MdeModulePkg/DriverSampleDxe: Refine the sample case for UNION type

The example of UNION storage is not good, now update it.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Dandan Bi 2018-03-07 10:34:00 +08:00 committed by Liming Gao
parent 777f4aa083
commit f7d05bddd7
3 changed files with 6 additions and 20 deletions

View File

@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -53,8 +53,8 @@ typedef struct {
} MY_BITS_DATA; } MY_BITS_DATA;
typedef union { typedef union {
UINT16 BitField : 10; UINT8 UnionNumeric;
UINT8 ByteField; UINT8 UnionNumericAlias;
} MY_EFI_UNION_DATA; } MY_EFI_UNION_DATA;
typedef struct { typedef struct {

View File

@ -2,7 +2,7 @@
// //
// Sample Setup formset. // Sample Setup formset.
// //
// Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR> // Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
// This program and the accompanying materials // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // 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_SUBTITLE_TEXT2);
subtitle text = STRING_TOKEN(STR_UNION_EFI_VARSTORE); subtitle text = STRING_TOKEN(STR_UNION_EFI_VARSTORE);
numeric varid = MyEfiUnionVar.ByteField, numeric varid = MyEfiUnionVar.UnionNumeric,
prompt = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_PROMPT), prompt = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_PROMPT),
help = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_HELP), help = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_HELP),
minimum = 0, minimum = 0,
@ -925,16 +925,6 @@ formset
default = 8, defaultstore = MyManufactureDefault, default = 8, defaultstore = MyManufactureDefault,
endnumeric; 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 guidop
guid = DRIVER_SAMPLE_FORMSET_GUID, guid = DRIVER_SAMPLE_FORMSET_GUID,
datatype = MY_EFI_BITS_VARSTORE_DATA, datatype = MY_EFI_BITS_VARSTORE_DATA,

View File

@ -1,6 +1,6 @@
// *++ // *++
// //
// Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR> // Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
// This program and the accompanying materials // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // 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" #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" #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" #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 // Boot Order
#string STR_BOOT_TITLE #language en-US "Boot" #string STR_BOOT_TITLE #language en-US "Boot"
#string STR_BOOT_OPTIONS #language en-US "Boot Order" #string STR_BOOT_OPTIONS #language en-US "Boot Order"