You can subscribe to this list here.
| 2010 |
Jan
(18) |
Feb
(75) |
Mar
(40) |
Apr
(18) |
May
(12) |
Jun
(13) |
Jul
(17) |
Aug
(25) |
Sep
(31) |
Oct
(16) |
Nov
(20) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(5) |
Feb
(7) |
Mar
(6) |
Apr
(21) |
May
(12) |
Jun
(35) |
Jul
(29) |
Aug
(56) |
Sep
(64) |
Oct
(43) |
Nov
(60) |
Dec
(26) |
| 2012 |
Jan
(6) |
Feb
(12) |
Mar
(17) |
Apr
(10) |
May
(11) |
Jun
(13) |
Jul
(6) |
Aug
(2) |
Sep
(3) |
Oct
(9) |
Nov
(1) |
Dec
(2) |
| 2013 |
Jan
(5) |
Feb
(5) |
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(3) |
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
(4) |
Nov
(14) |
Dec
(10) |
| 2014 |
Jan
(22) |
Feb
(7) |
Mar
(3) |
Apr
(4) |
May
(1) |
Jun
(6) |
Jul
(4) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: <yd...@us...> - 2012-09-27 11:28:58
|
Revision: 2553
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2553&view=rev
Author: ydong10
Date: 2012-09-27 11:28:48 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
Refine the logic to auto generate opcode for not defined variable at the end of the form set instead of at the end of the form.
Signed-off-by: Eric Dong <eri...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp 2012-09-27 10:54:08 UTC (rev 2552)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp 2012-09-27 11:28:48 UTC (rev 2553)
@@ -2,7 +2,7 @@
VfrCompiler main class and main function.
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 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
@@ -554,11 +554,50 @@
}
VOID
+CVfrCompiler::UpdateInfoForDynamicOpcode (
+ VOID
+ )
+{
+ SIfrRecord *pRecord;
+
+ if (!gNeedAdjustOpcode) {
+ return;
+ }
+
+ //
+ // Base on the original offset info to update the record list.
+ //
+ if (!gCIfrRecordInfoDB.IfrAdjustDynamicOpcodeInRecords()) {
+ DebugError (NULL, 0, 1001, "Error parsing vfr file", "Can find the offset in the record.");
+ }
+
+ //
+ // Base on the opcode binary length to recalculate the offset for each opcode.
+ //
+ gCIfrRecordInfoDB.IfrAdjustOffsetForRecord();
+
+ //
+ // Base on the offset to find the binary address.
+ //
+ pRecord = gCIfrRecordInfoDB.GetRecordInfoFromOffset(gAdjustOpcodeOffset);
+ while (pRecord != NULL) {
+ pRecord->mIfrBinBuf = gCFormPkg.GetBufAddrBaseOnOffset(pRecord->mOffset);
+ if (pRecord->mIfrBinBuf == NULL) {
+ DebugError (NULL, 0, 0001, "Error parsing vfr file", " 0x%X. offset not allocated.", pRecord->mOffset);
+ }
+ pRecord = pRecord->mNext;
+ }
+}
+
+VOID
CVfrCompiler::AdjustBin (
VOID
)
{
EFI_VFR_RETURN_CODE Status;
+
+ UpdateInfoForDynamicOpcode ();
+
//
// Check Binary Code consistent between Form and IfrRecord
//
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h 2012-09-27 10:54:08 UTC (rev 2552)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrCompiler.h 2012-09-27 11:28:48 UTC (rev 2553)
@@ -87,6 +87,7 @@
VOID SET_RUN_STATUS (IN COMPILER_RUN_STATUS);
BOOLEAN IS_RUN_STATUS (IN COMPILER_RUN_STATUS);
+ VOID UpdateInfoForDynamicOpcode (VOID);
public:
COMPILER_RUN_STATUS RunStatus (VOID) {
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2012-09-27 10:54:08 UTC (rev 2552)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2012-09-27 11:28:48 UTC (rev 2553)
@@ -152,12 +152,39 @@
PendingAssignList = NULL;
}
+SBufferNode *
+CFormPkg::CreateNewNode (
+ VOID
+ )
+{
+ SBufferNode *Node;
+
+ Node = new SBufferNode;
+ if (Node == NULL) {
+ return NULL;
+ }
+
+ Node->mBufferStart = new CHAR8[mBufferSize];
+ if (Node->mBufferStart == NULL) {
+ delete Node;
+ return NULL;
+ } else {
+ memset (Node->mBufferStart, 0, mBufferSize);
+ Node->mBufferEnd = Node->mBufferStart + mBufferSize;
+ Node->mBufferFree = Node->mBufferStart;
+ Node->mNext = NULL;
+ }
+
+ return Node;
+}
+
CHAR8 *
CFormPkg::IfrBinBufferGet (
IN UINT32 Len
)
{
- CHAR8 *BinBuffer = NULL;
+ CHAR8 *BinBuffer = NULL;
+ SBufferNode *Node = NULL;
if ((Len == 0) || (Len > mBufferSize)) {
return NULL;
@@ -167,24 +194,11 @@
BinBuffer = mCurrBufferNode->mBufferFree;
mCurrBufferNode->mBufferFree += Len;
} else {
- SBufferNode *Node;
-
- Node = new SBufferNode;
+ Node = CreateNewNode ();
if (Node == NULL) {
return NULL;
}
- Node->mBufferStart = new CHAR8[mBufferSize];
- if (Node->mBufferStart == NULL) {
- delete Node;
- return NULL;
- } else {
- memset (Node->mBufferStart, 0, mBufferSize);
- Node->mBufferEnd = Node->mBufferStart + mBufferSize;
- Node->mBufferFree = Node->mBufferStart;
- Node->mNext = NULL;
- }
-
if (mBufferNodeQueueTail == NULL) {
mBufferNodeQueueHead = mBufferNodeQueueTail = Node;
} else {
@@ -245,7 +259,7 @@
}
if (mReadBufferNode == NULL) {
- return 0;
+ return 0;
}
for (Index = 0; Index < Size; Index++) {
@@ -256,7 +270,7 @@
return Index;
} else {
mReadBufferOffset = 0;
- Buffer[Index] = mReadBufferNode->mBufferStart[mReadBufferOffset++];
+ Index --;
}
}
}
@@ -402,6 +416,9 @@
}
#define BYTES_PRE_LINE 0x10
+UINT32 gAdjustOpcodeOffset = 0;
+BOOLEAN gNeedAdjustOpcode = FALSE;
+UINT32 gAdjustOpcodeLen = 0;
EFI_VFR_RETURN_CODE
CFormPkg::GenCFile (
@@ -548,13 +565,236 @@
}
}
+SBufferNode *
+CFormPkg::GetBinBufferNodeForAddr (
+ IN CHAR8 *BinBuffAddr
+ )
+{
+ SBufferNode *TmpNode;
+
+ TmpNode = mBufferNodeQueueHead;
+
+ while (TmpNode != NULL) {
+ if (TmpNode->mBufferStart <= BinBuffAddr && TmpNode->mBufferFree >= BinBuffAddr) {
+ return TmpNode;
+ }
+
+ TmpNode = TmpNode->mNext;
+ }
+
+ return NULL;
+}
+
+SBufferNode *
+CFormPkg::GetNodeBefore(
+ IN SBufferNode *CurrentNode
+ )
+{
+ SBufferNode *FirstNode = mBufferNodeQueueHead;
+ SBufferNode *LastNode = mBufferNodeQueueHead;
+
+ while (FirstNode != NULL) {
+ if (FirstNode == CurrentNode) {
+ break;
+ }
+
+ LastNode = FirstNode;
+ FirstNode = FirstNode->mNext;
+ }
+
+ if (FirstNode == NULL) {
+ LastNode = NULL;
+ }
+
+ return LastNode;
+}
+
EFI_VFR_RETURN_CODE
+CFormPkg::InsertNodeBefore(
+ IN SBufferNode *CurrentNode,
+ IN SBufferNode *NewNode
+ )
+{
+ SBufferNode *LastNode = GetNodeBefore (CurrentNode);
+
+ if (LastNode == NULL) {
+ return VFR_RETURN_MISMATCHED;
+ }
+
+ NewNode->mNext = LastNode->mNext;
+ LastNode->mNext = NewNode;
+
+ return VFR_RETURN_SUCCESS;
+}
+
+CHAR8 *
+CFormPkg::GetBufAddrBaseOnOffset (
+ IN UINT32 Offset
+ )
+{
+ SBufferNode *TmpNode;
+ UINT32 TotalBufLen;
+ UINT32 CurrentBufLen;
+
+ TotalBufLen = 0;
+
+ for (TmpNode = mBufferNodeQueueHead; TmpNode != NULL; TmpNode = TmpNode->mNext) {
+ CurrentBufLen = TmpNode->mBufferFree - TmpNode->mBufferStart;
+ if (Offset >= TotalBufLen && Offset < TotalBufLen + CurrentBufLen) {
+ return TmpNode->mBufferStart + (Offset - TotalBufLen);
+ }
+
+ TotalBufLen += CurrentBufLen;
+ }
+
+ return NULL;
+}
+
+EFI_VFR_RETURN_CODE
+CFormPkg::AdjustDynamicInsertOpcode (
+ IN CHAR8 *LastFormEndAddr,
+ IN CHAR8 *InsertOpcodeAddr
+ )
+{
+ SBufferNode *LastFormEndNode;
+ SBufferNode *InsertOpcodeNode;
+ SBufferNode *NewRestoreNodeBegin;
+ SBufferNode *NewRestoreNodeEnd;
+ SBufferNode *NewLastEndNode;
+ SBufferNode *TmpNode;
+ UINT32 NeedRestoreCodeLen;
+
+ NewRestoreNodeEnd = NULL;
+
+ LastFormEndNode = GetBinBufferNodeForAddr(LastFormEndAddr);
+ InsertOpcodeNode = GetBinBufferNodeForAddr(InsertOpcodeAddr);
+
+ if (LastFormEndNode == InsertOpcodeNode) {
+ //
+ // Create New Node to save the restore opcode.
+ //
+ NeedRestoreCodeLen = InsertOpcodeAddr - LastFormEndAddr;
+ gAdjustOpcodeLen = NeedRestoreCodeLen;
+ NewRestoreNodeBegin = CreateNewNode ();
+ if (NewRestoreNodeBegin == NULL) {
+ return VFR_RETURN_OUT_FOR_RESOURCES;
+ }
+ memcpy (NewRestoreNodeBegin->mBufferFree, LastFormEndAddr, NeedRestoreCodeLen);
+ NewRestoreNodeBegin->mBufferFree += NeedRestoreCodeLen;
+
+ //
+ // Override the restore buffer data.
+ //
+ memcpy (LastFormEndAddr, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr);
+ InsertOpcodeNode->mBufferFree -= NeedRestoreCodeLen;
+ memset (InsertOpcodeNode->mBufferFree, 0, NeedRestoreCodeLen);
+ } else {
+ //
+ // Create New Node to save the restore opcode.
+ //
+ NeedRestoreCodeLen = LastFormEndNode->mBufferFree - LastFormEndAddr;
+ gAdjustOpcodeLen = NeedRestoreCodeLen;
+ NewRestoreNodeBegin = CreateNewNode ();
+ if (NewRestoreNodeBegin == NULL) {
+ return VFR_RETURN_OUT_FOR_RESOURCES;
+ }
+ memcpy (NewRestoreNodeBegin->mBufferFree, LastFormEndAddr, NeedRestoreCodeLen);
+ NewRestoreNodeBegin->mBufferFree += NeedRestoreCodeLen;
+ //
+ // Override the restore buffer data.
+ //
+ LastFormEndNode->mBufferFree -= NeedRestoreCodeLen;
+ //
+ // Link the restore data to new node.
+ //
+ NewRestoreNodeBegin->mNext = LastFormEndNode->mNext;
+
+ //
+ // Count the Adjust opcode len.
+ //
+ TmpNode = LastFormEndNode->mNext;
+ while (TmpNode != InsertOpcodeNode) {
+ gAdjustOpcodeLen += TmpNode->mBufferFree - TmpNode->mBufferStart;
+ TmpNode = TmpNode->mNext;
+ }
+
+ //
+ // Create New Node to save the last node of restore opcode.
+ //
+ NeedRestoreCodeLen = InsertOpcodeAddr - InsertOpcodeNode->mBufferStart;
+ gAdjustOpcodeLen += NeedRestoreCodeLen;
+ if (NeedRestoreCodeLen > 0) {
+ NewRestoreNodeEnd = CreateNewNode ();
+ if (NewRestoreNodeEnd == NULL) {
+ return VFR_RETURN_OUT_FOR_RESOURCES;
+ }
+ memcpy (NewRestoreNodeEnd->mBufferFree, InsertOpcodeNode->mBufferStart, NeedRestoreCodeLen);
+ NewRestoreNodeEnd->mBufferFree += NeedRestoreCodeLen;
+ //
+ // Override the restore buffer data.
+ //
+ memcpy (InsertOpcodeNode->mBufferStart, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr);
+ InsertOpcodeNode->mBufferFree -= InsertOpcodeAddr - InsertOpcodeNode->mBufferStart;
+
+ //
+ // Insert the last restore data node.
+ //
+ TmpNode = GetNodeBefore (InsertOpcodeNode);
+ if (TmpNode == LastFormEndNode) {
+ NewRestoreNodeBegin->mNext = NewRestoreNodeEnd;
+ } else {
+ TmpNode->mNext = NewRestoreNodeEnd;
+ }
+ //
+ // Connect the dynamic opcode node to the node before last form end node.
+ //
+ LastFormEndNode->mNext = InsertOpcodeNode;
+ }
+ }
+
+ if (mBufferNodeQueueTail->mBufferFree - mBufferNodeQueueTail->mBufferStart > 2) {
+ //
+ // End form set opcode all in the mBufferNodeQueueTail node.
+ //
+ NewLastEndNode = CreateNewNode ();
+ if (NewLastEndNode == NULL) {
+ return VFR_RETURN_OUT_FOR_RESOURCES;
+ }
+ NewLastEndNode->mBufferStart[0] = 0x29;
+ NewLastEndNode->mBufferStart[1] = 0x02;
+ NewLastEndNode->mBufferFree += 2;
+
+ mBufferNodeQueueTail->mBufferFree -= 2;
+
+ mBufferNodeQueueTail->mNext = NewRestoreNodeBegin;
+ if (NewRestoreNodeEnd != NULL) {
+ NewRestoreNodeEnd->mNext = NewLastEndNode;
+ } else {
+ NewRestoreNodeBegin->mNext = NewLastEndNode;
+ }
+
+ mBufferNodeQueueTail = NewLastEndNode;
+ } else if (mBufferNodeQueueTail->mBufferFree - mBufferNodeQueueTail->mBufferStart == 2) {
+ TmpNode = GetNodeBefore(mBufferNodeQueueTail);
+ TmpNode->mNext = NewRestoreNodeBegin;
+ if (NewRestoreNodeEnd != NULL) {
+ NewRestoreNodeEnd->mNext = mBufferNodeQueueTail;
+ } else {
+ NewRestoreNodeBegin->mNext = mBufferNodeQueueTail;
+ }
+ }
+
+ return VFR_RETURN_SUCCESS;
+}
+
+EFI_VFR_RETURN_CODE
CFormPkg::DeclarePendingQuestion (
IN CVfrVarDataTypeDB &lCVfrVarDataTypeDB,
IN CVfrDataStorage &lCVfrDataStorage,
IN CVfrQuestionDB &lCVfrQuestionDB,
IN EFI_GUID *LocalFormSetGuid,
- IN UINT32 LineNo
+ IN UINT32 LineNo,
+ OUT CHAR8 **InsertOpcodeAddr
)
{
SPendingAssign *pNode;
@@ -572,6 +812,7 @@
// DisableIf
CIfrDisableIf DIObj;
DIObj.SetLineNo (LineNo);
+ *InsertOpcodeAddr = DIObj.GetObjBinAddr ();
//TrueOpcode
CIfrTrue TObj (LineNo);
@@ -983,6 +1224,82 @@
return QuestionHead->QuestionId;
}
+SIfrRecord *
+CIfrRecordInfoDB::GetRecordInfoFromOffset (
+ IN UINT32 Offset
+ )
+{
+ SIfrRecord *pNode = NULL;
+
+ for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
+ if (pNode->mOffset == Offset) {
+ return pNode;
+ }
+ }
+
+ return pNode;
+}
+
+BOOLEAN
+CIfrRecordInfoDB::IfrAdjustDynamicOpcodeInRecords (
+ VOID
+ )
+{
+ UINT32 OpcodeOffset;
+ SIfrRecord *pNode, *pPreNode;
+ SIfrRecord *pStartNode, *pNodeBeforeStart;
+ SIfrRecord *pEndNode;
+
+ pStartNode = NULL;
+ pEndNode = NULL;
+ OpcodeOffset = 0;
+
+ //
+ // Base on the offset info to get the node.
+ //
+ for (pNode = mIfrRecordListHead; pNode->mNext != NULL; pPreNode = pNode,pNode = pNode->mNext) {
+ if (OpcodeOffset == gAdjustOpcodeOffset) {
+ pStartNode = pNode;
+ pNodeBeforeStart = pPreNode;
+ } else if (OpcodeOffset == gAdjustOpcodeOffset + gAdjustOpcodeLen) {
+ pEndNode = pPreNode;
+ }
+
+ OpcodeOffset += pNode->mBinBufLen;
+ }
+
+ //
+ // Check the value.
+ //
+ if (pEndNode == NULL || pStartNode == NULL) {
+ return FALSE;
+ }
+
+ //
+ // Adjust the node. pPreNode save the Node before mIfrRecordListTail
+ //
+ pNodeBeforeStart->mNext = pEndNode->mNext;
+ pPreNode->mNext = pStartNode;
+ pEndNode->mNext = mIfrRecordListTail;
+
+ return TRUE;
+}
+
+VOID
+CIfrRecordInfoDB::IfrAdjustOffsetForRecord (
+ VOID
+ )
+{
+ UINT32 OpcodeOffset;
+ SIfrRecord *pNode;
+
+ OpcodeOffset = 0;
+ for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
+ pNode->mOffset = OpcodeOffset;
+ OpcodeOffset += pNode->mBinBufLen;
+ }
+}
+
EFI_VFR_RETURN_CODE
CIfrRecordInfoDB::IfrRecordAdjust (
VOID
@@ -1195,11 +1512,7 @@
// Update Ifr Opcode Offset
//
if (Status == VFR_RETURN_SUCCESS) {
- OpcodeOffset = 0;
- for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
- pNode->mOffset = OpcodeOffset;
- OpcodeOffset += pNode->mBinBufLen;
- }
+ IfrAdjustOffsetForRecord ();
}
return Status;
}
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-09-27 10:54:08 UTC (rev 2552)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-09-27 11:28:48 UTC (rev 2553)
@@ -115,6 +115,10 @@
VOID _WRITE_PKG_LINE (IN FILE *, IN UINT32 , IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);
VOID _WRITE_PKG_END (IN FILE *, IN UINT32 , IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);
+ SBufferNode * GetBinBufferNodeForAddr (IN CHAR8 *);
+ SBufferNode * CreateNewNode ();
+ SBufferNode * GetNodeBefore (IN SBufferNode *);
+ EFI_VFR_RETURN_CODE InsertNodeBefore (IN SBufferNode *, IN SBufferNode *);
private:
SPendingAssign *PendingAssignList;
@@ -145,12 +149,22 @@
IN CVfrDataStorage &lCVfrDataStorage,
IN CVfrQuestionDB &lCVfrQuestionDB,
IN EFI_GUID *LocalFormSetGuid,
- IN UINT32 LineNo
+ IN UINT32 LineNo,
+ OUT CHAR8 **InsertOpcodeAddr
);
+ EFI_VFR_RETURN_CODE AdjustDynamicInsertOpcode (
+ IN CHAR8 *LastFormEndAddr,
+ IN CHAR8 *InsertOpcodeAddr
+ );
+ CHAR8 * GetBufAddrBaseOnOffset (
+ IN UINT32 Offset
+ );
};
extern CFormPkg gCFormPkg;
extern CVfrStringDB gCVfrStringDB;
+extern UINT32 gAdjustOpcodeOffset;
+extern BOOLEAN gNeedAdjustOpcode;
struct SIfrRecord {
UINT32 mLineNo;
@@ -189,6 +203,10 @@
mSwitch = FALSE;
}
+ SIfrRecord * GetRecordInfoFromOffset (IN UINT32);
+ VOID IfrAdjustOffsetForRecord (VOID);
+ BOOLEAN IfrAdjustDynamicOpcodeInRecords (VOID);
+
UINT32 IfrRecordRegister (IN UINT32, IN CHAR8 *, IN UINT8, IN UINT32);
VOID IfrRecordInfoUpdate (IN UINT32, IN UINT32, IN CHAR8*, IN UINT8, IN UINT32);
VOID IfrRecordOutput (IN FILE *, IN UINT32 LineNo);
@@ -227,6 +245,10 @@
return mObjBinBuf;
}
+ inline UINT32 GetObjBinOffset (VOID) {
+ return mPkgOffset;
+ }
+
inline UINT8 GetObjBinLen (VOID) {
return mObjBinLen;
}
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2012-09-27 10:54:08 UTC (rev 2552)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2012-09-27 11:28:48 UTC (rev 2553)
@@ -494,6 +494,7 @@
UINT8 ClassGuidNum = 0;
CIfrFormSet *FSObj = NULL;
UINT16 C, SC;
+ CHAR8* InsertOpcodeAddr = NULL;
>>
L:FormSet
Uuid "=" guidDefinition[Guid] ","
@@ -585,7 +586,34 @@
//
_DeclareDefaultFrameworkVarStore (GET_LINENO(E));
}
- CRT_END_OP (E); if (FSObj != NULL) delete FSObj;
+
+ //
+ // Declare undefined Question so that they can be used in expression.
+ //
+ if (gCFormPkg.HavePendingUnassigned()) {
+ gCFormPkg.DeclarePendingQuestion (
+ gCVfrVarDataTypeDB,
+ mCVfrDataStorage,
+ mCVfrQuestionDB,
+ &mFormsetGuid,
+ E->getLine(),
+ &InsertOpcodeAddr
+ );
+ gNeedAdjustOpcode = TRUE;
+ }
+
+ CRT_END_OP (E);
+
+ if (gNeedAdjustOpcode) {
+ gCFormPkg.AdjustDynamicInsertOpcode (
+ mLastFormEndAddr,
+ InsertOpcodeAddr
+ );
+ }
+
+ if (FSObj != NULL) {
+ delete FSObj;
+ }
>>
";"
;
@@ -1389,23 +1417,7 @@
LObj3.SetNumber (0xffff); //add end label for UEFI, label number hardcode 0xffff
}
- //
- // Declare undefined Question so that they can be used in expression.
- //
- if (gCFormPkg.HavePendingUnassigned()) {
- gCFormPkg.DeclarePendingQuestion (
- gCVfrVarDataTypeDB,
- mCVfrDataStorage,
- mCVfrQuestionDB,
- &mFormsetGuid,
- E->getLine()
- );
- }
-
- //
- // mCVfrQuestionDB.PrintAllQuestion();
- //
- CRT_END_OP (E);
+ {CIfrEnd EObj; EObj.SetLineNo (E->getLine()); mLastFormEndAddr = EObj.GetObjBinAddr (); gAdjustOpcodeOffset = EObj.GetObjBinOffset ();}
>>
";"
;
@@ -3904,6 +3916,7 @@
EFI_VARSTORE_INFO mCurrQestVarInfo;
EFI_GUID *mOverrideClassGuid;
+ CHAR8* mLastFormEndAddr;
//
// For framework vfr compatibility
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2012-09-27 10:54:15
|
Revision: 2552
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2552&view=rev
Author: ydong10
Date: 2012-09-27 10:54:08 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
Enable EFI_IFR_DEFAULT2 opcode in vfrcompile.
Signed-off-by: Eric Dong <eri...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-09-27 02:47:43 UTC (rev 2551)
+++ trunk/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h 2012-09-27 10:54:08 UTC (rev 2552)
@@ -803,6 +803,12 @@
EFI_IFR_TYPE_VALUE Value;
} EFI_IFR_DEFAULT;
+typedef struct _EFI_IFR_DEFAULT_2 {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 DefaultId;
+ UINT8 Type;
+} EFI_IFR_DEFAULT_2;
+
typedef struct _EFI_IFR_VALUE {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_VALUE;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-09-27 02:47:43 UTC (rev 2551)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2012-09-27 10:54:08 UTC (rev 2552)
@@ -923,6 +923,29 @@
}
};
+class CIfrDefault2 : public CIfrObj, public CIfrOpHeader {
+private:
+ EFI_IFR_DEFAULT_2 *mDefault;
+
+public:
+ CIfrDefault2 (
+ IN UINT16 DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD,
+ IN UINT8 Type = EFI_IFR_TYPE_OTHER
+ ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault, sizeof (EFI_IFR_DEFAULT_2)),
+ CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, sizeof (EFI_IFR_DEFAULT_2)) {
+ mDefault->Type = Type;
+ mDefault->DefaultId = DefaultId;
+ }
+
+ VOID SetDefaultId (IN UINT16 DefaultId) {
+ mDefault->DefaultId = DefaultId;
+ }
+
+ VOID SetType (IN UINT8 Type) {
+ mDefault->Type = Type;
+ }
+};
+
class CIfrValue : public CIfrObj, public CIfrOpHeader{
private:
EFI_IFR_VALUE *mValue;
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2012-09-27 02:47:43 UTC (rev 2551)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2012-09-27 10:54:08 UTC (rev 2552)
@@ -1455,28 +1455,42 @@
<<
BOOLEAN IsExp = FALSE;
EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- CIfrDefault DObj;
+ CIfrDefault *DObj = NULL;
+ CIfrDefault2 *DObj2 = NULL;
EFI_DEFAULT_ID DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
CHAR8 *VarStoreName = NULL;
EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
>>
- D:Default << DObj.SetLineNo(D->getLine()); >>
+ D:Default
(
(
- vfrStatementValue "," << IsExp = TRUE; DObj.SetScope (1); CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
- | "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] "," <<
+ "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","
+ <<
if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {
//check default value is valid for Numeric Opcode
if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {
_PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");
}
}
- DObj.SetType (_GET_CURRQEST_DATATYPE());
- DObj.SetValue(Val);
+ DObj = new CIfrDefault;
+ DObj->SetLineNo(D->getLine());
+ DObj->SetType (_GET_CURRQEST_DATATYPE());
+ DObj->SetValue(Val);
>>
+ | << IsExp = TRUE; DObj2 = new CIfrDefault2; DObj2->SetLineNo(D->getLine()); DObj2->SetScope (1); >>
+ vfrStatementValue "," << CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
)
{
- DefaultStore "=" SN:StringIdentifier "," << _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); DObj.SetDefaultId (DefaultId); >>
+ DefaultStore "=" SN:StringIdentifier "," <<
+ _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN);
+ if (DObj != NULL) {
+ DObj->SetDefaultId (DefaultId);
+ }
+
+ if (DObj2 != NULL) {
+ DObj2->SetDefaultId (DefaultId);
+ }
+ >>
}
<<
_PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), D->getLine());
@@ -1491,6 +1505,9 @@
D->getLine()
);
}
+
+ if (DObj != NULL) {delete DObj;}
+ if (DObj2 != NULL) {delete DObj2;}
>>
)
;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lg...@us...> - 2012-09-27 02:47:49
|
Revision: 2551
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2551&view=rev
Author: lgao4
Date: 2012-09-27 02:47:43 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
Fix issue in Build report to support DynamicEx type PCD.
Signed-off-by: Liming Gao <lim...@in...>
Reviewed-by: Zeng, Yurui <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/build/BuildReport.py
Modified: trunk/BaseTools/Source/Python/build/BuildReport.py
===================================================================
--- trunk/BaseTools/Source/Python/build/BuildReport.py 2012-08-15 00:34:24 UTC (rev 2550)
+++ trunk/BaseTools/Source/Python/build/BuildReport.py 2012-09-27 02:47:43 UTC (rev 2551)
@@ -94,9 +94,9 @@
'Dynamic' : ('DYN', 'Dynamic'),
'DynamicHii' : ('DYNHII', 'Dynamic'),
'DynamicVpd' : ('DYNVPD', 'Dynamic'),
- 'DynamicEx' : ('DEX', 'Dynamic'),
- 'DynamicExHii' : ('DEXHII', 'Dynamic'),
- 'DynamicExVpd' : ('DEXVPD', 'Dynamic'),
+ 'DynamicEx' : ('DEX', 'DynamicEx'),
+ 'DynamicExHii' : ('DEXHII', 'DynamicEx'),
+ 'DynamicExVpd' : ('DEXVPD', 'DynamicEx'),
}
## The look up table to map module type to driver type
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jlj...@us...> - 2012-08-15 00:34:31
|
Revision: 2550
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2550&view=rev
Author: jljusten
Date: 2012-08-15 00:34:24 +0000 (Wed, 15 Aug 2012)
Log Message:
-----------
tools_def: add GCC47 configuration to BaseTools/Conf template
The GCC 4.7 configuration needs to remove the -melf_x86_64 option from the
assembler command line. Invalid -m options are now reported as errors even
when not compiling, rather than being ignored.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paolo Bonzini <pbo...@re...>
Reviewed-by: Jordan Justen <jor...@in...>
Modified Paths:
--------------
trunk/BaseTools/Conf/tools_def.template
Modified: trunk/BaseTools/Conf/tools_def.template
===================================================================
--- trunk/BaseTools/Conf/tools_def.template 2012-08-02 10:05:32 UTC (rev 2549)
+++ trunk/BaseTools/Conf/tools_def.template 2012-08-15 00:34:24 UTC (rev 2550)
@@ -147,6 +147,9 @@
DEFINE GCC46_IA32_PREFIX = /usr/bin/
DEFINE GCC46_X64_PREFIX = /usr/bin/
+DEFINE GCC47_IA32_PREFIX = /usr/bin/
+DEFINE GCC47_X64_PREFIX = /usr/bin/
+
DEFINE UNIX_IASL_BIN = /usr/bin/iasl
#DEFINE UNIX_IASL_BIN = $(HOME)/programs/iasl
DEFINE WIN_ASL_BIN_DIR = C:\ASL
@@ -277,6 +280,12 @@
# Required to build platforms or ACPI tables:
# Intel(r) ACPI Compiler v20101013 from
# http://www.acpica.org/downloads/previous_releases.php
+# GCC47 -Linux- Requires:
+# GCC 4.7 (Native)
+# Optional:
+# Required to build platforms or ACPI tables:
+# Intel(r) ACPI Compiler v20101013 from
+# http://www.acpica.org/downloads/previous_releases.php
# ELFGCC -Linux- Requires:
# GCC(this tool chain uses whatever version of gcc and binutils that is installed in /usr/bin)
# Optional:
@@ -2610,6 +2619,14 @@
DEFINE GCC46_X64_DLINK_FLAGS = DEF(GCC45_X64_DLINK_FLAGS)
DEFINE GCC46_ASM_FLAGS = DEF(GCC45_ASM_FLAGS)
+DEFINE GCC47_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
+DEFINE GCC47_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
+DEFINE GCC47_IA32_X64_DLINK_COMMON = DEF(GCC46_IA32_X64_DLINK_COMMON)
+DEFINE GCC47_IA32_X64_ASLDLINK_FLAGS = DEF(GCC46_IA32_X64_ASLDLINK_FLAGS)
+DEFINE GCC47_IA32_X64_DLINK_FLAGS = DEF(GCC46_IA32_X64_DLINK_FLAGS)
+DEFINE GCC47_X64_DLINK_FLAGS = DEF(GCC46_X64_DLINK_FLAGS)
+DEFINE GCC47_ASM_FLAGS = DEF(GCC46_ASM_FLAGS)
+
####################################################################################
#
# Unix GCC And Intel Linux ACPI Compiler
@@ -2893,6 +2910,71 @@
####################################################################################
#
+# GCC 4.7 - This configuration is used to compile under Linux to produce
+# PE/COFF binaries using GCC 4.7.
+#
+####################################################################################
+*_GCC47_*_*_FAMILY = GCC
+
+*_GCC47_*_MAKE_PATH = make
+*_GCC47_*_ASL_PATH = DEF(UNIX_IASL_BIN)
+
+*_GCC47_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
+*_GCC47_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
+*_GCC47_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC47_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
+*_GCC47_*_APP_FLAGS =
+*_GCC47_*_ASL_FLAGS = DEF(IASL_FLAGS)
+*_GCC47_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
+
+##################
+# GCC47 IA32 definitions
+##################
+*_GCC47_IA32_OBJCOPY_PATH = DEF(GCC47_IA32_PREFIX)objcopy
+*_GCC47_IA32_CC_PATH = DEF(GCC47_IA32_PREFIX)gcc
+*_GCC47_IA32_SLINK_PATH = DEF(GCC47_IA32_PREFIX)ar
+*_GCC47_IA32_DLINK_PATH = DEF(GCC47_IA32_PREFIX)ld
+*_GCC47_IA32_ASLDLINK_PATH = DEF(GCC47_IA32_PREFIX)ld
+*_GCC47_IA32_ASM_PATH = DEF(GCC47_IA32_PREFIX)gcc
+*_GCC47_IA32_PP_PATH = DEF(GCC47_IA32_PREFIX)gcc
+*_GCC47_IA32_VFRPP_PATH = DEF(GCC47_IA32_PREFIX)gcc
+*_GCC47_IA32_ASLCC_PATH = DEF(GCC47_IA32_PREFIX)gcc
+*_GCC47_IA32_ASLPP_PATH = DEF(GCC47_IA32_PREFIX)gcc
+*_GCC47_IA32_RC_PATH = DEF(GCC47_IA32_PREFIX)objcopy
+
+*_GCC47_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
+*_GCC47_IA32_ASLDLINK_FLAGS = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
+*_GCC47_IA32_ASM_FLAGS = DEF(GCC47_ASM_FLAGS) -m32 -march=i386
+*_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os
+*_GCC47_IA32_DLINK_FLAGS = DEF(GCC47_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
+*_GCC47_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
+*_GCC47_IA32_OBJCOPY_FLAGS =
+
+##################
+# GCC47 X64 definitions
+##################
+*_GCC47_X64_OBJCOPY_PATH = DEF(GCC47_X64_PREFIX)objcopy
+*_GCC47_X64_CC_PATH = DEF(GCC47_X64_PREFIX)gcc
+*_GCC47_X64_SLINK_PATH = DEF(GCC47_X64_PREFIX)ar
+*_GCC47_X64_DLINK_PATH = DEF(GCC47_X64_PREFIX)ld
+*_GCC47_X64_ASLDLINK_PATH = DEF(GCC47_X64_PREFIX)ld
+*_GCC47_X64_ASM_PATH = DEF(GCC47_X64_PREFIX)gcc
+*_GCC47_X64_PP_PATH = DEF(GCC47_X64_PREFIX)gcc
+*_GCC47_X64_VFRPP_PATH = DEF(GCC47_X64_PREFIX)gcc
+*_GCC47_X64_ASLCC_PATH = DEF(GCC47_X64_PREFIX)gcc
+*_GCC47_X64_ASLPP_PATH = DEF(GCC47_X64_PREFIX)gcc
+*_GCC47_X64_RC_PATH = DEF(GCC47_X64_PREFIX)objcopy
+
+*_GCC47_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
+*_GCC47_X64_ASLDLINK_FLAGS = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
+*_GCC47_X64_ASM_FLAGS = DEF(GCC47_ASM_FLAGS) -m64
+*_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS)
+*_GCC47_X64_DLINK_FLAGS = DEF(GCC47_X64_DLINK_FLAGS)
+*_GCC47_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
+*_GCC47_X64_OBJCOPY_FLAGS =
+
+####################################################################################
+#
# Cygwin GCC And Intel ACPI Compiler
#
####################################################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ni...@us...> - 2012-08-02 10:05:42
|
Revision: 2549
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2549&view=rev
Author: niruiyu
Date: 2012-08-02 10:05:32 +0000 (Thu, 02 Aug 2012)
Log Message:
-----------
Keep the .eh_frame section in ELF and use the full ELF as the debug symbol.
Signed-off-by: Ruiyu Ni<rui...@in...>
Reviewed-by: Erik Bjorge<eri...@in...>
Modified Paths:
--------------
trunk/BaseTools/Conf/build_rule.template
trunk/BaseTools/Scripts/gcc4.4-ld-script
Modified: trunk/BaseTools/Conf/build_rule.template
===================================================================
--- trunk/BaseTools/Conf/build_rule.template 2012-07-26 07:04:18 UTC (rev 2548)
+++ trunk/BaseTools/Conf/build_rule.template 2012-08-02 10:05:32 UTC (rev 2549)
@@ -301,8 +301,8 @@
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
<Command.GCC>
- $(OBJCOPY) --only-keep-debug ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
- $(OBJCOPY) --strip-unneeded ${src}
+ $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
+ $(OBJCOPY) --strip-unneeded -R .eh_frame ${src}
#
#The below 2 lines are only needed for UNIXGCC tool chain, which genereates PE image directly
Modified: trunk/BaseTools/Scripts/gcc4.4-ld-script
===================================================================
--- trunk/BaseTools/Scripts/gcc4.4-ld-script 2012-07-26 07:04:18 UTC (rev 2548)
+++ trunk/BaseTools/Scripts/gcc4.4-ld-script 2012-08-02 10:05:32 UTC (rev 2549)
@@ -18,6 +18,10 @@
)
. = ALIGN(0x20);
}
+ .eh_frame ALIGN(0x20) :
+ {
+ KEEP (*(.eh_frame))
+ }
.got ALIGN(0x20) :
{
*(.got .got.*)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hc...@us...> - 2012-07-26 07:04:25
|
Revision: 2548
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2548&view=rev
Author: hchen30
Date: 2012-07-26 07:04:18 +0000 (Thu, 26 Jul 2012)
Log Message:
-----------
1. Add 'Includes' to the scope of section names which can have other items after ARCH
Assigned-by: Chen, Hesheng <hes...@in...>
Reviewed-by: Zeng, Yurui <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-07-17 01:58:45 UTC (rev 2547)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-07-26 07:04:18 UTC (rev 2548)
@@ -475,4 +475,5 @@
PCDS_DYNAMICEX_DEFAULT.upper(),
PCDS_DYNAMICEX_VPD.upper(),
PCDS_DYNAMICEX_HII.upper(),
- TAB_BUILD_OPTIONS.upper()]
+ TAB_BUILD_OPTIONS.upper(),
+ TAB_INCLUDES.upper()]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2012-07-17 01:58:52
|
Revision: 2547
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2547&view=rev
Author: yingke
Date: 2012-07-17 01:58:45 +0000 (Tue, 17 Jul 2012)
Log Message:
-----------
Fix bug to allow optional PCD value in DSC.
Reviewed-by: Su Jikui <jik...@in...>
Signed-off-by: Liu Yingke <yin...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-07-06 08:52:13 UTC (rev 2546)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-07-17 01:58:45 UTC (rev 2547)
@@ -1457,10 +1457,11 @@
EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self._FileWithError, Line=self._LineIndex+1,
ExtraData="%s.%s|%s" % (self._ValueList[0], self._ValueList[1], self._ValueList[2]))
PcdValue = ValList[Index]
- try:
- ValList[Index] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValList[Index] = Value.result
+ if PcdValue:
+ try:
+ ValList[Index] = ValueExpression(PcdValue, self._Macros)(True)
+ except WrnExpression, Value:
+ ValList[Index] = Value.result
if ValList[Index] == 'True':
ValList[Index] = '1'
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-07-06 08:52:13 UTC (rev 2546)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-07-17 01:58:45 UTC (rev 2547)
@@ -627,7 +627,7 @@
if not IsValid and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self.MetaFile, Line=LineNo,
ExtraData="%s.%s|%s" % (TokenSpaceGuid, PcdCName, Setting))
- if PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
+ if ValueList[Index] and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
try:
ValueList[Index] = ValueExpression(ValueList[Index], GlobalData.gPlatformPcds)(True)
except WrnExpression, Value:
@@ -649,10 +649,11 @@
ValueList[Index] = '1'
elif ValueList[Index] == 'False':
ValueList[Index] = '0'
- Valid, ErrStr = CheckPcdDatum(self._DecPcds[PcdCName, TokenSpaceGuid].DatumType, ValueList[Index])
- if not Valid:
- EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=LineNo,
- ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
+ if ValueList[Index]:
+ Valid, ErrStr = CheckPcdDatum(self._DecPcds[PcdCName, TokenSpaceGuid].DatumType, ValueList[Index])
+ if not Valid:
+ EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=LineNo,
+ ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
return ValueList
## Retrieve all PCD settings in platform
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2012-07-06 08:52:22
|
Revision: 2546
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2546&view=rev
Author: xfzyr
Date: 2012-07-06 08:52:13 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
Sync BaseTool Trunk with BaseTool OC to support Python 2.7.2 and cx-freeze 4.2.3.
Signed-off-by: Yurui Zeng <lim...@in...>
Reviewed-by: Liming Gao <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Makefile
Modified: trunk/BaseTools/Source/Python/Makefile
===================================================================
--- trunk/BaseTools/Source/Python/Makefile 2012-07-03 06:44:40 UTC (rev 2545)
+++ trunk/BaseTools/Source/Python/Makefile 2012-07-06 08:52:13 UTC (rev 2546)
@@ -15,7 +15,13 @@
!ERROR PYTHON_FREEZER_PATH must be defined!
!ENDIF
+!IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze)
+# Using cx_Freeze 4.2.3 with Python 2.7.2
+FREEZE=$(PYTHON_FREEZER_PATH)\cxfreeze
+!ELSE
+# Using cx_Freeze 3.0.3 with Python 2.5.4
FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe
+!ENDIF
MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2012-07-03 06:44:51
|
Revision: 2545
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2545&view=rev
Author: yingke
Date: 2012-07-03 06:44:40 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
Fix PCD bugs:
1. The PCD value in DSC does not match the data type declared in DEC files.
2. Cannot evaluate expression which contains "|" in it.
3. The max size of PCD defined in DSC is always ignored.
4. The PCD value defined in DSC cannot be retrieved sometimes.
Reviewed-by: Su Jikui <jik...@in...>
Reviewed-by: Zeng Yurui <yur...@in...>
Signed-off-by: Liu Yingke <yin...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
trunk/BaseTools/Source/Python/Common/Misc.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Added Paths:
-----------
trunk/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2012-07-03 02:53:29 UTC (rev 2544)
+++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2012-07-03 06:44:40 UTC (rev 2545)
@@ -300,7 +300,6 @@
for Pcd in Pkg.Pcds:
DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2]))
- Platform.IsPlatformPcdDeclared(DecPcds)
Platform.SkuName = self.SkuId
for Name, Guid in PcdSet:
Modified: trunk/BaseTools/Source/Python/Common/Misc.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/Misc.py 2012-07-03 02:53:29 UTC (rev 2544)
+++ trunk/BaseTools/Source/Python/Common/Misc.py 2012-07-03 06:44:40 UTC (rev 2545)
@@ -30,6 +30,7 @@
from Common import GlobalData as GlobalData
from DataType import *
from BuildToolError import *
+from CommonDataClass.DataClass import *
## Regular expression used to find out place holders in string template
gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE|re.UNICODE)
@@ -1176,6 +1177,113 @@
Opr.close()
Opw.close()
+## AnalyzeDscPcd
+#
+# Analyze DSC PCD value, since there is no data type info in DSC
+# This fuction is used to match functions (AnalyzePcdData, AnalyzeHiiPcdData, AnalyzeVpdPcdData) used for retrieving PCD value from database
+# 1. Feature flag: TokenSpace.PcdCName|PcdValue
+# 2. Fix and Patch:TokenSpace.PcdCName|PcdValue[|MaxSize]
+# 3. Dynamic default:
+# TokenSpace.PcdCName|PcdValue[|VOID*[|MaxSize]]
+# TokenSpace.PcdCName|PcdValue
+# 4. Dynamic VPD:
+# TokenSpace.PcdCName|VpdOffset[|VpdValue]
+# TokenSpace.PcdCName|VpdOffset[|MaxSize[|VpdValue]]
+# 5. Dynamic HII:
+# TokenSpace.PcdCName|HiiString|VaiableGuid|VariableOffset[|HiiValue]
+# PCD value needs to be located in such kind of string, and the PCD value might be an expression in which
+# there might have "|" operator, also in string value.
+#
+# @param Setting: String contain information described above with "TokenSpace.PcdCName|" stripped
+# @param PcdType: PCD type: feature, fixed, dynamic default VPD HII
+# @param DataType: The datum type of PCD: VOID*, UNIT, BOOL
+# @retval:
+# ValueList: A List contain fields described above
+# IsValid: True if conforming EBNF, otherwise False
+# Index: The index where PcdValue is in ValueList
+#
+def AnalyzeDscPcd(Setting, PcdType, DataType=''):
+ Setting = Setting.strip()
+ # There might be escaped quote in a string: \", \\\"
+ Data = Setting.replace('\\\\', '//').replace('\\\"', '\\\'')
+ # There might be '|' in string and in ( ... | ... ), replace it with '-'
+ NewStr = ''
+ InStr = False
+ Pair = 0
+ for ch in Data:
+ if ch == '"':
+ InStr = not InStr
+ elif ch == '(' and not InStr:
+ Pair += 1
+ elif ch == ')' and not InStr:
+ Pair -= 1
+
+ if (Pair > 0 or InStr) and ch == TAB_VALUE_SPLIT:
+ NewStr += '-'
+ else:
+ NewStr += ch
+ FieldList = []
+ StartPos = 0
+ while True:
+ Pos = NewStr.find(TAB_VALUE_SPLIT, StartPos)
+ if Pos < 0:
+ FieldList.append(Setting[StartPos:].strip())
+ break
+ FieldList.append(Setting[StartPos:Pos].strip())
+ StartPos = Pos + 1
+
+ IsValid = True
+ if PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_FEATURE_FLAG):
+ Value = FieldList[0]
+ Size = ''
+ if len(FieldList) > 1:
+ Size = FieldList[1]
+ if DataType == 'VOID*':
+ IsValid = (len(FieldList) <= 2)
+ else:
+ IsValid = (len(FieldList) <= 1)
+ return [Value, '', Size], IsValid, 0
+ elif PcdType in (MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT):
+ Value = FieldList[0]
+ Size = Type = ''
+ if len(FieldList) > 1:
+ Type = FieldList[1]
+ if len(FieldList) > 2:
+ Size = FieldList[2]
+ if DataType == 'VOID*':
+ IsValid = (len(FieldList) <= 3)
+ else:
+ IsValid = (len(FieldList) <= 1)
+ return [Value, Type, Size], IsValid, 0
+ elif PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
+ VpdOffset = FieldList[0]
+ Value = Size = ''
+ if not DataType == 'VOID*':
+ if len(FieldList) > 1:
+ Value = FieldList[1]
+ else:
+ if len(FieldList) > 1:
+ Size = FieldList[1]
+ if len(FieldList) > 2:
+ Value = FieldList[2]
+ if DataType == 'VOID*':
+ IsValid = (len(FieldList) <= 3)
+ else:
+ IsValid = (len(FieldList) <= 2)
+ return [VpdOffset, Size, Value], IsValid, 2
+ elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):
+ HiiString = FieldList[0]
+ Guid = Offset = Value = ''
+ if len(FieldList) > 1:
+ Guid = FieldList[1]
+ if len(FieldList) > 2:
+ Offset = FieldList[2]
+ if len(FieldList) > 3:
+ Value = FieldList[3]
+ IsValid = (3 <= len(FieldList) <= 4)
+ return [HiiString, Guid, Offset, Value], IsValid, 3
+ return [], False, 0
+
## AnalyzePcdData
#
# Analyze the pcd Value, Datum type and TokenNumber.
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-07-03 02:53:29 UTC (rev 2544)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-07-03 06:44:40 UTC (rev 2545)
@@ -25,7 +25,7 @@
from CommonDataClass.DataClass import *
from Common.DataType import *
from Common.String import *
-from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData
+from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd
from Common.Expression import *
from CommonDataClass.Exceptions import *
@@ -1273,15 +1273,15 @@
def __RetrievePcdValue(self):
Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem= -1.0)
for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
- Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
Name = TokenSpaceGuid + '.' + PcdName
- self._Symbols[Name] = Value
+ ValList, Valid, Index = AnalyzeDscPcd(Value, MODEL_PCD_FEATURE_FLAG)
+ self._Symbols[Name] = ValList[Index]
Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem= -1.0)
for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
- Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
Name = TokenSpaceGuid + '.' + PcdName
- self._Symbols[Name] = Value
+ ValList, Valid, Index = AnalyzeDscPcd(Value, MODEL_PCD_FIXED_AT_BUILD)
+ self._Symbols[Name] = ValList[Index]
Content = open(str(self.MetaFile), 'r').readlines()
GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
@@ -1448,50 +1448,28 @@
self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros, RaiseError=True)
def __ProcessPcd(self):
- PcdValue = None
- ValueList = GetSplitValueList(self._ValueList[2])
+ if self._ItemType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
+ self._ValueList[2] = ReplaceMacro(self._ValueList[2], self._Macros, RaiseError=True)
+ return
- #
- # PCD value can be an expression
- #
- if len(ValueList) > 1 and ValueList[1] == TAB_VOID:
- PcdValue = ValueList[0]
- try:
- ValueList[0] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValueList[0] = Value.result
- PcdValue = ValueList[0]
- else:
- #
- # Int*/Boolean VPD PCD
- # TokenSpace | PcdCName | Offset | [Value]
- #
- # VOID* VPD PCD
- # TokenSpace | PcdCName | Offset | [Size] | [Value]
- #
- if self._ItemType == MODEL_PCD_DYNAMIC_VPD:
- if len(ValueList) >= 4:
- PcdValue = ValueList[-1]
- else:
- PcdValue = ValueList[-1]
- #
- # For the VPD PCD, there may not have PcdValue data in DSC file
- #
- if PcdValue:
- try:
- ValueList[-1] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValueList[-1] = Value.result
+ ValList, Valid, Index = AnalyzeDscPcd(self._ValueList[2], self._ItemType)
+ if not Valid:
+ EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self._FileWithError, Line=self._LineIndex+1,
+ ExtraData="%s.%s|%s" % (self._ValueList[0], self._ValueList[1], self._ValueList[2]))
+ PcdValue = ValList[Index]
+ try:
+ ValList[Index] = ValueExpression(PcdValue, self._Macros)(True)
+ except WrnExpression, Value:
+ ValList[Index] = Value.result
- if ValueList[-1] == 'True':
- ValueList[-1] = '1'
- if ValueList[-1] == 'False':
- ValueList[-1] = '0'
- PcdValue = ValueList[-1]
- if PcdValue and self._ItemType in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
- GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
- self._ValueList[2] = '|'.join(ValueList)
+ if ValList[Index] == 'True':
+ ValList[Index] = '1'
+ if ValList[Index] == 'False':
+ ValList[Index] = '0'
+ GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
+ self._ValueList[2] = '|'.join(ValList)
+
def __ProcessComponent(self):
self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
Added: trunk/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceCommon.py (rev 0)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceCommon.py 2012-07-03 06:44:40 UTC (rev 2545)
@@ -0,0 +1,237 @@
+## @file
+# Common routines used by workspace
+#
+# Copyright (c) 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
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+from Common.Misc import sdict
+from Common.DataType import SUP_MODULE_USER_DEFINED
+from BuildClassObject import LibraryClassObject
+
+## Get all packages from platform for specified arch, target and toolchain
+#
+# @param Platform: DscBuildData instance
+# @param BuildDatabase: The database saves all data for all metafiles
+# @param Arch: Current arch
+# @param Target: Current target
+# @param Toolchain: Current toolchain
+# @retval: List of packages which are DecBuildData instances
+#
+def GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain):
+ PkgSet = set()
+ for ModuleFile in Platform.Modules:
+ Data = BuildDatabase[ModuleFile, Arch, Target, Toolchain]
+ PkgSet.update(Data.Packages)
+ for Lib in GetLiabraryInstances(Data, Platform, BuildDatabase, Arch, Target, Toolchain):
+ PkgSet.update(Lib.Packages)
+ return list(PkgSet)
+
+## Get all declared PCD from platform for specified arch, target and toolchain
+#
+# @param Platform: DscBuildData instance
+# @param BuildDatabase: The database saves all data for all metafiles
+# @param Arch: Current arch
+# @param Target: Current target
+# @param Toolchain: Current toolchain
+# @retval: A dictionary contains instances of PcdClassObject with key (PcdCName, TokenSpaceGuid)
+#
+def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain):
+ PkgList = GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain)
+ DecPcds = {}
+ for Pkg in PkgList:
+ for Pcd in Pkg.Pcds:
+ DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
+ return DecPcds
+
+## Get all dependent libraries for a module
+#
+# @param Module: InfBuildData instance
+# @param Platform: DscBuildData instance
+# @param BuildDatabase: The database saves all data for all metafiles
+# @param Arch: Current arch
+# @param Target: Current target
+# @param Toolchain: Current toolchain
+# @retval: List of dependent libraries which are InfBuildData instances
+#
+def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):
+ if Module.AutoGenVersion >= 0x00010005:
+ return _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain)
+ else:
+ return _ResolveLibraryReference(Module, Platform)
+
+def _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):
+ ModuleType = Module.ModuleType
+
+ # for overriding library instances with module specific setting
+ PlatformModule = Platform.Modules[str(Module)]
+
+ # add forced library instances (specified under LibraryClasses sections)
+ #
+ # If a module has a MODULE_TYPE of USER_DEFINED,
+ # do not link in NULL library class instances from the global [LibraryClasses.*] sections.
+ #
+ if Module.ModuleType != SUP_MODULE_USER_DEFINED:
+ for LibraryClass in Platform.LibraryClasses.GetKeys():
+ if LibraryClass.startswith("NULL") and Platform.LibraryClasses[LibraryClass, Module.ModuleType]:
+ Module.LibraryClasses[LibraryClass] = Platform.LibraryClasses[LibraryClass, Module.ModuleType]
+
+ # add forced library instances (specified in module overrides)
+ for LibraryClass in PlatformModule.LibraryClasses:
+ if LibraryClass.startswith("NULL"):
+ Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
+
+ # EdkII module
+ LibraryConsumerList = [Module]
+ Constructor = []
+ ConsumedByList = sdict()
+ LibraryInstance = sdict()
+
+ while len(LibraryConsumerList) > 0:
+ M = LibraryConsumerList.pop()
+ for LibraryClassName in M.LibraryClasses:
+ if LibraryClassName not in LibraryInstance:
+ # override library instance for this module
+ if LibraryClassName in PlatformModule.LibraryClasses:
+ LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]
+ else:
+ LibraryPath = Platform.LibraryClasses[LibraryClassName, ModuleType]
+ if LibraryPath == None or LibraryPath == "":
+ LibraryPath = M.LibraryClasses[LibraryClassName]
+ if LibraryPath == None or LibraryPath == "":
+ return []
+
+ LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain]
+ # for those forced library instance (NULL library), add a fake library class
+ if LibraryClassName.startswith("NULL"):
+ LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))
+ elif LibraryModule.LibraryClass == None \
+ or len(LibraryModule.LibraryClass) == 0 \
+ or (ModuleType != 'USER_DEFINED'
+ and ModuleType not in LibraryModule.LibraryClass[0].SupModList):
+ # only USER_DEFINED can link against any library instance despite of its SupModList
+ return []
+
+ LibraryInstance[LibraryClassName] = LibraryModule
+ LibraryConsumerList.append(LibraryModule)
+ else:
+ LibraryModule = LibraryInstance[LibraryClassName]
+
+ if LibraryModule == None:
+ continue
+
+ if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:
+ Constructor.append(LibraryModule)
+
+ if LibraryModule not in ConsumedByList:
+ ConsumedByList[LibraryModule] = []
+ # don't add current module itself to consumer list
+ if M != Module:
+ if M in ConsumedByList[LibraryModule]:
+ continue
+ ConsumedByList[LibraryModule].append(M)
+ #
+ # Initialize the sorted output list to the empty set
+ #
+ SortedLibraryList = []
+ #
+ # Q <- Set of all nodes with no incoming edges
+ #
+ LibraryList = [] #LibraryInstance.values()
+ Q = []
+ for LibraryClassName in LibraryInstance:
+ M = LibraryInstance[LibraryClassName]
+ LibraryList.append(M)
+ if ConsumedByList[M] == []:
+ Q.append(M)
+
+ #
+ # start the DAG algorithm
+ #
+ while True:
+ EdgeRemoved = True
+ while Q == [] and EdgeRemoved:
+ EdgeRemoved = False
+ # for each node Item with a Constructor
+ for Item in LibraryList:
+ if Item not in Constructor:
+ continue
+ # for each Node without a constructor with an edge e from Item to Node
+ for Node in ConsumedByList[Item]:
+ if Node in Constructor:
+ continue
+ # remove edge e from the graph if Node has no constructor
+ ConsumedByList[Item].remove(Node)
+ EdgeRemoved = True
+ if ConsumedByList[Item] == []:
+ # insert Item into Q
+ Q.insert(0, Item)
+ break
+ if Q != []:
+ break
+ # DAG is done if there's no more incoming edge for all nodes
+ if Q == []:
+ break
+
+ # remove node from Q
+ Node = Q.pop()
+ # output Node
+ SortedLibraryList.append(Node)
+
+ # for each node Item with an edge e from Node to Item do
+ for Item in LibraryList:
+ if Node not in ConsumedByList[Item]:
+ continue
+ # remove edge e from the graph
+ ConsumedByList[Item].remove(Node)
+
+ if ConsumedByList[Item] != []:
+ continue
+ # insert Item into Q, if Item has no other incoming edges
+ Q.insert(0, Item)
+
+ #
+ # if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle
+ #
+ for Item in LibraryList:
+ if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
+ return []
+ if Item not in SortedLibraryList:
+ SortedLibraryList.append(Item)
+
+ #
+ # Build the list of constructor and destructir names
+ # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order
+ #
+ SortedLibraryList.reverse()
+ return SortedLibraryList
+
+def _ResolveLibraryReference(Module, Platform):
+ LibraryConsumerList = [Module]
+
+ # "CompilerStub" is a must for Edk modules
+ if Module.Libraries:
+ Module.Libraries.append("CompilerStub")
+ LibraryList = []
+ while len(LibraryConsumerList) > 0:
+ M = LibraryConsumerList.pop()
+ for LibraryName in M.Libraries:
+ Library = Platform.LibraryClasses[LibraryName, ':dummy:']
+ if Library == None:
+ for Key in Platform.LibraryClasses.data.keys():
+ if LibraryName.upper() == Key.upper():
+ Library = Platform.LibraryClasses[Key, ':dummy:']
+ break
+ if Library == None:
+ continue
+
+ if Library not in LibraryList:
+ LibraryList.append(Library)
+ LibraryConsumerList.append(Library)
+ return LibraryList
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-07-03 02:53:29 UTC (rev 2544)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-07-03 06:44:40 UTC (rev 2545)
@@ -34,6 +34,8 @@
from MetaFileTable import *
from MetaFileParser import *
from BuildClassObject import *
+from WorkspaceCommon import GetDeclaredPcd
+from Common.Misc import AnalyzeDscPcd
## Platform build information from DSC file
#
@@ -134,6 +136,7 @@
self._LibraryInstances = None
self._LibraryClasses = None
self._Pcds = None
+ self._DecPcds = None
self._BuildOptions = None
self._LoadFixAddress = None
self._RFCLanguages = None
@@ -613,6 +616,45 @@
self._LibraryClasses[Library.BaseName, ':dummy:'] = Library
return self._LibraryClasses
+ def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo):
+ if self._DecPcds == None:
+ self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain)
+ if (PcdCName, TokenSpaceGuid) not in self._DecPcds:
+ EdkLogger.error('build', PARSER_ERROR,
+ "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),
+ File=self.MetaFile, Line=LineNo)
+ ValueList, IsValid, Index = AnalyzeDscPcd(Setting, PcdType, self._DecPcds[PcdCName, TokenSpaceGuid].DatumType)
+ if not IsValid and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
+ EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self.MetaFile, Line=LineNo,
+ ExtraData="%s.%s|%s" % (TokenSpaceGuid, PcdCName, Setting))
+ if PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
+ try:
+ ValueList[Index] = ValueExpression(ValueList[Index], GlobalData.gPlatformPcds)(True)
+ except WrnExpression, Value:
+ ValueList[Index] = Value.result
+ except EvaluationException, Excpt:
+ if hasattr(Excpt, 'Pcd'):
+ if Excpt.Pcd in GlobalData.gPlatformOtherPcds:
+ EdkLogger.error('Parser', FORMAT_INVALID, "Cannot use this PCD (%s) in an expression as"
+ " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
+ " of the DSC file" % Excpt.Pcd,
+ File=self.MetaFile, Line=LineNo)
+ else:
+ EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s) is not defined in DSC file" % Excpt.Pcd,
+ File=self.MetaFile, Line=LineNo)
+ else:
+ EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),
+ File=self.MetaFile, Line=LineNo)
+ if ValueList[Index] == 'True':
+ ValueList[Index] = '1'
+ elif ValueList[Index] == 'False':
+ ValueList[Index] = '0'
+ Valid, ErrStr = CheckPcdDatum(self._DecPcds[PcdCName, TokenSpaceGuid].DatumType, ValueList[Index])
+ if not Valid:
+ EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=LineNo,
+ ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
+ return ValueList
+
## Retrieve all PCD settings in platform
def _GetPcds(self):
if self._Pcds == None:
@@ -663,14 +705,14 @@
# Find out all possible PCD candidates for self._Arch
RecordList = self._RawData[Type, self._Arch]
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdSet.add((PcdCName, TokenSpaceGuid))
+ PcdSet.add((PcdCName, TokenSpaceGuid, Dummy4))
PcdDict[Arch, PcdCName, TokenSpaceGuid] = Setting
# Remove redundant PCD candidates
- for PcdCName, TokenSpaceGuid in PcdSet:
+ for PcdCName, TokenSpaceGuid, Dummy4 in PcdSet:
Setting = PcdDict[self._Arch, PcdCName, TokenSpaceGuid]
if Setting == None:
continue
- PcdValue, DatumType, MaxDatumSize = AnalyzePcdData(Setting)
+ PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
PcdCName,
TokenSpaceGuid,
@@ -702,15 +744,15 @@
# Find out all possible PCD candidates for self._Arch
RecordList = self._RawData[Type, self._Arch]
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdList.append((PcdCName, TokenSpaceGuid))
+ PcdList.append((PcdCName, TokenSpaceGuid, Dummy4))
PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
# Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid in PcdList:
+ for PcdCName, TokenSpaceGuid, Dummy4 in PcdList:
Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]
if Setting == None:
continue
- PcdValue, DatumType, MaxDatumSize = AnalyzePcdData(Setting)
+ PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], '', '', '', '', '', PcdValue)
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
@@ -744,14 +786,14 @@
RecordList = self._RawData[Type, self._Arch]
# Find out all possible PCD candidates for self._Arch
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdSet.add((PcdCName, TokenSpaceGuid))
+ PcdSet.add((PcdCName, TokenSpaceGuid, Dummy4))
PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
# Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid in PcdSet:
+ for PcdCName, TokenSpaceGuid, Dummy4 in PcdSet:
Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]
if Setting == None:
continue
- VariableName, VariableGuid, VariableOffset, DefaultValue = AnalyzeHiiPcdData(Setting)
+ VariableName, VariableGuid, VariableOffset, DefaultValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], VariableName, VariableGuid, VariableOffset, DefaultValue)
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
PcdCName,
@@ -784,10 +826,10 @@
# Find out all possible PCD candidates for self._Arch
RecordList = self._RawData[Type, self._Arch]
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdList.append((PcdCName, TokenSpaceGuid))
+ PcdList.append((PcdCName, TokenSpaceGuid, Dummy4))
PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
# Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid in PcdList:
+ for PcdCName, TokenSpaceGuid, Dummy4 in PcdList:
Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]
if Setting == None:
continue
@@ -797,7 +839,7 @@
# At this point, we put all the data into the PcdClssObject for we don't know the PCD's datumtype
# until the DEC parser has been called.
#
- VpdOffset, MaxDatumSize, InitialValue = AnalyzeVpdPcdData(Setting)
+ VpdOffset, MaxDatumSize, InitialValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], '', '', '', '', VpdOffset, InitialValue)
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
@@ -842,46 +884,6 @@
self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None)
self.Pcds[Name, Guid].DefaultValue = Value
- def IsPlatformPcdDeclared(self, DecPcds):
- for PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_FEATURE_FLAG,
- MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_VPD,
- MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNAMIC_EX_HII, MODEL_PCD_DYNAMIC_EX_VPD):
- RecordList = self._RawData[PcdType, self._Arch]
- for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- if (PcdCName, TokenSpaceGuid) not in DecPcds:
- EdkLogger.error('build', PARSER_ERROR,
- "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),
- File=self.MetaFile, Line=Dummy4)
- PcdValue = ''
- if PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
- if DecPcds[PcdCName, TokenSpaceGuid].DatumType == "VOID*":
- PcdValue = AnalyzeVpdPcdData(Setting)[2]
- PcdMaxDatumSize = AnalyzeVpdPcdData(Setting)[1]
- # Check The MaxDatumSize is valid
- try:
- Value = long(PcdMaxDatumSize, 0)
- except ValueError:
- EdkLogger.error("build", FORMAT_INVALID, "PCD setting error",
- File=self.MetaFile, Line=Dummy4,
- ExtraData="\n\tPCD: The MaxDatumSize [%s] of %s.%s must be a hexadecimal or decimal in C language format in DSC: %s\n\t\t\n"
- % (PcdMaxDatumSize, TokenSpaceGuid, PcdCName, self.MetaFile.Path))
- if Value < 0x00 or Value > 0xFFFFFFFF:
- EdkLogger.error("build", FORMAT_INVALID, "PCD setting error",
- File=self.MetaFile, Line=Dummy4,
- ExtraData="\n\tPCD: The MaxDatumSize [%s] of %s.%s exceed the valid scope(0x0 - 0xFFFFFFFF) in DSC: %s\n\t\t\n"
- % (PcdMaxDatumSize, TokenSpaceGuid, PcdCName, self.MetaFile.Path))
- else:
- PcdValue = AnalyzeVpdPcdData(Setting)[1]
- elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):
- PcdValue = AnalyzeHiiPcdData(Setting)[3]
- else:
- PcdValue = AnalyzePcdData(Setting)[0]
- if PcdValue:
- Valid, ErrStr = CheckPcdDatum(DecPcds[PcdCName, TokenSpaceGuid].DatumType, PcdValue)
- if not Valid:
- EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=Dummy4,
- ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
-
_Macros = property(_GetMacros)
Arch = property(_GetArch, _SetArch)
Platform = property(_GetPlatformName)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2012-07-03 02:53:35
|
Revision: 2544
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2544&view=rev
Author: yingke
Date: 2012-07-03 02:53:29 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
Support C format GUID and registry format GUID comparison in expression.
Reviewed-by: Su Jikui <jik...@in...>
Signed-off-by: Liu Yingke <yin...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/Expression.py
Modified: trunk/BaseTools/Source/Python/Common/Expression.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/Expression.py 2012-07-02 22:12:26 UTC (rev 2543)
+++ trunk/BaseTools/Source/Python/Common/Expression.py 2012-07-03 02:53:29 UTC (rev 2544)
@@ -246,12 +246,14 @@
# @return: True or False if RealValue is False
# Evaluated value of string format if RealValue is True
#
- def __call__(self, RealValue=False):
+ def __call__(self, RealValue=False, Depth=0):
if self._NoProcess:
return self._Expr
+ self._Depth = Depth
+
self._Expr = self._Expr.strip()
- if RealValue:
+ if RealValue and Depth == 0:
self._Token = self._Expr
if self.__IsNumberToken():
return self._Expr
@@ -471,7 +473,7 @@
Ex = BadExpression(ERR_PCD_RESOLVE % self._Token)
Ex.Pcd = self._Token
raise Ex
- self._Token = ValueExpression(self._Symb[self._Token], self._Symb)(True)
+ self._Token = ValueExpression(self._Symb[self._Token], self._Symb)(True, self._Depth+1)
if type(self._Token) != type(''):
self._LiteralToken = hex(self._Token)
return
@@ -551,7 +553,7 @@
if Match and not Expr[Match.end():Match.end()+1].isalnum() \
and Expr[Match.end():Match.end()+1] != '_':
self._Idx += Match.end()
- self._Token = ValueExpression(GuidStringToGuidStructureString(Expr[0:Match.end()]))(True)
+ self._Token = ValueExpression(GuidStringToGuidStructureString(Expr[0:Match.end()]))(True, self._Depth+1)
return self._Token
elif self.__IsIdChar(Ch):
return self.__GetIdToken()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2012-07-02 22:12:32
|
Revision: 2543
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2543&view=rev
Author: jsu1
Date: 2012-07-02 22:12:26 +0000 (Mon, 02 Jul 2012)
Log Message:
-----------
Fix some blank lines missing in build report.
Reviewed-by: Zeng, Yurui <yur...@in...>
Signed-off-by: Su jikui <jik...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/build/BuildReport.py
Modified: trunk/BaseTools/Source/Python/build/BuildReport.py
===================================================================
--- trunk/BaseTools/Source/Python/build/BuildReport.py 2012-06-28 08:45:49 UTC (rev 2542)
+++ trunk/BaseTools/Source/Python/build/BuildReport.py 2012-07-02 22:12:26 UTC (rev 2543)
@@ -188,7 +188,6 @@
# @param MaxLength The Max Length of the line
#
def FileLinesSplit(Content=None, MaxLength=None):
- Content = Content.replace(gEndOfLine, TAB_LINE_BREAK)
ContentList = Content.split(TAB_LINE_BREAK)
NewContent = ''
NewContentList = []
@@ -206,7 +205,9 @@
if Line:
NewContentList.append(Line)
for NewLine in NewContentList:
- NewContent += NewLine + gEndOfLine
+ NewContent += NewLine + TAB_LINE_BREAK
+
+ NewContent = NewContent.replace(TAB_LINE_BREAK, gEndOfLine).replace('\r\r\n', gEndOfLine)
return NewContent
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2012-06-28 08:46:00
|
Revision: 2542
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2542&view=rev
Author: jsu1
Date: 2012-06-28 08:45:49 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
Fix the pcd value in FDF lost issue.
Reviewed-by: Zeng, Yurui <yur...@in...>
Signed-off-by: Su jikui <jik...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2012-06-28 08:44:41 UTC (rev 2541)
+++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2012-06-28 08:45:49 UTC (rev 2542)
@@ -317,6 +317,7 @@
if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey \
or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in DecPcdsKey \
or (Name, Guid, TAB_PCDS_FEATURE_FLAG) in DecPcdsKey:
+ Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])
continue
elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey:
EdkLogger.error(
@@ -326,7 +327,6 @@
File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],
Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]
)
- Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])
Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2012-06-28 08:44:50
|
Revision: 2541
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2541&view=rev
Author: jsu1
Date: 2012-06-28 08:44:41 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
Fix the end of line to all use ?\226?\128?\152\r\n?\226?\128?\153 in build report.
Reviewed-by: Zeng, Yurui <yur...@in...>
Reviewed-by: Liu Yingke <yin...@in...>
Signed-off-by: Su jikui <jik...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/build/BuildReport.py
Modified: trunk/BaseTools/Source/Python/build/BuildReport.py
===================================================================
--- trunk/BaseTools/Source/Python/build/BuildReport.py 2012-06-25 02:32:08 UTC (rev 2540)
+++ trunk/BaseTools/Source/Python/build/BuildReport.py 2012-06-28 08:44:41 UTC (rev 2541)
@@ -4,7 +4,7 @@
# This module contains the functionality to generate build report after
# build all target completes successfully.
#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 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
@@ -72,6 +72,9 @@
## Tags for MaxLength of line in report
gLineMaxLength = 120
+## Tags for end of line in report
+gEndOfLine = "\r\n"
+
## Tags for section start, end and separator
gSectionStart = ">" + "=" * (gLineMaxLength-2) + "<"
gSectionEnd = "<" + "=" * (gLineMaxLength-2) + ">" + "\n"
@@ -128,7 +131,7 @@
def FileWrite(File, String, Wrapper=False):
if Wrapper:
String = textwrap.fill(String, 120)
- File.write(String + "\r\n")
+ File.write(String + gEndOfLine)
##
# Find all the header file that the module source directly includes.
@@ -185,6 +188,7 @@
# @param MaxLength The Max Length of the line
#
def FileLinesSplit(Content=None, MaxLength=None):
+ Content = Content.replace(gEndOfLine, TAB_LINE_BREAK)
ContentList = Content.split(TAB_LINE_BREAK)
NewContent = ''
NewContentList = []
@@ -202,7 +206,7 @@
if Line:
NewContentList.append(Line)
for NewLine in NewContentList:
- NewContent += NewLine + TAB_LINE_BREAK
+ NewContent += NewLine + gEndOfLine
return NewContent
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2012-06-25 02:32:19
|
Revision: 2540
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2540&view=rev
Author: ydong10
Date: 2012-06-25 02:32:08 +0000 (Mon, 25 Jun 2012)
Log Message:
-----------
Fix a typo
Signed-off-by: Eric Dong <eri...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
trunk/BaseTools/Source/C/Include/X64/ProcessorBind.h
trunk/BaseTools/Source/Python/UPT/Library/String.py
Modified: trunk/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
===================================================================
--- trunk/BaseTools/Source/C/Include/Ia32/ProcessorBind.h 2012-06-12 18:04:47 UTC (rev 2539)
+++ trunk/BaseTools/Source/C/Include/Ia32/ProcessorBind.h 2012-06-25 02:32:08 UTC (rev 2540)
@@ -1,7 +1,7 @@
/** @file
Processor or Compiler specific defines and types for x64.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 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
@@ -70,7 +70,7 @@
#if _MSC_EXTENSIONS
//
- // use Microsoft* C complier dependent interger width types
+ // use Microsoft* C complier dependent integer width types
//
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
Modified: trunk/BaseTools/Source/C/Include/X64/ProcessorBind.h
===================================================================
--- trunk/BaseTools/Source/C/Include/X64/ProcessorBind.h 2012-06-12 18:04:47 UTC (rev 2539)
+++ trunk/BaseTools/Source/C/Include/X64/ProcessorBind.h 2012-06-25 02:32:08 UTC (rev 2540)
@@ -1,7 +1,7 @@
/** @file
Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64).
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 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
@@ -73,7 +73,7 @@
//
- // use Microsoft C complier dependent interger width types
+ // use Microsoft C complier dependent integer width types
//
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
Modified: trunk/BaseTools/Source/Python/UPT/Library/String.py
===================================================================
--- trunk/BaseTools/Source/Python/UPT/Library/String.py 2012-06-12 18:04:47 UTC (rev 2539)
+++ trunk/BaseTools/Source/Python/UPT/Library/String.py 2012-06-25 02:32:08 UTC (rev 2540)
@@ -2,7 +2,7 @@
# This file is used to define common string related functions used in parsing
# process
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 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
@@ -737,7 +737,7 @@
return False
return False
-## Check if the string is HexDgit and its interger value within limit of UINT32
+## Check if the string is HexDgit and its integer value within limit of UINT32
#
# Return true if all characters in the string are digits and there is at
# least one character
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2012-06-12 18:04:59
|
Revision: 2539
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2539&view=rev
Author: lhauch
Date: 2012-06-12 18:04:47 +0000 (Tue, 12 Jun 2012)
Log Message:
-----------
Updating the XML Schema to match approved ECRs for UEFI Distribution Package Specification
Modified Paths:
--------------
trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
Modified: trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
===================================================================
--- trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd 2012-06-08 05:00:29 UTC (rev 2538)
+++ trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd 2012-06-12 18:04:47 UTC (rev 2539)
@@ -2,7 +2,7 @@
<!--
Filename: DistributionPackage.xsd
-Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2008 - 2012, 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 may be found at
@@ -13,108 +13,96 @@
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://www.uefi.org/2011/1.1" xmlns="http://www.uefi.org/2011/1.1">
+ targetNamespace="http://www.uefi.org/2012/1.0" xmlns="http://www.uefi.org/2012/1.0">
<xs:element name="DistributionPackage">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI Distribution Package
- description (PKG) file. It describes the content of:</xs:documentation>
- <xs:documentation xml:lang="en-us"> 1) Package descriptions with definitions and
- headers.</xs:documentation>
- <xs:documentation xml:lang="en-us"> 2) Modules in either source or binary format. (Note
- that Binary format is for FFS leaf section file types only, complete FFS files
- cannot be distributed using this distribution format.) </xs:documentation>
- <xs:documentation xml:lang="en-us"> 3) The distribution of custom tools used to modify
- the binary images to create UEFI/PI compliant images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 4) Finally, it can be used to distribute other
- miscellaneous content that is not specific to UEFI/PI images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The Package Surface Area describes the content of
- packages, while the Module Surface Area provides information relevant to source
- and/or binary distributions. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI Distribution Package description (PKG)
+ file. It describes the content of:</xs:documentation>
+ <xs:documentation xml:lang="en-us"> 1) Package descriptions with definitions and headers.</xs:documentation>
+ <xs:documentation xml:lang="en-us"> 2) Modules in either source or binary format. (Note that Binary format
+ is for FFS leaf section file types only, complete FFS files cannot be distributed using this
+ distribution format.) </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 3) The distribution of custom tools used to modify the binary images to
+ create UEFI/PI compliant images. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 4) Finally, it can be used to distribute other miscellaneous content
+ that is not specific to UEFI/PI images. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The Package Surface Area describes the content of packages, while the
+ Module Surface Area provides information relevant to source and/or binary distributions.
+ </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="DistributionHeader" minOccurs="1" maxOccurs="1">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This header contains (legal) information
- usually required for distributing both binary and/or source code.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This header contains (legal) information usually required
+ for distributing both binary and/or source code. </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="PackageSurfaceArea" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The list of packages in this
- distribution. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Packages are groups of files and/or
- modules that are similar in nature.</xs:documentation>
- <xs:documentation xml:lang="en-us"> Packages are uniquely identified by a
- package GUID and a package version. </xs:documentation>
- <xs:documentation xml:lang="en-us"> A package can declare public mappings of
- C names to GUID values. </xs:documentation>
- <xs:documentation xml:lang="en-us"> A package can provide header files for
- library classes and/or other industry standard definitions. </xs:documentation>
- <xs:documentation xml:lang="en-us"> A package can also declare public
- mappings of platform configuration database (PCD) "knobs" to
- control features and operation of modules within a platform. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Finally, a package lists the library
- instances and/or modules that are provided in a distribution package.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The list of packages in this distribution. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Packages are groups of files and/or modules that are similar
+ in nature.</xs:documentation>
+ <xs:documentation xml:lang="en-us"> Packages are uniquely identified by a package GUID and a
+ package version. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A package can declare public mappings of C names to GUID
+ values. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A package can provide header files for library classes
+ and/or other industry standard definitions. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A package can also declare public mappings of platform
+ configuration database (PCD) "knobs" to control features and operation of modules
+ within a platform. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Finally, a package lists the library instances and/or
+ modules that are provided in a distribution package. </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="ModuleSurfaceArea" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The listing of UEFI/PI compliant modules
- in this distribution that are NOT part of a Package. Every module that
- is provided as part of a package needs to be described in a
- PackageSurfaceArea.Modules section. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The ModuleSurfaceArea section describes
- how each module in a distribution is coded, or, in the case of a binary
- module distribution, how it was built. </xs:documentation>
- <xs:documentation xml:lang="en-us"> UEFI/PI compliant libraries and modules
- are uniquely identified by the Module's GUID and version number. </xs:documentation>
- <xs:documentation xml:lang="en-us"> This section will typically be used for
- modules that don't require any additional files that would be included
- in a package. For example, the Enhanced FAT driver binary does not need
- to have a package description, as no additional files are provided.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The listing of UEFI/PI compliant modules in this
+ distribution that are NOT part of a Package. Every module that is provided as part of a
+ package needs to be described in a PackageSurfaceArea.Modules section. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The ModuleSurfaceArea section describes how each module in a
+ distribution is coded, or, in the case of a binary module distribution, how it was built. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> UEFI/PI compliant libraries and modules are uniquely
+ identified by the Module's GUID and version number. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This section will typically be used for modules that don't
+ require any additional files that would be included in a package. For example, the Enhanced
+ FAT driver binary does not need to have a package description, as no additional files are
+ provided. </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="Tools" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is for distributing vendor
- specific executable tools, tool source code and/or configuration files.
- These tools are primarily for manipulating code and/or binary images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Tools in this section
- can:</xs:documentation>
- <xs:documentation xml:lang="en-us"> 1) Parse build meta-data files to create
- source code files and build scripts. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 2) Modify image files to conform to
- UEFI/PI specifications. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 3) Generate binary files from certain
- types of text/unicode files. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 4) Generate PCI Option Roms or Firmware
- Device images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 5) Implement external
- encoding/decoding/signature/GUIDed tools. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 6) Distribution Package
- create/install/remove tools. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This section is for distributing vendor specific executable
+ tools, tool source code and/or configuration files. These tools are primarily for
+ manipulating code and/or binary images. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Tools in this section can:</xs:documentation>
+ <xs:documentation xml:lang="en-us"> 1) Parse build meta-data files to create source code files
+ and build scripts. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 2) Modify image files to conform to UEFI/PI specifications. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 3) Generate binary files from certain types of text/unicode
+ files. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 4) Generate PCI Option Roms or Firmware Device images. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 5) Implement external encoding/decoding/signature/GUIDed
+ tools. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> 6) Distribution Package create/install/remove tools.
+ </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="MiscellaneousFiles" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The list of miscellaneous files in this
- distribution. Any files that are not listed in either the Package,
- Module or Tools sections can be listed here. This section can be used to
- distribute specifications for packages and modules that are not
- "industry standards" such as a specification for a chipset or
- a video device. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The list of miscellaneous files in this distribution. Any
+ files that are not listed in either the Package, Module or Tools sections can be listed
+ here. This section can be used to distribute specifications for packages and modules that
+ are not "industry standards" such as a specification for a chipset or a video
+ device. </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="UserExtensions" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The UserExtensions section is used to
- disseminate processing instructions that may be custom to the content
- provided by the distribution. This section contains information that is
- common to all aspects of this disribution. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The UserExtensions section is used to disseminate processing
+ instructions that may be custom to the content provided by the distribution. This section
+ contains information that is common to all aspects of this disribution. </xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
@@ -125,31 +113,30 @@
<xs:element name="DistributionHeader">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This section defines the content of the UEIF/PI
- compliant Distribution Package Header. This is the only required element of a
- UEFI/PI compliant distribution package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This section defines the content of the UEIF/PI compliant Distribution
+ Package Header. This is the only required element of a UEFI/PI compliant distribution package.
+ </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Name">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the User Interface Name for this
- Distribution Package. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Each Distribution Package is uniquely
- identified by it's GUID and Version number. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This is the User Interface Name for this Distribution
+ Package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Each Distribution Package is uniquely identified by it's
+ GUID and Version number. </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:normalizedString">
<xs:attribute name="BaseName" type="xs:NMTOKEN" use="optional">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The reference name of
- the Distribution Package file. This single word name can
- be used by tools as a keyword or for directory and/or
- file creation. </xs:documentation>
- <xs:documentation xml:lang="en-us"> White space and special
- characters (dash and underscore characters may be used)
- are not permitted in this name. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The reference name of the Distribution
+ Package file. This single word name can be used by tools as a keyword or for
+ directory and/or file creation. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> White space and special characters (dash and
+ underscore characters may be used) are not permitted in this name.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
@@ -158,22 +145,20 @@
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="GUID">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This 128-bit GUID and the Version
- attribute uniquely identify this Distribution Package. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Backward compatible releases of a
- distribution package need only change the version number, while
- non-backward compatible changes require the GUID to change (resetting
- the version number to 1.0 is optional.) </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This 128-bit GUID and the Version attribute uniquely
+ identify this Distribution Package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Backward compatible releases of a distribution package need
+ only change the version number, while non-backward compatible changes require the GUID to
+ change (resetting the version number to 1.0 is optional.) </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="RegistryFormatGuid">
<xs:attribute name="Version" type="xs:decimal" use="required">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with
- the GUID, is used to uniquely identify this object. The
- higher the number, the more recent the content.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This value, along with the GUID, is used to
+ uniquely identify this object. The higher the number, the more recent the
+ content. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
@@ -182,97 +167,116 @@
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Vendor" type="xs:normalizedString">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A string identifying who created this
- distribution package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A string identifying who created this distribution package.
+ </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="Date" type="xs:dateTime">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The date and time this distribution was
- created. The format is: YYYY-MM-DDThh:mm:ss, for example:
- 2001-01-31T13:30:00 (note the T character separator between the calendar
- date and the time. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The date and time this distribution was created. The format
+ is: YYYY-MM-DDThh:mm:ss, for example: 2001-01-31T13:30:00 (note the T character separator
+ between the calendar date and the time. </xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Copyright" type="xs:string">
+ <xs:element minOccurs="1" maxOccurs="unbounded" name="Copyright">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The copyright for this file that is
- generated by the creator of the distribution. If a derivative work is
- generated from an existing distribution, then the existing copyright
- must be maintained, and additional copyrights may be appended to the end
- of this element. It may also be the primary copyright for all code
- provided in the Distribution Package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The copyright for this file that is generated by the creator
+ of the distribution. If a derivative work is generated from an existing distribution, then
+ the existing copyright must be maintained, and additional copyrights may be appended to the
+ end of this element. It may also be the primary copyright for all code provided in the
+ Distribution Package. </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
</xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="License" type="xs:string">
+ <xs:element minOccurs="1" maxOccurs="unbounded" name="License">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A license that describes any
- restrictions on the use of this distribution. If a derivative work is
- allowed by the original license and a derivative work is generated from
- an existing distribution, then the existing license must be maintained,
- and additional licenses may be appended to the end of this element. It
- may also be the primary license for all code provided in the
- distribution file. Alternatively, this may point to a filename that
- contains the License. The file (included in the content zip file) will
- be stored in the same location as the distribution package's .pkg file.
+ <xs:documentation xml:lang="en-us"> A license that describes any restrictions on the use of this
+ distribution. If a derivative work is allowed by the original license and a derivative work
+ is generated from an existing distribution, then the existing license must be maintained,
+ and additional licenses may be appended to the end of this element. It may also be the
+ primary license for all code provided in the distribution file. Alternatively, this may
+ point to a filename that contains the License. The file (included in the content zip file)
+ will be stored in the same location as the distribution package's .pkg file.
</xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Abstract" type="xs:normalizedString">
+ <xs:element minOccurs="1" maxOccurs="unbounded" name="Abstract">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A one line description of the
- Distribution Package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A one line description of the Distribution Package.
+ </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:normalizedString">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Description" type="xs:string">
+ <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A complete description of the
- Distribution Package. This description may include the release name of
- the file, the version of the file, and a complete description of the
- file contents and/or features including a description of the updates
- since the previous file release. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A complete description of the Distribution Package. This
+ description may include the release name of the file, the version of the file, and a
+ complete description of the file contents and/or features including a description of the
+ updates since the previous file release. </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Signature" type="Md5Sum">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The packaging utilities will use this
- MD5 sum value of the included ZIP file containing files and/or code. If
- this element is not present, then installation tools should assume that
- the content is correct, or that other methods may be needed to verify
- content. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The packaging utilities will use this MD5 sum value of the
+ included ZIP file containing files and/or code. If this element is not present, then
+ installation tools should assume that the content is correct, or that other methods may be
+ needed to verify content. </xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="XmlSpecification" type="xs:decimal"
- default="1.1">
+ <xs:element minOccurs="1" maxOccurs="1" name="XmlSpecification" type="xs:decimal" default="1.1">
<xs:annotation>
<xs:documentation xml:lang="en-us"> This version of this XML Schema is 1.1 </xs:documentation>
<xs:documentation xml:lang="en-us"> Changes to 1.1 from 1.0 </xs:documentation>
- <xs:documentation xml:lang="en-us"> #1 Updated to present date and new
- version which is important to reflect the present state of the
- matter</xs:documentation>
- <xs:documentation xml:lang="en-us"> #2 Added definition/enumeration of
- UNDEFIND type 2 is important since there is a large body of legacy code
- for which the GUID’s and other code/data objects were not decorated with
- their usage. This document will allow for importing today’s source
- artifacts and producing decorations using the ‘Undefined’ versus having
- an error</xs:documentation>
- <xs:documentation xml:lang="en-us">#3 Allow for inclusion of ARM and future
- architecture types</xs:documentation>
+ <xs:documentation xml:lang="en-us"> #1 Updated to present date and new version which is
+ important to reflect the present state of the matter</xs:documentation>
+ <xs:documentation xml:lang="en-us"> #2 Added definition/enumeration of UNDEFIND type 2 is
+ important since there is a large body of legacy code for which the GUID’s and other
+ code/data objects were not decorated with their usage. This document will allow for
+ importing today’s source artifacts and producing decorations using the ‘Undefined’ versus
+ having an error</xs:documentation>
+ <xs:documentation xml:lang="en-us">#3 Allow for inclusion of ARM and future architecture
+ types</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="ReadOnly" type="xs:boolean" default="false" use="optional">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> If set to true, all content within this
- Distribution Package should NOT be modified. The default permits
- modification of all content. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> If set to true, all content within this Distribution Package
+ should NOT be modified. The default permits modification of all content. </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="RePackage" type="xs:boolean" default="false" use="optional">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> If set to true, then the content can be
- repackaged into another distribution package. The default prohibits
- repackaging the Distribution content. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> If set to true, then the content can be repackaged into another
+ distribution package. The default prohibits repackaging the Distribution content.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
@@ -281,12 +285,12 @@
<xs:element name="PackageSurfaceArea">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A package is a collection of related objects -
- Includes, Libraries and Modules. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Each package is uniquely identified by it's GUID and
- Version number. Backward compatible releases of a package need only change the
- version number, while non-backward compatible changes require the GUID to change
- (resetting the version number to 1.0 is optional.) </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A package is a collection of related objects - Includes, Libraries and
+ Modules. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Each package is uniquely identified by it's GUID and Version number.
+ Backward compatible releases of a package need only change the version number, while non-backward
+ compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
+ </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
@@ -296,19 +300,17 @@
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Name">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the User Interface
- Name for this package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This is the User Interface Name for this
+ package. </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:normalizedString">
- <xs:attribute name="BaseName" type="xs:NMTOKEN"
- use="required">
+ <xs:attribute name="BaseName" type="xs:NMTOKEN" use="required">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a
- single word BaseName of the package. This BaseName
- can be used by tools as a keyword and for
- directory/file creation. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This is a single word BaseName
+ of the package. This BaseName can be used by tools as a keyword
+ and for directory/file creation. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
@@ -317,72 +319,93 @@
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="GUID">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version
- attribute uniquely identify a given package.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
+ identify a given package. </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal"
- use="required">
+ <xs:attribute name="Version" type="xs:decimal" use="required">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This value,
- along with the GUID, is used to uniquely identify
- this object. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Backward
- compatible changes must make sure this number is
- incremented from the most recent version.
- Non-backward compatible changes require a new
- GUID, and the version can be reset.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This value, along with the GUID,
+ is used to uniquely identify this object. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> Backward compatible changes must
+ make sure this number is incremented from the most recent
+ version. Non-backward compatible changes require a new GUID, and
+ the version can be reset. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Copyright"
- type="xs:string">
+ <xs:element minOccurs="0" maxOccurs="unbounded" name="Copyright">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> If the package requires a
- different copyright than the distribution package, this
- element can list one or more copyright lines.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> If the package requires a different copyright
+ than the distribution package, this element can list one or more copyright
+ lines. </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+ />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
+ <xs:element minOccurs="0" maxOccurs="unbounded" name="License">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> If the package requires
- licenses that are different from the distribution package
- license, this element can contain one or more license text
- paragraphs (or license filenames.) </xs:documentation>
+ <xs:documentation xml:lang="en-us"> If the package requires licenses that are
+ different from the distribution package license, this element can contain one or
+ more license text paragraphs (or license filenames.) </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+ />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Abstract"
- type="xs:normalizedString">
+ <xs:element minOccurs="0" maxOccurs="unbounded" name="Abstract">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A one line description of
- this package. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A one line description of this package.
+ </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:normalizedString">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+ />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Description"
- type="xs:string">
+ <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> A complete description of a
- package. This description may include the release name of
- the package, the version of the package, and a complete
- description of the package contents and/or features
- including a description of the updates since the previous
- package’s release. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> A complete description of a package. This
+ description may include the release name of the package, the version of the
+ package, and a complete description of the package contents and/or features
+ including a description of the updates since the previous package’s release.
+ </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
+ />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="PackagePath"
- type="xs:anyURI">
+ <xs:element minOccurs="1" maxOccurs="1" name="PackagePath" type="xs:anyURI">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This element is the location
- (in the ZIP file) for the root directory of a package.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This element is the location (in the ZIP file)
+ for the root directory of a package. </xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
@@ -392,29 +415,26 @@
<xs:element minOccurs="0" maxOccurs="1" name="ClonedFrom">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The term cloned is used here to indicate
- that this package as been copied and modified to a completely different
- package. An example might be for a new generation of chipsets that have
- few or no elements in common with the original. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The term cloned is used here to indicate that this package
+ as been copied and modified to a completely different package. An example might be for a new
+ generation of chipsets that have few or no elements in common with the original.
+ </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="GUID">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version
- attribute uniquely identify the Package that this Package
- was copied from. </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
+ identify the Package that this Package was copied from. </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal"
- use="required">
+ <xs:attribute name="Version" type="xs:decimal" use="required">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> This value,
- along with the GUID, is used to uniquely identify
- the package that this package was cloned from.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> This value, along with the GUID,
+ is used to uniquely identify the package that this package was
+ cloned from. </xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
@@ -428,11 +448,10 @@
<xs:element minOccurs="0" maxOccurs="1" name="LibraryClassDeclarations">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> Library Classes are public interfaces
- that can be used by modules. One or more library instances can implement
- a library class, however only one library instance can be linked to an
- individual module. This provides the platform integrator with the
- flexibility of choosing one library instance's implementation over a
+ <xs:documentation xml:lang="en-us"> Library Classes are public interfaces that can be used by
+ modules. One or more library instances can implement a library class, however only one
+ library instance can be linked to an individual module. This provides the platform
+ integrator with the flexibility of choosing one library instance's implementation over a
different library instance. </xs:documentation>
</xs:annotation>
<xs:complexType>
@@ -440,59 +459,51 @@
<xs:element minOccurs="1" maxOccurs="unbounded" name="LibraryClass">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile"
- type="xs:anyURI">
+ <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The header file
- provides definitions and function prototypes for a
- library class. Modules can be coded against these
- functions, using the definitions in this header,
- without concerning themselves about the libraries'
- implementation details. This is a PackagePath
- relative path and filename for the include file.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The header file provides definitions
+ and function prototypes for a library class. Modules can be coded
+ against these functions, using the definitions in this header,
+ without concerning themselves about the libraries' implementation
+ details. This is a PackagePath relative path and filename for the
+ include file. </xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1"
- name="RecommendedInstance">
+ <xs:element minOccurs="0" maxOccurs="1" name="RecommendedInstance">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1"
- name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and
- the Version attribute uniquely identify the
- Recommended Library Instance. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal"
- use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value,
- along with the GUID, is used to uniquely identify
- this object. If this value is not specified, then
- any version of the library instance is
- recommended. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
+ <xs:element minOccurs="1" maxOccurs="1" name="GUID">
+ <xs:annotation>
+ <xs:documentation xml:lang="en-us"> This GUID and the
+ Version attribute uniquely identify the Recommended Library
+ Instance. </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="RegistryFormatGuid">
+ <xs:attribute name="Version" type="xs:decimal"
+ use="optional">
+ <xs:annotation>
+ <xs:documentation xml:lang="en-us"> This value, along with
+ the GUID, is used to uniquely identify this object. If this
+ value is not specified, then any version of the library
+ instance is recommended. </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element ref="HelpText" minOccurs="0"
- maxOccurs="unbounded"/>
+ <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Keyword" type="xs:NCName" use="required">
<xs:annotation>
- <xs:documentation xml:lang="en-us"> The single word name
- of the Library Class that module developers will use
- to identify a library class dependency.
- </xs:documentation>
+ <xs:documentation xml:lang="en-us"> The single word name of the Library
+ Class that module developers will use to identify a library class
+ dependency. </xs:documentation>
...
[truncated message content] |
|
From: <hc...@us...> - 2012-06-08 05:00:35
|
Revision: 2538
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2538&view=rev
Author: hchen30
Date: 2012-06-08 05:00:29 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
1. Add checkpoint of duplicate PCD defined in DEC file
Reviewed-by: Yurui Zeng <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-08 01:49:59 UTC (rev 2537)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-08 05:00:29 UTC (rev 2538)
@@ -1567,6 +1567,7 @@
MetaFileParser.__init__(self, FilePath, FileType, Table, -1)
self._Comments = []
self._Version = 0x00010005 # Only EDK2 dec file is supported
+ self._AllPCDs = [] # Only for check duplicate PCD
## Parser starter
def Start(self):
@@ -1809,6 +1810,14 @@
elif ValueList[0] in ['False', 'false', 'FALSE']:
ValueList[0] = '0'
+ # check for duplicate PCD definition
+ if (self._Scope[0], self._ValueList[0], self._ValueList[1]) in self._AllPCDs:
+ EdkLogger.error('Parser', FORMAT_INVALID,
+ "The same PCD name and GUID have been already defined",
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+ else:
+ self._AllPCDs.append((self._Scope[0], self._ValueList[0], self._ValueList[1]))
+
self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()
_SectionParser = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hc...@us...> - 2012-06-08 01:50:05
|
Revision: 2537
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2537&view=rev
Author: hchen30
Date: 2012-06-08 01:49:59 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
1. Add checkpoint of PCD datum type for DSC file
2. Add BuildOptions to the scope of section names which can have other items after ARCH.
Reviewed-by: Yurui Zeng <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-07 16:28:29 UTC (rev 2536)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-08 01:49:59 UTC (rev 2537)
@@ -38,6 +38,7 @@
TAB_UINT16 = 'UINT16'
TAB_UINT32 = 'UINT32'
TAB_UINT64 = 'UINT64'
+TAB_VOID = 'VOID*'
TAB_EDK_SOURCE = '$(EDK_SOURCE)'
TAB_EFI_SOURCE = '$(EFI_SOURCE)'
@@ -473,4 +474,5 @@
PCDS_DYNAMIC_HII.upper(),
PCDS_DYNAMICEX_DEFAULT.upper(),
PCDS_DYNAMICEX_VPD.upper(),
- PCDS_DYNAMICEX_HII.upper()]
+ PCDS_DYNAMICEX_HII.upper(),
+ TAB_BUILD_OPTIONS.upper()]
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-07 16:28:29 UTC (rev 2536)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-08 01:49:59 UTC (rev 2537)
@@ -1043,6 +1043,14 @@
EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
File=self.MetaFile, Line=self._LineIndex + 1)
+
+ # Validate the datum type of Dynamic Defaul PCD and DynamicEx Default PCD
+ ValueList = GetSplitValueList(self._ValueList[2])
+ if len(ValueList) > 1 and ValueList[1] != TAB_VOID \
+ and self._ItemType in [MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT]:
+ EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s' of PCD is wrong" % ValueList[1],
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+
# if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
@@ -1050,6 +1058,7 @@
elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
+
## [components] section parser
@ParseMacro
def _ComponentParser(self):
@@ -1441,10 +1450,11 @@
def __ProcessPcd(self):
PcdValue = None
ValueList = GetSplitValueList(self._ValueList[2])
+
#
# PCD value can be an expression
#
- if len(ValueList) > 1 and ValueList[1] == 'VOID*':
+ if len(ValueList) > 1 and ValueList[1] == TAB_VOID:
PcdValue = ValueList[0]
try:
ValueList[0] = ValueExpression(PcdValue, self._Macros)(True)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <oli...@us...> - 2012-06-07 16:28:37
|
Revision: 2536
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2536&view=rev
Author: oliviermartin
Date: 2012-06-07 16:28:29 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
Conf/tools_def.template: Added ARM toolchains to the list of supported toolchains
Signed-off-by: Olivier Martin <oli...@ar...>
Modified Paths:
--------------
trunk/BaseTools/Conf/tools_def.template
Modified: trunk/BaseTools/Conf/tools_def.template
===================================================================
--- trunk/BaseTools/Conf/tools_def.template 2012-06-07 16:17:37 UTC (rev 2535)
+++ trunk/BaseTools/Conf/tools_def.template 2012-06-07 16:28:29 UTC (rev 2536)
@@ -514,6 +514,32 @@
# Required to build platforms or ACPI tables:
# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
+# ARMGCC -unix- Requires:
+# ARM None EABI GCC 4.6.0
+# Optional:
+# Required to build platforms or ACPI tables:
+# Intel(r) ACPI Compiler v20101013 from
+# http://www.acpica.org/downloads/previous_releases.php
+# ARMLINUXGCC -unix- Requires:
+# ARM Linux GNU EABI GCC 4.6.0
+# Optional:
+# Required to build platforms or ACPI tables:
+# Intel(r) ACPI Compiler v20101013 from
+# http://www.acpica.org/downloads/previous_releases.php
+# RVCT -win- Requires:
+# ARM C/C++ Compiler, 5.00
+# Optional:
+# Required to build EBC drivers:
+# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
+# Required to build platforms or ACPI tables:
+# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
+# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
+# RVCTLINUX -unix- Requires:
+# ARM C/C++ Compiler, 5.00
+# Optional:
+# Required to build platforms or ACPI tables:
+# Intel(r) ACPI Compiler v20101013 from
+# http://www.acpica.org/downloads/previous_releases.php
# * Commented out - All versions of VS2005 use the same standard install directory
#
####################################################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <oli...@us...> - 2012-06-07 16:17:44
|
Revision: 2535
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2535&view=rev
Author: oliviermartin
Date: 2012-06-07 16:17:37 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
BaseTools: Fixed ARM GCC 4.6 build (changed in tools_def.template)
Signed-off-by: Olivier Martin <oli...@ar...>
Reviewed-by: Su Jikui <jik...@in...>
Modified Paths:
--------------
trunk/BaseTools/Conf/tools_def.template
Modified: trunk/BaseTools/Conf/tools_def.template
===================================================================
--- trunk/BaseTools/Conf/tools_def.template 2012-06-07 16:14:02 UTC (rev 2534)
+++ trunk/BaseTools/Conf/tools_def.template 2012-06-07 16:17:37 UTC (rev 2535)
@@ -2541,7 +2541,7 @@
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
-DEFINE GCC_ARMGCC_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer
+DEFINE GCC_ARMGCC_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
@@ -4871,8 +4871,8 @@
*_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc
*_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
- DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -O0
-RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
+ DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -O0
+RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-unused-but-set-variable
#################
# ASM 16 linker defintions
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <oli...@us...> - 2012-06-07 16:14:09
|
Revision: 2534
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2534&view=rev
Author: oliviermartin
Date: 2012-06-07 16:14:02 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
BaseTools: removed '-combine' from tools_def.template
This option is not supported any more by the latest version of GCC (v4.6).
Note from the GCC mailing-list: The -combine option has been removed, it
has been very buggy and has been superceeded by -flto. Either drop it, or
build with -flto.
Signed-off-by: Olivier Martin <oli...@ar...>
Reviewed-by: Su Jikui <jik...@in...>
Modified Paths:
--------------
trunk/BaseTools/Conf/tools_def.template
Modified: trunk/BaseTools/Conf/tools_def.template
===================================================================
--- trunk/BaseTools/Conf/tools_def.template 2012-06-04 01:43:54 UTC (rev 2533)
+++ trunk/BaseTools/Conf/tools_def.template 2012-06-07 16:14:02 UTC (rev 2534)
@@ -4813,8 +4813,8 @@
*_ARMGCC_ARM_SLINK_FLAGS = -rc
*_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
- DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -O0
-RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -Wno-unused
+ DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -O0
+RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -Wno-unused
####################################################################################
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2012-06-04 01:44:00
|
Revision: 2533
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2533&view=rev
Author: xfzyr
Date: 2012-06-04 01:43:54 +0000 (Mon, 04 Jun 2012)
Log Message:
-----------
Add the check of not allowing list a specified PCD in different PCD type sections in a module.
Signed-off-by: Yurui Zeng <yur...@in...>
Reviewed-by: Chen, Hesheng <hes...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-01 06:28:38 UTC (rev 2532)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-04 01:43:54 UTC (rev 2533)
@@ -482,6 +482,7 @@
if hasattr(self, "_Table"):
return
MetaFileParser.__init__(self, FilePath, FileType, Table)
+ self.PcdsDict = {}
## Parser starter
def Start(self):
@@ -688,6 +689,12 @@
self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
+ if (self._ValueList[0], self._ValueList[1]) not in self.PcdsDict:
+ self.PcdsDict[self._ValueList[0], self._ValueList[1]] = self._SectionType
+ elif self.PcdsDict[self._ValueList[0], self._ValueList[1]] != self._SectionType:
+ EdkLogger.error('Parser', FORMAT_INVALID, "It is not permissible to list a specified PCD in different PCD type sections.",
+ ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
+ File=self.MetaFile, Line=self._LineIndex + 1)
## [depex] section parser
@ParseMacro
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hc...@us...> - 2012-06-01 06:28:44
|
Revision: 2532
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2532&view=rev
Author: hchen30
Date: 2012-06-01 06:28:38 +0000 (Fri, 01 Jun 2012)
Log Message:
-----------
Enhance build tool to break when there is a space with the section in DEC file.
Reviewed-by: Yurui Zeng <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-01 05:12:41 UTC (rev 2531)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-01 06:28:38 UTC (rev 2532)
@@ -1637,12 +1637,13 @@
self._SectionName = ''
self._SectionType = []
ArchList = set()
- for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
+ Line = self._CurrentLine.replace("%s%s" % (TAB_COMMA_SPLIT, TAB_SPACE_SPLIT), TAB_COMMA_SPLIT)
+ for Item in Line[1:-1].split(TAB_COMMA_SPLIT):
if Item == '':
EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR,
"section name can NOT be empty or incorrectly use separator comma",
self.MetaFile, self._LineIndex + 1, self._CurrentLine)
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
+ ItemList = Item.split(TAB_SPLIT)
# different types of PCD are permissible in one section
self._SectionName = ItemList[0].upper()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hc...@us...> - 2012-06-01 05:12:47
|
Revision: 2531
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2531&view=rev
Author: hchen30
Date: 2012-06-01 05:12:41 +0000 (Fri, 01 Jun 2012)
Log Message:
-----------
Enhance build tool to break when there is an invalid section name in DEC file.
Reviewed-by: Yurui Zeng <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-01 01:44:56 UTC (rev 2530)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-01 05:12:41 UTC (rev 2531)
@@ -1,7 +1,7 @@
## @file
# This file is used to define common static strings used by INF/DEC/DSC files
#
-# Copyright (c) 2007 - 2008, 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
@@ -459,14 +459,18 @@
TAB_BUILD_RULE_VERSION = "build_rule_version"
# section name for PCDs
-TAB_PCDS_DYNAMIC_DEFAULT = "PcdsDynamicDefault"
-TAB_PCDS_DYNAMIC_VPD = "PcdsDynamicVpd"
-TAB_PCDS_DYNAMIC_HII = "PcdsDynamicHii"
-TAB_PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
-TAB_PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
-TAB_PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
+PCDS_DYNAMIC_DEFAULT = "PcdsDynamicDefault"
+PCDS_DYNAMIC_VPD = "PcdsDynamicVpd"
+PCDS_DYNAMIC_HII = "PcdsDynamicHii"
+PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
+PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
+PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
# Section allowed to have items after arch
SECTIONS_HAVE_ITEM_AFTER_ARCH = [TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),
- TAB_PCDS_DYNAMIC_DEFAULT.upper(), TAB_PCDS_DYNAMIC_VPD.upper(), TAB_PCDS_DYNAMIC_HII.upper(),
- TAB_PCDS_DYNAMICEX_DEFAULT.upper(), TAB_PCDS_DYNAMICEX_VPD.upper(), TAB_PCDS_DYNAMICEX_HII.upper()]
+ PCDS_DYNAMIC_DEFAULT.upper(),
+ PCDS_DYNAMIC_VPD.upper(),
+ PCDS_DYNAMIC_HII.upper(),
+ PCDS_DYNAMICEX_DEFAULT.upper(),
+ PCDS_DYNAMICEX_VPD.upper(),
+ PCDS_DYNAMICEX_HII.upper()]
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-01 01:44:56 UTC (rev 2530)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-01 05:12:41 UTC (rev 2531)
@@ -1,7 +1,7 @@
## @file
# This file is used to parse meta files
#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 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
@@ -288,15 +288,17 @@
self._SectionType = self.DataType[self._SectionName]
else:
self._SectionType = MODEL_UNKNOWN
- EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
- Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
+ EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+ self.MetaFile, self._LineIndex + 1, self._CurrentLine)
+
+ # Check if the section name is valid
+ if self._SectionName not in SECTIONS_HAVE_ITEM_AFTER_ARCH and len(ItemList) > 2:
+ EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+ self.MetaFile, self._LineIndex + 1, self._CurrentLine)
+
# S1 is always Arch
if len(ItemList) > 1:
S1 = ItemList[1].upper()
- if self._SectionName not in SECTIONS_HAVE_ITEM_AFTER_ARCH and len(ItemList) > 2:
- EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
- self.MetaFile, self._LineIndex + 1, self._CurrentLine)
-
else:
S1 = 'COMMON'
ArchList.add(S1)
@@ -1637,7 +1639,9 @@
ArchList = set()
for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
if Item == '':
- continue
+ EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR,
+ "section name can NOT be empty or incorrectly use separator comma",
+ self.MetaFile, self._LineIndex + 1, self._CurrentLine)
ItemList = GetSplitValueList(Item, TAB_SPLIT)
# different types of PCD are permissible in one section
@@ -1646,9 +1650,8 @@
if self.DataType[self._SectionName] not in self._SectionType:
self._SectionType.append(self.DataType[self._SectionName])
else:
- EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
- Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
- continue
+ EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+ self.MetaFile, self._LineIndex + 1, self._CurrentLine)
if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._SectionType) > 1:
EdkLogger.error(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hc...@us...> - 2012-06-01 01:45:03
|
Revision: 2530
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2530&view=rev
Author: hchen30
Date: 2012-06-01 01:44:56 +0000 (Fri, 01 Jun 2012)
Log Message:
-----------
1. Enhance build tool to break when there is an invalid section name in INF file.
2. Clean some format issues.
Reviewed-by: Yurui Zeng <yur...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-05-31 03:07:05 UTC (rev 2529)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-06-01 01:44:56 UTC (rev 2530)
@@ -27,14 +27,14 @@
TAB_SECTION_START = '['
TAB_SECTION_END = ']'
TAB_OPTION_START = '<'
-TAB_OPTION_END = '>'
+TAB_OPTION_END = '>'
TAB_SLASH = '\\'
TAB_BACK_SLASH = '/'
TAB_LINE_BREAK = '\n'
TAB_PRINTCHAR_VT = '\x0b'
TAB_PRINTCHAR_BS = '\b'
TAB_PRINTCHAR_NUL = '\0'
-TAB_UINT8 = 'UINT8'
+TAB_UINT8 = 'UINT8'
TAB_UINT16 = 'UINT16'
TAB_UINT32 = 'UINT32'
TAB_UINT64 = 'UINT64'
@@ -83,7 +83,7 @@
EDK_COMPONENT_TYPE_RT_DRIVER = 'RT_DRIVER'
EDK_COMPONENT_TYPE_SAL_RT_DRIVER = 'SAL_RT_DRIVER'
EDK_COMPONENT_TYPE_APPLICATION = 'APPLICATION'
-EDK_NAME = 'EDK'
+EDK_NAME = 'EDK'
EDKII_NAME = 'EDKII'
BINARY_FILE_TYPE_FW = 'FW'
@@ -340,7 +340,7 @@
TAB_INF_USAGE_SOME_PRO = 'SOMETIMES_PRODUCES'
TAB_INF_USAGE_CON = 'CONSUMES'
TAB_INF_USAGE_SOME_CON = 'SOMETIMES_CONSUMES'
-TAB_INF_USAGE_NOTIFY = 'NOTIFY'
+TAB_INF_USAGE_NOTIFY = 'NOTIFY'
TAB_INF_USAGE_TO_START = 'TO_START'
TAB_INF_USAGE_BY_START = 'BY_START'
TAB_INF_GUIDTYPE_EVENT = 'Event'
@@ -457,3 +457,16 @@
# Build Rule File Version Definition
#
TAB_BUILD_RULE_VERSION = "build_rule_version"
+
+# section name for PCDs
+TAB_PCDS_DYNAMIC_DEFAULT = "PcdsDynamicDefault"
+TAB_PCDS_DYNAMIC_VPD = "PcdsDynamicVpd"
+TAB_PCDS_DYNAMIC_HII = "PcdsDynamicHii"
+TAB_PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
+TAB_PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
+TAB_PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
+
+# Section allowed to have items after arch
+SECTIONS_HAVE_ITEM_AFTER_ARCH = [TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),
+ TAB_PCDS_DYNAMIC_DEFAULT.upper(), TAB_PCDS_DYNAMIC_VPD.upper(), TAB_PCDS_DYNAMIC_HII.upper(),
+ TAB_PCDS_DYNAMICEX_DEFAULT.upper(), TAB_PCDS_DYNAMICEX_VPD.upper(), TAB_PCDS_DYNAMICEX_HII.upper()]
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-05-31 03:07:05 UTC (rev 2529)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2012-06-01 01:44:56 UTC (rev 2530)
@@ -44,7 +44,7 @@
# Syntax check
if not TokenList[0]:
EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
if len(TokenList) < 2:
TokenList.append('')
@@ -53,11 +53,11 @@
# Global macros can be only defined via environment variable
if Name in GlobalData.gGlobalDefines:
EdkLogger.error('Parser', FORMAT_INVALID, "%s can only be defined via environment variable" % Name,
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
# Only upper case letters, digit and '_' are allowed
if not gMacroNamePattern.match(Name):
EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
Value = ReplaceMacro(Value, self._Macros)
if Type in self.DataType:
@@ -85,14 +85,14 @@
# EDK_GLOBAL defined macros
elif type(self) != DscParser:
EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used in .dsc file",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
elif self._SectionType != MODEL_META_DATA_HEADER:
EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used under [Defines] section",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
elif (Name in self._FileLocalMacros) and (self._FileLocalMacros[Name] != Value):
EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL defined a macro with the same name and different value as one defined by 'DEFINE'",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
-
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
+
self._ValueList = [Type, Name, Value]
return MacroParser
@@ -146,7 +146,7 @@
# @param Owner Owner ID (for sub-section parsing)
# @param From ID from which the data comes (for !INCLUDE directive)
#
- def __init__(self, FilePath, FileType, Table, Owner=-1, From=-1):
+ def __init__(self, FilePath, FileType, Table, Owner= -1, From= -1):
self._Table = Table
self._RawTable = Table
self._FileType = FileType
@@ -262,7 +262,7 @@
## Skip unsupported data
def _Skip(self):
EdkLogger.warn("Parser", "Unrecognized content", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine);
+ Line=self._LineIndex + 1, ExtraData=self._CurrentLine);
self._ValueList[0:1] = [self._CurrentLine]
## Section header parser
@@ -282,20 +282,25 @@
# different section should not mix in one section
if self._SectionName != '' and self._SectionName != ItemList[0].upper():
EdkLogger.error('Parser', FORMAT_INVALID, "Different section names in the same section",
- File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+ File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
self._SectionName = ItemList[0].upper()
if self._SectionName in self.DataType:
self._SectionType = self.DataType[self._SectionName]
else:
self._SectionType = MODEL_UNKNOWN
EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+ Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
# S1 is always Arch
if len(ItemList) > 1:
S1 = ItemList[1].upper()
+ if self._SectionName not in SECTIONS_HAVE_ITEM_AFTER_ARCH and len(ItemList) > 2:
+ EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
+ self.MetaFile, self._LineIndex + 1, self._CurrentLine)
+
else:
S1 = 'COMMON'
ArchList.add(S1)
+
# S2 may be Platform or ModuleType
if len(ItemList) > 2:
S2 = ItemList[2].upper()
@@ -306,7 +311,7 @@
# 'COMMON' must not be used with specific ARCHs at the same section
if 'COMMON' in ArchList and len(ArchList) > 1:
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
- File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+ File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
# If the section information is needed later, it should be stored in database
self._ValueList[0] = self._SectionName
@@ -317,10 +322,10 @@
self._ValueList[1:len(TokenList)] = TokenList
if not self._ValueList[1]:
EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
if not self._ValueList[2]:
EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
Name, Value = self._ValueList[1], self._ValueList[2]
@@ -330,7 +335,7 @@
self._Version = int(Value, 0)
except:
EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version number",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
if type(self) == InfParser and self._Version < 0x00010005:
# EDK module allows using defines as macros
@@ -358,7 +363,7 @@
"'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
ExtraData=self._CurrentLine,
File=self.MetaFile,
- Line=self._LineIndex+1
+ Line=self._LineIndex + 1
)
def _GetMacros(self):
@@ -391,11 +396,11 @@
ComComMacroDict = {}
ComSpeMacroDict = {}
SpeSpeMacroDict = {}
-
+
ActiveSectionType = self._SectionType
if type(self) == DecParser:
ActiveSectionType = self._SectionType[0]
-
+
for (SectionType, Scope) in self._SectionsMacroDict:
if SectionType != ActiveSectionType:
continue
@@ -406,7 +411,7 @@
break
else:
SpeSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
-
+
for ActiveScope in self._Scope:
Scope0, Scope1 = ActiveScope[0], ActiveScope[1]
if(Scope0, Scope1) not in Scope and (Scope0, "COMMON") not in Scope and ("COMMON", Scope1) not in Scope:
@@ -423,9 +428,9 @@
return Macros
- _SectionParser = {}
- Finished = property(_GetFinished, _SetFinished)
- _Macros = property(_GetMacros)
+ _SectionParser = {}
+ Finished = property(_GetFinished, _SetFinished)
+ _Macros = property(_GetMacros)
## INF file parser class
@@ -527,13 +532,13 @@
MODEL_META_DATA_USER_EXTENSION]:
EdkLogger.error('Parser', FORMAT_INVALID,
"Section [%s] is not allowed in inf file without version" % (self._SectionName),
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
elif self._SectionType in [MODEL_EFI_INCLUDE,
MODEL_EFI_LIBRARY_INSTANCE,
MODEL_META_DATA_NMAKE]:
EdkLogger.error('Parser', FORMAT_INVALID,
"Section [%s] is not allowed in inf file with version 0x%08x" % (self._SectionName, self._Version),
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
continue
# merge two lines specified by '\' in section NMAKE
elif self._SectionType == MODEL_META_DATA_NMAKE:
@@ -553,7 +558,7 @@
NmakeLine = ''
# section content
- self._ValueList = ['','','']
+ self._ValueList = ['', '', '']
# parse current line, result will be put in self._ValueList
self._SectionParser[self._SectionType](self)
if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
@@ -571,14 +576,14 @@
Arch,
Platform,
self._Owner[-1],
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
+ self._LineIndex + 1,
+ - 1,
+ self._LineIndex + 1,
+ - 1,
0
)
if IsFindBlockComment:
- EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",
+ EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",
File=self.MetaFile)
self._Done()
@@ -636,15 +641,15 @@
if len(TokenList) < 2:
EdkLogger.error('Parser', FORMAT_INVALID, "No file type or path specified",
ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if not TokenList[0]:
EdkLogger.error('Parser', FORMAT_INVALID, "No file type specified",
ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if not TokenList[1]:
EdkLogger.error('Parser', FORMAT_INVALID, "No file path specified",
ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
self._ValueList[0:len(TokenList)] = TokenList
self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros)
@@ -665,14 +670,14 @@
if len(ValueList) != 2:
EdkLogger.error('Parser', FORMAT_INVALID, "Illegal token space GUID and PCD name format",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
self._ValueList[0:1] = ValueList
if len(TokenList) > 1:
self._ValueList[2] = TokenList[1]
if self._ValueList[0] == '' or self._ValueList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
if self._ValueList[2] != '':
@@ -691,11 +696,11 @@
MODEL_UNKNOWN : MetaFileParser._Skip,
MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,
MODEL_META_DATA_BUILD_OPTION : MetaFileParser._BuildOptionParser,
- MODEL_EFI_INCLUDE : _IncludeParser, # for Edk.x modules
- MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, # for Edk.x modules
+ MODEL_EFI_INCLUDE : _IncludeParser, # for Edk.x modules
+ MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, # for Edk.x modules
MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,
MODEL_META_DATA_PACKAGE : MetaFileParser._PathParser,
- MODEL_META_DATA_NMAKE : _NmakeParser, # for Edk.x modules
+ MODEL_META_DATA_NMAKE : _NmakeParser, # for Edk.x modules
MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
MODEL_PCD_FEATURE_FLAG : _PcdParser,
@@ -781,7 +786,7 @@
# @param Owner Owner ID (for sub-section parsing)
# @param From ID from which the data comes (for !INCLUDE directive)
#
- def __init__(self, FilePath, FileType, Table, Owner=-1, From=-1):
+ def __init__(self, FilePath, FileType, Table, Owner= -1, From= -1):
# prevent re-initialization
if hasattr(self, "_Table"):
return
@@ -791,12 +796,12 @@
self._DirectiveStack = []
self._DirectiveEvalStack = []
self._Enabled = 1
-
+
#
# Specify whether current line is in uncertain condition
#
self._InDirective = -1
-
+
# Final valid replacable symbols
self._Symbols = {}
#
@@ -823,7 +828,7 @@
self._LineIndex = Index
if self._InSubsection and self._Owner[-1] == -1:
self._Owner.append(self._LastItem)
-
+
# section header
if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
self._SectionType = MODEL_META_DATA_SECTION_HEADER
@@ -866,10 +871,10 @@
ModuleType,
self._Owner[-1],
self._From,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
+ self._LineIndex + 1,
+ - 1,
+ self._LineIndex + 1,
+ - 1,
self._Enabled
)
@@ -887,12 +892,12 @@
else:
self._SubsectionType = MODEL_UNKNOWN
EdkLogger.warn("Parser", "Unrecognized sub-section", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+ Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
self._ValueList[0] = self._SubsectionName
## Directive statement parser
def _DirectiveParser(self):
- self._ValueList = ['','','']
+ self._ValueList = ['', '', '']
TokenList = GetSplitValueList(self._CurrentLine, ' ', 1)
self._ValueList[0:len(TokenList)] = TokenList
@@ -900,7 +905,7 @@
DirectiveName = self._ValueList[0].upper()
if DirectiveName not in self.DataType:
EdkLogger.error("Parser", FORMAT_INVALID, "Unknown directive [%s]" % DirectiveName,
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if DirectiveName in ['!IF', '!IFDEF', '!IFNDEF']:
self._InDirective += 1
@@ -910,7 +915,7 @@
if DirectiveName in ['!IF', '!IFDEF', '!INCLUDE', '!IFNDEF', '!ELSEIF'] and self._ValueList[1] == '':
EdkLogger.error("Parser", FORMAT_INVALID, "Missing expression",
- File=self.MetaFile, Line=self._LineIndex+1,
+ File=self.MetaFile, Line=self._LineIndex + 1,
ExtraData=self._CurrentLine)
ItemType = self.DataType[DirectiveName]
@@ -928,7 +933,7 @@
break
else:
EdkLogger.error("Parser", FORMAT_INVALID, "Redundant '!endif'",
- File=self.MetaFile, Line=self._LineIndex+1,
+ File=self.MetaFile, Line=self._LineIndex + 1,
ExtraData=self._CurrentLine)
elif ItemType != MODEL_META_DATA_INCLUDE:
# Break if there's a !else is followed by a !elseif
@@ -936,14 +941,14 @@
self._DirectiveStack and \
self._DirectiveStack[-1][0] == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE:
EdkLogger.error("Parser", FORMAT_INVALID, "'!elseif' after '!else'",
- File=self.MetaFile, Line=self._LineIndex+1,
+ File=self.MetaFile, Line=self._LineIndex + 1,
ExtraData=self._CurrentLine)
- self._DirectiveStack.append((ItemType, self._LineIndex+1, self._CurrentLine))
+ self._DirectiveStack.append((ItemType, self._LineIndex + 1, self._CurrentLine))
elif self._From > 0:
EdkLogger.error('Parser', FORMAT_INVALID,
"No '!include' allowed in included file",
- ExtraData=self._CurrentLine, File=self.MetaFile,
- Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile,
+ Line=self._LineIndex + 1)
#
# Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
@@ -959,10 +964,10 @@
ModuleType,
self._Owner[-1],
self._From,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
+ self._LineIndex + 1,
+ - 1,
+ self._LineIndex + 1,
+ - 1,
0
)
@@ -975,16 +980,16 @@
# Syntax check
if not self._ValueList[1]:
EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
if not self._ValueList[2]:
EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
if not self._ValueList[1] in self.DefineKeywords:
EdkLogger.error('Parser', FORMAT_INVALID,
"Unknown keyword found: %s. "
"If this is a macro you must "
"add it as a DEFINE in the DSC" % self._ValueList[1],
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
self._Defines[self._ValueList[1]] = self._ValueList[2]
self._ItemType = self.DataType[TAB_DSC_DEFINES.upper()]
@@ -993,7 +998,7 @@
TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
if len(TokenList) != 2:
EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is '<Integer>|<UiName>'",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
+ ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
self._ValueList[0:len(TokenList)] = TokenList
## Parse Edk style of library modules
@@ -1024,11 +1029,11 @@
if self._ValueList[0] == '' or self._ValueList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if self._ValueList[2] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
@@ -1052,15 +1057,15 @@
if len(TokenList) < 2:
EdkLogger.error('Parser', FORMAT_INVALID, "No library class or instance specified",
ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if TokenList[0] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No library class specified",
ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if TokenList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No library instance specified",
ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
self._ValueList[0:len(TokenList)] = TokenList
@@ -1088,7 +1093,7 @@
"'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
ExtraData=self._CurrentLine,
File=self.MetaFile,
- Line=self._LineIndex+1
+ Line=self._LineIndex + 1
)
## Override parent's method since we'll do all macro replacements in parser
@@ -1192,23 +1197,23 @@
" it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
" of the DSC file, and it is currently defined in this section:"
" %s, line #: %d." % (Excpt.Pcd, Info[0], Info[1]),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
+ File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+ Line=self._LineIndex + 1)
else:
EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s) is not defined in DSC file" % Excpt.Pcd,
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
+ File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+ Line=self._LineIndex + 1)
else:
EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
+ File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+ Line=self._LineIndex + 1)
except MacroException, Excpt:
EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
+ File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+ Line=self._LineIndex + 1)
if self._ValueList == None:
- continue
+ continue
NewOwner = self._IdMapping.get(Owner, -1)
self._Enabled = int((not self._DirectiveEvalStack) or (False not in self._DirectiveEvalStack))
@@ -1221,10 +1226,10 @@
S2,
NewOwner,
self._From,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
+ self._LineIndex + 1,
+ - 1,
+ self._LineIndex + 1,
+ - 1,
self._Enabled
)
self._IdMapping[Id] = self._LastItem
@@ -1248,14 +1253,14 @@
self._SubsectionType = MODEL_UNKNOWN
def __RetrievePcdValue(self):
- Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem=-1.0)
- for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
+ Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem= -1.0)
+ for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
Name = TokenSpaceGuid + '.' + PcdName
self._Symbols[Name] = Value
- Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem=-1.0)
- for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
+ Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem= -1.0)
+ for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
Name = TokenSpaceGuid + '.' + PcdName
self._Symbols[Name] = Value
@@ -1265,8 +1270,8 @@
for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNAMIC_EX_HII,
MODEL_PCD_DYNAMIC_EX_VPD):
- Records = self._RawTable.Query(PcdType, BelongsToItem=-1.0)
- for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
+ Records = self._RawTable.Query(PcdType, BelongsToItem= -1.0)
+ for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
Name = TokenSpaceGuid + '.' + PcdName
if Name not in GlobalData.gPlatformOtherPcds:
PcdLine = Line
@@ -1287,13 +1292,13 @@
self._ConstructSectionMacroDict(Name, Value)
elif self._ItemType == MODEL_META_DATA_GLOBAL_DEFINE:
GlobalData.gEdkGlobal[Name] = Value
-
+
#
# Keyword in [Defines] section can be used as Macros
#
if (self._ItemType == MODEL_META_DATA_HEADER) and (self._SectionType == MODEL_META_DATA_HEADER):
self._FileLocalMacros[Name] = Value
-
+
self._ValueList = [Type, Name, Value]
def __ProcessDirective(self):
@@ -1313,8 +1318,8 @@
# the precise number of line and return the evaluation result
#
EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
+ File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+ Line=self._LineIndex + 1)
Result = Excpt.result
if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
@@ -1368,7 +1373,7 @@
# Allow using MACROs comes from [Defines] section to keep compatible.
#
__IncludeMacros.update(self._Macros)
-
+
IncludedFile = NormPath(ReplaceMacro(self._ValueList[1], __IncludeMacros, RaiseError=True))
#
# First search the include file under the same directory as DSC file
@@ -1382,14 +1387,14 @@
IncludedFile1 = PathClass(IncludedFile, GlobalData.gWorkspace)
ErrorCode, ErrorInfo2 = IncludedFile1.Validate()
if ErrorCode != 0:
- EdkLogger.error('parser', ErrorCode, File=self._FileWithError,
- Line=self._LineIndex+1, ExtraData=ErrorInfo1 + "\n"+ ErrorInfo2)
+ EdkLogger.error('parser', ErrorCode, File=self._FileWithError,
+ Line=self._LineIndex + 1, ExtraData=ErrorInfo1 + "\n" + ErrorInfo2)
self._FileWithError = IncludedFile1
IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, False)
- Owner = self._Content[self._ContentIndex-1][0]
- Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable,
+ Owner = self._Content[self._ContentIndex - 1][0]
+ Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable,
Owner=Owner, From=Owner)
# set the parser status with current status
@@ -1403,17 +1408,17 @@
# update current status with sub-parser's status
self._SectionName = Parser._SectionName
self._SectionType = Parser._SectionType
- self._Scope = Parser._Scope
- self._Enabled = Parser._Enabled
+ self._Scope = Parser._Scope
+ self._Enabled = Parser._Enabled
# Insert all records in the table for the included file into dsc file table
Records = IncludedFileTable.GetAll()
if Records:
self._Content[self._ContentIndex:self._ContentIndex] = Records
- self._Content.pop(self._ContentIndex-1)
+ self._Content.pop(self._ContentIndex - 1)
self._ValueList = None
self._ContentIndex -= 1
-
+
def __ProcessSkuId(self):
self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True)
for Value in self._ValueList]
@@ -1431,7 +1436,7 @@
# PCD value can be an expression
#
if len(ValueList) > 1 and ValueList[1] == 'VOID*':
- PcdValue = ValueList[0]
+ PcdValue = ValueList[0]
try:
ValueList[0] = ValueExpression(PcdValue, self._Macros)(True)
except WrnExpression, Value:
@@ -1458,7 +1463,7 @@
ValueList[-1] = ValueExpression(PcdValue, self._Macros)(True)
except WrnExpression, Value:
ValueList[-1] = Value.result
-
+
if ValueList[-1] == 'True':
ValueList[-1] = '1'
if ValueList[-1] == 'False':
@@ -1501,7 +1506,7 @@
MODEL_META_DATA_SUBSECTION_HEADER : _SubsectionHeaderParser,
}
- _Macros = property(_GetMacros)
+ _Macros = property(_GetMacros)
## DEC file parser class
#
@@ -1559,7 +1564,7 @@
# save comment for later use
if Comment:
- self._Comments.append((Comment, self._LineIndex+1))
+ self._Comments.append((Comment, self._LineIndex + 1))
# skip empty line
if Line == '':
continue
@@ -1574,7 +1579,7 @@
continue
# section content
- self._ValueList = ['','','']
+ self._ValueList = ['', '', '']
self._SectionParser[self._SectionType[0]](self)
if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
self._ItemType = -1
@@ -1594,10 +1599,10 @@
Arch,
ModuleType,
self._Owner[-1],
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
+ self._LineIndex + 1,
+ - 1,
+ self._LineIndex + 1,
+ - 1,
0
)
for Comment, LineNo in self._Comments:
@@ -1610,9 +1615,9 @@
ModuleType,
self._LastItem,
LineNo,
- -1,
+ - 1,
LineNo,
- -1,
+ - 1,
0
)
self._Comments = []
@@ -1642,7 +1647,7 @@
self._SectionType.append(self.DataType[self._SectionName])
else:
EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+ Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
continue
if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._SectionType) > 1:
@@ -1651,7 +1656,7 @@
FORMAT_INVALID,
"%s must not be in the same section of other types of PCD" % TAB_PCDS_FEATURE_FLAG_NULL,
File=self.MetaFile,
- Line=self._LineIndex+1,
+ Line=self._LineIndex + 1,
ExtraData=self._CurrentLine
)
# S1 is always Arch
@@ -1671,7 +1676,7 @@
# 'COMMON' must not be used with specific ARCHs at the same section
if 'COMMON' in ArchList and len(ArchList) > 1:
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
- File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
+ File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
## [guids], [ppis] and [protocols] section parser
@ParseMacro
@@ -1680,20 +1685,20 @@
if len(TokenList) < 2:
EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name or value specified",
ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if TokenList[0] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name specified",
ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if TokenList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No GUID value specified",
ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if TokenList[1][0] != '{' or TokenList[1][-1] != '}' or GuidStructureStringToGuidString(TokenList[1]) == '':
EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value format",
ExtraData=self._CurrentLine + \
" (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
self._ValueList[0] = TokenList[0]
self._ValueList[1] = TokenList[1]
@@ -1709,74 +1714,74 @@
def _PcdParser(self):
TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
- ValueRe = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*')
+ ValueRe = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*')
# check PCD information
if self._ValueList[0] == '' or self._ValueList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check format of token space GUID CName
if not ValueRe.match(self._ValueList[0]):
EdkLogger.error('Parser', FORMAT_INVALID, "The format of the token space GUID CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check format of PCD CName
if not ValueRe.match(self._ValueList[1]):
EdkLogger.error('Parser', FORMAT_INVALID, "The format of the PCD CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check PCD datum information
if len(TokenList) < 2 or TokenList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "No PCD Datum information given",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
-
- ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
+
+ ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
PtrValue = ValueRe.findall(TokenList[1])
-
+
# Has VOID* type string, may contain "|" character in the string.
if len(PtrValue) != 0:
ptrValueList = re.sub(ValueRe, '', TokenList[1])
- ValueList = GetSplitValueList(ptrValueList)
+ ValueList = GetSplitValueList(ptrValueList)
ValueList[0] = PtrValue[0]
else:
ValueList = GetSplitValueList(TokenList[1])
-
-
+
+
# check if there's enough datum information given
if len(ValueList) != 3:
EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Datum information given",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check default value
if ValueList[0] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "Missing DefaultValue in PCD Datum information",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check datum type
if ValueList[1] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "Missing DatumType in PCD Datum information",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check token of the PCD
if ValueList[2] == '':
EdkLogger.error('Parser', FORMAT_INVALID, "Missing Token in PCD Datum information",
ExtraData=self._CurrentLine + \
" (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
# check format of default value against the datum type
IsValid, Cause = CheckPcdDatum(ValueList[1], ValueList[0])
if not IsValid:
EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
- File=self.MetaFile, Line=self._LineIndex+1)
+ File=self.MetaFile, Line=self._LineIndex + 1)
if ValueList[0] in ['True', 'true', 'TRUE']:
ValueList[0] = '1'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xf...@us...> - 2012-05-31 03:07:11
|
Revision: 2529
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2529&view=rev
Author: xfzyr
Date: 2012-05-31 03:07:05 +0000 (Thu, 31 May 2012)
Log Message:
-----------
Add the check for PCD string value and the Maximum size value.
Signed-off-by: Yurui Zeng <yur...@in...>
Reviewed-by: Boyer, Donna J <don...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/DataType.py
trunk/BaseTools/Source/Python/Common/Misc.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Modified: trunk/BaseTools/Source/Python/Common/DataType.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/DataType.py 2012-05-29 08:21:34 UTC (rev 2528)
+++ trunk/BaseTools/Source/Python/Common/DataType.py 2012-05-31 03:07:05 UTC (rev 2529)
@@ -31,6 +31,9 @@
TAB_SLASH = '\\'
TAB_BACK_SLASH = '/'
TAB_LINE_BREAK = '\n'
+TAB_PRINTCHAR_VT = '\x0b'
+TAB_PRINTCHAR_BS = '\b'
+TAB_PRINTCHAR_NUL = '\0'
TAB_UINT8 = 'UINT8'
TAB_UINT16 = 'UINT16'
TAB_UINT32 = 'UINT32'
Modified: trunk/BaseTools/Source/Python/Common/Misc.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/Misc.py 2012-05-29 08:21:34 UTC (rev 2528)
+++ trunk/BaseTools/Source/Python/Common/Misc.py 2012-05-31 03:07:05 UTC (rev 2529)
@@ -1236,12 +1236,12 @@
## AnalyzeVpdPcdData
#
-# Analyze the vpd pcd Value, Datum type and TokenNumber.
+# Analyze the vpd pcd VpdOffset, MaxDatumSize and InitialValue.
# Used to avoid split issue while the value string contain "|" character
#
-# @param[in] Setting: A String contain value/datum type/token number information;
+# @param[in] Setting: A String contain VpdOffset/MaxDatumSize/InitialValue information;
#
-# @retval ValueList: A List contain value, datum type and toke number.
+# @retval ValueList: A List contain VpdOffset, MaxDatumSize and InitialValue.
#
def AnalyzeVpdPcdData(Setting):
ValueList = ['', '', '']
@@ -1269,11 +1269,26 @@
#
def CheckPcdDatum(Type, Value):
if Type == "VOID*":
+ ValueRe = re.compile(r'\s*L?\".*\"\s*$')
if not (((Value.startswith('L"') or Value.startswith('"')) and Value.endswith('"'))
or (Value.startswith('{') and Value.endswith('}'))
):
return False, "Invalid value [%s] of type [%s]; must be in the form of {...} for array"\
- ", or \"...\" for string, or L\"...\" for unicode string" % (Value, Type)
+ ", or \"...\" for string, or L\"...\" for unicode string" % (Value, Type)
+ elif ValueRe.match(Value):
+ # Check the chars in UnicodeString or CString is printable
+ if Value.startswith("L"):
+ Value = Value[2:-1]
+ else:
+ Value = Value[1:-1]
+ Printset = set(string.printable)
+ Printset.remove(TAB_PRINTCHAR_VT)
+ Printset.add(TAB_PRINTCHAR_BS)
+ Printset.add(TAB_PRINTCHAR_NUL)
+ if not set(Value).issubset(Printset):
+ PrintList = list(Printset)
+ PrintList.sort()
+ return False, "Invalid PCD string value of type [%s]; must be printable chars %s." % (Type, PrintList)
elif Type == 'BOOLEAN':
if Value not in ['TRUE', 'True', 'true', '0x1', '0x01', '1', 'FALSE', 'False', 'false', '0x0', '0x00', '0']:
return False, "Invalid value [%s] of type [%s]; must be one of TRUE, True, true, 0x1, 0x01, 1"\
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-05-29 08:21:34 UTC (rev 2528)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2012-05-31 03:07:05 UTC (rev 2529)
@@ -856,6 +856,20 @@
if PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
if DecPcds[PcdCName, TokenSpaceGuid].DatumType == "VOID*":
PcdValue = AnalyzeVpdPcdData(Setting)[2]
+ PcdMaxDatumSize = AnalyzeVpdPcdData(Setting)[1]
+ # Check The MaxDatumSize is valid
+ try:
+ Value = long(PcdMaxDatumSize, 0)
+ except ValueError:
+ EdkLogger.error("build", FORMAT_INVALID, "PCD setting error",
+ File=self.MetaFile, Line=Dummy4,
+ ExtraData="\n\tPCD: The MaxDatumSize [%s] of %s.%s must be a hexadecimal or decimal in C language format in DSC: %s\n\t\t\n"
+ % (PcdMaxDatumSize, TokenSpaceGuid, PcdCName, self.MetaFile.Path))
+ if Value < 0x00 or Value > 0xFFFFFFFF:
+ EdkLogger.error("build", FORMAT_INVALID, "PCD setting error",
+ File=self.MetaFile, Line=Dummy4,
+ ExtraData="\n\tPCD: The MaxDatumSize [%s] of %s.%s exceed the valid scope(0x0 - 0xFFFFFFFF) in DSC: %s\n\t\t\n"
+ % (PcdMaxDatumSize, TokenSpaceGuid, PcdCName, self.MetaFile.Path))
else:
PcdValue = AnalyzeVpdPcdData(Setting)[1]
elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|