Base on the type field to generate oneof opcode.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14035 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2013-01-06 06:09:43 +00:00
parent d593121935
commit dcf5ba47ae
1 changed files with 5 additions and 1 deletions

View File

@ -3123,6 +3123,7 @@ HiiCreateOneOfOpCode (
{
EFI_IFR_ONE_OF OpCode;
UINTN Position;
UINTN Length;
ASSERT (OptionsOpCodeHandle != NULL);
ASSERT ((QuestionFlags & (~(EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY))) == 0);
@ -3136,8 +3137,11 @@ HiiCreateOneOfOpCode (
OpCode.Question.Flags = QuestionFlags;
OpCode.Flags = OneOfFlags;
Length = OFFSET_OF (EFI_IFR_ONE_OF, data);
Length += (1 << (OneOfFlags & EFI_IFR_NUMERIC_SIZE)) * 3;
Position = InternalHiiOpCodeHandlePosition (OpCodeHandle);
InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OP, sizeof (OpCode), 0, 1);
InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OP, Length, 0, 1);
InternalHiiAppendOpCodes (OpCodeHandle, OptionsOpCodeHandle);
if (DefaultsOpCodeHandle != NULL) {
InternalHiiAppendOpCodes (OpCodeHandle, DefaultsOpCodeHandle);