Home | History | Annotate | Download | only in Tools

Lines Matching refs:Item

687                     # It could be a virtual item as below

727 for Item in self._CfgItemList:
728 if len(Item['subreg']) == 0:
731 if Item['value'][0] == '{':
732 binlist = Item['value'][1:-1].split(',')
741 if Item['value'].startswith('0x'):
742 value = int(Item['value'], 16)
744 value = int(Item['value'])
746 while idx < Item['length']:
750 for SubItem in Item['subreg']:
792 for Item in self._CfgItemList:
793 if Item['cname'] == 'Signature' and str(Item['value'])[0:6] == SignatureList[Index]:
794 StartAddr = Item['offset']
797 if Item['cname'] == 'UpdTerminator' and InRange == True:
798 EndAddr = Item['offset']
801 for Item in self._CfgItemList:
802 if Item['cname'] == 'Signature' and str(Item['value'])[0:6] == SignatureList[Index]:
806 if Item['cname'] == 'UpdTerminator':
808 if Item['region'] != 'UPD':
810 Offset = Item['offset']
815 TxtFd.write("%s.UnusedUpdSpace%d|%s0x%04X|0x%04X|{0}\n" % (Item['space'], SpaceIdx, Default, NextOffset - StartAddr, Offset - NextOffset))
817 NextOffset = Offset + Item['length']
818 if Item['cname'] == 'PcdSerialIoUartDebugEnable':
820 Item['value'] = 0x01
821 TxtFd.write("%s.%s|%s0x%04X|%s|%s\n" % (Item['space'],Item['cname'],Default,Item['offset'] - StartAddr,Item['length'],Item['value']))
875 def CreateField (self, Item, Name, Length, Offset, Struct, BsfName, Help, Option):
892 if Item and Item['value'].startswith('{'):
1000 for Item in self._CfgItemList:
1001 if str(Item['cname']) == 'Signature' and Item['length'] == 8:
1002 Value = int(Item['value'], 16)
1010 TxtBody.append("#define FSPT_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
1012 TxtBody.append("#define FSPM_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
1014 TxtBody.append("#define FSPS_UPD_SIGNATURE %s /* '%s' */\n\n" % (Item['value'], SignatureStr))
1021 for Item in self._CfgItemList:
1022 if Item["cname"] == 'Signature' and Item["value"][0:6] in UpdSignature:
1023 UpdOffsetTable.append (Item["offset"])
1027 for Item in self._CfgItemList:
1028 if Item["comment"] != '' and Item["offset"] >= UpdOffsetTable[UpdIdx]:
1029 MatchComment = re.match("^(U|V)PD_DATA_REGION:([\w|\W|\s]+)", Item["comment"])
1033 elif Item["offset"] >= UpdOffsetTable[UpdIdx] and Item["comment"] == '':
1047 for Item in self._CfgItemList:
1048 if Item['cname'] == 'Signature' and str(Item['value'])[0:6] == UpdSignature[UpdIdx] or Region[0] == 'V':
1052 if Item['cname'] == 'UpdTerminator':
1055 if Item['region'] != Region:
1058 if Item["offset"] < UpdOffsetTable[UpdIdx]:
1063 if LastVisible and (Item['header'] == 'OFF'):
1065 ResvOffset = Item['offset']
1066 elif (not LastVisible) and Item['header'] == 'ON':
1070 TxtBody.append(self.CreateField (Item, Name, Item["offset"] - ResvOffset, ResvOffset, '', '', '', ''))
1072 if Offset < Item["offset"]:
1075 LineBuffer.append(self.CreateField (Item, Name, Item["offset"] - Offset, Offset, '', '', '', ''))
1077 Offset = Item["offset"]
1081 Offset = Offset + Item["length"]
1086 Comment = Item["comment"]
1087 Embed = Item["embed"].upper()
1090 Marker = '/* COMMENT:%s */ \n' % Item["comment"]
1091 Marker = Marker + '/* EMBED_STRUCT:%s */ ' % Item["embed"]
1093 Marker = '/* EMBED_STRUCT:%s */ ' % Item["embed"]
1098 self.Error = "Invalid embedded structure format '%s'!\n" % Item["embed"]
1100 Line = Marker + self.CreateField (Item, Item["cname"], Item["length"], Item["offset"], Item['struct'], Item['name'], Item['help'], Item['option'])
1102 if Item['cname'] == 'UpdTerminator':
1127 for item in range(len(UpdRegionCheck)):
1128 if UpdRegionCheck[item] == 'FSPT':
1131 elif UpdRegionCheck[item] == 'FSPM':
1134 elif UpdRegionCheck[item] == 'FSPS':
1148 if Match.group(2) == "BEGIN" and Match.group(1) == UpdRegionCheck[item]:
1170 if Match and (UpdRegionCheck[item] in Match.group(1) or UpdConfigCheck[item] in Match.group(1)) and (ExcludedSpecificUpd not in Match.group(1)):
1177 for Item in range(len(StructStart)):
1178 if Index == StructStart[Item]:
1181 StructStartWithComment.append(StructStart[Item])
1183 StructStartWithComment.append(StructStart[Item] + 1)
1187 for Item in range(len(StructStart)):
1188 if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]:
1203 for item in range(len(UpdRegionCheck)):
1216 if Match and (UpdSignatureCheck[item] in Match.group(1) or UpdSignatureCheck[item] in Match.group(1)):
1222 for Item in range(len(StructStart)):
1223 if Index == StructStart[Item]:
1226 StructStartWithComment.append(StructStart[Item])
1228 StructStartWithComment.append(StructStart[Item] + 1)
1232 for Item in range(len(StructStart)):
1233 if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]:
1241 def WriteBsfStruct (self, BsfFd, Item):
1242 if Item['type'] == "None":
1245 Space = Item['space']
1246 Line = " $%s_%s" % (Space, Item['cname'])
1247 Match = re.match("\s*\{([x0-9a-fA-F,\s]+)\}\s*", Item['value'])
1251 DefaultValue = Item['value'].strip()
1252 if 'bitlength' in Item:
1253 BsfFd.write(" %s%s%4d bits $_DEFAULT_ = %s\n" % (Line, ' ' * (64 - len(Line)), Item['bitlength'], DefaultValue))
1255 BsfFd.write(" %s%s%4d bytes $_DEFAULT_ = %s\n" % (Line, ' ' * (64 - len(Line)), Item['length'], DefaultValue))
1257 if Item['type'] == "Combo":
1258 if not Item['option'] in self._BuidinOption:
1259 OptList = Item['option'].split(',')
1266 def WriteBsfOption (self, BsfFd, Item):
1267 PcdName = Item['space'] + '_' + Item['cname']
1269 if Item['type'] == "Combo":
1270 if Item['option'] in self._BuidinOption:
1271 Options = self._BuidinOption[Item['option']]
1274 BsfFd.write(' %s $%s, "%s", &%s,\n' % (Item['type'], PcdName, Item['name'], Options))
1276 elif Item['type'].startswith("EditNum"):
1277 Match = re.match("EditNum\s*,\s*(HEX|DEC)\s*,\s*\((\d+|0x[0-9A-Fa-f]+)\s*,\s*(\d+|0x[0-9A-Fa-f]+)\)", Item['type'])
1279 BsfFd.write(' EditNum $%s, "%s", %s,\n' % (PcdName, Item['name'], Match.group(1)))
1281 elif Item['type'].startswith("EditText"):
1282 BsfFd.write(' %s $%s, "%s",\n' % (Item['type'], PcdName, Item['name']))
1284 elif Item['type'] == "Table":
1285 Columns = Item['option'].split(',')
1287 BsfFd.write(' %s $%s "%s",' % (Item['type'], PcdName, Item['name']))
1301 HelpLines = Item['help'].split('\\n\\r')
1325 for Item in self._CfgItemList:
1326 if Item['find'] != '':
1327 BsfFd.write('\n Find "%s"\n' % Item['find'])
1328 NextOffset = Item['offset'] + Item['length']
1329 if Item['name'] != '':
1330 if NextOffset != Item['offset']:
1331 BsfFd.write(" Skip %d bytes\n" % (Item['offset'] - NextOffset))
1332 if len(Item['subreg']) > 0:
1333 NextOffset = Item['offset']
1335 for SubItem in Item['subreg']:
1347 NextBitsOffset = (Item['offset'] + Item['length']) * 8
1357 NextOffset = Item['offset'] + Item['length']
1359 NextOffset = Item['offset'] + Item['length']
1360 Options = self.WriteBsfStruct(BsfFd, Item)
1362 OptionDict[Item['space']+'_'+Item['cname']] = Options
1369 for Item in OptionDict[Each]:
1370 BsfFd.write(' Selection %s , "%s"\n' % (Item[0], Item[1]))
1381 for Item in self._CfgItemList:
1382 if Item['name'] != '':
1383 if Item['page'] != Each:
1385 if len(Item['subreg']) > 0:
1386 for SubItem in Item['subreg']:
1390 BsfItems.append(Item)
1394 for Item in BsfItems:
1395 self.WriteBsfOption (BsfFd, Item)