Fixed EDKT498(enchance makedep tool to support asm file), EDKT500(dep file needs...
[mirror_edk2.git] / Tools / Java / Source / GenBuild / org / tianocore / build / autogen / AutoGen.java
index f1f0fc0..bf04cc2 100644 (file)
@@ -124,12 +124,12 @@ public class AutoGen {
     //\r
     private boolean componentNamePcd = false;\r
     private boolean driverDiagnostPcd = false;\r
-    \r
+\r
     //\r
     // Instance of SurfaceAreaQuery\r
     //\r
     private SurfaceAreaQuery saq = null;\r
-    \r
+\r
     private ModuleIdentification parentId = null;\r
 \r
     /**\r
@@ -169,7 +169,7 @@ public class AutoGen {
                  "false" failed\r
     **/\r
     private boolean saveFile(String fileName, StringBuffer fileBuffer) {\r
-        \r
+\r
         File autoGenH = new File(fileName);\r
 \r
         //\r
@@ -183,9 +183,9 @@ public class AutoGen {
                 fIn.close();\r
             } catch (IOException e) {\r
                 EdkLog.log(EdkLog.EDK_INFO, this.moduleId.getName() \r
-                                            + "'s " \r
-                                            + fileName \r
-                                            + " is exist, but can't be open!!");\r
+                           + "'s " \r
+                           + fileName \r
+                           + " is exist, but can't be open!!");\r
                 return false;\r
             }\r
 \r
@@ -197,7 +197,7 @@ public class AutoGen {
                 return true;\r
             }\r
         }\r
-        \r
+\r
         try {\r
             FileWriter fOut = new FileWriter(autoGenH);\r
             fOut.write(fileBuffer.toString());\r
@@ -205,11 +205,11 @@ public class AutoGen {
             fOut.close();\r
         } catch (IOException e) {\r
             EdkLog.log(EdkLog.EDK_INFO, this.moduleId.getName() \r
-                                        + "'s " \r
-                                        + fileName \r
-                                        + " can't be create!!");\r
+                       + "'s " \r
+                       + fileName \r
+                       + " can't be create!!");\r
             return false;\r
-        } \r
+        }\r
         return true;\r
     }\r
 \r
