summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff>2013-09-10 03:17:16 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2013-09-10 03:17:16 +0000
commit4fac802b692b91298854f068f885b5dd9069d411 (patch)
treef9702f1529fa6a844c6e917ceb211dcacdfc67f5
parent7d21b6936d907a2c8c2bb6e846089792d7cc2c9d (diff)
downloadedk2-4fac802b692b91298854f068f885b5dd9069d411.zip
edk2-4fac802b692b91298854f068f885b5dd9069d411.tar.gz
edk2-4fac802b692b91298854f068f885b5dd9069d411.tar.bz2
Sync patch r14036 from main trunk.
Base on the type field to get the width of value field for option opcode. git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2010.SR1@14636 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Library/UefiHiiLib/HiiLib.c7
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c6
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c4
3 files changed, 10 insertions, 7 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index 7a2415e..fbc85fb 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -947,6 +947,7 @@ InternalHiiValidateCurrentSetting (
UINT16 Offset;
UINT16 Width;
UINT64 VarValue;
+ UINT64 TmpValue;
LIST_ENTRY *Link;
UINT8 *VarBuffer;
UINTN MaxBufferSize;
@@ -1511,7 +1512,9 @@ InternalHiiValidateCurrentSetting (
//
// Check current value is the value of one of option.
//
- if (VarValue == IfrOneOfOption->Value.u64) {
+ TmpValue = 0;
+ CopyMem (&TmpValue, &IfrOneOfOption->Value, IfrOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
+ if (VarValue == TmpValue) {
//
// The value is one of option value.
// Set OpCode to Zero, don't need check again.
@@ -2629,7 +2632,7 @@ HiiCreateOneOfOptionOpCode (
OpCode.Type = Type;
CopyMem (&OpCode.Value, &Value, mHiiDefaultTypeToWidth[Type]);
- return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OPTION_OP, sizeof (OpCode));
+ return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OPTION_OP, OFFSET_OF(EFI_IFR_ONE_OF_OPTION, Value) + mHiiDefaultTypeToWidth[Type]);
}
/**
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 1cb754b..9d253a2 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -1,7 +1,7 @@
/** @file
Implementation of interfaces function for EFI_HII_CONFIG_ROUTING_PROTOCOL.
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -1861,7 +1861,7 @@ ParseIfrData (
// Prepare new DefaultValue
//
DefaultData.Type = DefaultValueFromFlag;
- CopyMem (&DefaultData.Value.u64, &IfrOneOfOption->Value.u64, sizeof (UINT64));
+ CopyMem (&DefaultData.Value, &IfrOneOfOption->Value, IfrOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
if ((IfrOneOfOption->Flags & EFI_IFR_OPTION_DEFAULT) == EFI_IFR_OPTION_DEFAULT) {
DefaultData.DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
InsertDefaultValue (BlockData, &DefaultData);
@@ -1886,7 +1886,7 @@ ParseIfrData (
// Prepare new DefaultValue
//
DefaultData.Type = DefaultValueFromDefault;
- CopyMem (&DefaultData.Value.u64, &IfrOneOfOption->Value.u64, sizeof (UINT64));
+ CopyMem (&DefaultData.Value, &IfrOneOfOption->Value, IfrOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
DefaultDataPtr = BASE_CR (LinkData, IFR_DEFAULT_DATA, Entry);
DefaultData.DefaultId = DefaultDataPtr->DefaultId;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 7c6a35d..a75f2da 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1,7 +1,7 @@
/** @file
Parser for IFR binary encoding.
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -1915,7 +1915,7 @@ ParseOpCodes (
CurrentOption->Flags = ((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Flags;
CurrentOption->Value.Type = ((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Type;
CopyMem (&CurrentOption->Text, &((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Option, sizeof (EFI_STRING_ID));
- CopyMem (&CurrentOption->Value.Value, &((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Value, sizeof (EFI_IFR_TYPE_VALUE));
+ CopyMem (&CurrentOption->Value.Value, &((EFI_IFR_ONE_OF_OPTION *) OpCodeData)->Value, OpCodeLength - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
ExtendValueToU64 (&CurrentOption->Value);
ConditionalExprCount = GetConditionalExpressionCount(ExpressOption);