mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 08:34:07 +02:00
1) Fix a bug for PCD autogen tools, see track#115 in PVCS: Module's PCD informtion is generated into autogen.h/autogen.c of library
2) Remove PcdEmulatedDriver from PcdAutogen class. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@495 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f79b595b7b
commit
ad82307c75
@ -414,11 +414,11 @@ public class AutoGen {
|
|||||||
null,
|
null,
|
||||||
this.arch,
|
this.arch,
|
||||||
null,
|
null,
|
||||||
baseName.equalsIgnoreCase("PcdEmulatorPeim"),
|
false,
|
||||||
false);
|
SurfaceAreaQuery.getModulePcdEntryNameArray());
|
||||||
this.myPcdAutogen.execute();
|
this.myPcdAutogen.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BuildException("PCD Autogen failed:" + e.getMessage());
|
throw new BuildException("PCD Autogen for module failed:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.myPcdAutogen != null) {
|
if (this.myPcdAutogen != null) {
|
||||||
@ -555,11 +555,11 @@ public class AutoGen {
|
|||||||
null,
|
null,
|
||||||
this.arch,
|
this.arch,
|
||||||
null,
|
null,
|
||||||
baseName.equalsIgnoreCase("PcdEmulatorPeim"),
|
true,
|
||||||
true);
|
SurfaceAreaQuery.getModulePcdEntryNameArray());
|
||||||
this.myPcdAutogen.execute();
|
this.myPcdAutogen.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BuildException(e.getMessage());
|
throw new BuildException("Pcd Autogen for library failed! " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.myPcdAutogen != null) {
|
if (this.myPcdAutogen != null) {
|
||||||
@ -2015,4 +2015,4 @@ public class AutoGen {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ import org.tianocore.LibrariesDocument;
|
|||||||
import org.tianocore.LibraryClassDefinitionsDocument;
|
import org.tianocore.LibraryClassDefinitionsDocument;
|
||||||
import org.tianocore.MsaHeaderDocument;
|
import org.tianocore.MsaHeaderDocument;
|
||||||
import org.tianocore.MsaLibHeaderDocument;
|
import org.tianocore.MsaLibHeaderDocument;
|
||||||
import org.tianocore.PCDsDocument;
|
import org.tianocore.PcdCodedDocument;
|
||||||
import org.tianocore.PPIsDocument;
|
import org.tianocore.PPIsDocument;
|
||||||
import org.tianocore.ProtocolsDocument;
|
import org.tianocore.ProtocolsDocument;
|
||||||
import org.tianocore.SourceFilesDocument;
|
import org.tianocore.SourceFilesDocument;
|
||||||
@ -113,7 +113,7 @@ public class OverrideProcess {
|
|||||||
"SourceFiles", "Includes", "Libraries", "Protocols",
|
"SourceFiles", "Includes", "Libraries", "Protocols",
|
||||||
"Events", "Hobs", "PPIs", "Variables", "BootModes",
|
"Events", "Hobs", "PPIs", "Variables", "BootModes",
|
||||||
"SystemTables", "DataHubs", "Formsets", "Guids", "Externs",
|
"SystemTables", "DataHubs", "Formsets", "Guids", "Externs",
|
||||||
"PCDs", "BuildOptions" };
|
"PcdCoded", "BuildOptions" };
|
||||||
|
|
||||||
///
|
///
|
||||||
/// list of exclusive elements
|
/// list of exclusive elements
|
||||||
@ -223,8 +223,8 @@ public class OverrideProcess {
|
|||||||
newMap.put("Externs", ((ExternsDocument) map.get("Externs"))
|
newMap.put("Externs", ((ExternsDocument) map.get("Externs"))
|
||||||
.getExterns());
|
.getExterns());
|
||||||
}
|
}
|
||||||
if (map.get("PCDs") != null) {
|
if (map.get("PcdCoded") != null) {
|
||||||
newMap.put("PCDs", ((PCDsDocument) map.get("PCDs")).getPCDs());
|
newMap.put("PcdCoded", ((PcdCodedDocument) map.get("PcdCoded")).getPcdCoded());
|
||||||
}
|
}
|
||||||
if (map.get("BuildOptions") != null) {
|
if (map.get("BuildOptions") != null) {
|
||||||
newMap.put("BuildOptions", ((BuildOptionsDocument) map
|
newMap.put("BuildOptions", ((BuildOptionsDocument) map
|
||||||
|
@ -91,18 +91,14 @@ public class SurfaceAreaParser {
|
|||||||
msaMap.put("Variables", doc.getModuleSurfaceArea().getVariables());
|
msaMap.put("Variables", doc.getModuleSurfaceArea().getVariables());
|
||||||
msaMap.put("BootModes", doc.getModuleSurfaceArea().getBootModes());
|
msaMap.put("BootModes", doc.getModuleSurfaceArea().getBootModes());
|
||||||
|
|
||||||
msaMap
|
msaMap.put("SystemTables", doc.getModuleSurfaceArea().getSystemTables());
|
||||||
.put("SystemTables", doc.getModuleSurfaceArea()
|
|
||||||
.getSystemTables());
|
|
||||||
msaMap.put("DataHubs", doc.getModuleSurfaceArea().getDataHubs());
|
msaMap.put("DataHubs", doc.getModuleSurfaceArea().getDataHubs());
|
||||||
msaMap.put("Formsets", doc.getModuleSurfaceArea().getFormsets());
|
msaMap.put("Formsets", doc.getModuleSurfaceArea().getFormsets());
|
||||||
msaMap.put("Guids", doc.getModuleSurfaceArea().getGuids());
|
msaMap.put("Guids", doc.getModuleSurfaceArea().getGuids());
|
||||||
msaMap.put("Externs", doc.getModuleSurfaceArea().getExterns());
|
msaMap.put("Externs", doc.getModuleSurfaceArea().getExterns());
|
||||||
|
|
||||||
msaMap.put("PCDs", doc.getModuleSurfaceArea().getPCDs());
|
msaMap.put("PcdCoded", doc.getModuleSurfaceArea().getPcdCoded());
|
||||||
msaMap
|
msaMap.put("BuildOptions", doc.getModuleSurfaceArea().getBuildOptions());
|
||||||
.put("BuildOptions", doc.getModuleSurfaceArea()
|
|
||||||
.getBuildOptions());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,7 +128,6 @@ public class SurfaceAreaParser {
|
|||||||
mbdMap.put("Guids", doc.getModuleBuildDescription().getGuids());
|
mbdMap.put("Guids", doc.getModuleBuildDescription().getGuids());
|
||||||
mbdMap.put("Externs", doc.getModuleBuildDescription().getExterns());
|
mbdMap.put("Externs", doc.getModuleBuildDescription().getExterns());
|
||||||
|
|
||||||
mbdMap.put("PCDs", doc.getModuleBuildDescription().getPCDs());
|
|
||||||
mbdMap.put("BuildOptions", doc.getModuleBuildDescription()
|
mbdMap.put("BuildOptions", doc.getModuleBuildDescription()
|
||||||
.getBuildOptions());
|
.getBuildOptions());
|
||||||
}
|
}
|
||||||
@ -168,7 +163,7 @@ public class SurfaceAreaParser {
|
|||||||
msaMap.put("Guids", doc.getLibraryModuleSurfaceArea().getGuids());
|
msaMap.put("Guids", doc.getLibraryModuleSurfaceArea().getGuids());
|
||||||
msaMap.put("Externs", doc.getLibraryModuleSurfaceArea().getExterns());
|
msaMap.put("Externs", doc.getLibraryModuleSurfaceArea().getExterns());
|
||||||
|
|
||||||
msaMap.put("PCDs", doc.getLibraryModuleSurfaceArea().getPCDs());
|
msaMap.put("PcdCoded", doc.getLibraryModuleSurfaceArea().getPcdCoded());
|
||||||
msaMap.put("BuildOptions", doc.getLibraryModuleSurfaceArea()
|
msaMap.put("BuildOptions", doc.getLibraryModuleSurfaceArea()
|
||||||
.getBuildOptions());
|
.getBuildOptions());
|
||||||
}
|
}
|
||||||
@ -211,7 +206,6 @@ public class SurfaceAreaParser {
|
|||||||
mbdMap.put("Externs", doc.getLibraryModuleBuildDescription()
|
mbdMap.put("Externs", doc.getLibraryModuleBuildDescription()
|
||||||
.getExterns());
|
.getExterns());
|
||||||
|
|
||||||
mbdMap.put("PCDs", doc.getLibraryModuleBuildDescription().getPCDs());
|
|
||||||
mbdMap.put("BuildOptions", doc.getLibraryModuleBuildDescription()
|
mbdMap.put("BuildOptions", doc.getLibraryModuleBuildDescription()
|
||||||
.getBuildOptions());
|
.getBuildOptions());
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ import org.tianocore.OutputDirectoryDocument;
|
|||||||
import org.tianocore.PPIsDocument;
|
import org.tianocore.PPIsDocument;
|
||||||
import org.tianocore.PackageNameDocument;
|
import org.tianocore.PackageNameDocument;
|
||||||
import org.tianocore.ProtocolsDocument;
|
import org.tianocore.ProtocolsDocument;
|
||||||
import org.tianocore.PCDsDocument.PCDs;
|
import org.tianocore.PcdCodedDocument.PcdCoded;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
SurfaceAreaQuery class is used to query Surface Area information from msa, mbd,
|
SurfaceAreaQuery class is used to query Surface Area information from msa, mbd,
|
||||||
@ -1029,81 +1029,27 @@ public class SurfaceAreaQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieve PCD tokens
|
Get name array of PCD in a module. In one module, token space
|
||||||
|
is same, and token name should not be conflicted.
|
||||||
@returns CName/ItemType pairs list if elements are found at the known xpath
|
|
||||||
@returns null if nothing is there
|
@return String[]
|
||||||
**/
|
**/
|
||||||
public static String[][] getPcdTokenArray() {
|
public static String[] getModulePcdEntryNameArray() {
|
||||||
String[] xPath = new String[] {"/PcdData"};
|
PcdCoded.PcdEntry[] pcdEntries = null;
|
||||||
|
String[] results;
|
||||||
XmlObject[] returns = get("PCDs", xPath);
|
int index;
|
||||||
if (returns == null || returns.length == 0) {
|
String[] xPath = new String[] {"/PcdEntry"};
|
||||||
|
XmlObject[] returns = get ("PcdCoded", xPath);
|
||||||
|
if (returns == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pcdEntries = (PcdCoded.PcdEntry[])returns;
|
||||||
|
results = new String[pcdEntries.length];
|
||||||
|
|
||||||
PCDs.PcdData[] pcds = (PCDs.PcdData[]) returns;
|
for (index = 0; index < pcdEntries.length; index ++) {
|
||||||
String[][] result = new String[pcds.length][2];
|
results[index] = pcdEntries[index].getCName();
|
||||||
for (int i = 0; i < returns.length; ++i) {
|
|
||||||
if (pcds[i].getItemType() != null) {
|
|
||||||
result[i][1] = pcds[i].getItemType().toString();
|
|
||||||
} else {
|
|
||||||
result[i][1] = null;
|
|
||||||
}
|
|
||||||
result[i][0] = pcds[i].getCName();
|
|
||||||
}
|
}
|
||||||
|
return results;
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get the PcdToken array from module's surface area document.
|
|
||||||
The array should contains following data:
|
|
||||||
<p>-------------------------------------------------------------------</p>
|
|
||||||
<p>CName | ItemType | TokenspaceName | DefaultValue | Usage | HelpText</p>
|
|
||||||
<p>-------------------------------------------------------------------</p>
|
|
||||||
<p>Note: Until new schema applying, now we can only get CName, ItemType,</p>
|
|
||||||
|
|
||||||
@return 2-array table contains all information of PCD token retrieved from MSA.
|
|
||||||
**/
|
|
||||||
public static Object[][] getModulePCDTokenArray () {
|
|
||||||
int index;
|
|
||||||
Object[][] result;
|
|
||||||
PCDs.PcdData[] pcds;
|
|
||||||
String[] xPath = new String[] {"/PcdData"};
|
|
||||||
XmlObject[] returns = get ("PCDs", xPath);
|
|
||||||
|
|
||||||
if ((returns == null) || (returns.length == 0)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
pcds = (PCDs.PcdData[]) returns;
|
|
||||||
result = new Object[pcds.length][6];
|
|
||||||
for (index = 0; index < pcds.length; index ++) {
|
|
||||||
//
|
|
||||||
// Get CName
|
|
||||||
//
|
|
||||||
result [index][0] = pcds[index].getCName();
|
|
||||||
//
|
|
||||||
// Get ItemType: FEATURE_FLAG, FIXED_AT_BUILD, PATCHABLE_IN_MODLE, DYNAMIC, DYNAMIC_EX
|
|
||||||
//
|
|
||||||
if (pcds[index].getItemType() != null) {
|
|
||||||
result [index][1] = pcds[index].getItemType().toString();
|
|
||||||
} else {
|
|
||||||
result [index][1] = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// BUGBUG: following field can *not* be got from current MSA until schema changed.
|
|
||||||
//
|
|
||||||
//result [index][2] = pcds[index].getTokenSpaceName();
|
|
||||||
result [index][2] = null;
|
|
||||||
result [index][3] = pcds[index].getDefaultValue();
|
|
||||||
//result [index][4] = pcds[index].getUsage ();
|
|
||||||
result [index][4] = null;
|
|
||||||
//result [index][5] = pcds[index].getHelpText ();
|
|
||||||
result [index][5] = null;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,14 @@ package org.tianocore.build.pcd.action;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.apache.xmlbeans.XmlObject;
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
import org.tianocore.build.pcd.entity.MemoryDatabaseManager;
|
import org.tianocore.build.pcd.entity.MemoryDatabaseManager;
|
||||||
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;
|
||||||
@ -60,11 +65,6 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
///
|
///
|
||||||
private String version;
|
private String version;
|
||||||
///
|
///
|
||||||
/// Wheter current module is PCD emulated driver. It is only for
|
|
||||||
/// emulated PCD driver and will be kept until PCD IMAGE tool ready.
|
|
||||||
///
|
|
||||||
private boolean isEmulatedPCDDriver;
|
|
||||||
///
|
|
||||||
/// Whether current autogen is for building library used by current module.
|
/// Whether current autogen is for building library used by current module.
|
||||||
///
|
///
|
||||||
private boolean isBuildUsedLibrary;
|
private boolean isBuildUsedLibrary;
|
||||||
@ -75,8 +75,11 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
///
|
///
|
||||||
/// The generated string for C code file.
|
/// The generated string for C code file.
|
||||||
///
|
///
|
||||||
private String cAutoGenString;
|
private String cAutoGenString;
|
||||||
|
///
|
||||||
|
/// The name array of <PcdCoded> in a module.
|
||||||
|
///
|
||||||
|
private String[] pcdNameArray;
|
||||||
/**
|
/**
|
||||||
Set parameter ModuleName
|
Set parameter ModuleName
|
||||||
|
|
||||||
@ -86,38 +89,67 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
this.moduleName = moduleName;
|
this.moduleName = moduleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
set the moduleGuid parameter.
|
||||||
|
|
||||||
|
@param moduleGuid
|
||||||
|
**/
|
||||||
public void setModuleGuid(UUID moduleGuid) {
|
public void setModuleGuid(UUID moduleGuid) {
|
||||||
this.moduleGuid = moduleGuid;
|
this.moduleGuid = moduleGuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
set packageName parameter.
|
||||||
|
|
||||||
|
@param packageName
|
||||||
|
**/
|
||||||
public void setPackageName(String packageName) {
|
public void setPackageName(String packageName) {
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
set packageGuid parameter.
|
||||||
|
|
||||||
|
@param packageGuid
|
||||||
|
**/
|
||||||
public void setPackageGuid(UUID packageGuid) {
|
public void setPackageGuid(UUID packageGuid) {
|
||||||
this.packageGuid = packageGuid;
|
this.packageGuid = packageGuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
set Arch parameter.
|
||||||
|
|
||||||
|
@param arch
|
||||||
|
**/
|
||||||
public void setArch(String arch) {
|
public void setArch(String arch) {
|
||||||
this.arch = arch;
|
this.arch = arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
set version parameter
|
||||||
|
|
||||||
|
@param version
|
||||||
|
*/
|
||||||
public void setVersion(String version) {
|
public void setVersion(String version) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set parameter isEmulatedPCDDriver
|
set isBuildUsedLibrary parameter.
|
||||||
|
|
||||||
@param isEmulatedPCDDriver whether this module is PeiEmulatedPCD driver
|
@param isBuildUsedLibrary
|
||||||
**/
|
*/
|
||||||
public void setIsEmulatedPCDDriver(boolean isEmulatedPCDDriver) {
|
|
||||||
this.isEmulatedPCDDriver = isEmulatedPCDDriver;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsBuildUsedLibrary(boolean isBuildUsedLibrary) {
|
public void setIsBuildUsedLibrary(boolean isBuildUsedLibrary) {
|
||||||
this.isBuildUsedLibrary = isBuildUsedLibrary;
|
this.isBuildUsedLibrary = isBuildUsedLibrary;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
set pcdNameArray parameter.
|
||||||
|
|
||||||
|
@param pcdNameArray
|
||||||
|
*/
|
||||||
|
public void setPcdNameArray(String[] pcdNameArray) {
|
||||||
|
this.pcdNameArray = pcdNameArray;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the output of generated string for header file.
|
Get the output of generated string for header file.
|
||||||
@ -145,23 +177,23 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
@param moduleName Parameter of this action class.
|
@param moduleName Parameter of this action class.
|
||||||
@param isEmulatedPCDDriver Parameter of this action class.
|
@param isEmulatedPCDDriver Parameter of this action class.
|
||||||
**/
|
**/
|
||||||
public PCDAutoGenAction(String moduleName,
|
public PCDAutoGenAction(String moduleName,
|
||||||
UUID moduleGuid,
|
UUID moduleGuid,
|
||||||
String packageName,
|
String packageName,
|
||||||
UUID packageGuid,
|
UUID packageGuid,
|
||||||
String arch,
|
String arch,
|
||||||
String version,
|
String version,
|
||||||
boolean isEmulatedPCDDriver,
|
boolean isBuildUsedLibrary,
|
||||||
boolean isBuildUsedLibrary) {
|
String[] pcdNameArray) {
|
||||||
dbManager = null;
|
dbManager = null;
|
||||||
hAutoGenString = "";
|
hAutoGenString = "";
|
||||||
cAutoGenString = "";
|
cAutoGenString = "";
|
||||||
|
|
||||||
setIsEmulatedPCDDriver(isEmulatedPCDDriver);
|
|
||||||
setModuleName(moduleName);
|
setModuleName(moduleName);
|
||||||
setModuleGuid(moduleGuid);
|
setModuleGuid(moduleGuid);
|
||||||
setPackageName(packageName);
|
setPackageName(packageName);
|
||||||
setPackageGuid(packageGuid);
|
setPackageGuid(packageGuid);
|
||||||
|
setPcdNameArray(pcdNameArray);
|
||||||
setArch(arch);
|
setArch(arch);
|
||||||
setVersion(version);
|
setVersion(version);
|
||||||
setIsBuildUsedLibrary(isBuildUsedLibrary);
|
setIsBuildUsedLibrary(isBuildUsedLibrary);
|
||||||
@ -173,13 +205,7 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
@throws BuildActionException Bad parameter.
|
@throws BuildActionException Bad parameter.
|
||||||
**/
|
**/
|
||||||
void checkParameter() throws BuildActionException {
|
void checkParameter() throws BuildActionException {
|
||||||
if(!isEmulatedPCDDriver &&(moduleName == null)) {
|
|
||||||
throw new BuildActionException("Wrong module name parameter for PCDAutoGenAction tool!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isEmulatedPCDDriver && moduleName.length() == 0) {
|
|
||||||
throw new BuildActionException("Wrong module name parameter for PCDAutoGenAction tool!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -224,8 +250,8 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
**/
|
**/
|
||||||
private void generateAutogenForModule()
|
private void generateAutogenForModule()
|
||||||
{
|
{
|
||||||
int index;
|
int index, index2;
|
||||||
List<UsageInstance> usageInstanceArray;
|
List<UsageInstance> usageInstanceArray, usageContext;
|
||||||
|
|
||||||
if (!isBuildUsedLibrary) {
|
if (!isBuildUsedLibrary) {
|
||||||
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
|
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
|
||||||
@ -237,21 +263,39 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
dbManager.UsageInstanceContext = usageInstanceArray;
|
dbManager.UsageInstanceContext = usageInstanceArray;
|
||||||
dbManager.CurrentModuleName = moduleName;
|
dbManager.CurrentModuleName = moduleName;
|
||||||
} else {
|
} else {
|
||||||
usageInstanceArray = dbManager.UsageInstanceContext;
|
usageContext = dbManager.UsageInstanceContext;
|
||||||
//
|
//
|
||||||
// For building MDE package, although all module are library, but PCD entries of
|
// For building MDE package, although all module are library, but PCD entries of
|
||||||
// these library should be used to autogen.
|
// these library should be used to autogen.
|
||||||
//
|
//
|
||||||
if (usageInstanceArray == null) {
|
if (usageContext == null) {
|
||||||
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
|
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
|
||||||
moduleGuid,
|
moduleGuid,
|
||||||
packageName,
|
packageName,
|
||||||
packageGuid,
|
packageGuid,
|
||||||
arch,
|
arch,
|
||||||
version);
|
version);
|
||||||
|
} else {
|
||||||
|
usageInstanceArray = new ArrayList<UsageInstance>();
|
||||||
|
//
|
||||||
|
// Remove PCD entries which are not belong to this library.
|
||||||
|
//
|
||||||
|
for (index = 0; index < usageContext.size(); index++) {
|
||||||
|
if ((pcdNameArray == null) || (pcdNameArray.length == 0)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (index2 = 0; index2 < pcdNameArray.length; index2 ++) {
|
||||||
|
if (pcdNameArray[index2].equalsIgnoreCase(usageContext.get(index).parentToken.cName)) {
|
||||||
|
usageInstanceArray.add(usageContext.get(index));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(usageInstanceArray.size() != 0) {
|
if(usageInstanceArray.size() != 0) {
|
||||||
//
|
//
|
||||||
// Add "#include 'PcdLib.h'" for Header file
|
// Add "#include 'PcdLib.h'" for Header file
|
||||||
@ -301,6 +345,7 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
|
|
||||||
String WorkSpace = "M:/ForPcd/edk2";
|
String WorkSpace = "M:/ForPcd/edk2";
|
||||||
String logFilePath = WorkSpace + "/MdePkg/MdePkg.fpd";
|
String logFilePath = WorkSpace + "/MdePkg/MdePkg.fpd";
|
||||||
|
String[] nameArray = null;
|
||||||
|
|
||||||
//
|
//
|
||||||
// At first, CollectPCDAction should be invoked to collect
|
// At first, CollectPCDAction should be invoked to collect
|
||||||
@ -328,8 +373,7 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false
|
nameArray);
|
||||||
);
|
|
||||||
autogenAction.execute();
|
autogenAction.execute();
|
||||||
|
|
||||||
System.out.println(autogenAction.OutputH());
|
System.out.println(autogenAction.OutputH());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user