summaryrefslogtreecommitdiff
path: root/Tools/Source/GenBuild
diff options
context:
space:
mode:
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-29 07:36:14 +0000
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-29 07:36:14 +0000
commitc60019f637b21263c1e3063c41a5bc59cd26a8d8 (patch)
tree13d41db60c0464e4e82a595a35ce9fcba32d71bc /Tools/Source/GenBuild
parent04a13d6c501bd4b70331a11a88d480bb254a3693 (diff)
downloadedk2-c60019f637b21263c1e3063c41a5bc59cd26a8d8.zip
edk2-c60019f637b21263c1e3063c41a5bc59cd26a8d8.tar.gz
edk2-c60019f637b21263c1e3063c41a5bc59cd26a8d8.tar.bz2
Modify the Autogen.java for <SetVirtualAddressMapCallBack> and
<ExitBootServicesCallBack> only working on module type as DXE_DRIVER, DXE_RUNTIME_DRIVER,DXE_SAL_DRIVER,UEFI_DRIVER, UEFI_APPLICATION. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1401 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/GenBuild')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java318
1 files changed, 158 insertions, 160 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
index 80cdecf..e385dea 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
@@ -1843,175 +1843,22 @@ public class AutoGen {
// and <ExitBootServicesCallBack>
//
String moduleType = this.moduleId.getModuleType();
- boolean UefiOrDxeModule = false;
- int Count = 0;
- int i;
switch (CommonDefinition.getModuleType(moduleType)) {
case CommonDefinition.ModuleTypeDxeDriver:
case CommonDefinition.ModuleTypeDxeRuntimeDriver:
case CommonDefinition.ModuleTypeDxeSalDriver:
case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- //
- // Entry point lib for these module types needs to know the count
- // of entryPoint.
- //
- UefiOrDxeModule = true;
- fileBuffer
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");
-
- //
- // If the list is not valid or has no entries set count to zero else
- // set count to the number of valid entries
- //
- Count = 0;
- if (this.setVirtalAddList != null) {
- for (i = 0; i < this.setVirtalAddList.size(); i++) {
- if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
- break;
- }
- }
- Count = i;
- }
-
- fileBuffer.append(Integer.toString(Count));
- fileBuffer.append(";\r\n\r\n");
+ case CommonDefinition.ModuleTypeUefiApplication:
+ //
+ // If moduleType is one of above, call setVirtualAddressToAutogenC,
+ // and setExitBootServiceToAutogenC.
+ //
+ setVirtualAddressToAutogenC(fileBuffer);
+ setExitBootServiceToAutogenC(fileBuffer);
break;
default:
break;
}
-
- if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {
- if (UefiOrDxeModule) {
- //
- // No data so make a NULL list
- //
- fileBuffer
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");
- fileBuffer.append(" NULL\r\n");
- fileBuffer.append("};\r\n\r\n");
- }
- } else {
- //
- // Write SetVirtualAddressMap function definition.
- //
- for (i = 0; i < this.setVirtalAddList.size(); i++) {
- if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
- break;
- }
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append(this.setVirtalAddList.get(i));
- fileBuffer.append(" (\r\n");
- fileBuffer.append(" IN EFI_EVENT Event,\r\n");
- fileBuffer.append(" IN VOID *Context\r\n");
- fileBuffer.append(" );\r\n\r\n");
- }
-
- //
- // Write SetVirtualAddressMap entry point array.
- //
- fileBuffer
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");
- for (i = 0; i < this.setVirtalAddList.size(); i++) {
- if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
- break;
- }
-
- if (i == 0) {
- fileBuffer.append("\r\n ");
- } else {
- fileBuffer.append(",\r\n ");
- }
-
- fileBuffer.append(this.setVirtalAddList.get(i));
- }
- //
- // 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");
- }
-
- if (UefiOrDxeModule) {
- //
- // Entry point lib for these module types needs to know the count.
- //
- fileBuffer
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverExitBootServicesEventCount = ");
-
- //
- // If the list is not valid or has no entries set count to zero else
- // set count to the number of valid entries.
- //
- Count = 0;
- if (this.exitBootServiceList != null) {
- for (i = 0; i < this.exitBootServiceList.size(); i++) {
- if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
- break;
- }
- }
- Count = i;
- }
- fileBuffer.append(Integer.toString(Count));
- fileBuffer.append(";\r\n\r\n");
- }
-
- if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {
- if (UefiOrDxeModule) {
- //
- // No data so make a NULL list.
- //
- fileBuffer
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");
- fileBuffer.append(" NULL\r\n");
- fileBuffer.append("};\r\n\r\n");
- }
- } else {
- //
- // Write DriverExitBootServices function definition.
- //
- for (i = 0; i < this.exitBootServiceList.size(); i++) {
- if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
- break;
- }
-
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append(this.exitBootServiceList.get(i));
- fileBuffer.append(" (\r\n");
- fileBuffer.append(" IN EFI_EVENT Event,\r\n");
- fileBuffer.append(" IN VOID *Context\r\n");
- fileBuffer.append(" );\r\n\r\n");
- }
-
- //
- // Write DriverExitBootServices entry point array.
- //
- fileBuffer
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");
- for (i = 0; i < this.exitBootServiceList.size(); i++) {
- if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
- break;
- }
-
- if (i == 0) {
- fileBuffer.append("\r\n ");
- } else {
- fileBuffer.append(",\r\n ");
- }
- fileBuffer.append(this.exitBootServiceList.get(i));
- }
- if (!UefiOrDxeModule) {
- fileBuffer.append(",\r\n NULL");
- }
- fileBuffer.append("\r\n};\r\n\r\n");
- }
-
}
/**
@@ -2190,4 +2037,155 @@ public class AutoGen {
System.out.println("Collect library instance failed!");
}
}
+ private void setVirtualAddressToAutogenC(StringBuffer fileBuffer){
+ //
+ // Entry point lib for these module types needs to know the count
+ // of entryPoint.
+ //
+ fileBuffer
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");
+
+ //
+ // If the list is not valid or has no entries set count to zero else
+ // set count to the number of valid entries
+ //
+ int Count = 0;
+ int i = 0;
+ if (this.setVirtalAddList != null) {
+ for (i = 0; i < this.setVirtalAddList.size(); i++) {
+ if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
+ break;
+ }
+ }
+ Count = i;
+ }
+
+ fileBuffer.append(Integer.toString(Count));
+ fileBuffer.append(";\r\n\r\n");
+ if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {
+ //
+ // No data so make a NULL list
+ //
+ fileBuffer
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");
+ fileBuffer.append(" NULL\r\n");
+ fileBuffer.append("};\r\n\r\n");
+ } else {
+ //
+ // Write SetVirtualAddressMap function definition.
+ //
+ for (i = 0; i < this.setVirtalAddList.size(); i++) {
+ if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
+ break;
+ }
+ fileBuffer.append("VOID\r\n");
+ fileBuffer.append("EFIAPI\r\n");
+ fileBuffer.append(this.setVirtalAddList.get(i));
+ fileBuffer.append(" (\r\n");
+ fileBuffer.append(" IN EFI_EVENT Event,\r\n");
+ fileBuffer.append(" IN VOID *Context\r\n");
+ fileBuffer.append(" );\r\n\r\n");
+ }
+
+ //
+ // Write SetVirtualAddressMap entry point array.
+ //
+ fileBuffer
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");
+ for (i = 0; i < this.setVirtalAddList.size(); i++) {
+ if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
+ break;
+ }
+
+ if (i == 0) {
+ fileBuffer.append("\r\n ");
+ } else {
+ fileBuffer.append(",\r\n ");
+ }
+
+ fileBuffer.append(this.setVirtalAddList.get(i));
+ }
+ //
+ // add the NULL at the end of _gDriverSetVirtualAddressMapEvent list.
+ //
+ fileBuffer.append(",\r\n NULL");
+ fileBuffer.append("\r\n};\r\n\r\n");
+ }
+ }
+
+
+ private void setExitBootServiceToAutogenC(StringBuffer fileBuffer){
+ //
+ // Entry point lib for these module types needs to know the count.
+ //
+ fileBuffer
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverExitBootServicesEventCount = ");
+
+ //
+ // If the list is not valid or has no entries set count to zero else
+ // set count to the number of valid entries.
+ //
+ int Count = 0;
+ int i = 0;
+ if (this.exitBootServiceList != null) {
+ for (i = 0; i < this.exitBootServiceList.size(); i++) {
+ if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
+ break;
+ }
+ }
+ Count = i;
+ }
+ fileBuffer.append(Integer.toString(Count));
+ fileBuffer.append(";\r\n\r\n");
+
+ if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {
+ //
+ // No data so make a NULL list.
+ //
+ fileBuffer
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");
+ fileBuffer.append(" NULL\r\n");
+ fileBuffer.append("};\r\n\r\n");
+ } else {
+ //
+ // Write DriverExitBootServices function definition.
+ //
+ for (i = 0; i < this.exitBootServiceList.size(); i++) {
+ if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
+ break;
+ }
+
+ fileBuffer.append("VOID\r\n");
+ fileBuffer.append("EFIAPI\r\n");
+ fileBuffer.append(this.exitBootServiceList.get(i));
+ fileBuffer.append(" (\r\n");
+ fileBuffer.append(" IN EFI_EVENT Event,\r\n");
+ fileBuffer.append(" IN VOID *Context\r\n");
+ fileBuffer.append(" );\r\n\r\n");
+ }
+
+ //
+ // Write DriverExitBootServices entry point array.
+ //
+ fileBuffer
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");
+ for (i = 0; i < this.exitBootServiceList.size(); i++) {
+ if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
+ break;
+ }
+
+ if (i == 0) {
+ fileBuffer.append("\r\n ");
+ } else {
+ fileBuffer.append(",\r\n ");
+ }
+ fileBuffer.append(this.exitBootServiceList.get(i));
+ }
+
+ fileBuffer.append(",\r\n NULL");
+ fileBuffer.append("\r\n};\r\n\r\n");
+ }
+
+ }
+
}