Fixed EDKT498(enchance makedep tool to support asm file), EDKT500(dep file needs to be created for uni file) and tracker ID 454(report real driver entrypoint address through debug output) in PVCS.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2246 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jwang36 2007-01-15 01:59:23 +00:00
parent b991a45139
commit a387de3b32
3 changed files with 568 additions and 579 deletions

View File

@ -29,15 +29,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</not> </not>
</and> </and>
<then> <then>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/> TargetFile="${DEST_DIR_OUTPUT}/AutoGen.h.gch">
<then>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep">
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/> <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/> <EXTRA.INC/>
</makedeps> </makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
@ -102,20 +98,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/> <EXTRA.INC/>
</makedeps> </makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -161,20 +153,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
<input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/> <EXTRA.INC/>
</makedeps> </makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -304,9 +292,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<EXTRA.INC.1/>
</makedeps>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <file Listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -379,9 +374,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<EXTRA.INC.1/>
</makedeps>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <file Listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -429,20 +431,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<sequential> <sequential>
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC.1/> <EXTRA.INC.1/>
</makedeps> </makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -485,6 +483,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</macrodef> </macrodef>
<!--
Assembly the preprocessed IPF assembly code
-->
<macrodef name="Build_IPF_PP_Code"> <macrodef name="Build_IPF_PP_Code">
<attribute name="FILEPATH"/> <attribute name="FILEPATH"/>
<attribute name="FILENAME"/> <attribute name="FILENAME"/>
@ -516,7 +517,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<!-- <!--
Library private HashMap map = new HashMap(); Library
--> -->
<macrodef name="Build_Library"> <macrodef name="Build_Library">
<attribute name="FILENAME" /> <attribute name="FILENAME" />
@ -563,10 +564,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<sequential> <sequential>
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<EXTRA.INC/>
</makedeps>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/> <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
@ -689,20 +695,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<sequential> <sequential>
<mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/> <EXTRA.INC/>
</makedeps> </makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -911,7 +913,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</macrodef> </macrodef>
<!-- <!--
DUMMY DUMMY - for skipping the source file which should not be built
--> -->
<macrodef name="Build_DUMMY"> <macrodef name="Build_DUMMY">
<attribute name="FILEPATH"/> <attribute name="FILEPATH"/>

View File

