summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/FfsInfStatement.py
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-03-03 09:12:18 +0800
committerLiming Gao <liming.gao@intel.com>2018-03-03 12:40:35 +0800
commit0537f332c968e6c3adeefa2222b5f1aa7252b711 (patch)
treed064a1ff2f493a00344021625baedb913f6cb8db /BaseTools/Source/Python/GenFds/FfsInfStatement.py
parent0e2a5749d89c96e3e17ea458365d2e5296c807e2 (diff)
downloadedk2-0537f332c968e6c3adeefa2222b5f1aa7252b711.tar.gz
edk2-0537f332c968e6c3adeefa2222b5f1aa7252b711.tar.bz2
edk2-0537f332c968e6c3adeefa2222b5f1aa7252b711.zip
BaseTools: DSC Components section support flexible PCD
DSC Components section support flexible PCD, and for binary driver, we need patch this value. Update the split char ',' not ', ' because some value may have space, while others may not have this space. 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> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FfsInfStatement.py')
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index b0b242be8d..dfff892e21 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -46,6 +46,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
import Common.GlobalData as GlobalData
from DepexSection import DepexSection
from Common.Misc import SaveFileOnChange
+from Common.Expression import *
## generate FFS from INF
#
@@ -279,6 +280,20 @@ class FfsInfStatement(FfsInfStatementClassObject):
if not DscOverride and not FdfOverride and not BuildOptionOverride:
continue
+
+ # Support Flexible PCD format
+ if DefaultValue:
+ try:
+ DefaultValue = ValueExpressionEx(DefaultValue, Pcd.DatumType, Platform._GuidDict)(True)
+ except BadExpression:
+ EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] Value "%s"' %(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, DefaultValue), File=self.InfFileName)
+
+ if Pcd.DefaultValue:
+ try:
+ Pcd.DefaultValue = ValueExpressionEx(Pcd.DefaultValue, Pcd.DatumType, Platform._GuidDict)(True)
+ except BadExpression:
+ EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] Value "%s"' %(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DefaultValue),File=self.InfFileName)
+
# Check value, if value are equal, no need to patch
if Pcd.DatumType == "VOID*":
if Pcd.DefaultValue == DefaultValue or DefaultValue in [None, '']: