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