diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-15 02:51:34 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-15 02:51:34 +0000 |
commit | 6780eef1f9ed0af24795708c3be7adafd7113691 (patch) | |
tree | 1a9fd2fca0bd71c4a64a8bf3f10e492f45a232d8 /BaseTools/Source/C | |
parent | 5460c4bbc5aa9d99d25c55c6b936166bea3dbea0 (diff) | |
download | edk2-6780eef1f9ed0af24795708c3be7adafd7113691.tar.gz edk2-6780eef1f9ed0af24795708c3be7adafd7113691.tar.bz2 edk2-6780eef1f9ed0af24795708c3be7adafd7113691.zip |
Sync EDKII BaseTools to BaseTools project r2093.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11057 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r-- | BaseTools/Source/C/BootSectImage/bootsectimage.c | 22 | ||||
-rw-r--r-- | BaseTools/Source/C/GenVtf/GenVtf.c | 12 | ||||
-rw-r--r-- | BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c | 9 | ||||
-rw-r--r-- | BaseTools/Source/C/Include/X64/ProcessorBind.h | 6 | ||||
-rw-r--r-- | BaseTools/Source/C/Makefiles/header.makefile | 112 | ||||
-rw-r--r-- | BaseTools/Source/C/Makefiles/lib.makefile | 18 |
6 files changed, 102 insertions, 77 deletions
diff --git a/BaseTools/Source/C/BootSectImage/bootsectimage.c b/BaseTools/Source/C/BootSectImage/bootsectimage.c index a907e214f4..0d0a3cbf77 100644 --- a/BaseTools/Source/C/BootSectImage/bootsectimage.c +++ b/BaseTools/Source/C/BootSectImage/bootsectimage.c @@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "fat.h"
#include "mbr.h"
#include "EfiUtilityMsgs.h"
+#include "ParseInf.h"
#define DEBUG_WARN 0x1
#define DEBUG_ERROR 0x2
@@ -845,7 +846,9 @@ main ( BOOLEAN ProcessMbr; // -m
BOOLEAN DoParse; // -p SrcImage or -g SrcImage DstImage
BOOLEAN Verbose; // -v
-
+ UINT64 LogLevel;
+ EFI_STATUS EfiStatus;
+
SrcImage = DstImage = NULL;
ForcePatch = FALSE;
ProcessMbr = FALSE;
@@ -886,6 +889,23 @@ main ( ProcessMbr = TRUE;
} else if (strcmp (*argv, "-v") == 0 || strcmp (*argv, "--verbose") == 0) {
Verbose = TRUE;
+ } else if ((stricmp (*argv, "-d") == 0) || (stricmp (*argv, "--debug") == 0)) {
+ argc--; argv++;
+ if (argc < 1) {
+ Usage ();
+ return -1;
+ }
+ EfiStatus = AsciiStringToUint64 (*argv, FALSE, &LogLevel);
+ if (EFI_ERROR (EfiStatus)) {
+ Error (NULL, 0, 1003, "Invalid option value", "%s = %s", "--debug", *argv);
+ return 1;
+ }
+ if (LogLevel > 9) {
+ Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);
+ return 1;
+ }
+ SetPrintLevel (LogLevel);
+ DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", *argv);
} else {
Usage ();
return -1;
diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c index 35120f36c1..428158ebb8 100644 --- a/BaseTools/Source/C/GenVtf/GenVtf.c +++ b/BaseTools/Source/C/GenVtf/GenVtf.c @@ -105,23 +105,22 @@ ConvertVersionInfo ( /*++
Routine Description:
- This function converts GUID string to GUID
+ This function split version to major version and minor version
Arguments:
Str - String representing in form XX.XX
- MajorVer - The major vertion
- MinorVer - The minor vertion
+ MajorVer - The major version
+ MinorVer - The minor version
Returns:
- EFI_SUCCESS - The fuction completed successfully.
+ EFI_SUCCESS - The function completed successfully.
--*/
{
CHAR8 StrPtr[40];
CHAR8 *Token;
- UINTN Length;
unsigned Major;
unsigned Minor;
@@ -135,10 +134,9 @@ Returns: Token = strtok (NULL, ".");
}
- Length = strlen (StrPtr);
sscanf (
StrPtr,
- "%01x%02x",
+ "%02d%02d",
&Major,
&Minor
);
diff --git a/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c b/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c index 8a0952ff08..267eaa332c 100644 --- a/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c +++ b/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c @@ -235,10 +235,13 @@ ProcessBsOrMbr ( }
//Process Floppy Disk
- OutputFile = fopen(OutputInfo->PhysicalPath, "w");
+ OutputFile = fopen(OutputInfo->PhysicalPath, "r+");
if (OutputFile == NULL) {
- return ErrorFileReadWrite;
- }
+ OutputFile = fopen(OutputInfo->PhysicalPath, "w");
+ if (OutputFile == NULL) {
+ return ErrorFileReadWrite;
+ }
+ }
if (OutputInfo->Type != PathFile) {
if (ProcessMbr) {
diff --git a/BaseTools/Source/C/Include/X64/ProcessorBind.h b/BaseTools/Source/C/Include/X64/ProcessorBind.h index 3c106b5fce..0bc02f043a 100644 --- a/BaseTools/Source/C/Include/X64/ProcessorBind.h +++ b/BaseTools/Source/C/Include/X64/ProcessorBind.h @@ -149,13 +149,13 @@ typedef INT64 INTN; //
// Processor specific defines
//
-#define MAX_BIT 0x8000000000000000
-#define MAX_2_BITS 0xC000000000000000
+#define MAX_BIT 0x8000000000000000ULL
+#define MAX_2_BITS 0xC000000000000000ULL
//
// Maximum legal Itanium-based address
//
-#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
+#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
//
// Modifier to ensure that all protocol member functions and EFI intrinsics
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile index 841803e51d..9aa83c0390 100644 --- a/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile @@ -1,10 +1,10 @@ ## @file
#
-# The makefile can be invoked with -# ARCH = x86_64 or x64 for EM64T build -# ARCH = ia32 or IA32 for IA32 build -# ARCH = ia64 or IA64 for IA64 build -# +# The makefile can be invoked with
+# ARCH = x86_64 or x64 for EM64T build
+# ARCH = ia32 or IA32 for IA32 build
+# ARCH = ia64 or IA64 for IA64 build
+#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -12,52 +12,56 @@ # 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. - -ARCH ?= IA32 - -CYGWIN:=$(findstring CYGWIN, $(shell uname -s)) -LINUX:=$(findstring Linux, $(shell uname -s)) -DARWIN:=$(findstring Darwin, $(shell uname -s)) - -CC = gcc -CXX = g++ -AS = gcc -AR = ar -LD = ld -LINKER ?= $(CC) -ifeq ($(ARCH), IA32) -ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/ -endif - -ifeq ($(ARCH), X64) -ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/ -endif - -INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) -CPPFLAGS = $(INCLUDE) -CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g -LFLAGS = - -# -# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns -i386, but gcc defaults -# to x86_64. So make sure tools match uname -m -# -uname_s = $(shell uname -s) -ifeq ($(uname_s),Darwin) - CFLAGS += -arch i386 - CPPFLAGS += -arch i386 - LFLAGS += -arch i386 -endif - -.PHONY: all -.PHONY: install -.PHONY: clean - -all: - -$(MAKEROOT)/libs: - mkdir $(MAKEROOT)/libs - -$(MAKEROOT)/bin: - mkdir $(MAKEROOT)/bin +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ARCH ?= IA32
+
+CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
+LINUX:=$(findstring Linux, $(shell uname -s))
+DARWIN:=$(findstring Darwin, $(shell uname -s))
+
+CC = gcc
+CXX = g++
+AS = gcc
+AR = ar
+LD = ld
+LINKER ?= $(CC)
+ifeq ($(ARCH), IA32)
+ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
+endif
+
+ifeq ($(ARCH), X64)
+ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
+endif
+
+INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
+CPPFLAGS = $(INCLUDE)
+CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g
+LFLAGS =
+
+ifeq ($(ARCH), IA32)
+#
+# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
+# to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard
+# so only do this is uname -m returns i386.
+#
+uname_s = $(shell uname -s)
+ifeq ($(uname_s),Darwin)
+ CFLAGS += -arch i386
+ CPPFLAGS += -arch i386
+ LFLAGS += -arch i386
+endif
+endif
+
+
+.PHONY: all
+.PHONY: install
+.PHONY: clean
+
+all:
+
+$(MAKEROOT)/libs:
+ mkdir $(MAKEROOT)/libs
+
+$(MAKEROOT)/bin:
+ mkdir $(MAKEROOT)/bin
diff --git a/BaseTools/Source/C/Makefiles/lib.makefile b/BaseTools/Source/C/Makefiles/lib.makefile index fe7a1cef8d..dc8d90ccca 100644 --- a/BaseTools/Source/C/Makefiles/lib.makefile +++ b/BaseTools/Source/C/Makefiles/lib.makefile @@ -7,12 +7,12 @@ # 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 $(MAKEROOT)/Makefiles/header.makefile - -LIBRARY = $(MAKEROOT)/libs/lib$(LIBNAME).a - -all: $(MAKEROOT)/libs $(LIBRARY) - -include $(MAKEROOT)/Makefiles/footer.makefile +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+include $(MAKEROOT)/Makefiles/header.makefile
+
+LIBRARY = $(MAKEROOT)/libs/lib$(LIBNAME).a
+
+all: $(MAKEROOT)/libs $(LIBRARY)
+
+include $(MAKEROOT)/Makefiles/footer.makefile
|