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.web09.547.1649378863825984439 for ; Thu, 07 Apr 2022 17:47:45 -0700 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 ([101.224.116.119]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 08 Apr 2022 08:47:38 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 101.224.116.119 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , "'Chen Lin Z'" , , , Cc: , References: <20220401060905.841569-1-lin.z.chen@intel.com> <16E384C9AA220AC9.11968@groups.io> In-Reply-To: <16E384C9AA220AC9.11968@groups.io> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0g5Zue5aSNOiBbUEFUQ0gtVjJdIEZpeCBTZXR1cCBudW1lcmljIGRlZmF1bHQgdmFsdWUgaW5jb3JyZWN0IGlzc3Vl?= Date: Fri, 8 Apr 2022 08:47:41 +0800 Message-ID: <037801d84ae2$40c6bbe0$c25433a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQCrk5x5IguJowjuGlp/BcZCaQRoLAIPUzqUry4icHA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Lin: Here is PR https://github.com/tianocore/edk2/pull/2748. There is the issu= e in the change. Please check it.=20 ERROR - /home/vsts/work/1/s/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET returned 1 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED gaoliming > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA4=D4=C27=C8=D5 13:05 > =CA=D5=BC=FE=C8=CB: 'Chen Lin Z' ; jian.j.wang@inte= l.com; > dandan.bi@intel.com; eric.dong@intel.com; devel@edk2.groups.io > =B3=AD=CB=CD: zhuangzhi.li@intel.com; di.zhang@intel.com > =D6=F7=CC=E2: [edk2-devel] =BB=D8=B8=B4: [PATCH-V2] Fix Setup numeric def= ault value > incorrect issue >=20 > Reviewed-by: Liming Gao >=20 > > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > > =B7=A2=BC=FE=C8=CB: Chen Lin Z > > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA4=D4=C21=C8=D5 14:09 > > =CA=D5=BC=FE=C8=CB: jian.j.wang@intel.com; gaoliming@byosoft.com.cn; > > dandan.bi@intel.com; eric.dong@intel.com; devel@edk2.groups.io > > =B3=AD=CB=CD: zhuangzhi.li@intel.com; di.zhang@intel.com; Chen Lin Z > > > > =D6=F7=CC=E2: [PATCH-V2] Fix Setup numeric default value incorrect issu= e > > > > When default/manufacturing flag get removed from numeric varid, it can'= t > > get default value from StructurePcd in > 'UpdateDefaultSettingInFormPackage' > > function since there is no EFI_IFR_DEFAULT_OP opcode in IFR file. Add a > > chance to get numeric default value from StructurePcd in the case that > > numeric minimum value will be used as default value. > > > > Signed-off-by: Chen Lin Z > > Signed-off-by: Dandan Bi > > --- > > .../Universal/HiiDatabaseDxe/ConfigRouting.c | 22 > ++++++++++++++++++ > > .../Universal/HiiDatabaseDxe/HiiDatabase.h | 23 > > +++++++++++++++++++ > > 2 files changed, 45 insertions(+) > > > > diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > > b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > > index 2f792d2965..1c6af853b3 100644 > > --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > > +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > > @@ -2171,6 +2171,7 @@ ParseIfrData ( > > UINTN PackageOffset; > > > > EFI_IFR_VARSTORE *IfrVarStore; > > > > EFI_IFR_VARSTORE_EFI *IfrEfiVarStore; > > > > + EFI_IFR_VARSTORE_EFI *IfrEfiVarStoreTmp; > > > > EFI_IFR_OP_HEADER *IfrOpHdr; > > > > EFI_IFR_ONE_OF *IfrOneOf; > > > > EFI_IFR_REF4 *IfrRef; > > > > @@ -2187,6 +2188,7 @@ ParseIfrData ( > > IFR_BLOCK_DATA *BlockData; > > > > CHAR16 *VarStoreName; > > > > UINTN NameSize; > > > > + UINTN NvDefaultStoreSize; > > > > UINT16 VarWidth; > > > > UINT16 VarDefaultId; > > > > BOOLEAN FirstOneOfOption; > > > > @@ -2212,6 +2214,7 @@ ParseIfrData ( > > SmallestDefaultId =3D 0xFFFF; > > > > FromOtherDefaultOpcode =3D FALSE; > > > > QuestionReferBitField =3D FALSE; > > > > + IfrEfiVarStoreTmp =3D NULL; > > > > > > > > // > > > > // Go through the form package to parse OpCode one by one. > > > > @@ -2303,6 +2306,17 @@ ParseIfrData ( > > } > > > > > > > > AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, > > VarStoreName, NameSize); > > > > + if (IfrEfiVarStoreTmp !=3D NULL) { > > > > + FreePool (IfrEfiVarStoreTmp); > > > > + } > > > > + IfrEfiVarStoreTmp =3D AllocatePool (IfrEfiVarStore->Header.Len= gth > + > > AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name)); > > > > + if (IfrEfiVarStoreTmp =3D=3D NULL) { > > > > + Status =3D EFI_OUT_OF_RESOURCES; > > > > + goto Done; > > > > + } > > > > + > > > > + CopyMem (IfrEfiVarStoreTmp, IfrEfiVarStore, > > IfrEfiVarStore->Header.Length); > > > > + AsciiStrToUnicodeStrS ((CHAR8 *)IfrEfiVarStore->Name, (CHAR16 > > *)&(IfrEfiVarStoreTmp->Name[0]), AsciiStrSize ((CHAR8 > > *)IfrEfiVarStore->Name) * sizeof (CHAR16)); > > > > > > > > if (IsThisVarstore (&IfrEfiVarStore->Guid, VarStoreName, > > ConfigHdr)) { > > > > // > > > > @@ -2502,9 +2516,13 @@ ParseIfrData ( > > // > > > > // Set default value base on the DefaultId list get from IFR > data. > > > > // > > > > + NvDefaultStoreSize =3D PcdGetSize > > (PcdNvStoreDefaultValueBuffer); > > > > for (LinkData =3D DefaultIdArray->Entry.ForwardLink; > LinkData !=3D > > &DefaultIdArray->Entry; LinkData =3D LinkData->ForwardLink) { > > > > DefaultDataPtr =3D BASE_CR (LinkData, > > IFR_DEFAULT_DATA, Entry); > > > > DefaultData.DefaultId =3D DefaultDataPtr->DefaultId; > > > > + if (NvDefaultStoreSize > sizeof > > (PCD_NV_STORE_DEFAULT_BUFFER_HEADER)) { > > > > + FindQuestionDefaultSetting (DefaultData.DefaultId, > > IfrEfiVarStoreTmp, &(IfrOneOf->Question), &DefaultData.Value, VarWidth, > > QuestionReferBitField); > > > > + } > > > > InsertDefaultValue (BlockData, &DefaultData); > > > > } > > > > } > > > > @@ -3192,6 +3210,10 @@ Done: > > } > > > > } > > > > > > > > + if (IfrEfiVarStoreTmp !=3D NULL) { > > > > + FreePool (IfrEfiVarStoreTmp); > > > > + } > > > > + > > > > return Status; > > > > } > > > > > > > > diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h > > b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h > > index c4ca6ad6ee..421c293cfc 100644 > > --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h > > +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h > > @@ -2308,6 +2308,29 @@ HiiGetConfigRespInfo ( > > IN CONST EFI_HII_DATABASE_PROTOCOL *This > > > > ); > > > > > > > > +/** > > > > + Find question default value from PcdNvStoreDefaultValueBuffer > > > > + > > > > + @param DefaultId Default store ID > > > > + @param EfiVarStore Point to EFI VarStore header > > > > + @param IfrQuestionHdr Point to Question header > > > > + @param ValueBuffer Point to Buffer includes the found default > > setting > > > > + @param Width Width of the default value > > > > + @param BitFieldQuestion Whether the Question is stored in Bit field. > > > > + > > > > + @retval EFI_SUCCESS Question default value is found. > > > > + @retval EFI_NOT_FOUND Question default value is not found. > > > > +**/ > > > > +EFI_STATUS > > > > +FindQuestionDefaultSetting ( > > > > + IN UINT16 DefaultId, > > > > + IN EFI_IFR_VARSTORE_EFI *EfiVarStore, > > > > + IN EFI_IFR_QUESTION_HEADER *IfrQuestionHdr, > > > > + OUT VOID *ValueBuffer, > > > > + IN UINTN Width, > > > > + IN BOOLEAN BitFieldQuestion > > > > + ); > > > > + > > > > // > > > > // Global variables > > > > // > > > > -- > > 2.25.1 >=20 >=20 >=20 >=20 >=20 >=20 >=20