summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenC.py
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools: Add EDKII_DSC_PLATFORM_GUID MACROfengyunhua2020-10-131-0/+3
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2969 Add EDKII_DSC_PLATFORM_GUID MACRO to AutoGen.h and AutoGen.c Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Tested-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: remove unnecessary calls of os.existFeng, Bob C2019-09-171-49/+50
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2101 This patch is going to remove unnecessary calls of os.exist() Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Improve the file saving and copying reliabilityShi, Steven2019-08-201-0/+0
| | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2079 The Basetool CopyFileOnChange() and SaveFileOnChange() functions might raise the IOError occasionally when build in Windows with multi-process and build cache enabled. The CopyFileOnChange() and SaveFileOnChange() might be invoked in multiple sub-processes simultaneously, and this patch adds global locks to sync these functions invoking which can harden their reliability. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Enable Multiple Process AutoGenFeng, Bob C2019-08-091-2/+2
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 Assign the Module AutoGen tasks into multiple sub process. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Decouple AutoGen ObjectsFeng, Bob C2019-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 1. Separate the AutoGen.py into 3 small py files. One is for AutoGen base class, one is for WorkspaceAutoGen class and PlatformAutoGen class, and the one for ModuleAutoGen class. 2. Create a new class DataPipe to store the Platform scope settings. Create a new class PlatformInfo to provide the same interface as PlatformAutoGen. PlatformInfo class is initialized by DataPipe instance. Create a new class WorkspaceInfo to provide the same interface as WorkspaceAutoGen. WorkspaceInfo class is initialized by DataPipe instance. 3. Change ModuleAutoGen to depends on DataPipe, PlatformInfo and WorkspaceInfo. Remove the dependency of ModuleAutoGen to PlatformAutoGen. Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add HOST_APPLICATION module type.Jiewen Yao2019-07-121-11/+12
| | | | | | | | | | | It can be used to indicate a module can be build to run as OS application and run in OS environment. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* Revert "BaseTools:BaseTools supports to the driver combination."Liming Gao2019-02-281-27/+5
| | | | | | | | | | | | | | | | | This reverts commit 838bc257bae3f9fc6723f41f3980f6cfbedb77e5. After further evaluation, there are the unclear behavior in for the driver combination feature. To not impact Q1 stable tag, remove it first. 1. If the drivers to be combined have the different PCD or library instance setting, build should not combine them and report build break. But this commit doesn't consider this case. 2. When start the sub driver fail, continue to start other sub driver. This behavior is required to be clarifed in build spec. 3. Unload the sub driver when the combined driver start fail. This case need to call the sub driver unload function for the driver start fail only. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTool/GenC: Fix build error when type is BASE or USER_DEFINED.Jiewen Yao2019-02-221-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1544 1) The GenC tool does not include the constructor/destructor for USER_DEFINED module. It should be included. Only constructor/destructor with BASE type is included here. The constructor/destructor with PEI/DXE/SMM type is still excluded to keep original behavior. 2) The GenC tool includes the UnloadImage code for BASE module. It should NOT be included. 3) The GenC tool uses EFI_STATUS and ASSERT_EFI_ERROR for BASE type. It should use RETURN_STATUS and ASSERT_RETURN_ERROR. 4) The GenC tool miss DebugLib.h for BASE or USER_DEFINED module AutoGen.c. Only Base.h is there. It should add Library/DebugLib.h. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:BaseTools supports to the driver combination.Fan, ZhijuX2019-02-201-5/+27
| | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1520 To save the image size without the compression, more than one drivers can be combined into single one. When more than one drivers are combined, their depex will be AND together. Below is the example to combine BootManagerPolicyDxe into DriverHealthManagerDxe. Besides this patch, BaseTools also needs to check the module type and make sure all module type are same. Otherwise, BaseTools will report the error. DRIVER INF has the parameter ENTRY_POINT LIBRARY INF has the parameter LIBRARY_CLASS Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Handle the bytes and str differenceFeng, Bob C2019-02-011-3/+3
| | | | | | | | | | | | | | | | Deal with bytes and str is different, remove the unicode(), correct open file parameter. Using utcfromtimestamp instead of fromtimestamp. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: the list and iterator translationFeng, Bob C2019-02-011-1/+1
| | | | | | | | | | | | | | In python3,The keys of the dictionary not a list,It needs to be converted Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Similar to octal data rectificationZhijux Fan2019-02-011-1/+1
| | | | | | | | | | | | | | In python3, if Value is octal data, the int(Value, 0) report an error Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: change the Division OperatorZhijux Fan2019-02-011-4/+4
| | | | | | | | | | | | | | | | | PEP 238 -- Changing the Division Operator x/y to return a reasonable approximation of the mathematical result of the division ("true division") x//y to return the floor ("floor division") Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:Similar to octal data rectificationZhijux Fan2019-02-011-0/+2
| | | | | | | | | | | | | | In python3, if Value is octal data, the int(Value, 0) report an error Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Remove unused logic for EDKIFeng, Bob C2019-01-141-56/+34
| | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350 Remove EDK module type support from BaseTools python code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: fix importsCarsey, Jaben2019-01-101-1/+1
| | | | | | | | | | | | | | | 1 - Some of these imports are cascaded from another file. Import them locally. 2 - Some of these imports are not used. Remove them. 3 - Some of these were missing the namespace used to import them. These changes facilitate optimization of BaseTools: https://bugzilla.tianocore.org/show_bug.cgi?id=42 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* Revert BaseTools: PYTHON3 migrationLiming Gao2018-10-151-14/+12
| | | | | | | | | | | | | | This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52.. 678f85131238622e576705117e299d81cff755c9. Python3 migration is the fundamental change. It requires every developer to install Python3. Before this migration, the well communication and wide verification must be done. But now, most people is not aware of this change, and not try it. So, Python3 migration is reverted and be moved to edk2-staging Python3 branch for the edk2 user evaluation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix some build and report file issueYunhua Feng2018-10-131-1/+4
| | | | | | | | | | | | | | 1. increment build not skip make file when not change any file 2. report file generate abundant blank line 3. Build encounter Database is locked on some platform, using database auto commit 4. Fv BaseAddress must have if set Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: change the Division Operator in the expressionYunhua Feng2018-10-131-4/+4
| | | | | | | | | | | | | PEP 238 -- Changing the Division Operator x/y to return a reasonable approximation of the mathematical result of the division ("true division") x//y to return the floor ("floor division") Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: do the list and iterator translationYunhua Feng2018-10-131-3/+3
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Handle the bytes and str differenceYunhua Feng2018-10-131-3/+3
| | | | | | | | | | | Deal with bytes and str is different, remove the unicode() Using utcfromtimestamp instead of fromtimestamp. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove the "from __future__ import" itemsYunhua Feng2018-10-131-1/+0
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: refactor the error for PCD value is negative or exceed maxzhijufan2018-09-301-44/+13
| | | | | | | | | | | refactor the error handling for the PCD value that is negative or it exceed the max value. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: AutoGen refactor ModuleAutoGen cachingJaben Carsey2018-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Add a new file Common/caching.py a. Allows for automated caching of repeated class functions, class properties, and non-class functions b. When called the first time the value is cached and if called a second time, the cached result is called, not the function. c. When used, this saves lots of memory since the actual function pointers are replaced with smaller data elements. d. note that not all features are used yet. 2) Fix AutoGen/GenMake and AutoGen/GetC to not call into private member variables of ModuleAutoGen class a. use the existing accessor properties for the data 3) Change AutoGen classes to remove a exception for duplicate members in __new__ and use ?in? testing to speed up 4) Work on ModuleAutoGen class a. Change all properties that use caching to use @caching_property (see #1 above) b. Change all properties that do not use caching to use standard python decorator "@property" c. Change all cases where a dictionary/set/list/object was created and then immediately updated to use constructor parameters d. Refactor each property function to remove the internal variable that is no longer needed (this helps find items like #2 above) e. Refactor _ApplyBuildRule with optional parameter to work around circular dependency with BinaryFileList. Note that 4e was almost certainly unintended as the functions were acting on incomplete information since they were directly accessing private instance variables at the same time another function on the stack was creating the same private isntance data. This overall changes behavior slightly, but makes the codebase smaller and easier to read. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix the different token with the same PCDYunhua Feng2018-07-241-1/+1
| | | | | | | | | | | | | | | If the different token with the same PCD names are used in the driver, build can pass. If the different token with the same PCD name are used in the different library, then the driver build will fail. The reason is that the driver autogen.c is not generated correctly for the second case. BaseTools should check the duplicated PCD name is the driver and its linked libraries. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Correct _PCD_PATCHABLE_TokenName_SIZE's valueYonghong Zhu2018-07-241-2/+1
| | | | | | | | | current if user use PatchPcdSetPtr in library, it will report the _PCD_PATCHABLE_TokenName_SIZE is not defined. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/AutoGen: Update header file for MM modules.Supreeth Venkatesh2018-07-231-8/+8
| | | | | | | | | | | | | This patch corrects the Module Type Header file for Management Mode(MM) as specified in PI v1.6 Specification. Also, it updates parameter for auto generated template functions from EFI_SMM_SYSTEM_TABLE2 to EFI_MM_SYSTEM_TABLE. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Use absolute import in AutoGenGary Lin2018-07-161-3/+4
| | | | | | | | | | Based on "futurize -f libfuturize.fixes.fix_absolute_import Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools: Enable structure pcd in FDF fileBobCF2018-07-131-0/+4
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Clean up source filesLiming Gao2018-07-091-37/+37
| | | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Adjust the spaces around commas and colonsGary Lin2018-06-271-36/+36
| | | | | | | | | | Based on "futurize -f lib2to3.fixes.fix_ws_comma" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Enhance BaseTools supports FeaturePcd usage in VFR fileYonghong Zhu2018-06-221-2/+3
| | | | | | | | | | Bugzilla 348 only fixed FixedAtBuild Pcd type, now this patch also add support for FeaturePcd type. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=348 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: remove including Base.h if the module type is not BASEYonghong Zhu2018-06-141-3/+1
| | | | | | | | | According the module type to include the header file. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=867 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Cleanup unneeded codeJaben Carsey2018-06-131-1/+1
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Rename String to StringUtils.Marvin.Haeuser@outlook.com2018-05-281-1/+1
| | | | | | | | | | | | For case-insensitive file systems, edk2 String.py collides with the Python string.py, which results in build errors. This,for example, applies to building via the Windows Subsystem for Linux from a DriveFS file system. This patch renames String to StringUtils to prevent conflicts for case-insensitive file systems. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove the redundant codeYonghong Zhu2018-05-101-10/+0
| | | | | | | | | the ArraySize and Array already be got in line 1093, so this code are redundant. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools: Fix generating array's size is incorrect in AutoGen.cYunhua Feng2018-05-101-12/+13
| | | | | | | | | | | | | | | | | | | | | | case example: DSC: [PcdsFixedAtBuild] PcdToken.PcdName | "A" [Components] TestPkg/TestDriver.inf { PcdToken.PcdName | {0x41,0x42,0x43,0x44} } Generating the size of array is incorrect in AutoGen.c GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_PcdName[2] = {0x41,0x42,0x43,0x44}; Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=950 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: move PCD size calculation functions to PcdClassObjectCarsey, Jaben2018-05-041-31/+6
| | | | | | | | | | | move both GetPcdMaxSize and GetPcdSize to the PcdClassObject. fix MAX_SIZE_TYPE to have int values Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: remove redundant if comparisonCarsey, Jaben2018-05-021-1/+1
| | | | | | | | | | | | inherently python will check string and list for None and having data if <x> in [None, ''] and similar are superflous. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Replace Binary File type strings with predefined constantCarsey, Jaben2018-05-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | BINARY_FILE_TYPE_FW was 'FW' BINARY_FILE_TYPE_GUID was 'GUID' BINARY_FILE_TYPE_PREEFORM was 'PREEFORM' BINARY_FILE_TYPE_UEFI_APP was 'UEFI_APP' BINARY_FILE_TYPE_UNI_UI was 'UNI_UI' BINARY_FILE_TYPE_UNI_VER was 'UNI_VER' BINARY_FILE_TYPE_LIB was 'LIB' BINARY_FILE_TYPE_PE32 was 'PE32' BINARY_FILE_TYPE_PIC was 'PIC' BINARY_FILE_TYPE_PEI_DEPEX was 'PEI_DEPEX' BINARY_FILE_TYPE_DXE_DEPEX was 'DXE_DEPEX' BINARY_FILE_TYPE_SMM_DEPEX was 'SMM_DEPEX' BINARY_FILE_TYPE_TE was 'TE' BINARY_FILE_TYPE_VER was 'VER' BINARY_FILE_TYPE_UI was 'UI' BINARY_FILE_TYPE_BIN was 'BIN' BINARY_FILE_TYPE_FV was 'FV' v2 - split apart FV and GUID types with different meanings. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Replace PCD type strings with predefined constantCarsey, Jaben2018-05-021-2/+2
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: DataType - cleanup list constantsCarsey, Jaben2018-05-021-20/+15
| | | | | | | | | | | | remove unused ones convert lists used for membership testing to sets use shared ones not local ones Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Define and use a set for common listCarsey, Jaben2018-05-021-4/+4
| | | | | | | | | | share a set for both PEI module types Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: replace string constants used for module typesCarsey, Jaben2018-05-021-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | replace raw strings in the code (note: except UPT) with constants. SUP_MODULE_BASE was 'BASE' SUP_MODULE_SEC was 'SEC' SUP_MODULE_PEI_CORE was 'PEI_CORE' SUP_MODULE_PEIM was 'PEIM' SUP_MODULE_DXE_CORE was 'DXE_CORE' SUP_MODULE_DXE_DRIVER was 'DXE_DRIVER' SUP_MODULE_DXE_RUNTIME_DRIVER was 'DXE_RUNTIME_DRIVER' SUP_MODULE_DXE_SAL_DRIVER was 'DXE_SAL_DRIVER' SUP_MODULE_DXE_SMM_DRIVER was 'DXE_SMM_DRIVER' SUP_MODULE_UEFI_DRIVER was 'UEFI_DRIVER' SUP_MODULE_UEFI_APPLICATION was 'UEFI_APPLICATION' SUP_MODULE_USER_DEFINED was 'USER_DEFINED' SUP_MODULE_SMM_CORE was 'SMM_CORE' SUP_MODULE_MM_STANDALONE was 'MM_STANDALONE' SUP_MODULE_MM_CORE_STANDALONE was 'MM_CORE_STANDALONE' Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: replace 'UINT8','UINT16','UINT32','UINT64','VOID*' with shared ↵Carsey, Jaben2018-04-231-48/+46
| | | | | | | | | | constants. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: fix None comparisonsCarsey, Jaben2018-04-171-1/+1
| | | | | | | | | | | when comparing a list/string against None and empty, just compare the object. when comparing against None, dont use !=, ==, <> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: reduce list usage when not neededCarsey, Jaben2018-04-171-21/+27
| | | | | | | | | | | remove not needed lists. some were just counted and others should be sets. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix the bug for VOID* pcd max size from component sectionYonghong Zhu2018-04-101-1/+6
| | | | | | | | | | When the Pcd defined in components section, its value's size is larger than the value's size in [pcd] section, it cause build error, because original code use the size get in [pcd] section as max size. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix size override issue for Void* Patchable pcdYonghong Zhu2018-04-101-8/+12
| | | | | | | | | | when multiple driver link same library, and the drivers override the pcd to different value in the DSC component section, it cause the pcd size incorrect. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>