Sync BaseTools Branch (version r2362) to EDKII main trunk.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Oct 2011 02:49:48 +0000 (02:49 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Oct 2011 02:49:48 +0000 (02:49 +0000)
Signed-off-by: lgao4
Reviewed-by: jsu1
Reviewed-by: ydliu
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12525 6f19259b-4bc3-4df7-8a09-765794883524

49 files changed:
BaseTools/Bin/Win32/BPDG.exe
BaseTools/Bin/Win32/BootSectImage.exe
BaseTools/Bin/Win32/EfiLdrImage.exe
BaseTools/Bin/Win32/EfiRom.exe
BaseTools/Bin/Win32/Fpd2Dsc.exe
BaseTools/Bin/Win32/GenBootSector.exe
BaseTools/Bin/Win32/GenCrc32.exe
BaseTools/Bin/Win32/GenDepex.exe
BaseTools/Bin/Win32/GenFds.exe
BaseTools/Bin/Win32/GenFfs.exe
BaseTools/Bin/Win32/GenFv.exe
BaseTools/Bin/Win32/GenFw.exe
BaseTools/Bin/Win32/GenPage.exe
BaseTools/Bin/Win32/GenPatchPcdTable.exe
BaseTools/Bin/Win32/GenSec.exe
BaseTools/Bin/Win32/GenVtf.exe
BaseTools/Bin/Win32/LzmaCompress.exe
BaseTools/Bin/Win32/MigrationMsa2Inf.exe
BaseTools/Bin/Win32/PatchPcdValue.exe
BaseTools/Bin/Win32/Spd2Dec.exe
BaseTools/Bin/Win32/Split.exe
BaseTools/Bin/Win32/TargetTool.exe
BaseTools/Bin/Win32/TianoCompress.exe
BaseTools/Bin/Win32/Trim.exe
BaseTools/Bin/Win32/UPT.exe
BaseTools/Bin/Win32/VfrCompile.exe
BaseTools/Bin/Win32/VolInfo.exe
BaseTools/Bin/Win32/build.exe
BaseTools/Conf/tools_def.template
BaseTools/Source/C/GenFv/GenFv.c
BaseTools/Source/C/GenFv/GenFvInternalLib.c
BaseTools/Source/C/GenFv/GenFvInternalLib.h
BaseTools/Source/C/Include/Common/BuildVersion.h
BaseTools/Source/C/VfrCompile/VfrSyntax.g
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/AutoGen/GenMake.py
BaseTools/Source/Python/AutoGen/StrGather.py
BaseTools/Source/Python/AutoGen/UniClassObject.py
BaseTools/Source/Python/Common/BuildVersion.py
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/Ecc/c.py
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/FfsFileStatement.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/Fv.py
BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools/Source/Python/GenFds/OptRomInfStatement.py
BaseTools/Source/Python/Workspace/MetaFileParser.py
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py

index 9d2cc2b823ba109d526a87db0c49700b0657b94c..016bee5d840c122adec6de0bc305dae8381edde1 100644 (file)
Binary files a/BaseTools/Bin/Win32/BPDG.exe and b/BaseTools/Bin/Win32/BPDG.exe differ
index 1ac08a171e75129167c2e196542d3171aa3d306d..313bc717562aaa5cfba136becc04bfb2e2a3e7c0 100755 (executable)
Binary files a/BaseTools/Bin/Win32/BootSectImage.exe and b/BaseTools/Bin/Win32/BootSectImage.exe differ
index e1c47508e2918af21f052524668a2b3624f7b6dc..e06cbedc51ca47a95828ab41b6d4278a83763979 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiLdrImage.exe and b/BaseTools/Bin/Win32/EfiLdrImage.exe differ
index 73c638f42121d3caeeb1bac829c8d08efc095124..01ad3703d0114ccdfc4f2b042c4c90c5b8d3c8c3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/EfiRom.exe and b/BaseTools/Bin/Win32/EfiRom.exe differ
index da0b3957dc8e262770a43c43438ecfacb5a44a73..fd41b60624b4d57b6783f36bdedec45feefe60f9 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Fpd2Dsc.exe and b/BaseTools/Bin/Win32/Fpd2Dsc.exe differ
index 62a576b1a65204b928ded06d1819c2e398c28ea0..25f50e5e7ef74fcdad84359a4d80ea48cd667a4c 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenBootSector.exe and b/BaseTools/Bin/Win32/GenBootSector.exe differ
index 2a4fa4647abbf5e58b2b541acab30ee875b549f2..d20d15a950896f6bf507ee34cf92bdd60df9c357 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenCrc32.exe and b/BaseTools/Bin/Win32/GenCrc32.exe differ
index 4330f6d09f1dc544e99f6c4b1815880460cc1be7..cf6ff7fed94ff3d1d04318a6f3eb989d4bef45bc 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenDepex.exe and b/BaseTools/Bin/Win32/GenDepex.exe differ
index a0c20def4d03041bcd029fc44ad351755741d9c1..9209a7dd863814e33d899f6d58a6bf28624eb6ce 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFds.exe and b/BaseTools/Bin/Win32/GenFds.exe differ
index fa31eeee4696bfafd87edd2b2ddf8c641b18401e..434f8890f043c2f26ceecbb07fec05a83802fe41 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFfs.exe and b/BaseTools/Bin/Win32/GenFfs.exe differ
index 08f4320f87312ed8c3d870ac360074e51a4d3668..6d1096efc9883077c00313692a6149e59e6c587e 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFv.exe and b/BaseTools/Bin/Win32/GenFv.exe differ
index 8eab045150694693cacba94aa53e962c5cf4f644..f4331d3eeaeb8f61cac14cf50ff4e691da676f21 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenFw.exe and b/BaseTools/Bin/Win32/GenFw.exe differ
index 8c7097c00731dfa965bbc313a038565d754a5186..2cdca2ad6c220701a854d11dad80cc4ca62d76d5 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPage.exe and b/BaseTools/Bin/Win32/GenPage.exe differ
index 2371e995e846e1d99ff46312d63a5b1cfe023efd..4a506e4858ed2e5ec1c85e94768bb6a58b0ec3a3 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenPatchPcdTable.exe and b/BaseTools/Bin/Win32/GenPatchPcdTable.exe differ
index 9dbdb062e085771f51ab8cc6c552f8e3e5a3eb12..64730c5fa5c66c88a90962bbfb300f43e49a607c 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenSec.exe and b/BaseTools/Bin/Win32/GenSec.exe differ
index 88e3bc42f5b152faf6a24b552313a17d2e5d55bf..e15f567a31abedfd35e5f9c78f58dd79b7c0586a 100755 (executable)
Binary files a/BaseTools/Bin/Win32/GenVtf.exe and b/BaseTools/Bin/Win32/GenVtf.exe differ
index 7c0d8d1363d9dae87ef6946966e49d631e4cbede..2652a7b5bdc6bd747097292e233cbf9b14bb2a09 100755 (executable)
Binary files a/BaseTools/Bin/Win32/LzmaCompress.exe and b/BaseTools/Bin/Win32/LzmaCompress.exe differ
index a6ed5abd747a645ba1012086b5d59d2e333f9054..2c7b28d59c5c01d03fdcad22edc826f69a047ee2 100755 (executable)
Binary files a/BaseTools/Bin/Win32/MigrationMsa2Inf.exe and b/BaseTools/Bin/Win32/MigrationMsa2Inf.exe differ
index 5d6a2aa0e76852a0c858ca831309cbccce7fa69a..4500f21a84fb022d0f41f89714048795dac7babb 100755 (executable)
Binary files a/BaseTools/Bin/Win32/PatchPcdValue.exe and b/BaseTools/Bin/Win32/PatchPcdValue.exe differ
index 60fdb26dd0b3c2532c10db322d195052d2dcca0a..5a5bb7b59c11148323ee58278d7882df8199fbbd 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Spd2Dec.exe and b/BaseTools/Bin/Win32/Spd2Dec.exe differ
index 761f80531522350d11d025fa4bf384a005dcb0ed..250cedba6e5ebe0bada516f9061c846a8ca20e86 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Split.exe and b/BaseTools/Bin/Win32/Split.exe differ
index 7550a5efeeae06a06feeb23884544cab1ccfbc02..14b2680005be9a2d58767fe35f0890b3446556b4 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TargetTool.exe and b/BaseTools/Bin/Win32/TargetTool.exe differ
index 25b80ed9b71ec90a5f94f2053f9a8aeaa9cbd3bf..7bf2896f70be72b8620536537d5f0b4b45bf1698 100755 (executable)
Binary files a/BaseTools/Bin/Win32/TianoCompress.exe and b/BaseTools/Bin/Win32/TianoCompress.exe differ
index 85ca31b554a9d9d230f9e4edba0b512515fd30f6..a094bb11027dd00b035dc197ea85d9ea805b2945 100755 (executable)
Binary files a/BaseTools/Bin/Win32/Trim.exe and b/BaseTools/Bin/Win32/Trim.exe differ
index 396397d92e7fa22400bdf05de62c6e712494c9cb..a1cf4d889f1122931ad60dac7e51c745dd132821 100644 (file)
Binary files a/BaseTools/Bin/Win32/UPT.exe and b/BaseTools/Bin/Win32/UPT.exe differ
index 3e37b6711e08860447c2f71161780b87b67294f3..03d35d7b2dc6e176ad1ae090e51b2ec55df7ba5d 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VfrCompile.exe and b/BaseTools/Bin/Win32/VfrCompile.exe differ
index ef8ac32eb2a0185edcec71041dbc3616ae42b32c..754857cc1e98a723a879f272a7e94e5885100597 100755 (executable)
Binary files a/BaseTools/Bin/Win32/VolInfo.exe and b/BaseTools/Bin/Win32/VolInfo.exe differ
index 0f899504f1c3be8dd2ed27de5e50e9efd221ce13..8536c7249bdbca0d2dec914051f1603231ebe285 100755 (executable)
Binary files a/BaseTools/Bin/Win32/build.exe and b/BaseTools/Bin/Win32/build.exe differ
index cc91445862e1c15765833ba51d9f2940b69a88ef..c8af70495d30acd6454385f8c1856593564de6ae 100644 (file)
@@ -161,8 +161,6 @@ DEFINE ICC_WIN_ASLCC_FLAGS     = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcp
 DEFINE ICC_WIN_ASLDLINK_FLAGS  = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libmmt /NODEFAULTLIB:libirc\r
 \r
 DEFINE IPHONE_TOOLS            = /Developer/Platforms/iPhoneOS.platform/Developer\r
-DEFINE RVCT31_TOOLS_PATH       = c:/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium\r
-DEFINE RVCT31CYGWIN_TOOLS_PATH = /cygdrive/c/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium\r
 \r
 DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin\r
 \r
@@ -1976,6 +1974,7 @@ DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar -fno-strict-aliasing -
 DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe\r
 DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe\r
 DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency\r
+DEFINE GCC_ARMGCC_CC_FLAGS         = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char  -ffunction-sections -fdata-sections -fomit-frame-pointer\r
 DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie\r
 DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections\r
 DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)\r
@@ -3983,99 +3982,145 @@ RELEASE_XCLANG_X64_CC_FLAGS   = -ccc-host-triple x86_64-pc-win32-macho -c    -Os
 *_XCLANG_*_ASLPP_FLAGS      = -x c -E \r
 *_XCLANG_*_ASL_FLAGS        =\r
 \r
+####################################################################################\r
+#\r
+# RVCT Common\r
+#\r
+####################################################################################\r
+\r
+DEFINE RVCT_ALL_CC_FLAGS   = --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167 --diag_style=ide\r
+DEFINE RVCT_ALL_DLINK_FLAGS   = --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --diag_style=ide\r
 \r
 ####################################################################################\r
 #\r
-# ARM Tools\r
+# ARM RealView Tools - Windows\r
 #\r
 ####################################################################################\r
-#   RVCT31         - Tools from ARM\r
+#   RVCT         - Tools from ARM\r
 \r
-*_RVCT31_*_*_FAMILY          = RVCT\r
+*_RVCT_*_*_FAMILY          = RVCT\r
 \r
 #\r
 # Use default values, or override in DSC file\r
 #\r
-*_RVCT31_ARM_ARCHCC_FLAGS    = --thumb --cpu 7-A\r
-*_RVCT31_ARM_ARCHASM_FLAGS   = --cpu 7-A\r
-*_RVCT31_ARM_ARCHDLINK_FLAGS =\r
-*_RVCT31_ARM_PLATFORM_FLAGS  =\r
+*_RVCT_ARM_ARCHCC_FLAGS    = --thumb\r
+*_RVCT_ARM_ARCHASM_FLAGS   = \r
+*_RVCT_ARM_ARCHDLINK_FLAGS = \r
+*_RVCT_ARM_PLATFORM_FLAGS  = --cpu 7-A\r
 \r
-  DEBUG_RVCT31_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map --diag_style=ide\r
-RELEASE_RVCT31_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map --diag_style=ide\r
+  DEBUG_RVCT_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map \r
+RELEASE_RVCT_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map \r
 \r
 \r
-*_RVCT31_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) --apcs /interwork --diag_style=ide\r
-*_RVCT31_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E --diag_style=ide\r
-*_RVCT31_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
-*_RVCT31_ARM_MAKE_PATH       = nmake\r
-*_RVCT31_ARM_SLINK_FLAGS     = --partial --diag_style=ide -o\r
-  DEBUG_RVCT31_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -g -Ospace -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167 --diag_style=ide\r
-RELEASE_RVCT31_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90    -Ospace -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167 --diag_style=ide\r
+*_RVCT_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) --apcs /interwork\r
+*_RVCT_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E\r
+*_RVCT_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
+*_RVCT_ARM_MAKE_PATH       = nmake /NOLOGO\r
+*_RVCT_ARM_SLINK_FLAGS     = --partial -o\r
+  DEBUG_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g\r
+RELEASE_RVCT_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O2\r
 \r
 ##################\r
 # ARM definitions\r
 ##################\r
-*_RVCT31_ARM_CC_PATH         = DEF(RVCT31_TOOLS_PATH)/armcc\r
-*_RVCT31_ARM_SLINK_PATH      = DEF(RVCT31_TOOLS_PATH)/armlink\r
-*_RVCT31_ARM_DLINK_PATH      = DEF(RVCT31_TOOLS_PATH)/armlink\r
-*_RVCT31_ARM_ASM_PATH        = DEF(RVCT31_TOOLS_PATH)/armasm\r
-*_RVCT31_ARM_PP_PATH         = DEF(RVCT31_TOOLS_PATH)/armcc\r
-*_RVCT31_ARM_VFRPP_PATH      = DEF(RVCT31_TOOLS_PATH)/armcc\r
-*_RVCT31_ARM_FROMELF_PATH    = DEF(RVCT31_TOOLS_PATH)/fromelf\r
+*_RVCT_ARM_CC_PATH         = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCT_ARM_SLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink\r
+*_RVCT_ARM_DLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink\r
+*_RVCT_ARM_ASM_PATH        = ENV(RVCT_TOOLS_PATH)armasm\r
+*_RVCT_ARM_PP_PATH         = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCT_ARM_VFRPP_PATH      = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCT_ARM_FROMELF_PATH    = ENV(RVCT_TOOLS_PATH)fromelf\r
 \r
 ####################################################################################\r
 #\r
-# ARM Tools & Cygwin\r
+# ARM RealView Tools - Linux\r
 #\r
 ####################################################################################\r
-#   ARMCYGWIN         - Tools from ARM in a Cygwin environment\r
+#   RVCTLINUX         - Tools from ARM in a Cygwin environment\r
+*_RVCTLINUX_*_*_FAMILY               = RVCT\r
+*_RVCTLINUX_*_*_BUILDRULEFAMILY      = RVCTLINUX\r
 \r
-*_RVCT31CYGWIN_*_*_FAMILY               = RVCT\r
-*_RVCT31CYGWIN_*_*_BUILDRULEFAMILY      = RVCTCYGWIN\r
+#\r
+# Use default values, or override in DSC file\r
+#\r
+*_RVCTLINUX_ARM_ARCHCC_FLAGS    = --thumb\r
+*_RVCTLINUX_ARM_ARCHASM_FLAGS   = \r
+*_RVCTLINUX_ARM_ARCHDLINK_FLAGS = \r
+*_RVCTLINUX_ARM_PLATFORM_FLAGS  = --cpu 7-A\r
 \r
-*_RVCT31CYGWIN_ARM_CCPATH_FLAG         = DEF(RVCT31CYGWIN_TOOLS_PATH)/armcc\r
-*_RVCT31CYGWIN_ARM_SLINKPATH_FLAG      = DEF(RVCT31CYGWIN_TOOLS_PATH)/armlink\r
-*_RVCT31CYGWIN_ARM_DLINKPATH_FLAG      = DEF(RVCT31CYGWIN_TOOLS_PATH)/armlink\r
-*_RVCT31CYGWIN_ARM_ASMPATH_FLAG        = DEF(RVCT31CYGWIN_TOOLS_PATH)/armasm\r
-*_RVCT31CYGWIN_ARM_PPPATH_FLAG         = DEF(RVCT31CYGWIN_TOOLS_PATH)/armcc\r
-*_RVCT31CYGWIN_ARM_VFRPPPATH_FLAG      = DEF(RVCT31CYGWIN_TOOLS_PATH)/armcc\r
-*_RVCT31CYGWIN_ARM_FROMELFPATH_FLAG    = DEF(RVCT31CYGWIN_TOOLS_PATH)/fromelf\r
+DEBUG_RVCTLINUX_ARM_DLINK_FLAGS     = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map \r
+RELEASE_RVCTLINUX_ARM_DLINK_FLAGS   = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 \r
+*_RVCTLINUX_ARM_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) --apcs /interwork\r
+*_RVCTLINUX_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E\r
+*_RVCTLINUX_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
+*_RVCTLINUX_ARM_MAKE_PATH       = make\r
+*_RVCTLINUX_ARM_SLINK_FLAGS     = --partial -o\r
+  DEBUG_RVCTLINUX_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g\r
+RELEASE_RVCTLINUX_ARM_CC_FLAGS  = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O2\r
 \r
+##################\r
+# ARM definitions\r
+##################\r
+*_RVCTLINUX_ARM_CC_PATH         = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCTLINUX_ARM_SLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink\r
+*_RVCTLINUX_ARM_DLINK_PATH      = ENV(RVCT_TOOLS_PATH)armlink\r
+*_RVCTLINUX_ARM_ASM_PATH        = ENV(RVCT_TOOLS_PATH)armasm\r
+*_RVCTLINUX_ARM_PP_PATH         = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCTLINUX_ARM_VFRPP_PATH      = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCTLINUX_ARM_FROMELF_PATH    = ENV(RVCT_TOOLS_PATH)fromelf\r
+\r
+####################################################################################\r
 #\r
-# Use default values, or override in DSC file\r
+# ARM RealView Tools - Cygwin\r
 #\r
-*_RVCT31CYGWIN_ARM_ARCHCC_FLAGS    = --thumb --cpu 7-A\r
-*_RVCT31CYGWIN_ARM_ARCHASM_FLAGS   = --cpu 7-A\r
-*_RVCT31CYGWIN_ARM_ARCHDLINK_FLAGS =\r
-*_RVCT31CYGWIN_ARM_PLATFORM_FLAGS  =\r
+####################################################################################\r
+#   ARMCYGWIN         - Tools from ARM in a Cygwin environment\r
+\r
+*_RVCTCYGWIN_*_*_FAMILY               = RVCT\r
+*_RVCTCYGWIN_*_*_BUILDRULEFAMILY      = RVCTCYGWIN\r
 \r
-  DEBUG_RVCT31CYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` --diag_style=ide\r
-RELEASE_RVCT31CYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT)  --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` --diag_style=ide\r
+*_RVCTCYGWIN_ARM_CCPATH_FLAG         = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCTCYGWIN_ARM_SLINKPATH_FLAG      = ENV(RVCT_TOOLS_PATH)armlink\r
+*_RVCTCYGWIN_ARM_DLINKPATH_FLAG      = ENV(RVCT_TOOLS_PATH)armlink\r
+*_RVCTCYGWIN_ARM_ASMPATH_FLAG        = ENV(RVCT_TOOLS_PATH)armasm\r
+*_RVCTCYGWIN_ARM_PPPATH_FLAG         = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCTCYGWIN_ARM_VFRPPPATH_FLAG      = ENV(RVCT_TOOLS_PATH)armcc\r
+*_RVCTCYGWIN_ARM_FROMELFPATH_FLAG    = ENV(RVCT_TOOLS_PATH)fromelf\r
 \r
-*_RVCT31CYGWIN_ARM_ASM_FLAGS       = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) --apcs /interwork --diag_style=ide\r
-*_RVCT31CYGWIN_ARM_PP_FLAGS        = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E --diag_style=ide\r
-*_RVCT31CYGWIN_ARM_VFRPP_FLAGS     = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`\r
-*_RVCT31CYGWIN_ARM_MAKE_PATH       = make\r
-*_RVCT31CYGWIN_ARM_SLINK_FLAGS     = "$(SLINKPATH_FLAG)" --partial --diag_style=ide -o\r
-  DEBUG_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -Ospace --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167 --diag_style=ide\r
-RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c    -Ospace --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167 --diag_style=ide\r
+#\r
+# Use default values, or override in DSC file\r
+#\r
+*_RVCTCYGWIN_ARM_ARCHCC_FLAGS    = --thumb\r
+*_RVCTCYGWIN_ARM_ARCHASM_FLAGS   =\r
+*_RVCTCYGWIN_ARM_ARCHDLINK_FLAGS = \r
+*_RVCTCYGWIN_ARM_PLATFORM_FLAGS  = --cpu 7-A\r
+\r
+  DEBUG_RVCTCYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` \r
+RELEASE_RVCTCYGWIN_ARM_DLINK_FLAGS     = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map` \r
\r
+*_RVCTCYGWIN_ARM_ASM_FLAGS       = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) --apcs /interwork\r
+*_RVCTCYGWIN_ARM_PP_FLAGS        = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E\r
+*_RVCTCYGWIN_ARM_VFRPP_FLAGS     = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E  -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`\r
+*_RVCTCYGWIN_ARM_MAKE_PATH       = make\r
+*_RVCTCYGWIN_ARM_SLINK_FLAGS     = "$(SLINKPATH_FLAG)" --partial -o\r
+  DEBUG_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g\r
+RELEASE_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O2\r
 \r
 ##################\r
 # ARM definitions\r
 ##################\r
