From nobody Fri Nov 1 12:33:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1516675728969119.60345424306638; Mon, 22 Jan 2018 18:48:48 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0FA7A22333784; Mon, 22 Jan 2018 18:43:21 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C488822333778 for ; Mon, 22 Jan 2018 18:43:18 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 18:48:45 -0800 Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga006.fm.intel.com with ESMTP; 22 Jan 2018 18:48:44 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,398,1511856000"; d="scan'208";a="197949421" From: BobCF To: edk2-devel@lists.01.org Date: Tue, 23 Jan 2018 10:48:41 +0800 Message-Id: <20180123024841.13224-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [edk2] [Patch] BaseTools: Support multiple .h file for structure Pcd declaration in DEC file. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 4 ++-- BaseTools/Source/Python/Workspace/DecBuildData.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 8 ++++---- BaseTools/Source/Python/Workspace/MetaFileParser.py | 4 +++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index e5f1f01556..0e3081cfc5 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -107,13 +107,13 @@ class PcdClassObject(object): # def __hash__(self): return hash((self.TokenCName, self.TokenSpaceGuidCName)) =20 class StructurePcd(PcdClassObject): - def __init__(self, StructuredPcdIncludeFile=3D"", Packages=3DNone, Nam= e=3DNone, Guid=3DNone, Type=3DNone, DatumType=3DNone, Value=3DNone, Token= =3DNone, MaxDatumSize=3DNone, SkuInfoList=3D{}, IsOverrided=3DFalse, GuidVa= lue=3DNone, validateranges=3D[], validlists=3D[], expressions=3D[],default_= store =3D TAB_DEFAULT_STORES_DEFAULT): + def __init__(self, StructuredPcdIncludeFile=3DNone, Packages=3DNone, N= ame=3DNone, Guid=3DNone, Type=3DNone, DatumType=3DNone, Value=3DNone, Token= =3DNone, MaxDatumSize=3DNone, SkuInfoList=3D{}, IsOverrided=3DFalse, GuidVa= lue=3DNone, validateranges=3D[], validlists=3D[], expressions=3D[],default_= store =3D TAB_DEFAULT_STORES_DEFAULT): super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Va= lue, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validaterang= es, validlists, expressions) - self.StructuredPcdIncludeFile =3D StructuredPcdIncludeFile + self.StructuredPcdIncludeFile =3D [] if StructuredPcdIncludeFile i= s None else StructuredPcdIncludeFile self.PackageDecs =3D Packages self.DefaultStoreName =3D [default_store] self.DefaultValues =3D collections.OrderedDict({}) self.PcdMode =3D None self.SkuOverrideValues =3D collections.OrderedDict({}) diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTools/= Source/Python/Workspace/DecBuildData.py index 01f716bfab..13fb8686b6 100644 --- a/BaseTools/Source/Python/Workspace/DecBuildData.py +++ b/BaseTools/Source/Python/Workspace/DecBuildData.py @@ -374,11 +374,11 @@ class DecBuildData(PackageBuildClassObject): for pcdname in s_pcd_set: dep_pkgs =3D [] struct_pcd =3D StructurePcd() for item,LineNo in s_pcd_set[pcdname]: if "" in item.TokenCName: - struct_pcd.StructuredPcdIncludeFile =3D item.DefaultVa= lue + struct_pcd.StructuredPcdIncludeFile.append(item.Defaul= tValue) elif "" in item.TokenCName: dep_pkgs.append(item.DefaultValue) elif item.DatumType =3D=3D item.TokenCName: struct_pcd.copy(item) struct_pcd.TokenValue =3D struct_pcd.TokenValue.strip(= "{").strip() diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 4a87fd1762..b042c4306a 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1455,14 +1455,14 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D PcdMainCHeader =20 Includes =3D {} for PcdName in StructuredPcds: Pcd =3D StructuredPcds[PcdName] - IncludeFile =3D Pcd.StructuredPcdIncludeFile - if IncludeFile not in Includes: - Includes[IncludeFile] =3D True - CApp =3D CApp + '#include <%s>\n' % (IncludeFile) + for IncludeFile in Pcd.StructuredPcdIncludeFile: + if IncludeFile not in Includes: + Includes[IncludeFile] =3D True + CApp =3D CApp + '#include <%s>\n' % (IncludeFile) CApp =3D CApp + '\n' =20 for PcdName in StructuredPcds: Pcd =3D StructuredPcds[PcdName] if not Pcd.SkuOverrideValues: diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index b2b0e282eb..7469cd7ab7 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1889,26 +1889,28 @@ class DecParser(MetaFileParser): self._ValueList[0] =3D self._CurrentStructurePcdName =20 if "|" not in self._CurrentLine: if "" =3D=3D self._CurrentLine: self._include_flag =3D True + self._package_flag =3D False self._ValueList =3D None return if "" =3D=3D self._CurrentLine: self._package_flag =3D True self._ValueList =3D None + self._include_flag =3D False return =20 if self._include_flag: self._ValueList[1] =3D "_" + md5.new(self= ._CurrentLine).hexdigest() self._ValueList[2] =3D self._CurrentLine - self._include_flag =3D False if self._package_flag and "}" !=3D self._CurrentLine: self._ValueList[1] =3D "_" + md5.new(self._C= urrentLine).hexdigest() self._ValueList[2] =3D self._CurrentLine if self._CurrentLine =3D=3D "}": self._package_flag =3D False + self._include_flag =3D False self._ValueList =3D None return else: PcdTockens =3D self._CurrentLine.split(TAB_VALUE_SPLIT) PcdNames =3D PcdTockens[0].split(TAB_SPLIT) --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel