summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-26 17:09:08 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-26 17:09:08 +0000
commit51da9e80d4624783c6f7230407d3bd8f28f94a4a (patch)
treefdb71135586df5fde8f8034e550d86366a183ef7 /Tools
parent3534cbb7a33fd3a65d3f9a442f2d6298cae2ce95 (diff)
downloadedk2-platforms-51da9e80d4624783c6f7230407d3bd8f28f94a4a.tar.xz
Fix a bug for token number set in FPD can not exceed 2^31. The fixing is using Long instead of int type.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@632 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java11
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java4
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java16
3 files changed, 17 insertions, 14 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
index 40a462c3d0..25799463e3 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
@@ -1071,7 +1071,7 @@ class PcdDatabase {
// Add a mapping if this dynamic PCD entry is a EX type
//
if (t.isDynamicEx()) {
- exMapTable.add(t.tokenNumber,
+ exMapTable.add((int)t.tokenNumber,
t.dynamicExTokenNumber,
guidTable.add(t.tokenSpaceName, t.getPrimaryKeyString()),
t.getPrimaryKeyString()
@@ -2045,7 +2045,7 @@ public class CollectPCDAction {
boolean isDuplicate = false;
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
- int tokenNumber = 0;
+ long tokenNumber = 0;
String moduleName = null;
String datum = null;
int maxDatumSize = 0;
@@ -2117,7 +2117,8 @@ public class CollectPCDAction {
translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));
pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
- tokenNumber = Integer.decode(pcdBuildData.getToken().toString());
+ tokenNumber = Long.decode(pcdBuildData.getToken().toString());
+
if (pcdBuildData.getValue() != null) {
datum = pcdBuildData.getValue().toString();
} else {
@@ -2719,7 +2720,7 @@ public class CollectPCDAction {
String temp;
boolean hasSkuId0 = false;
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
- int tokenNumber = 0;
+ long tokenNumber = 0;
String hiiDefaultValue = null;
String[] variableGuidString = null;
@@ -2757,7 +2758,7 @@ public class CollectPCDAction {
dynamicInfo.getMaxDatumSize());
throw new EntityException(exceptionString);
}
- tokenNumber = Integer.decode(dynamicInfo.getToken().toString());
+ tokenNumber = Long.decode(dynamicInfo.getToken().toString());
if (tokenNumber != token.tokenNumber) {
exceptionString = String.format("[FPD file error] For dynamic PCD %s, the token number in module %s is 0x%x, but"+
"in <DynamicPcdBuildDefinictions>, the token number is 0x%x, they are not match!",
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
index edcbd80aa2..97c2d29195 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
@@ -67,12 +67,12 @@ public class Token {
/// platform token space. For Dynamic, dynamicEx type, this number will be re-adjust by
/// PCD run-time database autogen tools.
///
- public int tokenNumber;
+ public long tokenNumber;
///
/// This token number is retrieved from FPD file for DynamicEx type.
///
- public int dynamicExTokenNumber;
+ public long dynamicExTokenNumber;
///
/// All supported PCD type, this value can be retrieved from SPD
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
index baf87572f0..d146e9db44 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
@@ -211,21 +211,23 @@ public class UsageInstance {
*/
public void generateAutoGen(boolean isBuildUsedLibrary)
throws EntityException {
- String guidStringCName = null;
- boolean isByteArray = false;
- String printDatum = null;
+ String guidStringCName = null;
+ boolean isByteArray = false;
+ String printDatum = null;
+ String tokenNumberString = null;
hAutogenStr = "";
cAutogenStr = "";
if (this.modulePcdType == Token.PCD_TYPE.DYNAMIC_EX) {
- hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%016x\r\n",
- parentToken.cName, parentToken.dynamicExTokenNumber);
+ tokenNumberString = Long.toString(parentToken.dynamicExTokenNumber, 16);
} else {
- hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%016x\r\n",
- parentToken.cName, parentToken.tokenNumber);
+ tokenNumberString = Long.toString(parentToken.tokenNumber, 16);
}
+ hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%s\r\n",
+ parentToken.cName, tokenNumberString);
+
if (!isBuildUsedLibrary && !parentToken.isDynamicPCD) {
if (datum.trim().charAt(0) == '{') {
isByteArray = true;