[edk2] [PATCH V2] BaseTools: AutoGen and GenFds share the parser data.

2018-11-22 Thread Zhaozh1x
V2: Extract the common part of new API and the original main() function into one function. V1: https://bugzilla.tianocore.org/show_bug.cgi?id=1288 Currently, AutoGen and GenFds run in different python interpreters. The parser are duplicated. This patch is going to create new API for GenFds and ha

[edk2] [PATCH] BaseTools: AutoGen and GenFds share the parser data.

2018-11-20 Thread Zhaozh1x
https://bugzilla.tianocore.org/show_bug.cgi?id=1288 Currently, AutoGen and GenFds run in different python interpreters. The parser are duplicated. This patch is going to create new API for GenFds and have the build to call that API instead of executing GenFds.py. As such, the GenFds and build can

[edk2] [PATCH] BaseTools: Check the max size for string PCD.

2018-10-31 Thread Zhaozh1x
According to PCD_DATABASE_INIT in edk2\MdeModulePkg\Include\Guid\PcdDataBaseSignatureGuid.h, the max size for string PCD should not exceed USHRT_MAX 65535(0x). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng

[edk2] [PATCH] BaseTools:Not miss the full assign value of FixedAtBuild structure PCD

2018-10-24 Thread Zhaozh1x
For structure PCD, if it is a FixedAtBuild PCD, the full assign value in dsc file should not be missed when updating the structure PCD value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source

[edk2] [PATCH] BaseTools: Not convert the void* pcd string in command line to array.

2018-10-22 Thread Zhaozh1x
For void* type pcd in command line, if its value is string, code should not convert the void* pcd string in command line to array, otherwise it will make the pcd value in report not match its real raw value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc:

[edk2] [PATCH] BaseTools: add ASSERT checker for array buffer in fdf and command line

2018-10-22 Thread Zhaozh1x
For structure PCD in fdf file and command line, 1. use compiler time assert to check the array index, report error if array index exceeds the array number. 2. use compiler time assert to check the array size, report error if the user declared size in header file is smaller than the user used in fdf

[edk2] [PATCH] BaseTools:Translate the StructurePCD value in field to correct format.

2018-10-22 Thread Zhaozh1x
For StructurePCD value got from DSC file, translate its field value in to correct format in report. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source/Python/Workspace/DscBuildData.py | 7 ++--

[edk2] [PATCH V2] BaseTool: Support different PCDs that refers to the same EFI variable.

2018-10-18 Thread Zhaozh1x
V2: Make the code of patch both compatible for Python2 and Python3. V1: If different PCDs refer to the same EFI variable, then do EFI variable combination, according to the VariableOffset of different PCDS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc:

[edk2] [PATCH V2] BaseTools: Convert "Unicode string" to "byte array" if value type diff

