/** @file\r
- \r
+\r
The definition of CFormPkg's member function\r
\r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
*/\r
\r
SPendingAssign::SPendingAssign (\r
- IN CHAR8 *Key, \r
- IN VOID *Addr, \r
- IN UINT32 Len, \r
+ IN CHAR8 *Key,\r
+ IN VOID *Addr,\r
+ IN UINT32 Len,\r
IN UINT32 LineNo,\r
IN CONST CHAR8 *Msg\r
)\r
\r
VOID\r
SPendingAssign::SetAddrAndLen (\r
- IN VOID *Addr, \r
+ IN VOID *Addr,\r
IN UINT32 LineNo\r
)\r
{\r
\r
VOID\r
SPendingAssign::AssignValue (\r
- IN VOID *Addr, \r
+ IN VOID *Addr,\r
IN UINT32 Len\r
)\r
{\r
\r
UINT32\r
CFormPkg::Read (\r
- IN CHAR8 *Buffer, \r
+ IN CHAR8 *Buffer,\r
IN UINT32 Size\r
)\r
{\r
OUT PACKAGE_DATA &TBuffer\r
)\r
{\r
- \r
+\r
CHAR8 *Temp;\r
UINT32 Size;\r
CHAR8 Buffer[1024];\r
}\r
fwrite (PkgHdr, sizeof (EFI_HII_PACKAGE_HEADER), 1, Output);\r
delete PkgHdr;\r
- \r
+\r
if (PkgData == NULL) {\r
Open ();\r
while ((Size = Read (Buffer, 1024)) != 0) {\r
BOOLEAN gNeedAdjustOpcode = FALSE;\r
UINT32 gAdjustOpcodeLen = 0;\r
\r
-EFI_VFR_RETURN_CODE \r
+EFI_VFR_RETURN_CODE\r
CFormPkg::GenCFile (\r
IN CHAR8 *BaseName,\r
IN FILE *pFile,\r
// For framework vfr file, the extension framework header will be added.\r
//\r
if (VfrCompatibleMode) {\r
- fprintf (pFile, " // FRAMEWORK PACKAGE HEADER Length\n");\r
- PkgLength = PkgHdr->Length + sizeof (UINT32) + 2;\r
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32)); \r
- fprintf (pFile, "\n\n // FRAMEWORK PACKAGE HEADER Type\n");\r
- PkgLength = 3;\r
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT16)); \r
- } else {\r
- fprintf (pFile, " // ARRAY LENGTH\n");\r
- PkgLength = PkgHdr->Length + sizeof (UINT32);\r
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32)); \r
- }\r
+ fprintf (pFile, " // FRAMEWORK PACKAGE HEADER Length\n");\r
+ PkgLength = PkgHdr->Length + sizeof (UINT32) + 2;\r
+ _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));\r
+ fprintf (pFile, "\n\n // FRAMEWORK PACKAGE HEADER Type\n");\r
+ PkgLength = 3;\r
+ _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT16));\r
+ } else {\r
+ fprintf (pFile, " // ARRAY LENGTH\n");\r
+ PkgLength = PkgHdr->Length + sizeof (UINT32);\r
+ _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));\r
+ }\r
\r
fprintf (pFile, "\n\n // PACKAGE HEADER\n");\r
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)PkgHdr, sizeof (EFI_HII_PACKAGE_HEADER));\r
PkgLength = sizeof (EFI_HII_PACKAGE_HEADER);\r
\r
fprintf (pFile, "\n\n // PACKAGE DATA\n");\r
- \r
+\r
if (PkgData == NULL) {\r
Open ();\r
while ((ReadSize = Read ((CHAR8 *)Buffer, BYTES_PRE_LINE * 8)) != 0) {\r
\r
EFI_VFR_RETURN_CODE\r
CFormPkg::AssignPending (\r
- IN CHAR8 *Key, \r
- IN VOID *ValAddr, \r
+ IN CHAR8 *Key,\r
+ IN VOID *ValAddr,\r
IN UINT32 ValLen,\r
IN UINT32 LineNo,\r
IN CONST CHAR8 *Msg\r
\r
VOID\r
CFormPkg::DoPendingAssign (\r
- IN CHAR8 *Key, \r
- IN VOID *ValAddr, \r
+ IN CHAR8 *Key,\r
+ IN VOID *ValAddr,\r
IN UINT32 ValLen\r
)\r
{\r
CIfrDisableIf DIObj;\r
DIObj.SetLineNo (LineNo);\r
*InsertOpcodeAddr = DIObj.GetObjBinAddr<CHAR8>();\r
- \r
+\r
//TrueOpcode\r
CIfrTrue TObj (LineNo);\r
\r
// Declare Numeric qeustion for each undefined question.\r
for (pNode = PendingAssignList; pNode != NULL; pNode = pNode->mNext) {\r
if (pNode->mFlag == PENDING) {\r
- EFI_VARSTORE_INFO Info; \r
+ EFI_VARSTORE_INFO Info;\r
EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;\r
//\r
// Register this question, assume it is normal question, not date or time question\r
gCVfrErrorHandle.HandleError (ReturnCode, pNode->mLineNo, pNode->mKey);\r
return ReturnCode;\r
}\r
- \r
+\r
#ifdef VFREXP_DEBUG\r
printf ("Undefined Question name is %s and Id is 0x%x\n", VarStr, QId);\r
#endif\r
gCVfrErrorHandle.PrintMsg (pNode->mLineNo, FName, "Error", "Var Store Type is not defined");\r
return ReturnCode;\r
}\r
- VarStoreType = lCVfrDataStorage.GetVarStoreType (Info.mVarStoreId); \r
+ VarStoreType = lCVfrDataStorage.GetVarStoreType (Info.mVarStoreId);\r
\r
if (*VarStr == '\0' && ArrayIdx != INVALID_ARRAY_INDEX) {\r
ReturnCode = lCVfrDataStorage.GetNameVarStoreInfo (&Info, ArrayIdx);\r
)\r
{\r
CHAR8 *Temp;\r
- SIfrRecord *pNode; \r
+ SIfrRecord *pNode;\r
\r
if (TBuffer.Buffer != NULL) {\r
delete[] TBuffer.Buffer;\r
\r
if (mSwitch == FALSE) {\r
return;\r
- } \r
- \r
+ }\r
+\r
for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {\r
TBuffer.Size += pNode->mBinBufLen;\r
}\r
- \r
+\r
if (TBuffer.Size != 0) {\r
TBuffer.Buffer = new CHAR8[TBuffer.Size];\r
} else {\r
return;\r
}\r
- \r
+\r
Temp = TBuffer.Buffer;\r
\r
for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {\r
}\r
}\r
\r
- return; \r
-} \r
+ return;\r
+}\r
\r
VOID\r
CIfrRecordInfoDB::IfrRecordOutput (\r
fprintf (File, "\n");\r
}\r
}\r
- \r
+\r
if (LineNo == 0) {\r
fprintf (File, "\nTotal Size of all record is 0x%08X\n", TotalSize);\r
}\r
default:\r
return FALSE;\r
}\r
-} \r
+}\r
\r
EFI_QUESTION_ID\r
CIfrRecordInfoDB::GetOpcodeQuestionId (\r
)\r
{\r
EFI_IFR_QUESTION_HEADER *QuestionHead;\r
- \r
+\r
QuestionHead = (EFI_IFR_QUESTION_HEADER *) (OpHead + 1);\r
- \r
+\r
return QuestionHead->QuestionId;\r
}\r
\r
QuestionScope = 0;\r
while (pNode != NULL) {\r
OpHead = (EFI_IFR_OP_HEADER *) pNode->mIfrBinBuf;\r
- \r
+\r
//\r
// make sure the inconsistent opcode in question scope\r
//\r
QuestionScope --;\r
}\r
}\r
- \r
+\r
if (CheckQuestionOpCode (OpHead->OpCode)) {\r
QuestionScope = 1;\r
}\r
//\r
\r
//\r
- // Count inconsistent opcode Scope \r
+ // Count inconsistent opcode Scope\r
//\r
StackCount = OpHead->Scope;\r
QuestionId = EFI_QUESTION_ID_INVALID;\r
//\r
// by IdEqual opcode to get QuestionId\r
//\r
- if (QuestionId == EFI_QUESTION_ID_INVALID && \r
+ if (QuestionId == EFI_QUESTION_ID_INVALID &&\r
CheckIdOpCode (tOpHead->OpCode)) {\r
QuestionId = *(EFI_QUESTION_ID *) (tOpHead + 1);\r
}\r
// extract inconsistent opcode list\r
// pNode is Incosistent opcode, tNode is End Opcode\r
//\r
- \r
+\r
//\r
// insert inconsistent opcode list into the right question scope by questionid\r
//\r
for (uNode = mIfrRecordListHead; uNode != NULL; uNode = uNode->mNext) {\r
tOpHead = (EFI_IFR_OP_HEADER *) uNode->mIfrBinBuf;\r
- if (CheckQuestionOpCode (tOpHead->OpCode) && \r
+ if (CheckQuestionOpCode (tOpHead->OpCode) &&\r
(QuestionId == GetOpcodeQuestionId (tOpHead))) {\r
break;\r
}\r
//\r
OpHead->OpCode = EFI_IFR_NO_SUBMIT_IF_OP;\r
}\r
- \r
+\r
//\r
// skip the default storage for Date and Time\r
//\r
Status = VFR_RETURN_MISMATCHED;\r
break;\r
}\r
- } else if (OpHead->OpCode == EFI_IFR_VARSTORE_OP || \r
+ } else if (OpHead->OpCode == EFI_IFR_VARSTORE_OP ||\r
OpHead->OpCode == EFI_IFR_VARSTORE_EFI_OP) {\r
//\r
// for new added group of varstore opcode\r
tNode = pNode;\r
while (tNode->mNext != NULL) {\r
tOpHead = (EFI_IFR_OP_HEADER *) tNode->mNext->mIfrBinBuf;\r
- if (tOpHead->OpCode != EFI_IFR_VARSTORE_OP && \r
+ if (tOpHead->OpCode != EFI_IFR_VARSTORE_OP &&\r
tOpHead->OpCode != EFI_IFR_VARSTORE_EFI_OP) {\r
- break; \r
+ break;\r
}\r
tNode = tNode->mNext;\r
}\r
if (tNode->mNext == NULL) {\r
//\r
// invalid IfrCode, IfrCode end by EndOpCode\r
- // \r
+ //\r
gCVfrErrorHandle.PrintMsg (0, NULL, "Error", "No found End Opcode in the end");\r
Status = VFR_RETURN_MISMATCHED;\r
break;\r
}\r
- \r
+\r
if (tOpHead->OpCode != EFI_IFR_END_OP) {\r
//\r
// not new added varstore, which are not needed to be adjust.\r
//\r
preNode = tNode;\r
pNode = tNode->mNext;\r
- continue; \r
+ continue;\r
} else {\r
//\r
- // move new added varstore opcode to the position befor form opcode \r
+ // move new added varstore opcode to the position befor form opcode\r
// varstore opcode between pNode and tNode\r
//\r
\r
// next node\r
//\r
preNode = pNode;\r
- pNode = pNode->mNext; \r
+ pNode = pNode->mNext;\r
}\r
- \r
+\r
//\r
// Update Ifr Opcode Offset\r
//\r
)\r
{\r
CHAR8 *ObjBinBuf = NULL;\r
- \r
+\r
//\r
// do nothing\r
//\r
if (ObjBinBuf != NULL) {\r
memmove (ObjBinBuf, mObjBinBuf, mObjBinLen);\r
}\r
- \r
+\r
//\r
// update bin buffer to package data buffer\r
//\r
delete[] mObjBinBuf;\r
mObjBinBuf = ObjBinBuf;\r
}\r
- \r
+\r
mDelayEmit = FALSE;\r
}\r
\r