[edk2] [PATCH 1/1] BaseTools: Sync MdePkg/Library/UefiDevicePathLib/DevicePathToText.c code

2018-10-26 Thread Feng, YunhuaX
Sync MdePkg/Library/UefiDevicePathLib/DevicePathToText.c code Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/C/DevicePath/DevicePath.c | 2 +- BaseTools/Source/C/DevicePath/DevicePathFromText.c |

[edk2] [PATCH 1/1] BaseTools: Roll back code modify by commit 9e47e6f90880

2018-10-26 Thread Feng, YunhuaX
Roll back code modify by commit 9e47e6f90880, if ForceRebase not False or True, the GenFv command not need add parameter Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH 1/1] BaseTools: Use VENDOR_DEVICE_PATH structure for Debug Port device path

2018-10-25 Thread Feng, YunhuaX
Copy code from Commit 9343d0a1cd09544686b14dba5b428d7bc811f6b9 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/C/DevicePath/DevicePath.c | 2 +- BaseTools/Source/C/DevicePath/DevicePathFromText.c |

[edk2] [PATCH 1/1] BaseTools: Fix BPDG tool print traceback info issue

2018-10-24 Thread Feng, YunhuaX
Fix BPDG tool print traceback info issue and remove abundant code Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/BPDG/BPDG.py | 5 - BaseTools/Source/Python/Common/VpdInfoFile.py | 5

Re: [edk2] [PATCH] BaseTools: covert "unicode string" to "byte array" if value type diff.

2018-10-17 Thread Feng, YunhuaX
Unicode string should be start with 'L"' or "L'", but like as "Less" is not Unicode string > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Carsey, Jaben > Sent: Thursday, October 18, 2018 2:49 AM > To: Laszlo Ersek ; Zhao, ZhiqiangX > >

[edk2] [PATCH 1/1] BaseTools: Fix regression boot hang issue by commit 0e982cf03dd5

2018-10-15 Thread Feng, YunhuaX
Fix regression boot hang issue by commit 0e982cf03dd5023b90def60c3656e5e18135ebac Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/Fv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[edk2] [PATCH] BaseTools: Regression bug Linux script used windows line format

2018-09-13 Thread Feng, YunhuaX
regression by 15e20228258c1714cd90207a52101a5b1b54cd2c and 9f3594782de9051cbf599f9af006903ed3f6669e Linux execute script must use '\n' not '\r\n' for end of line Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH V2] BaseTools: Fix regression issue by b23414f6540d

2018-08-20 Thread Feng, YunhuaX
V2: Renaming function DepexExpressionTokenList to DepexExpressionDict instead of changing the callers Fix regression issue by b23414f6540d4f336b6f00b44681911d469f9a04 AttributeError: 'ModuleAutoGen' object has no attribute 'DepexExpressionDict' Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH] BaseTools: Fix regression issue by b23414f6540d

2018-08-20 Thread Feng, YunhuaX
Fix regression issue by b23414f6540d4f336b6f00b44681911d469f9a04 AttributeError: 'ModuleAutoGen' object has no attribute 'DepexExpressionDict' Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH 3/3] BaseTools: Use hashlib instead of md5

2018-08-08 Thread Feng, YunhuaX
Use from hashlib import md5 instead of import md5 due to md5 deprecated in python3 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py | 4 ++--

[edk2] [PATCH 2/3] BaseTools: remove cmp due to deprecated in python3

2018-08-08 Thread Feng, YunhuaX
remove cmp due to deprecated in python3 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 +++--- BaseTools/Source/Python/BPDG/GenVpd.py | 4 ++-- 2 files changed, 5

[edk2] [PATCH 1/3] BaseTools: Modify class OrderedListDict

2018-08-08 Thread Feng, YunhuaX
class OrderedListDict(OrderedDict, defaultdict) will encounter multiple bases have instance lay-out conflict error on python3 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH 0/3] Optimizing code

2018-08-08 Thread Feng, YunhuaX
Modify class OrderedListDict, remove cmp and use hashlib instead of md5 Yunhua Feng (3): BaseTools: Modify class OrderedListDict BaseTools: remove cmp due to deprecated in python3 BaseTools: Use hashlib instead of md5 BaseTools/Source/Python/AutoGen/AutoGen.py| 6 +++---

[edk2] [PATCH] BaseTools: Check GUID C structure format

2018-08-08 Thread Feng, YunhuaX
GUID C format must conform to {8,4,4,{2,2,2,2,2,2,2,2}} Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/Common/GlobalData.py | 7 +++ BaseTools/Source/Python/Common/Misc.py | 4 +++- 2

