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.120; helo=mga04.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 35E7E22283508 for ; Tue, 6 Mar 2018 19:00:24 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 19:06:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,434,1515484800"; d="scan'208";a="32978292" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga003.jf.intel.com with ESMTP; 06 Mar 2018 19:06:38 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Eric Dong , Liming Gao Date: Wed, 7 Mar 2018 11:06:25 +0800 Message-Id: <1520391985-22332-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [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 03:00:25 -0000 The example of UNION storage is not good, now update it. 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(-) diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModulePkg/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 -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 may be found at http://opensource.org/licenses/bsd-license.php @@ -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; typedef union { - UINT16 BitField : 10; - UINT8 ByteField; + UINT8 UnionNumeric; + UINT8 UnionNumericAlias; } MY_EFI_UNION_DATA; typedef struct { UINT16 MyStringData[40]; UINT16 SomethingHiddenForHtml; diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/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 the BSD License // which accompanies this distribution. The full text of the license may be found at // http://opensource.org/licenses/bsd-license.php // @@ -913,30 +913,20 @@ formset endnumeric; subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2); subtitle text = STRING_TOKEN(STR_UNION_EFI_VARSTORE); - numeric varid = MyEfiUnionVar.ByteField, + numeric varid = MyEfiUnionVar.UnionNumeric, prompt = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_PROMPT), help = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_HELP), minimum = 0, maximum = 20, step = 0, default = 7, defaultstore = MyStandardDefault, default = 8, defaultstore = MyManufactureDefault, endnumeric; - numeric varid = MyEfiUnionVar.BitField, - prompt = STRING_TOKEN(STR_UNION_BIT_NUMERIC_PROMPT), - help = STRING_TOKEN(STR_UNION_BIT_NUMERIC_HELP), - minimum = 0, - maximum = 20, - step = 0, - default = 7, defaultstore = MyStandardDefault, - default = 8, defaultstore = MyManufactureDefault, - endnumeric; - guidop guid = DRIVER_SAMPLE_FORMSET_GUID, datatype = MY_EFI_BITS_VARSTORE_DATA, data.EfiBitNumeric = 1, data.EfiBitOneof = 1, diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/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 may be found at // http://opensource.org/licenses/bsd-license.php // @@ -330,14 +330,10 @@ #language fr-FR "The question refer to byte field in BIT structure" #string STR_UNION_BYTE_NUMERIC_PROMPT #language en-US "UNION EfiVarStore byte numeric" #language fr-FR "UNION EfiVarStore byte numeric" #string STR_UNION_BYTE_NUMERIC_HELP #language en-US "Question refer to byte field in UNION type efivastore, the Standard default is 7 Manufacture default is 8" #language fr-FR "Question refer to 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 EfiVarStore bit numeric" - #language fr-FR "UNION EfiVarStore bit numeric" -#string STR_UNION_BIT_NUMERIC_HELP #language en-US "Question refer to bit field in UNION type efivastore, the Standard default is 7 Manufacture default is 8" - #language fr-FR "Question refer to 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