-*_RVCT31CYGWIN_ARM_CC_PATH         = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
-*_RVCT31CYGWIN_ARM_SLINK_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
-*_RVCT31CYGWIN_ARM_DLINK_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
-*_RVCT31CYGWIN_ARM_ASM_PATH        = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
-*_RVCT31CYGWIN_ARM_PP_PATH         = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
-*_RVCT31CYGWIN_ARM_VFRPP_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
-*_RVCT31CYGWIN_ARM_FROMELF_PATH    = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_CC_PATH         = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_SLINK_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_DLINK_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_ASM_PATH        = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_PP_PATH         = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_VFRPP_PATH      = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
+*_RVCTCYGWIN_ARM_FROMELF_PATH    = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py\r
 \r
 ####################################################################################\r
 #\r
-# ARM GCC (www.codesourcery.com)\r
+# ARM EABI GCC (www.codesourcery.com)\r
 #\r
 ####################################################################################\r
 #  ARMGCC         - ARM version of the GCC cross compiler\r
@@ -4089,12 +4134,12 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 ##################\r
 # ASL definitions\r
 ##################\r
-*_ARMGCC_*_ASL_PATH                     = DEF(UNIX_IASL_BIN)\r
-*_ARMGCC_*_ASL_FLAGS                    = DEF(IASL_FLAGS)\r
-*_ARMGCC_*_ASL_OUTFLAGS                 = DEF(IASL_OUTFLAGS)\r
-*_ARMGCC_*_ASLPP_FLAGS                  = -x c -E -P\r
-*_ARMGCC_*_ASLCC_FLAGS                  = -x c\r
-*_ARMGCC_*_ASLDLINK_FLAGS               = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable\r
+*_ARMGCC_*_ASL_PATH          = DEF(UNIX_IASL_BIN)\r
+*_ARMGCC_*_ASL_FLAGS         = DEF(IASL_FLAGS)\r
+*_ARMGCC_*_ASL_OUTFLAGS      = DEF(IASL_OUTFLAGS)\r
+*_ARMGCC_*_ASLPP_FLAGS       = -x c -E -P\r
+*_ARMGCC_*_ASLCC_FLAGS       = -x c\r
+*_ARMGCC_*_ASLDLINK_FLAGS    = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable\r
 \r
 ##################\r
 # ARM definitions\r
@@ -4114,22 +4159,22 @@ RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM
 #\r
 # Use default values, or override in DSC file\r
 #\r
-*_ARMGCC_ARM_ARCHCC_FLAGS    = -march=armv7-a -mthumb\r
-*_ARMGCC_ARM_ARCHASM_FLAGS   = -march=armv7-a\r
+*_ARMGCC_ARM_ARCHCC_FLAGS    = -mthumb\r
+*_ARMGCC_ARM_ARCHASM_FLAGS   =\r
 *_ARMGCC_ARM_ARCHDLINK_FLAGS =\r
 *_ARMGCC_ARM_PLATFORM_FLAGS  = -march=armv7-a\r
 \r
-  DEBUG_ARMGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) -mlittle-endian -g\r
-RELEASE_ARMGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) -mlittle-endian\r
+  DEBUG_ARMGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g\r
+RELEASE_ARMGCC_ARM_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian\r
 \r
-*_ARMGCC_ARM_PP_FLAGS    = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS)  -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h\r
-*_ARMGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS)  -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
+*_ARMGCC_ARM_PP_FLAGS    = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h\r
+*_ARMGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h\r
 \r
 *_ARMGCC_ARM_SLINK_FLAGS =  -rc\r
 *_ARMGCC_ARM_DLINK_FLAGS =  $(ARCHDLINK_FLAGS)  --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map\r
 \r
-  DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g -O0 -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fsigned-char -fshort-wchar -fno-strict-aliasing -ffunction-sections -fdata-sections -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h\r
-RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian    -Os -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fsigned-char -fshort-wchar -fno-strict-aliasing -ffunction-sections -fdata-sections -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h\r
+  DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -O0\r
+RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARMGCC_CC_FLAGS) -combine -Wno-unused\r
 \r
 #################\r
 # ASM 16 linker defintions\r
index 8f452c7374f6765a58daabc10316312937d3b2ea..fa86d009da28a831eb52d1b6a1ad8d8973aae617 100644 (file)
@@ -124,6 +124,11 @@ Returns:
                         Address is the rebase start address for drivers that\n\\r
                         run in Flash. It supports DEC or HEX digital format.\n\\r
                         If it is set to zero, no rebase action will be taken\n");\r
+  fprintf (stdout, "  -F ForceRebase, --force-rebase ForceRebase\n\\r
+                        If value is TRUE, will always take rebase action\n\\r
+                        If value is FALSE, will always not take reabse action\n\\r
+                        If not specified, will take rebase action if rebase address greater than zero, \n\\r
+                        will not take rebase action if rebase address is zero.\n");\r
   fprintf (stdout, "  -a AddressFile, --addrfile AddressFile\n\\r
                         AddressFile is one file used to record the child\n\\r
                         FV base address when current FV base address is set.\n");\r
@@ -231,6 +236,7 @@ Returns:
   // Set the default FvGuid\r
   //\r
   memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID));\r
+  mFvDataInfo.ForceRebase = -1;\r
    \r
   //\r
   // Parse command line\r
@@ -330,7 +336,7 @@ Returns:
       continue; \r
     }\r
 \r
-    if ((stricmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {\r
+    if ((strcmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {\r
       if (argv[1] == NULL) {\r
         Error (NULL, 0, 1003, "Invalid option value", "Input Ffsfile can't be null");\r
         return STATUS_ERROR;\r
@@ -372,6 +378,26 @@ Returns:
       argv ++;\r
       continue; \r
     }\r
+  \r
+    if ((strcmp (argv[0], "-F") == 0) || (stricmp (argv[0], "--force-rebase") == 0)) {\r
+      if (argv[1] == NULL) {\r
+        Error (NULL, 0, 1003, "Invalid option value", "Froce rebase flag can't be null");\r
+        return STATUS_ERROR;\r
+      }\r
+\r
+      if (stricmp (argv[1], "TRUE") == 0) {\r
+        mFvDataInfo.ForceRebase = 1;\r
+      } else if (stricmp (argv[1], "FALSE") == 0) {\r
+        mFvDataInfo.ForceRebase = 0;\r
+      } else {\r
+        Error (NULL, 0, 1003, "Invalid option value", "froce rebase flag value must be \"TRUE\" or \"FALSE\"");\r
+        return STATUS_ERROR;\r
+      }\r
+\r
+      argc -= 2;\r
+      argv += 2;\r
+      continue; \r
+    } \r
 \r
     if (stricmp (argv[0], "--capheadsize") == 0) {\r
       //\r
@@ -597,7 +623,12 @@ Returns:
               );\r
   } else {\r
     VerboseMsg ("Create Fv image and its map file");\r
-    if (mFvDataInfo.BaseAddress != 0) {\r
+    //\r
+    // Will take rebase action at below situation:\r
+    // 1. ForceRebase Flag specified to TRUE;\r
+    // 2. ForceRebase Flag not specified, BaseAddress greater than zero.\r
+    //\r
+    if (((mFvDataInfo.BaseAddress > 0) && (mFvDataInfo.ForceRebase == -1)) || (mFvDataInfo.ForceRebase == 1)) {\r
       VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);\r
     }\r
     //\r
index d86909b4df63e15df65eeabec1a4de3a35a0c9ba..9fdcb47d6bba84dcc740463ce69d89fde108730b 100644 (file)
@@ -209,6 +209,7 @@ Returns:
       DebugMsg (NULL, 0, 9, "rebase address", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);\r
 \r
       FvInfo->BaseAddress = Value64;\r
+      FvInfo->BaseAddressSet = TRUE;\r
     }\r
   }\r
 \r
@@ -2826,11 +2827,20 @@ Returns:
   PeFileBuffer       = NULL;\r
 \r
   //\r
-  // Don't need to relocate image when BaseAddress is not set.\r
+  // Don't need to relocate image when BaseAddress is zero and no ForceRebase Flag specified.\r
   //\r
-  if (FvInfo->BaseAddress == 0) {\r
+  if ((FvInfo->BaseAddress == 0) && (FvInfo->ForceRebase == -1)) {\r
     return EFI_SUCCESS;\r
   }\r
+  \r
+  //\r
+  // If ForceRebase Flag specified to FALSE, will always not take rebase action.\r
+  //\r
+  if (FvInfo->ForceRebase == 0) {\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
+\r
   XipBase = FvInfo->BaseAddress + XipOffset;\r
 \r
   //\r
index bc25ea8358263ec30084f21d05fbacfa8a696ad5..2629b9aee892933d534a7cd099c0baf147e4ca61 100644 (file)
@@ -232,6 +232,7 @@ typedef struct {
   CHAR8                   FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];\r
   UINT32                  SizeofFvFiles[MAX_NUMBER_OF_FILES_IN_FV];\r
   BOOLEAN                 IsPiFvImage;\r
+  INT8                    ForceRebase;\r
 } FV_INFO;\r
 \r
 typedef struct {\r
index 3e1f8f93fa8e8cbfa33f017e757ba01fd6cc1870..ec4acc338a204fc3f7104c9ca1a972e11168aa65 100644 (file)
@@ -1,3 +1,3 @@
 //This file is for build version number auto generation\r
 //\r
-#define __BUILD_VERSION "Build 2322"\r
+#define __BUILD_VERSION "Build 2361"\r
index 0cd87bb5e88b7ef14040383617b58580204f639d..d9f8dd99a72c1e879a90b7316f85f1ca243981bf 100644 (file)
@@ -1683,7 +1683,7 @@ vfrStatementGoto :
       Question "="\r
       (\r
           QN3:StringIdentifier ","                     << mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask); >>\r
-        | QN4:Number ","                               << QId = _STOQID(QN4->getText()); >>\r
+        | QN3:Number ","                               << QId = _STOQID(QN3->getText()); >>\r
       )\r
     )\r
     |\r
index 55a6a81ccca3c922421f42ac6b068cc2b6031399..8150ea0b69014ca45d2387323f5feb982d715788 100644 (file)
@@ -155,7 +155,7 @@ class AutoGen(object):
 class WorkspaceAutoGen(AutoGen):\r
     ## Real constructor of WorkspaceAutoGen\r
     #\r
-    # This method behaves the same as __init__ except that it needs explict invoke\r
+    # This method behaves the same as __init__ except that it needs explicit invoke\r
     # (in super class's __new__ method)\r
     #\r
     #   @param  WorkspaceDir            Root directory of workspace\r
@@ -246,6 +246,9 @@ class WorkspaceAutoGen(AutoGen):
         #\r
         self._CheckPcdDefineAndType()\r
         \r
+        if self.FdfFile:\r
+            self._CheckDuplicateInFV(Fdf)\r
+        \r
         self._BuildDir = None\r
         self._FvDir = None\r
         self._MakeFileDir = None\r
@@ -253,6 +256,130 @@ class WorkspaceAutoGen(AutoGen):
 \r
         return True\r
 \r
+    ## _CheckDuplicateInFV() method\r
+    #\r
+    # Check whether there is duplicate modules/files exist in FV section. \r
+    # The check base on the file GUID;\r
+    #\r
+    def _CheckDuplicateInFV(self, Fdf):\r
+        for Fv in Fdf.Profile.FvDict:\r
+            _GuidDict = {}\r
+            for FfsFile in Fdf.Profile.FvDict[Fv].FfsList:\r
+                if FfsFile.InfFileName and FfsFile.NameGuid == None:\r
+                    #\r
+                    # Get INF file GUID\r
+                    #\r
+                    InfFoundFlag = False                   \r
+                    for Pa in self.AutoGenObjectList:\r
+                        for Module in Pa.ModuleAutoGenList:\r
+                            if path.normpath(Module.MetaFile.File) == path.normpath(FfsFile.InfFileName):\r
+                                InfFoundFlag = True\r
+                                if not Module.Guid.upper() in _GuidDict.keys():\r
+                                    _GuidDict[Module.Guid.upper()] = FfsFile\r
+                                else:\r
+                                    EdkLogger.error("build", \r
+                                                    FORMAT_INVALID,\r
+                                                    "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,\r
+                                                                                                                                   FfsFile.CurrentLineContent,\r
+                                                                                                                                   _GuidDict[Module.Guid.upper()].CurrentLineNum,\r
+                                                                                                                                   _GuidDict[Module.Guid.upper()].CurrentLineContent,\r
+                                                                                                                                   Module.Guid.upper()),\r
+                                                    ExtraData=self.FdfFile)\r
+                    #\r
+                    # Some INF files not have entity in DSC file. \r
+                    #\r
+                    if not InfFoundFlag:\r
+                        if FfsFile.InfFileName.find('$') == -1:\r
+                            InfPath = NormPath(FfsFile.InfFileName)\r
+                            if not os.path.exists(InfPath):\r
+                                EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))\r
+                                \r
+                            PathClassObj = PathClass(FfsFile.InfFileName, self.WorkspaceDir)\r
+                            #\r
+                            # Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use \r
+                            # BuildObject from one of AutoGenObjectList is enough.\r
+                            #\r
+                            InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, 'COMMON', self.BuildTarget, self.ToolChain]\r
+                            if not InfObj.Guid.upper() in _GuidDict.keys():\r
+                                _GuidDict[InfObj.Guid.upper()] = FfsFile\r
+                            else:\r
+                                EdkLogger.error("build", \r
+                                                FORMAT_INVALID,\r
+                                                "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,\r
+                                                                                                                               FfsFile.CurrentLineContent,\r
+                                                                                                                               _GuidDict[InfObj.Guid.upper()].CurrentLineNum,\r
+                                                                                                                               _GuidDict[InfObj.Guid.upper()].CurrentLineContent,\r
+                                                                                                                               InfObj.Guid.upper()),\r
+                                                ExtraData=self.FdfFile)\r
+                        InfFoundFlag = False\r
+                                                                   \r
+                if FfsFile.NameGuid != None:\r
+                    _CheckPCDAsGuidPattern = re.compile("^PCD\(.+\..+\)$")\r
+                    \r
+                    #\r
+                    # If the NameGuid reference a PCD name. \r
+                    # The style must match: PCD(xxxx.yyy)\r
+                    #\r
+                    if _CheckPCDAsGuidPattern.match(FfsFile.NameGuid):\r
+                        #\r
+                        # Replace the PCD value.\r
+                        #\r
+                        _PcdName = FfsFile.NameGuid.lstrip("PCD(").rstrip(")")\r
+                        PcdFoundFlag = False\r
+                        for Pa in self.AutoGenObjectList:\r
+                            if not PcdFoundFlag:\r
+                                for PcdItem in Pa.AllPcdList:\r
+                                    if (PcdItem.TokenSpaceGuidCName + "." + PcdItem.TokenCName) == _PcdName:\r
+                                        #\r
+                                        # First convert from CFormatGuid to GUID string\r
+                                        #\r
+                                        _PcdGuidString = GuidStructureStringToGuidString(PcdItem.DefaultValue)\r
+                                        \r
+                                        if not _PcdGuidString:\r
+                                            #\r
+                                            # Then try Byte array.\r
+                                            #\r
+                                            _PcdGuidString = GuidStructureByteArrayToGuidString(PcdItem.DefaultValue)\r
+                                            \r
+                                        if not _PcdGuidString:\r
+                                            #\r
+                                            # Not Byte array or CFormat GUID, raise error.\r
+                                            #\r
+                                            EdkLogger.error("build",\r
+                                                            FORMAT_INVALID,\r
+                                                            "The format of PCD value is incorrect. PCD: %s , Value: %s\n"%(_PcdName, PcdItem.DefaultValue),\r
+                                                            ExtraData=self.FdfFile)\r
+                                        \r
+                                        if not _PcdGuidString.upper() in _GuidDict.keys():    \r
+                                            _GuidDict[_PcdGuidString.upper()] = FfsFile\r
+                                            PcdFoundFlag = True\r
+                                            break\r
+                                        else:\r
+                                            EdkLogger.error("build", \r
+                                                            FORMAT_INVALID,\r
+                                                            "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,\r
+                                                                                                                                           FfsFile.CurrentLineContent,\r
+                                                                                                                                           _GuidDict[_PcdGuidString.upper()].CurrentLineNum,\r
+                                                                                                                                           _GuidDict[_PcdGuidString.upper()].CurrentLineContent,\r
+                                                                                                                                           FfsFile.NameGuid.upper()),\r
+                                                            ExtraData=self.FdfFile)                                                                       \r
+                \r
+                    if not FfsFile.NameGuid.upper() in _GuidDict.keys():\r
+                        _GuidDict[FfsFile.NameGuid.upper()] = FfsFile\r
+                    else:\r
+                        #\r
+                        # Two raw file GUID conflict.\r
+                        #\r
+                        EdkLogger.error("build", \r
+                                        FORMAT_INVALID,\r
+                                        "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,\r
+                                                                                                                       FfsFile.CurrentLineContent,\r
+                                                                                                                       _GuidDict[FfsFile.NameGuid.upper()].CurrentLineNum,\r
+                                                                                                                       _GuidDict[FfsFile.NameGuid.upper()].CurrentLineContent,\r
+                                                                                                                       FfsFile.NameGuid.upper()),\r
+                                        ExtraData=self.FdfFile)\r
+                \r
+\r
     def _CheckPcdDefineAndType(self):\r
         PcdTypeList = [\r
             "FixedAtBuild", "PatchableInModule", "FeatureFlag",\r
@@ -1749,6 +1876,7 @@ class ModuleAutoGen(AutoGen):
         self._DepexList               = None\r
         self._DepexExpressionList     = None\r
         self._BuildOption             = None\r
+        self._BuildOptionIncPathList  = None\r
         self._BuildTargets            = None\r
         self._IntroBuildTargetList    = None\r
         self._FinalBuildTargetList    = None\r
@@ -2004,6 +2132,50 @@ class ModuleAutoGen(AutoGen):
             self._BuildOption = self.PlatformInfo.ApplyBuildOption(self.Module)\r
         return self._BuildOption\r
 \r
+    ## Get include path list from tool option for the module build\r
+    #\r
+    #   @retval     list            The include path list\r
+    #\r
+    def _GetBuildOptionIncPathList(self):\r
+        if self._BuildOptionIncPathList == None:\r
+            #\r
+            # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC\r
+            # is the former use /I , the Latter used -I to specify include directories\r
+            #\r
+            if self.PlatformInfo.ToolChainFamily in ('MSFT'):\r
+                gBuildOptIncludePattern = re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL)\r
+            elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC'):\r
+                gBuildOptIncludePattern = re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL)\r
+            \r
+            BuildOptionIncPathList = []\r
+            for Tool in ('CC', 'PP', 'VFRPP', 'ASLPP', 'ASLCC', 'APP', 'ASM'):\r
+                Attr = 'FLAGS'\r
+                try:\r
+                    FlagOption = self.BuildOption[Tool][Attr]\r
+                except KeyError:\r
+                    FlagOption = ''\r
+                \r
+                IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)]\r
+                #\r
+                # EDK II modules must not reference header files outside of the packages they depend on or \r
+                # within the module's directory tree. Report error if violation.\r
+                #\r
+                if self.AutoGenVersion >= 0x00010005 and len(IncPathList) > 0:\r
+                    for Path in IncPathList:\r
+                        if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):\r
+                            ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption) \r
+                            EdkLogger.error("build", \r
+                                            PARAMETER_INVALID,\r
+                                            ExtraData = ErrMsg, \r
+                                            File = str(self.MetaFile))\r
+\r
+                \r
+                BuildOptionIncPathList += IncPathList\r
+            \r
+            self._BuildOptionIncPathList = BuildOptionIncPathList\r
+        \r
+        return self._BuildOptionIncPathList\r
+        \r
     ## Return a list of files which can be built from source\r
     #\r
     #  What kind of files can be built is determined by build rules in\r
@@ -2256,7 +2428,7 @@ class ModuleAutoGen(AutoGen):
     #\r
     def _GetLibraryPcdList(self):\r
         if self._LibraryPcdList == None:\r
-            Pcds = {}\r
+            Pcds = sdict()\r
             if not self.IsLibrary:\r
                 # get PCDs from dependent libraries\r
                 for Library in self.DependentLibraryList:\r
@@ -2584,6 +2756,7 @@ class ModuleAutoGen(AutoGen):
     DxsFile                 = property(_GetDxsFile)\r
     DepexExpressionList     = property(_GetDepexExpressionTokenList)\r
     BuildOption             = property(_GetModuleBuildOption)\r
+    BuildOptionIncPathList  = property(_GetBuildOptionIncPathList)\r
     BuildCommand            = property(_GetBuildCommand)\r
 \r
 # This acts like the main() function for the script, unless it is 'import'ed into another script.\r
index 5bf693c50f1a6647dc3fcb0e2d95e9c9c7e3882e..3720c8bfedbdfb8abdd2ba8ae669f7c2bf540c2f 100644 (file)
@@ -614,7 +614,7 @@ cleanlib:
         self.FileDependency = self.GetFileDependency(
                                     SourceFileList,
                                     ForceIncludedFile,
-                                    self._AutoGenObject.IncludePathList
+                                    self._AutoGenObject.IncludePathList + self._AutoGenObject.BuildOptionIncPathList
                                     )
         DepSet = None
         for File in self.FileDependency:
@@ -1253,7 +1253,7 @@ ${END}\t@cd $(BUILD_DIR)
 #
 fds: init
 \t-@cd $(FV_DIR)
-${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list} ${extra_options}${END}${BEGIN} -r ${fd} ${END}${BEGIN} -i ${fv} ${END}${BEGIN} -C ${cap} ${END}${BEGIN} -D ${macro} ${END}
+${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list}${END}${BEGIN}${extra_options}${END}${BEGIN} -r ${fd}${END}${BEGIN} -i ${fv}${END}${BEGIN} -C ${cap}${END}${BEGIN} -D${macro}${END}
 
 #
 # run command for emulator platform only
@@ -1335,6 +1335,9 @@ ${END}\t@cd $(BUILD_DIR)\n
 
         if GlobalData.gCaseInsensitive:
             ExtraOption += " -c"
+        ExtraOptionList = []
+        if ExtraOption:
+            ExtraOptionList.append(ExtraOption)
 
         MakefileName = self._FILE_NAME_[self._FileType]
         SubBuildCommandList = []
@@ -1366,7 +1369,7 @@ ${END}\t@cd $(BUILD_DIR)\n
             "fd"                        : PlatformInfo.FdTargetList,
             "fv"                        : PlatformInfo.FvTargetList,
             "cap"                       : PlatformInfo.CapTargetList,
-            "extra_options"             : ExtraOption,
+            "extra_options"             : ExtraOptionList,
             "macro"                     : MacroList,
         }
 
index 3df493834c48cd5cb225e04f4e263839840e8940..7187f0a440dae540a6dbd3363bb30bf846c3db2e 100644 (file)
@@ -168,8 +168,9 @@ def CreateHFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag):
     Str = WriteLine(Str, Line)\r
     Line = COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED\r
     Str = WriteLine(Str, Line)\r
+    UnusedStr = ''\r
 \r
-    #Group the referred STRING token together. \r
+    #Group the referred/Unused STRING token together. \r
     for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):\r
         StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]\r
         Name = StringItem.StringName\r
@@ -183,21 +184,14 @@ def CreateHFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag):
                 else:\r
                     Line = DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4)\r
                 Str = WriteLine(Str, Line)\r
-\r
-    #Group the unused STRING token together.\r
-    for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):\r
-        StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]\r
-        Name = StringItem.StringName\r
-        Token = StringItem.Token\r
-        Referenced = StringItem.Referenced\r
-        if Name != None:\r
-            Line = ''\r
-            if Referenced == False:\r
+            else:\r
                 if (ValueStartPtr - len(DEFINE_STR + Name)) <= 0:\r
                     Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED\r
                 else:\r
                     Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED\r
-                Str = WriteLine(Str, Line)\r
+                UnusedStr = WriteLine(UnusedStr, Line)\r
+\r
+    Str = ''.join([Str,UnusedStr])\r
 \r
     Str = WriteLine(Str, '')\r
     if IsCompatibleMode or UniGenCFlag:\r
@@ -383,7 +377,6 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniBinBuffer,
     #\r
     for IndexI in range(len(UniObjectClass.LanguageDef)):\r
         Language = UniObjectClass.LanguageDef[IndexI][0]\r
-        LangPrintName = UniObjectClass.LanguageDef[IndexI][1]\r
         if Language not in UniLanguageListFiltered:\r
             continue\r
         \r
@@ -393,12 +386,12 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniBinBuffer,
         NumberOfUseOtherLangDef = 0\r
         Index = 0\r
         for IndexJ in range(1, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[IndexI][0]])):\r
-            Item = UniObjectClass.FindByToken(IndexJ, Language)\r
+            Item = UniObjectClass.OrderedStringListByToken[Language][IndexJ]\r
+\r
             Name = Item.StringName\r
             Value = Item.StringValueByteList\r
             Referenced = Item.Referenced\r
             Token = Item.Token\r
-            Length = Item.Length\r
             UseOtherLangDef = Item.UseOtherLangDef\r
 \r
             if UseOtherLangDef != '' and Referenced:\r
@@ -595,10 +588,7 @@ def SearchString(UniObjectClass, FileList, IsCompatibleMode):
 # This function is used for UEFI2.1 spec\r
 #\r
 #\r
-def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):\r
-    Status = True\r
-    ErrorMessage = ''\r
-\r
+def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):  \r
     if len(UniFilList) > 0:\r
         if ShellMode:\r
             #\r
@@ -627,13 +617,13 @@ def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, Ski
 # Write an item\r
 #\r
 def Write(Target, Item):\r
-    return Target + Item\r
+    return ''.join([Target,Item])\r
 \r
 #\r
 # Write an item with a break line\r
 #\r
 def WriteLine(Target, Item):\r
-    return Target + Item + '\n'\r
+    return ''.join([Target,Item,'\n'])\r
 \r
 # This acts like the main() function for the script, unless it is 'import'ed into another\r
 # script.\r
index 1825c81d91f5e4148a7945e4a140f4b3d12dbc3d..54751bab4e1111511c3f9700d797148e95934d7a 100644 (file)
@@ -193,6 +193,8 @@ class UniFileClassObject(object):
         self.Token = 2\r
         self.LanguageDef = []                   #[ [u'LanguageIdentifier', u'PrintableName'], ... ]\r
         self.OrderedStringList = {}             #{ u'LanguageIdentifier' : [StringDefClassObject]  }\r
+        self.OrderedStringDict = {}             #{ u'LanguageIdentifier' : {StringName:(IndexInList)}  }\r
+        self.OrderedStringListByToken = {}      #{ u'LanguageIdentifier' : {Token: StringDefClassObject} }\r
         self.IsCompatibleMode = IsCompatibleMode\r
         self.IncludePathList = IncludePathList\r
         if len(self.FileList) > 0:\r
@@ -246,14 +248,13 @@ class UniFileClassObject(object):
                     else:\r
                         OtherLang = FirstLangName\r
                     self.OrderedStringList[LangName].append (StringDefClassObject(Item.StringName, '', Item.Referenced, Item.Token, OtherLang))\r
-\r
+                    self.OrderedStringDict[LangName][Item.StringName] = len(self.OrderedStringList[LangName]) - 1\r
         return True\r
 \r
     #\r
     # Get String name and value\r
     #\r
     def GetStringObject(self, Item):\r
-        Name = ''\r
         Language = ''\r
         Value = ''\r
 \r
@@ -476,20 +477,22 @@ class UniFileClassObject(object):
             \r
         if Language not in self.OrderedStringList:\r
             self.OrderedStringList[Language] = []\r
+            self.OrderedStringDict[Language] = {}\r
 \r
         IsAdded = True\r
-        for Item in self.OrderedStringList[Language]:\r
-            if Name == Item.StringName:\r
-                IsAdded = False\r
-                if Value != None:\r
-                    Item.UpdateValue(Value)\r
-                    Item.UseOtherLangDef = ''\r
-                break\r
+        if Name in self.OrderedStringDict[Language]:\r
+            IsAdded = False\r
+            if Value != None:\r
+                ItemIndexInList = self.OrderedStringDict[Language][Name]\r
+                Item = self.OrderedStringList[Language][ItemIndexInList]\r
+                Item.UpdateValue(Value)\r
+                Item.UseOtherLangDef = ''   \r
 \r
         if IsAdded:\r
             Token = len(self.OrderedStringList[Language])\r
             if Index == -1:\r
                 self.OrderedStringList[Language].append(StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))\r
+                self.OrderedStringDict[Language][Name] = Token\r
                 for LangName in self.LanguageDef:\r
                     #\r
                     # New STRING token will be added into all language string lists.\r
@@ -501,8 +504,10 @@ class UniFileClassObject(object):
                         else:\r
                             OtherLangDef = Language\r
                         self.OrderedStringList[LangName[0]].append(StringDefClassObject(Name, '', Referenced, Token, OtherLangDef))\r
+                        self.OrderedStringDict[LangName[0]][Name] = len(self.OrderedStringList[LangName[0]]) - 1\r
             else:\r
                 self.OrderedStringList[Language].insert(Index, StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))\r
+                self.OrderedStringDict[Language][Name] = Index\r
 \r
     #\r
     # Set the string as referenced\r
@@ -513,17 +518,18 @@ class UniFileClassObject(object):
         # So, only update the status of string stoken in first language string list.\r
         #\r
         Lang = self.LanguageDef[0][0]\r
-        for Item in self.OrderedStringList[Lang]:\r
-            if Name == Item.StringName:\r
-                Item.Referenced = True\r
-                break\r
+        if Name in self.OrderedStringDict[Lang]:\r
+            ItemIndexInList = self.OrderedStringDict[Lang][Name]\r
+            Item = self.OrderedStringList[Lang][ItemIndexInList]\r
+            Item.Referenced = True\r
+\r
     #\r
     # Search the string in language definition by Name\r
     #\r
     def FindStringValue(self, Name, Lang):\r
-        for Item in self.OrderedStringList[Lang]:\r
-            if Item.StringName == Name:\r
-                return Item\r
+        if Name in self.OrderedStringDict[Lang]:\r
+            ItemIndexInList = self.OrderedStringDict[Lang][Name]\r
+            return self.OrderedStringList[Lang][ItemIndexInList]\r
 \r
         return None\r
 \r
@@ -546,6 +552,10 @@ class UniFileClassObject(object):
         #\r
         FirstLangName = self.LanguageDef[0][0]\r
 \r
+        # Convert the OrderedStringList to be OrderedStringListByToken in order to faciliate future search by token\r
+        for LangNameItem in self.LanguageDef:\r
+            self.OrderedStringListByToken[LangNameItem[0]] = {}\r
+\r
         #\r
         # Use small token for all referred string stoken.\r
         #\r
@@ -558,6 +568,7 @@ class UniFileClassObject(object):
                     OtherLangItem = self.OrderedStringList[LangName][Index]\r
                     OtherLangItem.Referenced = True\r
                     OtherLangItem.Token = RefToken\r
+                    self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem\r
                 RefToken = RefToken + 1\r
 \r
         #\r
@@ -571,6 +582,7 @@ class UniFileClassObject(object):
                     LangName = LangNameItem[0]\r
                     OtherLangItem = self.OrderedStringList[LangName][Index]\r
                     OtherLangItem.Token = RefToken + UnRefToken\r
+                    self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem\r
                 UnRefToken = UnRefToken + 1\r
 \r
     #\r
index 48316716b1fe0e65e8b2be6dc12176b6a468d746..fecc40e84a3cff32e817ab3d2e1722664229f56b 100644 (file)
@@ -1,3 +1,3 @@
 #This file is for build version number auto generation\r
 #\r
-gBUILD_VERSION = "Build 2322"\r
+gBUILD_VERSION = "Build 2361"\r
index d6a796bd2b1ec46cab2807205d92035c0064f3a7..731bbf14584b7a610e412a7c716fe83ed3284e5e 100644 (file)
@@ -1396,6 +1396,27 @@ class PathClass(object):
         else:
             return self.Path == str(Other)
 
+    ## Override __cmp__ function
+    #
+    # Customize the comparsion operation of two PathClass
+    #
+    # @retval 0     The two PathClass are different
+    # @retval -1    The first PathClass is less than the second PathClass
+    # @retval 1     The first PathClass is Bigger than the second PathClass
+    def __cmp__(self, Other):
+        if type(Other) == type(self):
+            OtherKey = Other.Path
+        else:
+            OtherKey = str(Other)
+            
+        SelfKey = self.Path
+        if SelfKey == OtherKey:
+            return 0
+        elif SelfKey > OtherKey:
+            return 1
+        else:
+            return -1
+
     ## Override __hash__ function
     #
     # Use Path as key in hash table
index 4c831e0ff72e8ffc49bca9d400de5133b10fc8bf..532f4a0918a8a16f2fa642ea1d875a3a5b4533a6 100644 (file)
@@ -62,7 +62,7 @@ def PrintErrorMsg(ErrorType, Msg, TableName, ItemId):
     for Part in MsgPartList:\r
         Msg += Part\r
         Msg += ' '\r
-    GetDB().TblReport.Insert(ErrorType, OtherMsg = Msg, BelongsToTable = TableName, BelongsToItem = ItemId)\r
+    GetDB().TblReport.Insert(ErrorType, OtherMsg=Msg, BelongsToTable=TableName, BelongsToItem=ItemId)\r
 \r
 def GetIdType(Str):\r
     Type = DataClass.MODEL_UNKNOWN\r
@@ -93,16 +93,16 @@ def SuOccurInTypedef (Su, TdList):
 def GetIdentifierList():\r
     IdList = []\r
     for comment in FileProfile.CommentList:\r
-        IdComment = DataClass.IdentifierClass(-1, '', '', '', comment.Content, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0],comment.StartPos[1],comment.EndPos[0],comment.EndPos[1])\r
+        IdComment = DataClass.IdentifierClass(-1, '', '', '', comment.Content, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0], comment.StartPos[1], comment.EndPos[0], comment.EndPos[1])\r
         IdList.append(IdComment)\r
 \r
     for pp in FileProfile.PPDirectiveList:\r
         Type = GetIdType(pp.Content)\r