[edk2] [PATCH] BaseTools: Remove duplicate function declaration

2018-08-07 Thread Feng, YunhuaX
Remove duplicate function declaration Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/C/DevicePath/UefiDevicePathLib.h | 7 --- 1 file changed, 7 deletions(-) diff --git

[edk2] [PATCH] BaseTools: Fix report flexible value issue

2018-08-07 Thread Feng, YunhuaX
Report flexible value in INF file encounter error Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/build/BuildReport.py | 5 + 1 file changed, 5 insertions(+) diff --git

[edk2] [PATCH] BaseTools:Fix incorrect %EDK_TOOLS_PATH%

2018-08-06 Thread Feng, YunhuaX
For non-root folder, such as "X:\bp", the EDK_TOOLS_PATH will resolve to "X:\bp\edk2\BaseTools". This is OK. But if WORKSPACE is at a root folder, such as "X:\", the EDK_TOOLS_PATH will look like "X:\\BaseTools". The *double backslash* can fail the command like "del" and thus affect the

[edk2] [PATCH] BaseTools: Optimizing code for function doesn't match

2018-08-05 Thread Feng, YunhuaX
Optimizing code for function doesn't match name and comment Fix https://bugzilla.tianocore.org/show_bug.cgi?id=924 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/AutoGen/BuildEngine.py | 30

[edk2] [PATCH] BaseTools: Debug message make confused

2018-08-05 Thread Feng, YunhuaX
Debug message make confused Fix https://bugzilla.tianocore.org/show_bug.cgi?id=995 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- 1 file changed, 1 insertion(+), 1

[edk2] [PATCH] BaseTools: Use gGuidPattern for Guid regular expression

2018-08-05 Thread Feng, YunhuaX
Use GlobalData.py gGuidPattern for Guid regular expression Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/GenFds/GenFds.py | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[edk2] [PATCH] BaseTools: Fix the different token with the same PCD

2018-07-20 Thread Feng, YunhuaX
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

[edk2] [PATCH 3/3] BaseTools: fix --genfds-multi-thread generate makefile issue

2018-04-09 Thread Feng, YunhuaX
1. when inf file is binary module, not generate makefile, so need generate ffs with previous method. 2. generate Ui section maybe override and the string is not $(MODULE_NAME) like as: INF RuleOverride = UI MdeModulePkg/Application/UiApp/UiApp.inf 3. Trim generate incorrect Offset.raw

[edk2] [PATCH 2/3] BaseTools: argument genfds-multi-thread create GenSec command issue

2018-04-09 Thread Feng, YunhuaX
Issue: genfds-multi-thread create makefile before section file generation, so it get alignment is zero from empty file. It is incorrect. solution: GenSec get section alignment from input file when the input alignment is zero. Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH 1/3] BaseTools: Correct GenSec argument dummy free memory issue

2018-04-09 Thread Feng, YunhuaX
Free DummyFileBuffer and set DummyFileBuffer to NULL. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/C/GenSec/GenSec.c | 3 ++- 1

[edk2] [PATCH] BaseTools: Remove EdkIIWorkspaceBuild.py from source code

2018-04-03 Thread Feng, YunhuaX
Remove EdkIIWorkspaceBuild.py from source code Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- .../Source/Python/Common/EdkIIWorkspaceBuild.py| 1670

[edk2] [PATCH] BaseTools: argument genfds-multi-thread create GenSec command issue

2018-03-26 Thread Feng, YunhuaX
Issue: genfds-multi-thread create makefile before section file generation, so it get alignment is zero from empty file. It is incorrect. solution: GenSec get section alignment from input file when the input alignment is zero. Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH] BaseTools: Correct GenSec argument dummy free memory issue

2018-03-26 Thread Feng, YunhuaX
Free DummyFileBuffer and set DummyFileBuffer to NULL. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/C/GenSec/GenSec.c | 3 ++- 1

[edk2] [PATCH] BaseTools: --hash --binary-destination generate wrong binary path

2018-03-16 Thread Feng, YunhuaX
Option --hash --binary-destination generate Binaries section in the inf file, but the path of ASL file is begin with Output directory, so need replace Output directory with '', will get the file name RamDisk.aml Incorrect AML file path in inf file on linux: [Binaries.X64] PE32|RamDiskDxe.efi

[edk2] [PATCH] BaseTools: Fix parse OFFSET_OF get wrong offset

2018-03-09 Thread Feng, YunhuaX
Fix parse OFFSET_OF get wrong offset Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/Common/Expression.py | 9 ++--- 1 file

