]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/EfiRom/EfiRom.c
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / EfiRom / EfiRom.c
index fc3b5ad277a60db17bd7b3fda5a8a2bbf39932ee..cb4ecea2c498b703b170e4017e4101618bfda601 100644 (file)
@@ -1,9 +1,9 @@
 /** @file\r
 Utility program to create an EFI option ROM image from binary and EFI PE32 files.\r
 \r
-Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available \r
-under the terms and conditions of the BSD License which accompanies this \r
+Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available\r
+under the terms and conditions of the BSD License which accompanies this\r
 distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
 \r
@@ -26,8 +26,8 @@ main (
 /*++\r
 \r
 Routine Description:\r
-  \r
-  Given an EFI image filename, create a ROM-able image by creating an option \r
+\r
+  Given an EFI image filename, create a ROM-able image by creating an option\r
   ROM header and PCI data structure, filling them in, and then writing the\r
   option ROM header + PCI data structure + EFI image out to the output file.\r
 \r
@@ -71,11 +71,11 @@ Returns:
   } else if (mOptions.Debug) {\r
     SetPrintLevel(DebugLevel);\r
   }\r
-  \r
+\r
   if (mOptions.Verbose) {\r
     VerboseMsg("%s tool start.\n", UTILITY_NAME);\r
   }\r
-  \r
+\r
   //\r
   // If dumping an image, then do that and quit\r
   //\r
@@ -208,7 +208,7 @@ BailOut:
     VerboseMsg("%s tool done with return code is 0x%x.\n", UTILITY_NAME, GetUtilityStatus ());\r
   }\r
 \r
-  return GetUtilityStatus (); \r
+  return GetUtilityStatus ();\r
 }\r
 \r
 static\r
@@ -221,7 +221,7 @@ ProcessBinFile (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Process a binary input file.\r
 \r
 Arguments:\r
@@ -247,7 +247,7 @@ Returns:
   UINT32                    Index;\r
   UINT8                     ByteCheckSum;\r
   UINT16                    CodeType;\r
\r
+\r
   PciDs23 = NULL;\r
   PciDs30 = NULL;\r
   Status = STATUS_SUCCESS;\r
@@ -351,7 +351,7 @@ Returns:
   } else {\r
     PciDs30->ImageLength = (UINT16) (TotalSize / 512);\r
     CodeType = PciDs30->CodeType;\r
-       }\r
+  }\r
 \r
   //\r
   // If this is the last image, then set the LAST bit unless requested not\r
@@ -362,13 +362,13 @@ Returns:
       PciDs23->Indicator = INDICATOR_LAST;\r
     } else {\r
       PciDs30->Indicator = INDICATOR_LAST;\r
-               }\r
+    }\r
   } else {\r
     if (mOptions.Pci23 == 1) {\r
       PciDs23->Indicator = 0;\r
     } else {\r
       PciDs30->Indicator = 0;\r
-               }\r
+    }\r
   }\r
 \r
   if (CodeType != PCI_CODE_TYPE_EFI_IMAGE) {\r
@@ -431,7 +431,7 @@ ProcessEfiFile (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Process a PE32 EFI file.\r
 \r
 Arguments:\r
@@ -502,7 +502,7 @@ Returns:
   } else {\r
     HeaderPadBytes = 0;\r
   }\r
-  \r
+\r
   //\r
   // For Pci3.0 to use the different data structure.\r
   //\r
@@ -600,7 +600,7 @@ Returns:
   // Check size\r
   //\r
   if (TotalSize > MAX_OPTION_ROM_SIZE) {\r
-    Error (NULL, 0, 2000, "Invalid", "Option ROM image %s size exceeds limit of 0x%X bytes.", InFile->FileName, MAX_OPTION_ROM_SIZE);  \r
+    Error (NULL, 0, 2000, "Invalid", "Option ROM image %s size exceeds limit of 0x%X bytes.", InFile->FileName, MAX_OPTION_ROM_SIZE);\r
     Status = STATUS_ERROR;\r
     goto BailOut;\r
   }\r
@@ -685,12 +685,12 @@ Returns:
   if ((InFile->Next == NULL) && (mOptions.NoLast == 0)) {\r
     if (mOptions.Pci23 == 1) {\r
       PciDs23.Indicator = INDICATOR_LAST;\r
-         } else {\r
+    } else {\r
     PciDs30.Indicator = INDICATOR_LAST;}\r
   } else {\r
     if (mOptions.Pci23 == 1) {\r
       PciDs23.Indicator = 0;\r
-       } else {\r
+  } else {\r
       PciDs30.Indicator = 0;\r
     }\r
   }\r
@@ -723,13 +723,13 @@ Returns:
       Error (NULL, 0, 0002, "Failed to write PCI ROM header to output file!", NULL);\r
       Status = STATUS_ERROR;\r
       goto BailOut;\r
-    } \r
+    }\r
   } else {\r
     if (fwrite (&PciDs30, sizeof (PciDs30), 1, OutFptr) != 1) {\r
       Error (NULL, 0, 0002, "Failed to write PCI ROM header to output file!", NULL);\r
       Status = STATUS_ERROR;\r
       goto BailOut;\r
-    } \r
+    }\r
   }\r
 \r
   //\r
@@ -819,7 +819,7 @@ CheckPE32File (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Given a file pointer to a supposed PE32 image file, verify that it is indeed a\r
   PE32 image file, and then return the machine type in the supplied pointer.\r
 \r
@@ -911,7 +911,7 @@ ParseCommandLine (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Given the Argc/Argv program arguments, and a pointer to an options structure,\r
   parse the command-line options and check their validity.\r
 \r
@@ -973,12 +973,12 @@ Returns:
     Usage ();\r
     return STATUS_ERROR;\r
   }\r
-  \r
+\r
   if ((stricmp(Argv[0], "-h") == 0) || (stricmp(Argv[0], "--help") == 0)) {\r
     Usage();\r
     return STATUS_ERROR;\r
   }\r
-  \r
+\r
   if ((stricmp(Argv[0], "--version") == 0)) {\r
     Version();\r
     return STATUS_ERROR;\r
@@ -1222,7 +1222,7 @@ Returns:
         ReturnStatus = STATUS_ERROR;\r
         goto Done;\r
       }\r
-      \r
+\r
       //\r
       // set flag and class code for this image.\r
       //\r
@@ -1239,7 +1239,7 @@ Returns:
       } else {\r
         if (PrevFileList == NULL) {\r
           PrevFileList = FileList;\r
-        } else {          \r
+        } else {\r
           PrevFileList->Next = FileList;\r
         }\r
       }\r
@@ -1273,7 +1273,7 @@ Returns:
       ReturnStatus = STATUS_ERROR;\r
       goto Done;\r
     }\r
-  \r
+\r
     if (!Options->DevIdCount) {\r
       Error (NULL, 0, 2000, "Missing Device ID in command line", NULL);\r
       ReturnStatus = STATUS_ERROR;\r
@@ -1307,7 +1307,7 @@ Version (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Print version information for this utility.\r
 \r
 Arguments:\r
@@ -1321,7 +1321,7 @@ Returns:
 {\r
  fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
 }\r
-   \r
+\r
 static\r
 void\r
 Usage (\r
@@ -1330,7 +1330,7 @@ Usage (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Print usage information for this utility.\r
 \r
 Arguments:\r
@@ -1347,11 +1347,11 @@ Returns:
   // Summary usage\r
   //\r
   fprintf (stdout, "Usage: %s -f VendorId -i DeviceId [options] [file name<s>] \n\n", UTILITY_NAME);\r
-  \r
+\r
   //\r
   // Copyright declaration\r
-  // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.\n\n");\r
+  //\r
+  fprintf (stdout, "Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -1386,7 +1386,7 @@ Returns:
   fprintf (stdout, "  -q, --quiet\n\\r
             Disable all messages except FATAL ERRORS.\n");\r
   fprintf (stdout, "  --debug [#,0-9]\n\\r
-            Enable debug messages at level #.\n");  \r
+            Enable debug messages at level #.\n");\r
 }\r
 \r
 static\r
@@ -1515,7 +1515,7 @@ Returns:
     fprintf (stdout, "    Device ID               0x%04X\n", PciDs30.DeviceId);\r
     fprintf (stdout, "    Length                  0x%04X\n", PciDs30.Length);\r
     fprintf (stdout, "    Revision                0x%04X\n", PciDs30.Revision);\r
-    fprintf (stdout, "    DeviceListOffset        0x%02X\n", PciDs30.DeviceListOffset);    \r
+    fprintf (stdout, "    DeviceListOffset        0x%02X\n", PciDs30.DeviceListOffset);\r
     if (PciDs30.DeviceListOffset) {\r
       //\r
       // Print device ID list\r
@@ -1549,8 +1549,8 @@ Returns:
     fprintf (stdout, "    Code revision:          0x%04X\n", PciDs30.CodeRevision);\r
     fprintf (stdout, "    MaxRuntimeImageLength   0x%02X\n", PciDs30.MaxRuntimeImageLength);\r
     fprintf (stdout, "    ConfigUtilityCodeHeaderOffset 0x%02X\n", PciDs30.ConfigUtilityCodeHeaderOffset);\r
-    fprintf (stdout, "    DMTFCLPEntryPointOffset 0x%02X\n", PciDs30.DMTFCLPEntryPointOffset);   \r
-    fprintf (stdout, "    Indicator               0x%02X", PciDs30.Indicator);    \r
+    fprintf (stdout, "    DMTFCLPEntryPointOffset 0x%02X\n", PciDs30.DMTFCLPEntryPointOffset);\r
+    fprintf (stdout, "    Indicator               0x%02X", PciDs30.Indicator);\r
     }\r
     //\r
     // Print the indicator, used to flag the last image\r
@@ -1566,7 +1566,7 @@ Returns:
     if (mOptions.Pci23 == 1) {\r
       fprintf (stdout, "    Code type              0x%02X", PciDs23.CodeType);\r
     } else {\r
-      fprintf (stdout, "    Code type               0x%02X", PciDs30.CodeType); \r
+      fprintf (stdout, "    Code type               0x%02X", PciDs30.CodeType);\r
     }\r
     if (PciDs23.CodeType == PCI_CODE_TYPE_EFI_IMAGE || PciDs30.CodeType == PCI_CODE_TYPE_EFI_IMAGE) {\r
       fprintf (stdout, "   (EFI image)\n");\r