diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-08-01 19:18:31 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-08-08 11:07:24 +0800 |
commit | 74bbe31b8d485da26ec7ffad5e78b8384a9eb9a5 (patch) | |
tree | 8b03d9d40293a5f7cb0bd2b35cbb555453ccb680 /BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | |
parent | bec3a18108cf5839f3fb1f451c55e1b2afcbc747 (diff) | |
download | edk2-platforms-74bbe31b8d485da26ec7ffad5e78b8384a9eb9a5.tar.xz |
BaseTools/VfrCompile: Add two new option for VfrCompile
1.--autodefault option
VfrCompile will generate default opcodes for questions if some
default are missing.
2 --checkdefault option
VfrCompile will check whether every question has no default or
has all default. If not, will generate an error to let user know
the question misses default.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp')
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp index f73b70d794..b3d1ac54ff 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -2,7 +2,7 @@ Vfr common library functions.
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2016, 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
@@ -1419,6 +1419,8 @@ CVfrDataStorage::CVfrDataStorage ( mNameVarStoreList = NULL;
mCurrVarStorageNode = NULL;
mNewVarStorageNode = NULL;
+ mBufferFieldInfoListHead = NULL;
+ mBufferFieldInfoListTail = NULL;
}
CVfrDataStorage::~CVfrDataStorage (
@@ -2000,6 +2002,48 @@ CVfrDataStorage::GetEfiVarStoreInfo ( }
EFI_VFR_RETURN_CODE
+CVfrDataStorage::AddBufferVarStoreFieldInfo (
+ IN EFI_VARSTORE_INFO *Info
+ )
+{
+ BufferVarStoreFieldInfoNode *pNew;
+
+ if ((pNew = new BufferVarStoreFieldInfoNode(Info)) == NULL) {
+ return VFR_RETURN_FATAL_ERROR;
+ }
+
+ if (mBufferFieldInfoListHead == NULL) {
+ mBufferFieldInfoListHead = pNew;
+ mBufferFieldInfoListTail= pNew;
+ } else {
+ mBufferFieldInfoListTail->mNext = pNew;
+ mBufferFieldInfoListTail = pNew;
+ }
+
+ return VFR_RETURN_SUCCESS;
+}
+
+EFI_VFR_RETURN_CODE
+CVfrDataStorage::GetBufferVarStoreFieldInfo (
+ IN OUT EFI_VARSTORE_INFO *Info
+ )
+{
+ BufferVarStoreFieldInfoNode *pNode;
+
+ pNode = mBufferFieldInfoListHead;
+ while (pNode != NULL) {
+ if (Info->mVarStoreId == pNode->mVarStoreInfo.mVarStoreId &&
+ Info->mInfo.mVarOffset == pNode->mVarStoreInfo.mInfo.mVarOffset) {
+ Info->mVarTotalSize = pNode->mVarStoreInfo.mVarTotalSize;
+ Info->mVarType = pNode->mVarStoreInfo.mVarType;
+ return VFR_RETURN_SUCCESS;
+ }
+ pNode = pNode->mNext;
+ }
+ return VFR_RETURN_FATAL_ERROR;
+}
+
+EFI_VFR_RETURN_CODE
CVfrDataStorage::GetNameVarStoreInfo (
OUT EFI_VARSTORE_INFO *Info,
IN UINT32 Index
@@ -2358,6 +2402,26 @@ EFI_VARSTORE_INFO::operator == ( return FALSE;
}
+BufferVarStoreFieldInfoNode::BufferVarStoreFieldInfoNode(
+ IN EFI_VARSTORE_INFO *Info
+ )
+{
+ mVarStoreInfo.mVarType = Info->mVarType;
+ mVarStoreInfo.mVarTotalSize = Info->mVarTotalSize;
+ mVarStoreInfo.mInfo.mVarOffset = Info->mInfo.mVarOffset;
+ mVarStoreInfo.mVarStoreId = Info->mVarStoreId;
+ mNext = NULL;
+}
+
+BufferVarStoreFieldInfoNode::~BufferVarStoreFieldInfoNode ()
+{
+ mVarStoreInfo.mVarType = EFI_IFR_TYPE_OTHER;
+ mVarStoreInfo.mVarTotalSize = 0;
+ mVarStoreInfo.mInfo.mVarOffset = EFI_VAROFFSET_INVALID;
+ mVarStoreInfo.mVarStoreId = EFI_VARSTORE_ID_INVALID;
+ mNext = NULL;
+}
+
static EFI_VARSTORE_INFO gEfiInvalidVarStoreInfo;
EFI_QUESTION_ID
@@ -3632,5 +3696,7 @@ CVfrStringDB::GetUnicodeStringTextSize ( BOOLEAN VfrCompatibleMode = FALSE;
CVfrVarDataTypeDB gCVfrVarDataTypeDB;
+CVfrDefaultStore gCVfrDefaultStore;
+CVfrDataStorage gCVfrDataStorage;
|