summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-25 06:21:03 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-25 06:21:03 +0000
commit2bcc713e74b944bb5aefb433ef33fb4002a62d76 (patch)
tree7aa002279415c1fafbedbf287d256177746e0a4a /BaseTools/Source/C
parentc32dcd284c19bbb0b1db3606a243d9d69d37d6ab (diff)
downloadedk2-platforms-2bcc713e74b944bb5aefb433ef33fb4002a62d76.tar.xz
Sync BaseTool trunk (version r2423) into EDKII BaseTools. The change mainly includes:
1. Fix !include issues 2. Fix Trim to skip the postfix 'U' for hexadecimal and decimal numbers 3. Fix building error C2733 when building C++ code. 4. Add GCC46 tool chain definition 5. Add new RVCT and RVCTLINUX tool chains Signed-off-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12782 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r--BaseTools/Source/C/Common/FirmwareVolumeBuffer.c4
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.c4
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.h6
-rw-r--r--BaseTools/Source/C/Include/Common/BuildVersion.h2
-rw-r--r--BaseTools/Source/C/Include/Common/PiFirmwareVolume.h24
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp19
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g68
-rw-r--r--BaseTools/Source/C/VolInfo/VolInfo.c6
8 files changed, 81 insertions, 52 deletions
diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
index c8586b4078..92060e2ca1 100644
--- a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
+++ b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
@@ -553,7 +553,7 @@ Returns:
EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES FvbAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvbAttributes;
UINTN offset;
UINTN fsize;
UINTN newSize;
@@ -869,7 +869,7 @@ Returns:
EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES FvbAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvbAttributes;
UINTN fsize;
EFI_STATUS Status;
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index 45a2c8022d..684933f64d 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -84,7 +84,7 @@ CHAR8 *mFvbAlignmentName[] = {
EFI_FVB2_ALIGNMENT_64K_STRING,
EFI_FVB2_ALIGNMENT_128K_STRING,
EFI_FVB2_ALIGNMENT_256K_STRING,
- EFI_FVB2_ALIGNMNET_512K_STRING,
+ EFI_FVB2_ALIGNMENT_512K_STRING,
EFI_FVB2_ALIGNMENT_1M_STRING,
EFI_FVB2_ALIGNMENT_2M_STRING,
EFI_FVB2_ALIGNMENT_4M_STRING,
@@ -1535,7 +1535,7 @@ Returns:
//
Status = FindApResetVectorPosition (FvImage, &BytePointer);
if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "Cannot find the appropriate location in FvImage to add Ap reset vector!");
+ Error (NULL, 0, 3000, "Invalid", "FV image does not have enough space to place AP reset vector. The FV image needs to reserve at least 4KB of unused space.");
return EFI_ABORTED;
}
}
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.h b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
index 2629b9aee8..40c23600ab 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.h
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -130,7 +130,7 @@ Abstract:
#define EFI_FVB2_ALIGNMENT_64K_STRING "EFI_FVB2_ALIGNMENT_64K"
#define EFI_FVB2_ALIGNMENT_128K_STRING "EFI_FVB2_ALIGNMENT_128K"
#define EFI_FVB2_ALIGNMENT_256K_STRING "EFI_FVB2_ALIGNMENT_256K"
-#define EFI_FVB2_ALIGNMNET_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
+#define EFI_FVB2_ALIGNMENT_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
#define EFI_FVB2_ALIGNMENT_1M_STRING "EFI_FVB2_ALIGNMENT_1M"
#define EFI_FVB2_ALIGNMENT_2M_STRING "EFI_FVB2_ALIGNMENT_2M"
#define EFI_FVB2_ALIGNMENT_4M_STRING "EFI_FVB2_ALIGNMENT_4M"
@@ -226,7 +226,7 @@ typedef struct {
BOOLEAN FvNameGuidSet;
CHAR8 FvExtHeaderFile[_MAX_PATH];
UINTN Size;
- EFI_FVB_ATTRIBUTES FvAttributes;
+ EFI_FVB_ATTRIBUTES_2 FvAttributes;
CHAR8 FvName[_MAX_PATH];
EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
diff --git a/BaseTools/Source/C/Include/Common/BuildVersion.h b/BaseTools/Source/C/Include/Common/BuildVersion.h
index f19e9007d9..bbcd09a918 100644
--- a/BaseTools/Source/C/Include/Common/BuildVersion.h
+++ b/BaseTools/Source/C/Include/Common/BuildVersion.h
@@ -1,3 +1,3 @@
//This file is for build version number auto generation
//
-#define __BUILD_VERSION "Build 2396"
+#define __BUILD_VERSION "Build 2423"
diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
index fde381537f..0c8e29e1ce 100644
--- a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
+++ b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
@@ -1,7 +1,7 @@
/** @file
The firmware volume related definitions in PI.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -14,7 +14,7 @@
File Name: PiFirmwareVolume.h
@par Revision Reference:
- Version 1.0.
+ Version 1.2C
**/
@@ -33,7 +33,7 @@ typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
-typedef UINT32 EFI_FVB_ATTRIBUTES;
+typedef UINT32 EFI_FVB_ATTRIBUTES_2;
//
// Attributes bit definitions
@@ -73,7 +73,7 @@ typedef UINT32 EFI_FVB_ATTRIBUTES;
#define EFI_FVB2_ALIGNMENT_64K 0x00100000
#define EFI_FVB2_ALIGNMENT_128K 0x00110000
#define EFI_FVB2_ALIGNMENT_256K 0x00120000
-#define EFI_FVB2_ALIGNMNET_512K 0x00130000
+#define EFI_FVB2_ALIGNMENT_512K 0x00130000
#define EFI_FVB2_ALIGNMENT_1M 0x00140000
#define EFI_FVB2_ALIGNMENT_2M 0x00150000
#define EFI_FVB2_ALIGNMENT_4M 0x00160000
@@ -101,7 +101,7 @@ typedef struct {
EFI_GUID FileSystemGuid;
UINT64 FvLength;
UINT32 Signature;
- EFI_FVB_ATTRIBUTES Attributes;
+ EFI_FVB_ATTRIBUTES_2 Attributes;
UINT16 HeaderLength;
UINT16 Checksum;
UINT16 ExtHeaderOffset;
@@ -139,8 +139,20 @@ typedef struct {
// Array of GUIDs.
// Each GUID represents an OEM file type.
//
- EFI_GUID Types[1];
+ // EFI_GUID Types[1];
+ //
} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
+#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002
+typedef struct {
+ EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
+ EFI_GUID FormatType;
+
+ //
+ // An arry of bytes of length Length.
+ //
+ // UINT8 Data[1];
+ //
+} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;
#endif
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
index 94ad55b1bb..b4f9d8fd7f 100644
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
@@ -670,6 +670,25 @@ CFormPkg::DeclarePendingQuestion (
Info.mVarType = EFI_IFR_TYPE_NUM_SIZE_8;
}
CNObj.SetFlags (0, Info.mVarType);
+ //
+ // Use maximum value not to limit the vaild value for the undefined question.
+ //
+ switch (Info.mVarType) {
+ case EFI_IFR_TYPE_NUM_SIZE_64:
+ CNObj.SetMinMaxStepData ((UINT64) 0, (UINT64) -1 , (UINT64) 0);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_32:
+ CNObj.SetMinMaxStepData ((UINT32) 0, (UINT32) -1 , (UINT32) 0);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_16:
+ CNObj.SetMinMaxStepData ((UINT16) 0, (UINT16) -1 , (UINT16) 0);
+ break;
+ case EFI_IFR_TYPE_NUM_SIZE_8:
+ CNObj.SetMinMaxStepData ((UINT8) 0, (UINT8) -1 , (UINT8) 0);
+ break;
+ default:
+ break;
+ }
//
// For undefined Efi VarStore type question
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index f27f05b689..d55a80672b 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -1989,6 +1989,7 @@ vfrStatementDate :
Prompt "=" "STRING_TOKEN" "\(" DP:Number "\)" ","
Help "=" "STRING_TOKEN" "\(" DH:Number "\)" ","
minMaxDateStepDefault[Val.date, 2]
+ { G:FLAGS "=" vfrDateFlags[DObj, G->getLine()] "," }
<<
mCVfrQuestionDB.RegisterOldDateQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);
DObj.SetQuestionId (QId);
@@ -2449,6 +2450,7 @@ vfrStatementTime :
Prompt "=" "STRING_TOKEN" "\(" SP:Number "\)" ","
Help "=" "STRING_TOKEN" "\(" SH:Number "\)" ","
minMaxTimeStepDefault[Val.time, 2]
+ { G:FLAGS "=" vfrTimeFlags[TObj, G->getLine()] "," }
<<
mCVfrQuestionDB.RegisterOldTimeQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);
TObj.SetQuestionId (QId);
@@ -3216,7 +3218,7 @@ vfrExpressionBuildInFunction [UINT32 & RootLevel, UINT32 & ExpOpCount] :
| ideqvalExp[$RootLevel, $ExpOpCount]
| ideqidExp[$RootLevel, $ExpOpCount]
| ideqvallistExp[$RootLevel, $ExpOpCount]
- | questionref13Exp[$RootLevel, $ExpOpCount]
+ | questionref1Exp[$RootLevel, $ExpOpCount]
| rulerefExp[$RootLevel, $ExpOpCount]
| stringref1Exp[$RootLevel, $ExpOpCount]
| pushthisExp[$RootLevel, $ExpOpCount]
@@ -3451,50 +3453,26 @@ ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
>>
;
-questionref13Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
+questionref1Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
<<
- UINT8 Type = 0x1;
- EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
- EFI_GUID Guid = {0,};
EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
UINT32 BitMask;
CHAR8 *QName = NULL;
UINT32 LineNo = 0;
>>
L:QuestionRef
- (
- (
- << Type = 0x3; >>
- {
- Path "=" "STRING_TOKEN" "\(" S:Number "\)" << Type = 0x4; DevPath = _STOSID(S->getText()); >>
- }
- {
- Uuid "=" guidDefinition[Guid] << Type = 0x5; >>
- }
- )
- |
- (
- "\("
- (
+ "\("
+ (
QN:StringIdentifier <<
QName = QN->getText();
- LineNo = QN->getLine();
+ LineNo = QN->getLine();
mCVfrQuestionDB.GetQuestionId (QN->getText(), NULL, QId, BitMask);
>>
| ID:Number << QId = _STOQID(ID->getText()); >>
)
- "\)"
- )
- )
+ "\)"
<<
- switch (Type) {
- case 0x1: {CIfrQuestionRef1 QR1Obj(L->getLine()); _SAVE_OPHDR_COND (QR1Obj, ($ExpOpCount == 0), L->getLine()); QR1Obj.SetQuestionId (QId, QName, LineNo); break;}
- case 0x3: {CIfrQuestionRef3 QR3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3Obj, ($ExpOpCount == 0), L->getLine()); break;}
- case 0x4: {CIfrQuestionRef3_2 QR3_2Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_2Obj, ($ExpOpCount == 0), L->getLine()); QR3_2Obj.SetDevicePath (DevPath); break;}
- case 0x5: {CIfrQuestionRef3_3 QR3_3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_3Obj, ($ExpOpCount == 0), L->getLine()); QR3_3Obj.SetDevicePath (DevPath); QR3_3Obj.SetGuid (&Guid); break;}
- }
- $ExpOpCount++;
- >>
+ { CIfrQuestionRef1 QR1Obj(L->getLine()); _SAVE_OPHDR_COND (QR1Obj, ($ExpOpCount == 0), L->getLine()); QR1Obj.SetQuestionId (QId, QName, LineNo); } $ExpOpCount++; >>
;
rulerefExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
@@ -3626,7 +3604,7 @@ vfrExpressionConstant[UINT32 & RootLevel, UINT32 & ExpOpCount] :
vfrExpressionUnaryOp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
lengthExp[$RootLevel, $ExpOpCount]
| bitwisenotExp[$RootLevel, $ExpOpCount]
- | question2refExp[$RootLevel, $ExpOpCount]
+ | question23refExp[$RootLevel, $ExpOpCount]
| stringref2Exp[$RootLevel, $ExpOpCount]
| toboolExp[$RootLevel, $ExpOpCount]
| tostringExp[$RootLevel, $ExpOpCount]
@@ -3648,10 +3626,30 @@ bitwisenotExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
<< { CIfrBitWiseNot BWNObj(L->getLine()); $ExpOpCount++; } >>
;
-question2refExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
+question23refExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
+ <<
+ UINT8 Type = 0x1;
+ EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
+ EFI_GUID Guid = {0,};
+ >>
L:QuestionRefVal
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrQuestionRef2 QR2Obj(L->getLine()); $ExpOpCount++; } >>
+ "\("
+ {
+ DevicePath "=" "STRING_TOKEN" "\(" S:Number "\)" "," << Type = 0x2; DevPath = _STOSID(S->getText()); >>
+ }
+ {
+ Uuid "=" guidDefinition[Guid] "," << Type = 0x3; >>
+ }
+ vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
+ "\)"
+ <<
+ switch (Type) {
+ case 0x1: {CIfrQuestionRef2 QR2Obj(L->getLine()); _SAVE_OPHDR_COND (QR2Obj, ($ExpOpCount == 0), L->getLine()); break;}
+ case 0x2: {CIfrQuestionRef3_2 QR3_2Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_2Obj, ($ExpOpCount == 0), L->getLine()); QR3_2Obj.SetDevicePath (DevPath); break;}
+ case 0x3: {CIfrQuestionRef3_3 QR3_3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_3Obj, ($ExpOpCount == 0), L->getLine()); QR3_3Obj.SetDevicePath (DevPath); QR3_3Obj.SetGuid (&Guid); break;}
+ }
+ $ExpOpCount++;
+ >>
;
stringref2Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index f514ba8c38..7d127e1691 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -845,8 +845,8 @@ Returns:
printf (" EFI_FVB2_ALIGNMENT_256K\n");
}
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMNET_512K) {
- printf (" EFI_FVB2_ALIGNMNET_512K\n");
+ if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {
+ printf (" EFI_FVB2_ALIGNMENT_512K\n");
}
if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {