Sync tool code to BuildTools project r1739.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9397 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -628,23 +628,27 @@ CVfrCompiler::GenCFile (
|
||||
if (!IS_RUN_STATUS(STATUS_GENBINARY)) {
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {
|
||||
if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
|
||||
Error (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
|
||||
Error (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
|
||||
goto Fail;
|
||||
}
|
||||
for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
|
||||
fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
|
||||
}
|
||||
|
||||
for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
|
||||
fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
|
||||
}
|
||||
if (mOptions.CompatibleMode) {
|
||||
gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
|
||||
}
|
||||
|
||||
gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
|
||||
|
||||
if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
|
||||
if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
|
||||
fclose (pFile);
|
||||
goto Fail;
|
||||
}
|
||||
fclose (pFile);
|
||||
goto Fail;
|
||||
}
|
||||
fclose (pFile);
|
||||
|
||||
SET_RUN_STATUS (STATUS_FINISHED);
|
||||
return;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The definition of CFormPkg's member function
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation
|
||||
Copyright (c) 2004 - 2009, Intel Corporation
|
||||
All rights reserved. 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
|
||||
@@ -1228,7 +1228,7 @@ static struct {
|
||||
{ sizeof (EFI_IFR_INCONSISTENT_IF), 1 }, // EFI_IFR_INCONSISTENT_IF_OP
|
||||
{ sizeof (EFI_IFR_EQ_ID_VAL), 0 }, // EFI_IFR_EQ_ID_VAL_OP
|
||||
{ sizeof (EFI_IFR_EQ_ID_ID), 0 }, // EFI_IFR_EQ_ID_ID_OP
|
||||
{ sizeof (EFI_IFR_EQ_ID_LIST), 0 }, // EFI_IFR_EQ_ID_LIST_OP - 0x14
|
||||
{ sizeof (EFI_IFR_EQ_ID_VAL_LIST), 0 }, // EFI_IFR_EQ_ID_LIST_OP - 0x14
|
||||
{ sizeof (EFI_IFR_AND), 0 }, // EFI_IFR_AND_OP
|
||||
{ sizeof (EFI_IFR_OR), 0 }, // EFI_IFR_OR_OP
|
||||
{ sizeof (EFI_IFR_NOT), 0 }, // EFI_IFR_NOT_OP
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The definition of CFormPkg's member function
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation
|
||||
Copyright (c) 2004 - 2009, Intel Corporation
|
||||
All rights reserved. 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
|
||||
@@ -1568,12 +1568,12 @@ public:
|
||||
|
||||
class CIfrEqIdList : public CIfrObj, public CIfrOpHeader {
|
||||
private:
|
||||
EFI_IFR_EQ_ID_LIST *mEqIdVList;
|
||||
EFI_IFR_EQ_ID_VAL_LIST *mEqIdVList;
|
||||
|
||||
public:
|
||||
CIfrEqIdList (
|
||||
IN UINT32 LineNo
|
||||
) : CIfrObj (EFI_IFR_EQ_ID_LIST_OP, (CHAR8 **)&mEqIdVList, sizeof (EFI_IFR_EQ_ID_LIST), TRUE),
|
||||
) : CIfrObj (EFI_IFR_EQ_ID_LIST_OP, (CHAR8 **)&mEqIdVList, sizeof (EFI_IFR_EQ_ID_VAL_LIST), TRUE),
|
||||
CIfrOpHeader (EFI_IFR_EQ_ID_LIST_OP, &mEqIdVList->Header) {
|
||||
SetLineNo (LineNo);
|
||||
mEqIdVList->QuestionId = EFI_QUESTION_ID_INVALID;
|
||||
@@ -1584,7 +1584,7 @@ public:
|
||||
VOID UpdateIfrBuffer (
|
||||
) {
|
||||
_EMIT_PENDING_OBJ();
|
||||
mEqIdVList = (EFI_IFR_EQ_ID_LIST *) GetObjBinAddr();
|
||||
mEqIdVList = (EFI_IFR_EQ_ID_VAL_LIST *) GetObjBinAddr();
|
||||
UpdateHeader (&mEqIdVList->Header);
|
||||
}
|
||||
|
||||
|
@@ -1911,7 +1911,7 @@ vfrStatementOrderedList :
|
||||
>>
|
||||
L:OrderedList << OLObj.SetLineNo(L->getLine()); >>
|
||||
vfrQuestionHeader[OLObj] ","
|
||||
<< OLObj.SetMaxContainers ((UINT8)_GET_CURRQEST_VARSIZE()); >>
|
||||
<< OLObj.SetMaxContainers ((UINT8) _GET_CURRQEST_ARRAY_SIZE()); >>
|
||||
{
|
||||
MaxContainers "=" M:Number "," << OLObj.SetMaxContainers (_STOU8(M->getText())); >>
|
||||
}
|
||||
@@ -3179,6 +3179,7 @@ private:
|
||||
|
||||
UINT8 _GET_CURRQEST_DATATYPE ();
|
||||
UINT32 _GET_CURRQEST_VARSIZE ();
|
||||
UINT32 _GET_CURRQEST_ARRAY_SIZE();
|
||||
|
||||
public:
|
||||
VOID _PCATCH (IN INTN, IN INTN, IN ANTLRTokenPtr, IN CHAR8 *);
|
||||
@@ -3286,6 +3287,37 @@ EfiVfrParser::_GET_CURRQEST_VARTINFO (
|
||||
return mCurrQestVarInfo;
|
||||
}
|
||||
|
||||
UINT32
|
||||
EfiVfrParser::_GET_CURRQEST_ARRAY_SIZE (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT8 Size = 1;
|
||||
|
||||
switch (mCurrQestVarInfo.mVarType) {
|
||||
case EFI_IFR_TYPE_NUM_SIZE_8:
|
||||
Size = 1;
|
||||
break;
|
||||
|
||||
case EFI_IFR_TYPE_NUM_SIZE_16:
|
||||
Size = 2;
|
||||
break;
|
||||
|
||||
case EFI_IFR_TYPE_NUM_SIZE_32:
|
||||
Size = 4;
|
||||
break;
|
||||
|
||||
case EFI_IFR_TYPE_NUM_SIZE_64:
|
||||
Size = 8;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (mCurrQestVarInfo.mVarTotalSize / Size);
|
||||
}
|
||||
|
||||
UINT8
|
||||
EfiVfrParser::_GET_CURRQEST_DATATYPE (
|
||||
VOID
|
||||
|
Reference in New Issue
Block a user