New tool.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@692 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -70,6 +70,7 @@
|
|||||||
<IncludePkgHeader ModuleType="DXE_SMM_DRIVER">Include/WinNtDxe.h</IncludePkgHeader>
|
<IncludePkgHeader ModuleType="DXE_SMM_DRIVER">Include/WinNtDxe.h</IncludePkgHeader>
|
||||||
<IncludePkgHeader ModuleType="DXE_SAL_DRIVER">Include/WinNtDxe.h</IncludePkgHeader>
|
<IncludePkgHeader ModuleType="DXE_SAL_DRIVER">Include/WinNtDxe.h</IncludePkgHeader>
|
||||||
<IncludePkgHeader ModuleType="UEFI_DRIVER">Include/WinNtDxe.h</IncludePkgHeader>
|
<IncludePkgHeader ModuleType="UEFI_DRIVER">Include/WinNtDxe.h</IncludePkgHeader>
|
||||||
|
<IncludePkgHeader ModuleType="USER_DEFINED">Include/WinNtPeim.h</IncludePkgHeader>
|
||||||
</PackageHeaders>
|
</PackageHeaders>
|
||||||
<GuidDeclarations>
|
<GuidDeclarations>
|
||||||
<Entry Name="WinNtVirtualDisks">
|
<Entry Name="WinNtVirtualDisks">
|
||||||
|
@@ -35,9 +35,9 @@
|
|||||||
<Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>
|
<Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>
|
||||||
</PackageDependencies>
|
</PackageDependencies>
|
||||||
<PPIs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<PPIs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<Ppi Usage="ALWAYS_CONSUMED">
|
<!--<Ppi Usage="ALWAYS_CONSUMED">
|
||||||
<PpiCName>PeCoffLoader</PpiCName>
|
<PpiCName>PeCoffLoader</PpiCName>
|
||||||
</Ppi>
|
</Ppi>-->
|
||||||
</PPIs>
|
</PPIs>
|
||||||
<Externs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<Externs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||||
|
@@ -5733,14 +5733,6 @@
|
|||||||
<MaxDatumSize>4</MaxDatumSize>
|
<MaxDatumSize>4</MaxDatumSize>
|
||||||
<Value>0x5678</Value>
|
<Value>0x5678</Value>
|
||||||
</PcdData>
|
</PcdData>
|
||||||
<PcdData ItemType="DYNAMIC">
|
|
||||||
<C_Name>PcdWinNtDynamicUINT32</C_Name>
|
|
||||||
<Token>0x0001000e</Token>
|
|
||||||
<TokenSpaceGuidCName>Fix_Me</TokenSpaceGuidCName>
|
|
||||||
<DatumType>UINT32</DatumType>
|
|
||||||
<MaxDatumSize>4</MaxDatumSize>
|
|
||||||
<Value>0x0</Value>
|
|
||||||
</PcdData>
|
|
||||||
</PcdBuildDefinition>
|
</PcdBuildDefinition>
|
||||||
<ModuleSaBuildOptions>
|
<ModuleSaBuildOptions>
|
||||||
<FvBinding>FV_RECOVERY</FvBinding>
|
<FvBinding>FV_RECOVERY</FvBinding>
|
||||||
@@ -6575,17 +6567,6 @@
|
|||||||
<Value>L"3000"</Value>
|
<Value>L"3000"</Value>
|
||||||
</SkuInfo>
|
</SkuInfo>
|
||||||
</PcdBuildData>
|
</PcdBuildData>
|
||||||
<PcdBuildData ItemType="DYNAMIC">
|
|
||||||
<C_Name>PcdWinNtDynamicUINT32</C_Name>
|
|
||||||
<Token>0x0001000e</Token>
|
|
||||||
<TokenSpaceGuidCName>Fix_Me</TokenSpaceGuidCName>
|
|
||||||
<DatumType>UINT32</DatumType>
|
|
||||||
<MaxDatumSize>4</MaxDatumSize>
|
|
||||||
<SkuInfo>
|
|
||||||
<SkuId>0</SkuId>
|
|
||||||
<Value>0x0</Value>
|
|
||||||
</SkuInfo>
|
|
||||||
</PcdBuildData>
|
|
||||||
<PcdBuildData ItemType="DYNAMIC">
|
<PcdBuildData ItemType="DYNAMIC">
|
||||||
<C_Name>PcdKentTestDynamicUINT32</C_Name>
|
<C_Name>PcdKentTestDynamicUINT32</C_Name>
|
||||||
<Token>0x0001000e</Token>
|
<Token>0x0001000e</Token>
|
||||||
@@ -6594,10 +6575,7 @@
|
|||||||
<MaxDatumSize>4</MaxDatumSize>
|
<MaxDatumSize>4</MaxDatumSize>
|
||||||
<SkuInfo>
|
<SkuInfo>
|
||||||
<SkuId>0</SkuId>
|
<SkuId>0</SkuId>
|
||||||
<VariableName>0x0062 0x006F 0x006F 0x0074 0x006D 0x006F 0x0064 0x0065</VariableName>
|
<Value>0x2</Value>
|
||||||
<VariableGuid>WinNPassThrough</VariableGuid>
|
|
||||||
<VariableOffset>0x123</VariableOffset>
|
|
||||||
<HiiDefaultValue>0x123</HiiDefaultValue>
|
|
||||||
</SkuInfo>
|
</SkuInfo>
|
||||||
</PcdBuildData>
|
</PcdBuildData>
|
||||||
</DynamicPcdBuildDefinitions>
|
</DynamicPcdBuildDefinitions>
|
||||||
|
@@ -493,7 +493,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
</targetfiles>
|
</targetfiles>
|
||||||
|
|
||||||
<sequential>
|
<sequential>
|
||||||
<vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">
|
<vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">
|
||||||
<EXTRA.INC/>
|
<EXTRA.INC/>
|
||||||
</vfrcompile>
|
</vfrcompile>
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
FPDParser = org.tianocore.build.fpd.FpdParserTask
|
FPDParser = org.tianocore.build.fpd.FpdParserTask
|
||||||
bl = org.tianocore.build.global.VariableTask
|
bl = org.tianocore.build.global.VariableTask
|
||||||
bf = org.tianocore.build.global.LibBuildFileGenerator
|
|
||||||
GenBuild = org.tianocore.build.GenBuildTask
|
GenBuild = org.tianocore.build.GenBuildTask
|
||||||
ToolChainSetup = org.tianocore.build.toolchain.ToolChainTask
|
FrameworkBuild = org.tianocore.build.FrameworkBuildTask
|
||||||
Expand = org.tianocore.build.ExpandTask
|
|
||||||
OutputDirSetup = org.tianocore.build.OutputDirSetupTask
|
|
||||||
OnDependency = org.tianocore.build.global.OnDependency
|
OnDependency = org.tianocore.build.global.OnDependency
|
||||||
|
ToolChainSetup = org.tianocore.build.toolchain.ToolChainTask
|
||||||
|
OutputDirSetup = org.tianocore.build.OutputDirSetup
|
||||||
sourcefiles = org.tianocore.build.global.DpFileList
|
sourcefiles = org.tianocore.build.global.DpFileList
|
||||||
targetfiles = org.tianocore.build.global.DpFileList
|
targetfiles = org.tianocore.build.global.DpFileList
|
||||||
file = org.tianocore.build.global.DpFile
|
file = org.tianocore.build.global.DpFile
|
||||||
|
DefaultBuildFileGenerator = org.tianocore.build.tools.DefaultBuildFileGenerator
|
||||||
|
@@ -64,6 +64,7 @@ public class FileProcess {
|
|||||||
{".s", "", "ASM" },
|
{".s", "", "ASM" },
|
||||||
{".uni", "", "UNI" },
|
{".uni", "", "UNI" },
|
||||||
{".vfr", "", "VFR" },
|
{".vfr", "", "VFR" },
|
||||||
|
{".Vfr", "", "VFR" },
|
||||||
{".dxs", "", "DPX"},
|
{".dxs", "", "DPX"},
|
||||||
{".fv", "", "FV" },
|
{".fv", "", "FV" },
|
||||||
{".efi", "", "EFI" },
|
{".efi", "", "EFI" },
|
||||||
|
@@ -32,8 +32,9 @@ import org.apache.tools.ant.taskdefs.Ant;
|
|||||||
import org.apache.tools.ant.taskdefs.Property;
|
import org.apache.tools.ant.taskdefs.Property;
|
||||||
import org.apache.xmlbeans.XmlObject;
|
import org.apache.xmlbeans.XmlObject;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.build.autogen.AutoGen;
|
||||||
import org.tianocore.build.fpd.FpdParserTask;
|
import org.tianocore.build.fpd.FpdParserTask;
|
||||||
|
import org.tianocore.build.global.GenBuildLogger;
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
import org.tianocore.build.global.OutputManager;
|
import org.tianocore.build.global.OutputManager;
|
||||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
@@ -42,6 +43,8 @@ import org.tianocore.build.id.ModuleIdentification;
|
|||||||
import org.tianocore.build.id.PackageIdentification;
|
import org.tianocore.build.id.PackageIdentification;
|
||||||
import org.tianocore.build.id.PlatformIdentification;
|
import org.tianocore.build.id.PlatformIdentification;
|
||||||
import org.tianocore.build.tools.ModuleItem;
|
import org.tianocore.build.tools.ModuleItem;
|
||||||
|
import org.tianocore.exception.EdkException;
|
||||||
|
import org.tianocore.logger.EdkLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<p>
|
<p>
|
||||||
@@ -115,6 +118,13 @@ public class GenBuildTask extends Ant {
|
|||||||
From module build, exception from module surface area invalid.
|
From module build, exception from module surface area invalid.
|
||||||
**/
|
**/
|
||||||
public void execute() throws BuildException {
|
public void execute() throws BuildException {
|
||||||
|
//
|
||||||
|
// set Logger
|
||||||
|
//
|
||||||
|
GenBuildLogger logger = new GenBuildLogger(getProject());
|
||||||
|
EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL"));
|
||||||
|
EdkLog.setLogger(logger);
|
||||||
|
// remove !!
|
||||||
try {
|
try {
|
||||||
pushProperties();
|
pushProperties();
|
||||||
//
|
//
|
||||||
@@ -524,8 +534,9 @@ public class GenBuildTask extends Ant {
|
|||||||
//
|
//
|
||||||
// AutoGen
|
// AutoGen
|
||||||
//
|
//
|
||||||
// AutoGen autogen = new AutoGen(getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId);
|
|
||||||
// autogen.genAutogen();
|
AutoGen autogen = new AutoGen(getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch());
|
||||||
|
autogen.genAutogen();
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@@ -26,8 +26,9 @@ import org.tianocore.GuidsDocument;
|
|||||||
import org.tianocore.LibraryClassDocument.LibraryClass;
|
import org.tianocore.LibraryClassDocument.LibraryClass;
|
||||||
import org.tianocore.PPIsDocument;
|
import org.tianocore.PPIsDocument;
|
||||||
import org.tianocore.ProtocolsDocument;
|
import org.tianocore.ProtocolsDocument;
|
||||||
//import org.tianocore.build.pcd.action.PCDAutoGenAction;
|
import org.tianocore.build.pcd.action.PCDAutoGenAction;
|
||||||
import org.tianocore.build.exception.*;
|
import org.tianocore.build.exception.*;
|
||||||
|
import org.tianocore.logger.EdkLog;
|
||||||
import org.apache.tools.ant.BuildException;
|
import org.apache.tools.ant.BuildException;
|
||||||
import org.apache.xmlbeans.XmlObject;
|
import org.apache.xmlbeans.XmlObject;
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ import java.io.FileWriter;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -65,7 +67,7 @@ public class AutoGen {
|
|||||||
// / PcdAutogen instance which is used to manage how to generate the PCD
|
// / PcdAutogen instance which is used to manage how to generate the PCD
|
||||||
// / information.
|
// / information.
|
||||||
// /
|
// /
|
||||||
// private PCDAutoGenAction myPcdAutogen;
|
private PCDAutoGenAction myPcdAutogen;
|
||||||
|
|
||||||
// /
|
// /
|
||||||
// / The protocl list which records in module or library surface area and
|
// / The protocl list which records in module or library surface area and
|
||||||
@@ -80,11 +82,16 @@ public class AutoGen {
|
|||||||
private Set<String> mPpiList = new HashSet<String>();
|
private Set<String> mPpiList = new HashSet<String>();
|
||||||
|
|
||||||
// /
|
// /
|
||||||
// / The Guid list which recoreded in module or library surface are and it's
|
// / The Guid list which recoreded in module or library surface area and it's
|
||||||
// / dependence on library instance surface area.
|
// / dependence on library instance surface area.
|
||||||
// /
|
// /
|
||||||
private Set<String> mGuidList = new HashSet<String>();
|
private Set<String> mGuidList = new HashSet<String>();
|
||||||
|
|
||||||
|
//
|
||||||
|
// The dependence package list which recoreded in module or library surface
|
||||||
|
// area and it's dependence on library instance surface are.
|
||||||
|
//
|
||||||
|
private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();
|
||||||
/**
|
/**
|
||||||
* Construct function
|
* Construct function
|
||||||
*
|
*
|
||||||
@@ -231,7 +238,7 @@ public class AutoGen {
|
|||||||
Set<String> libClassIncludeH;
|
Set<String> libClassIncludeH;
|
||||||
String moduleType;
|
String moduleType;
|
||||||
// List<String> headerFileList;
|
// List<String> headerFileList;
|
||||||
Set<String> headerFileList;
|
List<String> headerFileList;
|
||||||
Iterator item;
|
Iterator item;
|
||||||
StringBuffer fileBuffer = new StringBuffer(8192);
|
StringBuffer fileBuffer = new StringBuffer(8192);
|
||||||
|
|
||||||
@@ -257,29 +264,29 @@ public class AutoGen {
|
|||||||
// moduleType.
|
// moduleType.
|
||||||
//
|
//
|
||||||
moduleType = SurfaceAreaQuery.getModuleType();
|
moduleType = SurfaceAreaQuery.getModuleType();
|
||||||
switch (CommonDefinition.getModuleType(moduleType)) {
|
// switch (CommonDefinition.getModuleType(moduleType)) {
|
||||||
case CommonDefinition.ModuleTypeDxeCore:
|
// case CommonDefinition.ModuleTypeDxeCore:
|
||||||
case CommonDefinition.ModuleTypeDxeDriver:
|
// case CommonDefinition.ModuleTypeDxeDriver:
|
||||||
case CommonDefinition.ModuleTypeDxeRuntimeDriver:
|
// case CommonDefinition.ModuleTypeDxeRuntimeDriver:
|
||||||
case CommonDefinition.ModuleTypeDxeSmmDriver:
|
// case CommonDefinition.ModuleTypeDxeSmmDriver:
|
||||||
case CommonDefinition.ModuleTypeDxeSalDriver:
|
// case CommonDefinition.ModuleTypeDxeSalDriver:
|
||||||
case CommonDefinition.ModuleTypeUefiDriver:
|
// case CommonDefinition.ModuleTypeUefiDriver:
|
||||||
case CommonDefinition.ModuleTypeUefiApplication:
|
// case CommonDefinition.ModuleTypeUefiApplication:
|
||||||
fileBuffer.append(CommonDefinition.autoGenHLine1);
|
// fileBuffer.append(CommonDefinition.autoGenHLine1);
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
fileBuffer.append(CommonDefinition.autoGenHVersionDefault);
|
// fileBuffer.append(CommonDefinition.autoGenHVersionDefault);
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
switch (CommonDefinition.getModuleType(moduleType)) {
|
// switch (CommonDefinition.getModuleType(moduleType)) {
|
||||||
case CommonDefinition.ModuleTypeUefiDriver:
|
// case CommonDefinition.ModuleTypeUefiDriver:
|
||||||
case CommonDefinition.ModuleTypeUefiApplication:
|
// case CommonDefinition.ModuleTypeUefiApplication:
|
||||||
fileBuffer.append(CommonDefinition.autoGenHReleaseDefault);
|
// fileBuffer.append(CommonDefinition.autoGenHReleaseDefault);
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
fileBuffer.append(CommonDefinition.autoGenHLine2);
|
// fileBuffer.append(CommonDefinition.autoGenHLine2);
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add "extern int __make_me_compile_correctly;" at begin of
|
// Add "extern int __make_me_compile_correctly;" at begin of
|
||||||
@@ -287,12 +294,21 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
fileBuffer.append(CommonDefinition.autoGenHbegin);
|
fileBuffer.append(CommonDefinition.autoGenHbegin);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Put EFI_SPECIFICATION_VERSION, and EDK_RELEASE_VERSION.
|
||||||
|
//
|
||||||
|
String[] specList = SurfaceAreaQuery.getExternSpecificaiton();
|
||||||
|
for (int i = 0; i < specList.length; i++) {
|
||||||
|
fileBuffer.append(CommonDefinition.marcDefineStr + specList[i]
|
||||||
|
+ "\r\n");
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// Write consumed package's mdouleInfo related .h file to autogen.h
|
// Write consumed package's mdouleInfo related .h file to autogen.h
|
||||||
//
|
//
|
||||||
// PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery
|
// PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery
|
||||||
// .getDependencePkg(this.arch);
|
// .getDependencePkg(this.arch);
|
||||||
PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery.getDependencePkg(null);
|
PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery
|
||||||
|
.getDependencePkg(null);
|
||||||
if (consumedPkgIdList != null) {
|
if (consumedPkgIdList != null) {
|
||||||
headerFileList = depPkgToAutogenH(consumedPkgIdList, moduleType);
|
headerFileList = depPkgToAutogenH(consumedPkgIdList, moduleType);
|
||||||
item = headerFileList.iterator();
|
item = headerFileList.iterator();
|
||||||
@@ -328,9 +344,10 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
// Write PCD autogen information to AutoGen.h.
|
// Write PCD autogen information to AutoGen.h.
|
||||||
//
|
//
|
||||||
// if (this.myPcdAutogen != null) {
|
if (this.myPcdAutogen != null) {
|
||||||
// fileBuffer.append(this.myPcdAutogen.OutputH());
|
fileBuffer.append("\r\n");
|
||||||
// }
|
fileBuffer.append(this.myPcdAutogen.OutputH());
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Append the #endif at AutoGen.h
|
// Append the #endif at AutoGen.h
|
||||||
@@ -374,7 +391,8 @@ public class AutoGen {
|
|||||||
Map<String, XmlObject> doc = GlobalData.getNativeMsa(this.moduleId);
|
Map<String, XmlObject> doc = GlobalData.getNativeMsa(this.moduleId);
|
||||||
SurfaceAreaQuery.push(doc);
|
SurfaceAreaQuery.push(doc);
|
||||||
//
|
//
|
||||||
// Write <Extern> DriverBinding/ComponentName/DriverConfiguration/DriverDialog
|
// Write <Extern>
|
||||||
|
// DriverBinding/ComponentName/DriverConfiguration/DriverDialog
|
||||||
// to AutoGen.c
|
// to AutoGen.c
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -390,9 +408,8 @@ public class AutoGen {
|
|||||||
// Write EntryPoint to autgoGen.c
|
// Write EntryPoint to autgoGen.c
|
||||||
//
|
//
|
||||||
String[] entryPointList = SurfaceAreaQuery.getModuleEntryPointArray();
|
String[] entryPointList = SurfaceAreaQuery.getModuleEntryPointArray();
|
||||||
if (entryPointList != null) {
|
EntryPointToAutoGen(CommonDefinition.remDupString(entryPointList), fileBuffer);
|
||||||
EntryPointToAutoGen(entryPointList, fileBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Restore the DOC which include the FPD module info.
|
// Restore the DOC which include the FPD module info.
|
||||||
@@ -402,7 +419,8 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
// Write Guid to autogen.c
|
// Write Guid to autogen.c
|
||||||
//
|
//
|
||||||
String guid = CommonDefinition.formatGuidName(SurfaceAreaQuery.getModuleGuid());
|
String guid = CommonDefinition.formatGuidName(SurfaceAreaQuery
|
||||||
|
.getModuleGuid());
|
||||||
|
|
||||||
fileBuffer
|
fileBuffer
|
||||||
.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");
|
.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");
|
||||||
@@ -427,6 +445,17 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
LibInstanceToAutogenC(fileBuffer);
|
LibInstanceToAutogenC(fileBuffer);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get module dependent Package identification.
|
||||||
|
//
|
||||||
|
PackageIdentification[] packages = SurfaceAreaQuery.getDependencePkg(this.arch);
|
||||||
|
for (int i = 0; i < packages.length; i++){
|
||||||
|
if (!this.mDepPkgList.contains(packages[i])){
|
||||||
|
this.mDepPkgList.add(packages[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Write consumed ppi, guid, protocol to autogen.c
|
// Write consumed ppi, guid, protocol to autogen.c
|
||||||
//
|
//
|
||||||
@@ -442,17 +471,19 @@ public class AutoGen {
|
|||||||
// Note : when PCD image tool ready,
|
// Note : when PCD image tool ready,
|
||||||
// isPCDEmulatedDriver parameter will be removed.
|
// isPCDEmulatedDriver parameter will be removed.
|
||||||
//
|
//
|
||||||
// try {
|
try {
|
||||||
// this.myPcdAutogen = new PCDAutoGenAction(moduleId.getName(),
|
// this.myPcdAutogen = new PCDAutoGenAction(moduleId.getName(),
|
||||||
// moduleId.getName().equalsIgnoreCase("PcdEmulatorPeim"));
|
// moduleId.getGuid(), moduleId.getPackage().getName(), moduleId.getPackage().getGuid(),this.arch,moduleId.getVersion(),false, null);
|
||||||
// this.myPcdAutogen.execute();
|
this.myPcdAutogen = new PCDAutoGenAction(moduleId.getName(),null,null,null, this.arch,null,false, null);
|
||||||
// } catch (Exception e) {
|
this.myPcdAutogen.execute();
|
||||||
// throw new BuildException("PCD Autogen failed:" + e.getMessage());
|
} catch (Exception e) {
|
||||||
// }
|
throw new BuildException("PCD Autogen failed:" + e.getMessage());
|
||||||
//
|
}
|
||||||
// if (this.myPcdAutogen != null) {
|
|
||||||
// fileBuffer.append(this.myPcdAutogen.OutputC());
|
if (this.myPcdAutogen != null) {
|
||||||
// }
|
fileBuffer.append("\r\n");
|
||||||
|
fileBuffer.append(this.myPcdAutogen.OutputC());
|
||||||
|
}
|
||||||
|
|
||||||
if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {
|
if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {
|
||||||
throw new BuildException("Failed to generate AutoGen.c !!!");
|
throw new BuildException("Failed to generate AutoGen.c !!!");
|
||||||
@@ -472,7 +503,7 @@ public class AutoGen {
|
|||||||
|
|
||||||
Set<String> libClassIncludeH;
|
Set<String> libClassIncludeH;
|
||||||
String moduleType;
|
String moduleType;
|
||||||
Set<String> headerFileList;
|
List<String> headerFileList;
|
||||||
Iterator item;
|
Iterator item;
|
||||||
StringBuffer fileBuffer = new StringBuffer(10240);
|
StringBuffer fileBuffer = new StringBuffer(10240);
|
||||||
|
|
||||||
@@ -499,7 +530,8 @@ public class AutoGen {
|
|||||||
fileBuffer.append(CommonDefinition.autoGenHbegin);
|
fileBuffer.append(CommonDefinition.autoGenHbegin);
|
||||||
String[] specList = SurfaceAreaQuery.getExternSpecificaiton();
|
String[] specList = SurfaceAreaQuery.getExternSpecificaiton();
|
||||||
for (int i = 0; i < specList.length; i++) {
|
for (int i = 0; i < specList.length; i++) {
|
||||||
fileBuffer.append(CommonDefinition.marcDefineStr + specList[i] + "\r\n");
|
fileBuffer.append(CommonDefinition.marcDefineStr + specList[i]
|
||||||
|
+ "\r\n");
|
||||||
}
|
}
|
||||||
// fileBuffer.append(CommonDefinition.autoGenHLine1);
|
// fileBuffer.append(CommonDefinition.autoGenHLine1);
|
||||||
// fileBuffer.append(CommonDefinition.autoGenHLine2);
|
// fileBuffer.append(CommonDefinition.autoGenHLine2);
|
||||||
@@ -542,9 +574,10 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
// Write PCD information to library AutoGen.h.
|
// Write PCD information to library AutoGen.h.
|
||||||
//
|
//
|
||||||
// if (this.myPcdAutogen != null) {
|
if (this.myPcdAutogen != null) {
|
||||||
// fileBuffer.append(this.myPcdAutogen.OutputH());
|
fileBuffer.append("\r\n");
|
||||||
// }
|
fileBuffer.append(this.myPcdAutogen.OutputH());
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Append the #endif at AutoGen.h
|
// Append the #endif at AutoGen.h
|
||||||
@@ -588,16 +621,25 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
try {
|
try {
|
||||||
// this.myPcdAutogen = new PCDAutoGenAction(this.moduleId.getName(),
|
// this.myPcdAutogen = new PCDAutoGenAction(this.moduleId.getName(),
|
||||||
// this.moduleId.getName().equalsIgnoreCase("PcdEmulatorPeim"));
|
// this.moduleId.getGuid(),moduleId.getPackage().getName(),moduleId.getPackage().getGuid(), this.arch, moduleId.getVersion(),true, SurfaceAreaQuery.getModulePcdEntryNameArray());
|
||||||
// this.myPcdAutogen.execute();
|
this.myPcdAutogen = new PCDAutoGenAction(this.moduleId.getName(),
|
||||||
// this.myPcdAutogen = new PCDAutoGenAction(this.moduleId,);
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.arch,
|
||||||
|
null,
|
||||||
|
true,
|
||||||
|
SurfaceAreaQuery.getModulePcdEntryNameArray());
|
||||||
|
|
||||||
|
this.myPcdAutogen.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BuildException(e.getMessage());
|
throw new BuildException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.myPcdAutogen != null) {
|
if (this.myPcdAutogen != null) {
|
||||||
// fileBuffer.append(this.myPcdAutogen.OutputC());
|
fileBuffer.append("\r\n");
|
||||||
// }
|
fileBuffer.append(this.myPcdAutogen.OutputC());
|
||||||
|
}
|
||||||
|
|
||||||
if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {
|
if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {
|
||||||
throw new BuildException("Failed to generate AutoGen.c !!!");
|
throw new BuildException("Failed to generate AutoGen.c !!!");
|
||||||
@@ -615,7 +657,8 @@ public class AutoGen {
|
|||||||
* build module or library.
|
* build module or library.
|
||||||
* @return includeStrList List of *.h file.
|
* @return includeStrList List of *.h file.
|
||||||
*/
|
*/
|
||||||
Set<String> LibraryClassToAutogenH(String[] libClassList) throws AutoGenException{
|
Set<String> LibraryClassToAutogenH(String[] libClassList)
|
||||||
|
throws AutoGenException {
|
||||||
Set<String> includStrList = new HashSet<String>();
|
Set<String> includStrList = new HashSet<String>();
|
||||||
String includerName[];
|
String includerName[];
|
||||||
String str = "";
|
String str = "";
|
||||||
@@ -630,7 +673,8 @@ public class AutoGen {
|
|||||||
SurfaceAreaQuery.getDependencePkg(this.arch),
|
SurfaceAreaQuery.getDependencePkg(this.arch),
|
||||||
libClassList[i]);
|
libClassList[i]);
|
||||||
if (includerName == null) {
|
if (includerName == null) {
|
||||||
throw new AutoGenException("Can not find library class [" + libClassList[i] + "] declaration in every packages. ");
|
throw new AutoGenException("Can not find library class ["
|
||||||
|
+ libClassList[i] + "] declaration in every packages. ");
|
||||||
}
|
}
|
||||||
for (int j = 0; j < includerName.length; j++) {
|
for (int j = 0; j < includerName.length; j++) {
|
||||||
String includeNameStr = includerName[j];
|
String includeNameStr = includerName[j];
|
||||||
@@ -656,10 +700,10 @@ public class AutoGen {
|
|||||||
* Module type.
|
* Module type.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Set<String> depPkgToAutogenH(PackageIdentification[] packageNameList,
|
List<String> depPkgToAutogenH(PackageIdentification[] packageNameList,
|
||||||
String moduleType) throws AutoGenException {
|
String moduleType) throws AutoGenException {
|
||||||
|
|
||||||
Set<String> includeStrList = new HashSet<String>();
|
List<String> includeStrList = new LinkedList<String>();
|
||||||
String pkgHeader;
|
String pkgHeader;
|
||||||
String includeStr = "";
|
String includeStr = "";
|
||||||
|
|
||||||
@@ -667,13 +711,17 @@ public class AutoGen {
|
|||||||
// Get include file from moduleInfo file
|
// Get include file from moduleInfo file
|
||||||
//
|
//
|
||||||
for (int i = 0; i < packageNameList.length; i++) {
|
for (int i = 0; i < packageNameList.length; i++) {
|
||||||
// pkgHeader = GlobalData.getPackageHeaderFiles(packageNameList[i], moduleType);
|
pkgHeader = GlobalData.getPackageHeaderFiles(packageNameList[i],
|
||||||
// if (pkgHeader == null){
|
moduleType);
|
||||||
// throw new AutoGenException("Can not find package [" + packageNameList[i] + "] declaration in every packages. ");
|
if (pkgHeader == null) {
|
||||||
// }else if (!pkgHeader.equalsIgnoreCase("")){
|
throw new AutoGenException("Can not find package ["
|
||||||
// includeStr = CommonDefinition.include + "<" + pkgHeader + ">\r\n";
|
+ packageNameList[i]
|
||||||
// includeStrList.add(includeStr);
|
+ "] declaration in every packages. ");
|
||||||
// }
|
} else if (!pkgHeader.equalsIgnoreCase("")) {
|
||||||
|
includeStr = CommonDefinition.include + " <" + pkgHeader
|
||||||
|
+ ">\r\n";
|
||||||
|
includeStrList.add(includeStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return includeStrList;
|
return includeStrList;
|
||||||
@@ -703,7 +751,7 @@ public class AutoGen {
|
|||||||
switch (CommonDefinition.getModuleType(typeStr)) {
|
switch (CommonDefinition.getModuleType(typeStr)) {
|
||||||
|
|
||||||
case CommonDefinition.ModuleTypePeiCore:
|
case CommonDefinition.ModuleTypePeiCore:
|
||||||
if (entryPointList.length != 1 || entryPointList[0].equals("")) {
|
if (entryPointList == null ||entryPointList.length != 1 ) {
|
||||||
throw new BuildException(
|
throw new BuildException(
|
||||||
"Module type = 'PEI_CORE', only have one module entry point!");
|
"Module type = 'PEI_CORE', only have one module entry point!");
|
||||||
} else {
|
} else {
|
||||||
@@ -735,7 +783,7 @@ public class AutoGen {
|
|||||||
|
|
||||||
case CommonDefinition.ModuleTypeDxeCore:
|
case CommonDefinition.ModuleTypeDxeCore:
|
||||||
fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");
|
fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");
|
||||||
if (entryPointList.length != 1 || entryPointList[0].equals("")) {
|
if (entryPointList == null || entryPointList.length != 1) {
|
||||||
throw new BuildException(
|
throw new BuildException(
|
||||||
"Module type = 'DXE_CORE', only have one module entry point!");
|
"Module type = 'DXE_CORE', only have one module entry point!");
|
||||||
} else {
|
} else {
|
||||||
@@ -764,8 +812,19 @@ public class AutoGen {
|
|||||||
int entryPointCount = 0;
|
int entryPointCount = 0;
|
||||||
fileBuffer
|
fileBuffer
|
||||||
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");
|
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");
|
||||||
|
if (entryPointList == null) {
|
||||||
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
|
fileBuffer.append("ProcessModuleEntryPointList (\r\n");
|
||||||
|
fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
|
||||||
|
fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
||||||
|
fileBuffer.append(" )\r\n\r\n");
|
||||||
|
fileBuffer.append("{\r\n");
|
||||||
|
fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
||||||
|
fileBuffer.append("}\r\n\r\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
for (int i = 0; i < entryPointList.length; i++) {
|
for (int i = 0; i < entryPointList.length; i++) {
|
||||||
if (!entryPointList[i].equals("")) {
|
|
||||||
fileBuffer.append("EFI_STATUS\r\n");
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
fileBuffer.append("EFIAPI\r\n");
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
fileBuffer.append(entryPointList[i]);
|
fileBuffer.append(entryPointList[i]);
|
||||||
@@ -776,9 +835,7 @@ public class AutoGen {
|
|||||||
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
||||||
fileBuffer.append(" );\r\n");
|
fileBuffer.append(" );\r\n");
|
||||||
entryPointCount++;
|
entryPointCount++;
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fileBuffer.append("EFI_STATUS\r\n");
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
@@ -788,10 +845,7 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
||||||
fileBuffer.append(" )\r\n\r\n");
|
fileBuffer.append(" )\r\n\r\n");
|
||||||
fileBuffer.append("{\r\n");
|
fileBuffer.append("{\r\n");
|
||||||
|
if (entryPointCount == 1) {
|
||||||
if (entryPointCount == 0) {
|
|
||||||
fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
|
||||||
} else if (entryPointCount == 1) {
|
|
||||||
fileBuffer.append(" return ");
|
fileBuffer.append(" return ");
|
||||||
fileBuffer.append(entryPointList[0]);
|
fileBuffer.append(entryPointList[0]);
|
||||||
fileBuffer.append(" (FfsHeader, PeiServices);\r\n");
|
fileBuffer.append(" (FfsHeader, PeiServices);\r\n");
|
||||||
@@ -819,6 +873,31 @@ public class AutoGen {
|
|||||||
|
|
||||||
case CommonDefinition.ModuleTypeDxeSmmDriver:
|
case CommonDefinition.ModuleTypeDxeSmmDriver:
|
||||||
entryPointCount = 0;
|
entryPointCount = 0;
|
||||||
|
//
|
||||||
|
// If entryPoint is null, create an empty ProcessModuleEntryPointList
|
||||||
|
// function.
|
||||||
|
//
|
||||||
|
if (entryPointList == null || entryPointList.length == 0){
|
||||||
|
fileBuffer
|
||||||
|
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
|
||||||
|
fileBuffer.append(Integer.toString(entryPointCount));
|
||||||
|
fileBuffer.append(";\r\n");
|
||||||
|
fileBuffer
|
||||||
|
.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n");
|
||||||
|
fileBuffer
|
||||||
|
.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n\r\n");
|
||||||
|
|
||||||
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
|
fileBuffer.append("ProcessModuleEntryPointList (\r\n");
|
||||||
|
fileBuffer.append(" EFI_HANDLE ImageHandle,\r\n");
|
||||||
|
fileBuffer.append(" EFI_SYSTEM_TABLE *SystemTable\r\n");
|
||||||
|
fileBuffer.append(" )\r\n\r\n");
|
||||||
|
fileBuffer.append("{\r\n");
|
||||||
|
fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
||||||
|
fileBuffer.append("}\r\n\r\n");
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
for (int i = 0; i < entryPointList.length; i++) {
|
for (int i = 0; i < entryPointList.length; i++) {
|
||||||
if (!entryPointList[i].equals("")) {
|
if (!entryPointList[i].equals("")) {
|
||||||
fileBuffer.append("EFI_STATUS\r\n");
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
@@ -850,8 +929,8 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" )\r\n\r\n");
|
fileBuffer.append(" )\r\n\r\n");
|
||||||
fileBuffer.append("{\r\n");
|
fileBuffer.append("{\r\n");
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < entryPointList.length; i++) {
|
for (int i = 0; i < entryPointList.length; i++) {
|
||||||
if (!entryPointList[i].equals("")) {
|
|
||||||
fileBuffer
|
fileBuffer
|
||||||
.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
|
.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
|
||||||
fileBuffer.append(" ExitDriver (");
|
fileBuffer.append(" ExitDriver (");
|
||||||
@@ -859,9 +938,7 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
|
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
|
||||||
fileBuffer.append(" ASSERT (FALSE);\r\n");
|
fileBuffer.append(" ASSERT (FALSE);\r\n");
|
||||||
fileBuffer.append(" }\r\n");
|
fileBuffer.append(" }\r\n");
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fileBuffer.append(" return mDriverEntryPointStatus;\r\n");
|
fileBuffer.append(" return mDriverEntryPointStatus;\r\n");
|
||||||
fileBuffer.append("}\r\n\r\n");
|
fileBuffer.append("}\r\n\r\n");
|
||||||
@@ -880,10 +957,14 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" ASSERT (FALSE);\r\n");
|
fileBuffer.append(" ASSERT (FALSE);\r\n");
|
||||||
fileBuffer.append("}\r\n\r\n");
|
fileBuffer.append("}\r\n\r\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add "ModuleUnloadImage" for DxeSmmDriver module type;
|
// Add "ModuleUnloadImage" for DxeSmmDriver module type;
|
||||||
//
|
//
|
||||||
entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();
|
entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();
|
||||||
|
entryPointList = CommonDefinition.remDupString(entryPointList);
|
||||||
entryPointCount = 0;
|
entryPointCount = 0;
|
||||||
|
|
||||||
fileBuffer
|
fileBuffer
|
||||||
@@ -924,7 +1005,11 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" EFI_STATUS Status;\r\n\r\n");
|
fileBuffer.append(" EFI_STATUS Status;\r\n\r\n");
|
||||||
fileBuffer.append(" Status = EFI_SUCCESS;\r\n\r\n");
|
fileBuffer.append(" Status = EFI_SUCCESS;\r\n\r\n");
|
||||||
for (int i = 0; i < entryPointList.length; i++) {
|
for (int i = 0; i < entryPointList.length; i++) {
|
||||||
if (!entryPointList[i].equals("")) {
|
if (i == 0){
|
||||||
|
fileBuffer.append(" Status = ");
|
||||||
|
fileBuffer.append(entryPointList[i]);
|
||||||
|
fileBuffer.append("(ImageHandle);\r\n");
|
||||||
|
}else{
|
||||||
fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
|
fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
|
||||||
fileBuffer.append(" ");
|
fileBuffer.append(" ");
|
||||||
fileBuffer.append(entryPointList[i]);
|
fileBuffer.append(entryPointList[i]);
|
||||||
@@ -934,8 +1019,6 @@ public class AutoGen {
|
|||||||
fileBuffer.append(entryPointList[i]);
|
fileBuffer.append(entryPointList[i]);
|
||||||
fileBuffer.append("(ImageHandle);\r\n");
|
fileBuffer.append("(ImageHandle);\r\n");
|
||||||
fileBuffer.append(" }\r\n");
|
fileBuffer.append(" }\r\n");
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fileBuffer.append(" return Status;\r\n");
|
fileBuffer.append(" return Status;\r\n");
|
||||||
@@ -950,8 +1033,25 @@ public class AutoGen {
|
|||||||
case CommonDefinition.ModuleTypeUefiApplication:
|
case CommonDefinition.ModuleTypeUefiApplication:
|
||||||
entryPointCount = 0;
|
entryPointCount = 0;
|
||||||
fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");
|
fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");
|
||||||
|
//
|
||||||
|
// If entry point is null, create a empty ProcessModuleEntryPointList function.
|
||||||
|
//
|
||||||
|
if (entryPointList == null || entryPointList.length == 0){
|
||||||
|
fileBuffer
|
||||||
|
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = 0;\r\n");
|
||||||
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
|
fileBuffer.append("ProcessModuleEntryPointList (\r\n");
|
||||||
|
fileBuffer.append(" EFI_HANDLE ImageHandle,\r\n");
|
||||||
|
fileBuffer.append(" EFI_SYSTEM_TABLE *SystemTable\r\n");
|
||||||
|
fileBuffer.append(" )\r\n\r\n");
|
||||||
|
fileBuffer.append("{\r\n");
|
||||||
|
fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
||||||
|
fileBuffer.append("}\r\n");
|
||||||
|
|
||||||
|
}else {
|
||||||
for (int i = 0; i < entryPointList.length; i++) {
|
for (int i = 0; i < entryPointList.length; i++) {
|
||||||
if (!entryPointList[i].equals("")) {
|
|
||||||
fileBuffer.append("EFI_STATUS\r\n");
|
fileBuffer.append("EFI_STATUS\r\n");
|
||||||
fileBuffer.append("EFIAPI\r\n");
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
fileBuffer.append(entryPointList[i]);
|
fileBuffer.append(entryPointList[i]);
|
||||||
@@ -960,9 +1060,6 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" EFI_SYSTEM_TABLE *SystemTable\r\n");
|
fileBuffer.append(" EFI_SYSTEM_TABLE *SystemTable\r\n");
|
||||||
fileBuffer.append(" );\r\n");
|
fileBuffer.append(" );\r\n");
|
||||||
entryPointCount++;
|
entryPointCount++;
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fileBuffer
|
fileBuffer
|
||||||
@@ -985,9 +1082,7 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" )\r\n\r\n");
|
fileBuffer.append(" )\r\n\r\n");
|
||||||
fileBuffer.append("{\r\n");
|
fileBuffer.append("{\r\n");
|
||||||
|
|
||||||
if (entryPointCount == 0) {
|
if (entryPointCount == 1) {
|
||||||
fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
|
||||||
} else if (entryPointCount == 1) {
|
|
||||||
fileBuffer.append(" return (");
|
fileBuffer.append(" return (");
|
||||||
fileBuffer.append(entryPointList[0]);
|
fileBuffer.append(entryPointList[0]);
|
||||||
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
|
fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
|
||||||
@@ -1032,10 +1127,16 @@ public class AutoGen {
|
|||||||
}
|
}
|
||||||
fileBuffer.append("}\r\n\r\n");
|
fileBuffer.append("}\r\n\r\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add ModuleUnloadImage for DxeDriver and UefiDriver module type.
|
// Add ModuleUnloadImage for DxeDriver and UefiDriver module type.
|
||||||
//
|
//
|
||||||
entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();
|
entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();
|
||||||
|
//
|
||||||
|
// Remover duplicate unload entry point.
|
||||||
|
//
|
||||||
|
entryPointList = CommonDefinition.remDupString(entryPointList);
|
||||||
entryPointCount = 0;
|
entryPointCount = 0;
|
||||||
if (entryPointList != null) {
|
if (entryPointList != null) {
|
||||||
for (int i = 0; i < entryPointList.length; i++) {
|
for (int i = 0; i < entryPointList.length; i++) {
|
||||||
@@ -1076,7 +1177,7 @@ public class AutoGen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fileBuffer.append("EFI_STATUS\n");
|
fileBuffer.append("EFI_STATUS\n");
|
||||||
fileBuffer.append("EFIAPI\n");
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
fileBuffer.append("ProcessModuleUnloadList (\r\n");
|
fileBuffer.append("ProcessModuleUnloadList (\r\n");
|
||||||
fileBuffer.append(" EFI_HANDLE ImageHandle\r\n");
|
fileBuffer.append(" EFI_HANDLE ImageHandle\r\n");
|
||||||
fileBuffer.append(" )\r\n");
|
fileBuffer.append(" )\r\n");
|
||||||
@@ -1131,12 +1232,13 @@ public class AutoGen {
|
|||||||
// Get the all PPI adn PPI Notify from MSA file,
|
// Get the all PPI adn PPI Notify from MSA file,
|
||||||
// then add those PPI ,and PPI Notify name to list.
|
// then add those PPI ,and PPI Notify name to list.
|
||||||
//
|
//
|
||||||
String[] ppiList = SurfaceAreaQuery.getPpiArray(null);
|
|
||||||
|
String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);
|
||||||
for (int i = 0; i < ppiList.length; i++) {
|
for (int i = 0; i < ppiList.length; i++) {
|
||||||
this.mPpiList.add(ppiList[i]);
|
this.mPpiList.add(ppiList[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] ppiNotifyList = SurfaceAreaQuery.getPpiNotifyArray(null);
|
String[] ppiNotifyList = SurfaceAreaQuery.getPpiNotifyArray(this.arch);
|
||||||
for (int i = 0; i < ppiNotifyList.length; i++) {
|
for (int i = 0; i < ppiNotifyList.length; i++) {
|
||||||
this.mPpiList.add(ppiNotifyList[i]);
|
this.mPpiList.add(ppiNotifyList[i]);
|
||||||
}
|
}
|
||||||
@@ -1148,21 +1250,20 @@ public class AutoGen {
|
|||||||
String ppiKeyWord = null;
|
String ppiKeyWord = null;
|
||||||
while (ppiIterator.hasNext()) {
|
while (ppiIterator.hasNext()) {
|
||||||
ppiKeyWord = ppiIterator.next().toString();
|
ppiKeyWord = ppiIterator.next().toString();
|
||||||
cNameGuid = GlobalData
|
cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, ppiKeyWord);
|
||||||
.getPpiGuid(SurfaceAreaQuery.getDependencePkg(this.arch),
|
|
||||||
ppiKeyWord);
|
|
||||||
if (cNameGuid != null) {
|
if (cNameGuid != null) {
|
||||||
fileBuffer
|
fileBuffer
|
||||||
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
|
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
|
||||||
fileBuffer.append(cNameGuid[0]);
|
fileBuffer.append(cNameGuid[0]);
|
||||||
fileBuffer.append(" = { ");
|
fileBuffer.append(" = { ");
|
||||||
fileBuffer.append(cNameGuid[1]);
|
fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
|
||||||
fileBuffer.append(" } ;");
|
fileBuffer.append(" } ;");
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// If can't find Ppi GUID declaration in every package
|
// If can't find Ppi GUID declaration in every package
|
||||||
//
|
//
|
||||||
throw new AutoGenException("Can not find Ppi GUID [" + ppiKeyWord + "] declaration in every packages. ");
|
throw new AutoGenException("Can not find Ppi GUID ["
|
||||||
|
+ ppiKeyWord + "] declaration in every packages. ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1200,24 +1301,26 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
// Get the NAME and GUID from dependence SPD and write to Autogen.c
|
// Get the NAME and GUID from dependence SPD and write to Autogen.c
|
||||||
//
|
//
|
||||||
Iterator protocolIterator = this.mPpiList.iterator();
|
Iterator protocolIterator = this.mProtocolList.iterator();
|
||||||
String protocolKeyWord = null;
|
String protocolKeyWord = null;
|
||||||
|
|
||||||
|
|
||||||
while (protocolIterator.hasNext()) {
|
while (protocolIterator.hasNext()) {
|
||||||
protocolKeyWord = protocolIterator.next().toString();
|
protocolKeyWord = protocolIterator.next().toString();
|
||||||
cNameGuid = GlobalData.getProtocolGuid(SurfaceAreaQuery
|
cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord);
|
||||||
.getDependencePkg(this.arch), protocolKeyWord);
|
|
||||||
if (cNameGuid != null) {
|
if (cNameGuid != null) {
|
||||||
fileBuffer
|
fileBuffer
|
||||||
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
|
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
|
||||||
fileBuffer.append(cNameGuid[0]);
|
fileBuffer.append(cNameGuid[0]);
|
||||||
fileBuffer.append(" = { ");
|
fileBuffer.append(" = { ");
|
||||||
fileBuffer.append(cNameGuid[1]);
|
fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
|
||||||
fileBuffer.append(" } ;");
|
fileBuffer.append(" } ;");
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// If can't find protocol GUID declaration in every package
|
// If can't find protocol GUID declaration in every package
|
||||||
//
|
//
|
||||||
throw new BuildException("Can not find protocol Guid [" + cNameGuid + "] declaration in every packages. ");
|
throw new BuildException("Can not find protocol Guid ["
|
||||||
|
+ protocolKeyWord + "] declaration in every packages. ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1242,24 +1345,25 @@ public class AutoGen {
|
|||||||
this.mGuidList.add(guidList[i]);
|
this.mGuidList.add(guidList[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Iterator guidIterator = this.mGuidList.iterator();
|
Iterator guidIterator = this.mGuidList.iterator();
|
||||||
while (guidIterator.hasNext()) {
|
while (guidIterator.hasNext()) {
|
||||||
guidKeyWord = guidIterator.next().toString();
|
guidKeyWord = guidIterator.next().toString();
|
||||||
cNameGuid = GlobalData.getGuid(SurfaceAreaQuery
|
cNameGuid = GlobalData.getGuid(this.mDepPkgList, guidKeyWord);
|
||||||
.getDependencePkg(this.arch), guidKeyWord);
|
|
||||||
|
|
||||||
if (cNameGuid != null) {
|
if (cNameGuid != null) {
|
||||||
fileBuffer
|
fileBuffer
|
||||||
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
|
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
|
||||||
fileBuffer.append(cNameGuid[0]);
|
fileBuffer.append(cNameGuid[0]);
|
||||||
fileBuffer.append(" = { ");
|
fileBuffer.append(" = { ");
|
||||||
fileBuffer.append(cNameGuid[1]);
|
fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
|
||||||
fileBuffer.append("} ;");
|
fileBuffer.append("} ;");
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// If can't find GUID declaration in every package
|
// If can't find GUID declaration in every package
|
||||||
//
|
//
|
||||||
throw new AutoGenException("Can not find Guid [" + guidKeyWord + "] declaration in every packages. ");
|
throw new AutoGenException("Can not find Guid [" + guidKeyWord
|
||||||
|
+ "] declaration in every packages. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1285,15 +1389,18 @@ public class AutoGen {
|
|||||||
|
|
||||||
String libConstructName = null;
|
String libConstructName = null;
|
||||||
String libDestructName = null;
|
String libDestructName = null;
|
||||||
ModuleIdentification[] libraryIdList = SurfaceAreaQuery.getLibraryInstance(this.arch);
|
ModuleIdentification[] libraryIdList = SurfaceAreaQuery
|
||||||
|
.getLibraryInstance(this.arch);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (libraryIdList != null) {
|
if (libraryIdList != null) {
|
||||||
//
|
//
|
||||||
// Reorder library instance sequence.
|
// Reorder library instance sequence.
|
||||||
//
|
//
|
||||||
AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList, this.arch);
|
AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList,
|
||||||
List<ModuleIdentification> orderList = libOrder.orderLibInstance();
|
this.arch);
|
||||||
|
List<ModuleIdentification> orderList = libOrder
|
||||||
|
.orderLibInstance();
|
||||||
|
|
||||||
if (orderList != null) {
|
if (orderList != null) {
|
||||||
//
|
//
|
||||||
@@ -1309,24 +1416,25 @@ public class AutoGen {
|
|||||||
//
|
//
|
||||||
// Get override map
|
// Get override map
|
||||||
//
|
//
|
||||||
Map<String, XmlObject> libDoc = GlobalData
|
|
||||||
.getDoc(libInstanceId, this.arch);
|
Map<String, XmlObject> libDoc = GlobalData.getDoc(
|
||||||
|
libInstanceId, this.arch);
|
||||||
SurfaceAreaQuery.push(libDoc);
|
SurfaceAreaQuery.push(libDoc);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get <PPis>, <Protocols>, <Guids> list of this library
|
// Get <PPis>, <Protocols>, <Guids> list of this library
|
||||||
// instance.
|
// instance.
|
||||||
//
|
//
|
||||||
String[] ppiList = SurfaceAreaQuery
|
String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);
|
||||||
.getPpiArray(null);
|
|
||||||
String[] ppiNotifyList = SurfaceAreaQuery
|
String[] ppiNotifyList = SurfaceAreaQuery
|
||||||
.getPpiNotifyArray(null);
|
.getPpiNotifyArray(this.arch);
|
||||||
String[] protocolList = SurfaceAreaQuery
|
String[] protocolList = SurfaceAreaQuery
|
||||||
.getProtocolArray(null);
|
.getProtocolArray(this.arch);
|
||||||
String[] protocolNotifyList = SurfaceAreaQuery
|
String[] protocolNotifyList = SurfaceAreaQuery
|
||||||
.getProtocolNotifyArray(null);
|
.getProtocolNotifyArray(this.arch);
|
||||||
String[] guidList = SurfaceAreaQuery
|
String[] guidList = SurfaceAreaQuery
|
||||||
.getGuidEntryArray(null);
|
.getGuidEntryArray(this.arch);
|
||||||
|
PackageIdentification[] pkgList = SurfaceAreaQuery.getDependencePkg(this.arch);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add those ppi, protocol, guid in global ppi,
|
// Add those ppi, protocol, guid in global ppi,
|
||||||
@@ -1352,6 +1460,11 @@ public class AutoGen {
|
|||||||
for (index = 0; index < guidList.length; index++) {
|
for (index = 0; index < guidList.length; index++) {
|
||||||
this.mGuidList.add(guidList[index]);
|
this.mGuidList.add(guidList[index]);
|
||||||
}
|
}
|
||||||
|
for (index = 0; index < pkgList.length; index++){
|
||||||
|
if (!this.mDepPkgList.contains(pkgList[index])){
|
||||||
|
this.mDepPkgList.add(pkgList[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If not yet parse this library instance's constructor
|
// If not yet parse this library instance's constructor
|
||||||
@@ -1487,10 +1600,16 @@ public class AutoGen {
|
|||||||
|
|
||||||
fileBuffer.append(" )\r\n");
|
fileBuffer.append(" )\r\n");
|
||||||
fileBuffer.append("{\r\n");
|
fileBuffer.append("{\r\n");
|
||||||
|
//
|
||||||
|
// If no constructor function, return EFI_SUCCESS.
|
||||||
|
//
|
||||||
|
//if (libInstanceList.size() == 0){
|
||||||
|
// fileBuffer.append(" return EFI_SUCCESS;\r\n");
|
||||||
|
//}
|
||||||
for (int i = 0; i < libInstanceList.size(); i++) {
|
for (int i = 0; i < libInstanceList.size(); i++) {
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
fileBuffer.append(" EFI_STATUS Status;\r\n");
|
fileBuffer.append(" EFI_STATUS Status;\r\n");
|
||||||
|
fileBuffer.append(" Status = EFI_SUCCESS;\r\n");
|
||||||
fileBuffer.append("\r\n");
|
fileBuffer.append("\r\n");
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
}
|
}
|
||||||
@@ -1518,6 +1637,8 @@ public class AutoGen {
|
|||||||
fileBuffer.append(libInstanceList.get(i));
|
fileBuffer.append(libInstanceList.get(i));
|
||||||
fileBuffer.append(" (ImageHandle, SystemTable);\r\n");
|
fileBuffer.append(" (ImageHandle, SystemTable);\r\n");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
EdkLog.log(EdkLog.EDK_INFO,"Autogen don't know how to deal with module type -"+ moduleType + " !");
|
||||||
}
|
}
|
||||||
fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n");
|
fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n");
|
||||||
}
|
}
|
||||||
@@ -1599,10 +1720,14 @@ public class AutoGen {
|
|||||||
fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
|
fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
|
||||||
fileBuffer.append(" )\r\n");
|
fileBuffer.append(" )\r\n");
|
||||||
fileBuffer.append("{\r\n");
|
fileBuffer.append("{\r\n");
|
||||||
|
//
|
||||||
|
// If no library destructor function, return EFI_SUCCESS.
|
||||||
|
//
|
||||||
|
|
||||||
for (int i = 0; i < libInstanceList.size(); i++) {
|
for (int i = 0; i < libInstanceList.size(); i++) {
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
fileBuffer.append(" EFI_STATUS Status;\r\n");
|
fileBuffer.append(" EFI_STATUS Status;\r\n");
|
||||||
|
fileBuffer.append(" Status = EFI_SUCCESS;\r\n");
|
||||||
fileBuffer.append("\r\n");
|
fileBuffer.append("\r\n");
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
}
|
}
|
||||||
@@ -1845,7 +1970,7 @@ public class AutoGen {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fileBuffer.append("VOID\r\n");
|
fileBuffer.append("VOID\r\n");
|
||||||
fileBuffer.append("EFIAPI\n");
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
fileBuffer.append(setVirtualList[i]);
|
fileBuffer.append(setVirtualList[i]);
|
||||||
fileBuffer.append(" (\r\n");
|
fileBuffer.append(" (\r\n");
|
||||||
fileBuffer.append(" IN EFI_EVENT Event,\r\n");
|
fileBuffer.append(" IN EFI_EVENT Event,\r\n");
|
||||||
@@ -1871,8 +1996,13 @@ public class AutoGen {
|
|||||||
|
|
||||||
fileBuffer.append(setVirtualList[i]);
|
fileBuffer.append(setVirtualList[i]);
|
||||||
}
|
}
|
||||||
if (Count == 0) {
|
//
|
||||||
fileBuffer.append("\r\n NULL");
|
// If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER
|
||||||
|
// UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of
|
||||||
|
// _gDriverSetVirtualAddressMapEvent list.
|
||||||
|
//
|
||||||
|
if (!UefiOrDxeModule) {
|
||||||
|
fileBuffer.append(",\r\n NULL");
|
||||||
}
|
}
|
||||||
fileBuffer.append("\r\n};\r\n\r\n");
|
fileBuffer.append("\r\n};\r\n\r\n");
|
||||||
}
|
}
|
||||||
@@ -1923,7 +2053,7 @@ public class AutoGen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fileBuffer.append("VOID\r\n");
|
fileBuffer.append("VOID\r\n");
|
||||||
fileBuffer.append("EFIAPI\n");
|
fileBuffer.append("EFIAPI\r\n");
|
||||||
fileBuffer.append(exitBootList[i]);
|
fileBuffer.append(exitBootList[i]);
|
||||||
fileBuffer.append(" (\r\n");
|
fileBuffer.append(" (\r\n");
|
||||||
fileBuffer.append(" IN EFI_EVENT Event,\r\n");
|
fileBuffer.append(" IN EFI_EVENT Event,\r\n");
|
||||||
@@ -1948,8 +2078,8 @@ public class AutoGen {
|
|||||||
}
|
}
|
||||||
fileBuffer.append(exitBootList[i]);
|
fileBuffer.append(exitBootList[i]);
|
||||||
}
|
}
|
||||||
if (Count == 0) {
|
if (!UefiOrDxeModule) {
|
||||||
fileBuffer.append("\r\n NULL");
|
fileBuffer.append(",\r\n NULL");
|
||||||
}
|
}
|
||||||
fileBuffer.append("\r\n};\r\n\r\n");
|
fileBuffer.append("\r\n};\r\n\r\n");
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,10 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.build.autogen;
|
package org.tianocore.build.autogen;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
CommonDefinition
|
CommonDefinition
|
||||||
|
|
||||||
@@ -149,7 +153,7 @@ public class CommonDefinition {
|
|||||||
new MyEnum("PEI_CORE", ModuleTypePeiCore),
|
new MyEnum("PEI_CORE", ModuleTypePeiCore),
|
||||||
new MyEnum("PEIM", ModuleTypePeim),
|
new MyEnum("PEIM", ModuleTypePeim),
|
||||||
new MyEnum("DXE_CORE", ModuleTypeDxeCore),
|
new MyEnum("DXE_CORE", ModuleTypeDxeCore),
|
||||||
new MyEnum("DXE_DRIVER", ModuleTypeDxeRuntimeDriver),
|
new MyEnum("DXE_DRIVER", ModuleTypeDxeDriver),
|
||||||
new MyEnum("DXE_RUNTIME_DRIVER", ModuleTypeDxeRuntimeDriver),
|
new MyEnum("DXE_RUNTIME_DRIVER", ModuleTypeDxeRuntimeDriver),
|
||||||
new MyEnum("DXE_SAL_DRIVER", ModuleTypeDxeSalDriver),
|
new MyEnum("DXE_SAL_DRIVER", ModuleTypeDxeSalDriver),
|
||||||
new MyEnum("DXE_SMM_DRIVER", ModuleTypeDxeSmmDriver),
|
new MyEnum("DXE_SMM_DRIVER", ModuleTypeDxeSmmDriver),
|
||||||
@@ -315,4 +319,32 @@ public class CommonDefinition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove deuplicat string in list
|
||||||
|
*
|
||||||
|
* This function is to duplicat string in list
|
||||||
|
*
|
||||||
|
* @param String[]
|
||||||
|
* String list.
|
||||||
|
* @return String[] String list which remove the duplicate string.
|
||||||
|
*/
|
||||||
|
public static String[] remDupString (String[] orgList){
|
||||||
|
Set<String> strList = new HashSet<String>();
|
||||||
|
String[] desList ;
|
||||||
|
if (orgList == null){
|
||||||
|
return new String[0];
|
||||||
|
}
|
||||||
|
for (int i = 0; i < orgList.length; i++){
|
||||||
|
strList.add(orgList[i]);
|
||||||
|
}
|
||||||
|
desList = new String[strList.size()];
|
||||||
|
Iterator item = strList.iterator();
|
||||||
|
int index = 0;
|
||||||
|
while (item.hasNext()){
|
||||||
|
desList[index] = (String)item.next();
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
return desList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.build.exception;
|
package org.tianocore.build.exception;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.exception.EdkException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The class handle the exception throwed by entity class.
|
The class handle the exception throwed by entity class.
|
||||||
@@ -35,6 +35,6 @@ public class GenBuildException extends EdkException {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
public GenBuildException(Exception e, String message){
|
public GenBuildException(Exception e, String message){
|
||||||
// super(e, message);
|
super(e, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.build.exception;
|
package org.tianocore.build.exception;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.exception.EdkException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The class handle the exception throwed by entity class.
|
The class handle the exception throwed by entity class.
|
||||||
@@ -36,6 +36,6 @@ public class TianoToolsException extends EdkException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TianoToolsException (Exception e, String message){
|
public TianoToolsException (Exception e, String message){
|
||||||
// super(e, message);
|
super(e, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,16 +33,19 @@ import org.apache.tools.ant.taskdefs.Ant;
|
|||||||
import org.apache.tools.ant.taskdefs.Property;
|
import org.apache.tools.ant.taskdefs.Property;
|
||||||
import org.apache.xmlbeans.XmlObject;
|
import org.apache.xmlbeans.XmlObject;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
import org.tianocore.build.global.OutputManager;
|
import org.tianocore.build.global.OutputManager;
|
||||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
import org.tianocore.build.id.FpdModuleIdentification;
|
import org.tianocore.build.id.FpdModuleIdentification;
|
||||||
import org.tianocore.build.id.ModuleIdentification;
|
import org.tianocore.build.id.ModuleIdentification;
|
||||||
import org.tianocore.build.id.PlatformIdentification;
|
import org.tianocore.build.id.PlatformIdentification;
|
||||||
|
import org.tianocore.build.pcd.action.ActionMessage;
|
||||||
|
import org.tianocore.build.pcd.action.CollectPCDAction;
|
||||||
|
import org.tianocore.build.pcd.exception.EntityException;
|
||||||
import org.tianocore.build.toolchain.ToolChainAttribute;
|
import org.tianocore.build.toolchain.ToolChainAttribute;
|
||||||
import org.tianocore.build.toolchain.ToolChainElement;
|
import org.tianocore.build.toolchain.ToolChainElement;
|
||||||
import org.tianocore.build.toolchain.ToolChainMap;
|
import org.tianocore.build.toolchain.ToolChainMap;
|
||||||
|
import org.tianocore.exception.EdkException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<code>FpdParserTask</code> is an ANT task. The main function is parsing Framework
|
<code>FpdParserTask</code> is an ANT task. The main function is parsing Framework
|
||||||
@@ -145,6 +148,18 @@ public class FpdParserTask extends Task {
|
|||||||
//
|
//
|
||||||
parseFpdFile();
|
parseFpdFile();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Pcd Collection. Call CollectPCDAction to collect pcd info.
|
||||||
|
//
|
||||||
|
try {
|
||||||
|
System.out.println("Begin PCD collecttion!");
|
||||||
|
CollectPCDAction ca = new CollectPCDAction();
|
||||||
|
ca.perform(GlobalData.getWorkspacePath(),platformId.getFpdFile().getPath(),ActionMessage.NULL_MESSAGE_LEVEL);
|
||||||
|
System.out.println("End PCD collection!");
|
||||||
|
} catch (Exception e){
|
||||||
|
throw new BuildException(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare BUILD_DIR
|
// Prepare BUILD_DIR
|
||||||
//
|
//
|
||||||
@@ -187,6 +202,7 @@ public class FpdParserTask extends Task {
|
|||||||
//
|
//
|
||||||
// Ant call ${PLATFORM}_build.xml
|
// Ant call ${PLATFORM}_build.xml
|
||||||
//
|
//
|
||||||
|
|
||||||
Ant ant = new Ant();
|
Ant ant = new Ant();
|
||||||
ant.setProject(getProject());
|
ant.setProject(getProject());
|
||||||
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");
|
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");
|
||||||
@@ -391,7 +407,7 @@ public class FpdParserTask extends Task {
|
|||||||
**/
|
**/
|
||||||
private void parseModuleSAFiles() throws EdkException{
|
private void parseModuleSAFiles() throws EdkException{
|
||||||
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();
|
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();
|
||||||
System.out.println("Nubmer: ##" + moduleSAs.size());
|
|
||||||
//
|
//
|
||||||
// For every Module lists in FPD file.
|
// For every Module lists in FPD file.
|
||||||
//
|
//
|
||||||
|
@@ -21,20 +21,21 @@ import org.apache.xmlbeans.XmlObject;
|
|||||||
import org.tianocore.DbPathAndFilename;
|
import org.tianocore.DbPathAndFilename;
|
||||||
import org.tianocore.FrameworkDatabaseDocument;
|
import org.tianocore.FrameworkDatabaseDocument;
|
||||||
import org.tianocore.ModuleSurfaceAreaDocument;
|
import org.tianocore.ModuleSurfaceAreaDocument;
|
||||||
|
import org.tianocore.PcdBuildDefinitionDocument;
|
||||||
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
|
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
|
||||||
import org.tianocore.build.exception.EdkException;
|
|
||||||
import org.tianocore.build.id.FpdModuleIdentification;
|
import org.tianocore.build.id.FpdModuleIdentification;
|
||||||
import org.tianocore.build.id.ModuleIdentification;
|
import org.tianocore.build.id.ModuleIdentification;
|
||||||
import org.tianocore.build.id.PackageIdentification;
|
import org.tianocore.build.id.PackageIdentification;
|
||||||
import org.tianocore.build.id.PlatformIdentification;
|
import org.tianocore.build.id.PlatformIdentification;
|
||||||
|
import org.tianocore.build.pcd.entity.MemoryDatabaseManager;
|
||||||
import org.tianocore.build.toolchain.ToolChainAttribute;
|
import org.tianocore.build.toolchain.ToolChainAttribute;
|
||||||
import org.tianocore.build.toolchain.ToolChainConfig;
|
import org.tianocore.build.toolchain.ToolChainConfig;
|
||||||
import org.tianocore.build.toolchain.ToolChainElement;
|
import org.tianocore.build.toolchain.ToolChainElement;
|
||||||
import org.tianocore.build.toolchain.ToolChainInfo;
|
import org.tianocore.build.toolchain.ToolChainInfo;
|
||||||
import org.tianocore.build.toolchain.ToolChainKey;
|
import org.tianocore.build.toolchain.ToolChainKey;
|
||||||
import org.tianocore.build.toolchain.ToolChainMap;
|
import org.tianocore.build.toolchain.ToolChainMap;
|
||||||
//import org.tianocore.build.pcd.entity.MemoryDatabaseManager;
|
import org.tianocore.exception.EdkException;
|
||||||
//import org.tianocore.logger.EdkLog;
|
import org.tianocore.logger.EdkLog;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -130,7 +131,7 @@ public class GlobalData {
|
|||||||
private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainOption = new HashMap<FpdModuleIdentification, ToolChainMap>();
|
private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainOption = new HashMap<FpdModuleIdentification, ToolChainMap>();
|
||||||
private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainFamilyOption = new HashMap<FpdModuleIdentification, ToolChainMap>();
|
private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainFamilyOption = new HashMap<FpdModuleIdentification, ToolChainMap>();
|
||||||
|
|
||||||
// private static final MemoryDatabasseManager pcdDbManager = new MemoryDatabaseManager();
|
private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -341,7 +342,7 @@ public class GlobalData {
|
|||||||
//
|
//
|
||||||
// First part: get the MSA files info
|
// First part: get the MSA files info
|
||||||
//
|
//
|
||||||
doc = getNativeMsa(moduleId);
|
doc.putAll(getNativeMsa(moduleId));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Second part: put build options
|
// Second part: put build options
|
||||||
@@ -413,6 +414,7 @@ public class GlobalData {
|
|||||||
msaMap.put("PPIs", cloneXmlObject(msa.getPPIs(), true));
|
msaMap.put("PPIs", cloneXmlObject(msa.getPPIs(), true));
|
||||||
msaMap.put("Guids", cloneXmlObject(msa.getGuids(), true));
|
msaMap.put("Guids", cloneXmlObject(msa.getGuids(), true));
|
||||||
msaMap.put("Externs", cloneXmlObject(msa.getExterns(), true));
|
msaMap.put("Externs", cloneXmlObject(msa.getExterns(), true));
|
||||||
|
msaMap.put("PcdCoded", cloneXmlObject(msa.getPcdCoded(), true));
|
||||||
return msaMap;
|
return msaMap;
|
||||||
}
|
}
|
||||||
catch (Exception ex){
|
catch (Exception ex){
|
||||||
@@ -507,15 +509,16 @@ public class GlobalData {
|
|||||||
/**
|
/**
|
||||||
* return two values: {cName, GuidValue}
|
* return two values: {cName, GuidValue}
|
||||||
*/
|
*/
|
||||||
public static String[] getGuid(PackageIdentification[] packages, String name)
|
public static String[] getGuid(List<PackageIdentification> packages, String name)
|
||||||
throws BuildException {
|
throws BuildException {
|
||||||
if (packages == null) {
|
if (packages == null) {
|
||||||
// throw Exception or not????
|
// throw Exception or not????
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
String[] result = null;
|
String[] result = null;
|
||||||
for (int i = 0; i < packages.length; i++) {
|
Iterator item = packages.iterator();
|
||||||
Spd spd = spdTable.get(packages[i]);
|
while (item.hasNext()){
|
||||||
|
Spd spd = spdTable.get(item.next());
|
||||||
//
|
//
|
||||||
// If find one package defined the GUID
|
// If find one package defined the GUID
|
||||||
//
|
//
|
||||||
@@ -523,20 +526,22 @@ public class GlobalData {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return two values: {cName, GuidValue}
|
* return two values: {cName, GuidValue}
|
||||||
*/
|
*/
|
||||||
public static String[] getPpiGuid(PackageIdentification[] packages,
|
public static String[] getPpiGuid(List<PackageIdentification> packages,
|
||||||
String name) throws BuildException {
|
String name) throws BuildException {
|
||||||
if (packages == null) {
|
if (packages == null) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
String[] result = null;
|
String[] result = null;
|
||||||
for (int i = 0; i < packages.length; i++) {
|
Iterator item = packages.iterator();
|
||||||
Spd spd = spdTable.get(packages[i]);
|
while (item.hasNext()){
|
||||||
|
Spd spd = spdTable.get(item.next());
|
||||||
//
|
//
|
||||||
// If find one package defined the Ppi GUID
|
// If find one package defined the Ppi GUID
|
||||||
//
|
//
|
||||||
@@ -551,14 +556,15 @@ public class GlobalData {
|
|||||||
/**
|
/**
|
||||||
* return two values: {cName, GuidValue}
|
* return two values: {cName, GuidValue}
|
||||||
*/
|
*/
|
||||||
public static String[] getProtocolGuid(PackageIdentification[] packages,
|
public static String[] getProtocolGuid(List<PackageIdentification> packages,
|
||||||
String name) throws BuildException {
|
String name) throws BuildException {
|
||||||
if (packages == null) {
|
if (packages == null) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
String[] result = null;
|
String[] result = null;
|
||||||
for (int i = 0; i < packages.length; i++) {
|
Iterator item = packages.iterator();
|
||||||
Spd spd = spdTable.get(packages[i]);
|
while (item.hasNext()){
|
||||||
|
Spd spd = spdTable.get(item.next());
|
||||||
//
|
//
|
||||||
// If find one package defined the protocol GUID
|
// If find one package defined the protocol GUID
|
||||||
//
|
//
|
||||||
@@ -750,52 +756,61 @@ public class GlobalData {
|
|||||||
//
|
//
|
||||||
// for PCD
|
// for PCD
|
||||||
//
|
//
|
||||||
// public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {
|
public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {
|
||||||
// return pcdDbManager;
|
return pcdDbManager;
|
||||||
// }
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// For PCD
|
// For PCD get tokenSpaceGUid
|
||||||
//
|
//
|
||||||
/**
|
public synchronized static String[] getGuidInfoFromCname(String cName){
|
||||||
*
|
String cNameGuid[] = null;
|
||||||
* @param guidName
|
String guid = null;
|
||||||
* @return
|
Set set = spdTable.keySet();
|
||||||
*/
|
Iterator iter = set.iterator();
|
||||||
// public synchronized static String[] getGuidInfoGuid(String guidName) {
|
|
||||||
// String[] cNameGuid = null;
|
while (iter.hasNext()){
|
||||||
// Set set = spdTable.keySet();
|
Spd spd = (Spd) spdTable.get(iter.next());
|
||||||
// Iterator iter = set.iterator();
|
guid = spd.getGuidFromCname(cName);
|
||||||
//
|
if (guid != null){
|
||||||
// while (iter.hasNext()) {
|
cNameGuid[0] = new String(cName);
|
||||||
// Spd spd = (Spd) spdTable.get(iter.next());
|
cNameGuid[1] = new String(guid);
|
||||||
// cNameGuid = spd.getGuidNameArray(guidName);
|
break;
|
||||||
// if (cNameGuid != null) {
|
}
|
||||||
// break;
|
}
|
||||||
// }
|
return cNameGuid;
|
||||||
// }
|
}
|
||||||
// return cNameGuid;
|
|
||||||
// }
|
//
|
||||||
|
// For PCD
|
||||||
//
|
//
|
||||||
// For PCD
|
public synchronized static Map<FpdModuleIdentification, XmlObject> getFpdModuleSaXmlObject(
|
||||||
//
|
String xmlObjectName) {
|
||||||
// public synchronized static Map<FpdModuleIdentification, XmlObject> getFpdModuleSaXmlObject(
|
Set<FpdModuleIdentification> fpdModuleSASet = fpdModuleSA.keySet();
|
||||||
// String xmlObjectName) {
|
Iterator item = fpdModuleSASet.iterator();
|
||||||
// Set<FpdModuleIdentification> fpdModuleSASet = fpdModuleSA.keySet();
|
|
||||||
// Iterator item = fpdModuleSASet.iterator();
|
|
||||||
//
|
Map<FpdModuleIdentification, XmlObject> SAPcdBuildDef = new HashMap<FpdModuleIdentification, XmlObject>();
|
||||||
// Map<FpdModuleIdentification, XmlObject> SAPcdBuildDef = new HashMap<FpdModuleIdentification, XmlObject>();
|
Map<String, XmlObject> SANode = new HashMap<String, XmlObject>();
|
||||||
// Map<String, XmlObject> SANode = new HashMap<String, XmlObject>();
|
FpdModuleIdentification moduleId;
|
||||||
// FpdModuleIdentification moduleId;
|
while (item.hasNext()) {
|
||||||
// while (item.hasNext()) {
|
|
||||||
// moduleId = (FpdModuleIdentification) item.next();
|
moduleId = (FpdModuleIdentification) item.next();
|
||||||
// SANode = fpdModuleSA.get(item.next());
|
SANode = fpdModuleSA.get(moduleId);
|
||||||
// SAPcdBuildDef.put(moduleId,
|
try{
|
||||||
// (PcdBuildDefinitionDocument.PcdBuildDefinition) SANode
|
if (SANode.get(xmlObjectName)!= null){
|
||||||
// .get(xmlObjectName));
|
SAPcdBuildDef.put(moduleId,
|
||||||
// }
|
(XmlObject) SANode
|
||||||
// return SAPcdBuildDef;
|
.get(xmlObjectName));
|
||||||
// }
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e){
|
||||||
|
EdkLog.log(EdkLog.EDK_INFO, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SAPcdBuildDef;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -66,6 +66,12 @@ public class Spd {
|
|||||||
Map<String, String[]> guidInfo = new HashMap<String, String[]>();
|
Map<String, String[]> guidInfo = new HashMap<String, String[]>();
|
||||||
|
|
||||||
///
|
///
|
||||||
|
/// Map of Guid info
|
||||||
|
/// Key: GuidCName
|
||||||
|
/// value: String Guid's GUID
|
||||||
|
///
|
||||||
|
Map<String, String> guidCnameInfo = new HashMap<String, String>();
|
||||||
|
|
||||||
/// Map of library class and its exposed header file.
|
/// Map of library class and its exposed header file.
|
||||||
/// Key : library class name
|
/// Key : library class name
|
||||||
/// value : library class corresponding header file
|
/// value : library class corresponding header file
|
||||||
@@ -140,7 +146,7 @@ public class Spd {
|
|||||||
// Change path seperator to system-dependent path separator
|
// Change path seperator to system-dependent path separator
|
||||||
//
|
//
|
||||||
File file = new File (header);
|
File file = new File (header);
|
||||||
header = file.getParent();
|
header = file.getPath();
|
||||||
packageHeaderInfo.put(moduleType, header);
|
packageHeaderInfo.put(moduleType, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +155,17 @@ public class Spd {
|
|||||||
//
|
//
|
||||||
guidInfo.putAll(SurfaceAreaQuery.getSpdGuid());
|
guidInfo.putAll(SurfaceAreaQuery.getSpdGuid());
|
||||||
|
|
||||||
|
//
|
||||||
|
// For Pcd get TokenSpaceGuid
|
||||||
|
//
|
||||||
|
Set<String> key = guidInfo.keySet();
|
||||||
|
Iterator item = key.iterator();
|
||||||
|
String [] nameValue = new String[2];
|
||||||
|
while(item.hasNext()){
|
||||||
|
nameValue = guidInfo.get(item.next());
|
||||||
|
guidCnameInfo.put(nameValue[0], nameValue[1]);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// initialize PPI info
|
// initialize PPI info
|
||||||
//
|
//
|
||||||
@@ -220,6 +237,13 @@ public class Spd {
|
|||||||
return guidInfo.get(guidName);
|
return guidInfo.get(guidName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return Guid Value.
|
||||||
|
*/
|
||||||
|
public String getGuidFromCname(String cName){
|
||||||
|
return guidCnameInfo.get(cName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
getLibClassInclude
|
getLibClassInclude
|
||||||
|
|
||||||
@@ -246,17 +270,5 @@ public class Spd {
|
|||||||
return packageHeaderInfo.get(moduleType);
|
return packageHeaderInfo.get(moduleType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
getGuidNameArray
|
|
||||||
|
|
||||||
This function is to get the GUID's CName and it's GUID according to
|
|
||||||
GUID's name
|
|
||||||
|
|
||||||
@param guidName Name of GUID
|
|
||||||
@return CName and GUID.
|
|
||||||
**/
|
|
||||||
public String[] getGuidNameArray(String guidName) {
|
|
||||||
return this.guidInfo.get(guidName);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -27,6 +27,7 @@ import org.apache.xmlbeans.XmlNormalizedString;
|
|||||||
import org.apache.xmlbeans.XmlObject;
|
import org.apache.xmlbeans.XmlObject;
|
||||||
import org.apache.xmlbeans.XmlString;
|
import org.apache.xmlbeans.XmlString;
|
||||||
import org.tianocore.BuildOptionsDocument;
|
import org.tianocore.BuildOptionsDocument;
|
||||||
|
import org.tianocore.CNameType;
|
||||||
import org.tianocore.DataIdDocument;
|
import org.tianocore.DataIdDocument;
|
||||||
import org.tianocore.ExternsDocument;
|
import org.tianocore.ExternsDocument;
|
||||||
import org.tianocore.FileNameConvention;
|
import org.tianocore.FileNameConvention;
|
||||||
@@ -48,9 +49,11 @@ import org.tianocore.OptionDocument;
|
|||||||
import org.tianocore.PPIsDocument;
|
import org.tianocore.PPIsDocument;
|
||||||
import org.tianocore.PackageDependenciesDocument;
|
import org.tianocore.PackageDependenciesDocument;
|
||||||
import org.tianocore.PackageHeadersDocument;
|
import org.tianocore.PackageHeadersDocument;
|
||||||
|
import org.tianocore.PcdCodedDocument;
|
||||||
import org.tianocore.PlatformDefinitionsDocument;
|
import org.tianocore.PlatformDefinitionsDocument;
|
||||||
import org.tianocore.PpiDeclarationsDocument;
|
import org.tianocore.PpiDeclarationsDocument;
|
||||||
import org.tianocore.ProtocolDeclarationsDocument;
|
import org.tianocore.ProtocolDeclarationsDocument;
|
||||||
|
import org.tianocore.Sentence;
|
||||||
import org.tianocore.SpdHeaderDocument;
|
import org.tianocore.SpdHeaderDocument;
|
||||||
import org.tianocore.SupportedArchitectures;
|
import org.tianocore.SupportedArchitectures;
|
||||||
import org.tianocore.FilenameDocument.Filename;
|
import org.tianocore.FilenameDocument.Filename;
|
||||||
@@ -63,6 +66,7 @@ import org.tianocore.build.id.ModuleIdentification;
|
|||||||
import org.tianocore.build.id.PackageIdentification;
|
import org.tianocore.build.id.PackageIdentification;
|
||||||
import org.tianocore.build.id.PlatformIdentification;
|
import org.tianocore.build.id.PlatformIdentification;
|
||||||
import org.tianocore.build.toolchain.ToolChainInfo;
|
import org.tianocore.build.toolchain.ToolChainInfo;
|
||||||
|
import org.tianocore.logger.EdkLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SurfaceAreaQuery class is used to query Surface Area information from msa,
|
* SurfaceAreaQuery class is used to query Surface Area information from msa,
|
||||||
@@ -624,8 +628,7 @@ public class SurfaceAreaQuery {
|
|||||||
String[] entryPoints = new String[returns.length];
|
String[] entryPoints = new String[returns.length];
|
||||||
|
|
||||||
for (int i = 0; i < returns.length; ++i) {
|
for (int i = 0; i < returns.length; ++i) {
|
||||||
entryPoints[i] = ((XmlNormalizedString) returns[i])
|
entryPoints[i] = ((CNameType) returns[i]).getStringValue();
|
||||||
.getStringValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return entryPoints;
|
return entryPoints;
|
||||||
@@ -689,7 +692,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
xPath = new String[] { "/Protocol[@SupArchList='" + arch + "']" };
|
xPath = new String[] { "/Protocol" };
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] returns = get("Protocols", xPath);
|
Object[] returns = get("Protocols", xPath);
|
||||||
@@ -700,8 +703,11 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
String[] protocolArray = new String[returns.length];
|
String[] protocolArray = new String[returns.length];
|
||||||
for (int i = 0; i < returns.length; i++) {
|
for (int i = 0; i < returns.length; i++) {
|
||||||
|
List<String> archList = protocolList[i].getSupArchList();
|
||||||
|
if (archList == null || archList.contains(arch)){
|
||||||
protocolArray[i] = protocolList[i].getProtocolCName();
|
protocolArray[i] = protocolList[i].getProtocolCName();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return protocolArray;
|
return protocolArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,8 +726,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
xPath = new String[] { "/ProtocolNotify[@SupArchList='" + arch
|
xPath = new String[] { "/ProtocolNotify" };
|
||||||
+ "']" };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] returns = get("Protocols", xPath);
|
Object[] returns = get("Protocols", xPath);
|
||||||
@@ -731,9 +736,13 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
String[] protocolNotifyList = new String[returns.length];
|
String[] protocolNotifyList = new String[returns.length];
|
||||||
for (int i = 0; i < returns.length; i++) {
|
for (int i = 0; i < returns.length; i++) {
|
||||||
|
List<String> archList = ((ProtocolNotify) returns[i]).getSupArchList();
|
||||||
|
if (archList == null || archList.contains(arch)){
|
||||||
protocolNotifyList[i] = ((ProtocolNotify) returns[i]).getProtocolNotifyCName();
|
protocolNotifyList[i] = ((ProtocolNotify) returns[i]).getProtocolNotifyCName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return protocolNotifyList;
|
return protocolNotifyList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,7 +799,7 @@ public class SurfaceAreaQuery {
|
|||||||
Object[] returns = get("Externs", xPath);
|
Object[] returns = get("Externs", xPath);
|
||||||
if (returns != null && returns.length > 0) {
|
if (returns != null && returns.length > 0) {
|
||||||
String[] stringArray = new String[returns.length];
|
String[] stringArray = new String[returns.length];
|
||||||
XmlNormalizedString[] doc = (XmlNormalizedString[]) returns;
|
CNameType[] doc = (CNameType[]) returns;
|
||||||
|
|
||||||
for (int i = 0; i < returns.length; ++i) {
|
for (int i = 0; i < returns.length; ++i) {
|
||||||
stringArray[i] = doc[i].getStringValue();
|
stringArray[i] = doc[i].getStringValue();
|
||||||
@@ -834,7 +843,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
xPath = new String[] { "/PpiNotify[@SupArchList='" + arch + "']" };
|
xPath = new String[] { "/PpiNotify" };
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] returns = get("PPIs", xPath);
|
Object[] returns = get("PPIs", xPath);
|
||||||
@@ -844,9 +853,13 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
String[] ppiNotifyList = new String[returns.length];
|
String[] ppiNotifyList = new String[returns.length];
|
||||||
for (int i = 0; i < returns.length; i++) {
|
for (int i = 0; i < returns.length; i++) {
|
||||||
|
List<String> archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList();
|
||||||
|
if (archList == null || archList.contains(arch)){
|
||||||
ppiNotifyList[i] = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName();
|
ppiNotifyList[i] = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ppiNotifyList;
|
return ppiNotifyList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -869,7 +882,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
archXpath = "/PpiNotify[@SupArchList='" + arch + "']";
|
archXpath = "/PpiNotify";
|
||||||
if (usage != null && !usage.equals("")) {
|
if (usage != null && !usage.equals("")) {
|
||||||
usageXpath = "/PpiNotify[@Usage='" + arch + "']";
|
usageXpath = "/PpiNotify[@Usage='" + arch + "']";
|
||||||
xPath = new String[] { archXpath, usageXpath };
|
xPath = new String[] { archXpath, usageXpath };
|
||||||
@@ -906,7 +919,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
xPath = new String[] { "/Ppi[@SupArchList='" + arch + "']" };
|
xPath = new String[] { "/Ppi" };
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] returns = get("PPIs", xPath);
|
Object[] returns = get("PPIs", xPath);
|
||||||
@@ -916,8 +929,12 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
String[] ppiList = new String[returns.length];
|
String[] ppiList = new String[returns.length];
|
||||||
for (int i = 0; i < returns.length; i++) {
|
for (int i = 0; i < returns.length; i++) {
|
||||||
|
List<String> archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList();
|
||||||
|
if (archList == null || archList.contains(arch)){
|
||||||
ppiList[i] = ((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName();
|
ppiList[i] = ((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return ppiList;
|
return ppiList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -940,7 +957,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
archXpath = "/Ppi[@SupArchList='" + arch + "']";
|
archXpath = "/Ppi";
|
||||||
if (usage != null && !usage.equals("")) {
|
if (usage != null && !usage.equals("")) {
|
||||||
usageXpath = "/Ppi[@Usage='" + arch + "']";
|
usageXpath = "/Ppi[@Usage='" + arch + "']";
|
||||||
xPath = new String[] { archXpath, usageXpath };
|
xPath = new String[] { archXpath, usageXpath };
|
||||||
@@ -975,9 +992,9 @@ public class SurfaceAreaQuery {
|
|||||||
String[] xPath;
|
String[] xPath;
|
||||||
|
|
||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
xPath = new String[] { "/GuidName" };
|
xPath = new String[] { "/GuidCNames" };
|
||||||
} else {
|
} else {
|
||||||
xPath = new String[] { "/GuidName[@SupArchList='" + arch + "']" };
|
xPath = new String[] { "/GuidCNames" };
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] returns = get("Guids", xPath);
|
Object[] returns = get("Guids", xPath);
|
||||||
@@ -986,8 +1003,12 @@ public class SurfaceAreaQuery {
|
|||||||
}
|
}
|
||||||
String[] guidList = new String[returns.length];
|
String[] guidList = new String[returns.length];
|
||||||
for (int i = 0; i < returns.length; i++) {
|
for (int i = 0; i < returns.length; i++) {
|
||||||
|
List<String> archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList();
|
||||||
|
if (archList == null || archList.contains(arch)){
|
||||||
guidList[i] = ((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName();
|
guidList[i] = ((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return guidList;
|
return guidList;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1009,7 +1030,7 @@ public class SurfaceAreaQuery {
|
|||||||
if (arch == null || arch.equals("")) {
|
if (arch == null || arch.equals("")) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
archXpath = "/GuidEntry[@SupArchList='" + arch + "']";
|
archXpath = "/GuidEntry";
|
||||||
if (usage != null && !usage.equals("")) {
|
if (usage != null && !usage.equals("")) {
|
||||||
usageXpath = "/GuidEntry[@Usage='" + arch + "']";
|
usageXpath = "/GuidEntry[@Usage='" + arch + "']";
|
||||||
xPath = new String[] { archXpath, usageXpath };
|
xPath = new String[] { archXpath, usageXpath };
|
||||||
@@ -1096,7 +1117,7 @@ public class SurfaceAreaQuery {
|
|||||||
String[] strings = new String[returns.length];
|
String[] strings = new String[returns.length];
|
||||||
for (int i = 0; i < returns.length; ++i) {
|
for (int i = 0; i < returns.length; ++i) {
|
||||||
// TBD
|
// TBD
|
||||||
// strings[i] = ((CName) returns[i]).getStringValue();
|
strings[i] = ((CNameType) returns[i]).getStringValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings;
|
return strings;
|
||||||
@@ -1113,8 +1134,8 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
Object[] returns = get("Externs", xPath);
|
Object[] returns = get("Externs", xPath);
|
||||||
if (returns != null && returns.length > 0) {
|
if (returns != null && returns.length > 0) {
|
||||||
// CName constructor = (CName) returns[0];
|
CNameType constructor = ((CNameType) returns[0]);
|
||||||
// return constructor.getStringValue();
|
return constructor.getStringValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -1131,8 +1152,11 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
Object[] returns = get("Externs", xPath);
|
Object[] returns = get("Externs", xPath);
|
||||||
if (returns != null && returns.length > 0) {
|
if (returns != null && returns.length > 0) {
|
||||||
// CName destructor = (CName) returns[0];
|
//
|
||||||
// return destructor.getStringValue();
|
// Only support one Destructor function.
|
||||||
|
//
|
||||||
|
CNameType destructor = (CNameType) returns[0];
|
||||||
|
return destructor.getStringValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -1646,9 +1670,8 @@ public class SurfaceAreaQuery {
|
|||||||
|
|
||||||
String[] specificationList = new String[queryResult.length];
|
String[] specificationList = new String[queryResult.length];
|
||||||
for (int i = 0; i < queryResult.length; i++) {
|
for (int i = 0; i < queryResult.length; i++) {
|
||||||
// specificationList[i] = ((SpecificationDocument.Specification)
|
specificationList[i] = ((Sentence)queryResult[i])
|
||||||
// queryResult[i])
|
.getStringValue();
|
||||||
// .getStringValue();
|
|
||||||
}
|
}
|
||||||
return specificationList;
|
return specificationList;
|
||||||
}
|
}
|
||||||
@@ -1765,6 +1788,9 @@ public class SurfaceAreaQuery {
|
|||||||
guidPair[0] = entry.getCName();
|
guidPair[0] = entry.getCName();
|
||||||
guidPair[1] = entry.getGuidValue();
|
guidPair[1] = entry.getGuidValue();
|
||||||
guidDeclMap.put(entry.getName(), guidPair);
|
guidDeclMap.put(entry.getName(), guidPair);
|
||||||
|
EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());
|
||||||
|
EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[0]);
|
||||||
|
EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[1]);
|
||||||
}
|
}
|
||||||
return guidDeclMap;
|
return guidDeclMap;
|
||||||
}
|
}
|
||||||
@@ -1793,6 +1819,9 @@ public class SurfaceAreaQuery {
|
|||||||
protocolPair[0] = entry.getCName();
|
protocolPair[0] = entry.getCName();
|
||||||
protocolPair[1] = entry.getGuidValue();
|
protocolPair[1] = entry.getGuidValue();
|
||||||
protoclMap.put(entry.getName(), protocolPair);
|
protoclMap.put(entry.getName(), protocolPair);
|
||||||
|
EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());
|
||||||
|
EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[0]);
|
||||||
|
EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[1]);
|
||||||
}
|
}
|
||||||
return protoclMap;
|
return protoclMap;
|
||||||
}
|
}
|
||||||
@@ -1885,4 +1914,29 @@ public class SurfaceAreaQuery {
|
|||||||
return new ModuleSADocument.ModuleSA[0];
|
return new ModuleSADocument.ModuleSA[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
Get name array of PCD in a module. In one module, token space
|
||||||
|
is same, and token name should not be conflicted.
|
||||||
|
|
||||||
|
@return String[]
|
||||||
|
**/
|
||||||
|
public static String[] getModulePcdEntryNameArray() {
|
||||||
|
PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null;
|
||||||
|
String[] results;
|
||||||
|
int index;
|
||||||
|
String[] xPath = new String[] {"/PcdEntry"};
|
||||||
|
Object[] returns = get ("PcdCoded", xPath);
|
||||||
|
|
||||||
|
if (returns == null) {
|
||||||
|
return new String[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns;
|
||||||
|
results = new String[pcdEntries.length];
|
||||||
|
|
||||||
|
for (index = 0; index < pcdEntries.length; index ++) {
|
||||||
|
results[index] = pcdEntries[index].getCName();
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,20 +23,36 @@ import java.io.FileReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
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.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.xmlbeans.XmlException;
|
import org.apache.xmlbeans.XmlException;
|
||||||
import org.apache.xmlbeans.XmlObject;
|
import org.apache.xmlbeans.XmlObject;
|
||||||
|
import org.tianocore.DynamicPcdBuildDefinitionsDocument;
|
||||||
import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;
|
import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;
|
||||||
|
import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData;
|
||||||
|
import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo;
|
||||||
import org.tianocore.FrameworkModulesDocument;
|
import org.tianocore.FrameworkModulesDocument;
|
||||||
import org.tianocore.FrameworkPlatformDescriptionDocument;
|
import org.tianocore.PcdDeclarationsDocument;
|
||||||
|
import org.tianocore.PlatformSurfaceAreaDocument;
|
||||||
|
import org.tianocore.PcdBuildDefinitionDocument;
|
||||||
|
import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
|
||||||
import org.tianocore.ModuleSADocument;
|
import org.tianocore.ModuleSADocument;
|
||||||
|
import org.tianocore.ModuleSADocument.ModuleSA;
|
||||||
|
import org.tianocore.PackageSurfaceAreaDocument;
|
||||||
import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;
|
import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;
|
||||||
|
import org.tianocore.build.autogen.CommonDefinition;
|
||||||
import org.tianocore.build.global.GlobalData;
|
import org.tianocore.build.global.GlobalData;
|
||||||
import org.tianocore.build.global.SurfaceAreaQuery;
|
import org.tianocore.build.global.SurfaceAreaQuery;
|
||||||
|
import org.tianocore.build.id.FpdModuleIdentification;
|
||||||
import org.tianocore.build.pcd.action.ActionMessage;
|
import org.tianocore.build.pcd.action.ActionMessage;
|
||||||
import org.tianocore.build.pcd.entity.DynamicTokenValue;
|
import org.tianocore.build.pcd.entity.DynamicTokenValue;
|
||||||
import org.tianocore.build.pcd.entity.MemoryDatabaseManager;
|
import org.tianocore.build.pcd.entity.MemoryDatabaseManager;
|
||||||
@@ -44,6 +60,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.logger.EdkLog;
|
||||||
import org.tianocore.ModuleTypeDef;
|
import org.tianocore.ModuleTypeDef;
|
||||||
|
|
||||||
class CStructTypeDeclaration {
|
class CStructTypeDeclaration {
|
||||||
@@ -407,6 +424,7 @@ class GuidTable {
|
|||||||
|
|
||||||
Output.add("/* GuidTable */");
|
Output.add("/* GuidTable */");
|
||||||
Output.add("{");
|
Output.add("{");
|
||||||
|
|
||||||
if (al.size() == 0) {
|
if (al.size() == 0) {
|
||||||
Output.add("\t" + getUuidCString(new UUID(0, 0)));
|
Output.add("\t" + getUuidCString(new UUID(0, 0)));
|
||||||
}
|
}
|
||||||
@@ -1824,12 +1842,25 @@ class PcdDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ModuleInfo {
|
class ModuleInfo {
|
||||||
public ModuleSADocument.ModuleSA module;
|
private String type;
|
||||||
public ModuleTypeDef.Enum type;
|
private FpdModuleIdentification moduleId;
|
||||||
|
private PcdBuildDefinitionDocument.PcdBuildDefinition pcdBuildDef;
|
||||||
|
|
||||||
public ModuleInfo (ModuleSADocument.ModuleSA module, ModuleTypeDef.Enum type) {
|
|
||||||
this.module = module;
|
|
||||||
|
public ModuleInfo (FpdModuleIdentification moduleId, String type, XmlObject pcdDef) {
|
||||||
|
this.moduleId = moduleId;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
this.pcdBuildDef = ((PcdBuildDefinitionDocument)pcdDef).getPcdBuildDefinition();
|
||||||
|
}
|
||||||
|
public String getModuleType (){
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
public FpdModuleIdentification getModuleId (){
|
||||||
|
return this.moduleId;
|
||||||
|
}
|
||||||
|
public PcdBuildDefinitionDocument.PcdBuildDefinition getPcdBuildDef(){
|
||||||
|
return this.pcdBuildDef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1851,7 +1882,10 @@ public class CollectPCDAction {
|
|||||||
private int originalMessageLevel;
|
private int originalMessageLevel;
|
||||||
|
|
||||||
/// Cache the fpd docment instance for private usage.
|
/// Cache the fpd docment instance for private usage.
|
||||||
private FrameworkPlatformDescriptionDocument fpdDocInstance;
|
private PlatformSurfaceAreaDocument fpdDocInstance;
|
||||||
|
|
||||||
|
/// xmlObject name
|
||||||
|
private static String xmlObjectName = "PcdBuildDefinition";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set WorkspacePath parameter for this action class.
|
Set WorkspacePath parameter for this action class.
|
||||||
@@ -1919,7 +1953,7 @@ public class CollectPCDAction {
|
|||||||
@throws EntityException Exception indicate failed to execute this action.
|
@throws EntityException Exception indicate failed to execute this action.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
private void execute() throws EntityException {
|
public void execute() throws EntityException {
|
||||||
//
|
//
|
||||||
// Get memoryDatabaseManager instance from GlobalData.
|
// Get memoryDatabaseManager instance from GlobalData.
|
||||||
// The memoryDatabaseManager should be initialized for whatever build
|
// The memoryDatabaseManager should be initialized for whatever build
|
||||||
@@ -1988,14 +2022,13 @@ public class CollectPCDAction {
|
|||||||
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;
|
|
||||||
FrameworkModulesDocument.FrameworkModules fModules = null;
|
FrameworkModulesDocument.FrameworkModules fModules = null;
|
||||||
ModuleSADocument.ModuleSA[] modules = null;
|
ModuleSADocument.ModuleSA[] modules = null;
|
||||||
HashMap<String, XmlObject> map = new HashMap<String, XmlObject>();
|
HashMap<String, XmlObject> map = new HashMap<String, XmlObject>();
|
||||||
|
|
||||||
if (fpdDocInstance == null) {
|
if (fpdDocInstance == null) {
|
||||||
try {
|
try {
|
||||||
fpdDocInstance = (FrameworkPlatformDescriptionDocument)XmlObject.Factory.parse(new File(fpdFilePath));
|
fpdDocInstance = (PlatformSurfaceAreaDocument)XmlObject.Factory.parse(new File(fpdFilePath));
|
||||||
} catch(IOException ioE) {
|
} catch(IOException ioE) {
|
||||||
throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());
|
throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());
|
||||||
} catch(XmlException xmlE) {
|
} catch(XmlException xmlE) {
|
||||||
@@ -2004,15 +2037,29 @@ public class CollectPCDAction {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("FrameworkPlatformDescription", fpdDocInstance);
|
//map.put("FrameworkPlatformDescription", fpdDocInstance);
|
||||||
SurfaceAreaQuery.setDoc(map);
|
//SurfaceAreaQuery.setDoc(map);
|
||||||
modules = SurfaceAreaQuery.getFpdModuleSAs();
|
Map<FpdModuleIdentification,XmlObject>pcdBuildDef = GlobalData.getFpdModuleSaXmlObject(CollectPCDAction.xmlObjectName);
|
||||||
for (index = 0; index < modules.length; index ++) {
|
Set<FpdModuleIdentification> pcdBuildKeySet = pcdBuildDef.keySet();
|
||||||
SurfaceAreaQuery.setDoc(GlobalData.getDoc(modules[index].getModuleName()));
|
Iterator item = pcdBuildKeySet.iterator();
|
||||||
allModules.add(new ModuleInfo(modules[index],
|
while (item.hasNext()){
|
||||||
ModuleTypeDef.Enum.forString(SurfaceAreaQuery.getModuleType())));
|
FpdModuleIdentification id = (FpdModuleIdentification)item.next();
|
||||||
|
try {
|
||||||
|
allModules.add(new ModuleInfo(id, id.getModule().getModuleType(),pcdBuildDef.get(id)));
|
||||||
|
} catch (Exception e){
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
//EdkLog.log(EdkLog.EDK_INFO,e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// //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;
|
return allModules;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2049,6 +2096,7 @@ public class CollectPCDAction {
|
|||||||
String moduleName = null;
|
String moduleName = null;
|
||||||
String datum = null;
|
String datum = null;
|
||||||
int maxDatumSize = 0;
|
int maxDatumSize = 0;
|
||||||
|
String tokenSpaceGuidString = null;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
@@ -2073,17 +2121,17 @@ public class CollectPCDAction {
|
|||||||
// BUGBUG: For transition schema, we can *not* get module's version from
|
// BUGBUG: For transition schema, we can *not* get module's version from
|
||||||
// <ModuleSAs>, It is work around code.
|
// <ModuleSAs>, It is work around code.
|
||||||
//
|
//
|
||||||
primaryKey1 = UsageInstance.getPrimaryKey(modules.get(index).module.getModuleName(),
|
primaryKey1 = UsageInstance.getPrimaryKey(modules.get(index).getModuleId().getModule().getName(),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
modules.get(index).module.getArch().toString(),
|
modules.get(index).getModuleId().getArch(),
|
||||||
null);
|
null);
|
||||||
primaryKey2 = UsageInstance.getPrimaryKey(modules.get(index2).module.getModuleName(),
|
primaryKey2 = UsageInstance.getPrimaryKey(modules.get(index2).getModuleId().getModule().getName(),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
modules.get(index2).module.getArch().toString(),
|
modules.get(index2).getModuleId().getArch(),
|
||||||
null);
|
null);
|
||||||
if (primaryKey1.equalsIgnoreCase(primaryKey2)) {
|
if (primaryKey1.equalsIgnoreCase(primaryKey2)) {
|
||||||
isDuplicate = true;
|
isDuplicate = true;
|
||||||
@@ -2098,13 +2146,13 @@ public class CollectPCDAction {
|
|||||||
//
|
//
|
||||||
// It is legal for a module does not contains ANY pcd build definitions.
|
// It is legal for a module does not contains ANY pcd build definitions.
|
||||||
//
|
//
|
||||||
if (modules.get(index).module.getPcdBuildDefinition() == null) {
|
if (modules.get(index).getPcdBuildDef() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcdBuildDataArray = modules.get(index).module.getPcdBuildDefinition().getPcdDataList();
|
pcdBuildDataArray = modules.get(index).getPcdBuildDef().getPcdDataList();
|
||||||
|
|
||||||
moduleName = modules.get(index).module.getModuleName();
|
moduleName = modules.get(index).getModuleId().getModule().getName();
|
||||||
|
|
||||||
//
|
//
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
@@ -2112,13 +2160,14 @@ public class CollectPCDAction {
|
|||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
for (pcdIndex = 0; pcdIndex < pcdBuildDataArray.size(); pcdIndex ++) {
|
for (pcdIndex = 0; pcdIndex < pcdBuildDataArray.size(); pcdIndex ++) {
|
||||||
|
//tokenSpaceGuidString = GlobalData.getGuidInfoFromCname(pcdBuildData.getTokenSpaceGuidCName())[1];
|
||||||
|
tokenSpaceGuidString = null;
|
||||||
pcdBuildData = pcdBuildDataArray.get(pcdIndex);
|
pcdBuildData = pcdBuildDataArray.get(pcdIndex);
|
||||||
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
|
primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
|
||||||
translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));
|
translateSchemaStringToUUID(tokenSpaceGuidString));
|
||||||
pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());
|
pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());
|
||||||
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
|
datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
|
||||||
tokenNumber = Long.decode(pcdBuildData.getToken().toString());
|
tokenNumber = Long.decode(pcdBuildData.getToken().toString());
|
||||||
|
|
||||||
if (pcdBuildData.getValue() != null) {
|
if (pcdBuildData.getValue() != null) {
|
||||||
datum = pcdBuildData.getValue().toString();
|
datum = pcdBuildData.getValue().toString();
|
||||||
} else {
|
} else {
|
||||||
@@ -2135,17 +2184,6 @@ public class CollectPCDAction {
|
|||||||
throw new EntityException(exceptionString);
|
throw new EntityException(exceptionString);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Check <TokenSpaceGuid> is exist? In future, because all schema verification will tools
|
|
||||||
// will check that, following checking code could be removed.
|
|
||||||
//
|
|
||||||
if (pcdBuildData.getTokenSpaceGuid() == null) {
|
|
||||||
exceptionString = String.format("[FPD file error] There is no <TokenSpaceGuid> for PCD %s in module %s! This is required!",
|
|
||||||
pcdBuildData.getCName(),
|
|
||||||
moduleName);
|
|
||||||
throw new EntityException(exceptionString);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
// 2.1.1), Do some necessary checking work for FixedAtBuild, FeatureFlag and PatchableInModule
|
// 2.1.1), Do some necessary checking work for FixedAtBuild, FeatureFlag and PatchableInModule
|
||||||
@@ -2255,8 +2293,10 @@ public class CollectPCDAction {
|
|||||||
// If the token is not in database, create a new token instance and add
|
// If the token is not in database, create a new token instance and add
|
||||||
// a usage instance into this token in database.
|
// a usage instance into this token in database.
|
||||||
//
|
//
|
||||||
|
//String tokenSpaceString = GlobalData.getGuidInfoFromCname(pcdBuildData.getTokenSpaceGuidCName())[1];
|
||||||
|
String tokenSpaceString = null;
|
||||||
token = new Token(pcdBuildData.getCName(),
|
token = new Token(pcdBuildData.getCName(),
|
||||||
translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));
|
translateSchemaStringToUUID(tokenSpaceString));
|
||||||
|
|
||||||
token.datumType = datumType;
|
token.datumType = datumType;
|
||||||
token.tokenNumber = tokenNumber;
|
token.tokenNumber = tokenNumber;
|
||||||
@@ -2294,9 +2334,9 @@ public class CollectPCDAction {
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
modules.get(index).type,
|
CommonDefinition.getModuleType(modules.get(index).getModuleType()),
|
||||||
pcdType,
|
pcdType,
|
||||||
modules.get(index).module.getArch().toString(),
|
modules.get(index).getModuleId().getArch(),
|
||||||
null,
|
null,
|
||||||
datum,
|
datum,
|
||||||
maxDatumSize);
|
maxDatumSize);
|
||||||
@@ -2655,7 +2695,7 @@ public class CollectPCDAction {
|
|||||||
//
|
//
|
||||||
if (fpdDocInstance == null) {
|
if (fpdDocInstance == null) {
|
||||||
try {
|
try {
|
||||||
fpdDocInstance = (FrameworkPlatformDescriptionDocument)XmlObject.Factory.parse(new File(fpdFilePath));
|
fpdDocInstance = (PlatformSurfaceAreaDocument)XmlObject.Factory.parse(new File(fpdFilePath));
|
||||||
} catch(IOException ioE) {
|
} catch(IOException ioE) {
|
||||||
throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());
|
throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());
|
||||||
} catch(XmlException xmlE) {
|
} catch(XmlException xmlE) {
|
||||||
@@ -2663,7 +2703,7 @@ public class CollectPCDAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamicPcdBuildDefinitions = fpdDocInstance.getFrameworkPlatformDescription().getDynamicPcdBuildDefinitions();
|
dynamicPcdBuildDefinitions = fpdDocInstance.getPlatformSurfaceArea().getDynamicPcdBuildDefinitions();
|
||||||
if (dynamicPcdBuildDefinitions == null) {
|
if (dynamicPcdBuildDefinitions == null) {
|
||||||
exceptionString = String.format("[FPD file error] There are no <PcdDynamicBuildDescriptions> in FPD file but contains Dynamic type "+
|
exceptionString = String.format("[FPD file error] There are no <PcdDynamicBuildDescriptions> in FPD file but contains Dynamic type "+
|
||||||
"PCD entry %s in module %s!",
|
"PCD entry %s in module %s!",
|
||||||
@@ -2674,18 +2714,10 @@ public class CollectPCDAction {
|
|||||||
|
|
||||||
dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
|
dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
|
||||||
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
|
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
|
||||||
//
|
//String tokenSpaceGuidString = GlobalData.getGuidInfoFromCname(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName())[1];
|
||||||
// Check <TokenSpaceGuid> is exist? In future, because all schema verification will tools
|
String tokenSpaceGuidString = null;
|
||||||
// will check that, following checking code could be removed.
|
|
||||||
//
|
|
||||||
if (dynamicPcdBuildDataArray.get(index).getTokenSpaceGuid() == null) {
|
|
||||||
exceptionString = String.format("[FPD file error] There is no <TokenSpaceGuid> for PCD %s in <DynamicPcdBuildDefinitions>! This is required!",
|
|
||||||
dynamicPcdBuildDataArray.get(index).getCName());
|
|
||||||
throw new EntityException(exceptionString);
|
|
||||||
}
|
|
||||||
|
|
||||||
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
|
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
|
||||||
translateSchemaStringToUUID(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuid()));
|
translateSchemaStringToUUID(tokenSpaceGuidString));
|
||||||
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
|
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {
|
||||||
return dynamicPcdBuildDataArray.get(index);
|
return dynamicPcdBuildDataArray.get(index);
|
||||||
}
|
}
|
||||||
@@ -2880,14 +2912,22 @@ public class CollectPCDAction {
|
|||||||
//
|
//
|
||||||
// Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
|
// Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
|
||||||
//
|
//
|
||||||
variableGuidString = GlobalData.getGuidInfoGuid(skuInfoList.get(index).getVariableGuid().toString());
|
variableGuidString = GlobalData.getGuidInfoFromCname(skuInfoList.get(index).getVariableGuid().toString());
|
||||||
if (variableGuidString == null) {
|
if (variableGuidString == null) {
|
||||||
throw new EntityException(String.format("[GUID Error] For dynamic PCD %s, the variable guid %s can be found in all SPD file!",
|
throw new EntityException(String.format("[GUID Error] For dynamic PCD %s, the variable guid %s can be found in all SPD file!",
|
||||||
token.cName,
|
token.cName,
|
||||||
skuInfoList.get(index).getVariableGuid().toString()));
|
skuInfoList.get(index).getVariableGuid().toString()));
|
||||||
}
|
}
|
||||||
|
String variableStr = skuInfoList.get(index).getVariableName();
|
||||||
|
Pattern pattern = Pattern.compile("0x([a-fA-F0-9]){4}");
|
||||||
|
Matcher matcher = pattern.matcher(variableStr);
|
||||||
|
List<String> varNameList = new ArrayList<String>();
|
||||||
|
while (matcher.find()){
|
||||||
|
String str = variableStr.substring(matcher.start(),matcher.end());
|
||||||
|
varNameList.add(str);
|
||||||
|
}
|
||||||
|
|
||||||
skuInstance.value.setHiiData(skuInfoList.get(index).getVariableName(),
|
skuInstance.value.setHiiData(varNameList,
|
||||||
translateSchemaStringToUUID(variableGuidString[1]),
|
translateSchemaStringToUUID(variableGuidString[1]),
|
||||||
skuInfoList.get(index).getVariableOffset(),
|
skuInfoList.get(index).getVariableOffset(),
|
||||||
skuInfoList.get(index).getHiiDefaultValue().toString());
|
skuInfoList.get(index).getHiiDefaultValue().toString());
|
||||||
@@ -3044,8 +3084,8 @@ public class CollectPCDAction {
|
|||||||
ca.setWorkspacePath("m:/tianocore/edk2");
|
ca.setWorkspacePath("m:/tianocore/edk2");
|
||||||
ca.setFPDFilePath("m:/tianocore/edk2/EdkNt32Pkg/Nt32.fpd");
|
ca.setFPDFilePath("m:/tianocore/edk2/EdkNt32Pkg/Nt32.fpd");
|
||||||
ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL);
|
ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL);
|
||||||
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",
|
// GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",
|
||||||
"m:/tianocore/edk2");
|
// "m:/tianocore/edk2");
|
||||||
ca.execute();
|
// ca.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,11 +19,15 @@ package org.tianocore.build.pcd.action;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
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.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -167,6 +171,37 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
return cAutoGenString;
|
return cAutoGenString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// Construct function
|
||||||
|
//
|
||||||
|
// This function mainly initialize some member variable.
|
||||||
|
//
|
||||||
|
// @param moduleName Parameter of this action class.
|
||||||
|
// @param isEmulatedPCDDriver Parameter of this action class.
|
||||||
|
// **/
|
||||||
|
// public PCDAutoGenAction(String moduleName,
|
||||||
|
// UUID moduleGuid,
|
||||||
|
// String packageName,
|
||||||
|
// UUID packageGuid,
|
||||||
|
// String arch,
|
||||||
|
// String version,
|
||||||
|
// boolean isBuildUsedLibrary,
|
||||||
|
// String[] pcdNameArray) {
|
||||||
|
// dbManager = null;
|
||||||
|
// hAutoGenString = "";
|
||||||
|
// cAutoGenString = "";
|
||||||
|
//
|
||||||
|
// setModuleName(moduleName);
|
||||||
|
// setModuleGuid(moduleGuid);
|
||||||
|
// setPackageName(packageName);
|
||||||
|
// setPackageGuid(packageGuid);
|
||||||
|
// setPcdNameArray(pcdNameArray);
|
||||||
|
// setArch(arch);
|
||||||
|
// setVersion(version);
|
||||||
|
// setIsBuildUsedLibrary(isBuildUsedLibrary);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Construct function
|
Construct function
|
||||||
|
|
||||||
@@ -176,25 +211,125 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
@param isEmulatedPCDDriver Parameter of this action class.
|
@param isEmulatedPCDDriver Parameter of this action class.
|
||||||
**/
|
**/
|
||||||
public PCDAutoGenAction(String moduleName,
|
public PCDAutoGenAction(String moduleName,
|
||||||
UUID moduleGuid,
|
String moduleGuidString,
|
||||||
String packageName,
|
String packageName,
|
||||||
UUID packageGuid,
|
String packageGuidString,
|
||||||
String arch,
|
String arch,
|
||||||
String version,
|
String version,
|
||||||
boolean isBuildUsedLibrary,
|
boolean isBuildUsedLibrary,
|
||||||
String[] pcdNameArray) {
|
String[] pcdNameArray)
|
||||||
|
throws BuildActionException {
|
||||||
dbManager = null;
|
dbManager = null;
|
||||||
hAutoGenString = "";
|
hAutoGenString = "";
|
||||||
cAutoGenString = "";
|
cAutoGenString = "";
|
||||||
|
try {
|
||||||
setModuleName(moduleName);
|
setModuleName(moduleName);
|
||||||
setModuleGuid(moduleGuid);
|
setModuleGuid(translateSchemaStringToUUID(moduleGuidString));
|
||||||
setPackageName(packageName);
|
setPackageName(packageName);
|
||||||
setPackageGuid(packageGuid);
|
setPackageGuid(translateSchemaStringToUUID(packageGuidString));
|
||||||
setPcdNameArray(pcdNameArray);
|
setPcdNameArray(pcdNameArray);
|
||||||
setArch(arch);
|
setArch(arch);
|
||||||
setVersion(version);
|
setVersion(version);
|
||||||
setIsBuildUsedLibrary(isBuildUsedLibrary);
|
setIsBuildUsedLibrary(isBuildUsedLibrary);
|
||||||
|
|
||||||
|
if (isBuildUsedLibrary) {
|
||||||
|
System.out.println("Build for library");
|
||||||
|
for (int index = 0; index < pcdNameArray.length; index ++) {
|
||||||
|
System.out.println(pcdNameArray[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (EntityException e){
|
||||||
|
throw new BuildActionException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Translate the schema string to UUID instance.
|
||||||
|
|
||||||
|
In schema, the string of UUID is defined as following two types string:
|
||||||
|
1) GuidArrayType: pattern = 0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},(
|
||||||
|
)*0x[a-fA-F0-9]{1,4}(,( )*\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\})?
|
||||||
|
|
||||||
|
2) GuidNamingConvention: pattern =
|
||||||
|
[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
|
||||||
|
|
||||||
|
This function will convert string and create uuid instance.
|
||||||
|
|
||||||
|
@param uuidString UUID string in XML file
|
||||||
|
|
||||||
|
@return UUID UUID instance
|
||||||
|
**/
|
||||||
|
private UUID translateSchemaStringToUUID(String uuidString)
|
||||||
|
throws EntityException {
|
||||||
|
String temp;
|
||||||
|
String[] splitStringArray;
|
||||||
|
int index;
|
||||||
|
int chIndex;
|
||||||
|
int chLen;
|
||||||
|
|
||||||
|
if (uuidString == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uuidString.length() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uuidString.equals("0") ||
|
||||||
|
uuidString.equalsIgnoreCase("0x0")) {
|
||||||
|
return new UUID(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uuidString = uuidString.replaceAll("\\{", "");
|
||||||
|
uuidString = uuidString.replaceAll("\\}", "");
|
||||||
|
|
||||||
|
//
|
||||||
|
// If the UUID schema string is GuidArrayType type then need translate
|
||||||
|
// to GuidNamingConvention type at first.
|
||||||
|
//
|
||||||
|
if ((uuidString.charAt(0) == '0') && ((uuidString.charAt(1) == 'x') || (uuidString.charAt(1) == 'X'))) {
|
||||||
|
splitStringArray = uuidString.split("," );
|
||||||
|
if (splitStringArray.length != 11) {
|
||||||
|
throw new EntityException ("[FPD file error] Wrong format for UUID string: " + uuidString);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Remove blank space from these string and remove header string "0x"
|
||||||
|
//
|
||||||
|
for (index = 0; index < 11; index ++) {
|
||||||
|
splitStringArray[index] = splitStringArray[index].trim();
|
||||||
|
splitStringArray[index] = splitStringArray[index].substring(2, splitStringArray[index].length());
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add heading '0' to normalize the string length
|
||||||
|
//
|
||||||
|
for (index = 3; index < 11; index ++) {
|
||||||
|
chLen = splitStringArray[index].length();
|
||||||
|
for (chIndex = 0; chIndex < 2 - chLen; chIndex ++) {
|
||||||
|
splitStringArray[index] = "0" + splitStringArray[index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// construct the final GuidNamingConvention string
|
||||||
|
//
|
||||||
|
temp = String.format("%s-%s-%s-%s%s-%s%s%s%s%s%s",
|
||||||
|
splitStringArray[0],
|
||||||
|
splitStringArray[1],
|
||||||
|
splitStringArray[2],
|
||||||
|
splitStringArray[3],
|
||||||
|
splitStringArray[4],
|
||||||
|
splitStringArray[5],
|
||||||
|
splitStringArray[6],
|
||||||
|
splitStringArray[7],
|
||||||
|
splitStringArray[8],
|
||||||
|
splitStringArray[9],
|
||||||
|
splitStringArray[10]);
|
||||||
|
uuidString = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return UUID.fromString(uuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -265,12 +400,14 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
dbManager.UsageInstanceContext = usageInstanceArray;
|
dbManager.UsageInstanceContext = usageInstanceArray;
|
||||||
dbManager.CurrentModuleName = moduleName;
|
dbManager.CurrentModuleName = moduleName;
|
||||||
} else {
|
} else {
|
||||||
|
System.out.println(String.format("Generate %s 's library", dbManager.CurrentModuleName));
|
||||||
usageContext = 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 (usageContext == null) {
|
if (usageContext == null) {
|
||||||
|
System.out.println("context is null");
|
||||||
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
|
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
|
||||||
moduleGuid,
|
moduleGuid,
|
||||||
packageName,
|
packageName,
|
||||||
@@ -279,6 +416,7 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
version);
|
version);
|
||||||
} else {
|
} else {
|
||||||
usageInstanceArray = new ArrayList<UsageInstance>();
|
usageInstanceArray = new ArrayList<UsageInstance>();
|
||||||
|
System.out.println("context is not null!");
|
||||||
//
|
//
|
||||||
// Remove PCD entries which are not belong to this library.
|
// Remove PCD entries which are not belong to this library.
|
||||||
//
|
//
|
||||||
@@ -289,6 +427,7 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
|
|
||||||
for (index2 = 0; index2 < pcdNameArray.length; index2 ++) {
|
for (index2 = 0; index2 < pcdNameArray.length; index2 ++) {
|
||||||
if (pcdNameArray[index2].equalsIgnoreCase(usageContext.get(index).parentToken.cName)) {
|
if (pcdNameArray[index2].equalsIgnoreCase(usageContext.get(index).parentToken.cName)) {
|
||||||
|
System.out.println("Found! for PCD entry " + pcdNameArray[index2]);
|
||||||
usageInstanceArray.add(usageContext.get(index));
|
usageInstanceArray.add(usageContext.get(index));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -404,7 +543,7 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
//
|
//
|
||||||
CollectPCDAction collectionAction = new CollectPCDAction();
|
CollectPCDAction collectionAction = new CollectPCDAction();
|
||||||
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",
|
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",
|
||||||
WorkSpace);
|
WorkSpace,null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
collectionAction.perform(WorkSpace,
|
collectionAction.perform(WorkSpace,
|
||||||
@@ -417,18 +556,18 @@ public class PCDAutoGenAction extends BuildAction {
|
|||||||
//
|
//
|
||||||
// Then execute the PCDAuotoGenAction to get generated Autogen.h and Autogen.c
|
// Then execute the PCDAuotoGenAction to get generated Autogen.h and Autogen.c
|
||||||
//
|
//
|
||||||
PCDAutoGenAction autogenAction = new PCDAutoGenAction("PcdPeim",
|
// PCDAutoGenAction autogenAction = new PCDAutoGenAction("MonoStatusCode",
|
||||||
null,
|
// null,
|
||||||
null,
|
// null,
|
||||||
null,
|
// null,
|
||||||
"IA32",
|
// "IA32",
|
||||||
null,
|
// null,
|
||||||
true,
|
// false,
|
||||||
nameArray);
|
// nameArray);
|
||||||
autogenAction.execute();
|
// autogenAction.execute();
|
||||||
|
//
|
||||||
System.out.println(autogenAction.OutputH());
|
// System.out.println(autogenAction.OutputH());
|
||||||
System.out.println("WQWQWQWQWQ");
|
// System.out.println("WQWQWQWQWQ");
|
||||||
System.out.println(autogenAction.OutputC());
|
// System.out.println(autogenAction.OutputC());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ public class ShowPCDDatabaseAction extends UIAction {
|
|||||||
// Initialize global data.
|
// Initialize global data.
|
||||||
//
|
//
|
||||||
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",
|
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",
|
||||||
workspacePath);
|
workspacePath,null);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Collect PCD information.
|
// Collect PCD information.
|
||||||
|
@@ -20,6 +20,7 @@ package org.tianocore.build.pcd.entity;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.tianocore.ModuleTypeDef;
|
import org.tianocore.ModuleTypeDef;
|
||||||
|
import org.tianocore.build.autogen.CommonDefinition;
|
||||||
import org.tianocore.build.pcd.exception.EntityException;
|
import org.tianocore.build.pcd.exception.EntityException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +72,7 @@ public class UsageInstance {
|
|||||||
///
|
///
|
||||||
/// The module type for this usage instance.
|
/// The module type for this usage instance.
|
||||||
///
|
///
|
||||||
public ModuleTypeDef.Enum moduleType;
|
public int moduleType;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The value of the PCD in this usage instance.
|
/// The value of the PCD in this usage instance.
|
||||||
@@ -115,7 +116,7 @@ public class UsageInstance {
|
|||||||
UUID moduleGUID,
|
UUID moduleGUID,
|
||||||
String packageName,
|
String packageName,
|
||||||
UUID packageGUID,
|
UUID packageGUID,
|
||||||
ModuleTypeDef.Enum moduleType,
|
int moduleType,
|
||||||
Token.PCD_TYPE modulePcdType,
|
Token.PCD_TYPE modulePcdType,
|
||||||
String arch,
|
String arch,
|
||||||
String version,
|
String version,
|
||||||
@@ -178,8 +179,8 @@ public class UsageInstance {
|
|||||||
@return boolean
|
@return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isPeiPhaseComponent() {
|
public boolean isPeiPhaseComponent() {
|
||||||
if ((moduleType == ModuleTypeDef.PEI_CORE) ||
|
if ((moduleType == CommonDefinition.ModuleTypePeiCore) ||
|
||||||
(moduleType == ModuleTypeDef.PEIM)) {
|
(moduleType == CommonDefinition.ModuleTypePeim)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -190,12 +191,12 @@ public class UsageInstance {
|
|||||||
// BugBug: May need confirmation on which type of module can
|
// BugBug: May need confirmation on which type of module can
|
||||||
// make use of Dynamic(EX) PCD entry.
|
// make use of Dynamic(EX) PCD entry.
|
||||||
//
|
//
|
||||||
if ((moduleType == ModuleTypeDef.DXE_DRIVER) ||
|
if ((moduleType == CommonDefinition.ModuleTypeDxeDriver) ||
|
||||||
(moduleType == ModuleTypeDef.DXE_RUNTIME_DRIVER) ||
|
(moduleType == CommonDefinition.ModuleTypeDxeRuntimeDriver) ||
|
||||||
(moduleType == ModuleTypeDef.DXE_SAL_DRIVER) ||
|
(moduleType == CommonDefinition.ModuleTypeDxeSalDriver) ||
|
||||||
(moduleType == ModuleTypeDef.DXE_SMM_DRIVER) ||
|
(moduleType == CommonDefinition.ModuleTypeDxeSmmDriver) ||
|
||||||
(moduleType == ModuleTypeDef.UEFI_DRIVER) ||
|
(moduleType == CommonDefinition.ModuleTypeUefiDriver) ||
|
||||||
(moduleType == ModuleTypeDef.UEFI_APPLICATION)
|
(moduleType == CommonDefinition.ModuleTypeUefiApplication)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.build.toolchain;
|
package org.tianocore.build.toolchain;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.exception.EdkException;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
package org.tianocore.build.toolchain;
|
package org.tianocore.build.toolchain;
|
||||||
|
|
||||||
import org.apache.tools.ant.BuildException;
|
import org.apache.tools.ant.BuildException;
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.exception.EdkException;
|
||||||
import org.tianocore.build.toolchain.ToolChainKey;
|
import org.tianocore.build.toolchain.ToolChainKey;
|
||||||
import org.tianocore.build.toolchain.ToolChainMap;
|
import org.tianocore.build.toolchain.ToolChainMap;
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.exception.EdkException;
|
||||||
|
|
||||||
public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainKey> {
|
public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainKey> {
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.tianocore.build.exception.EdkException;
|
import org.tianocore.exception.EdkException;
|
||||||
|
|
||||||
public class ToolChainMap {
|
public class ToolChainMap {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user