From nobody Mon Dec 23 05:49:33 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 1519444943539559.7339240822822; Fri, 23 Feb 2018 20:02:23 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9CBD521CB2E20; Fri, 23 Feb 2018 19:56:19 -0800 (PST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 3AA1F2034D8FB for ; Fri, 23 Feb 2018 19:56:17 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2018 20:02:20 -0800 Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga002.fm.intel.com with ESMTP; 23 Feb 2018 20:02:19 -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=134.134.136.100; helo=mga07.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.47,386,1515484800"; d="scan'208";a="22708192" From: BobCF To: edk2-devel@lists.01.org Date: Sat, 24 Feb 2018 12:02:18 +0800 Message-Id: <20180224040218.14008-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [edk2] [Patch] BaseTool: GUID assignment fail. 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" Structure PCD GUID assignment fail. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/Workspace/DecBuildData.py | 3 ++- BaseTools/Source/Python/Workspace/DscBuildData.py | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTools/= Source/Python/Workspace/DecBuildData.py index 18101a0add..ee00ec0719 100644 --- a/BaseTools/Source/Python/Workspace/DecBuildData.py +++ b/BaseTools/Source/Python/Workspace/DecBuildData.py @@ -13,10 +13,11 @@ # from Common.String import * from Common.DataType import * from Common.Misc import * from types import * +from collections import OrderedDict =20 from Workspace.BuildClassObject import PackageBuildClassObject, StructureP= cd, PcdClassObject =20 ## Platform build information from DEC file # @@ -365,11 +366,11 @@ class DecBuildData(PackageBuildClassObject): self._Pcds.update(self._GetPcd(MODEL_PCD_DYNAMIC_EX)) return self._Pcds =20 =20 def ProcessStructurePcd(self, StructurePcdRawDataSet): - s_pcd_set =3D dict() + s_pcd_set =3D OrderedDict() for s_pcd,LineNo in StructurePcdRawDataSet: if s_pcd.TokenSpaceGuidCName not in s_pcd_set: s_pcd_set[s_pcd.TokenSpaceGuidCName] =3D [] s_pcd_set[s_pcd.TokenSpaceGuidCName].append((s_pcd,LineNo)) =20 diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 3246a2afd8..ae937dee46 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -37,10 +37,11 @@ from Common.Parsing import IsValidWord from Common.VariableAttributes import VariableAttributes import Common.GlobalData as GlobalData import subprocess from Common.Misc import SaveFileOnChange from Workspace.BuildClassObject import PlatformBuildClassObject, Structure= Pcd, PcdClassObject, ModuleBuildClassObject +from collections import OrderedDict =20 # # Treat CHAR16 as a synonym for UINT16. CHAR16 support is required for VF= R C structs # PcdValueInitName =3D 'PcdValueInit' @@ -1272,11 +1273,11 @@ class DscBuildData(PlatformBuildClassObject): if SkuName in SkuIds and "." in TokenSpaceGuid: S_PcdSet.append([ TokenSpaceGuid.split(".")[0],TokenSpaceG= uid.split(".")[1], PcdCName,SkuName, default_store,Dummy5, AnalyzePcdExpres= sion(Setting)[0]]) =20 # handle pcd value override StrPcdSet =3D self.GetStructurePcdInfo(S_PcdSet) - S_pcd_set =3D {} + S_pcd_set =3D OrderedDict() for str_pcd in StrPcdSet: str_pcd_obj =3D Pcds.get((str_pcd[1], str_pcd[0]), None) str_pcd_dec =3D self._DecPcds.get((str_pcd[1], str_pcd[0]), No= ne) if not isinstance (str_pcd_dec, StructurePcd): EdkLogger.error('build', PARSER_ERROR, @@ -1597,11 +1598,11 @@ class DscBuildData(PlatformBuildClassObject): if not FieldList: continue for FieldName in FieldList: FieldName =3D "." + FieldName IsArray =3D self.IsFieldValueAnArray(FieldList[FieldNa= me.strip(".")][0]) - if IsArray: + if IsArray and not (FieldList[FieldName.strip(".")][0]= .startswith('{GUID') and FieldList[FieldName.strip(".")][0].endswith('}')): try: Value =3D ValueExpressionEx(FieldList[FieldNam= e.strip(".")][0], "VOID*", self._GuidDict)(True) except BadExpression: EdkLogger.error('Build', FORMAT_INVALID, "Inva= lid value format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName, FieldName.strip('.'))), FieldList[FieldName.strip("."= )][1], FieldList[FieldName.strip(".")][2])) @@ -1627,11 +1628,11 @@ class DscBuildData(PlatformBuildClassObject): if not FieldList: continue for FieldName in FieldList: FieldName =3D "." + FieldName IsArray =3D self.IsFieldValueAnArray(FieldList= [FieldName.strip(".")][0]) - if IsArray: + if IsArray and not (FieldList[FieldName.strip(= ".")][0].startswith('{GUID') and FieldList[FieldName.strip(".")][0].endswit= h('}')): try: Value =3D ValueExpressionEx(FieldList[= FieldName.strip(".")][0], "VOID*", self._GuidDict)(True) except BadExpression: EdkLogger.error('Build', FORMAT_INVALI= D, "Invalid value format for %s. From %s Line %d " % (".".join((Pcd.TokenSp= aceGuidCName, Pcd.TokenCName, FieldName.strip('.'))), FieldList[FieldName.s= trip(".")][1], FieldList[FieldName.strip(".")][2])) @@ -1708,11 +1709,11 @@ class DscBuildData(PlatformBuildClassObject): # # Use memcpy() to copy value into field # CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, = %s);\n' % (Pcd.DatumType, FieldName) CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (self.IntToCString(Value, ValueSize), FieldList[FieldNa= me][1], FieldList[FieldName][2], FieldList[FieldName][0]) - CApp =3D CApp + ' memcpy (&Pcd->%s[0], Value, (Fi= eldSize > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSiz= e, ValueSize) + CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (Field= Size > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, = ValueSize) else: if ValueSize > 4: CApp =3D CApp + ' Pcd->%s =3D %dULL; // From = %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldL= ist[FieldName][2], FieldList[FieldName][0]) else: CApp =3D CApp + ' Pcd->%s =3D %d; // From %s = Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList= [FieldName][2], FieldList[FieldName][0]) @@ -1761,11 +1762,11 @@ class DscBuildData(PlatformBuildClassObject): # # Use memcpy() to copy value into field # CApp =3D CApp + ' FieldSize =3D __FIELD_S= IZE(%s, %s);\n' % (Pcd.DatumType, FieldName) CApp =3D CApp + ' Value =3D %s; // Fr= om %s Line %d Value %s\n' % (self.IntToCString(Value, ValueSize), FieldList= [FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0]) - CApp =3D CApp + ' memcpy (&Pcd->%s[0], Va= lue, (FieldSize > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, = ValueSize, ValueSize) + CApp =3D CApp + ' memcpy (&Pcd->%s, Value= , (FieldSize > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, Val= ueSize, ValueSize) else: if ValueSize > 4: CApp =3D CApp + ' Pcd->%s =3D %dULL; = // From %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1]= , FieldList[FieldName][2], FieldList[FieldName][0]) else: CApp =3D CApp + ' Pcd->%s =3D %d; // = From %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], F= ieldList[FieldName][2], FieldList[FieldName][0]) --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel