From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web09.3959.1607994229361997048 for ; Mon, 14 Dec 2020 17:03:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=dFbg1yEE; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) IronPort-SDR: uxXAJXpLZKTYqNF3y+ry/K3K7QV1KTP8kI1ZRejkYdQyZI7PD3ZYukf9zeUHoHf99XOZ1xyJPl t1lEahq6Is4g== X-IronPort-AV: E=McAfee;i="6000,8403,9835"; a="154039027" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="154039027" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 17:03:47 -0800 IronPort-SDR: QapjCSBNVr/X2q2XF/s7lCsQ0pbkpL4G2QmPgYoR7XJwXW6tB1Sb5+QlPP7UHw1kLoiqOjR3sr oA+DwMzdLVZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="487420604" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 14 Dec 2020 17:03:43 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 17:03:36 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Dec 2020 17:03:36 -0800 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.51) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 14 Dec 2020 17:03:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3TKNggam5gjaVEAfTGiw0BfadF4Vyh/CbO7AplIh5Q67aV85HNakXe6PI06k0ZXbITPbESmeRIRyymokPGDJAwVtkO4cVMyVlkv6pVRo2+XcC6cJhGSniJdhVGY8VxBLSKywoU3wg7gv/pvoHec9aDsXkTOnhnGPbRuUFWMc0T6TNgfv0iIh9vbiJQWceY6d+mxwcBXcahRXC0hjCYm+e1AmQOwX7Ul0ndxmWaMv/MYLrvDmahHDvZxFb749o1jtIqgcwrqZ7l7XprZ7CBTIIRGbWotqAhypgc4bzNKV1zNFyBXM97Jgx+MpROJQ++Xej9cGBrQ9vsbDuoCxgWKmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bEdy6WmfxWHh56Qd//f1TKPTsLHoea0M0md9AsSIC34=; b=TpnJPhYDRrSSrtlmJlBe1kY71w4DqUUmDuT9X8ezRNDmGpyqOs+F9lg6wdi526ZbCtIcXA5AYwI2AzJtXluW0TiNMqBWZHrBTc1biAgH9ZmtBdUGT9JaImfcJss7mJm432gtVPldt8wC9waEVEijfq14zyk/WgnkQBBhO8dFiPsFHmQNuZorz5VlcDibJguZsxJ+2xxt20gqKfZF+n1g8mwv9wm5OJcEjfcLv3F925gojHPeqMwthnfUCt77JbOpFgsxeE2V9kr+/FOxp0GDzi3PbtBvE8Thq+wVTPbTlxt31EjWJnlVOsjIaMcAEVhvdb6LfIXjXemELtCl7NAOeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bEdy6WmfxWHh56Qd//f1TKPTsLHoea0M0md9AsSIC34=; b=dFbg1yEEuzB+Wq+yeuIvZz/gBCmTSjY+2Rb2CtaRV2xQO2mcbcHtNB61P7WURFu6CEjdCka2KCPrbzO5JylEKKdIgiDHZhR0vflU3pQO5LJ5SCGcQ++cKms3DCtr2UVvN2sQ5SoeQeRDmimf8fMwDP4Ro/w5z7awReluQiHCu70= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB2859.namprd11.prod.outlook.com (2603:10b6:5:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Tue, 15 Dec 2020 01:03:32 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb%3]) with mapi id 15.20.3654.025; Tue, 15 Dec 2020 01:03:32 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "Feng, Bob C" , "Chen, Christine" CC: Liming Gao Subject: Re: [edk2-devel] [Patch v3 1/1] BaseTools: Add comments in StructurePcd DSC file. Thread-Topic: [edk2-devel] [Patch v3 1/1] BaseTools: Add comments in StructurePcd DSC file. Thread-Index: AQHWzG6xSuRyoKoKQEmYxL9gnsU/y6n3YRWggAACJ7A= Date: Tue, 15 Dec 2020 01:03:31 +0000 Message-ID: References: <20201207075754.1240-1-yuwei.chen@intel.com> <1650BDCD6648B06E.11773@groups.io> In-Reply-To: <1650BDCD6648B06E.11773@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e60c2161-657c-4091-9f55-08d8a0953e30 x-ms-traffictypediagnostic: DM6PR11MB2859: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:561; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CjTI4ugNFwMs8EgYClCpRcemMy/kkx5Id2Oz1JEZHhPVW+5NQDkk5HJRd3zFTcyAEdB5kivv6CJ6adeXbkgOrG/bRqcfj+DtuPIqv/BFX3BCaZiRJaUgM7hq1+fJbRo92BFxRRU+6CL2Ip1Nc89lhdqClgSzULipH3XUEJjfaQWTDAHjYpLdIBhKs5bf8wQjUUp1lnQ3HktBsL7t57yiyHE1rdtSO63cbT8Pzas6D7brHySEqpc1prlSIFRTZ0Nfa8Tbjn/S+IyB2WeCVSV5RkI5nYK9DOFVcmgzdo8HTRMEt+mqCgzlPSH7noMseFnmVyonC8nYTxj5U16boDPF93w+nZbJ8pupxDui0/bZ8OhO4OTP/uzwxfRt2AC1XKGxl5QaLObTBETfun7fg1v+ZA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(366004)(376002)(346002)(110136005)(6506007)(2906002)(8676002)(6636002)(508600001)(9686003)(53546011)(66476007)(33656002)(83380400001)(26005)(71200400001)(76116006)(4326008)(86362001)(186003)(64756008)(55016002)(66946007)(66556008)(66446008)(966005)(52536014)(8936002)(7696005)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?bGow1wtdFjz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a1gTOJxe?= =?us-ascii?Q?N6nbvHno0O+MESM5JhSTLoADUlpfHHDwjeLMWpwrZmjPpf+iXfOYeU6h4lvn?= =?us-ascii?Q?O9zuv2T8d2g0xZE8jnkoknsF3TnphGIaDlTZC5kwDJM=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e60c2161-657c-4091-9f55-08d8a0953e30 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2020 01:03:31.3018 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7JW2aNCuXiZImDIe0dARD/oKqQs8UN0LTolP/8pBTsgBPNwmoxOSlF+j3nrW/ksredBNpdrJTVNDLrOOJj+zcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2859 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I created a PR https://github.com/tianocore/edk2/pull/1225 Thanks, Bob -----Original Message----- From: devel@edk2.groups.io On Behalf Of Bob Feng Sent: Tuesday, December 15, 2020 8:56 AM To: Chen, Christine ; devel@edk2.groups.io Cc: Liming Gao Subject: Re: [edk2-devel] [Patch v3 1/1] BaseTools: Add comments in Struct= urePcd DSC file. Reviewed-by: Bob Feng =20 -----Original Message----- From: Chen, Christine Sent: Monday, December 7, 2020 3:58 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao Subject: [Patch v3 1/1] BaseTools: Add comments in StructurePcd DSC file. Currently VFR files have variables comments which will not be added into S= tructurePcd.dsc file. Thus, it is not convenient for developer to Modify Pc= ds. To solve this problem, The comments will be modified to user friendly f= ormat and added after the corresponding Pcd values in StructurePcd.dsc file= . Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Scripts/ConvertFceToStructurePcd.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scr= ipts/ConvertFceToStructurePcd.py index aeda3ff26dfe..867660fba9cf 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -52,6 +52,7 @@ infstatement =3D '''[Pcd] =20 SECTION=3D'PcdsDynamicHii' PCD_NAME=3D'gStructPcdTokenSpaceGuid.Pcd' +Max_Pcd_Len =3D 100 =20 WARNING=3D[] ERRORMSG=3D[] @@ -278,6 +279,9 @@ class Config(object): part =3D [] for x in section[1:]: line=3Dx.split('\n')[0] + comment_list =3D value_re.findall(line) # the string \\... in "Q.= ..." line + comment_list[0] =3D comment_list[0].replace('//', '') + comment =3D comment_list[0].strip() line=3Dvalue_re.sub('',line) #delete \\... in "Q...." line list1=3Dline.split(' ') value=3Dself.value_parser(list1) @@ -289,7 +293,7 @@ class Config(object): if attribute[0] in ['0x3','0x7']: offset =3D int(offset[0], 16) #help =3D help_re.findall(x) - text =3D offset, name[0], guid[0], value, attribute[0] + text =3D offset, name[0], guid[0], value, attribute[0],=20 + comment part.append(text) return(part) =20 @@ -479,7 +483,7 @@ class mainprocess(object): tmp_id=3D[id_key] #['0_0',[(struct,[name...]),(struct,[name...])]] tmp_info=3D{} #{name:struct} for section in config_dict[id_key]: - c_offset,c_name,c_guid,c_value,c_attribute =3D section + c_offset,c_name,c_guid,c_value,c_attribute,c_comment =3D section if c_name in efi_dict: struct =3D efi_dict[c_name] title=3D'%s%s|L"%s"|%s|0x00||%s\n'%(PCD_NAME,c_name,c_name,self= .guid.guid_parser(c_guid),self.attribute_dict[c_attribute]) @@ -499,9 +503,14 @@ class mainprocess(object): if c_offset in struct_dict: offset_name=3Dstruct_dict[c_offset] info =3D "%s%s.%s|%s\n"%(PCD_NAME,c_name,offset_name,c_value) + blank_length =3D Max_Pcd_Len - len(info) + if blank_length <=3D 0: + info_comment =3D "%s%s.%s|%s%s# %s\n"%(PCD_NAME,c_name,of= fset_name,c_value," ",c_comment) + else: + info_comment =3D "%s%s.%s|%s%s#=20 + %s\n"%(PCD_NAME,c_name,offset_name,c_value,blank_length*" ",c_comment) inf =3D "%s%s\n"%(PCD_NAME,c_name) inf_list.append(inf) - tmp_info[info]=3Dtitle + tmp_info[info_comment]=3Dtitle else: print("ERROR: Can't find offset %s with struct name %s"%(c_of= fset,struct)) ERRORMSG.append("ERROR: Can't find offset %s with name %s"%(c= _offset,struct)) -- 2.27.0.windows.1