mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
Base on the type field to generate numeric 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@14034 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
335e268133
commit
d593121935
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HII Library implementation that uses DXE protocols and services.
|
HII Library implementation that uses DXE protocols and services.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2013, 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
|
||||||
@ -2959,9 +2959,11 @@ HiiCreateNumericOpCode (
|
|||||||
{
|
{
|
||||||
EFI_IFR_NUMERIC OpCode;
|
EFI_IFR_NUMERIC OpCode;
|
||||||
UINTN Position;
|
UINTN Position;
|
||||||
|
UINTN Length;
|
||||||
|
|
||||||
ASSERT ((QuestionFlags & (~(EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED))) == 0);
|
ASSERT ((QuestionFlags & (~(EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED))) == 0);
|
||||||
|
|
||||||
|
Length = 0;
|
||||||
ZeroMem (&OpCode, sizeof (OpCode));
|
ZeroMem (&OpCode, sizeof (OpCode));
|
||||||
OpCode.Question.QuestionId = QuestionId;
|
OpCode.Question.QuestionId = QuestionId;
|
||||||
OpCode.Question.VarStoreId = VarStoreId;
|
OpCode.Question.VarStoreId = VarStoreId;
|
||||||
@ -2976,33 +2978,39 @@ HiiCreateNumericOpCode (
|
|||||||
OpCode.data.u8.MinValue = (UINT8)Minimum;
|
OpCode.data.u8.MinValue = (UINT8)Minimum;
|
||||||
OpCode.data.u8.MaxValue = (UINT8)Maximum;
|
OpCode.data.u8.MaxValue = (UINT8)Maximum;
|
||||||
OpCode.data.u8.Step = (UINT8)Step;
|
OpCode.data.u8.Step = (UINT8)Step;
|
||||||
|
Length = 3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_NUMERIC_SIZE_2:
|
case EFI_IFR_NUMERIC_SIZE_2:
|
||||||
OpCode.data.u16.MinValue = (UINT16)Minimum;
|
OpCode.data.u16.MinValue = (UINT16)Minimum;
|
||||||
OpCode.data.u16.MaxValue = (UINT16)Maximum;
|
OpCode.data.u16.MaxValue = (UINT16)Maximum;
|
||||||
OpCode.data.u16.Step = (UINT16)Step;
|
OpCode.data.u16.Step = (UINT16)Step;
|
||||||
|
Length = 6;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_NUMERIC_SIZE_4:
|
case EFI_IFR_NUMERIC_SIZE_4:
|
||||||
OpCode.data.u32.MinValue = (UINT32)Minimum;
|
OpCode.data.u32.MinValue = (UINT32)Minimum;
|
||||||
OpCode.data.u32.MaxValue = (UINT32)Maximum;
|
OpCode.data.u32.MaxValue = (UINT32)Maximum;
|
||||||
OpCode.data.u32.Step = (UINT32)Step;
|
OpCode.data.u32.Step = (UINT32)Step;
|
||||||
|
Length = 12;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_NUMERIC_SIZE_8:
|
case EFI_IFR_NUMERIC_SIZE_8:
|
||||||
OpCode.data.u64.MinValue = Minimum;
|
OpCode.data.u64.MinValue = Minimum;
|
||||||
OpCode.data.u64.MaxValue = Maximum;
|
OpCode.data.u64.MaxValue = Maximum;
|
||||||
OpCode.data.u64.Step = Step;
|
OpCode.data.u64.Step = Step;
|
||||||
|
Length = 24;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Length += OFFSET_OF (EFI_IFR_NUMERIC, data);
|
||||||
|
|
||||||
if (DefaultsOpCodeHandle == NULL) {
|
if (DefaultsOpCodeHandle == NULL) {
|
||||||
return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, sizeof (OpCode));
|
return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
Position = InternalHiiOpCodeHandlePosition (OpCodeHandle);
|
Position = InternalHiiOpCodeHandlePosition (OpCodeHandle);
|
||||||
InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, sizeof (OpCode), 0, 1);
|
InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, Length, 0, 1);
|
||||||
InternalHiiAppendOpCodes (OpCodeHandle, DefaultsOpCodeHandle);
|
InternalHiiAppendOpCodes (OpCodeHandle, DefaultsOpCodeHandle);
|
||||||
HiiCreateEndOpCode (OpCodeHandle);
|
HiiCreateEndOpCode (OpCodeHandle);
|
||||||
return InternalHiiOpCodeHandleBuffer (OpCodeHandle) + Position;
|
return InternalHiiOpCodeHandleBuffer (OpCodeHandle) + Position;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user