X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FC%2FGenPage%2FGenPage.c;h=fb829e69cb0f87be9348cb48d564dd1578272ba1;hp=abcb5e827c3b4a6a90885c0feb34d2e26a195b72;hb=97fa0ee9b1cffbb4b97ee35365afa7afcf50e174;hpb=52302d4dee589a5df43a464420c9fe68ba83937d
diff --git a/BaseTools/Source/C/GenPage/GenPage.c b/BaseTools/Source/C/GenPage/GenPage.c
index abcb5e827c..fb829e69cb 100644
--- a/BaseTools/Source/C/GenPage/GenPage.c
+++ b/BaseTools/Source/C/GenPage/GenPage.c
@@ -1,18 +1,4 @@
/** @file
-
-Copyright 2006 - 2010, 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
@@ -63,13 +59,13 @@ UINT32 gPageTableOffsetInFile = EFI_PAGE_BASE_OFFSET_IN_LDR;
//
// Utility Name
//
-#define UTILITY_NAME "GenBootSector"
+#define UTILITY_NAME "GenPage"
//
// 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 - 2010 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,18 +95,29 @@ Usage (
void
)
{
- Version();
- printf ("\nUsage: \n\
- GenPage\n\
- -o, --output Filename containing page table\n\
- [-b, --baseaddr baseaddress of page table]\n\
- [-f, --offset offset in the file that page table will reside]\n\
- [-v, --verbose]\n\
- [--version]\n\
- [-q, --quiet disable all messages except fatal errors]\n\
- [-d, --debug[#]\n\
- [-h, --help]\n\
- EfiLoaderImageName\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 OFFSET\n\
+ The position that the page table will appear in the\n\
+ output file\n\
+ --sfo Reserved for future use\n");
}
@@ -233,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);