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
This commit is contained in:
hche10x 2006-10-16 08:46:52 +00:00
parent b28af3d768
commit edbacf2e5c
3 changed files with 44 additions and 7 deletions

View File

@ -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";
@ -266,6 +266,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
//

View File

@ -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() {

View File

@ -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));
}
}