add support arch check for pcd entries when adding a module to platform, sync. platform pcd with msa pcd and adding library instances.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2149 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-12-28 08:45:08 +00:00
parent a9e882c96d
commit 11c5f0713c
4 changed files with 46 additions and 17 deletions

View File

@ -427,7 +427,7 @@ public class FpdFileContents {
if (nextMi == null) {
continue;
}
if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], nextMi)) {
if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], arch, nextMi)) {
continue nextPcd;
}
}
@ -455,6 +455,13 @@ public class FpdFileContents {
}
}
}
// Check sup arch conformance for the new PCD
if (msaPcd.getSupArchList() != null) {
String newPcdArch = msaPcd.getSupArchList().toString();
if (!newPcdArch.toLowerCase().contains(arch.toLowerCase())) {
continue;
}
}
PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null, vMi.get(i));
PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);
@ -686,7 +693,7 @@ public class FpdFileContents {
int pcdSourceCount = 0;
for (int i = 0; i < vMi.size(); ++i) {
if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, vMi.get(i))) {
if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, null, vMi.get(i))) {
pcdSourceCount++;
}
}
@ -1179,6 +1186,11 @@ public class FpdFileContents {
ListIterator li = l.listIterator();
while (li.hasNext()) {
PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry) li.next();
if (msaPcd.getSupArchList() != null) {
if (!msaPcd.getSupArchList().toString().toLowerCase().contains(arch.toLowerCase())) {
continue;
}
}
PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);
if (spdPcd == null) {
//

View File

@ -672,17 +672,18 @@ public class FpdFrameworkModules extends IInternalFrame {
}
private void showSettingsDlg (int row) {
try {
Vector<String> vExceptions = new Vector<String>();
if (ffc.adjustPcd(row, vExceptions)) {
JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");
docConsole.setSaved(false);
}
}
catch (Exception exp) {
JOptionPane.showMessageDialog(frame, exp.getMessage());
// return;
}
// As PCD sync. check is full platform range now during opening FrameworkModules editor,
// the following check is no longer needed.
// try {
// Vector<String> vExceptions = new Vector<String>();
// if (ffc.adjustPcd(row, vExceptions)) {
// JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");
// docConsole.setSaved(false);
// }
// }
// catch (Exception exp) {
// JOptionPane.showMessageDialog(frame, exp.getMessage());
// }
if (settingDlg == null) {
settingDlg = new FpdModuleSA(ffc);
@ -864,7 +865,7 @@ public class FpdFrameworkModules extends IInternalFrame {
for (int i = 0; i < vExceptions.size(); ++i) {
errorMsg += " " + vExceptions.get(i) + "\n";
}
JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:" + errorMsg);
JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:\n" + errorMsg);
}
}

View File

@ -581,12 +581,21 @@ public class FpdModuleSA extends JDialog implements ActionListener {
}
private String getModuleArch () {
String arch = "";
String[] moduleInfo = moduleKey.split(" ");
for (int i = 4; i < moduleInfo.length; ++i) {
arch += moduleInfo[i];
arch += " ";
}
return arch.trim();
}
private void addLibInstance (ModuleIdentification libMi) throws Exception{
//
// Add pcd information of selected instance to current moduleSA
//
ffc.addFrameworkModulesPcdBuildDefs(libMi, null, ffc.getModuleSA(moduleKey));
ffc.addFrameworkModulesPcdBuildDefs(libMi, getModuleArch(), ffc.getModuleSA(moduleKey));
ffc.genLibraryInstance(libMi, moduleKey);
}

View File

@ -130,7 +130,7 @@ public class WorkspaceProfile {
return msa.getModuleDefinitions().getOutputFileBasename();
}
public static boolean pcdInMsa (String cName, String tsGuid, ModuleIdentification mi) {
public static boolean pcdInMsa (String cName, String tsGuid, String supArchList, ModuleIdentification mi) {
ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);
if (msa.getPcdCoded() == null || msa.getPcdCoded().getPcdEntryList() == null) {
return false;
@ -139,7 +139,14 @@ public class WorkspaceProfile {
while (li.hasNext()) {
PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry)li.next();
if (msaPcd.getCName().equals(cName) && msaPcd.getTokenSpaceGuidCName().equals(tsGuid)) {
return true;
if (supArchList != null && msaPcd.getSupArchList() != null) {
if (msaPcd.getSupArchList().toString().toLowerCase().contains(supArchList.trim().toLowerCase())) {
return true;
}
}
else{
return true;
}
}
}
return false;