diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-22 08:17:35 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-22 08:17:35 +0000 |
commit | 03b1a72da7fbda3f1e11a08557da9a9e8a6e3b8b (patch) | |
tree | 7b0e01439c83013f4e6d6844f6d952a3d2944425 | |
parent | 5a2a95923dd196b09a9c5dcf96ff4293426611e4 (diff) | |
download | edk2-03b1a72da7fbda3f1e11a08557da9a9e8a6e3b8b.zip edk2-03b1a72da7fbda3f1e11a08557da9a9e8a6e3b8b.tar.gz edk2-03b1a72da7fbda3f1e11a08557da9a9e8a6e3b8b.tar.bz2 |
In before, module type is judged by the sub element value in <ModuleSA>, it is not totally correct. Now the module type will be retrieved from GlobalData after pre-process all MSA document.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@595 6f19259b-4bc3-4df7-8a09-765794883524
3 files changed, 33 insertions, 73 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index 50345c8..35fd778 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -887,6 +887,22 @@ public class SurfaceAreaQuery { }
/**
+ Retrieve all <ModuleSA> documents from FPD file.
+
+ @returns ModuleSA objects list if elements are found at the known xpath
+ @returns Empty ModuleSA list if nothing is there
+ **/
+ public static ModuleSADocument.ModuleSA[] getFpdModuleSAs() {
+ String[] xPath = new String[] { "/FrameworkModules/*/ModuleSA" };
+
+ XmlObject[] result = get("FrameworkPlatformDescription", xPath);
+ if (result != null) {
+ return (ModuleSADocument.ModuleSA[]) result;
+ }
+ return new ModuleSADocument.ModuleSA[0];
+ }
+
+ /**
Retrieve variables for FV images
@returns name/value list if elements are found at the known xpath
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java index dc60cc6..3edadc6 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java @@ -52,6 +52,7 @@ import org.tianocore.build.pcd.entity.SkuInstance; import org.tianocore.build.pcd.entity.Token;
import org.tianocore.build.pcd.entity.UsageInstance;
import org.tianocore.build.pcd.exception.EntityException;
+import org.tianocore.ModuleTypeDef;
class StringTable {
private ArrayList<String> al;
@@ -1185,9 +1186,9 @@ class PcdDatabase { class ModuleInfo {
public ModuleSADocument.ModuleSA module;
- public UsageInstance.MODULE_TYPE type;
+ public ModuleTypeDef.Enum type;
- public ModuleInfo (ModuleSADocument.ModuleSA module, UsageInstance.MODULE_TYPE type) {
+ public ModuleInfo (ModuleSADocument.ModuleSA module, ModuleTypeDef.Enum type) {
this.module = module;
this.type = type;
}
@@ -1345,14 +1346,13 @@ public class CollectPCDAction { */
private List<ModuleInfo> getComponentsFromFPD()
throws EntityException {
- HashMap<String, XmlObject> map = new HashMap<String, XmlObject>();
List<ModuleInfo> allModules = new ArrayList<ModuleInfo>();
ModuleInfo current = null;
int index = 0;
org.tianocore.Components components = null;
FrameworkModulesDocument.FrameworkModules fModules = null;
- java.util.List<ModuleSADocument.ModuleSA> modules = null;
-
+ ModuleSADocument.ModuleSA[] modules = null;
+ HashMap<String, XmlObject> map = new HashMap<String, XmlObject>();
if (fpdDocInstance == null) {
try {
@@ -1365,64 +1365,13 @@ public class CollectPCDAction { }
- //
- // Check whether FPD contians <FramworkModules>
- //
- fModules = fpdDocInstance.getFrameworkPlatformDescription().getFrameworkModules();
- if (fModules == null) {
- return null;
- }
-
- //
- // BUGBUG: The following is work around code, the final component type should be get from
- // GlobalData class.
- //
- components = fModules.getSEC();
- if (components != null) {
- modules = components.getModuleSAList();
- for (index = 0; index < modules.size(); index ++) {
- allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.SEC));
- }
- }
-
- components = fModules.getPEICORE();
- if (components != null) {
- modules = components.getModuleSAList();
- for (index = 0; index < modules.size(); index ++) {
- allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.PEI_CORE));
- }
- }
-
- components = fModules.getPEIM();
- if (components != null) {
- modules = components.getModuleSAList();
- for (index = 0; index < modules.size(); index ++) {
- allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.PEIM));
- }
- }
-
- components = fModules.getDXECORE();
- if (components != null) {
- modules = components.getModuleSAList();
- for (index = 0; index < modules.size(); index ++) {
- allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.DXE_CORE));
- }
- }
-
- components = fModules.getDXEDRIVERS();
- if (components != null) {
- modules = components.getModuleSAList();
- for (index = 0; index < modules.size(); index ++) {
- allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.DXE_DRIVERS));
- }
- }
-
- components = fModules.getOTHERCOMPONENTS();
- if (components != null) {
- modules = components.getModuleSAList();
- for (index = 0; index < modules.size(); index ++) {
- allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.OTHER_COMPONENTS));
- }
+ map.put("FrameworkPlatformDescription", fpdDocInstance);
+ SurfaceAreaQuery.setDoc(map);
+ modules = SurfaceAreaQuery.getFpdModuleSAs();
+ for (index = 0; index < modules.length; index ++) {
+ SurfaceAreaQuery.setDoc(GlobalData.getDoc(modules[index].getModuleName()));
+ allModules.add(new ModuleInfo(modules[index],
+ ModuleTypeDef.Enum.forString(SurfaceAreaQuery.getModuleType())));
}
return allModules;
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java index 2769d49..3bebc45 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java @@ -19,7 +19,7 @@ package org.tianocore.build.pcd.entity; import java.util.UUID;
-
+import org.tianocore.ModuleTypeDef;
import org.tianocore.build.autogen.CommonDefinition;
import org.tianocore.build.pcd.action.ActionMessage;
import org.tianocore.build.pcd.exception.EntityException;
@@ -31,11 +31,6 @@ import org.tianocore.build.pcd.exception.EntityException; **/
public class UsageInstance {
///
- /// The module type of usage instance.
- ///
- public enum MODULE_TYPE {SEC, PEI_CORE, PEIM, DXE_CORE, DXE_DRIVERS, OTHER_COMPONENTS}
-
- ///
/// This parent that this usage instance belongs to.
///
public Token parentToken;
@@ -78,7 +73,7 @@ public class UsageInstance { ///
/// The module type for this usage instance.
///
- public MODULE_TYPE moduleType;
+ public ModuleTypeDef.Enum moduleType;
///
/// The value of the PCD in this usage instance.
@@ -122,7 +117,7 @@ public class UsageInstance { UUID moduleGUID,
String packageName,
UUID packageGUID,
- MODULE_TYPE moduleType,
+ ModuleTypeDef.Enum moduleType,
Token.PCD_TYPE modulePcdType,
String arch,
String version,
@@ -185,8 +180,8 @@ public class UsageInstance { @return boolean
*/
public boolean isPeiPhaseComponent() {
- if ((moduleType == MODULE_TYPE.PEI_CORE) ||
- (moduleType == MODULE_TYPE.PEIM)) {
+ if ((moduleType == ModuleTypeDef.PEI_CORE) ||
+ (moduleType == ModuleTypeDef.PEIM)) {
return true;
}
return false;
|