Fix a bug of PCD autogen for UINT64:

when generate macro value for a UINT64 type PCD, "ULL" should be added to forbid compiler tread it as UINT32 value.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@555 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2006-06-19 03:53:41 +00:00
parent 3ce2b1a85f
commit 1cf9cdcc9c
1 changed files with 10 additions and 3 deletions

View File

@ -204,6 +204,7 @@ public class UsageInstance {
String guidStringArray[] = null; String guidStringArray[] = null;
String guidString = null; String guidString = null;
boolean isByteArray = false; boolean isByteArray = false;
String printDatum = null;
hAutogenStr = ""; hAutogenStr = "";
cAutogenStr = ""; cAutogenStr = "";
@ -224,6 +225,12 @@ public class UsageInstance {
} }
} }
if (parentToken.datumType == Token.DATUM_TYPE.UINT64) {
printDatum = this.datum + "ULL";
} else {
printDatum = this.datum;
}
switch (modulePcdType) { switch (modulePcdType) {
case FEATURE_FLAG: case FEATURE_FLAG:
if (isBuildUsedLibrary) { if (isBuildUsedLibrary) {
@ -236,7 +243,7 @@ public class UsageInstance {
} else { } else {
hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n", hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
parentToken.cName, parentToken.cName,
datum.toString()); printDatum);
hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n",
parentToken.cName); parentToken.cName);
cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n", cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",
@ -260,7 +267,7 @@ public class UsageInstance {
} else { } else {
hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n", hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
parentToken.cName, parentToken.cName,
datum.toString()); printDatum);
if (isByteArray) { if (isByteArray) {
cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_%s[] = _PCD_VALUE_%s;\r\n", cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_%s[] = _PCD_VALUE_%s;\r\n",
parentToken.cName, parentToken.cName,
@ -298,7 +305,7 @@ public class UsageInstance {
} else { } else {
hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n", hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
parentToken.cName, parentToken.cName,
datum.toString()); printDatum);
if (isByteArray) { if (isByteArray) {
cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_%s[] = _PCD_VALUE_%s;\r\n", cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_%s[] = _PCD_VALUE_%s;\r\n",
parentToken.cName, parentToken.cName,