summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-19 06:25:21 +0000
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-19 06:25:21 +0000
commitf9081b646d7748e4a035ef736c13a92bc8d9681b (patch)
tree031a445fd180604fb68750e6673b9821f2d55326
parent8fc81f2a883015d461a495d1e9d0fa58b16f48b5 (diff)
downloadedk2-platforms-f9081b646d7748e4a035ef736c13a92bc8d9681b.tar.xz
1) Added prototype of constructor and destructor in the library's AutoGen.h. This is necessary for Intel Compiler.
2) Corrected the prototype destructor of EdkUefiRuntimeLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2271 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c3
-rw-r--r--EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c3
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java153
3 files changed, 155 insertions, 4 deletions
diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c
index 1b11dfb5fa..335a9b9bc7 100644
--- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c
+++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeLib.c
@@ -129,7 +129,8 @@ RuntimeDriverLibConstruct (
EFI_STATUS
EFIAPI
RuntimeDriverLibDeconstruct (
- VOID
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
index 7ef24d4938..9fa1d1610d 100644
--- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
+++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
@@ -142,7 +142,8 @@ Returns:
EFI_STATUS
EFIAPI
RuntimeDriverLibDeconstruct (
- VOID
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
index c6d0d342cd..8bb77af3d1 100644
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
+++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
@@ -620,12 +620,15 @@ public class AutoGen {
fileBuffer.append("\n");
fileBuffer.append(this.myPcdAutogen.getHAutoGenString());
}
-
+ //
+ // generate function prototype for constructor and destructor
+ //
+ LibConstructorToAutogenH(moduleType, fileBuffer);
+ LibDestructorToAutogenH(moduleType, fileBuffer);
//
// Append the #endif at AutoGen.h
//
fileBuffer.append("#endif\n");
-
//
// Save content of string buffer to AutoGen.h file.
//
@@ -1363,6 +1366,152 @@ public class AutoGen {
}
/**
+ LibConstructorToAutogenH
+
+ This function writes library constructor declarations AutoGen.h. The library
+ constructor's parameter and return value depend on module type.
+
+ @param libInstanceList
+ List of library construct name.
+ @param moduleType
+ Module type.
+ @param fileBuffer
+ String buffer for AutoGen.c
+ @throws Exception
+ **/
+ void LibConstructorToAutogenH(String moduleType, StringBuffer fileBuffer) throws EdkException {
+ boolean isFirst = true;
+
+ //
+ // If not yet parse this library instance's constructor
+ // element,parse it.
+ //
+ String libConstructName = saq.getLibConstructorName();
+ if (libConstructName == null) {
+ return;
+ }
+
+ //
+ // The library constructor's parameter and return value depend on
+ // module type.
+ //
+ if (moduleType.equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
+ fileBuffer.append("RETURN_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libConstructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" VOID\n");
+ fileBuffer.append(" );\n");
+ } else {
+ switch (CommonDefinition.getModuleType(moduleType)) {
+ case CommonDefinition.ModuleTypeBase:
+ fileBuffer.append("RETURN_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libConstructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" VOID\n");
+ fileBuffer.append(" );\n");
+ break;
+
+ case CommonDefinition.ModuleTypePeiCore:
+ case CommonDefinition.ModuleTypePeim:
+ fileBuffer.append("EFI_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libConstructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\n");
+ fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\n");
+ fileBuffer.append(" );\n");
+ break;
+
+ case CommonDefinition.ModuleTypeDxeCore:
+ case CommonDefinition.ModuleTypeDxeDriver:
+ case CommonDefinition.ModuleTypeDxeRuntimeDriver:
+ case CommonDefinition.ModuleTypeDxeSmmDriver:
+ case CommonDefinition.ModuleTypeDxeSalDriver:
+ case CommonDefinition.ModuleTypeUefiDriver:
+ case CommonDefinition.ModuleTypeUefiApplication:
+ fileBuffer.append("EFI_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libConstructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" IN EFI_HANDLE ImageHandle,\n");
+ fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\n");
+ fileBuffer.append(" );\n");
+ break;
+
+ }
+ }
+ }
+
+ /**
+ LibDestructorToAutogenH
+
+ This function writes library destructor declarations AutoGen.h. The library
+ destructor's parameter and return value depend on module type.
+
+ @param libInstanceList
+ List of library destructor name.
+ @param moduleType
+ Module type.
+ @param fileBuffer
+ String buffer for AutoGen.c
+ @throws Exception
+ **/
+ void LibDestructorToAutogenH(String moduleType, StringBuffer fileBuffer) throws EdkException {
+ boolean isFirst = true;
+ String libDestructName = saq.getLibDestructorName();
+ if (libDestructName == null) {
+ return;
+ }
+
+ if (moduleType.equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
+ fileBuffer.append("RETURN_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libDestructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" VOID\n");
+ fileBuffer.append(" );\n");
+ } else {
+ switch (CommonDefinition.getModuleType(moduleType)) {
+ case CommonDefinition.ModuleTypeBase:
+ fileBuffer.append("RETURN_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libDestructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" VOID\n");
+ fileBuffer.append(" );\n");
+ break;
+ case CommonDefinition.ModuleTypePeiCore:
+ case CommonDefinition.ModuleTypePeim:
+ fileBuffer.append("EFI_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libDestructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\n");
+ fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\n");
+ fileBuffer.append(" );\n");
+ break;
+ case CommonDefinition.ModuleTypeDxeCore:
+ case CommonDefinition.ModuleTypeDxeDriver:
+ case CommonDefinition.ModuleTypeDxeRuntimeDriver:
+ case CommonDefinition.ModuleTypeDxeSmmDriver:
+ case CommonDefinition.ModuleTypeDxeSalDriver:
+ case CommonDefinition.ModuleTypeUefiDriver:
+ case CommonDefinition.ModuleTypeUefiApplication:
+ fileBuffer.append("EFI_STATUS\n");
+ fileBuffer.append("EFIAPI\n");
+ fileBuffer.append(libDestructName);
+ fileBuffer.append(" (\n");
+ fileBuffer.append(" IN EFI_HANDLE ImageHandle,\n");
+ fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\n");
+ fileBuffer.append(" );\n");
+ break;
+ }
+ }
+ }
+
+ /**
LibConstructorToAutogenc
This function writes library constructor list to AutoGen.c. The library