2018-10-17 Thread Zhaozh1x
V2: Fixed 3 typo. Use startswith(('L"',"L'")) to check if a string is Unicode string. Use a set PcdValueTypeSet instead of a list PcdValueTypeList to save memory. V1: For the same one VOID* pcd, if the default value type of one SKU is "Unicode string", the other SKUs are "OtherVOID*"(ASCII string

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

2018-10-17 Thread Zhaozh1x
For the same one VOID* pcd, if the default value type of one sku is "unicode string", the other skus are "OtherVOID*"(ascii string or byte array),Then covert "unicode string" to "byte array". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc:

[edk2] [PATCH] BaseTool: Support different PCDs that refers to the same EFI variable.

2018-10-10 Thread Zhaozh1x
If different PCDs refer to the same EFI variable, then do EFI variable combination, according to the VariableOffset of different PCDS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source/Python

[edk2] [PATCH] BaseTools:Fix issue caused by 84a52d4d030185a44f2d8736142c6f0b19c6e9b1

2018-09-26 Thread Zhaozh1x
The commit 84a52d4d030185a44f2d8736142c6f0b19c6e9b1 will introduce the new issue "Invalid offset value for Dynamic Vpd PCD". This patch will fix the new issue, add 'DEFAULT' sku in to the AvailableSkuIdSet variable. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Z

[edk2] [PATCH] BaseTools: Convert string value of void* pcd in command line to array.

2018-09-26 Thread Zhaozh1x
For void* type pcd in command line, if its value is string, then convert the string value to array format. For example, build --pcd gUefiOvmfPkgTokenSpaceGuid.PcdTest="c", convert the pcd value from "c" to "{0x63,0x00}". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiqia

[edk2] [PATCH V3] BaseTools: add ASSERT checker for array buffer value assignment.

2018-09-24 Thread Zhaozh1x
V3: Update the error message for array checker. V2: 1. Add comments for each ASSERT. 2. ASSERT need to skip the case of array size of array as zero. For example, TestArray[] in struct in header file. V1: For structure PCD, 1. use compiler time assert to check the array index, report error if array

[edk2] [PATCH] BaseTools: Unused StructurePcd value is not requried to be calculated.

2018-09-16 Thread Zhaozh1x
Now, BaseTools always calculates StructurePcd value only if it is declared in DEC file. In fact, it only needs to calculate StructurePcd value only when this PCD is used by any module. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yongho

[edk2] [PATCH V2] BaseTools: Latter full value should overwrite the former field value.

2018-09-12 Thread Zhaozh1x
For structure Pcd, the latter full assign value in commandLine should override the former field assign value. For example in commandLine, build --pcd Token.pcd.field="haha" --pcd Token.pcd=H"{0x01,0x02}", the former field value "haha" will be ignored and overwrite by the latter full value "{0x01,0x

[edk2] [PATCH V2] BaseTools: Check the array index and the array size of structure PCD.

2018-09-12 Thread Zhaozh1x
V2: 1. Add comments for each ASSERT. 2. ASSERT need to skip the case of array size of array as zero. For example, TestArray[] in struct in header file. V1: For structure PCD, 1. use compiler time assert to check the array index, report error if the buffer overflow happens. 2. use compiler time ass

[edk2] [PATCH] BaseTools: Correct the SkuOverwrite.

2018-09-11 Thread Zhaozh1x
StructurePcd, SkuA does not define any structure pcd overwrite, But SkuA inherit from DEFAULT sku, and DEFAULT sku define structure pcd overwrite, the pcd value of SkuA should same with DEFAULT sku. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming G

[edk2] [PATCH] BaseTools: pcd in commandLine.

2018-09-11 Thread Zhaozh1x
In command line, the latter full assign value in commandLine should override the former field assign value. For example, --pcd Token.pcd.field="" --pcd Token.pcd=H"{}". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob

[edk2] [PATCH] BaseTools: Correct DXE_PCD_DATABASE_INIT.

2018-09-05 Thread Zhaozh1x
Add the handle of PCD_DATABASE_INIT and PCD_DATABASE_UNINIT for Boolean type pcd. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 2 +- 1 file changed, 1 insert

[edk2] [PATCH] BaseTools: Check the index of array.

2018-09-04 Thread Zhaozh1x
For structure PCD, add the checker for the ARRAY element assignment and Buffer FieldSize. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source/C/Common/PcdValueCommon.h| 7 +++ BaseT

[edk2] [PATCH] BaseTools: SKU inheritance.

2018-09-04 Thread Zhaozh1x
If the SkuB’s parent SkuA is not in SKUID_IDENTIFIER, then make SkuB inherit from SkuA as if the SKUID_INDENTIFIER is ALL. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- BaseTools/Source/Python/Workspace/D

[edk2] [PATCH] BaseTools: Check PcdNvStoreDefaultValueBuffer.

2018-09-04 Thread Zhaozh1x
Build tool should report warning if a platform defines [DefaultStores] but forgets to defined PcdNvStoreDefaultValueBuffer as PcdsDynamicExVpd in dsc file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng --- Ba