From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.4253.1607402865222555809 for ; Mon, 07 Dec 2020 20:47:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 08 Dec 2020 12:47:40 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , References: <20201207075754.1240-1-yuwei.chen@intel.com> In-Reply-To: <20201207075754.1240-1-yuwei.chen@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BhdGNoIHYzIDEvMV0gQmFzZVRvb2xzOiBBZGQgY29tbWVudHMgaW4gU3RydWN0dXJlUGNkIERTQyBmaWxlLg==?= Date: Tue, 8 Dec 2020 12:47:41 +0800 Message-ID: <007c01d6cd1d$43019090$c904b1b0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG4e141MYQiieP6u/YNLkBMpSnAfqopQ5jA Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Yuwei: What's purpose for Max_Pcd_Len? Does it mean PCD name length limitation? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+68378+4905953+8761045@groups.io > =B4=FA=B1=ED Yuwei Chen > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA12=D4=C27=C8=D5 15:58 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bob Feng ; Liming Gao > > =D6=F7=CC=E2: [edk2-devel] [Patch v3 1/1] BaseTools: Add comments in Str= ucturePcd > DSC file. >=20 > Currently VFR files have variables comments which will not be > added into StructurePcd.dsc file. Thus, it is not convenient for > developer to Modify Pcds. To solve this problem, The comments will > be modified to user friendly format and added after the corresponding > Pcd values in StructurePcd.dsc file. >=20 > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Yuwei Chen > --- > BaseTools/Scripts/ConvertFceToStructurePcd.py | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) >=20 > diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py > b/BaseTools/Scripts/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], com= ment > 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 sectio= n > if c_name in efi_dict: > struct =3D efi_dict[c_name] >=20 > 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,offset_name,c_value," > ",c_comment) > + else: > + info_comment =3D > "%s%s.%s|%s%s# %s\n"%(PCD_NAME,c_name,offset_name,c_value,blank_le > ngth*" ",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_offset,struct)) > ERRORMSG.append("ERROR: Can't find offset %s with > name %s"%(c_offset,struct)) > -- > 2.27.0.windows.1 >=20 >=20 >=20 >=20 >=20