@@ -228,7 +228,7 @@ public class AutoGen {
         //\r
         File path = new File(outputPath);\r
         path.mkdirs();\r
-        \r
+\r
         //\r
         // Check current is library or not, then call the corresponding\r
         // function.\r
@@ -249,8 +249,8 @@ public class AutoGen {
                   Faile to create module AutoGen.c & AutoGen.h.\r
     **/\r
     void moduleGenAutogen() throws EdkException {\r
-       setPcdComponentName();\r
-       setPcdDriverDiagnostic();\r
+        setPcdComponentName();\r
+        setPcdDriverDiagnostic();\r
         collectLibInstanceInfo();\r
         moduleGenAutogenC();\r
         moduleGenAutogenH();\r
@@ -296,14 +296,14 @@ public class AutoGen {
         // #def ${BseeName}_AUTOGENH\r
         //\r
         fileBuffer.append(CommonDefinition.IFNDEF \r
-                                      + CommonDefinition.AUTOGENH\r
-                                      + this.moduleId.getGuid().replaceAll("-", "_") \r
-                                      + ToolDefinitions.LINE_SEPARATOR);\r
+                          + CommonDefinition.AUTOGENH\r
+                          + this.moduleId.getGuid().replaceAll("-", "_") \r
+                          + ToolDefinitions.LINE_SEPARATOR);\r
         fileBuffer.append(CommonDefinition.DEFINE \r
-                                      + CommonDefinition.AUTOGENH\r
-                                      + this.moduleId.getGuid().replaceAll("-", "_") \r
-                                      + ToolDefinitions.LINE_SEPARATOR \r
-                                      + ToolDefinitions.LINE_SEPARATOR);\r
+                          + CommonDefinition.AUTOGENH\r
+                          + this.moduleId.getGuid().replaceAll("-", "_") \r
+                          + ToolDefinitions.LINE_SEPARATOR \r
+                          + ToolDefinitions.LINE_SEPARATOR);\r
 \r
         //\r
         // Write the specification version and release version at the begine\r
@@ -443,8 +443,8 @@ public class AutoGen {
         String[] entryPointList = saq.getModuleEntryPointArray();\r
         String[] unloadImageList = saq.getModuleUnloadImageArray();\r
         EntryPointToAutoGen(CommonDefinition.remDupString(entryPointList), \r
-                                        CommonDefinition.remDupString(unloadImageList),\r
-                                        fileBuffer);\r
+                            CommonDefinition.remDupString(unloadImageList),\r
+                            fileBuffer);\r
 \r
         pcdDriverType = saq.getPcdDriverType();\r
 \r
@@ -458,13 +458,11 @@ public class AutoGen {
         //\r
         String guid = CommonDefinition.formatGuidName(saq.getModuleGuid());\r
         if (this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
-                        fileBuffer\r
-            .append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {");\r
-                } else {\r
-                        fileBuffer\r
-            .append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");\r
-                }\r
-        \r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {");\r
+        } else {\r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");\r
+        }\r
+\r
         if (guid == null) {\r
             throw new AutoGenException("Guid value must set!\n");\r
         }\r
@@ -513,7 +511,7 @@ public class AutoGen {
                                                  null,\r
                                                  pcdDriverType, \r
                                                  parentId);\r
-        \r
+\r
         this.myPcdAutogen.execute();\r
         if (this.myPcdAutogen != null) {\r
             fileBuffer.append("\r\n");\r
@@ -552,14 +550,14 @@ public class AutoGen {
         // #def ${BseeName}_AUTOGENH\r
         //\r
         fileBuffer.append(CommonDefinition.IFNDEF \r
-                                      + CommonDefinition.AUTOGENH\r
-                                      + this.moduleId.getGuid().replaceAll("-", "_") \r
-                                      + ToolDefinitions.LINE_SEPARATOR);\r
+                          + CommonDefinition.AUTOGENH\r
+                          + this.moduleId.getGuid().replaceAll("-", "_") \r
+                          + ToolDefinitions.LINE_SEPARATOR);\r
         fileBuffer.append(CommonDefinition.DEFINE \r
-                                      + CommonDefinition.AUTOGENH\r
-                                      + this.moduleId.getGuid().replaceAll("-", "_") \r
-                                      + ToolDefinitions.LINE_SEPARATOR \r
-                                      + ToolDefinitions.LINE_SEPARATOR);\r
+                          + CommonDefinition.AUTOGENH\r
+                          + this.moduleId.getGuid().replaceAll("-", "_") \r
+                          + ToolDefinitions.LINE_SEPARATOR \r
+                          + ToolDefinitions.LINE_SEPARATOR);\r
 \r
         //\r
         // Write EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION\r
@@ -590,8 +588,7 @@ public class AutoGen {
         //\r
         // Write library class's related *.h file to autogen.h\r
         //\r
-        String[] libClassList = saq\r
-                                .getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch);\r
+        String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch);\r
         if (libClassList != null) {\r
             libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
             item = libClassIncludeH.iterator();\r
@@ -600,8 +597,7 @@ public class AutoGen {
             }\r
         }\r
 \r
-        libClassList = saq\r
-                       .getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
+        libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
         if (libClassList != null) {\r
             libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
             item = libClassIncludeH.iterator();\r
@@ -705,10 +701,10 @@ public class AutoGen {
         //\r
         for (int i = 0; i < libClassList.length; i++) {\r
             includeName = GlobalData.getLibraryClassHeaderFiles(\r
-                                                                saq.getDependencePkg(this.arch),\r
-                                                                libClassList[i]);\r
-        if (includeName == null) {\r
-            throw new AutoGenException("Can not find library class ["\r
+                                                               saq.getDependencePkg(this.arch),\r
+                                                               libClassList[i]);\r
+            if (includeName == null) {\r
+                throw new AutoGenException("Can not find library class ["\r
                                            + libClassList[i] + "] declaration in any SPD package. ");\r
             }\r
             for (int j = 0; j < includeName.length; j++) {\r
@@ -778,7 +774,8 @@ public class AutoGen {
     throws EdkException {\r
 \r
         String typeStr = saq.getModuleType();\r
-                int unloadImageCount = 0;\r
+        String debugStr = "DEBUG ((EFI_D_INFO | EFI_D_LOAD, \"Module Entry Point (%s) 0x%%p\\n\", (VOID *)(UINTN)%s));\n";\r
+        int unloadImageCount = 0;\r
         int entryPointCount  = 0;\r
 \r
         //\r
@@ -790,26 +787,24 @@ public class AutoGen {
         case CommonDefinition.ModuleTypePeiCore:\r
             if (entryPointList == null ||entryPointList.length != 1 ) {\r
                 throw new AutoGenException(\r
-                                        "Module type = 'PEI_CORE', can have only one module entry point!");\r
+                                          "Module type = 'PEI_CORE', can have only one module entry point!");\r
             } else {\r
                 fileBuffer.append("EFI_STATUS\r\n");\r
                 fileBuffer.append(entryPointList[0]);\r
                 fileBuffer.append(" (\r\n");\r
-                fileBuffer\r
-                .append("  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\r\n");\r
-                fileBuffer\r
-                .append("  IN VOID                        *OldCoreData\r\n");\r
+                fileBuffer.append("  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\r\n");\r
+                fileBuffer.append("  IN VOID                        *OldCoreData\r\n");\r
                 fileBuffer.append("  );\r\n\r\n");\r
 \r
                 fileBuffer.append("EFI_STATUS\r\n");\r
                 fileBuffer.append("EFIAPI\r\n");\r
                 fileBuffer.append("ProcessModuleEntryPointList (\r\n");\r
-                fileBuffer\r
-                .append("  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\r\n");\r
-                fileBuffer\r
-                .append("  IN VOID                        *OldCoreData\r\n");\r
+                fileBuffer.append("  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\r\n");\r
+                fileBuffer.append("  IN VOID                        *OldCoreData\r\n");\r
                 fileBuffer.append("  )\r\n\r\n");\r
                 fileBuffer.append("{\r\n");\r
+                // fileBuffer.append("  DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");\r
+                fileBuffer.append(String.format("  " + debugStr, entryPointList[0], entryPointList[0]));\r
                 fileBuffer.append("  return ");\r
                 fileBuffer.append(entryPointList[0]);\r
                 fileBuffer.append(" (PeiStartupDescriptor, OldCoreData);\r\n");\r
@@ -820,10 +815,8 @@ public class AutoGen {
         case CommonDefinition.ModuleTypeDxeCore:\r
             fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");\r
             if (entryPointList == null || entryPointList.length != 1) {\r
-                throw new AutoGenException(\r
-                                        "Module type = 'DXE_CORE', can have only one module entry point!");\r
+                throw new AutoGenException("Module type = 'DXE_CORE', can have only one module entry point!");\r
             } else {\r
-\r
                 fileBuffer.append("VOID\r\n");\r
                 fileBuffer.append(entryPointList[0]);\r
                 fileBuffer.append(" (\n");\r
@@ -836,6 +829,8 @@ public class AutoGen {
                 fileBuffer.append("  IN VOID  *HobStart\r\n");\r
                 fileBuffer.append("  )\r\n\r\n");\r
                 fileBuffer.append("{\r\n");\r
+                //fileBuffer.append("  DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");\r
+                fileBuffer.append(String.format("  " + debugStr, entryPointList[0], entryPointList[0]));\r
                 fileBuffer.append("  ");\r
                 fileBuffer.append(entryPointList[0]);\r
                 fileBuffer.append(" (HobStart);\r\n");\r
@@ -845,8 +840,7 @@ public class AutoGen {
 \r
         case CommonDefinition.ModuleTypePeim:\r
             entryPointCount = 0;\r
-            fileBuffer\r
-            .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");\r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");\r
             if (entryPointList == null || entryPointList.length == 0) {\r
                 fileBuffer.append("EFI_STATUS\r\n");\r
                 fileBuffer.append("EFIAPI\r\n");\r
@@ -863,13 +857,10 @@ public class AutoGen {
                 fileBuffer.append("EFI_STATUS\r\n");\r
                 fileBuffer.append(entryPointList[i]);\r
                 fileBuffer.append(" (\r\n");\r
-                fileBuffer\r
-                .append("  IN EFI_FFS_FILE_HEADER  *FfsHeader,\r\n");\r
-                fileBuffer\r
-                .append("  IN EFI_PEI_SERVICES     **PeiServices\r\n");\r
+                fileBuffer.append("  IN EFI_FFS_FILE_HEADER  *FfsHeader,\r\n");\r
+                fileBuffer.append("  IN EFI_PEI_SERVICES     **PeiServices\r\n");\r
                 fileBuffer.append("  );\r\n");\r
                 entryPointCount++;\r
-\r
             }\r
 \r
             fileBuffer.append("EFI_STATUS\r\n");\r
@@ -880,6 +871,8 @@ public class AutoGen {
             fileBuffer.append("  )\r\n\r\n");\r
             fileBuffer.append("{\r\n");\r
             if (entryPointCount == 1) {\r
+                //fileBuffer.append("  DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");\r
+                fileBuffer.append(String.format("  " + debugStr, entryPointList[0], entryPointList[0]));\r
                 fileBuffer.append("  return ");\r
                 fileBuffer.append(entryPointList[0]);\r
                 fileBuffer.append(" (FfsHeader, PeiServices);\r\n");\r
@@ -889,11 +882,12 @@ public class AutoGen {
                 fileBuffer.append("  CombinedStatus = EFI_LOAD_ERROR;\r\n\r\n");\r
                 for (int i = 0; i < entryPointList.length; i++) {\r
                     if (!entryPointList[i].equals("")) {\r
+                        //fileBuffer.append("  DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[i] + "));\n");\r
+                        fileBuffer.append(String.format("  " + debugStr, entryPointList[i], entryPointList[i]));\r
                         fileBuffer.append("  Status = ");\r
                         fileBuffer.append(entryPointList[i]);\r
                         fileBuffer.append(" (FfsHeader, PeiServices);\r\n");\r
-                        fileBuffer\r
-                        .append("  if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\r\n");\r
+                        fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\r\n");\r
                         fileBuffer.append("    CombinedStatus = Status;\r\n");\r
                         fileBuffer.append("  }\r\n\r\n");\r
                     } else {\r
@@ -912,8 +906,7 @@ public class AutoGen {
             // function.\r
             //\r
             if (entryPointList == null || entryPointList.length == 0) {\r
-                fileBuffer\r
-                .append("GLOBAL_REMOVE_IF_UNREFERENCED  const UINT8  _gDriverEntryPointCount = ");\r
+                fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED  const UINT8  _gDriverEntryPointCount = ");\r
                 fileBuffer.append(Integer.toString(entryPointCount));\r
                 fileBuffer.append(";\r\n");\r
                 fileBuffer.append("EFI_STATUS\r\n");\r
@@ -936,14 +929,11 @@ public class AutoGen {
                     fileBuffer.append("  );\r\n");\r
                     entryPointCount++;\r
                 }\r
-                fileBuffer\r
-                .append("GLOBAL_REMOVE_IF_UNREFERENCED  const UINT8  _gDriverEntryPointCount = ");\r
+                fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED  const UINT8  _gDriverEntryPointCount = ");\r
                 fileBuffer.append(Integer.toString(entryPointCount));\r
                 fileBuffer.append(";\r\n");\r
-                fileBuffer\r
-                .append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\r\n");\r
-                fileBuffer\r
-                .append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n\r\n");\r
+                fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\r\n");\r
+                fileBuffer.append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n\r\n");\r
 \r
                 fileBuffer.append("EFI_STATUS\r\n");\r
                 fileBuffer.append("EFIAPI\r\n");\r
@@ -953,16 +943,15 @@ public class AutoGen {
                 fileBuffer.append("  )\r\n\r\n");\r
                 fileBuffer.append("{\r\n");\r
 \r
-\r
                 for (int i = 0; i < entryPointList.length; i++) {\r
-                    fileBuffer\r
-                    .append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
+                    fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
+                    //fileBuffer.append("    DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[i] + "));\n");\r
+                    fileBuffer.append(String.format("    " + debugStr, entryPointList[i], entryPointList[i]));\r
                     fileBuffer.append("    ExitDriver (");\r
                     fileBuffer.append(entryPointList[i]);\r
                     fileBuffer.append(" (ImageHandle, SystemTable));\r\n");\r
                     fileBuffer.append("    ASSERT (FALSE);\r\n");\r
                     fileBuffer.append("  }\r\n");\r
-\r
                 }\r
                 fileBuffer.append("  return mDriverEntryPointStatus;\r\n");\r
                 fileBuffer.append("}\r\n\r\n");\r
@@ -973,14 +962,12 @@ public class AutoGen {
                 fileBuffer.append("  IN EFI_STATUS  Status\n");\r
                 fileBuffer.append("  )\r\n\r\n");\r
                 fileBuffer.append("{\r\n");\r
-                fileBuffer\r
-                .append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");\r
+                fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");\r
                 fileBuffer.append("    mDriverEntryPointStatus = Status;\r\n");\r
                 fileBuffer.append("  }\r\n");\r
                 fileBuffer.append("  LongJump (&mJumpContext, (UINTN)-1);\r\n");\r
                 fileBuffer.append("  ASSERT (FALSE);\r\n");\r
                 fileBuffer.append("}\r\n\r\n");\r
-\r
             }\r
 \r
 \r
@@ -991,21 +978,19 @@ public class AutoGen {
             //entryPointList = CommonDefinition.remDupString(entryPointList);\r
             //entryPointCount = 0;\r
 \r
-                        unloadImageCount = 0;\r
+            unloadImageCount = 0;\r
             if (unloadImageList != null) {\r
                 for (int i = 0; i < unloadImageList.length; i++) {\r
                     fileBuffer.append("EFI_STATUS\r\n");\r
                     fileBuffer.append(unloadImageList[i]);\r
                     fileBuffer.append(" (\r\n");\r
-                    fileBuffer\r
-                    .append("  IN EFI_HANDLE        ImageHandle\r\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle\r\n");\r
                     fileBuffer.append("  );\r\n");\r
                     unloadImageCount++;\r
                 }\r
             }\r
 \r
-            fileBuffer\r
-            .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverUnloadImageCount = ");\r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverUnloadImageCount = ");\r
             fileBuffer.append(Integer.toString(unloadImageCount));\r
             fileBuffer.append(";\r\n\r\n");\r
 \r
@@ -1058,8 +1043,7 @@ public class AutoGen {
             // If entry point is null, create a empty ProcessModuleEntryPointList function.\r
             //\r
             if (entryPointList == null || entryPointList.length == 0) {\r
-                fileBuffer\r
-                .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverEntryPointCount = 0;\r\n");\r
+                fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverEntryPointCount = 0;\r\n");\r
                 fileBuffer.append("EFI_STATUS\r\n");\r
                 fileBuffer.append("EFIAPI\r\n");\r
                 fileBuffer.append("ProcessModuleEntryPointList (\r\n");\r
@@ -1082,15 +1066,12 @@ public class AutoGen {
                     entryPointCount++;\r
                 }\r
 \r
-                fileBuffer\r
-                .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverEntryPointCount = ");\r
+                fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverEntryPointCount = ");\r
                 fileBuffer.append(Integer.toString(entryPointCount));\r
                 fileBuffer.append(";\r\n");\r
                 if (entryPointCount > 1) {\r
-                    fileBuffer\r
-                    .append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\r\n");\r
-                    fileBuffer\r
-                    .append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n");\r
+                    fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\r\n");\r
+                    fileBuffer.append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n");\r
                 }\r
                 fileBuffer.append("\n");\r
 \r
@@ -1103,14 +1084,17 @@ public class AutoGen {
                 fileBuffer.append("{\r\n");\r
 \r
                 if (entryPointCount == 1) {\r
-                    fileBuffer.append("  return (");\r
+                    //fileBuffer.append("  DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[0] + "));\n");\r
+                    fileBuffer.append(String.format("  " + debugStr, entryPointList[0], entryPointList[0]));\r
+                    fileBuffer.append("  return ");\r
                     fileBuffer.append(entryPointList[0]);\r
-                    fileBuffer.append(" (ImageHandle, SystemTable));\r\n");\r
+                    fileBuffer.append(" (ImageHandle, SystemTable);\r\n");\r
                 } else {\r
                     for (int i = 0; i < entryPointList.length; i++) {\r
                         if (!entryPointList[i].equals("")) {\r
-                            fileBuffer\r
-                            .append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
+                            fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
+                            //fileBuffer.append("    DEBUG ((EFI_D_INFO, \"Module Entry Point 0x%08x\\n\", (UINTN)" + entryPointList[i] + "));\n");\r
+                            fileBuffer.append(String.format("    " + debugStr, entryPointList[i], entryPointList[i]));\r
                             fileBuffer.append("    ExitDriver (");\r
                             fileBuffer.append(entryPointList[i]);\r
                             fileBuffer.append(" (ImageHandle, SystemTable));\r\n");\r
@@ -1132,21 +1116,18 @@ public class AutoGen {
                 fileBuffer.append("{\r\n");\r
                 if (entryPointCount <= 1) {\r
                     fileBuffer.append("  if (EFI_ERROR (Status)) {\r\n");\r
-                    fileBuffer\r
-                    .append("    ProcessLibraryDestructorList (gImageHandle, gST);\r\n");\r
+                    fileBuffer.append("    ProcessLibraryDestructorList (gImageHandle, gST);\r\n");\r
                     fileBuffer.append("  }\r\n");\r
                     fileBuffer\r
                     .append("  gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");\r
                 } else {\r
-                    fileBuffer\r
-                    .append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");\r
+                    fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");\r
                     fileBuffer.append("    mDriverEntryPointStatus = Status;\r\n");\r
                     fileBuffer.append("  }\r\n");\r
                     fileBuffer.append("  LongJump (&mJumpContext, (UINTN)-1);\r\n");\r
                     fileBuffer.append("  ASSERT (FALSE);\r\n");\r
                 }\r
                 fileBuffer.append("}\r\n\r\n");\r
-\r
             }\r
 \r
             //\r
@@ -1158,22 +1139,20 @@ public class AutoGen {
             //\r
             //entryPointList = CommonDefinition.remDupString(entryPointList);\r
             //entryPointCount = 0;\r
-                        unloadImageCount = 0;\r
+            unloadImageCount = 0;\r
             if (unloadImageList != null) {\r
                 for (int i = 0; i < unloadImageList.length; i++) {\r
                     fileBuffer.append("EFI_STATUS\r\n");\r
                     fileBuffer.append("EFIAPI\r\n");\r
                     fileBuffer.append(unloadImageList[i]);\r
                     fileBuffer.append(" (\r\n");\r
-                    fileBuffer\r
-                    .append("  IN EFI_HANDLE        ImageHandle\r\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle\r\n");\r
                     fileBuffer.append("  );\r\n");\r
                     unloadImageCount++;\r
                 }\r
             }\r
 \r
-            fileBuffer\r
-            .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverUnloadImageCount = ");\r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverUnloadImageCount = ");\r
             fileBuffer.append(Integer.toString(unloadImageCount));\r
             fileBuffer.append(";\r\n\r\n");\r
 \r
@@ -1255,8 +1234,7 @@ public class AutoGen {
             ppiKeyWord = ppiIterator.next().toString();\r
             cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, ppiKeyWord);\r
             if (cNameGuid != null) {\r
-                fileBuffer\r
-                .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+                fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
                 fileBuffer.append(cNameGuid[0]);\r
                 fileBuffer.append(" =     { ");\r
                 fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));\r
@@ -1294,8 +1272,7 @@ public class AutoGen {
             this.mProtocolList.add(protocolList[i]);\r
         }\r
 \r
-        String[] protocolNotifyList = saq\r
-                                      .getProtocolNotifyArray(this.arch);\r
+        String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch);\r
 \r
         for (int i = 0; i < protocolNotifyList.length; i++) {\r
             this.mProtocolList.add(protocolNotifyList[i]);\r
@@ -1312,8 +1289,7 @@ public class AutoGen {
             protocolKeyWord = protocolIterator.next().toString();\r
             cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord);\r
             if (cNameGuid != null) {\r
-                fileBuffer\r
-                .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+                fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
                 fileBuffer.append(cNameGuid[0]);\r
                 fileBuffer.append(" =     { ");\r
                 fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));\r
@@ -1323,7 +1299,7 @@ public class AutoGen {
                 // If can't find protocol GUID declaration in every package\r
                 //\r
                 throw new AutoGenException("Can not find protocol Guid ["\r
-                                         + protocolKeyWord + "] declaration in any SPD package!");\r
+                                           + protocolKeyWord + "] declaration in any SPD package!");\r
             }\r
         }\r
     }\r
@@ -1355,8 +1331,7 @@ public class AutoGen {
             cNameGuid = GlobalData.getGuid(this.mDepPkgList, guidKeyWord);\r
 \r
             if (cNameGuid != null) {\r
-                fileBuffer\r
-                .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+                fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
                 fileBuffer.append(cNameGuid[0]);\r
                 fileBuffer.append(" =     { ");\r
                 fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));\r
@@ -1384,16 +1359,16 @@ public class AutoGen {
       @throws BuildException\r
     **/\r
     void LibInstanceToAutogenC(StringBuffer fileBuffer) throws EdkException {\r
-                String moduleType = this.moduleId.getModuleType();\r
-                //\r
-                // Add library constructor to AutoGen.c\r
-                //\r
-                LibConstructorToAutogenC(libConstructList, moduleType,\r
-                                                                 fileBuffer/* autogenC */);\r
-                //\r
-                // Add library destructor to AutoGen.c\r
-                //\r
-                LibDestructorToAutogenC(libDestructList, moduleType, fileBuffer/* autogenC */);\r
+        String moduleType = this.moduleId.getModuleType();\r
+        //\r
+        // Add library constructor to AutoGen.c\r
+        //\r
+        LibConstructorToAutogenC(libConstructList, moduleType,\r
+                                 fileBuffer/* autogenC */);\r
+        //\r
+        // Add library destructor to AutoGen.c\r
+        //\r
+        LibDestructorToAutogenC(libDestructList, moduleType, fileBuffer/* autogenC */);\r
     }\r
 \r
     /**\r
@@ -1419,15 +1394,15 @@ public class AutoGen {
         // module type.\r
         //\r
         for (int i = 0; i < libInstanceList.size(); i++) {\r
-                        if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
-                                fileBuffer.append("RETURN_STATUS\r\n");\r
+            if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
+                fileBuffer.append("RETURN_STATUS\r\n");\r
                 fileBuffer.append("EFIAPI\r\n");\r
                 fileBuffer.append(libInstanceList.get(i)[0]);\r
                 fileBuffer.append(" (\r\n");\r
                 fileBuffer.append("  VOID\r\n");\r
                 fileBuffer.append("  );\r\n");\r
-                        } else {\r
-                                switch (CommonDefinition.getModuleType(moduleType)) {\r
+            } else {\r
+                switch (CommonDefinition.getModuleType(moduleType)) {\r
                 case CommonDefinition.ModuleTypeBase:\r
                     fileBuffer.append("RETURN_STATUS\r\n");\r
                     fileBuffer.append("EFIAPI\r\n");\r
@@ -1439,34 +1414,32 @@ public class AutoGen {
 \r
                 case CommonDefinition.ModuleTypePeiCore:\r
                 case CommonDefinition.ModuleTypePeim:\r
-                                        fileBuffer.append("EFI_STATUS\r\n");\r
-                                        fileBuffer.append("EFIAPI\r\n");\r
-                                        fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                        fileBuffer.append(" (\r\n");\r
-                                        fileBuffer\r
-                                        .append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r\n");\r
-                                        fileBuffer\r
-                                        .append("  IN EFI_PEI_SERVICES          **PeiServices\r\n");\r
-                                        fileBuffer.append("  );\r\n");\r
-                                        break;\r
-        \r
-                                case CommonDefinition.ModuleTypeDxeCore:\r
-                                case CommonDefinition.ModuleTypeDxeDriver:\r
-                                case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
-                                case CommonDefinition.ModuleTypeDxeSmmDriver:\r
-                                case CommonDefinition.ModuleTypeDxeSalDriver:\r
-                                case CommonDefinition.ModuleTypeUefiDriver:\r
-                                case CommonDefinition.ModuleTypeUefiApplication:\r
-                                        fileBuffer.append("EFI_STATUS\r\n");\r
-                                        fileBuffer.append("EFIAPI\r\n");\r
-                                        fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                        fileBuffer.append(" (\r\n");\r
-                                        fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\r\n");\r
-                                        fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\r\n");\r
-                                        fileBuffer.append("  );\r\n");\r
-                                        break;\r
-\r
-                            }\r
+                    fileBuffer.append("EFI_STATUS\r\n");\r
+                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (\r\n");\r
+                    fileBuffer.append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r\n");\r
+                    fileBuffer.append("  IN EFI_PEI_SERVICES          **PeiServices\r\n");\r
+                    fileBuffer.append("  );\r\n");\r
+                    break;\r
+\r
+                case CommonDefinition.ModuleTypeDxeCore:\r
+                case CommonDefinition.ModuleTypeDxeDriver:\r
+                case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
+                case CommonDefinition.ModuleTypeDxeSmmDriver:\r
+                case CommonDefinition.ModuleTypeDxeSalDriver:\r
+                case CommonDefinition.ModuleTypeUefiDriver:\r
+                case CommonDefinition.ModuleTypeUefiApplication:\r
+                    fileBuffer.append("EFI_STATUS\r\n");\r
+                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (\r\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\r\n");\r
+                    fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\r\n");\r
+                    fileBuffer.append("  );\r\n");\r
+                    break;\r
+\r
+                }\r
             }\r
         }\r
 \r
@@ -1515,38 +1488,38 @@ public class AutoGen {
                 fileBuffer.append("\r\n");\r
                 isFirst = false;\r
             }\r
-                        if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
+            if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
                 fileBuffer.append("  Status = ");\r
                 fileBuffer.append(libInstanceList.get(i)[0]);\r
                 fileBuffer.append("();\r\n");\r
-                        } else {\r
-                                switch (CommonDefinition.getModuleType(moduleType)) {\r
-                                        case CommonDefinition.ModuleTypeBase:\r
-                                                fileBuffer.append("  Status = ");\r
-                                                fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                                fileBuffer.append("();\r\n");\r
-                                                break;\r
-                                        case CommonDefinition.ModuleTypePeiCore:\r
-                                        case CommonDefinition.ModuleTypePeim:\r
-                                                fileBuffer.append("  Status = ");\r
-                                                fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                                fileBuffer.append(" (FfsHeader, PeiServices);\r\n");\r
-                                                break;\r
-                                        case CommonDefinition.ModuleTypeDxeCore:\r
-                                        case CommonDefinition.ModuleTypeDxeDriver:\r
-                                        case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
-                                        case CommonDefinition.ModuleTypeDxeSmmDriver:\r
-                                        case CommonDefinition.ModuleTypeDxeSalDriver:\r
-                                        case CommonDefinition.ModuleTypeUefiDriver:\r
-                                        case CommonDefinition.ModuleTypeUefiApplication:\r
-                                                fileBuffer.append("  Status = ");\r
-                                                fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                                fileBuffer.append(" (ImageHandle, SystemTable);\r\n");\r
-                                                break;\r
-                                        default:\r
-                                                EdkLog.log(EdkLog.EDK_INFO,"Autogen doesn't know how to deal with module type - " + moduleType + "!");\r
-                           }\r
-            \r
+            } else {\r
+                switch (CommonDefinition.getModuleType(moduleType)) {\r
+                case CommonDefinition.ModuleTypeBase:\r
+                    fileBuffer.append("  Status = ");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append("();\r\n");\r
+                    break;\r
+                case CommonDefinition.ModuleTypePeiCore:\r
+                case CommonDefinition.ModuleTypePeim:\r
+                    fileBuffer.append("  Status = ");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (FfsHeader, PeiServices);\r\n");\r
+                    break;\r
+                case CommonDefinition.ModuleTypeDxeCore:\r
+                case CommonDefinition.ModuleTypeDxeDriver:\r
+                case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
+                case CommonDefinition.ModuleTypeDxeSmmDriver:\r
+                case CommonDefinition.ModuleTypeDxeSalDriver:\r
+                case CommonDefinition.ModuleTypeUefiDriver:\r
+                case CommonDefinition.ModuleTypeUefiApplication:\r
+                    fileBuffer.append("  Status = ");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (ImageHandle, SystemTable);\r\n");\r
+                    break;\r
+                default:\r
+                    EdkLog.log(EdkLog.EDK_INFO,"Autogen doesn't know how to deal with module type - " + moduleType + "!");\r
+                }\r
+\r
             }\r
             fileBuffer.append("  ASSERT_EFI_ERROR (Status);\r\n");\r
         }\r
@@ -1571,51 +1544,49 @@ public class AutoGen {
                                  String moduleType, StringBuffer fileBuffer) throws EdkException {\r
         boolean isFirst = true;\r
         for (int i = 0; i < libInstanceList.size(); i++) {\r
-                        if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
+            if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
                 fileBuffer.append("RETURN_STATUS\r\n");\r
                 fileBuffer.append("EFIAPI\r\n");\r
                 fileBuffer.append(libInstanceList.get(i)[0]);\r
                 fileBuffer.append(" (\r\n");\r
                 fileBuffer.append("  VOID\r\n");\r
                 fileBuffer.append("  );\r\n");\r
-                        } else {\r
-                                switch (CommonDefinition.getModuleType(moduleType)) {\r
-                                        case CommonDefinition.ModuleTypeBase:\r
-                                                fileBuffer.append("RETURN_STATUS\r\n");\r
-                                                fileBuffer.append("EFIAPI\r\n");\r
-                                                fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                                fileBuffer.append(" (\r\n");\r
-                                                fileBuffer.append("  VOID\r\n");\r
-                                                fileBuffer.append("  );\r\n");\r
-                                                break;\r
-                                        case CommonDefinition.ModuleTypePeiCore:\r
-                                        case CommonDefinition.ModuleTypePeim:\r
-                                                fileBuffer.append("EFI_STATUS\r\n");\r
-                                                fileBuffer.append("EFIAPI\r\n");\r
-                                                fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                                fileBuffer.append(" (\r\n");\r
-                                                fileBuffer\r
-                                                .append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r\n");\r
-                                                fileBuffer\r
-                                                .append("  IN EFI_PEI_SERVICES          **PeiServices\r\n");\r
-                                                fileBuffer.append("  );\r\n");\r
-                                                break;\r
-                                        case CommonDefinition.ModuleTypeDxeCore:\r
-                                        case CommonDefinition.ModuleTypeDxeDriver:\r
-                                        case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
-                                        case CommonDefinition.ModuleTypeDxeSmmDriver:\r
-                                        case CommonDefinition.ModuleTypeDxeSalDriver:\r
-                                        case CommonDefinition.ModuleTypeUefiDriver:\r
-                                        case CommonDefinition.ModuleTypeUefiApplication:\r
-                                                fileBuffer.append("EFI_STATUS\r\n");\r
-                                                fileBuffer.append("EFIAPI\r\n");\r
-                                                fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                                fileBuffer.append(" (\r\n");\r
-                                                fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\r\n");\r
-                                                fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\r\n");\r
-                                                fileBuffer.append("  );\r\n");\r
-                                                break;\r
-                            }\r
+            } else {\r
+                switch (CommonDefinition.getModuleType(moduleType)) {\r
+                case CommonDefinition.ModuleTypeBase:\r
+                    fileBuffer.append("RETURN_STATUS\r\n");\r
+                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (\r\n");\r
+                    fileBuffer.append("  VOID\r\n");\r
+                    fileBuffer.append("  );\r\n");\r
+                    break;\r
+                case CommonDefinition.ModuleTypePeiCore:\r
+                case CommonDefinition.ModuleTypePeim:\r
+                    fileBuffer.append("EFI_STATUS\r\n");\r
+                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (\r\n");\r
+                    fileBuffer.append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r\n");\r
+                    fileBuffer.append("  IN EFI_PEI_SERVICES          **PeiServices\r\n");\r
+                    fileBuffer.append("  );\r\n");\r
+                    break;\r
+                case CommonDefinition.ModuleTypeDxeCore:\r
+                case CommonDefinition.ModuleTypeDxeDriver:\r
+                case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
+                case CommonDefinition.ModuleTypeDxeSmmDriver:\r
+                case CommonDefinition.ModuleTypeDxeSalDriver:\r
+                case CommonDefinition.ModuleTypeUefiDriver:\r
+                case CommonDefinition.ModuleTypeUefiApplication:\r
+                    fileBuffer.append("EFI_STATUS\r\n");\r
+                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append(" (\r\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\r\n");\r
+                    fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\r\n");\r
+                    fileBuffer.append("  );\r\n");\r
+                    break;\r
+                }\r
             }\r
         }\r
 \r
@@ -1652,17 +1623,17 @@ public class AutoGen {
                     fileBuffer.append("\r\n");\r
                     isFirst = false;\r
                 }\r
-                                if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
+                if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {\r
                     fileBuffer.append("  Status = ");\r
                     fileBuffer.append(libInstanceList.get(i)[0]);\r
                     fileBuffer.append("();\r\n");\r
                     fileBuffer.append("  VOID\r\n");\r
-                                } else {\r
-                                        fileBuffer.append("  Status = ");\r
-                                        fileBuffer.append(libInstanceList.get(i)[0]);\r
-                                        fileBuffer.append("(ImageHandle, SystemTable);\r\n");\r
-                                        fileBuffer.append("  ASSERT_EFI_ERROR (Status);\r\n");\r
-                                }\r
+                } else {\r
+                    fileBuffer.append("  Status = ");\r
+                    fileBuffer.append(libInstanceList.get(i)[0]);\r
+                    fileBuffer.append("(ImageHandle, SystemTable);\r\n");\r
+                    fileBuffer.append("  ASSERT_EFI_ERROR (Status);\r\n");\r
+                }\r
             }\r
             fileBuffer.append("}\r\n");\r
             break;\r
@@ -1688,10 +1659,10 @@ public class AutoGen {
         String[][] driverBindingGroup = this.saq.getExternProtocolGroup();\r
 \r
 \r
-       //\r
-       // inital BitMask;\r
-       // \r
-       int BitMask = 0;\r
+        //\r
+        // inital BitMask;\r
+        // \r
+        int BitMask = 0;\r
 \r
         //\r
         // Write driver binding protocol extern to autogen.c\r
@@ -1701,7 +1672,7 @@ public class AutoGen {
                 fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL ");\r
                 fileBuffer.append(driverBindingGroup[i][0]);\r
                 fileBuffer.append(";\r\n");\r
-            } \r
+            }\r
         }\r
 \r
         //\r
@@ -1718,10 +1689,10 @@ public class AutoGen {
                     } else {\r
                         throw new AutoGenException("DriverBinding can't be empty!!");\r
                     }\r
-                 }\r
-             }\r
-         }\r
-        \r
+                }\r
+            }\r
+        }\r
+\r
         //\r
         // Write driver configration protocol extern to autogen.c\r
         //\r
@@ -1737,7 +1708,7 @@ public class AutoGen {
                 }\r
             }\r
         }\r
-        \r
+\r
         //\r
         // Write driver dignastic protocol extern to autogen.c\r
         //\r
@@ -1755,21 +1726,19 @@ public class AutoGen {
                 }\r
             }\r
         }\r
-                \r
-      \r
+\r
+\r
         //\r
         // Write driver module protocol bitmask.\r
         //\r
-        fileBuffer\r
-        .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverModelProtocolBitmask = ");\r
+        fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverModelProtocolBitmask = ");\r
         fileBuffer.append(Integer.toString(BitMask));\r
         fileBuffer.append(";\r\n");\r
 \r
         //\r
         // Write driver module protocol list entry\r
         //\r
-        fileBuffer\r
-        .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN  _gDriverModelProtocolListEntries = ");\r
+        fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN  _gDriverModelProtocolListEntries = ");\r
 \r
         fileBuffer.append(Integer.toString(driverBindingGroup.length));\r
         fileBuffer.append(";\r\n");\r
@@ -1778,11 +1747,10 @@ public class AutoGen {
         // Write drive module protocol list to autogen.c\r
         //\r
         if (driverBindingGroup.length > 0) {\r
-                        fileBuffer\r
-        .append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST  _gDriverModelProtocolList[] = {");\r
-                }\r
-        \r
-                \r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST  _gDriverModelProtocolList[] = {");\r
+        }\r
+\r
+\r
         for (int i = 0; i < driverBindingGroup.length; i++) {\r
             if (i != 0) {\r
                 fileBuffer.append(",");\r
@@ -1794,7 +1762,7 @@ public class AutoGen {
             fileBuffer.append("  &");\r
             fileBuffer.append(driverBindingGroup[i][0]);\r
             fileBuffer.append(", \r\n");\r
-                        \r
+\r
             //\r
             //  ComponentName\r
             // \r
@@ -1831,7 +1799,7 @@ public class AutoGen {
         }\r
 \r
         if (driverBindingGroup.length > 0) {\r
-             fileBuffer.append("\r\n};\r\n");\r
+            fileBuffer.append("\r\n};\r\n");\r
         }\r
     }\r
 \r
@@ -1908,17 +1876,17 @@ public class AutoGen {
         //\r
         if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {\r
             if (inFile.exists()) {\r
-                try{\r
+                try {\r
                     FileInputStream fis = new FileInputStream (inFile);\r
                     fis.read(buffer);\r
                     FileOutputStream fos = new FileOutputStream(outFile);\r
                     fos.write(buffer);\r
                     fis.close();\r
                     fos.close();\r
-                } catch (IOException e){\r
+                } catch (IOException e) {\r
                     throw new AutoGenException("The file, flashMap.h can't be open!");\r
                 }\r
-                                \r
+\r
             } else {\r
                 throw new AutoGenException("The file, flashMap.h doesn't exist!");\r
             }\r
@@ -1939,267 +1907,262 @@ public class AutoGen {
 \r
         String libConstructName = null;\r
         String libDestructName = null;\r
-                String libModuleType   = null;\r
+        String libModuleType   = null;\r
         String[] setVirtuals = null;\r
         String[] exitBoots = null;\r
 \r
         ModuleIdentification[] libraryIdList = saq.getLibraryInstance(this.arch);\r
 \r
-           if (libraryIdList != null) {\r
-               //\r
-               // Reorder library instance sequence.\r
-               //\r
-               AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList,\r
-                                                              this.arch);\r
-               List<ModuleIdentification> orderList = libOrder\r
-                                                            .orderLibInstance();\r
-       \r
-               if (orderList != null) {\r
-                   //\r
-                   // Process library instance one by one.\r
-                   //\r
-                   for (int i = 0; i < orderList.size(); i++) {\r
-                       //\r
-                       // Get library instance basename.\r
-                       //\r
-                       ModuleIdentification libInstanceId = orderList.get(i);\r
-       \r
-                       //\r
-                       // Get override map\r
-                       //\r
-       \r
-                       Map<String, XmlObject> libDoc = GlobalData.getDoc(libInstanceId, this.arch);\r
-                       saq.push(libDoc);\r
-                       //\r
-                       // Get <PPis>, <Protocols>, <Guids> list of this library\r
-                       // instance.\r
-                       //\r
-                       String[] ppiList = saq.getPpiArray(this.arch);\r
-                       String[] ppiNotifyList = saq.getPpiNotifyArray(this.arch);\r
-                       String[] protocolList = saq.getProtocolArray(this.arch);\r
-                       String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch);\r
-                       String[] guidList = saq.getGuidEntryArray(this.arch);\r
-                       PackageIdentification[] pkgList = saq.getDependencePkg(this.arch);\r
-       \r
-                       //\r
-                       // Add those ppi, protocol, guid in global ppi,\r
-                       // protocol, guid\r
-                       // list.\r
-                       //\r
-                       for (index = 0; index < ppiList.length; index++) {\r
-                           this.mPpiList.add(ppiList[index]);\r
-                       }\r
-       \r
-                       for (index = 0; index < ppiNotifyList.length; index++) {\r
-                           this.mPpiList.add(ppiNotifyList[index]);\r
-                       }\r
-       \r
-                       for (index = 0; index < protocolList.length; index++) {\r
-                           this.mProtocolList.add(protocolList[index]);\r
-                       }\r
-       \r
-                       for (index = 0; index < protocolNotifyList.length; index++) {\r
-                           this.mProtocolList.add(protocolNotifyList[index]);\r
-                       }\r
-       \r
-                       for (index = 0; index < guidList.length; index++) {\r
-                           this.mGuidList.add(guidList[index]);\r
-                       }\r
-                       for (index = 0; index < pkgList.length; index++) {\r
-                           if (!this.mDepPkgList.contains(pkgList[index])) {\r
-                               this.mDepPkgList.add(pkgList[index]);\r
-                           }\r
-                       }\r
-       \r
-                       //\r
-                       // If not yet parse this library instance's constructor\r
-                       // element,parse it.\r
-                       //\r
-                           libConstructName = saq.getLibConstructorName();\r
-                           libDestructName = saq.getLibDestructorName();\r
-                           libModuleType = saq.getModuleType();\r
-                       \r
-                           //\r
-                           // Collect SetVirtualAddressMapCallBack and\r
-                           // ExitBootServiceCallBack.\r
-                           //\r
-                           setVirtuals = saq.getSetVirtualAddressMapCallBackArray();\r
-                           exitBoots = saq.getExitBootServicesCallBackArray();\r
-                           if (setVirtuals != null) {\r
-                                   for (int j = 0; j < setVirtuals.length; j++) {\r
-                                           this.setVirtalAddList.add(setVirtuals[j]);\r
-                                   }\r
-                           }\r
-                           if (exitBoots != null) {\r
-                                   for (int k = 0; k < exitBoots.length; k++) {\r
-                                           this.exitBootServiceList.add(exitBoots[k]);\r
-                                   }\r
-                           }\r
-                           saq.pop();\r
-                           //\r
-                           // Add dependent library instance constructor function.\r
-                           //\r
-                           if (libConstructName != null) {\r
-                                   this.libConstructList.add(new String[] {libConstructName, libModuleType});\r
-                           }\r
-                           //\r
-                           // Add dependent library instance destructor fuction.\r
-                           //\r
-                           if (libDestructName != null) {\r
-                                   this.libDestructList.add(new String[] {libDestructName, libModuleType});\r
-                           }\r
-                       }\r
-               }\r
-           }\r
+        if (libraryIdList != null) {\r
+            //\r
+            // Reorder library instance sequence.\r
+            //\r
+            AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList,\r
+                                                           this.arch);\r
+            List<ModuleIdentification> orderList = libOrder\r
+                                                   .orderLibInstance();\r
+\r
+            if (orderList != null) {\r
+                //\r
+                // Process library instance one by one.\r
+                //\r
+                for (int i = 0; i < orderList.size(); i++) {\r
+                    //\r
+                    // Get library instance basename.\r
+                    //\r
+                    ModuleIdentification libInstanceId = orderList.get(i);\r
+\r
+                    //\r
+                    // Get override map\r
+                    //\r
+\r
+                    Map<String, XmlObject> libDoc = GlobalData.getDoc(libInstanceId, this.arch);\r
+                    saq.push(libDoc);\r
+                    //\r
+                    // Get <PPis>, <Protocols>, <Guids> list of this library\r
+                    // instance.\r
+                    //\r
+                    String[] ppiList = saq.getPpiArray(this.arch);\r
+                    String[] ppiNotifyList = saq.getPpiNotifyArray(this.arch);\r
+                    String[] protocolList = saq.getProtocolArray(this.arch);\r
+                    String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch);\r
+                    String[] guidList = saq.getGuidEntryArray(this.arch);\r
+                    PackageIdentification[] pkgList = saq.getDependencePkg(this.arch);\r
+\r
+                    //\r
+                    // Add those ppi, protocol, guid in global ppi,\r
+                    // protocol, guid\r
+                    // list.\r
+                    //\r
+                    for (index = 0; index < ppiList.length; index++) {\r
+                        this.mPpiList.add(ppiList[index]);\r
+                    }\r
+\r
+                    for (index = 0; index < ppiNotifyList.length; index++) {\r
+                        this.mPpiList.add(ppiNotifyList[index]);\r
+                    }\r
+\r
+                    for (index = 0; index < protocolList.length; index++) {\r
+                        this.mProtocolList.add(protocolList[index]);\r
+                    }\r
+\r
+                    for (index = 0; index < protocolNotifyList.length; index++) {\r
+                        this.mProtocolList.add(protocolNotifyList[index]);\r
+                    }\r
+\r
+                    for (index = 0; index < guidList.length; index++) {\r
+                        this.mGuidList.add(guidList[index]);\r
+                    }\r
+                    for (index = 0; index < pkgList.length; index++) {\r
+                        if (!this.mDepPkgList.contains(pkgList[index])) {\r
+                            this.mDepPkgList.add(pkgList[index]);\r
+                        }\r
+                    }\r
+\r
+                    //\r
+                    // If not yet parse this library instance's constructor\r
+                    // element,parse it.\r
+                    //\r
+                    libConstructName = saq.getLibConstructorName();\r
+                    libDestructName = saq.getLibDestructorName();\r
+                    libModuleType = saq.getModuleType();\r
+\r
+                    //\r
+                    // Collect SetVirtualAddressMapCallBack and\r
+                    // ExitBootServiceCallBack.\r
+                    //\r
+                    setVirtuals = saq.getSetVirtualAddressMapCallBackArray();\r
+                    exitBoots = saq.getExitBootServicesCallBackArray();\r
+                    if (setVirtuals != null) {\r
+                        for (int j = 0; j < setVirtuals.length; j++) {\r
+                            this.setVirtalAddList.add(setVirtuals[j]);\r
+                        }\r
+                    }\r
+                    if (exitBoots != null) {\r
+                        for (int k = 0; k < exitBoots.length; k++) {\r
+                            this.exitBootServiceList.add(exitBoots[k]);\r
+                        }\r
+                    }\r
+                    saq.pop();\r
+                    //\r
+                    // Add dependent library instance constructor function.\r
+                    //\r
+                    if (libConstructName != null) {\r
+                        this.libConstructList.add(new String[] {libConstructName, libModuleType});\r
+                    }\r
+                    //\r
+                    // Add dependent library instance destructor fuction.\r
+                    //\r
+                    if (libDestructName != null) {\r
+                        this.libDestructList.add(new String[] {libDestructName, libModuleType});\r
+                    }\r
+                }\r
+            }\r
+        }\r
     }\r
     private void setVirtualAddressToAutogenC(StringBuffer fileBuffer){\r
         //\r
         // Entry point lib for these module types needs to know the count\r
         // of entryPoint.\r
         //\r
+        fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED  const UINTN _gDriverSetVirtualAddressMapEventCount = ");\r
+\r
+        //\r
+        // If the list is not valid or has no entries set count to zero else\r
+        // set count to the number of valid entries\r
+        //\r
+        int Count = 0;\r
+        int i = 0;\r
+        if (this.setVirtalAddList != null) {\r
+            for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+                if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
+                    break;\r
+                }\r
+            }\r
+            Count = i;\r
+        }\r
+\r
+        fileBuffer.append(Integer.toString(Count));\r
+        fileBuffer.append(";\r\n\r\n");\r
+        if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {\r
+            //\r
+            // No data so make a NULL list\r
+            //\r
+            fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");\r
+            fileBuffer.append("  NULL\r\n");\r
+            fileBuffer.append("};\r\n\r\n");\r
+        } else {\r
+            //\r
+            // Write SetVirtualAddressMap function definition.\r
+            //\r
+            for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+                if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
+                    break;\r
+                }\r
+                fileBuffer.append("VOID\r\n");\r
+                fileBuffer.append("EFIAPI\r\n");\r
+                fileBuffer.append(this.setVirtalAddList.get(i));\r
+                fileBuffer.append(" (\r\n");\r
+                fileBuffer.append("  IN EFI_EVENT  Event,\r\n");\r
+                fileBuffer.append("  IN VOID       *Context\r\n");\r
+                fileBuffer.append("  );\r\n\r\n");\r
+            }\r
+\r
+            //\r
+            // Write SetVirtualAddressMap entry point array.\r
+            //\r
+            fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");\r
+            for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+                if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
+                    break;\r
+                }\r
+\r
+                if (i == 0) {\r
+                    fileBuffer.append("\r\n  ");\r
+                } else {\r
+                    fileBuffer.append(",\r\n  ");\r
+                }\r
+\r
+                fileBuffer.append(this.setVirtalAddList.get(i));\r
+            }\r
+            //\r
+            // add the NULL at the end of _gDriverSetVirtualAddressMapEvent list.\r
+            //\r
+            fileBuffer.append(",\r\n  NULL");\r
+            fileBuffer.append("\r\n};\r\n\r\n");\r
+        }\r
+    }\r
+\r
+\r
+    private void setExitBootServiceToAutogenC(StringBuffer fileBuffer){\r
+        //\r
+        // Entry point lib for these module types needs to know the count.\r
+        //\r
         fileBuffer\r
-            .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED  const UINTN _gDriverSetVirtualAddressMapEventCount = ");\r
-\r
-           //\r
-           // If the list is not valid or has no entries set count to zero else\r
-           // set count to the number of valid entries\r
-           //\r
-           int Count = 0;\r
-           int i = 0;\r
-           if (this.setVirtalAddList != null) {\r
-               for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
-                   if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
-                       break;\r
-                   }\r
-               }\r
-               Count = i;\r
-           }\r
-       \r
-           fileBuffer.append(Integer.toString(Count));\r
-           fileBuffer.append(";\r\n\r\n");\r
-           if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {\r
-               //\r
-               // No data so make a NULL list\r
-               //\r
-               fileBuffer\r
-               .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");\r
-               fileBuffer.append("  NULL\r\n");\r
-               fileBuffer.append("};\r\n\r\n");\r
-           } else {\r
-               //\r
-               // Write SetVirtualAddressMap function definition.\r
-               //\r
-               for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
-                   if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
-                       break;\r
-                   }\r
-                   fileBuffer.append("VOID\r\n");\r
-                   fileBuffer.append("EFIAPI\r\n");\r
-                   fileBuffer.append(this.setVirtalAddList.get(i));\r
-                   fileBuffer.append(" (\r\n");\r
-                   fileBuffer.append("  IN EFI_EVENT  Event,\r\n");\r
-                   fileBuffer.append("  IN VOID       *Context\r\n");\r
-                   fileBuffer.append("  );\r\n\r\n");\r
-                }\r
-       \r
-               //\r
-               // Write SetVirtualAddressMap entry point array.\r
-               //\r
-               fileBuffer\r
-               .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");\r
-               for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
-                   if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
-                       break;\r
-                   }\r
-       \r
-                   if (i == 0) {\r
-                       fileBuffer.append("\r\n  ");\r
-                   } else {\r
-                       fileBuffer.append(",\r\n  ");\r
-                   }\r
-       \r
-                   fileBuffer.append(this.setVirtalAddList.get(i));\r
-               }\r
-               //\r
-               // add the NULL at the end of _gDriverSetVirtualAddressMapEvent list.\r
-               //\r
-               fileBuffer.append(",\r\n  NULL");\r
-               fileBuffer.append("\r\n};\r\n\r\n");\r
-           }\r
-       }\r
-\r
-\r
-       private void setExitBootServiceToAutogenC(StringBuffer fileBuffer){\r
-               //\r
-               // Entry point lib for these module types needs to know the count.\r
-               //\r
-               fileBuffer\r
-               .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED  const UINTN _gDriverExitBootServicesEventCount = ");\r
-               \r
-               //\r
-               // If the list is not valid or has no entries set count to zero else\r
-               // set count to the number of valid entries.\r
-               //\r
-               int Count = 0;\r
-               int i = 0; \r
-               if (this.exitBootServiceList != null) {\r
-                   for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
-                       if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
-                           break;\r
-                       }\r
-                   }\r
-                   Count = i;\r
-               }\r
-               fileBuffer.append(Integer.toString(Count));\r
-               fileBuffer.append(";\r\n\r\n");\r
-               \r
-               if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {\r
-                   //      \r
-                   // No data so make a NULL list.\r
-                   //\r
-                   fileBuffer\r
-                   .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");\r
-                   fileBuffer.append("  NULL\r\n");\r
-                   fileBuffer.append("};\r\n\r\n");\r
-               } else {\r
-                   //\r
-                   // Write DriverExitBootServices function definition.\r
-                   //\r
-                   for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
-                       if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
-                           break;\r
-                       }\r
-               \r
-                       fileBuffer.append("VOID\r\n");\r
-                       fileBuffer.append("EFIAPI\r\n");\r
-                       fileBuffer.append(this.exitBootServiceList.get(i));\r
-                       fileBuffer.append(" (\r\n");\r
-                       fileBuffer.append("  IN EFI_EVENT  Event,\r\n");\r
-                       fileBuffer.append("  IN VOID       *Context\r\n");\r
-                       fileBuffer.append("  );\r\n\r\n");\r
-                   }\r
-               \r
-                   //\r
-                   // Write DriverExitBootServices entry point array.\r
-                   //\r
-                   fileBuffer\r
-                   .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");\r
-                   for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
-                       if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
-                           break;\r
-                       }\r
-               \r
-                       if (i == 0) {\r
-                           fileBuffer.append("\r\n  ");\r
-                       } else {\r
-                           fileBuffer.append(",\r\n  ");\r
-                       }\r
-                       fileBuffer.append(this.exitBootServiceList.get(i));\r
-                   }\r
-                   \r
-                   fileBuffer.append(",\r\n  NULL");\r
-                   fileBuffer.append("\r\n};\r\n\r\n");\r
-               }               \r
+        .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED  const UINTN _gDriverExitBootServicesEventCount = ");\r
+\r
+        //\r
+        // If the list is not valid or has no entries set count to zero else\r
+        // set count to the number of valid entries.\r
+        //\r
+        int Count = 0;\r
+        int i = 0; \r
+        if (this.exitBootServiceList != null) {\r
+            for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+                if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
+                    break;\r
+                }\r
+            }\r
+            Count = i;\r
+        }\r
+        fileBuffer.append(Integer.toString(Count));\r
+        fileBuffer.append(";\r\n\r\n");\r
+\r
+        if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {\r
+            //      \r
+            // No data so make a NULL list.\r
+            //\r
+            fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");\r
+            fileBuffer.append("  NULL\r\n");\r
+            fileBuffer.append("};\r\n\r\n");\r
+        } else {\r
+            //\r
+            // Write DriverExitBootServices function definition.\r
+            //\r
+            for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+                if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
+                    break;\r
+                }\r
+\r
+                fileBuffer.append("VOID\r\n");\r
+                fileBuffer.append("EFIAPI\r\n");\r
+                fileBuffer.append(this.exitBootServiceList.get(i));\r
+                fileBuffer.append(" (\r\n");\r
+                fileBuffer.append("  IN EFI_EVENT  Event,\r\n");\r
+                fileBuffer.append("  IN VOID       *Context\r\n");\r
+                fileBuffer.append("  );\r\n\r\n");\r
+            }\r
+\r
+            //\r
+            // Write DriverExitBootServices entry point array.\r
+            //\r
+            fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");\r
+            for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+                if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
+                    break;\r
+                }\r
+\r
+                if (i == 0) {\r
+                    fileBuffer.append("\r\n  ");\r
+                } else {\r
+                    fileBuffer.append(",\r\n  ");\r
+                }\r
+                fileBuffer.append(this.exitBootServiceList.get(i));\r
+            }\r
+\r
+            fileBuffer.append(",\r\n  NULL");\r
+            fileBuffer.append("\r\n};\r\n\r\n");\r
+        }   \r
     }\r
     /**\r
       setPcdComponentName\r
@@ -2209,13 +2172,13 @@ public class AutoGen {
          \r
     **/\r
     public void setPcdComponentName (){\r
-       String pcdValue = null;\r
-               pcdValue = saq.getPcdValueBycName("PcdComponentNameDisable");\r
-               if (pcdValue != null && pcdValue.equalsIgnoreCase("true")) {\r
+        String pcdValue = null;\r
+        pcdValue = saq.getPcdValueBycName("PcdComponentNameDisable");\r
+        if (pcdValue != null && pcdValue.equalsIgnoreCase("true")) {\r
             this.componentNamePcd = true;\r
-               }\r
+        }\r
     }\r
-    \r
+\r
     /**\r
       setPcdDriverDiagnostic \r
       \r
@@ -2224,11 +2187,11 @@ public class AutoGen {
          \r
     **/\r
     public void setPcdDriverDiagnostic (){\r
-       String pcdValue = null;\r
+        String pcdValue = null;\r
         pcdValue  = saq.getPcdValueBycName("PcdDriverDiagnosticsDisable");\r
-               if (pcdValue != null && pcdValue.equalsIgnoreCase("true")) {\r
+        if (pcdValue != null && pcdValue.equalsIgnoreCase("true")) {\r
             this.driverDiagnostPcd = true;\r
-               }    \r
+        }\r
     }  \r
-    \r
+\r
 }\r