X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fplatform%2Fui%2FFpdFileContents.java;h=d942addf50adb966217dd3d720eacee22bc62e58;hp=f730fa2a6ee22cee410c272c63b5138f80e91df3;hb=a390c35d8a99be7adcc551ce541b5a6ce3f5fd2a;hpb=5af6b67fdb381cd8e5193d9c66bba9108ea088ee diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java index f730fa2a6e..d942addf50 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java @@ -231,7 +231,7 @@ public class FpdFileContents { ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator(); while(li.hasNext()) { ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next(); - if (msa.getModuleGuid().equals(s[0]) && msa.getPackageGuid().equals(s[2])) { + if (msa.getModuleGuid().equalsIgnoreCase(s[0]) && msa.getPackageGuid().equalsIgnoreCase(s[2])) { if (msa.getModuleVersion() != null) { if (!msa.getModuleVersion().equals(s[1])) { continue; @@ -776,7 +776,7 @@ public class FpdFileContents { // // ToDo Error // - throw new PcdDeclNotFound(mi.getName() + " " + msaPcd.getCName()); + throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + " in Module " + mi.getName()); } // // AddItem to ModuleSA PcdBuildDefinitions @@ -788,7 +788,7 @@ public class FpdFileContents { } catch (Exception e){ - e.printStackTrace(); + throw e; } @@ -873,16 +873,17 @@ public class FpdFileContents { // // Special dynamic type, if this pcd already exists in other ModuleSA // + /* Comment out Item type checking temporarily. if (itemType.equals("DYNAMIC")) { ListIterator li = pcdConsumer.listIterator(); while(li.hasNext()) { String value = li.next().toString(); String[] valuePart= value.split(" "); - if (!valuePart[4].equals("DYNAMIC")) { + if (!valuePart[5].equals("DYNAMIC")) { //ToDo error for same pcd, other type than dynamic pcdConsumer.remove(listValue); - throw new PcdItemTypeConflictException(value); + throw new PcdItemTypeConflictException(cName, value); } } } @@ -891,14 +892,14 @@ public class FpdFileContents { while(li.hasNext()) { String value = li.next().toString(); String[] valuePart= value.split(" "); - if (valuePart[4].equals("DYNAMIC")) { + if (valuePart[5].equals("DYNAMIC")) { //ToDo error for same pcd, other type than non-dynamic pcdConsumer.remove(listValue); - throw new PcdItemTypeConflictException(value); + throw new PcdItemTypeConflictException(cName, value); } } } - + */ PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData fpdPcd = moduleSa.getPcdBuildDefinition().addNewPcdData(); fpdPcd.setCName(cName); fpdPcd.setToken(token); @@ -906,6 +907,41 @@ public class FpdFileContents { fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType)); fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType)); + if (defaultVal != null){ + fpdPcd.setValue(defaultVal); + } + else { + if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) { + fpdPcd.setValue("0"); + } + if (dataType.equals("BOOLEAN")){ + fpdPcd.setValue("false"); + } + if (dataType.equals("VOID*")) { + fpdPcd.setValue(""); + } + } + if (dataType.equals("UINT8")){ + fpdPcd.setMaxDatumSize(1); + } + if (dataType.equals("UINT16")) { + fpdPcd.setMaxDatumSize(2); + } + if (dataType.equals("UINT32")) { + fpdPcd.setMaxDatumSize(4); + } + if (dataType.equals("UINT64")){ + fpdPcd.setMaxDatumSize(8); + } + if (dataType.equals("BOOLEAN")){ + fpdPcd.setMaxDatumSize(1); + } + if (dataType.equals("VOID*")) { + int maxSize = setMaxSizeForPointer(fpdPcd.getValue()); + fpdPcd.setMaxDatumSize(maxSize); + } + + if (itemType.equals("DYNAMIC") || itemType.equals("DYNAMIC_EX")) { ArrayList al = LookupDynamicPcdBuildDefinition(cName + " " + tsGuid); // @@ -917,6 +953,7 @@ public class FpdFileContents { } } else { + /* if (defaultVal != null){ fpdPcd.setValue(defaultVal); } @@ -931,6 +968,7 @@ public class FpdFileContents { fpdPcd.setValue(""); } } + if (dataType.equals("UINT8")){ fpdPcd.setMaxDatumSize(1); } @@ -950,6 +988,7 @@ public class FpdFileContents { int maxSize = setMaxSizeForPointer(fpdPcd.getValue()); fpdPcd.setMaxDatumSize(maxSize); } + */ } } @@ -1030,7 +1069,7 @@ public class FpdFileContents { private ArrayList LookupPlatformPcdData(String pcdKey) { - return dynPcdMap.get("pcdKey"); + return dynPcdMap.get(pcdKey); } public int getDynamicPcdBuildDataCount() { @@ -2320,7 +2359,7 @@ public class FpdFileContents { if (fpdHdr == null) { fpdHdr = fpdRoot.addNewPlatformHeader(); } - genPlatformDefsSkuInfo("0", "DEFAULT"); + return fpdHdr; } @@ -2464,8 +2503,9 @@ class PcdItemTypeConflictException extends Exception { private static final long serialVersionUID = 1L; private String details = null; - PcdItemTypeConflictException(String info){ - details = info; + PcdItemTypeConflictException(String pcdName, String info){ + ModuleIdentification mi = GlobalData.getModuleId(info); + details = pcdName + " ItemType Conflicts with " + mi.getName() + " in Pkg " + mi.getPackage().getName(); } public String getMessage() { @@ -2482,7 +2522,7 @@ class PcdDeclNotFound extends Exception { private String details = null; PcdDeclNotFound(String info) { - details = info; + details = "PcdDeclNotFound: " + info; } public String getMessage() { @@ -2499,7 +2539,7 @@ class PcdValueMalFormed extends Exception { private String details = null; PcdValueMalFormed(String info) { - details = info; + details = "PcdValueMalFormed: " + info; } public String getMessage() {