]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenPage/GenPage.c
License header updated to match correct format.
[mirror_edk2.git] / BaseTools / Source / C / GenPage / GenPage.c
index dac55889d512bbd944217151b45452312e48a54a..fb829e69cb0f87be9348cb48d564dd1578272ba1 100644 (file)
@@ -1,18 +1,4 @@
 /** @file\r
-\r
-Copyright 2006 - 2008, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  GenPage.c\r
-  \r
-Abstract:\r
   Pre-Create a 4G page table (2M pages).\r
   It's used in DUET x64 build needed to enter LongMode.\r
  \r
@@ -28,6 +14,16 @@ Abstract:
                         (\r
                           Directory-Ptr Directory {512}\r
                         ) {4}\r
+\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
 **/\r
 \r
 #include <stdio.h>\r
@@ -63,13 +59,13 @@ UINT32 gPageTableOffsetInFile = EFI_PAGE_BASE_OFFSET_IN_LDR;
 //\r
 // Utility Name\r
 //\r
-#define UTILITY_NAME  "GenBootSector"\r
+#define UTILITY_NAME  "GenPage"\r
 \r
 //\r
 // Utility version information\r
 //\r
 #define UTILITY_MAJOR_VERSION 0\r
-#define UTILITY_MINOR_VERSION 1\r
+#define UTILITY_MINOR_VERSION 2\r
 \r
 void\r
 Version (\r
@@ -91,8 +87,7 @@ Returns:
 \r
 --*/\r
 {\r
-  printf ("%s v%d.%d -Utility to generate the EfiLoader image containing page table.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION);\r
-  printf ("Copyright (c) 2008 - 2009 Intel Corporation. All rights reserved.\n");\r
+  printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
 }\r
 \r
 VOID\r
@@ -100,18 +95,29 @@ Usage (
   void\r
   )\r
 {\r
-  Version();\r
-  printf ("\nUsage: \n\\r
-   GenPage\n\\r
-     -o, --output Filename containing page table\n\\r
-     [-b, --baseaddr baseaddress of page table]\n\\r
-     [-f, --offset offset in the file that page table will reside]\n\\r
-     [-v, --verbose]\n\\r
-     [--version]\n\\r
-     [-q, --quiet disable all messages except fatal errors]\n\\r
-     [-d, --debug[#]\n\\r
-     [-h, --help]\n\\r
-     EfiLoaderImageName\n");\r
+  printf ("Usage: GenPage.exe [options] EfiLoaderImageName \n\n\\r
+Copyright (c) 2008 - 2014, Intel Corporation.  All rights reserved.\n\n\\r
+  Utility to generate the EfiLoader image containing a page table.\n\n\\r
+optional arguments:\n\\r
+  -h, --help            Show this help message and exit\n\\r
+  --version             Show program's version number and exit\n\\r
+  -d [DEBUG], --debug [DEBUG]\n\\r
+                        Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\\r
+                        - 9 (max)\n\\r
+  -v, --verbose         Print informational statements\n\\r
+  -q, --quiet           Returns the exit code, error messages will be\n\\r
+                        displayed\n\\r
+  -s, --silent          Returns only the exit code; informational and error\n\\r
+                        messages are not displayed\n\\r
+  -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\\r
+                        Output file contain both the non-page table part and\n\\r
+                        the page table\n\\r
+  -b BASE_ADDRESS, --baseaddr BASE_ADDRESS\n\\r
+                        The page table location\n\\r
+  -f OFFSET, --offset OFFSET\n\\r
+                        The position that the page table will appear in the\n\\r
+                        output file\n\\r
+  --sfo                 Reserved for future use\n");\r
 \r
 }\r
 \r
@@ -233,13 +239,13 @@ return:
   //\r
   // Open files\r
   //\r
-  PageFile = fopen (PageFileName, "w+b");\r
+  PageFile = fopen (LongFilePath (PageFileName), "w+b");\r
   if (PageFile == NULL) {\r
     Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Output File %s open failure", PageFileName);\r
     return -1;\r
   }\r
 \r
-  NoPageFile = fopen (NoPageFileName, "r+b");\r
+  NoPageFile = fopen (LongFilePath (NoPageFileName), "r+b");\r
   if (NoPageFile == NULL) {\r
     Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Input File %s open failure", NoPageFileName);\r
     fclose (PageFile);\r