[edk2] [PATCH] BaseTools: Dsc/Fdf conditional statement parse issue

2018-03-01 Thread Feng, YunhuaX
Set PCD value with --pcd argument not replace DSC/Fdf PCD value. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH] BaseTools: Dsc conditional statement parse issue

2018-03-01 Thread Feng, YunhuaX
Set PCD value with --pcd argument not replace DSC PCD value. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH] BaseTools: report error if flag in LABEL() invalid

2018-03-01 Thread Feng, YunhuaX
Flag in LABEL() is not valid C variable name, will report error Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH] BaseTools: GlobalData.gConfDirectory is None when run GenFds

2018-02-28 Thread Feng, YunhuaX
When run GenFds, GlobalData.gConfDirectory is None, On Linux self._ToolChainFamily default Value is "MSFT", and then generate the wrong PcdValueInit Makefile Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1

[edk2] [PATCH] BaseTools: Fix eval parse string issue

2018-02-28 Thread Feng, YunhuaX
eval argument start with " or ', but it is unicode string, will encounter error: List = list(eval(Value)) # translate escape character File "", line 1 'jà=îµ¢Ã"Fà ^ SyntaxError: EOL while scanning string literal Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH V2]BaseTools: Fix flexible PCD single quote and double quote bugs

2018-02-27 Thread Feng, YunhuaX
V2: 1. Fix parse DSC file split PCD Value {'9','a','#'} build error 2. Fix parse --pcd gUefiOvmfPkgTokenSpaceGuid.test10="\'A\'" build error, If PCD type is UINT8 or UINT16 or UINT32 or UINT64 V1: 1. Argument --pcd format as below: Some examples that to match --pcd format and DSC format

[edk2] [PATCH] BaseTools: Fix report not used --pcd value incorrectly

2018-02-26 Thread Feng, YunhuaX
Argument --pcd gUefiOvmfPkgTokenSpaceGuid.test10=H"{1}", If the PCD is not used, report value {0x01, 0x00}, is incorrect. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng

[edk2] [PATCH] BaseTools: Fix flexible PCD single quote and double quote bugs

2018-02-26 Thread Feng, YunhuaX
1. Argument --pcd format as below: Some examples that to match --pcd format and DSC format --pcd DSC format L"ABC"L"ABC" "AB\\\"C" "AB\"C" "AB\tC" "AB\tC" "AB\\\'C"

[edk2] [PATCH] BaseTools: Update ValueExpressionEx for flexible PCD

2018-02-23 Thread Feng, YunhuaX
1. Byte array number should less than 0xFF. 2. Add SplitPcdValueString for PCD split Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---

[edk2] [PATCH] BaseTools: Fix parse flexible PCD value bugs

2018-02-22 Thread Feng, YunhuaX
1. UINT64 Value {"A", "B"}, the expect value 0x420041. 2. Byte array number should less than 0xFF. {256, 0xff} will report error because of 256 larger than 0xFF 3. comma in GUID() and DEVICE_PATH() split issue Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH] BaseTool: correct the generate compress section process

2018-02-09 Thread Feng, YunhuaX
First generate a dummy file with section alignment, then compress the dummy file to generate the compress file Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng

[edk2] [PATCH] BaseTools: Fix COMPRESS alignment incorrect issue

