summaryrefslogtreecommitdiff
path: root/BaseTools/Source
AgeCommit message (Collapse)Author
2017-09-05Remove core packages since we can get them from edk2 repositoryGuo Mang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
2015-08-28BaseTools: Fixed bug for single FV generating.Yingke Liu
If -i is specified and this FV has no BlockSize defined, tool did not inherit FD's BlockSize. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18339 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-27BaseTools:To generate string default type correctly in VfrCompilerDandan Bi
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18336 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-26BaseTools: Fix the missing depex file in GenFdsLiming Gao
If FDF FfsRule describes |.depex for depex file on source build, it may be missed in the generated FD image. GenFds tool needs to check the output file list and find the matched one. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18318 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-26BaseTools: Nested !include support in DSC and FDF filesCecil Sheng
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cecil Sheng <cecil.sheng@hp.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hp.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18317 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24BaseTools: Update SetPcdPtr in AutoGen CodeLiming Gao
For patchable PCD, map SetPcdPtr() to LibPatchPcdSetPtrAndSize(), then the size of the updated VOID* value can be cached. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18272 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24BaseTools: Fix AutoGen issue for Patchable VOID* PCD.Liming Gao
Patchable VOID* PCD set operation should map LibPatchPcdSetPtr() and LibPatchPcdSetPtrS() API. This has been done when PCD is used in driver, but not done when PCD is used in library. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18271 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24BaseTools: Generate macro for the size of PCD valueBob Feng
PcdLib introduces new APIs to get the size of PCD value. BaseTools generates those macros in AutoGen code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18270 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24BaseTools: Add NULL pointer check in AutoGen codeLiming Gao
For DynamicEx PCD, if NULL pointer is specified as token space GUID, it will directly be used to compare GUID value in AutoGen code. To avoid access NULL pointer, NULL pointer will be checked first. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18267 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24BaseTools/Ecc: Remove checkpoint for STATIC modifierHess Chen
Remove checkpoint for STATIC modifier to allow this usage Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18264 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24BaseTools: Follow PI spec to update ExtendedSize in EFI_FFS_FILE_HEADER2Star Zeng
for FFS data above 16 bytes alignment requirement. PI spec requires FFS header to be at 8 bytes alignment to FV header. And, FFS data alignment requires the beginning of the file data must be aligned on a particular boundary, such as 1, 16, 128 bytes or above. If FFS data alignment requires to be above 16 bytes, and FFS header must be at 8 byte alignment, so FFS header size must be multiple of 8. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18262 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-21BaseTools: Fix build fail when the number in validlist is long type.Bob Feng
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Bob Feng" <bob.c.feng@intel.com> Reviewed-by: "Chen, Hesheng" <hesheng.chen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18256 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-12BaseTools: add ARCH detection for AARCH64 and ARMArd Biesheuvel
Add auto detection for the ARCH variable for AARCH64 and ARM systems. This allows us to do a native build of the BaseTools without the need to set ARCH externally. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18206 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-12BaseTools/GenFds: Fix 'NoneType' object is not iterable error.Qiu Shumin
When adding section VERSION in FDF file, for example: FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) { SECTION RAW = MdeModulePkg/Logo/Logo.bmp SECTION UI = "Logo" SECTION VERSION = "0001" } GenFds will report the following error: Traceback (most recent call last): File "GenFds.py", line 276, in main File "GenFds.py", line 391, in GenFd File "Fd.py", line 93, in GenFd File "Region.py", line 106, in AddToBuffer File "Fv.py", line 114, in AddToBuffer File "FfsFileStatement.py", line 117, in GenFfs File "VerSection.py", line 80, in GenSection File "GenFdsGlobalVariable.py", line 401, in GenerateSection TypeError: 'NoneType' object is not iterable. We found in GenFdsGlobalVariable.py line 401 'list' requires a iteralbe object as parameter while the 'Input' is None. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18205 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-10BaseTools/GenFw: allow AArch64 tiny and small code model relocationsArd Biesheuvel
The AArch64 small C model makes extensive use of ADRP/ADD and ADRP/{LDR,STR} pairs to emit PC-relative symbol references with a +/- 4 GB range. Since the relocation pair splits the relative offset into a relative page offset and an absolute offset into a 4 KB page, we need to take extra care to ensure that the target of the relocation preserves its alignment relative to a 4 KB alignment boundary. Also, due to a problem with the --emit-relocs GNU ld option, where it does not recalculate the addends for section relative relocations, the only way to guarantee correct code is by requiring the relative section offset to be equal in the ELF and PE/COFF versions of the binary. This affects both the 'tiny' and 'small' GCC code models. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18197 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-06BaseTools/Trim: Fixed a bug that cannot trim long valuesYingke Liu
The long value substitution must move to the front of HEX substitution, and updated build_rule to add --trim-long Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18170 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-28BaseTools: Add a keyword FvNameString in FDFYingke Liu
The keyword with value TRUE OR FALSE is used to indicate whether the FV UI name is included in FV EXT header as a entry or not. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18090 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-27BaseTools/GenFv: optimize away redundant paddingArd Biesheuvel
To prevent double padding of XIP modules leading to excessive waste of FV space, try to adjust existing padding rather than adding more. Instead of adding a pad file to the FV to line up an FFS file that itself may contain padding to line up the payload, try to find a dedicated padding section inside the FFS, and reduce its size to place all subsequent aligned FFS section at their respective minimum alignments. When using 4 KB section alignment (which is required on AARCH64 in some cases), this will save 4 KB for each XIP module. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18080 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-27BaseTools: use GUID identifiable section for FFS alignment paddingArd Biesheuvel
Instead of using an anonymous section of type EFI_SECTION_RAW to pad out the first aligned FFS section to its required alignment, use a section with a dedicated GUID if the size of the padding permits it. This allows for more flexibility when placing such FFS images in a firmware volume, because we will now be able to remove padding rather than add more, by shrinking the size of this section instead of padding out the start of the FFS image to file alignment. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18079 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-27BaseTools/GenFw: move PE/COFF header closer to payloadArd Biesheuvel
The secondary header (not the DOS header) of a PE/COFF binary does not reside at a fixed offset. Instead, its offset into the file is recorded in the DOS header. This gives us the flexibility to move it, along with the section headers, to right before the first section if there is considerable space before it, i.e., when the PE/COFF file alignment is substantially larger than the size of the header. Since the PE/COFF to TE conversion replaces everything before the section headers with a simple TE header, this change removes all the header padding from such images, leading to smaller files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18078 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-27BaseTools/GenFw: move .debug contents to .data to save spaceArd Biesheuvel
In order to reduce the memory footprint of PE/COFF images when using large values for the PE/COFF section alignment, move the contents of the .debug section to data, and point the debug data directory entry to it. This allows us to drop the .debug section entirely, as well as any associated rounding. Since our .debug section only contains the filename of the ELF input image, the penalty of keeping this data in a non-discardable section is negligible. Note that the PE/COFF spec v6.3 explicitly mentions that this is allowed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18077 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-26BaseTools: Make AutoGen.h array declaration match AutoGen.c definitionScott Duplichan
When a quoted string is used as initialization data in a DEC file PCD entry, the PCD data type in that entry must be VOID*. The created AutoGen.c defines the PCD data as UINT8[] or UINT16[], depending on the string type. The created AutoGen.h, however, declares the PCD data as VOID*. For a standard compile/link, this works because AutoGen.c doesn't include AutoGen.h. But when GCC LTO is used, the link time code generation detects the mismatch and the build fails. This change makes the AutoGen.h PCD data declaration match the AutoGen.c definition. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18058 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-26BaseTools/Common: fix heap overrun in ReadMemoryFileLine ()Ard Biesheuvel
ReadMemoryFileLine () appends a NULL character to the string it returns, but it failed to account for it in the allocation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18047 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-16BaseTools: Fixed incorrect alignment bug.Yingke Liu
The alignment in rule section is shared by modules to generate FFS, it should not be modified by certain module. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18016 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-14BaseTools/PeCoffLib: handle EFI_IMAGE_REL_BASED_DIR64 in generic codeArd Biesheuvel
Relocations of type EFI_IMAGE_REL_BASED_DIR64 are handled in exactly the same way on all 64-bit machine types (IPF, X64 and AARCH64). So move the handling of this type to the generic part of the relocation routine PeCoffLoaderRelocateImage (). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17942 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08BaseTools/Upt: Add a BOM check for UNI file and fix some help message errorHess Chen
Add a BOM check for UNI file and fix some help message error Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17876 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08BaseTools/Upt: Update UPT to ignore "!include" statement when parsing UNI fileHess Chen
Update UPT to ignore "!include" statement when parsing UNI file Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17872 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08BaseTools: Fix build on FreeBSD and allow use of non-gcc system compilerBruce Cran
On FreeBSD, uuid.h is in /usr/include, not /usr/include/uuid. Fix some errors when building using clang caused by self-assignment: the preferred way to 'use' a variable is '(void)x;', not 'x = x;'. Where the system provides $(CC) etc. by default, don't override it to be gcc. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bruce Cran <bruce@cran.org.uk> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17866 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-06BaseTools/Build: Fix the range expression evaluation error.Bob Feng
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Bob Feng" <bob.c.feng@intel.com> Reviewed-by: "Chen, Hesheng" <hesheng.chen@intel.com> Reviewed-by: "Liu, Yingke D" <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17822 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02BaseTools/Ecc: Fix a bug when checking copyright formatHess Chen
Fix a bug to only checking the copyright listed in config.ini file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17801 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02BaseTools/Ecc: Fix a bug to get correct member variableHess Chen
Fix a bug to get correct member variable by ignoring 'OPTIONAL' modifier Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17800 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02BaseTools: Fixed BuildOptions bug.Yingke Liu
The BuildOptions in an INF should also follow override rule: If '==' is used, all previous options are overridden. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17796 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01BaseTools: Add missing EfiPersistentMemory to EFI_MEMORY_TYPESamer El-Haj-Mahmoud
To sync with the EFI_MEMROYT_TYPE definition in MdePkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17792 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01BaseTools: Checked return value of malloc for EfiCompress.Yingke Liu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17775 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01BaseTools: Do not create an empty file if Rsa2048Sha256Sign was failed.Yingke Liu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17774 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-29BaseTools: Update GenFw to support 4K alignment.Ard Biesheuvel
Get maximum section alignment from each ELF section, and this alignment is used to create PE header. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17727 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Fix a bug of determining boolean variable incorrectlyHess Chen
Fix a bug of determining boolean variable incorrectly in C parser Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17711 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Fix two bugs for the checkpoint of GUIDHess Chen
a) Fix a bug of displaying wrong format of a GUID b) Fix a bug of setting wrong exception keyword Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17710 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Fix a bug in parserHess Chen
Fix a bug to not break when parsing a macro and not find its value Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17709 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Add a checkpoint for invalid DEC file.Hess Chen
Add a checkpoint to check whether a header file in 'include' directory is defined in DEC file Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17708 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Add a checkpoint for invalid PCD info.Hess Chen
Add a checkpoint to check invalid format of @ValidRange, @ValidList and @Expression for a PCD Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17707 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Add a checkpoint for invalid UNI file.Hess Chen
Add a checkpoint to check that the UNI file which is associated by INF or DEC file need define the prompt and help information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17706 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-25BaseTools/Ecc: Add a Configuration itemHess Chen
Add a ‘SkipFileList’ in config.ini to exclude the files not be scanned. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: YangX Li <yangx.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17705 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools/UniClassObject: Support UTF-8 string data in .uni filesJordan Justen
This allows .uni input files to be encoded with UTF-8. Today, we only support UTF-16 encoding. The strings are still converted to UCS-2 data for use in EDK II modules. (This is the only unicode character format supported by UEFI and EDK II.) Although UTF-8 would allow any UCS-4 character to be present in the source file, we restrict the entire file to the UCS-2 range. (Including comments.) This allows the files to be converted to UTF-16 if needed. v2: * Drop .utf8 extension. Use .uni file for UTF-8 data (mdkinney) * Merge in 'BaseTools/UniClassObject: Verify string data is 16-bit' commit v3: * Restrict the entire file's characters (including comments) to the UCS-2 range in addition to string data. (mdkinney) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17696 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools/UniClassObject: Verify valid UCS-2 chars in UTF-16 .uni filesJordan Justen
Supplementary Plane characters can exist in UTF-16 files, but they are not valid UCS-2 characters. For example, refer to this python interpreter code: >>> import codecs >>> codecs.encode(u'\U00010300', 'utf-16') '\xff\xfe\x00\xd8\x00\xdf' Therefore the UCS-4 0x00010300 character is encoded as two 16-bit numbers (0xd800 0xdf00) in a little endian UTF-16 file. For more information, see: http://en.wikipedia.org/wiki/UTF-16#U.2B10000_to_U.2B10FFFF This means that our current BaseTools code could be allowing unsupported UTF-16 characters be used. To fix this, we decode the file using python's utf-16 decode support. Then we verify that each character's code point is 0xffff or less. v3: * Based on Mike Kinney's feedback, we now read the whole file and verify up-front that it contains valid UCS-2 characters. Thanks also to Laszlo Ersek for pointing out the Supplementary Plane characters. v4: * Reject code points in 0xd800-0xdfff range since they are reserved for UTF-16 surrogate pairs. (lersek) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17694 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools/EdkLogger: Support unit tests with a SILENT log levelJordan Justen
This allows the unit tests to run without the errors logging to the screen. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17692 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools: Convert ".\\" to "" in FilePathLiming Gao
Convert ".\\" to "", because it doesn't work with WINDOWS_EXTENSION_PATH. WINDOWS_EXTENSION_PATH can support the file path larger than 260 length. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17686 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools/Build: Add error report for incorrect syntax in DEC file.Bob Feng
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Bob Feng" <bob.c.feng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17685 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools: The token values cannot be numeric same with different PCDs.Yingke Liu
Current check only compared string format of toke value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17682 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-23BaseTools: Fixed a bug that Build Report always uses DEC default value for ↵Yingke Liu
VPD PCD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17681 6f19259b-4bc3-4df7-8a09-765794883524