]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/GenBsfFixup/GenBsfFixup.c
Fix building error in Linux
[mirror_edk2.git] / Tools / CCode / Source / GenBsfFixup / GenBsfFixup.c
index 462f97fa83d63c318d77d6662480d054b2f40153..1cc1e83389e13203276b1b209d8a9e4bed004aa0 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved\r
+Copyright (c)  1999 - 2006 Intel Corporation. All rights reserved\r
 This software and associated documentation (if any) is furnished\r
 under a license and may only be used or copied in accordance\r
 with the terms of the license. Except as permitted by such\r
@@ -42,7 +42,10 @@ Abstract:
 //           A lot of the file-header stuff has been ported, but\r
 //           not the section information.\r
 //\r
-#define TOOLVERSION "0.1"\r
+\r
+#define UTILITY_NAME "GenBsfFixup"\r
+#define UTILITY_MAJOR_VERSION 0\r
+#define UTILITY_MINOR_VERSION 1\r
 \r
 UINT32  gFixup;\r
 \r
@@ -78,6 +81,26 @@ Returns:
   return OccupiedSize;\r
 }\r
 \r
+static\r
+void\r
+Version (\r
+  VOID\r
+  )\r
+{\r
+  printf ("%s v%d.%d -EDK Utility to Fixup the SEC component for IA32.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
+  printf ("Copyright (c) 1999-2006 Intel Corporation. All rights reserved.\n");\r
+}\r
+\r
+\r
+VOID\r
+Usage (\r
+  VOID\r
+  )\r
+{\r
+  Version();\r
+  printf ("\nUsage: " UTILITY_NAME " FvVolumeImageFile AddressOfFvInMemory OffsetOfFixup OutputFileName \n");\r
+}\r
+\r
 int\r
 ReadHeader (\r
   FILE    *In,\r
@@ -370,14 +393,25 @@ Returns:
 \r
   Index   = 0;\r
   Invert  = 0;\r
-  printf (\r
-    "GenBsfFixup EFI 2.0.  Version %s, %s\n""Copyright (c) 2000-2001, Intel Corporation\n\n",\r
-    TOOLVERSION,\r
-    __DATE__\r
-    );\r
-\r
\r
+  if (argc < 1) {\r
+    Usage();\r
+    return -1;\r
+  }\r
+  \r
+  if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0) ||\r
+      (strcmp(argv[1], "-?") == 0) || (strcmp(argv[1], "/?") == 0)) {\r
+    Usage();\r
+    return -1;\r
+  }\r
+  \r
+  if ((strcmp(argv[1], "-V") == 0) || (strcmp(argv[1], "--version") == 0)) {\r
+    Version();\r
+    return -1;\r
+  }\r
\r
   if (argc != 5) {\r
-    printf ("Usage:\n""  GenBsfFixup FvVolumeImageFile AddressOfFvInMemory OffsetOfFixup OutputFileName\n");\r
+    Usage();\r
     return -1;\r
   }\r
 \r