-        IdPP = DataClass.IdentifierClass(-1, '', '', '', pp.Content, Type, -1, -1, pp.StartPos[0],pp.StartPos[1],pp.EndPos[0],pp.EndPos[1])\r
+        IdPP = DataClass.IdentifierClass(-1, '', '', '', pp.Content, Type, -1, -1, pp.StartPos[0], pp.StartPos[1], pp.EndPos[0], pp.EndPos[1])\r
         IdList.append(IdPP)\r
 \r
     for pe in FileProfile.PredicateExpressionList:\r
-        IdPE = DataClass.IdentifierClass(-1, '', '', '', pe.Content, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -1, -1, pe.StartPos[0],pe.StartPos[1],pe.EndPos[0],pe.EndPos[1])\r
+        IdPE = DataClass.IdentifierClass(-1, '', '', '', pe.Content, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -1, -1, pe.StartPos[0], pe.StartPos[1], pe.EndPos[0], pe.EndPos[1])\r
         IdList.append(IdPE)\r
 \r
     FuncDeclPattern = GetFuncDeclPattern()\r
@@ -191,7 +191,7 @@ def GetIdentifierList():
                     var.Modifier += ' ' + Name[LSBPos:]\r
                     Name = Name[0:LSBPos]\r
 \r
-                IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0],var.StartPos[1], VarNameStartLine, VarNameStartColumn)\r
+                IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)\r
                 IdList.append(IdVar)\r
         else:\r
             DeclList = var.Declarator.split('=')\r
@@ -200,15 +200,15 @@ def GetIdentifierList():
                 LSBPos = var.Declarator.find('[')\r
                 var.Modifier += ' ' + Name[LSBPos:]\r
                 Name = Name[0:LSBPos]\r
-            IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0],var.StartPos[1], VarNameStartLine, VarNameStartColumn)\r
+            IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)\r
             IdList.append(IdVar)\r
 \r
     for enum in FileProfile.EnumerationDefinitionList:\r
         LBPos = enum.Content.find('{')\r
         RBPos = enum.Content.find('}')\r
         Name = enum.Content[4:LBPos].strip()\r
-        Value = enum.Content[LBPos+1:RBPos]\r
-        IdEnum = DataClass.IdentifierClass(-1, '', '', Name, Value, DataClass.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0],enum.StartPos[1],enum.EndPos[0],enum.EndPos[1])\r
+        Value = enum.Content[LBPos + 1:RBPos]\r
+        IdEnum = DataClass.IdentifierClass(-1, '', '', Name, Value, DataClass.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0], enum.StartPos[1], enum.EndPos[0], enum.EndPos[1])\r
         IdList.append(IdEnum)\r
 \r
     for su in FileProfile.StructUnionDefinitionList:\r
@@ -226,8 +226,8 @@ def GetIdentifierList():
             Value = ''\r
         else:\r
             Name = su.Content[SkipLen:LBPos].strip()\r
-            Value = su.Content[LBPos:RBPos+1]\r
-        IdPE = DataClass.IdentifierClass(-1, '', '', Name, Value, Type, -1, -1, su.StartPos[0],su.StartPos[1],su.EndPos[0],su.EndPos[1])\r
+            Value = su.Content[LBPos:RBPos + 1]\r
+        IdPE = DataClass.IdentifierClass(-1, '', '', Name, Value, Type, -1, -1, su.StartPos[0], su.StartPos[1], su.EndPos[0], su.EndPos[1])\r
         IdList.append(IdPE)\r
 \r
     TdFuncPointerPattern = GetTypedefFuncPointerPattern()\r
@@ -238,7 +238,7 @@ def GetIdentifierList():
         if TdFuncPointerPattern.match(td.ToType):\r
             Modifier = td.FromType\r
             LBPos = td.ToType.find('(')\r
-            TmpStr = td.ToType[LBPos+1:].strip()\r
+            TmpStr = td.ToType[LBPos + 1:].strip()\r
             StarPos = TmpStr.find('*')\r
             if StarPos != -1:\r
                 Modifier += ' ' + TmpStr[0:StarPos]\r
@@ -260,11 +260,11 @@ def GetIdentifierList():
             Value += Name[LBPos : RBPos + 1]\r
             Name = Name[0 : LBPos]\r
 \r
-        IdTd = DataClass.IdentifierClass(-1, Modifier, '', Name, Value, DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0],td.StartPos[1],td.EndPos[0],td.EndPos[1])\r
+        IdTd = DataClass.IdentifierClass(-1, Modifier, '', Name, Value, DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0], td.StartPos[1], td.EndPos[0], td.EndPos[1])\r
         IdList.append(IdTd)\r
 \r
     for funcCall in FileProfile.FunctionCallingList:\r
-        IdFC = DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, funcCall.StartPos[0],funcCall.StartPos[1],funcCall.EndPos[0],funcCall.EndPos[1])\r
+        IdFC = DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, funcCall.StartPos[0], funcCall.StartPos[1], funcCall.EndPos[0], funcCall.EndPos[1])\r
         IdList.append(IdFC)\r
     return IdList\r
 \r
@@ -275,7 +275,7 @@ def StripNonAlnumChars(Str):
             StrippedStr += Char\r
     return StrippedStr\r
 \r
-def GetParamList(FuncDeclarator, FuncNameLine = 0, FuncNameOffset = 0):\r
+def GetParamList(FuncDeclarator, FuncNameLine=0, FuncNameOffset=0):\r
     FuncDeclarator = StripComments(FuncDeclarator)\r
     ParamIdList = []\r
     #DeclSplitList = FuncDeclarator.split('(')\r
@@ -477,7 +477,7 @@ def GetFunctionList():
                         FuncNameStartColumn += 1\r
                     PreChar = FirstChar\r
 \r
-        FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0],FuncDef.StartPos[1],FuncDef.EndPos[0],FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)\r
+        FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0], FuncDef.StartPos[1], FuncDef.EndPos[0], FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)\r
         FuncObjList.append(FuncObj)\r
 \r
     return FuncObjList\r
@@ -547,7 +547,7 @@ def CollectSourceCodeDataIntoDB(RootDir):
 \r
     Db.UpdateIdentifierBelongsToFunction()\r
 \r
-def GetTableID(FullFileName, ErrorMsgList = None):\r
+def GetTableID(FullFileName, ErrorMsgList=None):\r
     if ErrorMsgList == None:\r
         ErrorMsgList = []\r
 \r
@@ -562,11 +562,11 @@ def GetTableID(FullFileName, ErrorMsgList = None):
     for Result in ResultSet:\r
         if FileID != -1:\r
             ErrorMsgList.append('Duplicate file ID found in DB for file %s' % FullFileName)\r
-            return -2\r
+            return - 2\r
         FileID = Result[0]\r
     if FileID == -1:\r
         ErrorMsgList.append('NO file ID found in DB for file %s' % FullFileName)\r
-        return -1\r
+        return - 1\r
     return FileID\r
 \r
 def GetIncludeFileList(FullFileName):\r
@@ -645,7 +645,7 @@ def GetPredicateListFromPredicateExpStr(PES):
     while i < len(PES) - 1:\r
         if (PES[i].isalnum() or PES[i] == '_' or PES[i] == '*') and LogicOpPos > PredicateBegin:\r
             PredicateBegin = i\r
-        if (PES[i] == '&' and PES[i+1] == '&') or (PES[i] == '|' and PES[i+1] == '|'):\r
+        if (PES[i] == '&' and PES[i + 1] == '&') or (PES[i] == '|' and PES[i + 1] == '|'):\r
             LogicOpPos = i\r
             Exp = PES[PredicateBegin:i].strip()\r
             # Exp may contain '.' or '->'\r
@@ -670,7 +670,7 @@ def GetPredicateListFromPredicateExpStr(PES):
             PredicateList.append(Exp.rstrip(';').rstrip(')').strip())\r
     return PredicateList\r
 \r
-def GetCNameList(Lvalue, StarList = []):\r
+def GetCNameList(Lvalue, StarList=[]):\r
     Lvalue += ' '\r
     i = 0\r
     SearchBegin = 0\r
@@ -686,7 +686,7 @@ def GetCNameList(Lvalue, StarList = []):
                 VarEnd = i\r
                 i += 1\r
             elif VarEnd != -1:\r
-                VarList.append(Lvalue[VarStart:VarEnd+1])\r
+                VarList.append(Lvalue[VarStart:VarEnd + 1])\r
                 i += 1\r
                 break\r
             else:\r
@@ -714,7 +714,7 @@ def GetCNameList(Lvalue, StarList = []):
 \r
     return VarList\r
 \r
-def SplitPredicateByOp(Str, Op, IsFuncCalling = False):\r
+def SplitPredicateByOp(Str, Op, IsFuncCalling=False):\r
 \r
     Name = Str.strip()\r
     Value = None\r
@@ -760,7 +760,7 @@ def SplitPredicateByOp(Str, Op, IsFuncCalling = False):
             return [Name]\r
 \r
         Name = Str[0:Index + IndexInRemainingStr].strip()\r
-        Value = Str[Index+IndexInRemainingStr+len(Op):].strip().strip(')')\r
+        Value = Str[Index + IndexInRemainingStr + len(Op):].strip().strip(')')\r
         return [Name, Value]\r
 \r
     TmpStr = Str.rstrip(';').rstrip(')')\r
@@ -769,7 +769,7 @@ def SplitPredicateByOp(Str, Op, IsFuncCalling = False):
         if Index == -1:\r
             return [Name]\r
 \r
-        if Str[Index - 1].isalnum() or Str[Index - 1].isspace() or Str[Index - 1] == ')':\r
+        if Str[Index - 1].isalnum() or Str[Index - 1].isspace() or Str[Index - 1] == ')' or Str[Index - 1] == ']':\r
             Name = Str[0:Index].strip()\r
             Value = Str[Index + len(Op):].strip()\r
             return [Name, Value]\r
@@ -826,15 +826,13 @@ def PatternInModifier(Modifier, SubStr):
 \r
 def GetDataTypeFromModifier(ModifierStr):\r
     MList = ModifierStr.split()\r
+    ReturnType = ''\r
     for M in MList:\r
         if M in EccGlobalData.gConfig.ModifierList:\r
-            MList.remove(M)\r
+            continue\r
         # remove array sufix\r
-        if M.startswith('['):\r
-            MList.remove(M)\r
-\r
-    ReturnType = ''\r
-    for M in MList:\r
+        if M.startswith('[') or M.endswith(']'):\r
+            continue\r
         ReturnType += M + ' '\r
 \r
     ReturnType = ReturnType.strip()\r
@@ -950,7 +948,7 @@ def StripComments(Str):
                 DoubleSlashComment = False\r
             Index += 1\r
         # check for */ comment end\r
-        elif InComment and not DoubleSlashComment and ListFromStr[Index] == '*' and ListFromStr[Index+1] == '/':\r
+        elif InComment and not DoubleSlashComment and ListFromStr[Index] == '*' and ListFromStr[Index + 1] == '/':\r
             ListFromStr[Index] = ' '\r
             Index += 1\r
             ListFromStr[Index] = ' '\r
@@ -961,12 +959,12 @@ def StripComments(Str):
             ListFromStr[Index] = ' '\r
             Index += 1\r
         # check for // comment\r
-        elif ListFromStr[Index] == '/' and ListFromStr[Index+1] == '/' and ListFromStr[Index+2] != '\n':\r
+        elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '/' and ListFromStr[Index + 2] != '\n':\r
             InComment = True\r
             DoubleSlashComment = True\r
 \r
         # check for /* comment start\r
