diff options
author | hche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-10-16 08:46:52 +0000 |
---|---|---|
committer | hche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-10-16 08:46:52 +0000 |
commit | edbacf2e5cf245287003b341ca814bfa17be604f (patch) | |
tree | f5f11fc7e8d3a8388a8b046026d7c6db49b3d937 /Tools/Java/Source | |
parent | b28af3d768c7352f66b102bda2c8aa49d7cc6569 (diff) | |
download | edk2-platforms-edbacf2e5cf245287003b341ca814bfa17be604f.tar.xz |
1. Fix EDKT344: The algorithm for PCD of msa should be adjusted
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1759 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Java/Source')
3 files changed, 44 insertions, 7 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java index 21d76139c5..daf00ee80f 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java @@ -254,7 +254,7 @@ public class DataType { public static final String FALSE = "False";
//
- // The Sting for USAGE type
+ // The String for USAGE type
//
public final static String USAGE_TYPE_ALWAYS_CONSUMED = "ALWAYS_CONSUMED";
@@ -267,6 +267,19 @@ public class DataType { public final static String USAGE_TYPE_PRIVATE = "PRIVATE";
//
+ // The String for PCD type
+ //
+ public final static String PCD_ITEM_TYPE_FEATURE_FLAG = "FEATURE_FLAG";
+
+ public final static String PCD_ITEM_TYPE_FIXED_AT_BUILD = "FIXED_AT_BUILD";
+
+ public final static String PCD_ITEM_TYPE_PATCHABLE_IN_MODULE = "PATCHABLE_IN_MODULE";
+
+ public final static String PCD_ITEM_TYPE_DYNAMIC = "DYNAMIC";
+
+ public final static String PCD_ITEM_TYPE_DYNAMIC_EX = "DYNAMIC_EX";
+
+ //
// The String for PPI type
//
public final static String PPI_TYPE_PPI = "Ppi";
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java index 4ffca7af59..408e75e812 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java @@ -709,11 +709,11 @@ public class EnumerationData { private void initPcdItemTypes() {
vPcdItemTypes.removeAllElements();
- vPcdItemTypes.addElement("FEATURE_FLAG");
- vPcdItemTypes.addElement("FIXED_AT_BUILD");
- vPcdItemTypes.addElement("PATCHABLE_IN_MODULE");
- vPcdItemTypes.addElement("DYNAMIC");
- vPcdItemTypes.addElement("DYNAMIC_EX");
+ vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG);
+ vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FIXED_AT_BUILD);
+ vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_PATCHABLE_IN_MODULE);
+ vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC);
+ vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC_EX);
}
private void initPcdUsage() {
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java index dedbdddf20..c27b81eea0 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java @@ -458,7 +458,31 @@ public class WorkspaceTools { String help = spd.getPcdDeclarations().getPcdEntryList().get(index).getHelpText();
Vector<String> type = Tools.convertListToVector(spd.getPcdDeclarations().getPcdEntryList()
.get(index).getValidUsage());
-
+ //
+ // The algorithm for PCD of msa should be:
+ // 1. If the type of PCD from Spd is FEATURE_FLAG,
+ // the type of Msa only can be FEATURE_FLAG.
+ // 2. If the type of PCD from Spd is not FEATURE_FLAG,
+ // the type of Msa could be selected from the PCD's all types and "DYNAMIC" type.
+ //
+ boolean hasFEATURE_FLAG = false;
+ boolean hasDYNAMIC = false;
+ for (int indexOfType = 0; indexOfType < type.size(); indexOfType++) {
+ if (type.elementAt(indexOfType).equals(DataType.PCD_ITEM_TYPE_DYNAMIC)) {
+ hasDYNAMIC = true;
+ }
+ if(type.elementAt(indexOfType).equals(DataType.PCD_ITEM_TYPE_FEATURE_FLAG)) {
+ hasFEATURE_FLAG = true;
+ }
+ }
+ if (hasFEATURE_FLAG) {
+ type.removeAllElements();
+ type.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG);
+ } else {
+ if (!hasDYNAMIC) {
+ type.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC);
+ }
+ }
vector.addPcd(new PcdIdentification(name, guidCName, help, type));
}
}
|