diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-26 08:42:50 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-06-26 08:42:50 +0000 |
commit | d9bbabfd13b77bac9e6524196f15de7115f482eb (patch) | |
tree | e734aae3bf90f467a535719ef55065e11c0ccf64 /MdeModulePkg | |
parent | d5bcf13e1d7f9bad6b51c55da99958631207ab23 (diff) | |
download | edk2-platforms-d9bbabfd13b77bac9e6524196f15de7115f482eb.tar.xz |
Check whether has storage for date/time opcode, if it has storage, also generate the offset/width info for it.
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@13473 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 138 |
1 files changed, 137 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 356b730bed..c79a4c9ab8 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 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2012, 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
@@ -997,6 +997,8 @@ ParseIfrData ( EFI_IFR_CHECKBOX *IfrCheckBox;
EFI_IFR_PASSWORD *IfrPassword;
EFI_IFR_STRING *IfrString;
+ EFI_IFR_DATE *IfrDate;
+ EFI_IFR_TIME *IfrTime;
IFR_DEFAULT_DATA DefaultData;
IFR_DEFAULT_DATA *DefaultDataPtr;
IFR_BLOCK_DATA *BlockData;
@@ -1505,6 +1507,140 @@ ParseIfrData ( InsertDefaultValue (BlockData, &DefaultData);
break;
+ case EFI_IFR_DATE_OP:
+ //
+ // offset by question header
+ // width MaxSize * sizeof (CHAR16)
+ // no default value, only block array
+ //
+
+ //
+ // Date question is not in IFR Form. This IFR form is not valid.
+ //
+ if (VarStorageData->Size == 0) {
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
+ }
+ //
+ // Check whether this question is for the requested varstore.
+ //
+ IfrDate = (EFI_IFR_DATE *) IfrOpHdr;
+ if (IfrDate->Question.VarStoreId != VarStorageData->VarStoreId) {
+ break;
+ }
+
+ //
+ // Get Offset/Width by Question header and OneOf Flags
+ //
+ VarOffset = IfrDate->Question.VarStoreInfo.VarOffset;
+ VarWidth = (UINT16) sizeof (EFI_HII_DATE);
+
+ //
+ // Check whether this question is in requested block array.
+ //
+ if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) {
+ //
+ // This question is not in the requested array. Skip it.
+ //
+ break;
+ }
+
+ //
+ // Check this var question is in the var storage
+ //
+ if ((VarOffset + VarWidth) > VarStorageData->Size) {
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
+ }
+
+ //
+ // Set Block Data
+ //
+ BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA));
+ if (BlockData == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto Done;
+ }
+ BlockData->Offset = VarOffset;
+ BlockData->Width = VarWidth;
+ BlockData->QuestionId = IfrDate->Question.QuestionId;
+ BlockData->OpCode = IfrOpHdr->OpCode;
+ BlockData->Scope = IfrOpHdr->Scope;
+ InitializeListHead (&BlockData->DefaultValueEntry);
+
+ //
+ // Add Block Data into VarStorageData BlockEntry
+ //
+ InsertBlockData (&VarStorageData->BlockEntry, &BlockData);
+ break;
+
+ case EFI_IFR_TIME_OP:
+ //
+ // offset by question header
+ // width MaxSize * sizeof (CHAR16)
+ // no default value, only block array
+ //
+
+ //
+ // Time question is not in IFR Form. This IFR form is not valid.
+ //
+ if (VarStorageData->Size == 0) {
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
+ }
+ //
+ // Check whether this question is for the requested varstore.
+ //
+ IfrTime = (EFI_IFR_TIME *) IfrOpHdr;
+ if (IfrTime->Question.VarStoreId != VarStorageData->VarStoreId) {
+ break;
+ }
+
+ //
+ // Get Offset/Width by Question header and OneOf Flags
+ //
+ VarOffset = IfrTime->Question.VarStoreInfo.VarOffset;
+ VarWidth = (UINT16) sizeof (EFI_HII_TIME);
+
+ //
+ // Check whether this question is in requested block array.
+ //
+ if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) {
+ //
+ // This question is not in the requested array. Skip it.
+ //
+ break;
+ }
+
+ //
+ // Check this var question is in the var storage
+ //
+ if ((VarOffset + VarWidth) > VarStorageData->Size) {
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
+ }
+
+ //
+ // Set Block Data
+ //
+ BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA));
+ if (BlockData == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto Done;
+ }
+ BlockData->Offset = VarOffset;
+ BlockData->Width = VarWidth;
+ BlockData->QuestionId = IfrTime->Question.QuestionId;
+ BlockData->OpCode = IfrOpHdr->OpCode;
+ BlockData->Scope = IfrOpHdr->Scope;
+ InitializeListHead (&BlockData->DefaultValueEntry);
+
+ //
+ // Add Block Data into VarStorageData BlockEntry
+ //
+ InsertBlockData (&VarStorageData->BlockEntry, &BlockData);
+ break;
+
case EFI_IFR_STRING_OP:
//
// offset by question header
|