|
From: <lg...@us...> - 2010-01-29 02:56:55
|
Revision: 1826
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1826&view=rev
Author: lgao4
Date: 2010-01-29 02:56:49 +0000 (Fri, 29 Jan 2010)
Log Message:
-----------
Add check for the invalid negative PCD value setting.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-01-29 02:54:50 UTC (rev 1825)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-01-29 02:56:49 UTC (rev 1826)
@@ -968,39 +968,43 @@
else:
ValueNumber = int (Value)
if Pcd.DatumType == 'UINT64':
- if abs (ValueNumber) >= 0x10000000000000000:
+ if ValueNumber < 0:
EdkLogger.error("build", AUTOGEN_ERROR,
+ "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
+ elif ValueNumber >= 0x10000000000000000:
+ EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
- if ValueNumber < 0:
- ValueNumber = 0x10000000000000000 + ValueNumber
- Value = str (ValueNumber)
if not Value.endswith('ULL'):
Value += 'ULL'
elif Pcd.DatumType == 'UINT32':
- if abs (ValueNumber) >= 0x100000000:
+ if ValueNumber < 0:
EdkLogger.error("build", AUTOGEN_ERROR,
+ "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
+ elif ValueNumber >= 0x100000000:
+ EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
+ elif Pcd.DatumType == 'UINT16':
if ValueNumber < 0:
- ValueNumber = 0x100000000 + ValueNumber
- Value = str (ValueNumber)
- elif Pcd.DatumType == 'UINT16':
- if abs (ValueNumber) >= 0x10000:
EdkLogger.error("build", AUTOGEN_ERROR,
+ "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
+ elif ValueNumber >= 0x10000:
+ EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
+ elif Pcd.DatumType == 'UINT8':
if ValueNumber < 0:
- ValueNumber = 0x10000 + ValueNumber
- Value = str (ValueNumber)
- elif Pcd.DatumType == 'UINT8':
- if abs (ValueNumber) >= 0x100:
EdkLogger.error("build", AUTOGEN_ERROR,
+ "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
+ elif ValueNumber >= 0x100:
+ EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
- if ValueNumber < 0:
- ValueNumber = 0x100 + ValueNumber
- Value = str (ValueNumber)
if Pcd.DatumType == 'VOID*':
if Pcd.MaxDatumSize == None or Pcd.MaxDatumSize == '':
EdkLogger.error("build", AUTOGEN_ERROR,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lg...@us...> - 2010-02-01 09:21:41
|
Revision: 1830
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1830&view=rev
Author: lgao4
Date: 2010-02-01 09:21:34 +0000 (Mon, 01 Feb 2010)
Log Message:
-----------
Catch TypeError exception when do int(value)
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-01 02:35:58 UTC (rev 1829)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-01 09:21:34 UTC (rev 1830)
@@ -963,10 +963,15 @@
Unicode = False
ValueNumber = 0
if Pcd.DatumType in ['UINT64', 'UINT32', 'UINT16', 'UINT8']:
- if Value.upper().startswith('0X'):
- ValueNumber = int (Value, 16)
- else:
- ValueNumber = int (Value)
+ try:
+ if Value.upper().startswith('0X'):
+ ValueNumber = int (Value, 16)
+ else:
+ ValueNumber = int (Value)
+ except:
+ EdkLogger.error("build", AUTOGEN_ERROR,
+ "PCD value is not valid dec or hex number for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
if Pcd.DatumType == 'UINT64':
if ValueNumber < 0:
EdkLogger.error("build", AUTOGEN_ERROR,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qh...@us...> - 2010-02-08 06:05:33
|
Revision: 1850
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1850&view=rev
Author: qhuang8
Date: 2010-02-08 06:05:26 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
Remove spec macro definitions in AutoGen.h for EDKII native modules as these macros should not be used in EDKII native source code.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-08 05:50:15 UTC (rev 1849)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-08 06:05:26 UTC (rev 1850)
@@ -1,7 +1,7 @@
## @file
# Routines for generating AutoGen.h and AutoGen.c
#
-# Copyright (c) 2007, Intel Corporation
+# Copyright (c) 2007 - 2010, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -876,13 +876,6 @@
"""),
}
-gSpecificationString = TemplateString("""
-${BEGIN}
-#undef ${SpecificationName}
-#define ${SpecificationName} ${SpecificationValue}
-${END}
-""")
-
gBasicHeaderFile = "Base.h"
gModuleTypeHeaderFile = {
@@ -1899,9 +1892,6 @@
# header file Prologue
AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Guid':Info.Guid.replace('-','_')}))
if Info.AutoGenVersion >= 0x00010005:
- # specification macros
- AutoGenH.Append(gSpecificationString.Replace({'SpecificationName':Info.Specification.keys(),
- 'SpecificationValue':Info.Specification.values()}))
# header files includes
AutoGenH.Append("#include <%s>\n" % gBasicHeaderFile)
if Info.ModuleType in gModuleTypeHeaderFile \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qh...@us...> - 2010-02-11 05:26:31
|
Revision: 1862
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1862&view=rev
Author: qhuang8
Date: 2010-02-11 05:26:23 +0000 (Thu, 11 Feb 2010)
Log Message:
-----------
Minor update AutoGen.c template to avoid global variable initialization:
static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;
This statement might fail EBC compiler
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-10 11:59:18 UTC (rev 1861)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-11 05:26:23 UTC (rev 1862)
@@ -501,7 +501,7 @@
const UINT32 _gDxeRevision = ${PiSpecVersion};
static BASE_LIBRARY_JUMP_BUFFER mJumpContext;
-static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;
+static EFI_STATUS mDriverEntryPointStatus;
VOID
EFIAPI
@@ -522,8 +522,9 @@
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
+{
+ mDriverEntryPointStatus = EFI_LOAD_ERROR;
-{
${BEGIN}
if (SetJump (&mJumpContext) == 0) {
ExitDriver (${Function} (ImageHandle, SystemTable));
@@ -595,14 +596,17 @@
const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
const UINT32 _gDxeRevision = ${PiSpecVersion};
+static BASE_LIBRARY_JUMP_BUFFER mJumpContext;
+static EFI_STATUS mDriverEntryPointStatus;
+
EFI_STATUS
EFIAPI
ProcessModuleEntryPointList (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
-
{
+ mDriverEntryPointStatus = EFI_LOAD_ERROR;
${BEGIN}
if (SetJump (&mJumpContext) == 0) {
ExitDriver (${Function} (ImageHandle, SystemTable));
@@ -612,9 +616,6 @@
return mDriverEntryPointStatus;
}
-static BASE_LIBRARY_JUMP_BUFFER mJumpContext;
-static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;
-
VOID
EFIAPI
ExitDriver (
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kl...@us...> - 2010-02-11 08:21:10
|
Revision: 1865
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1865&view=rev
Author: klu2
Date: 2010-02-11 08:21:03 +0000 (Thu, 11 Feb 2010)
Log Message:
-----------
Support HII VOID* dynamic/dynamicEx type PCD.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-11 06:36:15 UTC (rev 1864)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-02-11 08:21:03 UTC (rev 1865)
@@ -162,7 +162,7 @@
GUID GuidTable[${PHASE}_GUID_TABLE_SIZE];
${BEGIN} STRING_HEAD ${STRING_HEAD_CNAME_DECL}_${STRING_HEAD_GUID_DECL}[${STRING_HEAD_NUMSKUS_DECL}];
${END}
-${BEGIN} VARIABLE_HEAD ${VARIABLE_HEAD_CNAME_DECL}_${VARIABLE_HEAD_GUID_DECL}[${VARIABLE_HEAD_NUMSKUS_DECL}];
+${BEGIN} VARIABLE_HEAD ${VARIABLE_HEAD_CNAME_DECL}_${VARIABLE_HEAD_GUID_DECL}_Variable_Header[${VARIABLE_HEAD_NUMSKUS_DECL}];
${END}
${BEGIN} UINT8 StringTable${STRING_TABLE_INDEX}[${STRING_TABLE_LENGTH}]; /* ${STRING_TABLE_CNAME}_${STRING_TABLE_GUID} */
${END}
@@ -253,7 +253,7 @@
},
/* LocalTokenNumberTable */
{
-${BEGIN} offsetof(${PHASE}_PCD_DATABASE, ${TOKEN_INIT}.${TOKEN_CNAME}_${TOKEN_GUID}) | ${TOKEN_TYPE},
+${BEGIN} offsetof(${PHASE}_PCD_DATABASE, ${TOKEN_INIT}.${TOKEN_CNAME}_${TOKEN_GUID}${VARDEF_HEADER}) | ${TOKEN_TYPE},
${END}
},
/* GuidTable */
@@ -263,7 +263,7 @@
},
${BEGIN} { ${STRING_HEAD_VALUE} }, /* ${STRING_HEAD_CNAME_DECL}_${STRING_HEAD_GUID_DECL}[${STRING_HEAD_NUMSKUS_DECL}] */
${END}
-${BEGIN} /* ${VARIABLE_HEAD_CNAME_DECL}_${VARIABLE_HEAD_GUID_DECL}[${VARIABLE_HEAD_NUMSKUS_DECL}] */
+${BEGIN} /* ${VARIABLE_HEAD_CNAME_DECL}_${VARIABLE_HEAD_GUID_DECL}_Variable_Header[${VARIABLE_HEAD_NUMSKUS_DECL}] */
{
${VARIABLE_HEAD_VALUE}
},
@@ -953,7 +953,7 @@
Const = ''
Type = ''
Array = ''
- Value = Pcd.DefaultValue
+ Value = Pcd.DefaultValue
Unicode = False
ValueNumber = 0
if Pcd.DatumType in ['UINT64', 'UINT32', 'UINT16', 'UINT8']:
@@ -1013,7 +1013,7 @@
ArraySize = int(Pcd.MaxDatumSize, 0)
if Value[0] == '{':
Type = '(VOID *)'
- else:
+ else:
if Value[0] == 'L':
Unicode = True
Value = Value.lstrip('L') #.strip('"')
@@ -1021,15 +1021,15 @@
NewValue = '{'
for Index in range(0,len(Value)):
if Unicode:
- NewValue = NewValue + str(ord(Value[Index]) % 0x10000) + ', '
- else:
+ NewValue = NewValue + str(ord(Value[Index]) % 0x10000) + ', '
+ else:
NewValue = NewValue + str(ord(Value[Index]) % 0x100) + ', '
- if Unicode:
- ArraySize = ArraySize / 2;
-
+ if Unicode:
+ ArraySize = ArraySize / 2;
+
if ArraySize < (len(Value) + 1):
ArraySize = len(Value) + 1
- Value = NewValue + '0 }'
+ Value = NewValue + '0 }'
Array = '[%d]' % ArraySize
#
# skip casting for fixed at build since it breaks ARM assembly.
@@ -1043,16 +1043,16 @@
else:
PcdValueName = '_PCD_VALUE_' + Pcd.TokenCName
- if Pcd.DatumType == 'VOID*':
- #
- # For unicode, UINT16 array will be generated, so the alignment of unicode is guaranteed.
- #
- if Unicode:
- AutoGenH.Append('#define _PCD_PATCHABLE_%s_SIZE %s\n' % (Pcd.TokenCName, Pcd.MaxDatumSize))
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))
- AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
+ if Pcd.DatumType == 'VOID*':
+ #
+ # For unicode, UINT16 array will be generated, so the alignment of unicode is guaranteed.
+ #
+ if Unicode:
+ AutoGenH.Append('#define _PCD_PATCHABLE_%s_SIZE %s\n' % (Pcd.TokenCName, Pcd.MaxDatumSize))
+ AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))
+ AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVariableName, Array))
+ AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
else:
AutoGenH.Append('#define _PCD_PATCHABLE_%s_SIZE %s\n' % (Pcd.TokenCName, Pcd.MaxDatumSize))
AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
@@ -1179,7 +1179,7 @@
'SYSTEM_SKU_ID_VALUE' : '0'
}
- for DatumType in ['UINT64','UINT32','UINT16','UINT8','BOOLEAN']:
+ for DatumType in ['UINT64','UINT32','UINT16','UINT8','BOOLEAN', "VOID*"]:
Dict['VARDEF_CNAME_' + DatumType] = []
Dict['VARDEF_GUID_' + DatumType] = []
Dict['VARDEF_SKUID_' + DatumType] = []
@@ -1214,7 +1214,7 @@
Dict['GUID_STRUCTURE'] = []
Dict['SKUID_VALUE'] = []
-
+ Dict['VARDEF_HEADER'] = []
if Phase == 'DXE':
Dict['SYSTEM_SKU_ID'] = ''
Dict['SYSTEM_SKU_ID_VALUE'] = ''
@@ -1263,7 +1263,7 @@
Pcd.InitString = 'UNINIT'
if Pcd.DatumType == 'VOID*':
- Pcd.TokenTypeList = ['PCD_DATUM_TYPE_POINTER']
+ Pcd.TokenTypeList = ['PCD_TYPE_STRING']
elif Pcd.DatumType == 'BOOLEAN':
Pcd.TokenTypeList = ['PCD_DATUM_TYPE_UINT8']
else:
@@ -1310,53 +1310,65 @@
Dict['GUID_STRUCTURE'].append(VariableGuidStructure)
VariableHeadGuidIndex = GuidList.index(VariableGuid)
- VariableHeadValueList.append('%d, %d, %s, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s)' %
- (VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
- Phase, CName, TokenSpaceGuid, SkuIdIndex))
+ if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
+ VariableHeadValueList.append('%d, %d, %s, offsetof(%s_PCD_DATABASE, Init.%s_%s)' %
+ (VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
+ Phase, CName, TokenSpaceGuid))
+ else:
+ VariableHeadValueList.append('%d, %d, %s, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s)' %
+ (VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
+ Phase, CName, TokenSpaceGuid, SkuIdIndex))
Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName)
Dict['VARDEF_GUID_'+Pcd.DatumType].append(TokenSpaceGuid)
Dict['VARDEF_SKUID_'+Pcd.DatumType].append(SkuIdIndex)
- Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue)
+ if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
+ Dict['VARDEF_VALUE_' + Pcd.DatumType].append("%s_%s[%d]" % (Pcd.TokenCName, TokenSpaceGuid, SkuIdIndex))
+ else:
+ Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue)
elif Sku.VpdOffset != '':
Pcd.TokenTypeList += ['PCD_TYPE_VPD']
Pcd.InitString = 'INIT'
VpdHeadOffsetList.append(Sku.VpdOffset)
- else:
- if Pcd.DatumType == 'VOID*':
- Pcd.TokenTypeList += ['PCD_TYPE_STRING']
- Pcd.InitString = 'INIT'
- if Sku.DefaultValue != '':
- NumberOfSizeItems += 1
- Dict['STRING_TABLE_CNAME'].append(CName)
- Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)
+
+
+ if Pcd.DatumType == 'VOID*':
+ Pcd.TokenTypeList += ['PCD_TYPE_STRING']
+ Pcd.InitString = 'INIT'
+ if Sku.HiiDefaultValue != '' and Sku.DefaultValue == '':
+ Sku.DefaultValue = Sku.HiiDefaultValue
+ if Sku.DefaultValue != '':
+ NumberOfSizeItems += 1
+ Dict['STRING_TABLE_CNAME'].append(CName)
+ Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)
- if StringTableIndex == 0:
- Dict['STRING_TABLE_INDEX'].append('')
- else:
- Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
- if Sku.DefaultValue[0] == 'L':
- Size = (len(Sku.DefaultValue) - 3 + 1) * 2
- Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
- elif Sku.DefaultValue[0] == '"':
- Size = len(Sku.DefaultValue) - 2 + 1
- Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
- elif Sku.DefaultValue[0] == '{':
- Size = len(Sku.DefaultValue.replace(',',' ').split())
- Dict['STRING_TABLE_VALUE'].append(Sku.DefaultValue)
+ if StringTableIndex == 0:
+ Dict['STRING_TABLE_INDEX'].append('')
+ else:
+ Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
+ if Sku.DefaultValue[0] == 'L':
+ Size = (len(Sku.DefaultValue) - 3 + 1) * 2
+ Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
+ elif Sku.DefaultValue[0] == '"':
+ Size = len(Sku.DefaultValue) - 2 + 1
+ Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
+ elif Sku.DefaultValue[0] == '{':
+ Size = len(Sku.DefaultValue.replace(',',' ').split())
+ Dict['STRING_TABLE_VALUE'].append(Sku.DefaultValue)
- StringHeadOffsetList.append(str(StringTableSize))
- Dict['SIZE_TABLE_CNAME'].append(CName)
- Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append(Size)
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(Pcd.MaxDatumSize)
- if Pcd.MaxDatumSize != '':
- MaxDatumSize = int(Pcd.MaxDatumSize, 0)
- if MaxDatumSize > Size:
- Size = MaxDatumSize
- Dict['STRING_TABLE_LENGTH'].append(Size)
- StringTableIndex += 1
- StringTableSize += (Size)
- else:
+ StringHeadOffsetList.append(str(StringTableSize))
+ Dict['SIZE_TABLE_CNAME'].append(CName)
+ Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
+ Dict['SIZE_TABLE_CURRENT_LENGTH'].append(Size)
+ Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(Pcd.MaxDatumSize)
+ if Pcd.MaxDatumSize != '':
+ MaxDatumSize = int(Pcd.MaxDatumSize, 0)
+ if MaxDatumSize > Size:
+ Size = MaxDatumSize
+ Dict['STRING_TABLE_LENGTH'].append(Size)
+ StringTableIndex += 1
+ StringTableSize += (Size)
+ else:
+ if "PCD_TYPE_HII" not in Pcd.TokenTypeList:
Pcd.TokenTypeList += ['PCD_TYPE_DATA']
if Sku.DefaultValue == 'TRUE':
Pcd.InitString = 'INIT'
@@ -1366,23 +1378,27 @@
Pcd.InitString = 'INIT'
except:
pass
-
- #
- # For UNIT64 type PCD's value, ULL should be append to avoid
- # warning under linux building environment.
- #
- if Pcd.DatumType == "UINT64":
- ValueList.append(Sku.DefaultValue + "ULL")
- else:
- ValueList.append(Sku.DefaultValue)
+
+ #
+ # For UNIT64 type PCD's value, ULL should be append to avoid
+ # warning under linux building environment.
+ #
+ if Pcd.DatumType == "UINT64":
+ ValueList.append(Sku.DefaultValue + "ULL")
+ else:
+ ValueList.append(Sku.DefaultValue)
Pcd.TokenTypeList = list(set(Pcd.TokenTypeList))
+
if 'PCD_TYPE_HII' in Pcd.TokenTypeList:
Dict['VARIABLE_HEAD_CNAME_DECL'].append(CName)
Dict['VARIABLE_HEAD_GUID_DECL'].append(TokenSpaceGuid)
Dict['VARIABLE_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))
Dict['VARIABLE_HEAD_VALUE'].append('{ %s }\n' % ' },\n { '.join(VariableHeadValueList))
+ Dict['VARDEF_HEADER'].append('_Variable_Header')
+ else:
+ Dict['VARDEF_HEADER'].append('')
if 'PCD_TYPE_VPD' in Pcd.TokenTypeList:
Dict['VPD_HEAD_CNAME_DECL'].append(CName)
Dict['VPD_HEAD_GUID_DECL'].append(TokenSpaceGuid)
@@ -1411,7 +1427,7 @@
Dict['TOKEN_CNAME'] = ['' for x in range(NumberOfLocalTokens)]
Dict['TOKEN_GUID'] = ['' for x in range(NumberOfLocalTokens)]
Dict['TOKEN_TYPE'] = ['' for x in range(NumberOfLocalTokens)]
-
+
for Pcd in Platform.DynamicPcdList:
CName = Pcd.TokenCName
TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kl...@us...> - 2010-05-20 02:21:46
|
Revision: 1973
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1973&view=rev
Author: klu2
Date: 2010-05-20 02:21:40 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Fix the bug that autogen will generate duplicate fields for PCD database if VPD is used.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-05-18 10:02:37 UTC (rev 1972)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-05-20 02:21:40 UTC (rev 1973)
@@ -1227,7 +1227,7 @@
NumberOfExTokens = 0
NumberOfSizeItems = 0
GuidList = []
-
+
for Pcd in Platform.DynamicPcdList:
CName = Pcd.TokenCName
TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
@@ -1329,7 +1329,7 @@
Pcd.TokenTypeList += ['PCD_TYPE_VPD']
Pcd.InitString = 'INIT'
VpdHeadOffsetList.append(Sku.VpdOffset)
-
+ continue
if Pcd.DatumType == 'VOID*':
Pcd.TokenTypeList += ['PCD_TYPE_STRING']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kl...@us...> - 2010-05-25 02:15:30
|
Revision: 1975
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=1975&view=rev
Author: klu2
Date: 2010-05-25 02:15:24 +0000 (Tue, 25 May 2010)
Log Message:
-----------
Fix autogen bugs for VPD VOID* type PCD.
The root cause is VOID* type PCD is a special PCD and need generate STRING_HEADER and data array in PCD database, so build tool will treat PCD_TYPE_STRING as a PCD type same as PCD_TYPE_DYNAMIC, PCD_TYPE_VPD, etc.
But for VPD?\226?\128?\153s pcd, the default value is no need to be generated in Pcd database, so build tool should skip string operation for VPD type PCD.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-05-25 01:39:37 UTC (rev 1974)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-05-25 02:15:24 UTC (rev 1975)
@@ -1262,7 +1262,9 @@
VariableHeadValueList = []
Pcd.InitString = 'UNINIT'
- if Pcd.DatumType == 'VOID*':
+ if Pcd.Type in ["DynamicVpd", "DynamicExVpd"]:
+ Pcd.TokenTypeList = ['PCD_TYPE_VPD']
+ elif Pcd.DatumType == 'VOID*':
Pcd.TokenTypeList = ['PCD_TYPE_STRING']
elif Pcd.DatumType == 'BOOLEAN':
Pcd.TokenTypeList = ['PCD_DATUM_TYPE_UINT8']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <qh...@us...> - 2010-08-31 00:40:39
|
Revision: 2031
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2031&view=rev
Author: qhuang8
Date: 2010-08-31 00:40:33 +0000 (Tue, 31 Aug 2010)
Log Message:
-----------
Enhance build tools to check the maximum size of VOID* typed PCD. If the maximum size is specified but is less than the actual size, build will break instead of adjust the maximum size implicitly.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-08-30 02:00:29 UTC (rev 2030)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-08-31 00:40:33 UTC (rev 2031)
@@ -1028,7 +1028,9 @@
ArraySize = ArraySize / 2;
if ArraySize < (len(Value) + 1):
- ArraySize = len(Value) + 1
+ EdkLogger.error("build", AUTOGEN_ERROR,
+ "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
Value = NewValue + '0 }'
Array = '[%d]' % ArraySize
#
@@ -1365,8 +1367,11 @@
Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(Pcd.MaxDatumSize)
if Pcd.MaxDatumSize != '':
MaxDatumSize = int(Pcd.MaxDatumSize, 0)
- if MaxDatumSize > Size:
- Size = MaxDatumSize
+ if MaxDatumSize < Size:
+ EdkLogger.error("build", AUTOGEN_ERROR,
+ "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Platform))
+ Size = MaxDatumSize
Dict['STRING_TABLE_LENGTH'].append(Size)
StringTableIndex += 1
StringTableSize += (Size)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-09-09 02:32:46
|
Revision: 2303
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2303&view=rev
Author: jsu1
Date: 2011-09-09 02:32:40 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
Enhance build tool to also check [Pcd] section to include <Library/PcdLib.h> in AutoGen.h.
Signed-off-by: jsu1
Reviewed-by: gikidy
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-09-08 07:45:17 UTC (rev 2302)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-09-09 02:32:40 UTC (rev 2303)
@@ -1959,7 +1959,11 @@
if Info.ModuleType in gModuleTypeHeaderFile \
and gModuleTypeHeaderFile[Info.ModuleType][0] != gBasicHeaderFile:
AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.ModuleType][0])
- if 'PcdLib' in Info.Module.LibraryClasses:
+ #
+ # if either PcdLib in [LibraryClasses] sections or there exist Pcd section, add PcdLib.h
+ # As if modules only uses FixedPcd, then PcdLib is not needed in [LibraryClasses] section.
+ #
+ if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds:
AutoGenH.Append("#include <Library/PcdLib.h>\n")
AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;\n\n')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-09-16 01:21:13
|
Revision: 2317
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2317&view=rev
Author: gikidy
Date: 2011-09-16 01:21:06 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
Update PCD types definition to avoid build warnings.
Signed-off-by: gikidy
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-09-15 08:45:16 UTC (rev 2316)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-09-16 01:21:06 UTC (rev 2317)
@@ -67,21 +67,21 @@
#define PCD_TYPE_SHIFT 28
-#define PCD_TYPE_DATA (0x0 << PCD_TYPE_SHIFT)
-#define PCD_TYPE_HII (0x8 << PCD_TYPE_SHIFT)
-#define PCD_TYPE_VPD (0x4 << PCD_TYPE_SHIFT)
-#define PCD_TYPE_SKU_ENABLED (0x2 << PCD_TYPE_SHIFT)
-#define PCD_TYPE_STRING (0x1 << PCD_TYPE_SHIFT)
+#define PCD_TYPE_DATA (0x0U << PCD_TYPE_SHIFT)
+#define PCD_TYPE_HII (0x8U << PCD_TYPE_SHIFT)
+#define PCD_TYPE_VPD (0x4U << PCD_TYPE_SHIFT)
+#define PCD_TYPE_SKU_ENABLED (0x2U << PCD_TYPE_SHIFT)
+#define PCD_TYPE_STRING (0x1U << PCD_TYPE_SHIFT)
#define PCD_TYPE_ALL_SET (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING)
#define PCD_DATUM_TYPE_SHIFT 24
-#define PCD_DATUM_TYPE_POINTER (0x0 << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT8 (0x1 << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT16 (0x2 << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT32 (0x4 << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT64 (0x8 << PCD_DATUM_TYPE_SHIFT)
+#define PCD_DATUM_TYPE_POINTER (0x0U << PCD_DATUM_TYPE_SHIFT)
+#define PCD_DATUM_TYPE_UINT8 (0x1U << PCD_DATUM_TYPE_SHIFT)
+#define PCD_DATUM_TYPE_UINT16 (0x2U << PCD_DATUM_TYPE_SHIFT)
+#define PCD_DATUM_TYPE_UINT32 (0x4U << PCD_DATUM_TYPE_SHIFT)
+#define PCD_DATUM_TYPE_UINT64 (0x8U << PCD_DATUM_TYPE_SHIFT)
#define PCD_DATUM_TYPE_ALL_SET (PCD_DATUM_TYPE_POINTER | \\
PCD_DATUM_TYPE_UINT8 | \\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-03 05:27:48
|
Revision: 2391
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2391&view=rev
Author: jsu1
Date: 2011-11-03 05:27:42 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
Add ?\226?\128?\152U?\226?\128?\153 to AutoGen generated files for decimal numbers
Reviewed-by: lhauch
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-01 09:39:15 UTC (rev 2390)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-03 05:27:42 UTC (rev 2391)
@@ -917,7 +917,7 @@
"No generated token number for %s.%s\n" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
TokenNumber = PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName]
- AutoGenH.Append('\n#define %s %d\n' % (PcdTokenName, TokenNumber))
+ AutoGenH.Append('\n#define %s %dU\n' % (PcdTokenName, TokenNumber))
EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " + Pcd.TokenCName + "." + Pcd.TokenSpaceGuidCName)
if Pcd.Type not in gItemTypeStringDatabase:
@@ -960,9 +960,9 @@
if Pcd.DatumType == 'BOOLEAN':
BoolValue = Value.upper()
if BoolValue == 'TRUE':
- Value = 1
+ Value = '1U'
elif BoolValue == 'FALSE':
- Value = 0
+ Value = '0U'
if Pcd.DatumType in ['UINT64', 'UINT32', 'UINT16', 'UINT8']:
try:
@@ -994,6 +994,8 @@
EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
+ if not Value.endswith('U'):
+ Value += 'U'
elif Pcd.DatumType == 'UINT16':
if ValueNumber < 0:
EdkLogger.error("build", AUTOGEN_ERROR,
@@ -1003,6 +1005,8 @@
EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
+ if not Value.endswith('U'):
+ Value += 'U'
elif Pcd.DatumType == 'UINT8':
if ValueNumber < 0:
EdkLogger.error("build", AUTOGEN_ERROR,
@@ -1012,6 +1016,8 @@
EdkLogger.error("build", AUTOGEN_ERROR,
"Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
ExtraData="[%s]" % str(Info))
+ if not Value.endswith('U'):
+ Value += 'U'
if Pcd.DatumType == 'VOID*':
if Pcd.MaxDatumSize == None or Pcd.MaxDatumSize == '':
EdkLogger.error("build", AUTOGEN_ERROR,
@@ -1131,7 +1137,7 @@
Type = '(VOID *)'
Array = '[]'
- AutoGenH.Append('#define _PCD_TOKEN_%s %d\n' % (TokenCName, TokenNumber))
+ AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' % (TokenCName, TokenNumber))
PcdItemType = Pcd.Type
#if PcdItemType in gDynamicPcd:
@@ -1405,6 +1411,8 @@
#
if Pcd.DatumType == "UINT64":
ValueList.append(Sku.DefaultValue + "ULL")
+ elif Pcd.DatumType in ("UINT32", "UINT16", "UINT8"):
+ ValueList.append(Sku.DefaultValue + "U")
else:
ValueList.append(Sku.DefaultValue)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-04 01:09:40
|
Revision: 2393
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2393&view=rev
Author: jsu1
Date: 2011-11-04 01:09:33 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
Update GenC.py to allow using C++ for some code
Reviewed-by: gikidy
Reviewed-by: lhauch
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-04 00:47:35 UTC (rev 2392)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-04 01:09:33 UTC (rev 2393)
@@ -310,10 +310,19 @@
#ifndef _${File}_${Guid}
#define _${File}_${Guid}
+#ifdef __cplusplus
+extern "C" {
+#endif
+
""")
gAutoGenHEpilogueString = """
+
+#ifdef __cplusplus
+}
#endif
+
+#endif
"""
## PEI Core Entry Point Templates
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-15 07:06:25
|
Revision: 2404
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2404&view=rev
Author: jsu1
Date: 2011-11-15 07:06:19 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
Add closing c plus plus conditional clause to StrDefs.h file
Reviewed-by: gikidy
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-09 07:45:29 UTC (rev 2403)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-15 07:06:19 UTC (rev 2404)
@@ -2042,6 +2042,7 @@
StringH.Append(gAutoGenHeaderString.Replace({'FileName':FileName}))
StringH.Append(gAutoGenHPrologueString.Replace({'File':'STRDEFS', 'Guid':Info.Guid.replace('-','_')}))
CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, UniGenBinBuffer)
+ StringH.Append("\n#ifdef __cplusplus\n}\n#endif\n")
StringH.Append("\n#endif\n")
AutoGenH.Append('#include "%s"\n' % FileName)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-15 08:28:05
|
Revision: 2406
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2406&view=rev
Author: jsu1
Date: 2011-11-15 08:27:59 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
remove CPP conditional clause from StrDefs.h file as these files do not include function declarations
Reviewed-by: lgao4
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-15 07:21:21 UTC (rev 2405)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-15 08:27:59 UTC (rev 2406)
@@ -310,11 +310,14 @@
#ifndef _${File}_${Guid}
#define _${File}_${Guid}
+""")
+
+gAutoGenHCppPrologueString = """
#ifdef __cplusplus
extern "C" {
#endif
-""")
+"""
gAutoGenHEpilogueString = """
@@ -1970,6 +1973,7 @@
AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'}))
# header file Prologue
AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Guid':Info.Guid.replace('-','_')}))
+ AutoGenH.Append(gAutoGenHCppPrologueString)
if Info.AutoGenVersion >= 0x00010005:
# header files includes
AutoGenH.Append("#include <%s>\n" % gBasicHeaderFile)
@@ -2042,7 +2046,6 @@
StringH.Append(gAutoGenHeaderString.Replace({'FileName':FileName}))
StringH.Append(gAutoGenHPrologueString.Replace({'File':'STRDEFS', 'Guid':Info.Guid.replace('-','_')}))
CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, UniGenBinBuffer)
- StringH.Append("\n#ifdef __cplusplus\n}\n#endif\n")
StringH.Append("\n#endif\n")
AutoGenH.Append('#include "%s"\n' % FileName)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-24 06:17:05
|
Revision: 2429
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2429&view=rev
Author: jsu1
Date: 2011-11-24 06:16:59 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
Remove one extra empty line generated for autogen.h
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-24 02:51:37 UTC (rev 2428)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-24 06:16:59 UTC (rev 2429)
@@ -312,7 +312,7 @@
""")
-gAutoGenHCppPrologueString = """
+gAutoGenHCppPrologueString = """\
#ifdef __cplusplus
extern "C" {
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-11-28 08:28:22
|
Revision: 2438
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2438&view=rev
Author: jsu1
Date: 2011-11-28 08:28:12 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
Update autogen.c to add ?\226?\128?\152U?\226?\128?\153 postfix to the PcdDatabase datastructure.
Reviewed-by: gikidy
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-28 05:57:22 UTC (rev 2437)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-11-28 08:28:12 UTC (rev 2438)
@@ -1193,14 +1193,14 @@
Dict = {
'PHASE' : Phase,
- 'GUID_TABLE_SIZE' : '1',
- 'STRING_TABLE_SIZE' : '1',
- 'SKUID_TABLE_SIZE' : '1',
- 'LOCAL_TOKEN_NUMBER_TABLE_SIZE' : '1',
- 'LOCAL_TOKEN_NUMBER' : '0',
- 'EXMAPPING_TABLE_SIZE' : '1',
- 'EX_TOKEN_NUMBER' : '0',
- 'SIZE_TABLE_SIZE' : '2',
+ 'GUID_TABLE_SIZE' : '1U',
+ 'STRING_TABLE_SIZE' : '1U',
+ 'SKUID_TABLE_SIZE' : '1U',
+ 'LOCAL_TOKEN_NUMBER_TABLE_SIZE' : '1U',
+ 'LOCAL_TOKEN_NUMBER' : '0U',
+ 'EXMAPPING_TABLE_SIZE' : '1U',
+ 'EX_TOKEN_NUMBER' : '0U',
+ 'SIZE_TABLE_SIZE' : '2U',
'GUID_TABLE_EMPTY' : 'TRUE',
'STRING_TABLE_EMPTY' : 'TRUE',
'SKUID_TABLE_EMPTY' : 'TRUE',
@@ -1208,7 +1208,7 @@
'EXMAP_TABLE_EMPTY' : 'TRUE',
'PCD_DATABASE_UNINIT_EMPTY' : ' UINT8 dummy; /* PCD_DATABASE_UNINIT is emptry */',
'SYSTEM_SKU_ID' : ' SKU_ID SystemSkuId;',
- 'SYSTEM_SKU_ID_VALUE' : '0'
+ 'SYSTEM_SKU_ID_VALUE' : '0U'
}
for DatumType in ['UINT64','UINT32','UINT16','UINT8','BOOLEAN', "VOID*"]:
@@ -1313,10 +1313,10 @@
if SkuId == None or SkuId == '':
continue
- if SkuId not in Dict['SKUID_VALUE']:
- Dict['SKUID_VALUE'].append(SkuId)
+ if (SkuId + 'U') not in Dict['SKUID_VALUE']:
+ Dict['SKUID_VALUE'].append(SkuId + 'U')
- SkuIdIndex = Dict['SKUID_VALUE'].index(SkuId)
+ SkuIdIndex = Dict['SKUID_VALUE'].index(SkuId + 'U')
if len(Sku.VariableName) > 0:
Pcd.TokenTypeList += ['PCD_TYPE_HII']
Pcd.InitString = 'INIT'
@@ -1346,11 +1346,11 @@
VariableHeadGuidIndex = GuidList.index(VariableGuid)
if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
- VariableHeadValueList.append('%d, %d, %s, offsetof(%s_PCD_DATABASE, Init.%s_%s)' %
+ VariableHeadValueList.append('%dU, %dU, %sU, offsetof(%s_PCD_DATABASE, Init.%s_%s)' %
(VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
Phase, CName, TokenSpaceGuid))
else:
- VariableHeadValueList.append('%d, %d, %s, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s)' %
+ VariableHeadValueList.append('%dU, %dU, %sU, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s)' %
(VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
Phase, CName, TokenSpaceGuid, SkuIdIndex))
Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName)
@@ -1359,11 +1359,24 @@
if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
Dict['VARDEF_VALUE_' + Pcd.DatumType].append("%s_%s[%d]" % (Pcd.TokenCName, TokenSpaceGuid, SkuIdIndex))
else:
- Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue)
+ #
+ # ULL (for UINT64) or U(other integer type) should be append to avoid
+ # warning under linux building environment.
+ #
+ if Pcd.DatumType == "UINT64":
+ Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "ULL")
+ elif Pcd.DatumType in ("UINT32", "UINT16", "UINT8"):
+ Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "U")
+ elif Pcd.DatumType == "BOOLEAN":
+ if Sku.HiiDefaultValue in ["1", "0"]:
+ Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "U")
+ else:
+ Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue)
+
elif Sku.VpdOffset != '':
Pcd.TokenTypeList += ['PCD_TYPE_VPD']
Pcd.InitString = 'INIT'
- VpdHeadOffsetList.append(Sku.VpdOffset)
+ VpdHeadOffsetList.append(str(Sku.VpdOffset) + 'U')
continue
if Pcd.DatumType == 'VOID*':
@@ -1390,11 +1403,11 @@
Size = len(Sku.DefaultValue.replace(',',' ').split())
Dict['STRING_TABLE_VALUE'].append(Sku.DefaultValue)
- StringHeadOffsetList.append(str(StringTableSize))
+ StringHeadOffsetList.append(str(StringTableSize) + 'U')
Dict['SIZE_TABLE_CNAME'].append(CName)
Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append(Size)
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(Pcd.MaxDatumSize)
+ Dict['SIZE_TABLE_CURRENT_LENGTH'].append(str(Size) + 'U')
+ Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U')
if Pcd.MaxDatumSize != '':
MaxDatumSize = int(Pcd.MaxDatumSize, 0)
if MaxDatumSize < Size:
@@ -1425,6 +1438,9 @@
ValueList.append(Sku.DefaultValue + "ULL")
elif Pcd.DatumType in ("UINT32", "UINT16", "UINT8"):
ValueList.append(Sku.DefaultValue + "U")
+ elif Pcd.DatumType == "BOOLEAN":
+ if Sku.DefaultValue in ["1", "0"]:
+ ValueList.append(Sku.DefaultValue + "U")
else:
ValueList.append(Sku.DefaultValue)
@@ -1490,7 +1506,7 @@
Dict['TOKEN_GUID'][GeneratedTokenNumber] = TokenSpaceGuid
Dict['TOKEN_TYPE'][GeneratedTokenNumber] = ' | '.join(Pcd.TokenTypeList)
if Pcd.Type in gDynamicExPcd:
- Dict['EXMAPPING_TABLE_EXTOKEN'].append(Pcd.TokenValue)
+ Dict['EXMAPPING_TABLE_EXTOKEN'].append(str(Pcd.TokenValue) + 'U')
if Phase == 'DXE':
GeneratedTokenNumber += NumberOfPeiLocalTokens
#
@@ -1502,12 +1518,12 @@
# Therefore, 1 is added to GeneratedTokenNumber to generate a PCD Token Number before being inserted
# to the EXMAPPING_TABLE.
#
- Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(GeneratedTokenNumber + 1)
- Dict['EXMAPPING_TABLE_GUID_INDEX'].append(GuidList.index(TokenSpaceGuid))
+ Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(str(GeneratedTokenNumber + 1) + 'U')
+ Dict['EXMAPPING_TABLE_GUID_INDEX'].append(str(GuidList.index(TokenSpaceGuid)) + 'U')
if GuidList != []:
Dict['GUID_TABLE_EMPTY'] = 'FALSE'
- Dict['GUID_TABLE_SIZE'] = len(GuidList)
+ Dict['GUID_TABLE_SIZE'] = str(len(GuidList)) + 'U'
else:
Dict['GUID_STRUCTURE'] = [GuidStringToGuidStructureString('00000000-0000-0000-0000-000000000000')]
@@ -1519,13 +1535,13 @@
Dict['STRING_TABLE_VALUE'].append('{ 0 }')
else:
Dict['STRING_TABLE_EMPTY'] = 'FALSE'
- Dict['STRING_TABLE_SIZE'] = StringTableSize
+ Dict['STRING_TABLE_SIZE'] = str(StringTableSize) + 'U'
if Dict['SIZE_TABLE_CNAME'] == []:
Dict['SIZE_TABLE_CNAME'].append('')
Dict['SIZE_TABLE_GUID'].append('')
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append(0)
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(0)
+ Dict['SIZE_TABLE_CURRENT_LENGTH'].append('0U')
+ Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append('0U')
if NumberOfLocalTokens != 0:
Dict['DATABASE_EMPTY'] = 'FALSE'
@@ -1534,15 +1550,15 @@
if NumberOfExTokens != 0:
Dict['EXMAP_TABLE_EMPTY'] = 'FALSE'
- Dict['EXMAPPING_TABLE_SIZE'] = NumberOfExTokens
- Dict['EX_TOKEN_NUMBER'] = NumberOfExTokens
+ Dict['EXMAPPING_TABLE_SIZE'] = str(NumberOfExTokens) + 'U'
+ Dict['EX_TOKEN_NUMBER'] = str(NumberOfExTokens) + 'U'
else:
- Dict['EXMAPPING_TABLE_EXTOKEN'].append(0)
- Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(0)
- Dict['EXMAPPING_TABLE_GUID_INDEX'].append(0)
+ Dict['EXMAPPING_TABLE_EXTOKEN'].append('0U')
+ Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append('0U')
+ Dict['EXMAPPING_TABLE_GUID_INDEX'].append('0U')
if NumberOfSizeItems != 0:
- Dict['SIZE_TABLE_SIZE'] = NumberOfSizeItems * 2
+ Dict['SIZE_TABLE_SIZE'] = str(NumberOfSizeItems * 2) + 'U'
AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict))
if NumberOfLocalTokens == 0:
@@ -1716,8 +1732,8 @@
UefiSpecVersion = '0x00000000'
Dict = {
'Function' : Info.Module.ModuleEntryPointList,
- 'PiSpecVersion' : PiSpecVersion,
- 'UefiSpecVersion': UefiSpecVersion
+ 'PiSpecVersion' : PiSpecVersion + 'U',
+ 'UefiSpecVersion': UefiSpecVersion + 'U'
}
if Info.ModuleType in ['PEI_CORE', 'DXE_CORE', 'SMM_CORE']:
@@ -1777,7 +1793,7 @@
# Unload Image Handlers
#
NumUnloadImage = len(Info.Module.ModuleUnloadImageList)
- Dict = {'Count':NumUnloadImage, 'Function':Info.Module.ModuleUnloadImageList}
+ Dict = {'Count':str(NumUnloadImage) + 'U', 'Function':Info.Module.ModuleUnloadImageList}
if NumUnloadImage < 2:
AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dict))
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-12-13 05:35:48
|
Revision: 2465
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2465&view=rev
Author: gikidy
Date: 2011-12-13 05:35:42 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Fix an issue while generate PCD database, the order of SizeTable is not same with LocalTokenNumberTable.
Signed-off-by: gikidy
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-12-13 05:28:44 UTC (rev 2464)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2011-12-13 05:35:42 UTC (rev 2465)
@@ -1575,6 +1575,35 @@
if NumberOfLocalTokens == 0:
AutoGenC.Append(gEmptyPcdDatabaseAutoGenC.Replace(Dict))
else:
+ #
+ # Update Size Table to the right order, it should be same with LocalTokenNumberTable
+ #
+ SizeCNameTempList = []
+ SizeGuidTempList = []
+ SizeCurLenTempList = []
+ SizeMaxLenTempList = []
+ ReOrderFlag = True
+
+ if len(Dict['SIZE_TABLE_CNAME']) == 1:
+ if not (Dict['SIZE_TABLE_CNAME'][0] and Dict['SIZE_TABLE_GUID'][0]):
+ ReOrderFlag = False
+
+ if ReOrderFlag:
+ for Count in range(len(Dict['TOKEN_CNAME'])):
+ for Count1 in range(len(Dict['SIZE_TABLE_CNAME'])):
+ if Dict['TOKEN_CNAME'][Count] == Dict['SIZE_TABLE_CNAME'][Count1] and \
+ Dict['TOKEN_GUID'][Count] == Dict['SIZE_TABLE_GUID'][Count1]:
+ SizeCNameTempList.append(Dict['SIZE_TABLE_CNAME'][Count1])
+ SizeGuidTempList.append(Dict['SIZE_TABLE_GUID'][Count1])
+ SizeCurLenTempList.append(Dict['SIZE_TABLE_CURRENT_LENGTH'][Count1])
+ SizeMaxLenTempList.append(Dict['SIZE_TABLE_MAXIMUM_LENGTH'][Count1])
+
+ for Count in range(len(Dict['SIZE_TABLE_CNAME'])):
+ Dict['SIZE_TABLE_CNAME'][Count] = SizeCNameTempList[Count]
+ Dict['SIZE_TABLE_GUID'][Count] = SizeGuidTempList[Count]
+ Dict['SIZE_TABLE_CURRENT_LENGTH'][Count] = SizeCurLenTempList[Count]
+ Dict['SIZE_TABLE_MAXIMUM_LENGTH'][Count] = SizeMaxLenTempList[Count]
+
AutoGenC.Append(gPcdDatabaseAutoGenC.Replace(Dict))
return AutoGenH, AutoGenC
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jl...@us...> - 2012-03-07 02:00:30
|
Revision: 2496
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2496&view=rev
Author: jliu66
Date: 2012-03-07 02:00:24 +0000 (Wed, 07 Mar 2012)
Log Message:
-----------
Extend the definition of string offset and default offset from UINT16 to UINT32 to support the PCD database more than 64KB.
Reviewed-by: jsu1
Reviewed-by: lgao4
Signed-off-by: jliu66
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2012-03-05 08:55:31 UTC (rev 2495)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2012-03-07 02:00:24 UTC (rev 2496)
@@ -1,7 +1,7 @@
## @file
# Routines for generating AutoGen.h and AutoGen.c
#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2012, 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
@@ -103,17 +103,17 @@
} SKU_HEAD;
typedef struct {
+ UINT32 StringIndex; // Offset in String Table in units of UINT32.
+ UINT32 DefaultValueOffset; // Offset of the Default Value
UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
- UINT16 StringIndex; // Offset in String Table in units of UINT16.
UINT16 Offset; // Offset in Variable
- UINT16 DefaultValueOffset; // Offset of the Default Value
} VARIABLE_HEAD;
typedef struct {
UINT32 Offset;
} VPD_HEAD;
-typedef UINT16 STRING_HEAD;
+typedef UINT32 STRING_HEAD;
typedef UINT16 SIZE_INFO;
@@ -1346,13 +1346,13 @@
VariableHeadGuidIndex = GuidList.index(VariableGuid)
if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
- VariableHeadValueList.append('%dU, %dU, %sU, offsetof(%s_PCD_DATABASE, Init.%s_%s)' %
- (VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
- Phase, CName, TokenSpaceGuid))
+ VariableHeadValueList.append('%dU, offsetof(%s_PCD_DATABASE, Init.%s_%s), %dU, %sU' %
+ (VariableHeadStringIndex, Phase, CName, TokenSpaceGuid,
+ VariableHeadGuidIndex, Sku.VariableOffset))
else:
- VariableHeadValueList.append('%dU, %dU, %sU, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s)' %
- (VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset,
- Phase, CName, TokenSpaceGuid, SkuIdIndex))
+ VariableHeadValueList.append('%dU, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s), %dU, %sU' %
+ (VariableHeadStringIndex, Phase, CName, TokenSpaceGuid, SkuIdIndex,
+ VariableHeadGuidIndex, Sku.VariableOffset))
Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName)
Dict['VARDEF_GUID_'+Pcd.DatumType].append(TokenSpaceGuid)
Dict['VARDEF_SKUID_'+Pcd.DatumType].append(SkuIdIndex)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yz...@us...> - 2013-08-14 04:53:19
|
Revision: 2598
http://sourceforge.net/p/edk2-buildtools/code/2598
Author: yzhen22
Date: 2013-08-14 04:53:15 +0000 (Wed, 14 Aug 2013)
Log Message:
-----------
Add Module Name string in AutoGen.c code for Debug purpose.
Signed-off-by: Yuxin Zheng <yux...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2013-08-14 01:54:51 UTC (rev 2597)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2013-08-14 04:53:15 UTC (rev 2598)
@@ -2066,6 +2066,7 @@
# Publish the CallerId Guid
#
AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = %s;\n' % GuidStringToGuidStructureString(Info.Guid))
+ AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBaseName = "%s";\n' % Info.Name)
## Create common code for header file
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yz...@us...> - 2013-08-15 05:08:14
|
Revision: 2599
http://sourceforge.net/p/edk2-buildtools/code/2599
Author: yzhen22
Date: 2013-08-15 05:08:12 +0000 (Thu, 15 Aug 2013)
Log Message:
-----------
Add declaration for gEfiCallerBaseName for Debug purpose.
Signed-off-by: Yuxin Zheng <yux...@in...>
Reviewed-by: Liming Gao <lim...@in...>
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2013-08-14 04:53:15 UTC (rev 2598)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2013-08-15 05:08:12 UTC (rev 2599)
@@ -2043,7 +2043,8 @@
if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds:
AutoGenH.Append("#include <Library/PcdLib.h>\n")
- AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;\n\n')
+ AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;')
+ AutoGenH.Append('\nextern CHAR8 *gEfiCallerBaseName;\n\n')
if Info.IsLibrary:
return
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|