2018-02-05 Thread Feng, YunhuaX
Doesn't generate the correct alignment for the leaf section in the compression section. Below FFS rule doesn't work as the expectation. [Rule.Common.PEIM.PE32] FILE PEIM = $(NAMED_GUID) { PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex COMPRESS { PE32 PE32

[edk2] [PATCH] BaseTools: Fix flexible PCD DEVICE_PATH parse issue

2018-02-05 Thread Feng, YunhuaX
When the format of DEVICE_PATH have string, like as: {DEVICE_PATH("BBS(1,"AB",0)")} have string "AB", will get the wrong value. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng

[edk2] [PATCH] BaseTools: Report error GUID format if incorrectly

2018-02-04 Thread Feng, YunhuaX
Flexible GUID format support like these: 1. { GUID("11E13869-1896-4A07-8B21-D8B23DD2A2B4") } 2. { GUID({ 0x11e13869, 0x1896, 0x4a07,{ 0x8b, 0x21, 0xd8, 0xb2, 0x3d, 0xd2, 0xa2, 0xb4 } }) } 3. { GUID(gEfiBlockIoProtocolGuid) } Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH] BaseTools: Fix build argument --pcd for flexible format bugs

2018-02-04 Thread Feng, YunhuaX
Build argument --pcd flexible format, like as: 1. VOID* type gTokenSpaceGuid.Test=H"{flexible format}" gTokenSpaceGuid.Test=L"string" gTokenSpaceGuid.Test="string" gTokenSpaceGuid.Test=L'string' gTokenSpaceGuid.Test='string' 2. UINT8/UINT16/UINT32/UINT64 type gTokenSpaceGuid.Test=H"{flexible

Re: [edk2] [PATCH] BaseTools: Update Expression.py for VOID* support L'a' and 'a'

2018-02-02 Thread Feng, YunhuaX
sorry L'' and '' is single quote and not include any character, so we will report error message Any question, please let me know. Thanks. Best Regards Feng, Yunhua -Original Message- From: Yao, Jiewen Sent: Friday, February 2, 2018 9:45 PM To: Feng, YunhuaX <yunhuax.f...@intel.

Re: [edk2] [PATCH] BaseTools: Update Expression.py for VOID* support L'a' and 'a'

2018-02-02 Thread Feng, YunhuaX
ginal Message- From: Yao, Jiewen Sent: Friday, February 2, 2018 8:17 PM To: Feng, YunhuaX <yunhuax.f...@intel.com>; edk2-devel@lists.01.org Cc: Gao, Liming <liming@intel.com>; Yao, Jiewen <jiewen@intel.com> Subject: RE: [PATCH] BaseTools: Update Expression.py for V

[edk2] [PATCH] BaseTools: Update Expression.py for VOID* support L'a' and 'a'

2018-02-02 Thread Feng, YunhuaX
Type VOID* support L'a' and 'a', the value transfer to c style value. L'a' --> {0x61, 0x00} L'ab' --> {0x61, 0x00, 0x62, 0x00} 'a' --> {0x61} 'ab' --> {0x61, 0x62} when the value is L'' or '', will report error Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH] BaseTools: StructurePcd array Value support flexible format

2018-02-01 Thread Feng, YunhuaX
if StructurePcd set item value is array, support flexible format like as: gEfiStructuredPcdPkgTokenSpaceGuid.Test.Array | {flexible format} {flexible format} = {L"ABC"} | {L'ABC'} | {"ABC"} | {UINT8(0x10)} | {UINT16(0x10)} | {UINT32(0x10)} | {UINT64(0x10)} |

[edk2] [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug

2018-02-01 Thread Feng, YunhuaX
error message: PcdValueCommon.c: In function '__PcdGetPtr': PcdValueCommon.c:315:11: error: variable 'Byte' set but not used [-Werror=unused-but-set-variable] UINT8 Byte; ^ cc1: all warnings being treated as errors Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH] BaseTools: Optimizing DscDefaultValue process in BuildReport

2018-01-19 Thread Feng, YunhuaX
DscDefaultValue from Dsc file has been parsed by ValueExpressionEx when Dsc file parse, so only DscDefaultValue from FDF file need ValueExpressionEx parse Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1

[edk2] [PATCH] BaseTools: Fix increment build bug

2018-01-18 Thread Feng, YunhuaX
Issue decription: step 1, build platform X64 step 2, build platform IA32 step 3, build platform X64 step 4, check all ffs files for X64, the content still has IA32 in it Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution

[edk2] [PATCH 1/2] BaseTools: Enable MAX_CONCURRENT_THREAD_NUMBER = 0 feature

2018-01-09 Thread Feng, YunhuaX
when set 'MAX_CONCURRENT_THREAD_NUMBER=0', will auto-detect number of processor threads for MAX_CONCURRENT_THREAD_NUMBER Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=775 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore

[edk2] [PATCH] BaseTools: Enable MAX_CONCURRENT_THREAD_NUMBER = 0 feature

2018-01-09 Thread Feng, YunhuaX
Adding 'MAX_CONCURRENT_THREAD_NUMBER=0' option for user to enable 'auto-detect thread number' feature, and changing default value to '0' when initial build environment is configured. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=775 Cc: Liming Gao Cc: Yonghong Zhu

[edk2] [PATCH 2/2] BaseTools: Modify MAX_CONCURRENT_THREAD_NUMBER default values

2018-01-09 Thread Feng, YunhuaX
Modify MAX_CONCURRENT_THREAD_NUMBER default values Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=775 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng

[edk2] [PATCH] BaseTools: Correct Target Path in CodaTargetList replace Path

2018-01-09 Thread Feng, YunhuaX
Target Path in CodaTargetList is DebugDir path, correct replace path with DebugDir Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng ---