|
From: <gi...@us...> - 2010-08-18 04:56:43
|
Revision: 2017
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2017&view=rev
Author: gikidy
Date: 2010-08-18 04:56:37 +0000 (Wed, 18 Aug 2010)
Log Message:
-----------
Enhance code to process all VPD type PCD's offset are "*".
Modified Paths:
--------------
trunk/BaseTools/Source/Python/BPDG/GenVpd.py
Modified: trunk/BaseTools/Source/Python/BPDG/GenVpd.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-08-18 03:22:30 UTC (rev 2016)
+++ trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-08-18 04:56:37 UTC (rev 2017)
@@ -335,6 +335,20 @@
#
self.PcdUnknownOffsetList.sort(lambda x,y: cmp(x.PcdBinSize, y.PcdBinSize))
+ #
+ # Process all Offset value are "*"
+ #
+ if (len(self.PcdFixedOffsetSizeList) == 0) and (len(self.PcdUnknownOffsetList) != 0) :
+ # The offset start from 0
+ NowOffset = 0
+ for Pcd in self.PcdUnknownOffsetList :
+ Pcd.PcdBinOffset = NowOffset
+ Pcd.PcdOffset = str(hex(Pcd.PcdBinOffset))
+ NowOffset += Pcd.PcdBinSize
+
+ self.PcdFixedOffsetSizeList = self.PcdUnknownOffsetList
+ return
+
# Check the offset of VPD type pcd's offset start from 0.
if self.PcdFixedOffsetSizeList[0].PcdBinOffset != 0 :
EdkLogger.warn("BPDG", "The offset of VPD type pcd should start with 0, please check it.",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2010-09-03 06:07:20
|
Revision: 2040
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2040&view=rev
Author: gikidy
Date: 2010-09-03 06:07:13 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
Enhanced error handling.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/BPDG/GenVpd.py
Modified: trunk/BaseTools/Source/Python/BPDG/GenVpd.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-09-03 05:19:25 UTC (rev 2039)
+++ trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-09-03 06:07:13 UTC (rev 2040)
@@ -73,15 +73,27 @@
def _PackBooleanValue(self, ValueString):
if ValueString.upper() == "TRUE":
- self.PcdValue = pack(_FORMAT_CHAR[1], 1)
+ try:
+ self.PcdValue = pack(_FORMAT_CHAR[1], 1)
+ except:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
else:
- self.PcdValue = pack(_FORMAT_CHAR[1], 0)
-
+ try:
+ self.PcdValue = pack(_FORMAT_CHAR[1], 0)
+ except:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
+
def _PackIntValue(self, IntValue, Size):
if Size not in _FORMAT_CHAR.keys():
EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"Invalid size %d for PCD %s in integer datum size(File: %s Line: %s)." % (Size, self.PcdCName, self.FileName, self.Lineno))
- self.PcdValue = pack(_FORMAT_CHAR[Size], IntValue)
+ try:
+ self.PcdValue = pack(_FORMAT_CHAR[Size], IntValue)
+ except:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
def _PackPtrValue(self, ValueString, Size):
if ValueString.startswith('L"'):
@@ -107,7 +119,11 @@
if len(ValueString) + 1 > Size:
EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
"PCD value string %s is exceed to size %d(File: %s Line: %s)" % (ValueString, Size, self.FileName, self.Lineno))
- self.PcdValue= pack('%ds' % Size, ValueString)
+ try:
+ self.PcdValue= pack('%ds' % Size, ValueString)
+ except:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
def _PackByteArray(self, ValueString, Size):
if (Size < 0):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2010-09-20 00:49:54
|
Revision: 2055
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2055&view=rev
Author: gikidy
Date: 2010-09-20 00:49:47 +0000 (Mon, 20 Sep 2010)
Log Message:
-----------
Error handling enhancement while UINT* type VPD PCD exceed the scope of datum type.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/BPDG/GenVpd.py
Modified: trunk/BaseTools/Source/Python/BPDG/GenVpd.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-09-19 08:59:47 UTC (rev 2054)
+++ trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-09-20 00:49:47 UTC (rev 2055)
@@ -93,6 +93,39 @@
if Size not in _FORMAT_CHAR.keys():
EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
"Invalid size %d for PCD %s in integer datum size(File: %s Line: %s)." % (Size, self.PcdCName, self.FileName, self.Lineno))
+
+ if Size == 1:
+ if IntValue < 0:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "PCD can't be set to negative value %d for PCD %s in UINT8 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif IntValue >= 0x100:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Too large PCD value %d for datum type UINT8 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif Size == 2:
+ if IntValue < 0:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "PCD can't be set to negative value %d for PCD %s in UINT16 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif IntValue >= 0x10000:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Too large PCD value %d for datum type UINT16 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif Size == 4:
+ if IntValue < 0:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "PCD can't be set to negative value %d for PCD %s in UINT32 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif IntValue >= 0x100000000:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Too large PCD value %d for datum type UINT32 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif Size == 8:
+ if IntValue < 0:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "PCD can't be set to negative value %d for PCD %s in UINT32 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ elif IntValue >= 0x10000000000000000:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Too large PCD value %d for datum type UINT32 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
+ else:
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
+ "Invalid size %d for PCD %s in integer datum size(File: %s Line: %s)." % (Size, self.PcdCName, self.FileName, self.Lineno))
+
try:
self.PcdValue = pack(_FORMAT_CHAR[Size], IntValue)
except:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2010-11-04 02:14:24
|
Revision: 2085
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2085&view=rev
Author: gikidy
Date: 2010-11-04 02:14:17 +0000 (Thu, 04 Nov 2010)
Log Message:
-----------
Correct the algorithm for fix offset in BPDG.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/BPDG/GenVpd.py
Modified: trunk/BaseTools/Source/Python/BPDG/GenVpd.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-11-03 10:06:29 UTC (rev 2084)
+++ trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2010-11-04 02:14:17 UTC (rev 2085)
@@ -544,10 +544,8 @@
if lenOfUnfixedList != 0 :
countOfUnfixedList = 0
while(countOfUnfixedList < lenOfUnfixedList) :
- #needFixPcdCName, needFixPcdOffset, needFixPcdSize, needFixPcdValue, needFixUnpackValue = self.PcdUnknownOffsetList[countOfUnfixedList][0:6]
eachUnfixedPcd = self.PcdUnknownOffsetList[countOfUnfixedList]
needFixPcdSize = eachUnfixedPcd.PcdBinSize
- needFixPcdOffset = eachUnfixedPcd.PcdOffset
# Not been fixed
if eachUnfixedPcd.PcdOffset == '*' :
# The offset un-fixed pcd can write into this free space
@@ -566,18 +564,16 @@
FixOffsetSizeListCount += 1
# Decrease the un-fixed pcd offset list's length
- countOfUnfixedList += 1
lenOfUnfixedList -= 1
# Modify the last offset value
- LastOffset += needFixPcdSize
- continue
+ LastOffset += needFixPcdSize
else :
- # It can not insert into those two pcds, need to check stiil has other space can store it.
+ # It can not insert into those two pcds, need to check still has other space can store it.
+ LastOffset = NowOffset + self.PcdFixedOffsetSizeList[FixOffsetSizeListCount].PcdBinSize
FixOffsetSizeListCount += 1
- break
- else :
- continue
+ break
+
# Set the FixOffsetSizeListCount = lenOfList for quit the loop
else :
FixOffsetSizeListCount = lenOfList
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2012-05-21 08:21:56
|
Revision: 2520
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2520&view=rev
Author: yingke
Date: 2012-05-21 08:21:47 +0000 (Mon, 21 May 2012)
Log Message:
-----------
Support CARRAY value of VPD PCD starting with upper case ?\226?\128?\1560X?\226?\128?\157.
Reviewed-by: Su Jikui <jik...@in...>
Signed-off-by: Liu Yingke <yin...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/BPDG/GenVpd.py
Modified: trunk/BaseTools/Source/Python/BPDG/GenVpd.py
===================================================================
--- trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2012-05-21 06:07:38 UTC (rev 2519)
+++ trunk/BaseTools/Source/Python/BPDG/GenVpd.py 2012-05-21 08:21:47 UTC (rev 2520)
@@ -226,7 +226,7 @@
for Index in xrange(len(ValueList)):
Value = None
- if ValueList[Index].startswith('0x'):
+ if ValueList[Index].lower().startswith('0x'):
# translate hex value
try:
Value = int(ValueList[Index], 16)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|