From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 0FE252112E01A for ; Tue, 19 Jun 2018 01:15:21 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2018 01:15:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,242,1526367600"; d="scan'208";a="65331297" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 19 Jun 2018 01:15:21 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Jun 2018 01:15:21 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Jun 2018 01:15:21 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.87]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Tue, 19 Jun 2018 16:15:20 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing. Thread-Index: AQHUA4wI7pYBx3G+40idSXL6mN0b1aRnRCiw Date: Tue, 19 Jun 2018 08:15:20 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E298D00@SHSMSX104.ccr.corp.intel.com> References: <20180614030123.55508-1-bob.c.feng@intel.com> In-Reply-To: <20180614030123.55508-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 08:15:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Thursday, June 14, 2018 11:01 AM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing. > >When packing HiiPcd into PcdNvStoreDefaultValueBuffer, >The boolean type pcd value packing incorrect. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/AutoGen/GenVar.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py >b/BaseTools/Source/Python/AutoGen/GenVar.py >index 3675be8de9..bf3d225c21 100644 >--- a/BaseTools/Source/Python/AutoGen/GenVar.py >+++ b/BaseTools/Source/Python/AutoGen/GenVar.py >@@ -294,11 +294,11 @@ class VariableMgr(object): > if tail: > for value_char in tail.split(","): > Buffer +=3D pack("=3DB",int(value_char,16)) > data_len +=3D len(tail.split(",")) > elif data_type =3D=3D "BOOLEAN": >- Buffer +=3D pack("=3DB",True) if var_value.upper() =3D=3D "TR= UE" else >pack("=3DB",False) >+ Buffer +=3D pack("=3DB",True) if var_value.upper() in ["TRUE"= ,"1"] else >pack("=3DB",False) > data_len +=3D 1 > elif data_type =3D=3D DataType.TAB_UINT8: > Buffer +=3D pack("=3DB",GetIntegerValue(var_value)) > data_len +=3D 1 > elif data_type =3D=3D DataType.TAB_UINT16: >-- >2.16.2.windows.1