-        elif ListFromStr[Index] == '/' and ListFromStr[Index+1] == '*':\r
+        elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '*':\r
             ListFromStr[Index] = ' '\r
             Index += 1\r
             ListFromStr[Index] = ' '\r
@@ -1024,7 +1022,7 @@ def GetFinalTypeValue(Type, FieldName, TypedefDict, SUDict):
 \r
     return None\r
 \r
-def GetRealType(Type, TypedefDict, TargetType = None):\r
+def GetRealType(Type, TypedefDict, TargetType=None):\r
     if TargetType != None and Type == TargetType:\r
             return Type\r
     while TypedefDict.get(Type):\r
@@ -1033,7 +1031,7 @@ def GetRealType(Type, TypedefDict, TargetType = None):
             return Type\r
     return Type\r
 \r
-def GetTypeInfo(RefList, Modifier, FullFileName, TargetType = None):\r
+def GetTypeInfo(RefList, Modifier, FullFileName, TargetType=None):\r
     TypedefDict = GetTypedefDict(FullFileName)\r
     SUDict = GetSUDict(FullFileName)\r
     Type = GetDataTypeFromModifier(Modifier).replace('*', '').strip()\r
@@ -1051,7 +1049,7 @@ def GetTypeInfo(RefList, Modifier, FullFileName, TargetType = None):
         # we only want to check if it is a pointer\r
         else:\r
             Type = FromType\r
-            if Type.find('*') != -1 and Index == len(RefList)-1:\r
+            if Type.find('*') != -1 and Index == len(RefList) - 1:\r
                 return Type\r
             Type = FromType.split()[0]\r
 \r
@@ -1061,7 +1059,7 @@ def GetTypeInfo(RefList, Modifier, FullFileName, TargetType = None):
 \r
     return Type\r
 \r
-def GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall = False, TargetType = None, StarList = None):\r
+def GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall=False, TargetType=None, StarList=None):\r
 \r
     PredVar = PredVarList[0]\r
     FileID = GetTableID(FullFileName)\r
@@ -1536,7 +1534,7 @@ def CheckFuncLayoutLocalVariable(FullFileName):
         FL.append(Result)\r
 \r
     for F in FL:\r
