From nobody Sun Apr 28 16:46:20 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 1521771851884808.8500158211873; Thu, 22 Mar 2018 19:24:11 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id ABA1B2252CBD3; Thu, 22 Mar 2018 19:17:37 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 6A56F2252CBAC for ; Thu, 22 Mar 2018 19:17:36 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2018 19:24:08 -0700 Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga005.fm.intel.com with ESMTP; 22 Mar 2018 19:24:07 -0700 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.136; helo=mga12.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.48,347,1517904000"; d="scan'208";a="214107376" From: BobCF To: edk2-devel@lists.01.org Date: Fri, 23 Mar 2018 10:24:03 +0800 Message-Id: <20180323022403.30156-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [edk2] [Patch] BaseTool: Fixed the issue of empty PcdDB. 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" If there is no dynamic pcds, there should be DB header in the Pcd DataBase. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/GenPcdDb.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index e2848e7aaf..e4d7f3b759 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -978,12 +978,10 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH): DbFile.write(PcdDbBuffer) Changed =3D SaveFileOnChange(DbFileName, DbFile.getvalue(), True) def CreatePcdDataBase(PcdDBData): delta =3D {} basedata =3D {} - if not PcdDBData: - return "" for skuname,skuid in PcdDBData: if len(PcdDBData[(skuname,skuid)][1]) !=3D len(PcdDBData[("DEFAULT= ","0")][1]): EdkLogger.ERROR("The size of each sku in one pcd are not same") for skuname,skuid in PcdDBData: if skuname =3D=3D "DEFAULT": @@ -1059,13 +1057,16 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platfo= rm,Phase): VarCheckTable =3D CreateVarCheckBin(VarCheckTableData) VarCheckTable.dump(dest, Phase) AdditionalAutoGenH, AdditionalAutoGenC =3D CreateAutoGen(PcdDrive= rAutoGenData) else: AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer,VarCheckTab = =3D CreatePcdDatabasePhaseSpecificAutoGen (Platform,{}, Phase) + final_data =3D () + for item in PcdDbBuffer: + final_data +=3D unpack("B",item) + PcdDBData[("DEFAULT","0")] =3D (PcdDbBuffer, final_data) =20 - PcdDbBuffer =3D CreatePcdDataBase(PcdDBData) - return AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer + return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDB= Data) ## Create PCD database in DXE or PEI phase # # @param Platform The platform object # @retval tuple Two TemplateString objects for C code and head= er file, # respectively --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel