mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 22:54:51 +02:00
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
This commit is contained in:
parent
3534cbb7a3
commit
51da9e80d4
@ -1071,7 +1071,7 @@ class PcdDatabase {
|
|||||||
// Add a mapping if this dynamic PCD entry is a EX type
|
// Add a mapping if this dynamic PCD entry is a EX type
|
||||||
//
|
//
|
||||||
if (t.isDynamicEx()) {
|
if (t.isDynamicEx()) {
|
||||||
exMapTable.add(t.tokenNumber,
|
exMapTable.add((int)t.tokenNumber,
|
||||||
t.dynamicExTokenNumber,
|
t.dynamicExTokenNumber,
|
||||||
guidTable.add(t.tokenSpaceName, t.getPrimaryKeyString()),
|
guidTable.add(t.tokenSpaceName, t.getPrimaryKeyString()),
|
||||||
t.getPrimaryKeyString()
|
t.getPrimaryKeyString()
|
||||||
@ -2045,7 +2045,7 @@ public class CollectPCDAction {
|
|||||||
boolean isDuplicate = false;
|
boolean isDuplicate = false;
|
||||||
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
|
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
|
||||||
Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
|
Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
|
||||||
int tokenNumber = 0;
|
long tokenNumber = 0;
|
||||||
String moduleName = null;
|
String moduleName = null;
|
||||||
String datum = null;
|
String datum = null;
|
||||||
int maxDatumSize = 0;
|
int maxDatumSize = 0;
|
||||||
@ -2117,7 +2117,8 @@ public class CollectPCDAction {
|
|||||||
translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));
|
translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));
|
||||||
pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());
|
pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());
|
||||||
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
|
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
|
||||||
tokenNumber = Integer.decode(pcdBuildData.getToken().toString());
|
tokenNumber = Long.decode(pcdBuildData.getToken().toString());
|
||||||
|
|
||||||
if (pcdBuildData.getValue() != null) {
|
if (pcdBuildData.getValue() != null) {
|
||||||
datum = pcdBuildData.getValue().toString();
|
datum = pcdBuildData.getValue().toString();
|
||||||
} else {
|
} else {
|
||||||
@ -2719,7 +2720,7 @@ public class CollectPCDAction {
|
|||||||
String temp;
|
String temp;
|
||||||
boolean hasSkuId0 = false;
|
boolean hasSkuId0 = false;
|
||||||
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
|
Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
|
||||||
int tokenNumber = 0;
|
long tokenNumber = 0;
|
||||||
String hiiDefaultValue = null;
|
String hiiDefaultValue = null;
|
||||||
String[] variableGuidString = null;
|
String[] variableGuidString = null;
|
||||||
|
|
||||||
@ -2757,7 +2758,7 @@ public class CollectPCDAction {
|
|||||||
dynamicInfo.getMaxDatumSize());
|
dynamicInfo.getMaxDatumSize());
|
||||||
throw new EntityException(exceptionString);
|
throw new EntityException(exceptionString);
|
||||||
}
|
}
|
||||||
tokenNumber = Integer.decode(dynamicInfo.getToken().toString());
|
tokenNumber = Long.decode(dynamicInfo.getToken().toString());
|
||||||
if (tokenNumber != token.tokenNumber) {
|
if (tokenNumber != token.tokenNumber) {
|
||||||
exceptionString = String.format("[FPD file error] For dynamic PCD %s, the token number in module %s is 0x%x, but"+
|
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!",
|
"in <DynamicPcdBuildDefinictions>, the token number is 0x%x, they are not match!",
|
||||||
|
@ -67,12 +67,12 @@ public class Token {
|
|||||||
/// platform token space. For Dynamic, dynamicEx type, this number will be re-adjust by
|
/// platform token space. For Dynamic, dynamicEx type, this number will be re-adjust by
|
||||||
/// PCD run-time database autogen tools.
|
/// PCD run-time database autogen tools.
|
||||||
///
|
///
|
||||||
public int tokenNumber;
|
public long tokenNumber;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This token number is retrieved from FPD file for DynamicEx type.
|
/// 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
|
/// All supported PCD type, this value can be retrieved from SPD
|
||||||
|
@ -211,21 +211,23 @@ public class UsageInstance {
|
|||||||
*/
|
*/
|
||||||
public void generateAutoGen(boolean isBuildUsedLibrary)
|
public void generateAutoGen(boolean isBuildUsedLibrary)
|
||||||
throws EntityException {
|
throws EntityException {
|
||||||
String guidStringCName = null;
|
String guidStringCName = null;
|
||||||
boolean isByteArray = false;
|
boolean isByteArray = false;
|
||||||
String printDatum = null;
|
String printDatum = null;
|
||||||
|
String tokenNumberString = null;
|
||||||
|
|
||||||
hAutogenStr = "";
|
hAutogenStr = "";
|
||||||
cAutogenStr = "";
|
cAutogenStr = "";
|
||||||
|
|
||||||
if (this.modulePcdType == Token.PCD_TYPE.DYNAMIC_EX) {
|
if (this.modulePcdType == Token.PCD_TYPE.DYNAMIC_EX) {
|
||||||
hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%016x\r\n",
|
tokenNumberString = Long.toString(parentToken.dynamicExTokenNumber, 16);
|
||||||
parentToken.cName, parentToken.dynamicExTokenNumber);
|
|
||||||
} else {
|
} else {
|
||||||
hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%016x\r\n",
|
tokenNumberString = Long.toString(parentToken.tokenNumber, 16);
|
||||||
parentToken.cName, parentToken.tokenNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%s\r\n",
|
||||||
|
parentToken.cName, tokenNumberString);
|
||||||
|
|
||||||
if (!isBuildUsedLibrary && !parentToken.isDynamicPCD) {
|
if (!isBuildUsedLibrary && !parentToken.isDynamicPCD) {
|
||||||
if (datum.trim().charAt(0) == '{') {
|
if (datum.trim().charAt(0) == '{') {
|
||||||
isByteArray = true;
|
isByteArray = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user