From a10def91653163dbc6a38a609a87b370e9035654 Mon Sep 17 00:00:00 2001 From: Yunhua Feng Date: Fri, 13 Jul 2018 17:05:20 +0800 Subject: BaseTools: enable FixedAtBuild (VOID*) PCD use in the [DEPEX] section V3: Add some invalid type and datum check V2: limit the PCD used in the [Depex] section should be used in the module The PCD item used in INF [Depex] section must be defined as FixedAtBuild type and VOID* datum type, and the size of the PCD must be 16 bytes. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=443 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/InfBuildData.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/InfBuildData.py') diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py index f79ffe28d8..29e68aeb3b 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -912,12 +912,22 @@ class InfBuildData(ModuleBuildClassObject): ExtraData=Token, File=self.MetaFile, Line=Record[-1]) DepexList.append(Module.Guid) else: - # get the GUID value now - Value = ProtocolValue(Token, self.Packages, self.MetaFile.Path) - if Value is None: - Value = PpiValue(Token, self.Packages, self.MetaFile.Path) + # it use the Fixed PCD format + if '.' in Token: + if tuple(Token.split('.')[::-1]) not in self.Pcds: + EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "PCD [{}] used in [Depex] section should be listed in module PCD section".format(Token), File=self.MetaFile, Line=Record[-1]) + else: + if self.Pcds[tuple(Token.split('.')[::-1])].DatumType != TAB_VOID: + EdkLogger.error('build', FORMAT_INVALID, "PCD [{}] used in [Depex] section should be VOID* datum type".format(Token), File=self.MetaFile, Line=Record[-1]) + Value = Token + else: + # get the GUID value now + Value = ProtocolValue(Token, self.Packages, self.MetaFile.Path) if Value is None: - Value = GuidValue(Token, self.Packages, self.MetaFile.Path) + Value = PpiValue(Token, self.Packages, self.MetaFile.Path) + if Value is None: + Value = GuidValue(Token, self.Packages, self.MetaFile.Path) + if Value is None: PackageList = "\n\t".join(str(P) for P in self.Packages) EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, -- cgit v1.2.3