Revision: 14036
http://edk2.svn.sourceforge.net/edk2/?rev=14036&view=rev
Author: ydong10
Date: 2013-01-06 06:12:50 +0000 (Sun, 06 Jan 2013)
Log Message:
-----------
Base on the type field to get the width of value field for option opcode.
Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
trunk/edk2/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
Modified: trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 2013-01-06 06:09:43 UTC
(rev 14035)
+++ trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 2013-01-06 06:12:50 UTC
(rev 14036)
@@ -946,6 +946,7 @@
UINT16 Offset;
UINT16 Width;
UINT64 VarValue;
+ UINT64 TmpValue;
LIST_ENTRY *Link;
UINT8 *VarBuffer;
UINTN MaxBufferSize;
@@ -1510,7 +1511,9 @@
//
// 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.
@@ -2628,7 +2631,7 @@
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]);
}
/**
Modified: trunk/edk2/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
2013-01-06 06:09:43 UTC (rev 14035)
+++ trunk/edk2/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
2013-01-06 06:12:50 UTC (rev 14036)
@@ -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 @@
// 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 @@
// 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;
Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
2013-01-06 06:09:43 UTC (rev 14035)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
2013-01-06 06:12:50 UTC (rev 14036)
@@ -1,7 +1,7 @@
/** @file
Parser for IFR binary encoding.
-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
@@ -1809,7 +1809,7 @@
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);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits