From a390c35d8a99be7adcc551ce541b5a6ce3f5fd2a Mon Sep 17 00:00:00 2001 From: jlin16 Date: Thu, 3 Aug 2006 03:45:57 +0000 Subject: [PATCH] set default value of PCD from msa file or spd file. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1180 6f19259b-4bc3-4df7-8a09-765794883524 --- .../platform/ui/FpdFileContents.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 e0a0137ef7..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 @@ -906,6 +906,21 @@ public class FpdFileContents { fpdPcd.setTokenSpaceGuidCName(tsGuid); 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); } @@ -926,6 +941,7 @@ public class FpdFileContents { fpdPcd.setMaxDatumSize(maxSize); } + if (itemType.equals("DYNAMIC") || itemType.equals("DYNAMIC_EX")) { ArrayList al = LookupDynamicPcdBuildDefinition(cName + " " + tsGuid); // @@ -937,6 +953,7 @@ public class FpdFileContents { } } else { + /* if (defaultVal != null){ fpdPcd.setValue(defaultVal); } @@ -951,7 +968,7 @@ public class FpdFileContents { fpdPcd.setValue(""); } } - /* + if (dataType.equals("UINT8")){ fpdPcd.setMaxDatumSize(1); }