mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
5a2a95923d
commit
03b1a72da7
|
@ -886,6 +886,22 @@ public class SurfaceAreaQuery {
|
||||||
return (ModuleSADocument.ModuleSA[]) result;
|
return (ModuleSADocument.ModuleSA[]) result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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
|
Retrieve variables for FV images
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ import org.tianocore.build.pcd.entity.SkuInstance;
|
||||||
import org.tianocore.build.pcd.entity.Token;
|
import org.tianocore.build.pcd.entity.Token;
|
||||||
import org.tianocore.build.pcd.entity.UsageInstance;
|
import org.tianocore.build.pcd.entity.UsageInstance;
|
||||||
import org.tianocore.build.pcd.exception.EntityException;
|
import org.tianocore.build.pcd.exception.EntityException;
|
||||||
|
import org.tianocore.ModuleTypeDef;
|
||||||
|
|
||||||
class StringTable {
|
class StringTable {
|
||||||
private ArrayList<String> al;
|
private ArrayList<String> al;
|
||||||
|
@ -1185,9 +1186,9 @@ class PcdDatabase {
|
||||||
|
|
||||||
class ModuleInfo {
|
class ModuleInfo {
|
||||||
public ModuleSADocument.ModuleSA module;
|
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.module = module;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
@ -1345,14 +1346,13 @@ public class CollectPCDAction {
|
||||||
*/
|
*/
|
||||||
private List<ModuleInfo> getComponentsFromFPD()
|
private List<ModuleInfo> getComponentsFromFPD()
|
||||||
throws EntityException {
|
throws EntityException {
|
||||||
HashMap<String, XmlObject> map = new HashMap<String, XmlObject>();
|
|
||||||
List<ModuleInfo> allModules = new ArrayList<ModuleInfo>();
|
List<ModuleInfo> allModules = new ArrayList<ModuleInfo>();
|
||||||
ModuleInfo current = null;
|
ModuleInfo current = null;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
org.tianocore.Components components = null;
|
org.tianocore.Components components = null;
|
||||||
FrameworkModulesDocument.FrameworkModules fModules = 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) {
|
if (fpdDocInstance == null) {
|
||||||
try {
|
try {
|
||||||
|
@ -1365,64 +1365,13 @@ public class CollectPCDAction {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
map.put("FrameworkPlatformDescription", fpdDocInstance);
|
||||||
// Check whether FPD contians <FramworkModules>
|
SurfaceAreaQuery.setDoc(map);
|
||||||
//
|
modules = SurfaceAreaQuery.getFpdModuleSAs();
|
||||||
fModules = fpdDocInstance.getFrameworkPlatformDescription().getFrameworkModules();
|
for (index = 0; index < modules.length; index ++) {
|
||||||
if (fModules == null) {
|
SurfaceAreaQuery.setDoc(GlobalData.getDoc(modules[index].getModuleName()));
|
||||||
return null;
|
allModules.add(new ModuleInfo(modules[index],
|
||||||
}
|
ModuleTypeDef.Enum.forString(SurfaceAreaQuery.getModuleType())));
|
||||||
|
|
||||||
//
|
|
||||||
// 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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return allModules;
|
return allModules;
|
||||||
|
|
|
@ -19,7 +19,7 @@ package org.tianocore.build.pcd.entity;
|
||||||
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import org.tianocore.ModuleTypeDef;
|
||||||
import org.tianocore.build.autogen.CommonDefinition;
|
import org.tianocore.build.autogen.CommonDefinition;
|
||||||
import org.tianocore.build.pcd.action.ActionMessage;
|
import org.tianocore.build.pcd.action.ActionMessage;
|
||||||
import org.tianocore.build.pcd.exception.EntityException;
|
import org.tianocore.build.pcd.exception.EntityException;
|
||||||
|
@ -30,11 +30,6 @@ import org.tianocore.build.pcd.exception.EntityException;
|
||||||
is an usage instance for this PCD token.
|
is an usage instance for this PCD token.
|
||||||
**/
|
**/
|
||||||
public class UsageInstance {
|
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.
|
/// This parent that this usage instance belongs to.
|
||||||
///
|
///
|
||||||
|
@ -78,7 +73,7 @@ public class UsageInstance {
|
||||||
///
|
///
|
||||||
/// The module type for this usage instance.
|
/// The module type for this usage instance.
|
||||||
///
|
///
|
||||||
public MODULE_TYPE moduleType;
|
public ModuleTypeDef.Enum moduleType;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The value of the PCD in this usage instance.
|
/// The value of the PCD in this usage instance.
|
||||||
|
@ -122,7 +117,7 @@ public class UsageInstance {
|
||||||
UUID moduleGUID,
|
UUID moduleGUID,
|
||||||
String packageName,
|
String packageName,
|
||||||
UUID packageGUID,
|
UUID packageGUID,
|
||||||
MODULE_TYPE moduleType,
|
ModuleTypeDef.Enum moduleType,
|
||||||
Token.PCD_TYPE modulePcdType,
|
Token.PCD_TYPE modulePcdType,
|
||||||
String arch,
|
String arch,
|
||||||
String version,
|
String version,
|
||||||
|
@ -185,8 +180,8 @@ public class UsageInstance {
|
||||||
@return boolean
|
@return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isPeiPhaseComponent() {
|
public boolean isPeiPhaseComponent() {
|
||||||
if ((moduleType == MODULE_TYPE.PEI_CORE) ||
|
if ((moduleType == ModuleTypeDef.PEI_CORE) ||
|
||||||
(moduleType == MODULE_TYPE.PEIM)) {
|
(moduleType == ModuleTypeDef.PEIM)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue