From f7d05bddd7e7a1f094a549b5da8d0141d4060c25 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Wed, 7 Mar 2018 10:34:00 +0800 Subject: [PATCH] MdeModulePkg/DriverSampleDxe: Refine the sample case for UNION type 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 Reviewed-by: Liming Gao --- .../Universal/DriverSampleDxe/NVDataStruc.h | 6 +++--- MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 14 ++------------ .../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 6f092de8b6..208a4c6d91 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h +++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h @@ -1,6 +1,6 @@ /** @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 @@ -53,8 +53,8 @@ typedef struct { } MY_BITS_DATA; typedef union { - UINT16 BitField : 10; - UINT8 ByteField; + UINT8 UnionNumeric; + UINT8 UnionNumericAlias; } MY_EFI_UNION_DATA; typedef struct { diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr index b1017d9fd0..9d99dcf205 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr +++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr @@ -2,7 +2,7 @@ // // 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 @@ -915,7 +915,7 @@ formset 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, @@ -925,16 +925,6 @@ formset 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, diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni index 7cc6a19e93..2215c08c5a 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni +++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni @@ -1,6 +1,6 @@ // *++ // -// 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 @@ -332,10 +332,6 @@ #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" -- 2.39.2