diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-23 06:40:50 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-23 06:40:50 +0000 |
commit | 10d8dee566d0d882f97b8b89950702c1237a1b55 (patch) | |
tree | 1358f95145af12ebcef71b572811458085423023 | |
parent | 58f1099f3dd6d1d7606cc57046e59488d4cbf023 (diff) | |
download | edk2-platforms-10d8dee566d0d882f97b8b89950702c1237a1b55.tar.xz |
1) make sure a empty database will be generated if the Uinitialized database portion is empty.
2) add a newline at the end of Autogen.c for PCD driver/PEIM.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@606 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java | 14 |
1 files changed, 12 insertions, 2 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 b54f68c815..cf94885847 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java @@ -116,7 +116,7 @@ class StringTable { );
declaList.add(decl);
- cInstCode = tab + " { 0 } " + String.format("/* %s */", stringTable) + commaNewLine;
+ cInstCode = " { 0 } " + String.format("/* %s */", stringTable);
instTable.put(stringTable, cInstCode);
} else {
@@ -1195,6 +1195,7 @@ class PcdDatabase { //
// Generate code for every alignment size
//
+ boolean uinitDatabaseEmpty = true;
for (int align = 8; align > 0; align >>= 1) {
ArrayList<String> declaListBasedOnAlignment = alignmentInitDecl.get(new Integer(align));
ArrayList<String> instListBasedOnAlignment = alignmentInitInst.get(new Integer(align));
@@ -1215,14 +1216,23 @@ class PcdDatabase { }
declaListBasedOnAlignment = alignmentUninitDecl.get(new Integer(align));
+
+ if (declaListBasedOnAlignment.size() != 0) {
+ uinitDatabaseEmpty = false;
+ }
+
for (Object d : declaListBasedOnAlignment) {
String s = (String)d;
uninitDeclStr += tab + s;
}
}
+ if (uinitDatabaseEmpty) {
+ uninitDeclStr += tab + " UINT8 dummy; /* PCD_DATABASE_UNINIT is emptry */\r\n";
+ }
+
initDeclStr += String.format("} %s_PCD_DATABASE_INIT;", phase) + newLine + newLine;
- initInstStr += "};";
+ initInstStr += "};" + newLine;
uninitDeclStr += String.format("} %s_PCD_DATABASE_UNINIT;", phase) + newLine + newLine;
result.put("initDeclStr", initDeclStr);
|