/*++\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
// 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
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
\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