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.136; helo=mga12.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org 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 8107A22135D33 for ; Tue, 6 Mar 2018 22:50:42 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 22:56:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,434,1515484800"; d="scan'208";a="22561731" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga008.fm.intel.com with ESMTP; 06 Mar 2018 22:56:57 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 6 Mar 2018 22:56:56 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 6 Mar 2018 22:56:56 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0319.002; Wed, 7 Mar 2018 14:56:54 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Dong, Eric" Thread-Topic: [patch] MdeModulePkg/DriverSampleDxe: Refine the sample case for UNION type Thread-Index: AQHTtcFQiyiDX+aFg0C5TyxaQqmCnKPEV01w Date: Wed, 7 Mar 2018 06:56:54 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D8A27@SHSMSX104.ccr.corp.intel.com> References: <1520391985-22332-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1520391985-22332-1-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg/DriverSampleDxe: Refine the sample case for UNION type 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: , X-List-Received-Date: Wed, 07 Mar 2018 06:50:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Bi, Dandan > Sent: Wednesday, March 7, 2018 11:06 AM > To: edk2-devel@lists.01.org > Cc: Dong, Eric ; Gao, Liming > Subject: [patch] MdeModulePkg/DriverSampleDxe: Refine the sample case for= UNION type >=20 > The example of UNION storage is not good, now update it. >=20 > Cc: Eric Dong > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi > --- > MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h | 6 +++--- > MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 14 ++-----------= - > MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni | 6 +----- > 3 files changed, 6 insertions(+), 20 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeMo= dulePkg/Universal/DriverSampleDxe/NVDataStruc.h > index 6f092de..208a4c6 100644 > --- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h > +++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h > @@ -1,8 +1,8 @@ > /** @file >=20 > -Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D License > which accompanies this distribution. The full text of the license may b= e found at > http://opensource.org/licenses/bsd-license.php >=20 > @@ -51,12 +51,12 @@ typedef struct { > UINT8 : 0; // Special width 0 can be used to force= alignment at the next word boundary > UINT8 NestBitNumeric : 4; > } MY_BITS_DATA; >=20 > typedef union { > - UINT16 BitField : 10; > - UINT8 ByteField; > + UINT8 UnionNumeric; > + UINT8 UnionNumericAlias; > } MY_EFI_UNION_DATA; >=20 > typedef struct { > UINT16 MyStringData[40]; > UINT16 SomethingHiddenForHtml; > diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePk= g/Universal/DriverSampleDxe/Vfr.vfr > index b1017d9..9d99dcf 100644 > --- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr > +++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr > @@ -1,10 +1,10 @@ > ///** @file > // > // Sample Setup formset. > // > -// Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved. > +// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved. > // This program and the accompanying materials > // are licensed and made available under the terms and conditions of th= e BSD License > // which accompanies this distribution. The full text of the license m= ay be found at > // http://opensource.org/licenses/bsd-license.php > // > @@ -913,30 +913,20 @@ formset > endnumeric; >=20 > subtitle text =3D STRING_TOKEN(STR_SUBTITLE_TEXT2); > subtitle text =3D STRING_TOKEN(STR_UNION_EFI_VARSTORE); >=20 > - numeric varid =3D MyEfiUnionVar.ByteField, > + numeric varid =3D MyEfiUnionVar.UnionNumeric, > prompt =3D STRING_TOKEN(STR_UNION_BYTE_NUMERIC_PROMPT), > help =3D STRING_TOKEN(STR_UNION_BYTE_NUMERIC_HELP), > minimum =3D 0, > maximum =3D 20, > step =3D 0, > default =3D 7, defaultstore =3D MyStandardDefault, > default =3D 8, defaultstore =3D MyManufactureDefault, > endnumeric; >=20 > - numeric varid =3D MyEfiUnionVar.BitField, > - prompt =3D STRING_TOKEN(STR_UNION_BIT_NUMERIC_PROMPT), > - help =3D STRING_TOKEN(STR_UNION_BIT_NUMERIC_HELP), > - minimum =3D 0, > - maximum =3D 20, > - step =3D 0, > - default =3D 7, defaultstore =3D MyStandardDefault, > - default =3D 8, defaultstore =3D MyManufactureDefault, > - endnumeric; > - > guidop > guid =3D DRIVER_SAMPLE_FORMSET_GUID, > datatype =3D MY_EFI_BITS_VARSTORE_DATA, > data.EfiBitNumeric =3D 1, > data.EfiBitOneof =3D 1, > diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeM= odulePkg/Universal/DriverSampleDxe/VfrStrings.uni > index 7cc6a19..2215c08 100644 > --- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni > +++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni > @@ -1,8 +1,8 @@ > // *++ > // > -// Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved. > +// Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved. > // This program and the accompanying materials > // are licensed and made available under the terms and conditions of the= BSD License > // which accompanies this distribution. The full text of the license ma= y be found at > // http://opensource.org/licenses/bsd-license.php > // > @@ -330,14 +330,10 @@ > #language fr-FR "The question ref= er to byte field in BIT structure" > #string STR_UNION_BYTE_NUMERIC_PROMPT #language en-US "UNION EfiVarStor= e byte numeric" > #language fr-FR "UNION EfiVarStor= e byte numeric" > #string STR_UNION_BYTE_NUMERIC_HELP #language en-US "Question refer t= o byte field in UNION type efivastore, the Standard > default is 7 Manufacture default is 8" > #language fr-FR "Question refer t= o byte field in UNION type efivastore, the Standard > default is 7 Manufacture default is 8" > -#string STR_UNION_BIT_NUMERIC_PROMPT #language en-US "UNION EfiVarStor= e bit numeric" > - #language fr-FR "UNION EfiVarStor= e bit numeric" > -#string STR_UNION_BIT_NUMERIC_HELP #language en-US "Question refer t= o bit field in UNION type efivastore, the Standard > default is 7 Manufacture default is 8" > - #language fr-FR "Question refer t= o bit field in UNION type efivastore, the Standard > default is 7 Manufacture default is 8" > // Boot Order > #string STR_BOOT_TITLE #language en-US "Boot" > #string STR_BOOT_OPTIONS #language en-US "Boot Order" > #string STR_BOOT_OPTION1 #language en-US "IDE HDD" > #string STR_BOOT_OPTION2 #language en-US "ATAPI CD" > -- > 1.9.5.msysgit.1