@ -14,9 +14,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
package org.tianocore.framework.tasks; package org.tianocore.framework.tasks;
import java.io.BufferedInputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader; import java.io.FileReader;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
@ -44,6 +46,7 @@ public class MakeDeps extends Task {
// //
// private members, use set/get to access them // private members, use set/get to access them
// //
private String targetFile = "";
private String depsFilePath = ""; private String depsFilePath = "";
private IncludePath includePathList = new IncludePath(); private IncludePath includePathList = new IncludePath();
private Input inputFileList = new Input(); private Input inputFileList = new Input();
@ -54,7 +57,7 @@ public class MakeDeps extends Task {
// //
// regular expression for "#include ..." directive // regular expression for "#include ..." directive
// //
private static final Pattern incPattern = Pattern.compile("[\n\r \t]*#[ \t]*include[ \t\"<]+([^\n\r\"<>]+)"); private static final Pattern incPattern = Pattern.compile("[\n\r]+[ \t#]*[ \t]*include[ \t]+[\"<]*([^\n\r\"<>]+)[>\"]*[\n\r]+");
public MakeDeps() { public MakeDeps() {
@ -69,6 +72,13 @@ public class MakeDeps extends Task {
@throws BuildException @throws BuildException
**/ **/
public void execute() throws BuildException { public void execute() throws BuildException {
//
// if target file is specified and it hasn't been generated, don't generate
// dep file
//
if (targetFile.length() != 0 && (new File(targetFile)).exists() == false) {
return;
}
// //
// check if the dependency list file is uptodate or not // check if the dependency list file is uptodate or not
// //
@ -124,6 +134,14 @@ public class MakeDeps extends Task {
FileTimeStamp.update(depsFilePath, depsFile.lastModified()); FileTimeStamp.update(depsFilePath, depsFile.lastModified());
} }
public void setTargetFile(String name) {
targetFile = name;
}
public String getTargetFile() {
return targetFile;
}
/** /**
Set method for "DepsFile" attribute Set method for "DepsFile" attribute
@ -280,24 +298,30 @@ public class MakeDeps extends Task {
if (!srcFile.exists()) { if (!srcFile.exists()) {
continue; continue;
} }
// //
// try cache first // try cache first
// //
Set<String> incFiles = includesCache.get(src); Set<String> incFiles = includesCache.get(src);
if (incFiles == null) { if (incFiles == null) {
incFiles = new HashSet<String>(); incFiles = new HashSet<String>();
FileReader fileReader = null; FileInputStream fileReader = null;
BufferedReader bufReader = null; BufferedInputStream bufReader = null;
String fileContent = ""; String fileContent = "";
int fileLength = (int)srcFile.length(); int fileLength = (int)srcFile.length();
try { try {
fileReader = new FileReader(srcFile); fileReader = new FileInputStream(srcFile);
bufReader = new BufferedReader(fileReader); bufReader = new BufferedInputStream(fileReader);
char[] buf = new char[fileLength]; byte[] buf = new byte[fileLength];
bufReader.read(buf, 0, fileLength); bufReader.read(buf, 0, fileLength);
//
// check if the file is utf-16 encoded
//
if (buf[0] == (byte)0xff || buf[0] == (byte)0xfe) {
fileContent = new String(buf, "UTF-16");
buf = fileContent.getBytes("UTF-8");
}
fileContent = new String(buf); fileContent = new String(buf);
} catch (IOException e) { } catch (IOException e) {
throw new BuildException(e.getMessage()); throw new BuildException(e.getMessage());

View File

@ -458,11 +458,9 @@ public class AutoGen {
// //
String guid = CommonDefinition.formatGuidName(saq.getModuleGuid()); String guid = CommonDefinition.formatGuidName(saq.getModuleGuid());
if (this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { if (this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {");
.append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {");
} else { } else {
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");
.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");
} }
if (guid == null) { if (guid == null) {
@ -590,8 +588,7 @@ public class AutoGen {
// //
// Write library class's related *.h file to autogen.h // Write library class's related *.h file to autogen.h
// //
String[] libClassList = saq String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch);
.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch);
if (libClassList != null) { if (libClassList != null) {
libClassIncludeH = LibraryClassToAutogenH(libClassList); libClassIncludeH = LibraryClassToAutogenH(libClassList);
item = libClassIncludeH.iterator(); item = libClassIncludeH.iterator();
@ -600,8 +597,7 @@ public class AutoGen {
} }
} }
libClassList = saq libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);
.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);
if (libClassList != null) { if (libClassList != null) {
libClassIncludeH = LibraryClassToAutogenH(libClassList); libClassIncludeH = LibraryClassToAutogenH(libClassList);
item = libClassIncludeH.iterator(); item = libClassIncludeH.iterator();
@ -778,6 +774,7 @@ public class AutoGen {
throws EdkException { throws EdkException {
String typeStr = saq.getModuleType(); String typeStr = saq.getModuleType();
String debugStr = "DEBUG ((EFI_D_INFO | EFI_D_LOAD, \"Module Entry Point (%s) 0x%%p\\n\", (VOID *)(UINTN)%s));\n";
int unloadImageCount = 0; int unloadImageCount = 0;
int entryPointCount = 0; int entryPointCount = 0;
@ -795,21 +792,19 @@ public class AutoGen {
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append(entryPointList[0]); fileBuffer.append(entryPointList[0]);
fileBuffer.append(" (\r\n"); fileBuffer.append(" (\r\n");
fileBuffer fileBuffer.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n");
.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n"); fileBuffer.append(" IN VOID *OldCoreData\r\n");
fileBuffer
.append(" IN VOID *OldCoreData\r\n");
fileBuffer.append(" );\r\n\r\n"); fileBuffer.append(" );\r\n\r\n");
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
fileBuffer.append("ProcessModuleEntryPointList (\r\n"); fileBuffer.append("ProcessModuleEntryPointList (\r\n");
fileBuffer fileBuffer.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n");
.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n"); fileBuffer.append(" IN VOID *OldCoreData\r\n");
fileBuffer
.append(" IN VOID *OldCoreData\r\n");
fileBuffer.append(" )\r\n\r\n"); fileBuffer.append(" )\r\n\r\n");
fileBuffer.append("{\r\n"); fileBuffer.append("{\r\n");
// fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[0], entryPointList[0]));
fileBuffer.append(" return "); fileBuffer.append(" return ");
fileBuffer.append(entryPointList[0]); fileBuffer.append(entryPointList[0]);
fileBuffer.append(" (PeiStartupDescriptor, OldCoreData);\r\n"); fileBuffer.append(" (PeiStartupDescriptor, OldCoreData);\r\n");
@ -820,10 +815,8 @@ 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 == null || entryPointList.length != 1) { if (entryPointList == null || entryPointList.length != 1) {
throw new AutoGenException( throw new AutoGenException("Module type = 'DXE_CORE', can have only one module entry point!");
"Module type = 'DXE_CORE', can have only one module entry point!");
} else { } else {
fileBuffer.append("VOID\r\n"); fileBuffer.append("VOID\r\n");
fileBuffer.append(entryPointList[0]); fileBuffer.append(entryPointList[0]);
fileBuffer.append(" (\n"); fileBuffer.append(" (\n");
@ -836,6 +829,8 @@ public class AutoGen {
fileBuffer.append(" IN VOID *HobStart\r\n"); fileBuffer.append(" IN VOID *HobStart\r\n");
fileBuffer.append(" )\r\n\r\n"); fileBuffer.append(" )\r\n\r\n");
fileBuffer.append("{\r\n"); fileBuffer.append("{\r\n");
//fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[0], entryPointList[0]));
fileBuffer.append(" "); fileBuffer.append(" ");
fileBuffer.append(entryPointList[0]); fileBuffer.append(entryPointList[0]);
fileBuffer.append(" (HobStart);\r\n"); fileBuffer.append(" (HobStart);\r\n");
@ -845,8 +840,7 @@ public class AutoGen {
case CommonDefinition.ModuleTypePeim: case CommonDefinition.ModuleTypePeim:
entryPointCount = 0; 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 || entryPointList.length == 0) { if (entryPointList == null || entryPointList.length == 0) {
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
@ -863,13 +857,10 @@ public class AutoGen {
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append(entryPointList[i]); fileBuffer.append(entryPointList[i]);
fileBuffer.append(" (\r\n"); fileBuffer.append(" (\r\n");
fileBuffer fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n"); fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
fileBuffer
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
fileBuffer.append(" );\r\n"); fileBuffer.append(" );\r\n");
entryPointCount++; entryPointCount++;
} }
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
@ -880,6 +871,8 @@ 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 == 1) { if (entryPointCount == 1) {
//fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[0], entryPointList[0]));
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");
@ -889,11 +882,12 @@ public class AutoGen {
fileBuffer.append(" CombinedStatus = EFI_LOAD_ERROR;\r\n\r\n"); fileBuffer.append(" CombinedStatus = EFI_LOAD_ERROR;\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 (!entryPointList[i].equals("")) {
//fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[i] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[i], entryPointList[i]));
fileBuffer.append(" Status = "); fileBuffer.append(" Status = ");
fileBuffer.append(entryPointList[i]); fileBuffer.append(entryPointList[i]);
fileBuffer.append(" (FfsHeader, PeiServices);\r\n"); fileBuffer.append(" (FfsHeader, PeiServices);\r\n");
fileBuffer fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\r\n");
.append(" if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\r\n");
fileBuffer.append(" CombinedStatus = Status;\r\n"); fileBuffer.append(" CombinedStatus = Status;\r\n");
fileBuffer.append(" }\r\n\r\n"); fileBuffer.append(" }\r\n\r\n");
} else { } else {
@ -912,8 +906,7 @@ public class AutoGen {
// function. // function.
// //
if (entryPointList == null || entryPointList.length == 0) { if (entryPointList == null || entryPointList.length == 0) {
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
fileBuffer.append(Integer.toString(entryPointCount)); fileBuffer.append(Integer.toString(entryPointCount));
fileBuffer.append(";\r\n"); fileBuffer.append(";\r\n");
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
@ -936,14 +929,11 @@ public class AutoGen {
fileBuffer.append(" );\r\n"); fileBuffer.append(" );\r\n");
entryPointCount++; entryPointCount++;
} }
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
fileBuffer.append(Integer.toString(entryPointCount)); fileBuffer.append(Integer.toString(entryPointCount));
fileBuffer.append(";\r\n"); fileBuffer.append(";\r\n");
fileBuffer fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n");
.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n"); fileBuffer.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n\r\n");
fileBuffer
.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n\r\n");
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
@ -953,16 +943,15 @@ 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++) {
fileBuffer fileBuffer.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
.append(" if (SetJump (&mJumpContext) == 0) {\r\n"); //fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[i] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[i], entryPointList[i]));
fileBuffer.append(" ExitDriver ("); fileBuffer.append(" ExitDriver (");
fileBuffer.append(entryPointList[i]); fileBuffer.append(entryPointList[i]);
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");
} }
fileBuffer.append(" return mDriverEntryPointStatus;\r\n"); fileBuffer.append(" return mDriverEntryPointStatus;\r\n");
fileBuffer.append("}\r\n\r\n"); fileBuffer.append("}\r\n\r\n");
@ -973,14 +962,12 @@ public class AutoGen {
fileBuffer.append(" IN EFI_STATUS Status\n"); fileBuffer.append(" IN EFI_STATUS Status\n");
fileBuffer.append(" )\r\n\r\n"); fileBuffer.append(" )\r\n\r\n");
fileBuffer.append("{\r\n"); fileBuffer.append("{\r\n");
fileBuffer fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n"); fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n");
fileBuffer.append(" }\r\n"); fileBuffer.append(" }\r\n");
fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n"); fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");
fileBuffer.append(" ASSERT (FALSE);\r\n"); fileBuffer.append(" ASSERT (FALSE);\r\n");
fileBuffer.append("}\r\n\r\n"); fileBuffer.append("}\r\n\r\n");
} }
@ -997,15 +984,13 @@ public class AutoGen {
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append(unloadImageList[i]); fileBuffer.append(unloadImageList[i]);
fileBuffer.append(" (\r\n"); fileBuffer.append(" (\r\n");
fileBuffer fileBuffer.append(" IN EFI_HANDLE ImageHandle\r\n");
.append(" IN EFI_HANDLE ImageHandle\r\n");
fileBuffer.append(" );\r\n"); fileBuffer.append(" );\r\n");
unloadImageCount++; unloadImageCount++;
} }
} }
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");
fileBuffer.append(Integer.toString(unloadImageCount)); fileBuffer.append(Integer.toString(unloadImageCount));
fileBuffer.append(";\r\n\r\n"); fileBuffer.append(";\r\n\r\n");
@ -1058,8 +1043,7 @@ public class AutoGen {
// If entry point is null, create a empty ProcessModuleEntryPointList function. // If entry point is null, create a empty ProcessModuleEntryPointList function.
// //
if (entryPointList == null || entryPointList.length == 0) { if (entryPointList == null || entryPointList.length == 0) {
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = 0;\r\n");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = 0;\r\n");
fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFI_STATUS\r\n");
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
fileBuffer.append("ProcessModuleEntryPointList (\r\n"); fileBuffer.append("ProcessModuleEntryPointList (\r\n");
@ -1082,15 +1066,12 @@ public class AutoGen {
entryPointCount++; entryPointCount++;
} }
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
fileBuffer.append(Integer.toString(entryPointCount)); fileBuffer.append(Integer.toString(entryPointCount));
fileBuffer.append(";\r\n"); fileBuffer.append(";\r\n");
if (entryPointCount > 1) { if (entryPointCount > 1) {
fileBuffer fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n");
.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n"); fileBuffer.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n");
fileBuffer
.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n");
} }
fileBuffer.append("\n"); fileBuffer.append("\n");
@ -1103,14 +1084,17 @@ public class AutoGen {
fileBuffer.append("{\r\n"); fileBuffer.append("{\r\n");
if (entryPointCount == 1) { if (entryPointCount == 1) {
fileBuffer.append(" return ("); //fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[0], entryPointList[0]));
fileBuffer.append(" return ");
fileBuffer.append(entryPointList[0]); fileBuffer.append(entryPointList[0]);
fileBuffer.append(" (ImageHandle, SystemTable));\r\n"); fileBuffer.append(" (ImageHandle, SystemTable);\r\n");
} else { } 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 fileBuffer.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
.append(" if (SetJump (&mJumpContext) == 0) {\r\n"); //fileBuffer.append(" DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[i] + "));\n");
fileBuffer.append(String.format(" " + debugStr, entryPointList[i], entryPointList[i]));
fileBuffer.append(" ExitDriver ("); fileBuffer.append(" ExitDriver (");
fileBuffer.append(entryPointList[i]); fileBuffer.append(entryPointList[i]);
fileBuffer.append(" (ImageHandle, SystemTable));\r\n"); fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
@ -1132,21 +1116,18 @@ public class AutoGen {
fileBuffer.append("{\r\n"); fileBuffer.append("{\r\n");
if (entryPointCount <= 1) { if (entryPointCount <= 1) {
fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n"); fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
fileBuffer fileBuffer.append(" ProcessLibraryDestructorList (gImageHandle, gST);\r\n");
.append(" ProcessLibraryDestructorList (gImageHandle, gST);\r\n");
fileBuffer.append(" }\r\n"); fileBuffer.append(" }\r\n");
fileBuffer fileBuffer
.append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n"); .append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");
} else { } else {
fileBuffer fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n"); fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n");
fileBuffer.append(" }\r\n"); fileBuffer.append(" }\r\n");
fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n"); fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");
fileBuffer.append(" ASSERT (FALSE);\r\n"); fileBuffer.append(" ASSERT (FALSE);\r\n");
} }
fileBuffer.append("}\r\n\r\n"); fileBuffer.append("}\r\n\r\n");
} }
// //
@ -1165,15 +1146,13 @@ public class AutoGen {
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
fileBuffer.append(unloadImageList[i]); fileBuffer.append(unloadImageList[i]);
fileBuffer.append(" (\r\n"); fileBuffer.append(" (\r\n");
fileBuffer fileBuffer.append(" IN EFI_HANDLE ImageHandle\r\n");
.append(" IN EFI_HANDLE ImageHandle\r\n");
fileBuffer.append(" );\r\n"); fileBuffer.append(" );\r\n");
unloadImageCount++; unloadImageCount++;
} }
} }
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");
fileBuffer.append(Integer.toString(unloadImageCount)); fileBuffer.append(Integer.toString(unloadImageCount));
fileBuffer.append(";\r\n\r\n"); fileBuffer.append(";\r\n\r\n");
@ -1255,8 +1234,7 @@ public class AutoGen {
ppiKeyWord = ppiIterator.next().toString(); ppiKeyWord = ppiIterator.next().toString();
cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, ppiKeyWord); cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, 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(CommonDefinition.formatGuidName(cNameGuid[1])); fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
@ -1294,8 +1272,7 @@ public class AutoGen {
this.mProtocolList.add(protocolList[i]); this.mProtocolList.add(protocolList[i]);
} }
String[] protocolNotifyList = saq String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch);
.getProtocolNotifyArray(this.arch);
for (int i = 0; i < protocolNotifyList.length; i++) { for (int i = 0; i < protocolNotifyList.length; i++) {
this.mProtocolList.add(protocolNotifyList[i]); this.mProtocolList.add(protocolNotifyList[i]);
@ -1312,8 +1289,7 @@ public class AutoGen {
protocolKeyWord = protocolIterator.next().toString(); protocolKeyWord = protocolIterator.next().toString();
cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord); cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, 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(CommonDefinition.formatGuidName(cNameGuid[1])); fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
@ -1355,8 +1331,7 @@ public class AutoGen {
cNameGuid = GlobalData.getGuid(this.mDepPkgList, guidKeyWord); cNameGuid = GlobalData.getGuid(this.mDepPkgList, 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(CommonDefinition.formatGuidName(cNameGuid[1])); fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
@ -1443,10 +1418,8 @@ public class AutoGen {
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
fileBuffer.append(libInstanceList.get(i)[0]); fileBuffer.append(libInstanceList.get(i)[0]);
fileBuffer.append(" (\r\n"); fileBuffer.append(" (\r\n");
fileBuffer fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n"); fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
fileBuffer
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
fileBuffer.append(" );\r\n"); fileBuffer.append(" );\r\n");
break; break;
@ -1594,10 +1567,8 @@ public class AutoGen {
fileBuffer.append("EFIAPI\r\n"); fileBuffer.append("EFIAPI\r\n");
fileBuffer.append(libInstanceList.get(i)[0]); fileBuffer.append(libInstanceList.get(i)[0]);
fileBuffer.append(" (\r\n"); fileBuffer.append(" (\r\n");
fileBuffer fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n"); fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
fileBuffer
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
fileBuffer.append(" );\r\n"); fileBuffer.append(" );\r\n");
break; break;
case CommonDefinition.ModuleTypeDxeCore: case CommonDefinition.ModuleTypeDxeCore:
@ -1760,16 +1731,14 @@ public class AutoGen {
// //
// Write driver module protocol bitmask. // Write driver module protocol bitmask.
// //
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverModelProtocolBitmask = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverModelProtocolBitmask = ");
fileBuffer.append(Integer.toString(BitMask)); fileBuffer.append(Integer.toString(BitMask));
fileBuffer.append(";\r\n"); fileBuffer.append(";\r\n");
// //
// Write driver module protocol list entry // Write driver module protocol list entry
// //
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverModelProtocolListEntries = ");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverModelProtocolListEntries = ");
fileBuffer.append(Integer.toString(driverBindingGroup.length)); fileBuffer.append(Integer.toString(driverBindingGroup.length));
fileBuffer.append(";\r\n"); fileBuffer.append(";\r\n");
@ -1778,8 +1747,7 @@ public class AutoGen {
// Write drive module protocol list to autogen.c // Write drive module protocol list to autogen.c
// //
if (driverBindingGroup.length > 0) { if (driverBindingGroup.length > 0) {
fileBuffer fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {");
.append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {");
} }
@ -2057,8 +2025,7 @@ public class AutoGen {
// Entry point lib for these module types needs to know the count // Entry point lib for these module types needs to know the count
// of entryPoint. // of entryPoint.
// //
fileBuffer fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");
// //
// If the list is not valid or has no entries set count to zero else // If the list is not valid or has no entries set count to zero else
@ -2081,8 +2048,7 @@ public class AutoGen {
// //
// No data so make a NULL list // No data so make a NULL list
// //
fileBuffer fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");
fileBuffer.append(" NULL\r\n"); fileBuffer.append(" NULL\r\n");
fileBuffer.append("};\r\n\r\n"); fileBuffer.append("};\r\n\r\n");
} else { } else {
@ -2105,8 +2071,7 @@ public class AutoGen {
// //
// Write SetVirtualAddressMap entry point array. // Write SetVirtualAddressMap entry point array.
// //
fileBuffer fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");
for (i = 0; i < this.setVirtalAddList.size(); i++) { for (i = 0; i < this.setVirtalAddList.size(); i++) {
if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) { if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
break; break;
@ -2157,8 +2122,7 @@ public class AutoGen {
// //
// No data so make a NULL list. // No data so make a NULL list.
// //
fileBuffer fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");
fileBuffer.append(" NULL\r\n"); fileBuffer.append(" NULL\r\n");
fileBuffer.append("};\r\n\r\n"); fileBuffer.append("};\r\n\r\n");
} else { } else {
@ -2182,8 +2146,7 @@ public class AutoGen {
// //
// Write DriverExitBootServices entry point array. // Write DriverExitBootServices entry point array.
// //
fileBuffer fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");
.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");
for (i = 0; i < this.exitBootServiceList.size(); i++) { for (i = 0; i < this.exitBootServiceList.size(); i++) {
if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) { if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
break; break;