1) According to the spec, add EFIAPI to the module entry point function declaration...
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 17 Jan 2007 07:15:25 +0000 (07:15 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 17 Jan 2007 07:15:25 +0000 (07:15 +0000)
2) Remove the "#include <AutoGen.h>" from AutoGen.c because the AutoGen.h has been included by compiler option
3) Remove "\r" to AutoGen.h and AutoGen.c

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2259 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java

index 5b917b9..c6d0d34 100644 (file)
@@ -326,7 +326,7 @@ public class AutoGen {
         String[] specList = saq.getExternSpecificaiton();\r
         for (int i = 0; i < specList.length; i++) {\r
             fileBuffer.append(CommonDefinition.DEFINE + specList[i]\r
-                              + "\r\n");\r
+                              + "\n");\r
         }\r
         //\r
         // Write consumed package's mdouleInfo related .h file to autogen.h\r
@@ -362,7 +362,7 @@ public class AutoGen {
                 fileBuffer.append(item.next().toString());\r
             }\r
         }\r
-        fileBuffer.append("\r\n");\r
+        fileBuffer.append("\n");\r
 \r
         //\r
         //  If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to\r
@@ -371,21 +371,21 @@ public class AutoGen {
         if (saq.isHaveTianoR8FlashMap()) {\r
             fileBuffer.append(CommonDefinition.INCLUDE);\r
             fileBuffer.append("  <");\r
-            fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");\r
+            fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\n");\r
             copyFlashMapHToDebugDir();\r
         }\r
 \r
         // Write PCD autogen information to AutoGen.h.\r
         //\r
         if (this.myPcdAutogen != null) {\r
-            fileBuffer.append("\r\n");\r
+            fileBuffer.append("\n");\r
             fileBuffer.append(this.myPcdAutogen.getHAutoGenString());\r
         }\r
 \r
         //\r
         // Append the #endif at AutoGen.h\r
         //\r
-        fileBuffer.append("#endif\r\n");\r
+        fileBuffer.append("#endif\n");\r
 \r
         //\r
         // Save string buffer content in AutoGen.h.\r
@@ -411,11 +411,6 @@ public class AutoGen {
         //\r
         fileBuffer.append(CommonDefinition.AUTOGENCNOTATION);\r
 \r
-        //\r
-        // Write #include <AutoGen.h> at beginning of AutoGen.c\r
-        //\r
-        fileBuffer.append(CommonDefinition.INCLUDEAUTOGENH);\r
-\r
         //\r
         // Get the native MSA file infomation. Since before call autogen,\r
         // the MSA native <Externs> information were overrided. So before\r
@@ -474,7 +469,7 @@ public class AutoGen {
         //\r
 \r
         fileBuffer.append(guid);\r
-        fileBuffer.append("};\r\n");\r
+        fileBuffer.append("};\n");\r
 \r
         //\r
         // Generate library instance consumed protocol, guid, ppi, pcd list.\r
@@ -514,7 +509,7 @@ public class AutoGen {
 \r
         this.myPcdAutogen.execute();\r
         if (this.myPcdAutogen != null) {\r
-            fileBuffer.append("\r\n");\r
+            fileBuffer.append("\n");\r
             fileBuffer.append(this.myPcdAutogen.getCAutoGenString());\r
         }\r
 \r
@@ -569,7 +564,7 @@ public class AutoGen {
         String[] specList = saq.getExternSpecificaiton();\r
         for (int i = 0; i < specList.length; i++) {\r
             fileBuffer.append(CommonDefinition.DEFINE + specList[i]\r
-                              + "\r\n");\r
+                              + "\n");\r
         }\r
         // fileBuffer.append(CommonDefinition.autoGenHLine1);\r
         // fileBuffer.append(CommonDefinition.autoGenHLine2);\r
@@ -614,7 +609,7 @@ public class AutoGen {
         if (saq.isHaveTianoR8FlashMap()) {\r
             fileBuffer.append(CommonDefinition.INCLUDE);\r
             fileBuffer.append("  <");\r
-            fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");\r
+            fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\n");\r
             copyFlashMapHToDebugDir();\r
         }\r
 \r
@@ -622,14 +617,14 @@ public class AutoGen {
         // Write PCD information to library AutoGen.h.\r
         //\r
         if (this.myPcdAutogen != null) {\r
-            fileBuffer.append("\r\n");\r
+            fileBuffer.append("\n");\r
             fileBuffer.append(this.myPcdAutogen.getHAutoGenString());\r
         }\r
 \r
         //\r
         // Append the #endif at AutoGen.h\r
         //\r
-        fileBuffer.append("#endif\r\n");\r
+        fileBuffer.append("#endif\n");\r
 \r
         //\r
         // Save content of string buffer to AutoGen.h file.\r
@@ -711,7 +706,7 @@ public class AutoGen {
                 String includeNameStr = includeName[j];\r
                 if (includeNameStr != null) {\r
                     str = CommonDefinition.INCLUDE + " " + "<";\r
-                    str = str + includeNameStr + ">\r\n";\r
+                    str = str + includeNameStr + ">\n";\r
                     includeStrList.add(str);\r
                     includeNameStr = null;\r
                 }\r
@@ -750,7 +745,7 @@ public class AutoGen {
                                            + "] declaration in any SPD package. ");\r
             } else if (!pkgHeader.equalsIgnoreCase("")) {\r
                 includeStr = CommonDefinition.INCLUDE + " <" + pkgHeader\r
-                             + ">\r\n";\r
+                             + ">\n";\r
                 includeStrList.add(includeStr);\r
             }\r
         }\r
@@ -789,108 +784,111 @@ public class AutoGen {
                 throw new AutoGenException(\r
                                           "Module type = 'PEI_CORE', can have only one module entry point!");\r
             } else {\r
-                fileBuffer.append("EFI_STATUS\r\n");\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
                 fileBuffer.append(entryPointList[0]);\r
-                fileBuffer.append(" (\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.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(" (\n");\r
+                fileBuffer.append("  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\n");\r
+                fileBuffer.append("  IN VOID                        *OldCoreData\n");\r
+                fileBuffer.append("  );\n\n");\r
+\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\n");\r
+                fileBuffer.append("  IN VOID                        *OldCoreData\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
                 fileBuffer.append("  return ");\r
                 fileBuffer.append(entryPointList[0]);\r
-                fileBuffer.append(" (PeiStartupDescriptor, OldCoreData);\r\n");\r
-                fileBuffer.append("}\r\n\r\n");\r
+                fileBuffer.append(" (PeiStartupDescriptor, OldCoreData);\n");\r
+                fileBuffer.append("}\n\n");\r
             }\r
             break;\r
 \r
         case CommonDefinition.ModuleTypeDxeCore:\r
-            fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");\r
+            fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\n");\r
             if (entryPointList == null || entryPointList.length != 1) {\r
                 throw new AutoGenException("Module type = 'DXE_CORE', can have only one module entry point!");\r
             } else {\r
-                fileBuffer.append("VOID\r\n");\r
+                fileBuffer.append("VOID\n");\r
+                fileBuffer.append("EFIAPI\n");\r
                 fileBuffer.append(entryPointList[0]);\r
                 fileBuffer.append(" (\n");\r
-                fileBuffer.append("  IN VOID  *HobStart\r\n");\r
-                fileBuffer.append("  );\r\n\r\n");\r
-\r
-                fileBuffer.append("VOID\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ProcessModuleEntryPointList (\r\n");\r
-                fileBuffer.append("  IN VOID  *HobStart\r\n");\r
-                fileBuffer.append("  )\r\n\r\n");\r
-                fileBuffer.append("{\r\n");\r
+                fileBuffer.append("  IN VOID  *HobStart\n");\r
+                fileBuffer.append("  );\n\n");\r
+\r
+                fileBuffer.append("VOID\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN VOID  *HobStart\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
                 fileBuffer.append("  ");\r
                 fileBuffer.append(entryPointList[0]);\r
-                fileBuffer.append(" (HobStart);\r\n");\r
-                fileBuffer.append("}\r\n\r\n");\r
+                fileBuffer.append(" (HobStart);\n");\r
+                fileBuffer.append("}\n\n");\r
             }\r
             break;\r
 \r
         case CommonDefinition.ModuleTypePeim:\r
             entryPointCount = 0;\r
-            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");\r
+            fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\n");\r
             if (entryPointList == null || entryPointList.length == 0) {\r
-                fileBuffer.append("EFI_STATUS\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ProcessModuleEntryPointList (\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\n");\r
-                fileBuffer.append("{\r\n");\r
-                fileBuffer.append("  return EFI_SUCCESS;\r\n");\r
-                fileBuffer.append("}\r\n\r\n");\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN EFI_FFS_FILE_HEADER  *FfsHeader,\n");\r
+                fileBuffer.append("  IN EFI_PEI_SERVICES     **PeiServices\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
+                fileBuffer.append("  return EFI_SUCCESS;\n");\r
+                fileBuffer.append("}\n\n");\r
                 break;\r
             }\r
             for (int i = 0; i < entryPointList.length; i++) {\r
-                fileBuffer.append("EFI_STATUS\r\n");\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
                 fileBuffer.append(entryPointList[i]);\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
+                fileBuffer.append(" (\n");\r
+                fileBuffer.append("  IN EFI_FFS_FILE_HEADER  *FfsHeader,\n");\r
+                fileBuffer.append("  IN EFI_PEI_SERVICES     **PeiServices\n");\r
+                fileBuffer.append("  );\n");\r
                 entryPointCount++;\r
             }\r
 \r
-            fileBuffer.append("EFI_STATUS\r\n");\r
-            fileBuffer.append("EFIAPI\r\n");\r
-            fileBuffer.append("ProcessModuleEntryPointList (\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\n");\r
-            fileBuffer.append("{\r\n");\r
+            fileBuffer.append("EFI_STATUS\n");\r
+            fileBuffer.append("EFIAPI\n");\r
+            fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+            fileBuffer.append("  IN EFI_FFS_FILE_HEADER  *FfsHeader,\n");\r
+            fileBuffer.append("  IN EFI_PEI_SERVICES     **PeiServices\n");\r
+            fileBuffer.append("  )\n\n");\r
+            fileBuffer.append("{\n");\r
             if (entryPointCount == 1) {\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
+                fileBuffer.append(" (FfsHeader, PeiServices);\n");\r
             } else {\r
-                fileBuffer.append("  EFI_STATUS  Status;\r\n");\r
-                fileBuffer.append("  EFI_STATUS  CombinedStatus;\r\n\r\n");\r
-                fileBuffer.append("  CombinedStatus = EFI_LOAD_ERROR;\r\n\r\n");\r
+                fileBuffer.append("  EFI_STATUS  Status;\n");\r
+                fileBuffer.append("  EFI_STATUS  CombinedStatus;\n\n");\r
+                fileBuffer.append("  CombinedStatus = EFI_LOAD_ERROR;\n\n");\r
                 for (int i = 0; i < entryPointList.length; i++) {\r
                     if (!entryPointList[i].equals("")) {\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.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
+                        fileBuffer.append(" (FfsHeader, PeiServices);\n");\r
+                        fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\n");\r
+                        fileBuffer.append("    CombinedStatus = Status;\n");\r
+                        fileBuffer.append("  }\n\n");\r
                     } else {\r
                         break;\r
                     }\r
                 }\r
-                fileBuffer.append("  return CombinedStatus;\r\n");\r
+                fileBuffer.append("  return CombinedStatus;\n");\r
             }\r
-            fileBuffer.append("}\r\n\r\n");\r
+            fileBuffer.append("}\n\n");\r
             break;\r
 \r
         case CommonDefinition.ModuleTypeDxeSmmDriver:\r
@@ -902,65 +900,66 @@ public class AutoGen {
             if (entryPointList == null || entryPointList.length == 0) {\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
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ProcessModuleEntryPointList (\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\n");\r
-                fileBuffer.append("{\r\n");\r
-                fileBuffer.append("  return EFI_SUCCESS;\r\n");\r
-                fileBuffer.append("}\r\n\r\n");\r
+                fileBuffer.append(";\n");\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
+                fileBuffer.append("  return EFI_SUCCESS;\n");\r
+                fileBuffer.append("}\n\n");\r
 \r
             } else {\r
                 for (int i = 0; i < entryPointList.length; i++) {\r
-                    fileBuffer.append("EFI_STATUS\r\n");\r
+                    fileBuffer.append("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\n");\r
                     fileBuffer.append(entryPointList[i]);\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                    fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                    fileBuffer.append("  );\n");\r
                     entryPointCount++;\r
                 }\r
                 fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED  const UINT8  _gDriverEntryPointCount = ");\r
                 fileBuffer.append(Integer.toString(entryPointCount));\r
-                fileBuffer.append(";\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
-                fileBuffer.append("ProcessModuleEntryPointList (\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\n");\r
-                fileBuffer.append("{\r\n");\r
+                fileBuffer.append(";\n");\r
+                fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\n");\r
+                fileBuffer.append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\n\n");\r
+\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
 \r
                 for (int i = 0; i < entryPointList.length; i++) {\r
-                    fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
+                    fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\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
+                    fileBuffer.append(" (ImageHandle, SystemTable));\n");\r
+                    fileBuffer.append("    ASSERT (FALSE);\n");\r
+                    fileBuffer.append("  }\n");\r
                 }\r
-                fileBuffer.append("  return mDriverEntryPointStatus;\r\n");\r
-                fileBuffer.append("}\r\n\r\n");\r
+                fileBuffer.append("  return mDriverEntryPointStatus;\n");\r
+                fileBuffer.append("}\n\n");\r
 \r
-                fileBuffer.append("VOID\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ExitDriver (\r\n");\r
+                fileBuffer.append("VOID\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ExitDriver (\n");\r
                 fileBuffer.append("  IN EFI_STATUS  Status\n");\r
-                fileBuffer.append("  )\r\n\r\n");\r
-                fileBuffer.append("{\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
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
+                fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\n");\r
+                fileBuffer.append("    mDriverEntryPointStatus = Status;\n");\r
+                fileBuffer.append("  }\n");\r
+                fileBuffer.append("  LongJump (&mJumpContext, (UINTN)-1);\n");\r
+                fileBuffer.append("  ASSERT (FALSE);\n");\r
+                fileBuffer.append("}\n\n");\r
             }\r
 \r
 \r
@@ -974,55 +973,55 @@ public class AutoGen {
             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("EFI_STATUS\n");\r
                     fileBuffer.append(unloadImageList[i]);\r
-                    fileBuffer.append(" (\r\n");\r
-                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle\r\n");\r
-                    fileBuffer.append("  );\r\n");\r
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle\n");\r
+                    fileBuffer.append("  );\n");\r
                     unloadImageCount++;\r
                 }\r
             }\r
 \r
             fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverUnloadImageCount = ");\r
             fileBuffer.append(Integer.toString(unloadImageCount));\r
-            fileBuffer.append(";\r\n\r\n");\r
+            fileBuffer.append(";\n\n");\r
 \r
-            fileBuffer.append("EFI_STATUS\r\n");\r
-            fileBuffer.append("EFIAPI\r\n");\r
-            fileBuffer.append("ProcessModuleUnloadList (\r\n");\r
-            fileBuffer.append("  IN EFI_HANDLE  ImageHandle\r\n");\r
-            fileBuffer.append("  )\r\n");\r
-            fileBuffer.append("{\r\n");\r
+            fileBuffer.append("EFI_STATUS\n");\r
+            fileBuffer.append("EFIAPI\n");\r
+            fileBuffer.append("ProcessModuleUnloadList (\n");\r
+            fileBuffer.append("  IN EFI_HANDLE  ImageHandle\n");\r
+            fileBuffer.append("  )\n");\r
+            fileBuffer.append("{\n");\r
 \r
             if (unloadImageCount == 0) {\r
-                fileBuffer.append("  return EFI_SUCCESS;\r\n");\r
+                fileBuffer.append("  return EFI_SUCCESS;\n");\r
             } else if (unloadImageCount == 1) {\r
                 fileBuffer.append("  return ");\r
                 fileBuffer.append(unloadImageList[0]);\r
-                fileBuffer.append("(ImageHandle);\r\n");\r
+                fileBuffer.append("(ImageHandle);\n");\r
             } else {\r
-                fileBuffer.append("  EFI_STATUS  Status;\r\n\r\n");\r
-                fileBuffer.append("  Status = EFI_SUCCESS;\r\n\r\n");\r
+                fileBuffer.append("  EFI_STATUS  Status;\n\n");\r
+                fileBuffer.append("  Status = EFI_SUCCESS;\n\n");\r
                 for (int i = 0; i < unloadImageList.length; i++) {\r
                     if (i == 0) {\r
                         fileBuffer.append("     Status = ");\r
                         fileBuffer.append(unloadImageList[i]);\r
-                        fileBuffer.append("(ImageHandle);\r\n");\r
+                        fileBuffer.append("(ImageHandle);\n");\r
                     } else {\r
-                        fileBuffer.append("  if (EFI_ERROR (Status)) {\r\n");\r
+                        fileBuffer.append("  if (EFI_ERROR (Status)) {\n");\r
                         fileBuffer.append("    ");\r
                         fileBuffer.append(unloadImageList[i]);\r
-                        fileBuffer.append("(ImageHandle);\r\n");\r
-                        fileBuffer.append("  } else {\r\n");\r
+                        fileBuffer.append("(ImageHandle);\n");\r
+                        fileBuffer.append("  } else {\n");\r
                         fileBuffer.append("    Status = ");\r
                         fileBuffer.append(unloadImageList[i]);\r
-                        fileBuffer.append("(ImageHandle);\r\n");\r
-                        fileBuffer.append("  }\r\n");\r
+                        fileBuffer.append("(ImageHandle);\n");\r
+                        fileBuffer.append("  }\n");\r
                     }\r
                 }\r
-                fileBuffer.append("  return Status;\r\n");\r
+                fileBuffer.append("  return Status;\n");\r
             }\r
-            fileBuffer.append("}\r\n\r\n");\r
+            fileBuffer.append("}\n\n");\r
             break;\r
 \r
         case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
@@ -1031,94 +1030,95 @@ public class AutoGen {
         case CommonDefinition.ModuleTypeUefiDriver:\r
         case CommonDefinition.ModuleTypeUefiApplication:\r
             entryPointCount = 0;\r
-            fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");\r
+            fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\n");\r
             //\r
             // If entry point is null, create a empty ProcessModuleEntryPointList function.\r
             //\r
             if (entryPointList == null || entryPointList.length == 0) {\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
-                fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\r\n");\r
-                fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\r\n");\r
-                fileBuffer.append("  )\r\n\r\n");\r
-                fileBuffer.append("{\r\n");\r
-                fileBuffer.append("  return EFI_SUCCESS;\r\n");\r
-                fileBuffer.append("}\r\n");\r
+                fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverEntryPointCount = 0;\n");\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
+                fileBuffer.append("  return EFI_SUCCESS;\n");\r
+                fileBuffer.append("}\n");\r
 \r
             } else {\r
                 for (int i = 0; i < entryPointList.length; i++) {\r
 \r
-                    fileBuffer.append("EFI_STATUS\r\n");\r
+                    fileBuffer.append("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\n");\r
                     fileBuffer.append(entryPointList[i]);\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                    fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                    fileBuffer.append("  );\n");\r
                     entryPointCount++;\r
                 }\r
 \r
                 fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverEntryPointCount = ");\r
                 fileBuffer.append(Integer.toString(entryPointCount));\r
-                fileBuffer.append(";\r\n");\r
+                fileBuffer.append(";\n");\r
                 if (entryPointCount > 1) {\r
-                    fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\r\n");\r
-                    fileBuffer.append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n");\r
+                    fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER  mJumpContext;\n");\r
+                    fileBuffer.append("static EFI_STATUS  mDriverEntryPointStatus = EFI_LOAD_ERROR;\n");\r
                 }\r
                 fileBuffer.append("\n");\r
 \r
-                fileBuffer.append("EFI_STATUS\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ProcessModuleEntryPointList (\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\n");\r
-                fileBuffer.append("{\r\n");\r
+                fileBuffer.append("EFI_STATUS\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ProcessModuleEntryPointList (\n");\r
+                fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
 \r
                 if (entryPointCount == 1) {\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);\n");\r
                 } else {\r
                     for (int i = 0; i < entryPointList.length; i++) {\r
                         if (!entryPointList[i].equals("")) {\r
-                            fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
+                            fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\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
+                            fileBuffer.append(" (ImageHandle, SystemTable));\n");\r
+                            fileBuffer.append("    ASSERT (FALSE);\n");\r
+                            fileBuffer.append("  }\n");\r
                         } else {\r
                             break;\r
                         }\r
                     }\r
-                    fileBuffer.append("  return mDriverEntryPointStatus;\r\n");\r
+                    fileBuffer.append("  return mDriverEntryPointStatus;\n");\r
                 }\r
-                fileBuffer.append("}\r\n\r\n");\r
-\r
-                fileBuffer.append("VOID\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ExitDriver (\r\n");\r
-                fileBuffer.append("  IN EFI_STATUS  Status\r\n");\r
-                fileBuffer.append("  )\r\n\r\n");\r
-                fileBuffer.append("{\r\n");\r
+                fileBuffer.append("}\n\n");\r
+\r
+                fileBuffer.append("VOID\n");\r
+                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("ExitDriver (\n");\r
+                fileBuffer.append("  IN EFI_STATUS  Status\n");\r
+                fileBuffer.append("  )\n\n");\r
+                fileBuffer.append("{\n");\r
                 if (entryPointCount <= 1) {\r
-                    fileBuffer.append("  if (EFI_ERROR (Status)) {\r\n");\r
-                    fileBuffer.append("    ProcessLibraryDestructorList (gImageHandle, gST);\r\n");\r
-                    fileBuffer.append("  }\r\n");\r
+                    fileBuffer.append("  if (EFI_ERROR (Status)) {\n");\r
+                    fileBuffer.append("    ProcessLibraryDestructorList (gImageHandle, gST);\n");\r
+                    fileBuffer.append("  }\n");\r
                     fileBuffer\r
-                    .append("  gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");\r
+                    .append("  gBS->Exit (gImageHandle, Status, 0, NULL);\n");\r
                 } else {\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("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\n");\r
+                    fileBuffer.append("    mDriverEntryPointStatus = Status;\n");\r
+                    fileBuffer.append("  }\n");\r
+                    fileBuffer.append("  LongJump (&mJumpContext, (UINTN)-1);\n");\r
+                    fileBuffer.append("  ASSERT (FALSE);\n");\r
                 }\r
-                fileBuffer.append("}\r\n\r\n");\r
+                fileBuffer.append("}\n\n");\r
             }\r
 \r
             //\r
@@ -1133,56 +1133,56 @@ public class AutoGen {
             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("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\n");\r
                     fileBuffer.append(unloadImageList[i]);\r
-                    fileBuffer.append(" (\r\n");\r
-                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle\r\n");\r
-                    fileBuffer.append("  );\r\n");\r
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle\n");\r
+                    fileBuffer.append("  );\n");\r
                     unloadImageCount++;\r
                 }\r
             }\r
 \r
             fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverUnloadImageCount = ");\r
             fileBuffer.append(Integer.toString(unloadImageCount));\r
-            fileBuffer.append(";\r\n\r\n");\r
+            fileBuffer.append(";\n\n");\r
 \r
             fileBuffer.append("EFI_STATUS\n");\r
-            fileBuffer.append("EFIAPI\r\n");\r
-            fileBuffer.append("ProcessModuleUnloadList (\r\n");\r
-            fileBuffer.append("  IN EFI_HANDLE  ImageHandle\r\n");\r
-            fileBuffer.append("  )\r\n");\r
-            fileBuffer.append("{\r\n");\r
+            fileBuffer.append("EFIAPI\n");\r
+            fileBuffer.append("ProcessModuleUnloadList (\n");\r
+            fileBuffer.append("  IN EFI_HANDLE  ImageHandle\n");\r
+            fileBuffer.append("  )\n");\r
+            fileBuffer.append("{\n");\r
 \r
             if (unloadImageCount == 0) {\r
-                fileBuffer.append("  return EFI_SUCCESS;\r\n");\r
+                fileBuffer.append("  return EFI_SUCCESS;\n");\r
             } else if (unloadImageCount == 1) {\r
                 fileBuffer.append("  return ");\r
                 fileBuffer.append(unloadImageList[0]);\r
-                fileBuffer.append("(ImageHandle);\r\n");\r
+                fileBuffer.append("(ImageHandle);\n");\r
             } else {\r
-                fileBuffer.append("  EFI_STATUS  Status;\r\n\r\n");\r
-                fileBuffer.append("  Status = EFI_SUCCESS;\r\n\r\n");\r
+                fileBuffer.append("  EFI_STATUS  Status;\n\n");\r
+                fileBuffer.append("  Status = EFI_SUCCESS;\n\n");\r
                 for (int i = 0; i < unloadImageList.length; i++) {\r
                     if (i == 0) {\r
                         fileBuffer.append("  Status = ");\r
                         fileBuffer.append(unloadImageList[i]);\r
-                        fileBuffer.append("(ImageHandle);\r\n");\r
+                        fileBuffer.append("(ImageHandle);\n");\r
                     } else {\r
-                        fileBuffer.append("  if (EFI_ERROR (Status)) {\r\n");\r
+                        fileBuffer.append("  if (EFI_ERROR (Status)) {\n");\r
                         fileBuffer.append("    ");\r
                         fileBuffer.append(unloadImageList[i]);\r
-                        fileBuffer.append("(ImageHandle);\r\n");\r
-                        fileBuffer.append("  } else {\r\n");\r
+                        fileBuffer.append("(ImageHandle);\n");\r
+                        fileBuffer.append("  } else {\n");\r
                         fileBuffer.append("    Status = ");\r
                         fileBuffer.append(unloadImageList[i]);\r
-                        fileBuffer.append("(ImageHandle);\r\n");\r
-                        fileBuffer.append("  }\r\n");\r
+                        fileBuffer.append("(ImageHandle);\n");\r
+                        fileBuffer.append("  }\n");\r
                     }\r
                 }\r
-                fileBuffer.append("  return Status;\r\n");\r
+                fileBuffer.append("  return Status;\n");\r
             }\r
-            fileBuffer.append("}\r\n\r\n");\r
+            fileBuffer.append("}\n\n");\r
             break;\r
         }\r
     }\r
@@ -1225,7 +1225,7 @@ public class AutoGen {
             ppiKeyWord = ppiIterator.next().toString();\r
             cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, ppiKeyWord);\r
             if (cNameGuid != null) {\r
-                fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+                fileBuffer.append("\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
                 fileBuffer.append(cNameGuid[0]);\r
                 fileBuffer.append(" =     { ");\r
                 fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));\r
@@ -1280,7 +1280,7 @@ public class AutoGen {
             protocolKeyWord = protocolIterator.next().toString();\r
             cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord);\r
             if (cNameGuid != null) {\r
-                fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+                fileBuffer.append("\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
                 fileBuffer.append(cNameGuid[0]);\r
                 fileBuffer.append(" =     { ");\r
                 fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));\r
@@ -1322,7 +1322,7 @@ public class AutoGen {
             cNameGuid = GlobalData.getGuid(this.mDepPkgList, guidKeyWord);\r
 \r
             if (cNameGuid != null) {\r
-                fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
+                fileBuffer.append("\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");\r
                 fileBuffer.append(cNameGuid[0]);\r
                 fileBuffer.append(" =     { ");\r
                 fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));\r
@@ -1386,32 +1386,32 @@ public class AutoGen {
         //\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
-                fileBuffer.append("EFIAPI\r\n");\r
+                fileBuffer.append("RETURN_STATUS\n");\r
+                fileBuffer.append("EFIAPI\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
+                fileBuffer.append(" (\n");\r
+                fileBuffer.append("  VOID\n");\r
+                fileBuffer.append("  );\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("RETURN_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  VOID\n");\r
+                    fileBuffer.append("  );\n");\r
                     break;\r
 \r
                 case CommonDefinition.ModuleTypePeiCore:\r
                 case CommonDefinition.ModuleTypePeim:\r
-                    fileBuffer.append("EFI_STATUS\r\n");\r
-                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\n");\r
+                    fileBuffer.append("  IN EFI_PEI_SERVICES          **PeiServices\n");\r
+                    fileBuffer.append("  );\n");\r
                     break;\r
 \r
                 case CommonDefinition.ModuleTypeDxeCore:\r
@@ -1421,13 +1421,13 @@ public class AutoGen {
                 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("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                    fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                    fileBuffer.append("  );\n");\r
                     break;\r
 \r
                 }\r
@@ -1437,19 +1437,19 @@ public class AutoGen {
         //\r
         // Add ProcessLibraryConstructorList in AutoGen.c\r
         //\r
-        fileBuffer.append("VOID\r\n");\r
-        fileBuffer.append("EFIAPI\r\n");\r
-        fileBuffer.append("ProcessLibraryConstructorList (\r\n");\r
+        fileBuffer.append("VOID\n");\r
+        fileBuffer.append("EFIAPI\n");\r
+        fileBuffer.append("ProcessLibraryConstructorList (\n");\r
         switch (CommonDefinition.getModuleType(moduleType)) {\r
         case CommonDefinition.ModuleTypeBase:\r
-            fileBuffer.append("  VOID\r\n");\r
+            fileBuffer.append("  VOID\n");\r
             break;\r
 \r
         case CommonDefinition.ModuleTypePeiCore:\r
         case CommonDefinition.ModuleTypePeim:\r
-            fileBuffer.append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r\n");\r
+            fileBuffer.append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\n");\r
             fileBuffer\r
-            .append("  IN EFI_PEI_SERVICES          **PeiServices\r\n");\r
+            .append("  IN EFI_PEI_SERVICES          **PeiServices\n");\r
             break;\r
 \r
         case CommonDefinition.ModuleTypeDxeCore:\r
@@ -1459,42 +1459,42 @@ public class AutoGen {
         case CommonDefinition.ModuleTypeDxeSalDriver:\r
         case CommonDefinition.ModuleTypeUefiDriver:\r
         case CommonDefinition.ModuleTypeUefiApplication:\r
-            fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\r\n");\r
-            fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\r\n");\r
+            fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+            fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
             break;\r
         }\r
 \r
-        fileBuffer.append("  )\r\n");\r
-        fileBuffer.append("{\r\n");\r
+        fileBuffer.append("  )\n");\r
+        fileBuffer.append("{\n");\r
         //\r
         // If no constructor function, return EFI_SUCCESS.\r
         //\r
         //if (libInstanceList.size() == 0){\r
-        //   fileBuffer.append("  return EFI_SUCCESS;\r\n");\r
+        //   fileBuffer.append("  return EFI_SUCCESS;\n");\r
         //}\r
         for (int i = 0; i < libInstanceList.size(); i++) {\r
             if (isFirst) {\r
-                fileBuffer.append("  EFI_STATUS  Status;\r\n");\r
-                fileBuffer.append("  Status = EFI_SUCCESS;\r\n");\r
-                fileBuffer.append("\r\n");\r
+                fileBuffer.append("  EFI_STATUS  Status;\n");\r
+                fileBuffer.append("  Status = EFI_SUCCESS;\n");\r
+                fileBuffer.append("\n");\r
                 isFirst = false;\r
             }\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("();\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
+                    fileBuffer.append("();\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
+                    fileBuffer.append(" (FfsHeader, PeiServices);\n");\r
                     break;\r
                 case CommonDefinition.ModuleTypeDxeCore:\r
                 case CommonDefinition.ModuleTypeDxeDriver:\r
@@ -1505,16 +1505,16 @@ public class AutoGen {
                 case CommonDefinition.ModuleTypeUefiApplication:\r
                     fileBuffer.append("  Status = ");\r
                     fileBuffer.append(libInstanceList.get(i)[0]);\r
-                    fileBuffer.append(" (ImageHandle, SystemTable);\r\n");\r
+                    fileBuffer.append(" (ImageHandle, SystemTable);\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
+            fileBuffer.append("  ASSERT_EFI_ERROR (Status);\n");\r
         }\r
-        fileBuffer.append("}\r\n");\r
+        fileBuffer.append("}\n");\r
     }\r
 \r
     /**\r
@@ -1536,31 +1536,31 @@ public class AutoGen {
         boolean isFirst = true;\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
-                fileBuffer.append("EFIAPI\r\n");\r
+                fileBuffer.append("RETURN_STATUS\n");\r
+                fileBuffer.append("EFIAPI\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
+                fileBuffer.append(" (\n");\r
+                fileBuffer.append("  VOID\n");\r
+                fileBuffer.append("  );\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("RETURN_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  VOID\n");\r
+                    fileBuffer.append("  );\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("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_FFS_FILE_HEADER       *FfsHeader,\n");\r
+                    fileBuffer.append("  IN EFI_PEI_SERVICES          **PeiServices\n");\r
+                    fileBuffer.append("  );\n");\r
                     break;\r
                 case CommonDefinition.ModuleTypeDxeCore:\r
                 case CommonDefinition.ModuleTypeDxeDriver:\r
@@ -1569,13 +1569,13 @@ public class AutoGen {
                 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("EFI_STATUS\n");\r
+                    fileBuffer.append("EFIAPI\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
+                    fileBuffer.append(" (\n");\r
+                    fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+                    fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+                    fileBuffer.append("  );\n");\r
                     break;\r
                 }\r
             }\r
@@ -1596,37 +1596,37 @@ public class AutoGen {
         case CommonDefinition.ModuleTypeDxeSalDriver:\r
         case CommonDefinition.ModuleTypeUefiDriver:\r
         case CommonDefinition.ModuleTypeUefiApplication:\r
-            fileBuffer.append("VOID\r\n");\r
-            fileBuffer.append("EFIAPI\r\n");\r
-            fileBuffer.append("ProcessLibraryDestructorList (\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
-            fileBuffer.append("{\r\n");\r
+            fileBuffer.append("VOID\n");\r
+            fileBuffer.append("EFIAPI\n");\r
+            fileBuffer.append("ProcessLibraryDestructorList (\n");\r
+            fileBuffer.append("  IN EFI_HANDLE        ImageHandle,\n");\r
+            fileBuffer.append("  IN EFI_SYSTEM_TABLE  *SystemTable\n");\r
+            fileBuffer.append("  )\n");\r
+            fileBuffer.append("{\n");\r
             //\r
             // If no library destructor function, return EFI_SUCCESS.\r
             //\r
 \r
             for (int i = 0; i < libInstanceList.size(); i++) {\r
                 if (isFirst) {\r
-                    fileBuffer.append("  EFI_STATUS  Status;\r\n");\r
-                    fileBuffer.append("  Status = EFI_SUCCESS;\r\n");\r
-                    fileBuffer.append("\r\n");\r
+                    fileBuffer.append("  EFI_STATUS  Status;\n");\r
+                    fileBuffer.append("  Status = EFI_SUCCESS;\n");\r
+                    fileBuffer.append("\n");\r
                     isFirst = false;\r
                 }\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
+                    fileBuffer.append("();\n");\r
+                    fileBuffer.append("  VOID\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
+                    fileBuffer.append("(ImageHandle, SystemTable);\n");\r
+                    fileBuffer.append("  ASSERT_EFI_ERROR (Status);\n");\r
                 }\r
             }\r
-            fileBuffer.append("}\r\n");\r
+            fileBuffer.append("}\n");\r
             break;\r
         }\r
     }\r
@@ -1662,7 +1662,7 @@ public class AutoGen {
             if (driverBindingGroup[i][0] != null) {\r
                 fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL ");\r
                 fileBuffer.append(driverBindingGroup[i][0]);\r
-                fileBuffer.append(";\r\n");\r
+                fileBuffer.append(";\n");\r
             }\r
         }\r
 \r
@@ -1676,7 +1676,7 @@ public class AutoGen {
                         BitMask |= 0x01;\r
                         fileBuffer.append("extern EFI_COMPONENT_NAME_PROTOCOL ");\r
                         fileBuffer.append(driverBindingGroup[i][1]);\r
-                        fileBuffer.append(";\r\n");\r
+                        fileBuffer.append(";\n");\r
                     } else {\r
                         throw new AutoGenException("DriverBinding can't be empty!!");\r
                     }\r
@@ -1693,7 +1693,7 @@ public class AutoGen {
                     BitMask |= 0x02;\r
                     fileBuffer.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL ");\r
                     fileBuffer.append(driverBindingGroup[i][2]);\r
-                    fileBuffer.append(";\r\n");\r
+                    fileBuffer.append(";\n");\r
                 } else {\r
                     throw new AutoGenException("DriverBinding can't be empty!!");\r
                 }\r
@@ -1710,7 +1710,7 @@ public class AutoGen {
                         BitMask |= 0x04;\r
                         fileBuffer.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL ");\r
                         fileBuffer.append(driverBindingGroup[i][3]);\r
-                        fileBuffer.append(";\r\n");\r
+                        fileBuffer.append(";\n");\r
                     } else {\r
                         throw new AutoGenException("DriverBinding can't be empty!!");\r
                     }\r
@@ -1724,7 +1724,7 @@ public class AutoGen {
         //\r
         fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8  _gDriverModelProtocolBitmask = ");\r
         fileBuffer.append(Integer.toString(BitMask));\r
-        fileBuffer.append(";\r\n");\r
+        fileBuffer.append(";\n");\r
 \r
         //\r
         // Write driver module protocol list entry\r
@@ -1732,7 +1732,7 @@ public class AutoGen {
         fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN  _gDriverModelProtocolListEntries = ");\r
 \r
         fileBuffer.append(Integer.toString(driverBindingGroup.length));\r
-        fileBuffer.append(";\r\n");\r
+        fileBuffer.append(";\n");\r
 \r
         //\r
         // Write drive module protocol list to autogen.c\r
@@ -1749,10 +1749,10 @@ public class AutoGen {
             //\r
             //  DriverBinding\r
             // \r
-            fileBuffer.append("\r\n {\r\n");\r
+            fileBuffer.append("\n {\n");\r
             fileBuffer.append("  &");\r
             fileBuffer.append(driverBindingGroup[i][0]);\r
-            fileBuffer.append(", \r\n");\r
+            fileBuffer.append(", \n");\r
 \r
             //\r
             //  ComponentName\r
@@ -1760,9 +1760,9 @@ public class AutoGen {
             if (driverBindingGroup[i][1] != null && componentNamePcd != true) {\r
                 fileBuffer.append("  &");\r
                 fileBuffer.append(driverBindingGroup[i][1]);\r
-                fileBuffer.append(", \r\n");\r
+                fileBuffer.append(", \n");\r
             } else {\r
-                fileBuffer.append("  NULL, \r\n");\r
+                fileBuffer.append("  NULL, \n");\r
             }\r
 \r
             //\r
@@ -1771,9 +1771,9 @@ public class AutoGen {
             if (driverBindingGroup[i][2] != null) {\r
                 fileBuffer.append("  &");\r
                 fileBuffer.append(driverBindingGroup[i][2]);\r
-                fileBuffer.append(", \r\n");\r
+                fileBuffer.append(", \n");\r
             } else {\r
-                fileBuffer.append("  NULL, \r\n");\r
+                fileBuffer.append("  NULL, \n");\r
             }\r
 \r
             //\r
@@ -1782,15 +1782,15 @@ public class AutoGen {
             if (driverBindingGroup[i][3] != null && driverDiagnostPcd != true) {\r
                 fileBuffer.append("  &");\r
                 fileBuffer.append(driverBindingGroup[i][3]);\r
-                fileBuffer.append(", \r\n");\r
+                fileBuffer.append(", \n");\r
             } else {\r
-                fileBuffer.append("  NULL, \r\n");\r
+                fileBuffer.append("  NULL, \n");\r
             }\r
             fileBuffer.append("  }");\r
         }\r
 \r
         if (driverBindingGroup.length > 0) {\r
-            fileBuffer.append("\r\n};\r\n");\r
+            fileBuffer.append("\n};\n");\r
         }\r
     }\r
 \r
@@ -2016,7 +2016,7 @@ public class AutoGen {
         // 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
+        fileBuffer.append("\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
@@ -2034,14 +2034,14 @@ public class AutoGen {
         }\r
 \r
         fileBuffer.append(Integer.toString(Count));\r
-        fileBuffer.append(";\r\n\r\n");\r
+        fileBuffer.append(";\n\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
+            fileBuffer.append("\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\n");\r
+            fileBuffer.append("  NULL\n");\r
+            fileBuffer.append("};\n\n");\r
         } else {\r
             //\r
             // Write SetVirtualAddressMap function definition.\r
@@ -2050,28 +2050,28 @@ public class AutoGen {
                 if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
                     break;\r
                 }\r
-                fileBuffer.append("VOID\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
+                fileBuffer.append("VOID\n");\r
+                fileBuffer.append("EFIAPI\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
+                fileBuffer.append(" (\n");\r
+                fileBuffer.append("  IN EFI_EVENT  Event,\n");\r
+                fileBuffer.append("  IN VOID       *Context\n");\r
+                fileBuffer.append("  );\n\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
+            fileBuffer.append("\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
+                    fileBuffer.append("\n  ");\r
                 } else {\r
-                    fileBuffer.append(",\r\n  ");\r
+                    fileBuffer.append(",\n  ");\r
                 }\r
 \r
                 fileBuffer.append(this.setVirtalAddList.get(i));\r
@@ -2079,8 +2079,8 @@ public class AutoGen {
             //\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
+            fileBuffer.append(",\n  NULL");\r
+            fileBuffer.append("\n};\n\n");\r
         }\r
     }\r
 \r
@@ -2090,7 +2090,7 @@ public class AutoGen {
         // 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
+        .append("\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
@@ -2107,15 +2107,15 @@ public class AutoGen {
             Count = i;\r
         }\r
         fileBuffer.append(Integer.toString(Count));\r
-        fileBuffer.append(";\r\n\r\n");\r
+        fileBuffer.append(";\n\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
+            fileBuffer.append("\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\n");\r
+            fileBuffer.append("  NULL\n");\r
+            fileBuffer.append("};\n\n");\r
         } else {\r
             //\r
             // Write DriverExitBootServices function definition.\r
@@ -2125,34 +2125,34 @@ public class AutoGen {
                     break;\r
                 }\r
 \r
-                fileBuffer.append("VOID\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
+                fileBuffer.append("VOID\n");\r
+                fileBuffer.append("EFIAPI\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
+                fileBuffer.append(" (\n");\r
+                fileBuffer.append("  IN EFI_EVENT  Event,\n");\r
+                fileBuffer.append("  IN VOID       *Context\n");\r
+                fileBuffer.append("  );\n\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
+            fileBuffer.append("\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
+                    fileBuffer.append("\n  ");\r
                 } else {\r
-                    fileBuffer.append(",\r\n  ");\r
+                    fileBuffer.append(",\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
+            fileBuffer.append(",\n  NULL");\r
+            fileBuffer.append("\n};\n\n");\r
         }   \r
     }\r
     /**\r