From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.35579.1628855111557242670 for ; Fri, 13 Aug 2021 04:45:12 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bob.c.feng@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10074"; a="215539839" X-IronPort-AV: E=Sophos;i="5.84,318,1620716400"; d="scan'208";a="215539839" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2021 04:45:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,318,1620716400"; d="scan'208";a="508190651" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.137]) by fmsmga004.fm.intel.com with ESMTP; 13 Aug 2021 04:45:08 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Yuwei Chen Subject: [Patch 1/2] BaseTools: Enable VfrCompile to dump variable default value Date: Fri, 13 Aug 2021 19:45:06 +0800 Message-Id: <20210813114506.2012-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.29.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3562 Create new command line option to have VfrCompile generate a Json format file that contains the EFI Variable related information including: 1. The C struct associate the EFI variable 2. The variable vendor Guid, name and attribute 3. The variable field's default value Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 54 +++++++ BaseTools/Source/C/VfrCompile/VfrCompiler.h | 5 + BaseTools/Source/C/VfrCompile/VfrSyntax.g | 6 +- .../Source/C/VfrCompile/VfrUtilityLib.cpp | 145 +++++++++++++++++- BaseTools/Source/C/VfrCompile/VfrUtilityLib.h | 14 +- 5 files changed, 219 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Sour= ce/C/VfrCompile/VfrCompiler.cpp index 5f4d262d85c5..f13562be6727 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp @@ -76,10 +76,11 @@ CVfrCompiler::OptionInitialization ( mOptions.CPreprocessorOptions =3D NULL;=0D mOptions.HasOverrideClassGuid =3D FALSE;=0D mOptions.WarningAsError =3D FALSE;=0D mOptions.AutoDefault =3D FALSE;=0D mOptions.CheckDefault =3D FALSE;=0D + mOptions.GenJson =3D FALSE;=0D memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));=0D =0D if (Argc =3D=3D 1) {=0D Usage ();=0D SET_RUN_STATUS (STATUS_DEAD);=0D @@ -93,10 +94,12 @@ CVfrCompiler::OptionInitialization ( return;=0D } else if (stricmp(Argv[Index], "--version") =3D=3D 0) {=0D Version ();=0D SET_RUN_STATUS (STATUS_DEAD);=0D return;=0D + } else if (stricmp(Argv[Index], "--variable") =3D=3D 0) {=0D + mOptions.GenJson =3D TRUE;=0D } else if (stricmp(Argv[Index], "-l") =3D=3D 0) {=0D mOptions.CreateRecordListFile =3D TRUE;=0D gCIfrRecordInfoDB.TurnOn ();=0D } else if (stricmp(Argv[Index], "-i") =3D=3D 0) {=0D Index++;=0D @@ -203,10 +206,13 @@ CVfrCompiler::OptionInitialization ( goto Fail;=0D }=0D if (SetRecordListFileName () !=3D 0) {=0D goto Fail;=0D }=0D + if (SetRecordListJsonFileName () !=3D 0) {=0D + goto Fail;=0D + }=0D return;=0D =0D Fail:=0D SET_RUN_STATUS (STATUS_DEAD);=0D =0D @@ -458,10 +464,38 @@ CVfrCompiler::SetRecordListFileName ( =0D strcpy (mOptions.RecordListFile, mOptions.OutputDirectory);=0D strcat (mOptions.RecordListFile, mOptions.VfrBaseFileName);=0D strcat (mOptions.RecordListFile, VFR_RECORDLIST_FILENAME_EXTENSION);=0D =0D + return 0;=0D +}=0D +INT8=0D +CVfrCompiler::SetRecordListJsonFileName (=0D + VOID=0D + )=0D +{=0D + INTN Length;=0D +=0D + if (mOptions.VfrBaseFileName =3D=3D NULL) {=0D + return -1;=0D + }=0D +=0D + Length =3D strlen (mOptions.OutputDirectory) +=0D + strlen (mOptions.VfrBaseFileName) +=0D + strlen (VFR_RECORDLIST_JSON_FILENAME_EXTENSION) +=0D + 1;=0D +=0D + mOptions.RecordListJsonFile =3D (CHAR8 *) malloc (Length);=0D + if (mOptions.RecordListJsonFile =3D=3D NULL) {=0D + return -1;=0D + }=0D +=0D + strcpy (mOptions.RecordListJsonFile, mOptions.OutputDirectory);=0D + strcat (mOptions.RecordListJsonFile, mOptions.VfrBaseFileName);=0D + strcat (mOptions.RecordListJsonFile, VFR_RECORDLIST_JSON_FILENAME_EXTENS= ION);=0D +=0D +=0D return 0;=0D }=0D =0D CVfrCompiler::CVfrCompiler (=0D IN INT32 Argc,=0D @@ -565,10 +599,11 @@ CVfrCompiler::Usage ( " format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",=0D " -w --warning-as-error",=0D " treat warning as an error",=0D " -a --autodefaut generate default value for question opcode if s= ome default is missing",=0D " -d --checkdefault check the default information in a question opc= ode",=0D + " --variable generate default_data binary",=0D NULL=0D };=0D for (Index =3D 0; Help[Index] !=3D NULL; Index++) {=0D fprintf (stdout, "%s\n", Help[Index]);=0D }=0D @@ -902,10 +937,28 @@ CVfrCompiler::GenRecordListFile ( =0D Err1:=0D fclose (pInFile);=0D }=0D =0D +VOID=0D +CVfrCompiler::GenRecordListJsonFile(=0D + VOID=0D + )=0D +{=0D + if (!mOptions.GenJson)=0D + return;=0D +=0D + FILE *pOutFile2 =3D NULL;=0D + if ((pOutFile2 =3D fopen (LongFilePath (mOptions.RecordListJsonFile), "w= ")) =3D=3D NULL) {=0D + DebugError (NULL, 0, 0001, "Error opening the record list file", "%s",= mOptions.RecordListJsonFile );=0D + }=0D + gCVfrBufferConfig.DumpJson(pOutFile2);=0D + fclose (pOutFile2);=0D +=0D + return;=0D +=0D +}=0D int=0D main (=0D IN int Argc,=0D IN char **Argv=0D )=0D @@ -919,10 +972,11 @@ main ( Compiler.Compile();=0D Compiler.AdjustBin();=0D Compiler.GenBinary();=0D Compiler.GenCFile();=0D Compiler.GenRecordListFile ();=0D + Compiler.GenRecordListJsonFile ();=0D =0D Status =3D Compiler.RunStatus ();=0D if ((Status =3D=3D STATUS_DEAD) || (Status =3D=3D STATUS_FAILED)) {=0D return 2;=0D }=0D diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.h b/BaseTools/Source= /C/VfrCompile/VfrCompiler.h index b6e207d2ce1a..04fa4ed8eaf5 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h @@ -31,18 +31,21 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // Specify the filename extensions for the files we generate.=0D //=0D #define VFR_PREPROCESS_FILENAME_EXTENSION ".i"=0D #define VFR_PACKAGE_FILENAME_EXTENSION ".hpk"=0D #define VFR_RECORDLIST_FILENAME_EXTENSION ".lst"=0D +#define VFR_RECORDLIST_JSON_FILENAME_EXTENSION "_var.json"=0D =0D typedef struct {=0D CHAR8 *VfrFileName;=0D CHAR8 *RecordListFile;=0D + CHAR8 *RecordListJsonFile;=0D CHAR8 *PkgOutputFileName;=0D CHAR8 *COutputFileName;=0D bool CreateRecordListFile;=0D bool CreateIfrPkgFile;=0D + bool GenJson;=0D CHAR8 *OutputDirectory;=0D CHAR8 *PreprocessorOutputFileName;=0D CHAR8 *VfrBaseFileName; // name of input VFR file with no path or ext= ension=0D CHAR8 *IncludePaths;=0D bool SkipCPreprocessor;=0D @@ -78,10 +81,11 @@ class CVfrCompiler { INT8 SetBaseFileName (VOID);=0D INT8 SetPkgOutputFileName (VOID);=0D INT8 SetCOutputFileName(VOID);=0D INT8 SetPreprocessorOutputFileName (VOID);=0D INT8 SetRecordListFileName (VOID);=0D + INT8 SetRecordListJsonFileName (VOID);=0D =0D VOID SET_RUN_STATUS (IN COMPILER_RUN_STATUS);=0D BOOLEAN IS_RUN_STATUS (IN COMPILER_RUN_STATUS);=0D =0D public:=0D @@ -100,9 +104,10 @@ class CVfrCompiler { VOID Compile (VOID);=0D VOID AdjustBin (VOID);=0D VOID GenBinary (VOID);=0D VOID GenCFile (VOID);=0D VOID GenRecordListFile (VOID);=0D + VOID GenRecordListJsonFile (VOID);=0D VOID DebugError (IN CHAR8*, IN UINT32, IN UINT32, IN CONS= T CHAR8*, IN CONST CHAR8*, ...);=0D };=0D =0D #endif=0D diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C= /VfrCompile/VfrSyntax.g index 3f896c6f1acc..81a40d44cb36 100644 --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g @@ -1130,22 +1130,24 @@ vfrStatementVarStoreEfi : = StoreName,=0D = &Guid,=0D = &gCVfrVarDataTypeDB,=0D = TypeName,=0D = VarStoreId,=0D - = IsBitVarStore=0D + = IsBitVarStore,=0D + = Attr=0D = ), LineNum);=0D _PCATCH(gCVfrData= Storage.GetVarStoreId(StoreName, &VarStoreId, &Guid), SN);=0D _PCATCH(gCVfrVarD= ataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);=0D } else {=0D _PCATCH(gCVfrDataSt= orage.DeclareBufferVarStore (=0D = TN->getText(),=0D = &Guid,=0D = &gCVfrVarDataTypeDB,=0D = TypeName,=0D = VarStoreId,=0D - = FALSE=0D + = FALSE,=0D + = Attr=0D = ), LineNum);=0D _PCATCH(gCVfrData= Storage.GetVarStoreId(TN->getText(), &VarStoreId, &Guid), VN);=0D _PCATCH(gCVfrVarD= ataTypeDB.GetDataTypeSize(TypeName, &Size), N->getLine());=0D }=0D VSEObj.SetGuid (&Gu= id);=0D diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/So= urce/C/VfrCompile/VfrUtilityLib.cpp index 2b9b5dbb1ca5..0cf2b950de74 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -283,10 +283,150 @@ CVfrBufferConfig::Select ( }=0D =0D return 1;=0D }=0D =0D +VOID=0D +CVfrBufferConfig::DumpJson (=0D + IN FILE *pFile=0D + )=0D +{=0D + SVfrDataType *pTNode;=0D + SVfrDataField *pFNode;=0D + SConfigItem *pItem;=0D + SConfigInfo *pInfo;=0D + SConfigInfo *pInfoIndex =3D NULL;=0D + SVfrVarStorageNode *pVsNode;=0D + CHAR8 *DefaultStoreId =3D "0000";=0D + UINT8 indentation =3D 0;=0D +=0D +=0D + fprintf (pFile, "{\n");=0D + fprintf (pFile, "%*c\"DataStruct\" : {\n", 2 , ' ');=0D + for (pTNode =3D gCVfrVarDataTypeDB.GetDataTypeList(); pTNode !=3D NULL; = pTNode =3D pTNode->mNext) {=0D + fprintf (pFile, "%*c\"%s\" : [\n", 4, ' ',pTNode->mTypeName);=0D + for (pFNode =3D pTNode->mMembers; pFNode !=3D NULL; pFNode =3D pFNode-= >mNext) {=0D + fprintf (pFile, "%*c{ \n", 6 ,' ');=0D + fprintf (pFile,"%*c\"Name\": \"%s\",\n", 8 , ' ', pFNode->mFieldName= );=0D + if (pFNode->mArrayNum > 0) {=0D + fprintf (pFile,"%*c\"Type\": \"%s[%d]\",\n", 8 , ' ', pFNode->mFie= ldType->mTypeName,pFNode->mArrayNum);=0D + } else {=0D + fprintf (pFile,"%*c\"Type\": \"%s\",\n", 8 , ' ', pFNode->mFieldTy= pe->mTypeName);=0D + }=0D + fprintf (pFile,"%*c\"Offset\": %d\n", 8 , ' ', pFNode->mOffset);=0D +=0D + if (pFNode->mNext =3D=3D NULL) {=0D + fprintf (pFile, "%*c}\n", 6 ,' ');=0D + }=0D + else {=0D + fprintf (pFile, "%*c},\n", 6 ,' ');=0D + }=0D + }=0D + if (pTNode->mNext =3D=3D NULL) {=0D + fprintf (pFile, "%*c]\n", 4, ' ');=0D + }=0D + else {=0D + fprintf (pFile, "%*c],\n", 4, ' ');=0D + }=0D + }=0D + fprintf (pFile, "%*c},\n", 2, ' ');=0D +=0D + fprintf(pFile, "%*c\"DataStructAttribute\": {\n", 2, ' ');=0D + for (pTNode =3D gCVfrVarDataTypeDB.GetDataTypeList(); pTNode !=3D NULL; = pTNode =3D pTNode->mNext) {=0D + fprintf(pFile, "%*c\"%s\": {\n", 4, ' ', pTNode->mTypeName);=0D + fprintf(pFile, "%*c\"Alignment\": %u,\n", 6, ' ',pTNode->mAlign);=0D + fprintf(pFile, "%*c\"TotalSize\": %u\n", 6, ' ',pTNode->mTotalSize);=0D + if (pTNode->mNext =3D=3D NULL) {=0D + fprintf(pFile, "%*c}\n", 4, ' ');=0D + }=0D + else {=0D + fprintf(pFile, "%*c},\n", 4, ' ');=0D + }=0D + }=0D + fprintf (pFile, "%*c},\n", 2, ' ');=0D +=0D + fprintf (pFile, "%*c\"VarDefine\": {\n", 2, ' ');=0D + for (pVsNode =3D gCVfrDataStorage.GetBufferVarStoreList(); pVsNode !=3D = NULL; pVsNode =3D pVsNode->mNext) {=0D + fprintf (pFile, "%*c\"%s\" : {\n", 4, ' ', pVsNode->mVarStoreName);=0D + fprintf (pFile, "%*c\"Type\" : \"%s\",\n", 6, ' ', pVsNode->mStorageIn= fo.mDataType->mTypeName);=0D + fprintf (pFile, "%*c\"Attributes\" : %d\n", 6, ' ', pVsNode->mAttribut= es);=0D + if (pVsNode->mNext =3D=3D NULL) {=0D + fprintf(pFile, "%*c}\n", 4, ' ');=0D + }=0D + else {=0D + fprintf(pFile, "%*c},\n", 4, ' ');=0D + }=0D + }=0D + fprintf (pFile, "%*c},\n", 2, ' ');=0D +=0D + indentation =3D 0;=0D + fprintf (pFile, "%*c\"Data\" : [\n",2, ' ');=0D + for (pItem =3D mItemListHead; pItem!=3DNULL; pItem =3D pItem->mNext) {=0D + if (pItem->mId =3D=3D NULL) {=0D + continue;=0D + }=0D +=0D + DefaultStoreId =3D pItem->mId;=0D + //find the last pInfo whose value is not 0=0D + if (pItem->mNext =3D=3D NULL) {=0D + for (pInfo =3D pItem->mInfoStrList; pInfo !=3D NULL; pInfo =3D pInfo= ->mNext) {=0D + if(*pInfo->mValue !=3D0) {=0D + pInfoIndex =3D pInfo;=0D + }=0D + }=0D + }=0D + for (pInfo =3D pItem->mInfoStrList; pInfo !=3D NULL; pInfo =3D pInfo->= mNext) {=0D + bool pass =3D 1;=0D + for (int i=3D0;imWidth;i++){=0D + pass &=3D (*(pInfo->mValue+i) =3D=3D 0);=0D + }=0D + if (pass) {=0D + continue;=0D + }=0D + fprintf (pFile, "%*c{\n",4, ' ');=0D + fprintf(pFile, "%*c\"VendorGuid\": \"{0x%02x, 0x%02x, 0x%02x, { 0x%0= 2x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\",\n",=0D + 6,=0D + ' ',=0D + pItem->mGuid->Data1,=0D + pItem->mGuid->Data2,=0D + pItem->mGuid->Data3,=0D + pItem->mGuid->Data4[0],=0D + pItem->mGuid->Data4[1],=0D + pItem->mGuid->Data4[2],=0D + pItem->mGuid->Data4[3],=0D + pItem->mGuid->Data4[4],=0D + pItem->mGuid->Data4[5],=0D + pItem->mGuid->Data4[6],=0D + pItem->mGuid->Data4[7]=0D + );=0D + fprintf (pFile, "%*c\"VarName\": \"%s\",\n", 6, ' ', pItem->mName);= =0D + fprintf (pFile, "%*c\"DefaultStore\": \"%s\",\n", 6, ' ', DefaultSto= reId);=0D + fprintf (pFile, "%*c\"Size\": %u,\n", 6, ' ', pInfo->mWidth);=0D + fprintf (pFile, "%*c\"Offset\": %u,\n", 6, ' ',pInfo->mOffset);=0D + fprintf (pFile, "%*c\"Value\": \"0x", 6, ' ');=0D + for (int i =3D pInfo->mWidth -1 ; i>=3D0; i--) {=0D + fprintf (pFile, "%02x", *(pInfo->mValue+i));=0D + }=0D + fprintf (pFile,"\"\n");=0D + fprintf(pFile, "%*c},\n", 4, ' ');=0D + }=0D + }=0D + //End item=0D + fprintf (pFile, "%*c{\n",4, ' ');=0D + fprintf(pFile, "%*c\"VendorGuid\": \"NA\",\n", 6, ' ');=0D + fprintf (pFile, "%*c\"VarName\": \"NA\",\n", 6, ' ');=0D + fprintf (pFile, "%*c\"DefaultStore\": \"NA\",\n", 6, ' ');=0D + fprintf (pFile, "%*c\"Size\": 0,\n", 6, ' ');=0D + fprintf (pFile, "%*c\"Offset\": 0,\n", 6, ' ');=0D + fprintf (pFile, "%*c\"Value\": \"0x00\"\n", 6, ' ');=0D + fprintf(pFile, "%*c}\n", 4, ' ');=0D + //End item=0D +=0D + fprintf (pFile, "%*c]\n", 2, ' ');=0D +=0D + fprintf (pFile, "}\n");=0D +}=0D UINT8=0D CVfrBufferConfig::Write (=0D IN CONST CHAR8 Mode,=0D IN CHAR8 *Name,=0D IN EFI_GUID *Guid,=0D @@ -1557,10 +1697,11 @@ SVfrVarStorageNode::SVfrVarStorageNode ( IN EFI_GUID *Guid,=0D IN CHAR8 *StoreName,=0D IN EFI_VARSTORE_ID VarStoreId,=0D IN SVfrDataType *DataType,=0D IN BOOLEAN BitsVarstore,=0D + IN UINT32 Attributes,=0D IN BOOLEAN Flag=0D )=0D {=0D if (Guid !=3D NULL) {=0D mGuid =3D *Guid;=0D @@ -1580,10 +1721,11 @@ SVfrVarStorageNode::SVfrVarStorageNode ( } else {=0D mVarStoreType =3D EFI_VFR_VARSTORE_BUFFER;=0D }=0D mStorageInfo.mDataType =3D DataType;=0D mAssignedFlag =3D Flag;=0D + mAttributes =3D Attributes;=0D }=0D =0D SVfrVarStorageNode::SVfrVarStorageNode (=0D IN CHAR8 *StoreName,=0D IN EFI_VARSTORE_ID VarStoreId=0D @@ -1842,10 +1984,11 @@ CVfrDataStorage::DeclareBufferVarStore ( IN EFI_GUID *Guid,=0D IN CVfrVarDataTypeDB *DataTypeDB,=0D IN CHAR8 *TypeName,=0D IN EFI_VARSTORE_ID VarStoreId,=0D IN BOOLEAN IsBitVarStore,=0D + IN UINT32 Attr,=0D IN BOOLEAN Flag=0D )=0D {=0D SVfrVarStorageNode *pNew =3D NULL;=0D SVfrDataType *pDataType =3D NULL;=0D @@ -1868,11 +2011,11 @@ CVfrDataStorage::DeclareBufferVarStore ( return VFR_RETURN_VARSTOREID_REDEFINED;=0D }=0D MarkVarStoreIdUsed (VarStoreId);=0D }=0D =0D - if ((pNew =3D new SVfrVarStorageNode (Guid, StoreName, VarStoreId, pData= Type, IsBitVarStore, Flag)) =3D=3D NULL) {=0D + if ((pNew =3D new SVfrVarStorageNode (Guid, StoreName, VarStoreId, pData= Type, IsBitVarStore, Attr, Flag)) =3D=3D NULL) {=0D return VFR_RETURN_OUT_FOR_RESOURCES;=0D }=0D =0D pNew->mNext =3D mBufferVarStoreList;=0D mBufferVarStoreList =3D pNew;=0D diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h b/BaseTools/Sour= ce/C/VfrCompile/VfrUtilityLib.h index 57bb0c424daf..d3842aebb13b 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h @@ -86,10 +86,11 @@ class CVfrBufferConfig { virtual UINT8 Register (IN CHAR8 *, IN EFI_GUID *,IN CHAR8 *Info =3D N= ULL);=0D virtual VOID Open (VOID);=0D virtual BOOLEAN Eof(VOID);=0D virtual UINT8 Select (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *Info =3D NU= LL);=0D virtual UINT8 Write (IN CONST CHAR8, IN CHAR8 *, IN EFI_GUID *, IN CHA= R8 *, IN UINT8, IN UINT16, IN UINT32, IN EFI_IFR_TYPE_VALUE);=0D + virtual VOID DumpJson(IN FILE *);=0D #if 0=0D virtual UINT8 Read (OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **, OUT CHAR= 8 **, OUT CHAR8 **);=0D #endif=0D virtual VOID Close (VOID);=0D virtual VOID OutputCFile (IN FILE *, IN CHAR8 *);=0D @@ -200,10 +201,18 @@ class CVfrVarDataTypeDB { =0D public:=0D CVfrVarDataTypeDB (VOID);=0D ~CVfrVarDataTypeDB (VOID);=0D =0D + inline SVfrDataType * GetDataTypeList(VOID) {=0D + return mDataTypeList;=0D + }=0D +=0D + inline UINT32 GetPackAlign(VOID) {=0D + return mPackAlign;=0D + }=0D +=0D VOID DeclareDataTypeBegin (VOID);=0D EFI_VFR_RETURN_CODE SetNewTypeName (IN CHAR8 *);=0D EFI_VFR_RETURN_CODE DataTypeAddField (IN CHAR8 *, IN CHAR8 *, IN UINT32,= IN BOOLEAN);=0D EFI_VFR_RETURN_CODE DataTypeAddBitField (IN CHAR8 *, IN CHAR8 *, IN UINT= 32, IN BOOLEAN);=0D VOID DeclareDataTypeEnd (VOID);=0D @@ -247,10 +256,11 @@ typedef enum { struct SVfrVarStorageNode {=0D EFI_GUID mGuid;=0D CHAR8 *mVarStoreName;=0D EFI_VARSTORE_ID mVarStoreId;=0D BOOLEAN mAssignedFlag; //Create varstore opcode=0D + UINT32 mAttributes;=0D struct SVfrVarStorageNode *mNext;=0D =0D EFI_VFR_VARSTORE_TYPE mVarStoreType;=0D union {=0D // EFI Variable=0D @@ -269,11 +279,11 @@ struct SVfrVarStorageNode { } mNameSpace;=0D } mStorageInfo;=0D =0D public:=0D SVfrVarStorageNode (IN EFI_GUID *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN EF= I_STRING_ID, IN UINT32, IN BOOLEAN Flag =3D TRUE);=0D - SVfrVarStorageNode (IN EFI_GUID *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN SV= frDataType *,IN BOOLEAN, IN BOOLEAN Flag =3D TRUE);=0D + SVfrVarStorageNode (IN EFI_GUID *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN SV= frDataType *,IN BOOLEAN, IN UINT32, IN BOOLEAN Flag =3D TRUE);=0D SVfrVarStorageNode (IN CHAR8 *, IN EFI_VARSTORE_ID);=0D ~SVfrVarStorageNode (VOID);=0D =0D private:=0D SVfrVarStorageNode (IN CONST SVfrVarStorageNode&); // Preven= t copy-construction=0D @@ -345,11 +355,11 @@ class CVfrDataStorage { EFI_VFR_RETURN_CODE NameTableAddItem (EFI_STRING_ID);=0D EFI_VFR_RETURN_CODE DeclareNameVarStoreEnd (EFI_GUID *);=0D =0D EFI_VFR_RETURN_CODE DeclareEfiVarStore (IN CHAR8 *, IN EFI_GUID *, IN EF= I_STRING_ID, IN UINT32, IN BOOLEAN Flag =3D TRUE);=0D =0D - EFI_VFR_RETURN_CODE DeclareBufferVarStore (IN CHAR8 *, IN EFI_GUID *, IN= CVfrVarDataTypeDB *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN BOOLEAN, IN BOOLEA= N Flag =3D TRUE);=0D + EFI_VFR_RETURN_CODE DeclareBufferVarStore (IN CHAR8 *, IN EFI_GUID *, IN= CVfrVarDataTypeDB *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN BOOLEAN, IN UINT32= Attr =3D 0, IN BOOLEAN Flag =3D TRUE);=0D =0D EFI_VFR_RETURN_CODE GetVarStoreId (IN CHAR8 *, OUT EFI_VARSTORE_ID *, IN= EFI_GUID *VarGuid =3D NULL);=0D EFI_VFR_VARSTORE_TYPE GetVarStoreType (IN EFI_VARSTORE_ID);=0D EFI_GUID * GetVarStoreGuid (IN EFI_VARSTORE_ID);=0D EFI_VFR_RETURN_CODE GetVarStoreName (IN EFI_VARSTORE_ID, OUT CHAR8 **);= =0D --=20 2.18.0.windows.1