-        SqlStatement = """ select Name, Value, ID\r
+        SqlStatement = """ select Name, Value, ID, Modifier\r
                        from %s\r
                        where Model = %d and BelongsToFunction = %d\r
                    """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE, F[0])\r
@@ -1545,7 +1543,7 @@ def CheckFuncLayoutLocalVariable(FullFileName):
             continue\r
 \r
         for Result in ResultSet:\r
-            if len(Result[1]) > 0:\r
+            if len(Result[1]) > 0 and 'CONST' not in Result[3]:\r
                 PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE, 'Variable Name: %s' % Result[0], FileTable, Result[2])\r
 \r
 def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):\r
@@ -1687,9 +1685,9 @@ def CheckDeclTypedefFormat(FullFileName, ModelId):
         # Check member variable format.\r
         ErrMsgList = CheckMemberVariableFormat(Name, Value, FileTable, Td[5], ModelId)\r
         for ErrMsg in ErrMsgList:\r
-            if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Name+'.'+ErrMsg):\r
+            if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Name + '.' + ErrMsg):\r
                 continue\r
-            PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Name+'.'+ErrMsg), FileTable, Td[5])\r
+            PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Name + '.' + ErrMsg), FileTable, Td[5])\r
 \r
     # First check in current file to see whether struct/union/enum is typedef-ed.\r
     UntypedefedList = []\r
@@ -1710,9 +1708,9 @@ def CheckDeclTypedefFormat(FullFileName, ModelId):
             continue\r
         ErrMsgList = CheckMemberVariableFormat(Name, Value, FileTable, Result[3], ModelId)\r
         for ErrMsg in ErrMsgList:\r
-            if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Result[0]+'.'+ErrMsg):\r
+            if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Result[0] + '.' + ErrMsg):\r
                 continue\r
-            PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Result[0]+'.'+ErrMsg), FileTable, Result[3])\r
+            PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Result[0] + '.' + ErrMsg), FileTable, Result[3])\r
         # Check whether it is typedefed.\r
         Found = False\r
         for Td in TdList:\r
@@ -1949,7 +1947,7 @@ def CheckPointerNullComparison(FullFileName):
                 if SearchInCache:\r
                     Type = FuncReturnTypeDict.get(PredVarStr)\r
                     if Type != None:\r
-                        if Type.find('*') != -1:\r
+                        if Type.find('*') != -1 and Type != 'BOOLEAN*':\r
                             PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])\r
                         continue\r
 \r
@@ -1962,7 +1960,7 @@ def CheckPointerNullComparison(FullFileName):
                 if Type == None:\r
                     continue\r
                 Type = GetTypeFromArray(Type, PredVarStr)\r
-                if Type.find('*') != -1:\r
+                if Type.find('*') != -1 and Type != 'BOOLEAN*':\r
                     PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])\r
 \r
 def CheckNonBooleanValueComparison(FullFileName):\r
@@ -2004,8 +2002,6 @@ def CheckNonBooleanValueComparison(FullFileName):
             continue\r
 \r
         for Exp in GetPredicateListFromPredicateExpStr(Str[0]):\r
-#            if p.match(Exp):\r
-#                continue\r
             PredInfo = SplitPredicateStr(Exp)\r
             if PredInfo[1] == None:\r
                 PredVarStr = PredInfo[0][0].strip()\r
@@ -2037,7 +2033,6 @@ def CheckNonBooleanValueComparison(FullFileName):
 \r
                     if PredVarStr in FuncReturnTypeDict:\r
                         continue\r
-\r
                 Type = GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall, 'BOOLEAN', StarList)\r
                 if SearchInCache:\r
                     FuncReturnTypeDict[PredVarStr] = Type\r
@@ -2446,7 +2441,7 @@ def GetDoxygenStrFromComment(Str):
 \r
     return DoxygenStrList\r
 \r
-def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, CommentId = -1, TableName = ''):\r
+def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, CommentId= -1, TableName=''):\r
     #/** --*/ @retval after @param\r
     if not Str.startswith('/**'):\r
         ErrorMsgList.append('Line %d : Comment does NOT have prefix /** ' % StartLine)\r
@@ -2460,7 +2455,7 @@ def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, CommentId = -
         ErrorMsgList.append('Line %d : @retval appear before @param ' % StartLine)\r
         PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, @retval appear before @param  ', TableName, CommentId)\r
 \r
-def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId = -1, TableName = ''):\r
+def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId= -1, TableName=''):\r
 \r
     ParamList = GetParamList(FuncHeader)\r
     CheckGeneralDoxygenCommentLayout(CommentStr, CommentStartLine, ErrorMsgList, CommentId, TableName)\r
@@ -2480,18 +2475,18 @@ def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, Fu
             ParamName = ParamList[Index].Name.strip()\r
             Tag = DoxygenStrList[Index].strip(' ')\r
             if (not Tag[-1] == ('\n')) and (not Tag[-1] == ('\r')):\r
-                ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT end with new line ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))\r
-                PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, \"%s\" does NOT end with new line ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)\r
+                ErrorMsgList.append('Line %d : in Comment, <%s> does NOT end with new line ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))\r
+                PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, <%s> does NOT end with new line ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)\r
             TagPartList = Tag.split()\r
             if len(TagPartList) < 2:\r
-                ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT contain doxygen contents ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))\r
-                PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, \"%s\" does NOT contain doxygen contents ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)\r
+                ErrorMsgList.append('Line %d : in Comment, <%s> does NOT contain doxygen contents ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))\r
+                PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT contain doxygen contents ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)\r
                 Index += 1\r
                 continue\r
             LBPos = Tag.find('[')\r
             RBPos = Tag.find(']')\r
             ParamToLBContent = Tag[len('@param'):LBPos].strip()\r
-            if LBPos > 0 and len(ParamToLBContent)==0 and RBPos > LBPos:\r
+            if LBPos > 0 and len(ParamToLBContent) == 0 and RBPos > LBPos:\r
                 InOutStr = ''\r
                 ModifierPartList = ParamModifier.split()\r
                 for Part in ModifierPartList:\r
@@ -2504,12 +2499,19 @@ def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, Fu
                             InOutStr = 'out'\r
 \r
                 if InOutStr != '':\r
-                    if Tag.find('['+InOutStr+']') == -1:\r
-                        ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), '['+InOutStr+']'))\r
-                        PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, \"%s\" does NOT have %s ' % ((TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), '['+InOutStr+']'), TableName, CommentId)\r
+                    if Tag.find('[' + InOutStr + ']') == -1:\r
+                        if InOutStr != 'in, out':\r
+                            ErrorMsgList.append('Line %d : in Comment, <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))\r
+                            PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, CommentId)\r
+                        else:\r
+                            if Tag.find('[in,out]') == -1:\r
+                                ErrorMsgList.append('Line %d : in Comment, <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))\r
+                                PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, CommentId)\r
+\r
+\r
             if Tag.find(ParamName) == -1 and ParamName != 'VOID' and ParamName != 'void':\r
-                ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))\r
-                PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, \"%s\" does NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)\r
+                ErrorMsgList.append('Line %d : in Comment, <%s> does NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))\r
+                PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)\r
             Index += 1\r
 \r
         if Index < ParamNumber:\r
index 6a9e5b7b4035e6e01a389145ae91b7fed3b72b32..4f555e32bbaea27de65ee3f9cfc9899a73db24e2 100644 (file)
@@ -1690,9 +1690,13 @@ class FdfParser:
             self.__UndoToken()\r
             self.__GetRegionFileType( RegionObj)\r
 \r
-        else:\r
+        elif self.__Token == "DATA":\r
             self.__UndoToken()\r
             self.__GetRegionDataType( RegionObj)\r
+        else:\r
+            raise Warning("A valid region type was not found. "\r
+                          "Valid types are [SET, FV, CAPSULE, FILE, DATA]. This error occurred",\r
+                          self.FileName, self.CurrentLineNumber)\r
 \r
         return True\r
 \r
@@ -1929,6 +1933,8 @@ class FdfParser:
         self.__GetSetStatements(FvObj)\r
         \r
         self.__GetFvBaseAddress(FvObj)\r
+        \r
+        self.__GetFvForceRebase(FvObj)\r
 \r
         self.__GetFvAlignment(FvObj)\r
 \r
@@ -2006,11 +2012,42 @@ class FdfParser:
         IsValidBaseAddrValue = re.compile('^0[x|X][0-9a-fA-F]+')\r
 \r
         if not IsValidBaseAddrValue.match(self.__Token.upper()):\r
-            raise Warning("Unknown alignment value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
+            raise Warning("Unknown FV base address value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
         Obj.FvBaseAddress = self.__Token\r
         return True    \r
     \r
+    ## __GetFvForceRebase() method\r
+    #\r
+    #   Get FvForceRebase for FV\r
+    #\r
+    #   @param  self        The object pointer\r
+    #   @param  Obj         for whom FvForceRebase is got\r
+    #   @retval True        Successfully find a FvForceRebase statement\r
+    #   @retval False       Not able to find a FvForceRebase statement\r
+    #\r
+    def __GetFvForceRebase(self, Obj):\r
+\r
+        if not self.__IsKeyword("FvForceRebase"):\r
+            return False\r
+\r
+        if not self.__IsToken( "="):\r
+            raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
+\r
+        if not self.__GetNextToken():\r
+            raise Warning("expected FvForceRebase value", self.FileName, self.CurrentLineNumber)\r
 \r
+        if self.__Token.upper() not in ["TRUE", "FALSE", "0", "0X0", "0X00", "1", "0X1", "0X01"]:\r
+            raise Warning("Unknown FvForceRebase value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
+        \r
+        if self.__Token.upper() in ["TRUE", "1", "0X1", "0X01"]:\r
+            Obj.FvForceRebase = True\r
+        elif self.__Token.upper() in ["FALSE", "0", "0X0", "0X00"]:\r
+            Obj.FvForceRebase = False\r
+        else:\r
+            Obj.FvForceRebase = None\r
+           \r
+        return True\r
+    \r
     ## __GetFvAttributes() method\r
     #\r
     #   Get attributes for FV\r
@@ -2215,7 +2252,10 @@ class FdfParser:
                 ffsInf.KeepReloc = True\r
             else:\r
                 raise Warning("Unknown reloc strip flag '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
-\r
+        \r
+        ffsInf.CurrentLineNum = self.CurrentLineNumber\r
+        ffsInf.CurrentLineContent = self.__CurrentLine()\r
+        \r
         if ForCapsule:\r
             capsuleFfs = CapsuleData.CapsuleFfs()\r
             capsuleFfs.Ffs = ffsInf\r
@@ -2325,7 +2365,10 @@ class FdfParser:
                 self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'\r
                 \r
         FfsFileObj.NameGuid = self.__Token\r
-\r
+        \r
+        FfsFileObj.CurrentLineNum = self.CurrentLineNumber\r
+        FfsFileObj.CurrentLineContent = self.__CurrentLine()\r
+        \r
         self.__GetFilePart( FfsFileObj, MacroDict.copy())\r
 \r
         if ForCapsule:\r
@@ -3922,7 +3965,7 @@ class FdfParser:
                     Overrides.PciRevision = self.__Token\r
                     continue\r
 \r
-                if self.__IsKeyword( "COMPRESS"):\r
+                if self.__IsKeyword( "PCI_COMPRESS"):\r
                     if not self.__IsToken( "="):\r
                         raise Warning("expected '='", self.FileName, self.CurrentLineNumber)\r
                     if not self.__GetNextToken():\r
index 013dbb1f02fb99e335c23fc516847576362de4f1..b85854936179a33c956c7e4f1bf0739742f746d4 100644 (file)
@@ -39,6 +39,10 @@ class FileStatement (FileStatementClassObject) :
     #\r
     def __init__(self):\r
         FileStatementClassObject.__init__(self)\r
+        self.CurrentLineNum = None\r
+        self.CurrentLineContent = None\r
+        self.FileName = None\r
+        self.InfFileName = None\r
 \r
     ## GenFfs() method\r
     #\r
@@ -94,7 +98,7 @@ class FileStatement (FileStatementClassObject) :
             SectionFiles = []\r
             Index = 0\r
             SectionAlignments = []\r
-            for section in self.SectionList :\r
+            for section in self.SectionList:\r
                 Index = Index + 1\r
                 SecIndex = '%d' %Index\r
                 # process the inside FvImage from FvSection or GuidSection\r
index b9e18f6bca922ca09b82717026cdeb8fc41712bd..c6f29f6ddd941bc79db2a8dc9c9c18d5ac9dbc7f 100644 (file)
@@ -56,6 +56,10 @@ class FfsInfStatement(FfsInfStatementClassObject):
         self.PiSpecVersion = '0x00000000'\r
         self.InfModule = None\r
         self.FinalTargetSuffixMap = {}\r
+        self.CurrentLineNum = None\r
+        self.CurrentLineContent = None\r
+        self.FileName = None\r
+        self.InfFileName = None\r
 \r
     ## GetFinalTargetSuffixMap() method\r
     #\r
@@ -452,7 +456,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         Arch = ''\r
         OutputPath = ''\r
         (ModulePath, FileName) = os.path.split(self.InfFileName)\r
-        Index = FileName.find('.')\r
+        Index = FileName.rfind('.')\r
         FileName = FileName[0:Index]\r
         Arch = "NoneArch"\r
         if self.CurrentArch != None:\r
index 773b0efbe81f073a5c687b334db207dec705f4fd..f186ab0e73265547b126daa9be098b3738c436df 100644 (file)
@@ -47,6 +47,7 @@ class FV (FvClassObject):
         self.FvAddressFileName = None\r
         self.CapsuleName = None\r
         self.FvBaseAddress = None\r
+        self.FvForceRebase = None\r
 \r
     ## AddToBuffer()\r
     #\r
@@ -133,7 +134,8 @@ class FV (FvClassObject):
                                 FvOutputFile,\r
                                 [self.InfFileName],\r
                                 AddressFile=FvInfoFileName,\r
-                                FfsList=FfsFileList\r
+                                FfsList=FfsFileList,\r
+                                ForceRebase=self.FvForceRebase\r
                                 )\r
 \r
         NewFvInfo = None\r
@@ -162,7 +164,8 @@ class FV (FvClassObject):
                                         FvOutputFile,\r
                                         [self.InfFileName],\r
                                         AddressFile=FvInfoFileName,\r
-                                        FfsList=FfsFileList\r
+                                        FfsList=FfsFileList,\r
+                                        ForceRebase=self.FvForceRebase\r
                                         )\r
 \r
         #\r
index 3abaef2023223586c37506c00f45a02341b2e318..236283751e1ac0aa264a862e06e2d23034fd3c85 100644 (file)
@@ -422,7 +422,7 @@ class GenFdsGlobalVariable:
         GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate FFS")
 
     @staticmethod
-    def GenerateFirmwareVolume(Output, Input, BaseAddress=None, Capsule=False, Dump=False,
+    def GenerateFirmwareVolume(Output, Input, BaseAddress=None, ForceRebase=None, Capsule=False, Dump=False,
                                AddressFile=None, MapFile=None, FfsList=[]):
         if not GenFdsGlobalVariable.NeedsUpdate(Output, Input+FfsList):
             return
@@ -431,6 +431,12 @@ class GenFdsGlobalVariable:
         Cmd = ["GenFv"]
         if BaseAddress not in [None, '']:
             Cmd += ["-r", BaseAddress]
+        
+        if ForceRebase == False:
+            Cmd +=["-F", "FALSE"]
+        elif ForceRebase == True:
+            Cmd +=["-F", "TRUE"]
+                        
         if Capsule:
             Cmd += ["-c"]
         if Dump:
index d64f836164863fc2a1f9b5ce23131fab0def2897..069414df5b00bd18ca1b07c7dbad9f571456a75f 100644 (file)
@@ -50,10 +50,10 @@ class OptRomInfStatement (FfsInfStatement):
             self.OverrideAttribs = OptionRom.OverrideAttribs()\r
 \r
         if self.OverrideAttribs.NeedCompress == None:\r
-            self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('COMPRESS')\r
+            self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('PCI_COMPRESS')\r
             if self.OverrideAttribs.NeedCompress is not None:\r
                 if self.OverrideAttribs.NeedCompress.upper() not in ('TRUE', 'FALSE'):\r
-                    GenFdsGlobalVariable.ErrorLogger( "Expected TRUE/FALSE for COMPRESS: %s" %self.InfFileName)\r
+                    GenFdsGlobalVariable.ErrorLogger( "Expected TRUE/FALSE for PCI_COMPRESS: %s" %self.InfFileName)\r
                 self.OverrideAttribs.NeedCompress = \\r
                     self.OverrideAttribs.NeedCompress.upper() == 'TRUE'\r
 \r
index fabc7ed9862fe8d86a020d5411c2cbf0a86f46a1..4bad21298af6a433dc1d5613ab6f8e059aa9e751 100644 (file)
@@ -895,21 +895,28 @@ class DscParser(MetaFileParser):
         # three operands
         elif TokenNumber == 3:
             TokenValue = TokenList[0] 
-            if TokenValue[0] in ["'", '"'] and TokenValue[-1] in ["'", '"']:
-                TokenValue = TokenValue[1:-1]             
-            if TokenValue.startswith("$(") and TokenValue.endswith(")"):
-                TokenValue = self._EvaluateToken(TokenValue, Expression)
-            if TokenValue[0] in ["'", '"'] and TokenValue[-1] in ["'", '"']:
-                TokenValue = TokenValue[1:-1]                
-            if TokenValue == None:
-                return False
+            if TokenValue != "":
+                if TokenValue[0] in ["'", '"'] and TokenValue[-1] in ["'", '"']:
+                    TokenValue = TokenValue[1:-1]             
+                if TokenValue.startswith("$(") and TokenValue.endswith(")"):
+                    TokenValue = self._EvaluateToken(TokenValue, Expression)
+                    if TokenValue == None:
+                        return False
+                if TokenValue != "":                
+                    if TokenValue[0] in ["'", '"'] and TokenValue[-1] in ["'", '"']:
+                        TokenValue = TokenValue[1:-1]
+               
             Value = TokenList[2]
-            if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
-                Value = Value[1:-1]            
-            if Value.startswith("$(") and Value.endswith(")"):
-                Value = self._EvaluateToken(Value, Expression)          
-            if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
-                Value = Value[1:-1]
+            if Value != "":
+                if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
+                    Value = Value[1:-1]         
+                if Value.startswith("$(") and Value.endswith(")"):
+                    Value = self._EvaluateToken(Value, Expression)          
+                    if Value == None:
+                        return False
+                if Value != "":                
+                    if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
+                        Value = Value[1:-1]
             Op = TokenList[1]
             if Op not in self._OP_:
                 EdkLogger.error('Parser', FORMAT_INVALID, "Unsupported operator [%s]" % Op, File=self.MetaFile,
index 4bfa7d8ffd53cc7a2199e06a0c010df8867d21e7..ac2ca057ccdf9682ac5e51e2a2895a70ae77db84 100644 (file)
@@ -1896,7 +1896,7 @@ class InfBuildData(ModuleBuildClassObject):
     ## Retrieve PCDs used in this module\r
     def _GetPcds(self):\r
         if self._Pcds == None:\r
-            self._Pcds = {}\r
+            self._Pcds = sdict()\r
             self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))\r
             self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))\r
             self._Pcds.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))\r
@@ -1996,7 +1996,7 @@ class InfBuildData(ModuleBuildClassObject):
 \r
     ## Retrieve PCD for given type\r
     def _GetPcd(self, Type):\r
-        Pcds = {}\r
+        Pcds = sdict()\r
         PcdDict = tdict(True, 4)\r
         PcdList = []\r
         RecordList = self._RawData[Type, self._Arch, self._Platform]\r
@@ -2071,18 +2071,9 @@ class InfBuildData(ModuleBuildClassObject):
                     #\r
                     # Check hexadecimal token value length and format.\r
                     #\r
+                    ReIsValidPcdTokenValue = re.compile(r"^[0][x|X][0]*[0-9a-fA-F]{1,8}$", re.DOTALL)\r
                     if Pcd.TokenValue.startswith("0x") or Pcd.TokenValue.startswith("0X"):\r
-                        if len(Pcd.TokenValue) < 3 or len(Pcd.TokenValue) > 10:\r
-                            EdkLogger.error(\r
-                                    'build',\r
-                                    FORMAT_INVALID,\r
-                                    "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid:" % (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),\r
-                                    File =self.MetaFile, Line=LineNo,\r
-                                    ExtraData=None\r
-                                    )                          \r
-                        try:\r
-                            int (Pcd.TokenValue, 16)\r
-                        except:\r
+                        if ReIsValidPcdTokenValue.match(Pcd.TokenValue) == None:\r
                             EdkLogger.error(\r
                                     'build',\r
                                     FORMAT_INVALID,\r