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
This commit is contained in:
jlin16 2006-08-03 03:45:57 +00:00
parent 01413f0ccb
commit a390c35d8a

View File

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