summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-21 03:36:00 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-21 03:36:00 +0000
commita49b34c00ede89feac3c5fcfe69776cd947c9154 (patch)
tree5e3ea6eb7db09fb65b94fecc81e3e193693da6a9
parent8aeaf59524ad5d40b559b752c4a1cf78e0b8097b (diff)
downloadedk2-platforms-a49b34c00ede89feac3c5fcfe69776cd947c9154.tar.xz
Use the address of guid array as parameter directly for _PCD_MODE_xx macro for DynamicEx type PCD.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@582 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java23
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java13
2 files changed, 16 insertions, 20 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
index dd33b540c1..fdf90b620c 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
@@ -339,19 +339,22 @@ public class PCDAutoGenAction extends BuildAction {
(guidStringArray[4].substring(6, 8)),
(guidStringArray[4].substring(8, 10)),
(guidStringArray[4].substring(10, 12)));
- if (!isBuildUsedLibrary) {
- Pattern pattern = Pattern.compile("(" + guidStringCName + ")+?");
- Matcher matcher = pattern.matcher(cAutoGenString + " ");
- //
- // Find whether this guid array variable has been generated into autogen.c
- // For different DyanmicEx pcd token who use same token space guid, the token space
- // guid array should be only generated once.
- //
- if (!matcher.find()) {
+
+ Pattern pattern = Pattern.compile("(" + guidStringCName + ")+?");
+ Matcher matcher = pattern.matcher(cAutoGenString + " ");
+ //
+ // Find whether this guid array variable has been generated into autogen.c
+ // For different DyanmicEx pcd token who use same token space guid, the token space
+ // guid array should be only generated once.
+ //
+ if (!matcher.find()) {
+ hAutoGenString += String.format("extern EFI_GUID %s;\r\n",
+ guidStringCName);
+ if (!isBuildUsedLibrary) {
cAutoGenString += String.format("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID %s = %s;\r\n",
guidStringCName,
guidString);
- }
+ }
}
}
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 cfbdb1e149..2769d497f7 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
@@ -200,7 +200,7 @@ public class UsageInstance {
@param isBuildUsedLibrary whether the autogen is for library.
*/
public void generateAutoGen(boolean isBuildUsedLibrary)
- throws EntityException {
+ throws EntityException {
String guidStringCName = null;
boolean isByteArray = false;
String printDatum = null;
@@ -340,20 +340,13 @@ public class UsageInstance {
guidStringCName = "_gPcd_TokenSpaceGuid_" +
parentToken.tokenSpaceName.toString().replaceAll("-", "_");
- hAutogenStr += String.format("extern const EFI_GUID *_gPcd_DynamicEx_TokenSpaceGuid_%s;\r\n",
- parentToken.cName);
- hAutogenStr += String.format("#define _PCD_MODE_%s_%s LibPcdGetEx%s(_gPcd_DynamicEx_TokenSpaceGuid_%s, _PCD_TOKEN_%s)\r\n",
+ hAutogenStr += String.format("#define _PCD_MODE_%s_%s LibPcdGetEx%s(&%s, _PCD_TOKEN_%s)\r\n",
Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
parentToken.cName,
Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- parentToken.cName,
+ guidStringCName,
parentToken.cName);
- if (!isBuildUsedLibrary) {
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID *_gPcd_DynamicEx_TokenSpaceGuid_%s = &%s;\r\n",
- parentToken.cName,
- guidStringCName);
- }
break;
}
}