iap.lss 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874
  1. ../build/iap/iap/iap.elf: file format elf32-littlearm
  2. Sections:
  3. Idx Name Size VMA LMA File off Algn
  4. 0 .isr_vector 00000188 08000000 08000000 00008000 2**0
  5. CONTENTS, ALLOC, LOAD, READONLY, DATA
  6. 1 .text 0000b688 08008000 08008000 00010000 2**3
  7. CONTENTS, ALLOC, LOAD, READONLY, CODE
  8. 2 .ARM 00000008 08013688 08013688 0001b688 2**2
  9. CONTENTS, ALLOC, LOAD, READONLY, DATA
  10. 3 .init_array 00000004 08013690 08013690 0001b690 2**2
  11. CONTENTS, ALLOC, LOAD, DATA
  12. 4 .fini_array 00000004 08013694 08013694 0001b694 2**2
  13. CONTENTS, ALLOC, LOAD, DATA
  14. 5 .data 00000118 20000000 08013698 00020000 2**2
  15. CONTENTS, ALLOC, LOAD, DATA
  16. 6 .bss 0000c884 20000118 080137b0 00020118 2**2
  17. ALLOC
  18. 7 ._user_heap_stack 00000900 2000c99c 08020034 00020118 2**0
  19. ALLOC
  20. 8 .settings 00004000 08004000 08004000 0000c000 2**0
  21. CONTENTS, ALLOC, LOAD, DATA
  22. 9 .ARM.attributes 0000002f 00000000 00000000 00020118 2**0
  23. CONTENTS, READONLY
  24. 10 .debug_info 00024c72 00000000 00000000 00020147 2**0
  25. CONTENTS, READONLY, DEBUGGING
  26. 11 .debug_abbrev 00007158 00000000 00000000 00044db9 2**0
  27. CONTENTS, READONLY, DEBUGGING
  28. 12 .debug_loc 00011f69 00000000 00000000 0004bf11 2**0
  29. CONTENTS, READONLY, DEBUGGING
  30. 13 .debug_aranges 000019c8 00000000 00000000 0005de80 2**3
  31. CONTENTS, READONLY, DEBUGGING
  32. 14 .debug_ranges 00001d78 00000000 00000000 0005f848 2**3
  33. CONTENTS, READONLY, DEBUGGING
  34. 15 .debug_macro 0001760b 00000000 00000000 000615c0 2**0
  35. CONTENTS, READONLY, DEBUGGING
  36. 16 .debug_line 00013254 00000000 00000000 00078bcb 2**0
  37. CONTENTS, READONLY, DEBUGGING
  38. 17 .debug_str 00071516 00000000 00000000 0008be1f 2**0
  39. CONTENTS, READONLY, DEBUGGING
  40. 18 .comment 00000030 00000000 00000000 000fd335 2**0
  41. CONTENTS, READONLY
  42. 19 .debug_frame 00003ec8 00000000 00000000 000fd368 2**2
  43. CONTENTS, READONLY, DEBUGGING
  44. Disassembly of section .text:
  45. 08008000 <deregister_tm_clones>:
  46. 8008000: b508 push {r3, lr}
  47. 8008002: f240 1018 movw r0, #280 ; 0x118
  48. 8008006: 4b07 ldr r3, [pc, #28] ; (8008024 <deregister_tm_clones+0x24>)
  49. 8008008: f2c2 0000 movt r0, #8192 ; 0x2000
  50. 800800c: 1a1b subs r3, r3, r0
  51. 800800e: 2b06 cmp r3, #6
  52. 8008010: d800 bhi.n 8008014 <deregister_tm_clones+0x14>
  53. 8008012: bd08 pop {r3, pc}
  54. 8008014: f240 0300 movw r3, #0
  55. 8008018: f2c0 0300 movt r3, #0
  56. 800801c: 2b00 cmp r3, #0
  57. 800801e: d0f8 beq.n 8008012 <deregister_tm_clones+0x12>
  58. 8008020: 4798 blx r3
  59. 8008022: e7f6 b.n 8008012 <deregister_tm_clones+0x12>
  60. 8008024: 2000011b .word 0x2000011b
  61. 08008028 <register_tm_clones>:
  62. 8008028: b508 push {r3, lr}
  63. 800802a: f240 1018 movw r0, #280 ; 0x118
  64. 800802e: f240 1318 movw r3, #280 ; 0x118
  65. 8008032: f2c2 0000 movt r0, #8192 ; 0x2000
  66. 8008036: f2c2 0300 movt r3, #8192 ; 0x2000
  67. 800803a: 1a1b subs r3, r3, r0
  68. 800803c: 109b asrs r3, r3, #2
  69. 800803e: eb03 73d3 add.w r3, r3, r3, lsr #31
  70. 8008042: 1059 asrs r1, r3, #1
  71. 8008044: d100 bne.n 8008048 <register_tm_clones+0x20>
  72. 8008046: bd08 pop {r3, pc}
  73. 8008048: f240 0200 movw r2, #0
  74. 800804c: f2c0 0200 movt r2, #0
  75. 8008050: 2a00 cmp r2, #0
  76. 8008052: d0f8 beq.n 8008046 <register_tm_clones+0x1e>
  77. 8008054: 4790 blx r2
  78. 8008056: e7f6 b.n 8008046 <register_tm_clones+0x1e>
  79. 08008058 <__do_global_dtors_aux>:
  80. 8008058: b510 push {r4, lr}
  81. 800805a: f240 1418 movw r4, #280 ; 0x118
  82. 800805e: f2c2 0400 movt r4, #8192 ; 0x2000
  83. 8008062: 7823 ldrb r3, [r4, #0]
  84. 8008064: b973 cbnz r3, 8008084 <__do_global_dtors_aux+0x2c>
  85. 8008066: f7ff ffcb bl 8008000 <deregister_tm_clones>
  86. 800806a: f240 0300 movw r3, #0
  87. 800806e: f2c0 0300 movt r3, #0
  88. 8008072: b12b cbz r3, 8008080 <__do_global_dtors_aux+0x28>
  89. 8008074: f243 6070 movw r0, #13936 ; 0x3670
  90. 8008078: f6c0 0001 movt r0, #2049 ; 0x801
  91. 800807c: f3af 8000 nop.w
  92. 8008080: 2301 movs r3, #1
  93. 8008082: 7023 strb r3, [r4, #0]
  94. 8008084: bd10 pop {r4, pc}
  95. 8008086: bf00 nop
  96. 08008088 <frame_dummy>:
  97. 8008088: b508 push {r3, lr}
  98. 800808a: f240 0300 movw r3, #0
  99. 800808e: f2c0 0300 movt r3, #0
  100. 8008092: b14b cbz r3, 80080a8 <frame_dummy+0x20>
  101. 8008094: f243 6070 movw r0, #13936 ; 0x3670
  102. 8008098: f240 111c movw r1, #284 ; 0x11c
  103. 800809c: f6c0 0001 movt r0, #2049 ; 0x801
  104. 80080a0: f2c2 0100 movt r1, #8192 ; 0x2000
  105. 80080a4: f3af 8000 nop.w
  106. 80080a8: f240 1018 movw r0, #280 ; 0x118
  107. 80080ac: f2c2 0000 movt r0, #8192 ; 0x2000
  108. 80080b0: 6803 ldr r3, [r0, #0]
  109. 80080b2: b12b cbz r3, 80080c0 <frame_dummy+0x38>
  110. 80080b4: f240 0300 movw r3, #0
  111. 80080b8: f2c0 0300 movt r3, #0
  112. 80080bc: b103 cbz r3, 80080c0 <frame_dummy+0x38>
  113. 80080be: 4798 blx r3
  114. 80080c0: e8bd 4008 ldmia.w sp!, {r3, lr}
  115. 80080c4: f7ff bfb0 b.w 8008028 <register_tm_clones>
  116. 080080c8 <__aeabi_drsub>:
  117. 80080c8: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
  118. 80080cc: e002 b.n 80080d4 <__adddf3>
  119. 80080ce: bf00 nop
  120. 080080d0 <__aeabi_dsub>:
  121. 80080d0: f083 4300 eor.w r3, r3, #2147483648 ; 0x80000000
  122. 080080d4 <__adddf3>:
  123. 80080d4: b530 push {r4, r5, lr}
  124. 80080d6: ea4f 0441 mov.w r4, r1, lsl #1
  125. 80080da: ea4f 0543 mov.w r5, r3, lsl #1
  126. 80080de: ea94 0f05 teq r4, r5
  127. 80080e2: bf08 it eq
  128. 80080e4: ea90 0f02 teqeq r0, r2
  129. 80080e8: bf1f itttt ne
  130. 80080ea: ea54 0c00 orrsne.w ip, r4, r0
  131. 80080ee: ea55 0c02 orrsne.w ip, r5, r2
  132. 80080f2: ea7f 5c64 mvnsne.w ip, r4, asr #21
  133. 80080f6: ea7f 5c65 mvnsne.w ip, r5, asr #21
  134. 80080fa: f000 80e2 beq.w 80082c2 <__adddf3+0x1ee>
  135. 80080fe: ea4f 5454 mov.w r4, r4, lsr #21
  136. 8008102: ebd4 5555 rsbs r5, r4, r5, lsr #21
  137. 8008106: bfb8 it lt
  138. 8008108: 426d neglt r5, r5
  139. 800810a: dd0c ble.n 8008126 <__adddf3+0x52>
  140. 800810c: 442c add r4, r5
  141. 800810e: ea80 0202 eor.w r2, r0, r2
  142. 8008112: ea81 0303 eor.w r3, r1, r3
  143. 8008116: ea82 0000 eor.w r0, r2, r0
  144. 800811a: ea83 0101 eor.w r1, r3, r1
  145. 800811e: ea80 0202 eor.w r2, r0, r2
  146. 8008122: ea81 0303 eor.w r3, r1, r3
  147. 8008126: 2d36 cmp r5, #54 ; 0x36
  148. 8008128: bf88 it hi
  149. 800812a: bd30 pophi {r4, r5, pc}
  150. 800812c: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
  151. 8008130: ea4f 3101 mov.w r1, r1, lsl #12
  152. 8008134: f44f 1c80 mov.w ip, #1048576 ; 0x100000
  153. 8008138: ea4c 3111 orr.w r1, ip, r1, lsr #12
  154. 800813c: d002 beq.n 8008144 <__adddf3+0x70>
  155. 800813e: 4240 negs r0, r0
  156. 8008140: eb61 0141 sbc.w r1, r1, r1, lsl #1
  157. 8008144: f013 4f00 tst.w r3, #2147483648 ; 0x80000000
  158. 8008148: ea4f 3303 mov.w r3, r3, lsl #12
  159. 800814c: ea4c 3313 orr.w r3, ip, r3, lsr #12
  160. 8008150: d002 beq.n 8008158 <__adddf3+0x84>
  161. 8008152: 4252 negs r2, r2
  162. 8008154: eb63 0343 sbc.w r3, r3, r3, lsl #1
  163. 8008158: ea94 0f05 teq r4, r5
  164. 800815c: f000 80a7 beq.w 80082ae <__adddf3+0x1da>
  165. 8008160: f1a4 0401 sub.w r4, r4, #1
  166. 8008164: f1d5 0e20 rsbs lr, r5, #32
  167. 8008168: db0d blt.n 8008186 <__adddf3+0xb2>
  168. 800816a: fa02 fc0e lsl.w ip, r2, lr
  169. 800816e: fa22 f205 lsr.w r2, r2, r5
  170. 8008172: 1880 adds r0, r0, r2
  171. 8008174: f141 0100 adc.w r1, r1, #0
  172. 8008178: fa03 f20e lsl.w r2, r3, lr
  173. 800817c: 1880 adds r0, r0, r2
  174. 800817e: fa43 f305 asr.w r3, r3, r5
  175. 8008182: 4159 adcs r1, r3
  176. 8008184: e00e b.n 80081a4 <__adddf3+0xd0>
  177. 8008186: f1a5 0520 sub.w r5, r5, #32
  178. 800818a: f10e 0e20 add.w lr, lr, #32
  179. 800818e: 2a01 cmp r2, #1
  180. 8008190: fa03 fc0e lsl.w ip, r3, lr
  181. 8008194: bf28 it cs
  182. 8008196: f04c 0c02 orrcs.w ip, ip, #2
  183. 800819a: fa43 f305 asr.w r3, r3, r5
  184. 800819e: 18c0 adds r0, r0, r3
  185. 80081a0: eb51 71e3 adcs.w r1, r1, r3, asr #31
  186. 80081a4: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
  187. 80081a8: d507 bpl.n 80081ba <__adddf3+0xe6>
  188. 80081aa: f04f 0e00 mov.w lr, #0
  189. 80081ae: f1dc 0c00 rsbs ip, ip, #0
  190. 80081b2: eb7e 0000 sbcs.w r0, lr, r0
  191. 80081b6: eb6e 0101 sbc.w r1, lr, r1
  192. 80081ba: f5b1 1f80 cmp.w r1, #1048576 ; 0x100000
  193. 80081be: d31b bcc.n 80081f8 <__adddf3+0x124>
  194. 80081c0: f5b1 1f00 cmp.w r1, #2097152 ; 0x200000
  195. 80081c4: d30c bcc.n 80081e0 <__adddf3+0x10c>
  196. 80081c6: 0849 lsrs r1, r1, #1
  197. 80081c8: ea5f 0030 movs.w r0, r0, rrx
  198. 80081cc: ea4f 0c3c mov.w ip, ip, rrx
  199. 80081d0: f104 0401 add.w r4, r4, #1
  200. 80081d4: ea4f 5244 mov.w r2, r4, lsl #21
  201. 80081d8: f512 0f80 cmn.w r2, #4194304 ; 0x400000
  202. 80081dc: f080 809a bcs.w 8008314 <__adddf3+0x240>
  203. 80081e0: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
  204. 80081e4: bf08 it eq
  205. 80081e6: ea5f 0c50 movseq.w ip, r0, lsr #1
  206. 80081ea: f150 0000 adcs.w r0, r0, #0
  207. 80081ee: eb41 5104 adc.w r1, r1, r4, lsl #20
  208. 80081f2: ea41 0105 orr.w r1, r1, r5
  209. 80081f6: bd30 pop {r4, r5, pc}
  210. 80081f8: ea5f 0c4c movs.w ip, ip, lsl #1
  211. 80081fc: 4140 adcs r0, r0
  212. 80081fe: eb41 0101 adc.w r1, r1, r1
  213. 8008202: f411 1f80 tst.w r1, #1048576 ; 0x100000
  214. 8008206: f1a4 0401 sub.w r4, r4, #1
  215. 800820a: d1e9 bne.n 80081e0 <__adddf3+0x10c>
  216. 800820c: f091 0f00 teq r1, #0
  217. 8008210: bf04 itt eq
  218. 8008212: 4601 moveq r1, r0
  219. 8008214: 2000 moveq r0, #0
  220. 8008216: fab1 f381 clz r3, r1
  221. 800821a: bf08 it eq
  222. 800821c: 3320 addeq r3, #32
  223. 800821e: f1a3 030b sub.w r3, r3, #11
  224. 8008222: f1b3 0220 subs.w r2, r3, #32
  225. 8008226: da0c bge.n 8008242 <__adddf3+0x16e>
  226. 8008228: 320c adds r2, #12
  227. 800822a: dd08 ble.n 800823e <__adddf3+0x16a>
  228. 800822c: f102 0c14 add.w ip, r2, #20
  229. 8008230: f1c2 020c rsb r2, r2, #12
  230. 8008234: fa01 f00c lsl.w r0, r1, ip
  231. 8008238: fa21 f102 lsr.w r1, r1, r2
  232. 800823c: e00c b.n 8008258 <__adddf3+0x184>
  233. 800823e: f102 0214 add.w r2, r2, #20
  234. 8008242: bfd8 it le
  235. 8008244: f1c2 0c20 rsble ip, r2, #32
  236. 8008248: fa01 f102 lsl.w r1, r1, r2
  237. 800824c: fa20 fc0c lsr.w ip, r0, ip
  238. 8008250: bfdc itt le
  239. 8008252: ea41 010c orrle.w r1, r1, ip
  240. 8008256: 4090 lslle r0, r2
  241. 8008258: 1ae4 subs r4, r4, r3
  242. 800825a: bfa2 ittt ge
  243. 800825c: eb01 5104 addge.w r1, r1, r4, lsl #20
  244. 8008260: 4329 orrge r1, r5
  245. 8008262: bd30 popge {r4, r5, pc}
  246. 8008264: ea6f 0404 mvn.w r4, r4
  247. 8008268: 3c1f subs r4, #31
  248. 800826a: da1c bge.n 80082a6 <__adddf3+0x1d2>
  249. 800826c: 340c adds r4, #12
  250. 800826e: dc0e bgt.n 800828e <__adddf3+0x1ba>
  251. 8008270: f104 0414 add.w r4, r4, #20
  252. 8008274: f1c4 0220 rsb r2, r4, #32
  253. 8008278: fa20 f004 lsr.w r0, r0, r4
  254. 800827c: fa01 f302 lsl.w r3, r1, r2
  255. 8008280: ea40 0003 orr.w r0, r0, r3
  256. 8008284: fa21 f304 lsr.w r3, r1, r4
  257. 8008288: ea45 0103 orr.w r1, r5, r3
  258. 800828c: bd30 pop {r4, r5, pc}
  259. 800828e: f1c4 040c rsb r4, r4, #12
  260. 8008292: f1c4 0220 rsb r2, r4, #32
  261. 8008296: fa20 f002 lsr.w r0, r0, r2
  262. 800829a: fa01 f304 lsl.w r3, r1, r4
  263. 800829e: ea40 0003 orr.w r0, r0, r3
  264. 80082a2: 4629 mov r1, r5
  265. 80082a4: bd30 pop {r4, r5, pc}
  266. 80082a6: fa21 f004 lsr.w r0, r1, r4
  267. 80082aa: 4629 mov r1, r5
  268. 80082ac: bd30 pop {r4, r5, pc}
  269. 80082ae: f094 0f00 teq r4, #0
  270. 80082b2: f483 1380 eor.w r3, r3, #1048576 ; 0x100000
  271. 80082b6: bf06 itte eq
  272. 80082b8: f481 1180 eoreq.w r1, r1, #1048576 ; 0x100000
  273. 80082bc: 3401 addeq r4, #1
  274. 80082be: 3d01 subne r5, #1
  275. 80082c0: e74e b.n 8008160 <__adddf3+0x8c>
  276. 80082c2: ea7f 5c64 mvns.w ip, r4, asr #21
  277. 80082c6: bf18 it ne
  278. 80082c8: ea7f 5c65 mvnsne.w ip, r5, asr #21
  279. 80082cc: d029 beq.n 8008322 <__adddf3+0x24e>
  280. 80082ce: ea94 0f05 teq r4, r5
  281. 80082d2: bf08 it eq
  282. 80082d4: ea90 0f02 teqeq r0, r2
  283. 80082d8: d005 beq.n 80082e6 <__adddf3+0x212>
  284. 80082da: ea54 0c00 orrs.w ip, r4, r0
  285. 80082de: bf04 itt eq
  286. 80082e0: 4619 moveq r1, r3
  287. 80082e2: 4610 moveq r0, r2
  288. 80082e4: bd30 pop {r4, r5, pc}
  289. 80082e6: ea91 0f03 teq r1, r3
  290. 80082ea: bf1e ittt ne
  291. 80082ec: 2100 movne r1, #0
  292. 80082ee: 2000 movne r0, #0
  293. 80082f0: bd30 popne {r4, r5, pc}
  294. 80082f2: ea5f 5c54 movs.w ip, r4, lsr #21
  295. 80082f6: d105 bne.n 8008304 <__adddf3+0x230>
  296. 80082f8: 0040 lsls r0, r0, #1
  297. 80082fa: 4149 adcs r1, r1
  298. 80082fc: bf28 it cs
  299. 80082fe: f041 4100 orrcs.w r1, r1, #2147483648 ; 0x80000000
  300. 8008302: bd30 pop {r4, r5, pc}
  301. 8008304: f514 0480 adds.w r4, r4, #4194304 ; 0x400000
  302. 8008308: bf3c itt cc
  303. 800830a: f501 1180 addcc.w r1, r1, #1048576 ; 0x100000
  304. 800830e: bd30 popcc {r4, r5, pc}
  305. 8008310: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
  306. 8008314: f045 41fe orr.w r1, r5, #2130706432 ; 0x7f000000
  307. 8008318: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
  308. 800831c: f04f 0000 mov.w r0, #0
  309. 8008320: bd30 pop {r4, r5, pc}
  310. 8008322: ea7f 5c64 mvns.w ip, r4, asr #21
  311. 8008326: bf1a itte ne
  312. 8008328: 4619 movne r1, r3
  313. 800832a: 4610 movne r0, r2
  314. 800832c: ea7f 5c65 mvnseq.w ip, r5, asr #21
  315. 8008330: bf1c itt ne
  316. 8008332: 460b movne r3, r1
  317. 8008334: 4602 movne r2, r0
  318. 8008336: ea50 3401 orrs.w r4, r0, r1, lsl #12
  319. 800833a: bf06 itte eq
  320. 800833c: ea52 3503 orrseq.w r5, r2, r3, lsl #12
  321. 8008340: ea91 0f03 teqeq r1, r3
  322. 8008344: f441 2100 orrne.w r1, r1, #524288 ; 0x80000
  323. 8008348: bd30 pop {r4, r5, pc}
  324. 800834a: bf00 nop
  325. 0800834c <__aeabi_ui2d>:
  326. 800834c: f090 0f00 teq r0, #0
  327. 8008350: bf04 itt eq
  328. 8008352: 2100 moveq r1, #0
  329. 8008354: 4770 bxeq lr
  330. 8008356: b530 push {r4, r5, lr}
  331. 8008358: f44f 6480 mov.w r4, #1024 ; 0x400
  332. 800835c: f104 0432 add.w r4, r4, #50 ; 0x32
  333. 8008360: f04f 0500 mov.w r5, #0
  334. 8008364: f04f 0100 mov.w r1, #0
  335. 8008368: e750 b.n 800820c <__adddf3+0x138>
  336. 800836a: bf00 nop
  337. 0800836c <__aeabi_i2d>:
  338. 800836c: f090 0f00 teq r0, #0
  339. 8008370: bf04 itt eq
  340. 8008372: 2100 moveq r1, #0
  341. 8008374: 4770 bxeq lr
  342. 8008376: b530 push {r4, r5, lr}
  343. 8008378: f44f 6480 mov.w r4, #1024 ; 0x400
  344. 800837c: f104 0432 add.w r4, r4, #50 ; 0x32
  345. 8008380: f010 4500 ands.w r5, r0, #2147483648 ; 0x80000000
  346. 8008384: bf48 it mi
  347. 8008386: 4240 negmi r0, r0
  348. 8008388: f04f 0100 mov.w r1, #0
  349. 800838c: e73e b.n 800820c <__adddf3+0x138>
  350. 800838e: bf00 nop
  351. 08008390 <__aeabi_f2d>:
  352. 8008390: 0042 lsls r2, r0, #1
  353. 8008392: ea4f 01e2 mov.w r1, r2, asr #3
  354. 8008396: ea4f 0131 mov.w r1, r1, rrx
  355. 800839a: ea4f 7002 mov.w r0, r2, lsl #28
  356. 800839e: bf1f itttt ne
  357. 80083a0: f012 437f andsne.w r3, r2, #4278190080 ; 0xff000000
  358. 80083a4: f093 4f7f teqne r3, #4278190080 ; 0xff000000
  359. 80083a8: f081 5160 eorne.w r1, r1, #939524096 ; 0x38000000
  360. 80083ac: 4770 bxne lr
  361. 80083ae: f092 0f00 teq r2, #0
  362. 80083b2: bf14 ite ne
  363. 80083b4: f093 4f7f teqne r3, #4278190080 ; 0xff000000
  364. 80083b8: 4770 bxeq lr
  365. 80083ba: b530 push {r4, r5, lr}
  366. 80083bc: f44f 7460 mov.w r4, #896 ; 0x380
  367. 80083c0: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
  368. 80083c4: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
  369. 80083c8: e720 b.n 800820c <__adddf3+0x138>
  370. 80083ca: bf00 nop
  371. 080083cc <__aeabi_ul2d>:
  372. 80083cc: ea50 0201 orrs.w r2, r0, r1
  373. 80083d0: bf08 it eq
  374. 80083d2: 4770 bxeq lr
  375. 80083d4: b530 push {r4, r5, lr}
  376. 80083d6: f04f 0500 mov.w r5, #0
  377. 80083da: e00a b.n 80083f2 <__aeabi_l2d+0x16>
  378. 080083dc <__aeabi_l2d>:
  379. 80083dc: ea50 0201 orrs.w r2, r0, r1
  380. 80083e0: bf08 it eq
  381. 80083e2: 4770 bxeq lr
  382. 80083e4: b530 push {r4, r5, lr}
  383. 80083e6: f011 4500 ands.w r5, r1, #2147483648 ; 0x80000000
  384. 80083ea: d502 bpl.n 80083f2 <__aeabi_l2d+0x16>
  385. 80083ec: 4240 negs r0, r0
  386. 80083ee: eb61 0141 sbc.w r1, r1, r1, lsl #1
  387. 80083f2: f44f 6480 mov.w r4, #1024 ; 0x400
  388. 80083f6: f104 0432 add.w r4, r4, #50 ; 0x32
  389. 80083fa: ea5f 5c91 movs.w ip, r1, lsr #22
  390. 80083fe: f43f aedc beq.w 80081ba <__adddf3+0xe6>
  391. 8008402: f04f 0203 mov.w r2, #3
  392. 8008406: ea5f 0cdc movs.w ip, ip, lsr #3
  393. 800840a: bf18 it ne
  394. 800840c: 3203 addne r2, #3
  395. 800840e: ea5f 0cdc movs.w ip, ip, lsr #3
  396. 8008412: bf18 it ne
  397. 8008414: 3203 addne r2, #3
  398. 8008416: eb02 02dc add.w r2, r2, ip, lsr #3
  399. 800841a: f1c2 0320 rsb r3, r2, #32
  400. 800841e: fa00 fc03 lsl.w ip, r0, r3
  401. 8008422: fa20 f002 lsr.w r0, r0, r2
  402. 8008426: fa01 fe03 lsl.w lr, r1, r3
  403. 800842a: ea40 000e orr.w r0, r0, lr
  404. 800842e: fa21 f102 lsr.w r1, r1, r2
  405. 8008432: 4414 add r4, r2
  406. 8008434: e6c1 b.n 80081ba <__adddf3+0xe6>
  407. 8008436: bf00 nop
  408. 08008438 <__aeabi_dmul>:
  409. 8008438: b570 push {r4, r5, r6, lr}
  410. 800843a: f04f 0cff mov.w ip, #255 ; 0xff
  411. 800843e: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
  412. 8008442: ea1c 5411 ands.w r4, ip, r1, lsr #20
  413. 8008446: bf1d ittte ne
  414. 8008448: ea1c 5513 andsne.w r5, ip, r3, lsr #20
  415. 800844c: ea94 0f0c teqne r4, ip
  416. 8008450: ea95 0f0c teqne r5, ip
  417. 8008454: f000 f8de bleq 8008614 <__aeabi_dmul+0x1dc>
  418. 8008458: 442c add r4, r5
  419. 800845a: ea81 0603 eor.w r6, r1, r3
  420. 800845e: ea21 514c bic.w r1, r1, ip, lsl #21
  421. 8008462: ea23 534c bic.w r3, r3, ip, lsl #21
  422. 8008466: ea50 3501 orrs.w r5, r0, r1, lsl #12
  423. 800846a: bf18 it ne
  424. 800846c: ea52 3503 orrsne.w r5, r2, r3, lsl #12
  425. 8008470: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
  426. 8008474: f443 1380 orr.w r3, r3, #1048576 ; 0x100000
  427. 8008478: d038 beq.n 80084ec <__aeabi_dmul+0xb4>
  428. 800847a: fba0 ce02 umull ip, lr, r0, r2
  429. 800847e: f04f 0500 mov.w r5, #0
  430. 8008482: fbe1 e502 umlal lr, r5, r1, r2
  431. 8008486: f006 4200 and.w r2, r6, #2147483648 ; 0x80000000
  432. 800848a: fbe0 e503 umlal lr, r5, r0, r3
  433. 800848e: f04f 0600 mov.w r6, #0
  434. 8008492: fbe1 5603 umlal r5, r6, r1, r3
  435. 8008496: f09c 0f00 teq ip, #0
  436. 800849a: bf18 it ne
  437. 800849c: f04e 0e01 orrne.w lr, lr, #1
  438. 80084a0: f1a4 04ff sub.w r4, r4, #255 ; 0xff
  439. 80084a4: f5b6 7f00 cmp.w r6, #512 ; 0x200
  440. 80084a8: f564 7440 sbc.w r4, r4, #768 ; 0x300
  441. 80084ac: d204 bcs.n 80084b8 <__aeabi_dmul+0x80>
  442. 80084ae: ea5f 0e4e movs.w lr, lr, lsl #1
  443. 80084b2: 416d adcs r5, r5
  444. 80084b4: eb46 0606 adc.w r6, r6, r6
  445. 80084b8: ea42 21c6 orr.w r1, r2, r6, lsl #11
  446. 80084bc: ea41 5155 orr.w r1, r1, r5, lsr #21
  447. 80084c0: ea4f 20c5 mov.w r0, r5, lsl #11
  448. 80084c4: ea40 505e orr.w r0, r0, lr, lsr #21
  449. 80084c8: ea4f 2ece mov.w lr, lr, lsl #11
  450. 80084cc: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
  451. 80084d0: bf88 it hi
  452. 80084d2: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
  453. 80084d6: d81e bhi.n 8008516 <__aeabi_dmul+0xde>
  454. 80084d8: f1be 4f00 cmp.w lr, #2147483648 ; 0x80000000
  455. 80084dc: bf08 it eq
  456. 80084de: ea5f 0e50 movseq.w lr, r0, lsr #1
  457. 80084e2: f150 0000 adcs.w r0, r0, #0
  458. 80084e6: eb41 5104 adc.w r1, r1, r4, lsl #20
  459. 80084ea: bd70 pop {r4, r5, r6, pc}
  460. 80084ec: f006 4600 and.w r6, r6, #2147483648 ; 0x80000000
  461. 80084f0: ea46 0101 orr.w r1, r6, r1
  462. 80084f4: ea40 0002 orr.w r0, r0, r2
  463. 80084f8: ea81 0103 eor.w r1, r1, r3
  464. 80084fc: ebb4 045c subs.w r4, r4, ip, lsr #1
  465. 8008500: bfc2 ittt gt
  466. 8008502: ebd4 050c rsbsgt r5, r4, ip
  467. 8008506: ea41 5104 orrgt.w r1, r1, r4, lsl #20
  468. 800850a: bd70 popgt {r4, r5, r6, pc}
  469. 800850c: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
  470. 8008510: f04f 0e00 mov.w lr, #0
  471. 8008514: 3c01 subs r4, #1
  472. 8008516: f300 80ab bgt.w 8008670 <__aeabi_dmul+0x238>
  473. 800851a: f114 0f36 cmn.w r4, #54 ; 0x36
  474. 800851e: bfde ittt le
  475. 8008520: 2000 movle r0, #0
  476. 8008522: f001 4100 andle.w r1, r1, #2147483648 ; 0x80000000
  477. 8008526: bd70 pople {r4, r5, r6, pc}
  478. 8008528: f1c4 0400 rsb r4, r4, #0
  479. 800852c: 3c20 subs r4, #32
  480. 800852e: da35 bge.n 800859c <__aeabi_dmul+0x164>
  481. 8008530: 340c adds r4, #12
  482. 8008532: dc1b bgt.n 800856c <__aeabi_dmul+0x134>
  483. 8008534: f104 0414 add.w r4, r4, #20
  484. 8008538: f1c4 0520 rsb r5, r4, #32
  485. 800853c: fa00 f305 lsl.w r3, r0, r5
  486. 8008540: fa20 f004 lsr.w r0, r0, r4
  487. 8008544: fa01 f205 lsl.w r2, r1, r5
  488. 8008548: ea40 0002 orr.w r0, r0, r2
  489. 800854c: f001 4200 and.w r2, r1, #2147483648 ; 0x80000000
  490. 8008550: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
  491. 8008554: eb10 70d3 adds.w r0, r0, r3, lsr #31
  492. 8008558: fa21 f604 lsr.w r6, r1, r4
  493. 800855c: eb42 0106 adc.w r1, r2, r6
  494. 8008560: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
  495. 8008564: bf08 it eq
  496. 8008566: ea20 70d3 biceq.w r0, r0, r3, lsr #31
  497. 800856a: bd70 pop {r4, r5, r6, pc}
  498. 800856c: f1c4 040c rsb r4, r4, #12
  499. 8008570: f1c4 0520 rsb r5, r4, #32
  500. 8008574: fa00 f304 lsl.w r3, r0, r4
  501. 8008578: fa20 f005 lsr.w r0, r0, r5
  502. 800857c: fa01 f204 lsl.w r2, r1, r4
  503. 8008580: ea40 0002 orr.w r0, r0, r2
  504. 8008584: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
  505. 8008588: eb10 70d3 adds.w r0, r0, r3, lsr #31
  506. 800858c: f141 0100 adc.w r1, r1, #0
  507. 8008590: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
  508. 8008594: bf08 it eq
  509. 8008596: ea20 70d3 biceq.w r0, r0, r3, lsr #31
  510. 800859a: bd70 pop {r4, r5, r6, pc}
  511. 800859c: f1c4 0520 rsb r5, r4, #32
  512. 80085a0: fa00 f205 lsl.w r2, r0, r5
  513. 80085a4: ea4e 0e02 orr.w lr, lr, r2
  514. 80085a8: fa20 f304 lsr.w r3, r0, r4
  515. 80085ac: fa01 f205 lsl.w r2, r1, r5
  516. 80085b0: ea43 0302 orr.w r3, r3, r2
  517. 80085b4: fa21 f004 lsr.w r0, r1, r4
  518. 80085b8: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
  519. 80085bc: fa21 f204 lsr.w r2, r1, r4
  520. 80085c0: ea20 0002 bic.w r0, r0, r2
  521. 80085c4: eb00 70d3 add.w r0, r0, r3, lsr #31
  522. 80085c8: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
  523. 80085cc: bf08 it eq
  524. 80085ce: ea20 70d3 biceq.w r0, r0, r3, lsr #31
  525. 80085d2: bd70 pop {r4, r5, r6, pc}
  526. 80085d4: f094 0f00 teq r4, #0
  527. 80085d8: d10f bne.n 80085fa <__aeabi_dmul+0x1c2>
  528. 80085da: f001 4600 and.w r6, r1, #2147483648 ; 0x80000000
  529. 80085de: 0040 lsls r0, r0, #1
  530. 80085e0: eb41 0101 adc.w r1, r1, r1
  531. 80085e4: f411 1f80 tst.w r1, #1048576 ; 0x100000
  532. 80085e8: bf08 it eq
  533. 80085ea: 3c01 subeq r4, #1
  534. 80085ec: d0f7 beq.n 80085de <__aeabi_dmul+0x1a6>
  535. 80085ee: ea41 0106 orr.w r1, r1, r6
  536. 80085f2: f095 0f00 teq r5, #0
  537. 80085f6: bf18 it ne
  538. 80085f8: 4770 bxne lr
  539. 80085fa: f003 4600 and.w r6, r3, #2147483648 ; 0x80000000
  540. 80085fe: 0052 lsls r2, r2, #1
  541. 8008600: eb43 0303 adc.w r3, r3, r3
  542. 8008604: f413 1f80 tst.w r3, #1048576 ; 0x100000
  543. 8008608: bf08 it eq
  544. 800860a: 3d01 subeq r5, #1
  545. 800860c: d0f7 beq.n 80085fe <__aeabi_dmul+0x1c6>
  546. 800860e: ea43 0306 orr.w r3, r3, r6
  547. 8008612: 4770 bx lr
  548. 8008614: ea94 0f0c teq r4, ip
  549. 8008618: ea0c 5513 and.w r5, ip, r3, lsr #20
  550. 800861c: bf18 it ne
  551. 800861e: ea95 0f0c teqne r5, ip
  552. 8008622: d00c beq.n 800863e <__aeabi_dmul+0x206>
  553. 8008624: ea50 0641 orrs.w r6, r0, r1, lsl #1
  554. 8008628: bf18 it ne
  555. 800862a: ea52 0643 orrsne.w r6, r2, r3, lsl #1
  556. 800862e: d1d1 bne.n 80085d4 <__aeabi_dmul+0x19c>
  557. 8008630: ea81 0103 eor.w r1, r1, r3
  558. 8008634: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
  559. 8008638: f04f 0000 mov.w r0, #0
  560. 800863c: bd70 pop {r4, r5, r6, pc}
  561. 800863e: ea50 0641 orrs.w r6, r0, r1, lsl #1
  562. 8008642: bf06 itte eq
  563. 8008644: 4610 moveq r0, r2
  564. 8008646: 4619 moveq r1, r3
  565. 8008648: ea52 0643 orrsne.w r6, r2, r3, lsl #1
  566. 800864c: d019 beq.n 8008682 <__aeabi_dmul+0x24a>
  567. 800864e: ea94 0f0c teq r4, ip
  568. 8008652: d102 bne.n 800865a <__aeabi_dmul+0x222>
  569. 8008654: ea50 3601 orrs.w r6, r0, r1, lsl #12
  570. 8008658: d113 bne.n 8008682 <__aeabi_dmul+0x24a>
  571. 800865a: ea95 0f0c teq r5, ip
  572. 800865e: d105 bne.n 800866c <__aeabi_dmul+0x234>
  573. 8008660: ea52 3603 orrs.w r6, r2, r3, lsl #12
  574. 8008664: bf1c itt ne
  575. 8008666: 4610 movne r0, r2
  576. 8008668: 4619 movne r1, r3
  577. 800866a: d10a bne.n 8008682 <__aeabi_dmul+0x24a>
  578. 800866c: ea81 0103 eor.w r1, r1, r3
  579. 8008670: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
  580. 8008674: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
  581. 8008678: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
  582. 800867c: f04f 0000 mov.w r0, #0
  583. 8008680: bd70 pop {r4, r5, r6, pc}
  584. 8008682: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
  585. 8008686: f441 0178 orr.w r1, r1, #16252928 ; 0xf80000
  586. 800868a: bd70 pop {r4, r5, r6, pc}
  587. 0800868c <__aeabi_ddiv>:
  588. 800868c: b570 push {r4, r5, r6, lr}
  589. 800868e: f04f 0cff mov.w ip, #255 ; 0xff
  590. 8008692: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
  591. 8008696: ea1c 5411 ands.w r4, ip, r1, lsr #20
  592. 800869a: bf1d ittte ne
  593. 800869c: ea1c 5513 andsne.w r5, ip, r3, lsr #20
  594. 80086a0: ea94 0f0c teqne r4, ip
  595. 80086a4: ea95 0f0c teqne r5, ip
  596. 80086a8: f000 f8a7 bleq 80087fa <__aeabi_ddiv+0x16e>
  597. 80086ac: eba4 0405 sub.w r4, r4, r5
  598. 80086b0: ea81 0e03 eor.w lr, r1, r3
  599. 80086b4: ea52 3503 orrs.w r5, r2, r3, lsl #12
  600. 80086b8: ea4f 3101 mov.w r1, r1, lsl #12
  601. 80086bc: f000 8088 beq.w 80087d0 <__aeabi_ddiv+0x144>
  602. 80086c0: ea4f 3303 mov.w r3, r3, lsl #12
  603. 80086c4: f04f 5580 mov.w r5, #268435456 ; 0x10000000
  604. 80086c8: ea45 1313 orr.w r3, r5, r3, lsr #4
  605. 80086cc: ea43 6312 orr.w r3, r3, r2, lsr #24
  606. 80086d0: ea4f 2202 mov.w r2, r2, lsl #8
  607. 80086d4: ea45 1511 orr.w r5, r5, r1, lsr #4
  608. 80086d8: ea45 6510 orr.w r5, r5, r0, lsr #24
  609. 80086dc: ea4f 2600 mov.w r6, r0, lsl #8
  610. 80086e0: f00e 4100 and.w r1, lr, #2147483648 ; 0x80000000
  611. 80086e4: 429d cmp r5, r3
  612. 80086e6: bf08 it eq
  613. 80086e8: 4296 cmpeq r6, r2
  614. 80086ea: f144 04fd adc.w r4, r4, #253 ; 0xfd
  615. 80086ee: f504 7440 add.w r4, r4, #768 ; 0x300
  616. 80086f2: d202 bcs.n 80086fa <__aeabi_ddiv+0x6e>
  617. 80086f4: 085b lsrs r3, r3, #1
  618. 80086f6: ea4f 0232 mov.w r2, r2, rrx
  619. 80086fa: 1ab6 subs r6, r6, r2
  620. 80086fc: eb65 0503 sbc.w r5, r5, r3
  621. 8008700: 085b lsrs r3, r3, #1
  622. 8008702: ea4f 0232 mov.w r2, r2, rrx
  623. 8008706: f44f 1080 mov.w r0, #1048576 ; 0x100000
  624. 800870a: f44f 2c00 mov.w ip, #524288 ; 0x80000
  625. 800870e: ebb6 0e02 subs.w lr, r6, r2
  626. 8008712: eb75 0e03 sbcs.w lr, r5, r3
  627. 8008716: bf22 ittt cs
  628. 8008718: 1ab6 subcs r6, r6, r2
  629. 800871a: 4675 movcs r5, lr
  630. 800871c: ea40 000c orrcs.w r0, r0, ip
  631. 8008720: 085b lsrs r3, r3, #1
  632. 8008722: ea4f 0232 mov.w r2, r2, rrx
  633. 8008726: ebb6 0e02 subs.w lr, r6, r2
  634. 800872a: eb75 0e03 sbcs.w lr, r5, r3
  635. 800872e: bf22 ittt cs
  636. 8008730: 1ab6 subcs r6, r6, r2
  637. 8008732: 4675 movcs r5, lr
  638. 8008734: ea40 005c orrcs.w r0, r0, ip, lsr #1
  639. 8008738: 085b lsrs r3, r3, #1
  640. 800873a: ea4f 0232 mov.w r2, r2, rrx
  641. 800873e: ebb6 0e02 subs.w lr, r6, r2
  642. 8008742: eb75 0e03 sbcs.w lr, r5, r3
  643. 8008746: bf22 ittt cs
  644. 8008748: 1ab6 subcs r6, r6, r2
  645. 800874a: 4675 movcs r5, lr
  646. 800874c: ea40 009c orrcs.w r0, r0, ip, lsr #2
  647. 8008750: 085b lsrs r3, r3, #1
  648. 8008752: ea4f 0232 mov.w r2, r2, rrx
  649. 8008756: ebb6 0e02 subs.w lr, r6, r2
  650. 800875a: eb75 0e03 sbcs.w lr, r5, r3
  651. 800875e: bf22 ittt cs
  652. 8008760: 1ab6 subcs r6, r6, r2
  653. 8008762: 4675 movcs r5, lr
  654. 8008764: ea40 00dc orrcs.w r0, r0, ip, lsr #3
  655. 8008768: ea55 0e06 orrs.w lr, r5, r6
  656. 800876c: d018 beq.n 80087a0 <__aeabi_ddiv+0x114>
  657. 800876e: ea4f 1505 mov.w r5, r5, lsl #4
  658. 8008772: ea45 7516 orr.w r5, r5, r6, lsr #28
  659. 8008776: ea4f 1606 mov.w r6, r6, lsl #4
  660. 800877a: ea4f 03c3 mov.w r3, r3, lsl #3
  661. 800877e: ea43 7352 orr.w r3, r3, r2, lsr #29
  662. 8008782: ea4f 02c2 mov.w r2, r2, lsl #3
  663. 8008786: ea5f 1c1c movs.w ip, ip, lsr #4
  664. 800878a: d1c0 bne.n 800870e <__aeabi_ddiv+0x82>
  665. 800878c: f411 1f80 tst.w r1, #1048576 ; 0x100000
  666. 8008790: d10b bne.n 80087aa <__aeabi_ddiv+0x11e>
  667. 8008792: ea41 0100 orr.w r1, r1, r0
  668. 8008796: f04f 0000 mov.w r0, #0
  669. 800879a: f04f 4c00 mov.w ip, #2147483648 ; 0x80000000
  670. 800879e: e7b6 b.n 800870e <__aeabi_ddiv+0x82>
  671. 80087a0: f411 1f80 tst.w r1, #1048576 ; 0x100000
  672. 80087a4: bf04 itt eq
  673. 80087a6: 4301 orreq r1, r0
  674. 80087a8: 2000 moveq r0, #0
  675. 80087aa: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
  676. 80087ae: bf88 it hi
  677. 80087b0: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
  678. 80087b4: f63f aeaf bhi.w 8008516 <__aeabi_dmul+0xde>
  679. 80087b8: ebb5 0c03 subs.w ip, r5, r3
  680. 80087bc: bf04 itt eq
  681. 80087be: ebb6 0c02 subseq.w ip, r6, r2
  682. 80087c2: ea5f 0c50 movseq.w ip, r0, lsr #1
  683. 80087c6: f150 0000 adcs.w r0, r0, #0
  684. 80087ca: eb41 5104 adc.w r1, r1, r4, lsl #20
  685. 80087ce: bd70 pop {r4, r5, r6, pc}
  686. 80087d0: f00e 4e00 and.w lr, lr, #2147483648 ; 0x80000000
  687. 80087d4: ea4e 3111 orr.w r1, lr, r1, lsr #12
  688. 80087d8: eb14 045c adds.w r4, r4, ip, lsr #1
  689. 80087dc: bfc2 ittt gt
  690. 80087de: ebd4 050c rsbsgt r5, r4, ip
  691. 80087e2: ea41 5104 orrgt.w r1, r1, r4, lsl #20
  692. 80087e6: bd70 popgt {r4, r5, r6, pc}
  693. 80087e8: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
  694. 80087ec: f04f 0e00 mov.w lr, #0
  695. 80087f0: 3c01 subs r4, #1
  696. 80087f2: e690 b.n 8008516 <__aeabi_dmul+0xde>
  697. 80087f4: ea45 0e06 orr.w lr, r5, r6
  698. 80087f8: e68d b.n 8008516 <__aeabi_dmul+0xde>
  699. 80087fa: ea0c 5513 and.w r5, ip, r3, lsr #20
  700. 80087fe: ea94 0f0c teq r4, ip
  701. 8008802: bf08 it eq
  702. 8008804: ea95 0f0c teqeq r5, ip
  703. 8008808: f43f af3b beq.w 8008682 <__aeabi_dmul+0x24a>
  704. 800880c: ea94 0f0c teq r4, ip
  705. 8008810: d10a bne.n 8008828 <__aeabi_ddiv+0x19c>
  706. 8008812: ea50 3401 orrs.w r4, r0, r1, lsl #12
  707. 8008816: f47f af34 bne.w 8008682 <__aeabi_dmul+0x24a>
  708. 800881a: ea95 0f0c teq r5, ip
  709. 800881e: f47f af25 bne.w 800866c <__aeabi_dmul+0x234>
  710. 8008822: 4610 mov r0, r2
  711. 8008824: 4619 mov r1, r3
  712. 8008826: e72c b.n 8008682 <__aeabi_dmul+0x24a>
  713. 8008828: ea95 0f0c teq r5, ip
  714. 800882c: d106 bne.n 800883c <__aeabi_ddiv+0x1b0>
  715. 800882e: ea52 3503 orrs.w r5, r2, r3, lsl #12
  716. 8008832: f43f aefd beq.w 8008630 <__aeabi_dmul+0x1f8>
  717. 8008836: 4610 mov r0, r2
  718. 8008838: 4619 mov r1, r3
  719. 800883a: e722 b.n 8008682 <__aeabi_dmul+0x24a>
  720. 800883c: ea50 0641 orrs.w r6, r0, r1, lsl #1
  721. 8008840: bf18 it ne
  722. 8008842: ea52 0643 orrsne.w r6, r2, r3, lsl #1
  723. 8008846: f47f aec5 bne.w 80085d4 <__aeabi_dmul+0x19c>
  724. 800884a: ea50 0441 orrs.w r4, r0, r1, lsl #1
  725. 800884e: f47f af0d bne.w 800866c <__aeabi_dmul+0x234>
  726. 8008852: ea52 0543 orrs.w r5, r2, r3, lsl #1
  727. 8008856: f47f aeeb bne.w 8008630 <__aeabi_dmul+0x1f8>
  728. 800885a: e712 b.n 8008682 <__aeabi_dmul+0x24a>
  729. 0800885c <__gedf2>:
  730. 800885c: f04f 3cff mov.w ip, #4294967295
  731. 8008860: e006 b.n 8008870 <__cmpdf2+0x4>
  732. 8008862: bf00 nop
  733. 08008864 <__ledf2>:
  734. 8008864: f04f 0c01 mov.w ip, #1
  735. 8008868: e002 b.n 8008870 <__cmpdf2+0x4>
  736. 800886a: bf00 nop
  737. 0800886c <__cmpdf2>:
  738. 800886c: f04f 0c01 mov.w ip, #1
  739. 8008870: f84d cd04 str.w ip, [sp, #-4]!
  740. 8008874: ea4f 0c41 mov.w ip, r1, lsl #1
  741. 8008878: ea7f 5c6c mvns.w ip, ip, asr #21
  742. 800887c: ea4f 0c43 mov.w ip, r3, lsl #1
  743. 8008880: bf18 it ne
  744. 8008882: ea7f 5c6c mvnsne.w ip, ip, asr #21
  745. 8008886: d01b beq.n 80088c0 <__cmpdf2+0x54>
  746. 8008888: b001 add sp, #4
  747. 800888a: ea50 0c41 orrs.w ip, r0, r1, lsl #1
  748. 800888e: bf0c ite eq
  749. 8008890: ea52 0c43 orrseq.w ip, r2, r3, lsl #1
  750. 8008894: ea91 0f03 teqne r1, r3
  751. 8008898: bf02 ittt eq
  752. 800889a: ea90 0f02 teqeq r0, r2
  753. 800889e: 2000 moveq r0, #0
  754. 80088a0: 4770 bxeq lr
  755. 80088a2: f110 0f00 cmn.w r0, #0
  756. 80088a6: ea91 0f03 teq r1, r3
  757. 80088aa: bf58 it pl
  758. 80088ac: 4299 cmppl r1, r3
  759. 80088ae: bf08 it eq
  760. 80088b0: 4290 cmpeq r0, r2
  761. 80088b2: bf2c ite cs
  762. 80088b4: 17d8 asrcs r0, r3, #31
  763. 80088b6: ea6f 70e3 mvncc.w r0, r3, asr #31
  764. 80088ba: f040 0001 orr.w r0, r0, #1
  765. 80088be: 4770 bx lr
  766. 80088c0: ea4f 0c41 mov.w ip, r1, lsl #1
  767. 80088c4: ea7f 5c6c mvns.w ip, ip, asr #21
  768. 80088c8: d102 bne.n 80088d0 <__cmpdf2+0x64>
  769. 80088ca: ea50 3c01 orrs.w ip, r0, r1, lsl #12
  770. 80088ce: d107 bne.n 80088e0 <__cmpdf2+0x74>
  771. 80088d0: ea4f 0c43 mov.w ip, r3, lsl #1
  772. 80088d4: ea7f 5c6c mvns.w ip, ip, asr #21
  773. 80088d8: d1d6 bne.n 8008888 <__cmpdf2+0x1c>
  774. 80088da: ea52 3c03 orrs.w ip, r2, r3, lsl #12
  775. 80088de: d0d3 beq.n 8008888 <__cmpdf2+0x1c>
  776. 80088e0: f85d 0b04 ldr.w r0, [sp], #4
  777. 80088e4: 4770 bx lr
  778. 80088e6: bf00 nop
  779. 080088e8 <__aeabi_cdrcmple>:
  780. 80088e8: 4684 mov ip, r0
  781. 80088ea: 4610 mov r0, r2
  782. 80088ec: 4662 mov r2, ip
  783. 80088ee: 468c mov ip, r1
  784. 80088f0: 4619 mov r1, r3
  785. 80088f2: 4663 mov r3, ip
  786. 80088f4: e000 b.n 80088f8 <__aeabi_cdcmpeq>
  787. 80088f6: bf00 nop
  788. 080088f8 <__aeabi_cdcmpeq>:
  789. 80088f8: b501 push {r0, lr}
  790. 80088fa: f7ff ffb7 bl 800886c <__cmpdf2>
  791. 80088fe: 2800 cmp r0, #0
  792. 8008900: bf48 it mi
  793. 8008902: f110 0f00 cmnmi.w r0, #0
  794. 8008906: bd01 pop {r0, pc}
  795. 08008908 <__aeabi_dcmpeq>:
  796. 8008908: f84d ed08 str.w lr, [sp, #-8]!
  797. 800890c: f7ff fff4 bl 80088f8 <__aeabi_cdcmpeq>
  798. 8008910: bf0c ite eq
  799. 8008912: 2001 moveq r0, #1
  800. 8008914: 2000 movne r0, #0
  801. 8008916: f85d fb08 ldr.w pc, [sp], #8
  802. 800891a: bf00 nop
  803. 0800891c <__aeabi_dcmplt>:
  804. 800891c: f84d ed08 str.w lr, [sp, #-8]!
  805. 8008920: f7ff ffea bl 80088f8 <__aeabi_cdcmpeq>
  806. 8008924: bf34 ite cc
  807. 8008926: 2001 movcc r0, #1
  808. 8008928: 2000 movcs r0, #0
  809. 800892a: f85d fb08 ldr.w pc, [sp], #8
  810. 800892e: bf00 nop
  811. 08008930 <__aeabi_dcmple>:
  812. 8008930: f84d ed08 str.w lr, [sp, #-8]!
  813. 8008934: f7ff ffe0 bl 80088f8 <__aeabi_cdcmpeq>
  814. 8008938: bf94 ite ls
  815. 800893a: 2001 movls r0, #1
  816. 800893c: 2000 movhi r0, #0
  817. 800893e: f85d fb08 ldr.w pc, [sp], #8
  818. 8008942: bf00 nop
  819. 08008944 <__aeabi_dcmpge>:
  820. 8008944: f84d ed08 str.w lr, [sp, #-8]!
  821. 8008948: f7ff ffce bl 80088e8 <__aeabi_cdrcmple>
  822. 800894c: bf94 ite ls
  823. 800894e: 2001 movls r0, #1
  824. 8008950: 2000 movhi r0, #0
  825. 8008952: f85d fb08 ldr.w pc, [sp], #8
  826. 8008956: bf00 nop
  827. 08008958 <__aeabi_dcmpgt>:
  828. 8008958: f84d ed08 str.w lr, [sp, #-8]!
  829. 800895c: f7ff ffc4 bl 80088e8 <__aeabi_cdrcmple>
  830. 8008960: bf34 ite cc
  831. 8008962: 2001 movcc r0, #1
  832. 8008964: 2000 movcs r0, #0
  833. 8008966: f85d fb08 ldr.w pc, [sp], #8
  834. 800896a: bf00 nop
  835. 0800896c <__aeabi_d2iz>:
  836. 800896c: ea4f 0241 mov.w r2, r1, lsl #1
  837. 8008970: f512 1200 adds.w r2, r2, #2097152 ; 0x200000
  838. 8008974: d215 bcs.n 80089a2 <__aeabi_d2iz+0x36>
  839. 8008976: d511 bpl.n 800899c <__aeabi_d2iz+0x30>
  840. 8008978: f46f 7378 mvn.w r3, #992 ; 0x3e0
  841. 800897c: ebb3 5262 subs.w r2, r3, r2, asr #21
  842. 8008980: d912 bls.n 80089a8 <__aeabi_d2iz+0x3c>
  843. 8008982: ea4f 23c1 mov.w r3, r1, lsl #11
  844. 8008986: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
  845. 800898a: ea43 5350 orr.w r3, r3, r0, lsr #21
  846. 800898e: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
  847. 8008992: fa23 f002 lsr.w r0, r3, r2
  848. 8008996: bf18 it ne
  849. 8008998: 4240 negne r0, r0
  850. 800899a: 4770 bx lr
  851. 800899c: f04f 0000 mov.w r0, #0
  852. 80089a0: 4770 bx lr
  853. 80089a2: ea50 3001 orrs.w r0, r0, r1, lsl #12
  854. 80089a6: d105 bne.n 80089b4 <__aeabi_d2iz+0x48>
  855. 80089a8: f011 4000 ands.w r0, r1, #2147483648 ; 0x80000000
  856. 80089ac: bf08 it eq
  857. 80089ae: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
  858. 80089b2: 4770 bx lr
  859. 80089b4: f04f 0000 mov.w r0, #0
  860. 80089b8: 4770 bx lr
  861. 80089ba: bf00 nop
  862. 080089bc <__aeabi_uldivmod>:
  863. 80089bc: b94b cbnz r3, 80089d2 <__aeabi_uldivmod+0x16>
  864. 80089be: b942 cbnz r2, 80089d2 <__aeabi_uldivmod+0x16>
  865. 80089c0: 2900 cmp r1, #0
  866. 80089c2: bf08 it eq
  867. 80089c4: 2800 cmpeq r0, #0
  868. 80089c6: d002 beq.n 80089ce <__aeabi_uldivmod+0x12>
  869. 80089c8: f04f 31ff mov.w r1, #4294967295
  870. 80089cc: 4608 mov r0, r1
  871. 80089ce: f000 b83b b.w 8008a48 <__aeabi_idiv0>
  872. 80089d2: b082 sub sp, #8
  873. 80089d4: 46ec mov ip, sp
  874. 80089d6: e92d 5000 stmdb sp!, {ip, lr}
  875. 80089da: f000 f81d bl 8008a18 <__gnu_uldivmod_helper>
  876. 80089de: f8dd e004 ldr.w lr, [sp, #4]
  877. 80089e2: b002 add sp, #8
  878. 80089e4: bc0c pop {r2, r3}
  879. 80089e6: 4770 bx lr
  880. 080089e8 <__gnu_ldivmod_helper>:
  881. 80089e8: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
  882. 80089ec: 4690 mov r8, r2
  883. 80089ee: 4699 mov r9, r3
  884. 80089f0: 4606 mov r6, r0
  885. 80089f2: 460f mov r7, r1
  886. 80089f4: f000 f82a bl 8008a4c <__divdi3>
  887. 80089f8: 9b08 ldr r3, [sp, #32]
  888. 80089fa: fba8 4500 umull r4, r5, r8, r0
  889. 80089fe: fb08 f801 mul.w r8, r8, r1
  890. 8008a02: fb00 8209 mla r2, r0, r9, r8
  891. 8008a06: 1955 adds r5, r2, r5
  892. 8008a08: 1b34 subs r4, r6, r4
  893. 8008a0a: eb67 0505 sbc.w r5, r7, r5
  894. 8008a0e: e9c3 4500 strd r4, r5, [r3]
  895. 8008a12: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
  896. 8008a16: bf00 nop
  897. 08008a18 <__gnu_uldivmod_helper>:
  898. 8008a18: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  899. 8008a1c: 4690 mov r8, r2
  900. 8008a1e: 4606 mov r6, r0
  901. 8008a20: 460f mov r7, r1
  902. 8008a22: 461d mov r5, r3
  903. 8008a24: f000 f9c8 bl 8008db8 <__udivdi3>
  904. 8008a28: fb00 f305 mul.w r3, r0, r5
  905. 8008a2c: fba0 4508 umull r4, r5, r0, r8
  906. 8008a30: fb08 3801 mla r8, r8, r1, r3
  907. 8008a34: 9b06 ldr r3, [sp, #24]
  908. 8008a36: 4445 add r5, r8
  909. 8008a38: 1b34 subs r4, r6, r4
  910. 8008a3a: eb67 0505 sbc.w r5, r7, r5
  911. 8008a3e: e9c3 4500 strd r4, r5, [r3]
  912. 8008a42: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  913. 8008a46: bf00 nop
  914. 08008a48 <__aeabi_idiv0>:
  915. 8008a48: 4770 bx lr
  916. 8008a4a: bf00 nop
  917. 08008a4c <__divdi3>:
  918. 8008a4c: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  919. 8008a50: 2500 movs r5, #0
  920. 8008a52: 2900 cmp r1, #0
  921. 8008a54: b085 sub sp, #20
  922. 8008a56: 461c mov r4, r3
  923. 8008a58: f2c0 8149 blt.w 8008cee <__divdi3+0x2a2>
  924. 8008a5c: 2c00 cmp r4, #0
  925. 8008a5e: f2c0 8141 blt.w 8008ce4 <__divdi3+0x298>
  926. 8008a62: 468c mov ip, r1
  927. 8008a64: 460f mov r7, r1
  928. 8008a66: 4682 mov sl, r0
  929. 8008a68: 4691 mov r9, r2
  930. 8008a6a: 4614 mov r4, r2
  931. 8008a6c: 4606 mov r6, r0
  932. 8008a6e: 4619 mov r1, r3
  933. 8008a70: 2b00 cmp r3, #0
  934. 8008a72: d14b bne.n 8008b0c <__divdi3+0xc0>
  935. 8008a74: 4562 cmp r2, ip
  936. 8008a76: d959 bls.n 8008b2c <__divdi3+0xe0>
  937. 8008a78: fab2 f382 clz r3, r2
  938. 8008a7c: b143 cbz r3, 8008a90 <__divdi3+0x44>
  939. 8008a7e: f1c3 0220 rsb r2, r3, #32
  940. 8008a82: fa0c f703 lsl.w r7, ip, r3
  941. 8008a86: fa20 f202 lsr.w r2, r0, r2
  942. 8008a8a: 409c lsls r4, r3
  943. 8008a8c: 4317 orrs r7, r2
  944. 8008a8e: 409e lsls r6, r3
  945. 8008a90: ea4f 4814 mov.w r8, r4, lsr #16
  946. 8008a94: 4638 mov r0, r7
  947. 8008a96: 4641 mov r1, r8
  948. 8008a98: fa1f f984 uxth.w r9, r4
  949. 8008a9c: f000 fb18 bl 80090d0 <__aeabi_uidiv>
  950. 8008aa0: 4641 mov r1, r8
  951. 8008aa2: 4682 mov sl, r0
  952. 8008aa4: 4638 mov r0, r7
  953. 8008aa6: f000 fc41 bl 800932c <__aeabi_uidivmod>
  954. 8008aaa: 0c33 lsrs r3, r6, #16
  955. 8008aac: fb09 f00a mul.w r0, r9, sl
  956. 8008ab0: ea43 4101 orr.w r1, r3, r1, lsl #16
  957. 8008ab4: 4288 cmp r0, r1
  958. 8008ab6: d90a bls.n 8008ace <__divdi3+0x82>
  959. 8008ab8: 1909 adds r1, r1, r4
  960. 8008aba: f10a 32ff add.w r2, sl, #4294967295
  961. 8008abe: d205 bcs.n 8008acc <__divdi3+0x80>
  962. 8008ac0: 4288 cmp r0, r1
  963. 8008ac2: bf84 itt hi
  964. 8008ac4: f1aa 0a02 subhi.w sl, sl, #2
  965. 8008ac8: 1909 addhi r1, r1, r4
  966. 8008aca: d800 bhi.n 8008ace <__divdi3+0x82>
  967. 8008acc: 4692 mov sl, r2
  968. 8008ace: ebc0 0b01 rsb fp, r0, r1
  969. 8008ad2: 4641 mov r1, r8
  970. 8008ad4: 4658 mov r0, fp
  971. 8008ad6: b2b6 uxth r6, r6
  972. 8008ad8: f000 fafa bl 80090d0 <__aeabi_uidiv>
  973. 8008adc: 4641 mov r1, r8
  974. 8008ade: 4607 mov r7, r0
  975. 8008ae0: 4658 mov r0, fp
  976. 8008ae2: f000 fc23 bl 800932c <__aeabi_uidivmod>
  977. 8008ae6: fb09 f907 mul.w r9, r9, r7
  978. 8008aea: ea46 4101 orr.w r1, r6, r1, lsl #16
  979. 8008aee: 4589 cmp r9, r1
  980. 8008af0: d907 bls.n 8008b02 <__divdi3+0xb6>
  981. 8008af2: 1e7b subs r3, r7, #1
  982. 8008af4: 190c adds r4, r1, r4
  983. 8008af6: f080 8157 bcs.w 8008da8 <__divdi3+0x35c>
  984. 8008afa: 3f02 subs r7, #2
  985. 8008afc: 45a1 cmp r9, r4
  986. 8008afe: f240 8153 bls.w 8008da8 <__divdi3+0x35c>
  987. 8008b02: ea47 400a orr.w r0, r7, sl, lsl #16
  988. 8008b06: f04f 0800 mov.w r8, #0
  989. 8008b0a: e004 b.n 8008b16 <__divdi3+0xca>
  990. 8008b0c: 4563 cmp r3, ip
  991. 8008b0e: d958 bls.n 8008bc2 <__divdi3+0x176>
  992. 8008b10: f04f 0800 mov.w r8, #0
  993. 8008b14: 4640 mov r0, r8
  994. 8008b16: 4602 mov r2, r0
  995. 8008b18: 4643 mov r3, r8
  996. 8008b1a: b115 cbz r5, 8008b22 <__divdi3+0xd6>
  997. 8008b1c: 4252 negs r2, r2
  998. 8008b1e: eb63 0343 sbc.w r3, r3, r3, lsl #1
  999. 8008b22: 4610 mov r0, r2
  1000. 8008b24: 4619 mov r1, r3
  1001. 8008b26: b005 add sp, #20
  1002. 8008b28: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  1003. 8008b2c: b922 cbnz r2, 8008b38 <__divdi3+0xec>
  1004. 8008b2e: 2001 movs r0, #1
  1005. 8008b30: 4611 mov r1, r2
  1006. 8008b32: f000 facd bl 80090d0 <__aeabi_uidiv>
  1007. 8008b36: 4604 mov r4, r0
  1008. 8008b38: fab4 f384 clz r3, r4
  1009. 8008b3c: 2b00 cmp r3, #0
  1010. 8008b3e: f040 80dc bne.w 8008cfa <__divdi3+0x2ae>
  1011. 8008b42: 1b3f subs r7, r7, r4
  1012. 8008b44: ea4f 4914 mov.w r9, r4, lsr #16
  1013. 8008b48: fa1f fa84 uxth.w sl, r4
  1014. 8008b4c: f04f 0801 mov.w r8, #1
  1015. 8008b50: 4649 mov r1, r9
  1016. 8008b52: 4638 mov r0, r7
  1017. 8008b54: f000 fabc bl 80090d0 <__aeabi_uidiv>
  1018. 8008b58: 4649 mov r1, r9
  1019. 8008b5a: 4683 mov fp, r0
  1020. 8008b5c: 4638 mov r0, r7
  1021. 8008b5e: f000 fbe5 bl 800932c <__aeabi_uidivmod>
  1022. 8008b62: 0c33 lsrs r3, r6, #16
  1023. 8008b64: fb0a f00b mul.w r0, sl, fp
  1024. 8008b68: ea43 4101 orr.w r1, r3, r1, lsl #16
  1025. 8008b6c: 4288 cmp r0, r1
  1026. 8008b6e: d90b bls.n 8008b88 <__divdi3+0x13c>
  1027. 8008b70: 1909 adds r1, r1, r4
  1028. 8008b72: f10b 33ff add.w r3, fp, #4294967295
  1029. 8008b76: f080 8115 bcs.w 8008da4 <__divdi3+0x358>
  1030. 8008b7a: 4288 cmp r0, r1
  1031. 8008b7c: bf84 itt hi
  1032. 8008b7e: f1ab 0b02 subhi.w fp, fp, #2
  1033. 8008b82: 1909 addhi r1, r1, r4
  1034. 8008b84: f240 810e bls.w 8008da4 <__divdi3+0x358>
  1035. 8008b88: 1a0b subs r3, r1, r0
  1036. 8008b8a: 4649 mov r1, r9
  1037. 8008b8c: 4618 mov r0, r3
  1038. 8008b8e: 9301 str r3, [sp, #4]
  1039. 8008b90: f000 fa9e bl 80090d0 <__aeabi_uidiv>
  1040. 8008b94: 9b01 ldr r3, [sp, #4]
  1041. 8008b96: 4649 mov r1, r9
  1042. 8008b98: b2b6 uxth r6, r6
  1043. 8008b9a: 4607 mov r7, r0
  1044. 8008b9c: 4618 mov r0, r3
  1045. 8008b9e: f000 fbc5 bl 800932c <__aeabi_uidivmod>
  1046. 8008ba2: fb0a fa07 mul.w sl, sl, r7
  1047. 8008ba6: ea46 4101 orr.w r1, r6, r1, lsl #16
  1048. 8008baa: 458a cmp sl, r1
  1049. 8008bac: d906 bls.n 8008bbc <__divdi3+0x170>
  1050. 8008bae: 1e7b subs r3, r7, #1
  1051. 8008bb0: 190c adds r4, r1, r4
  1052. 8008bb2: d202 bcs.n 8008bba <__divdi3+0x16e>
  1053. 8008bb4: 3f02 subs r7, #2
  1054. 8008bb6: 45a2 cmp sl, r4
  1055. 8008bb8: d800 bhi.n 8008bbc <__divdi3+0x170>
  1056. 8008bba: 461f mov r7, r3
  1057. 8008bbc: ea47 400b orr.w r0, r7, fp, lsl #16
  1058. 8008bc0: e7a9 b.n 8008b16 <__divdi3+0xca>
  1059. 8008bc2: fab3 f483 clz r4, r3
  1060. 8008bc6: 2c00 cmp r4, #0
  1061. 8008bc8: f000 80e4 beq.w 8008d94 <__divdi3+0x348>
  1062. 8008bcc: f1c4 0320 rsb r3, r4, #32
  1063. 8008bd0: fa01 f104 lsl.w r1, r1, r4
  1064. 8008bd4: fa22 fa03 lsr.w sl, r2, r3
  1065. 8008bd8: fa2c fb03 lsr.w fp, ip, r3
  1066. 8008bdc: ea4a 0a01 orr.w sl, sl, r1
  1067. 8008be0: fa20 f803 lsr.w r8, r0, r3
  1068. 8008be4: fa0c fc04 lsl.w ip, ip, r4
  1069. 8008be8: 4658 mov r0, fp
  1070. 8008bea: ea4f 471a mov.w r7, sl, lsr #16
  1071. 8008bee: ea48 080c orr.w r8, r8, ip
  1072. 8008bf2: 4639 mov r1, r7
  1073. 8008bf4: fa02 f904 lsl.w r9, r2, r4
  1074. 8008bf8: f8cd 900c str.w r9, [sp, #12]
  1075. 8008bfc: f000 fa68 bl 80090d0 <__aeabi_uidiv>
  1076. 8008c00: 4639 mov r1, r7
  1077. 8008c02: 4681 mov r9, r0
  1078. 8008c04: 4658 mov r0, fp
  1079. 8008c06: f000 fb91 bl 800932c <__aeabi_uidivmod>
  1080. 8008c0a: fa1f fc8a uxth.w ip, sl
  1081. 8008c0e: ea4f 4318 mov.w r3, r8, lsr #16
  1082. 8008c12: fb0c f009 mul.w r0, ip, r9
  1083. 8008c16: ea43 4301 orr.w r3, r3, r1, lsl #16
  1084. 8008c1a: 4298 cmp r0, r3
  1085. 8008c1c: d90c bls.n 8008c38 <__divdi3+0x1ec>
  1086. 8008c1e: eb13 030a adds.w r3, r3, sl
  1087. 8008c22: f109 31ff add.w r1, r9, #4294967295
  1088. 8008c26: f080 80c3 bcs.w 8008db0 <__divdi3+0x364>
  1089. 8008c2a: 4298 cmp r0, r3
  1090. 8008c2c: bf84 itt hi
  1091. 8008c2e: f1a9 0902 subhi.w r9, r9, #2
  1092. 8008c32: 4453 addhi r3, sl
  1093. 8008c34: f240 80bc bls.w 8008db0 <__divdi3+0x364>
  1094. 8008c38: 1a1b subs r3, r3, r0
  1095. 8008c3a: 4639 mov r1, r7
  1096. 8008c3c: 4618 mov r0, r3
  1097. 8008c3e: f8cd c008 str.w ip, [sp, #8]
  1098. 8008c42: 9301 str r3, [sp, #4]
  1099. 8008c44: f000 fa44 bl 80090d0 <__aeabi_uidiv>
  1100. 8008c48: 9b01 ldr r3, [sp, #4]
  1101. 8008c4a: 4639 mov r1, r7
  1102. 8008c4c: fa1f f888 uxth.w r8, r8
  1103. 8008c50: 4683 mov fp, r0
  1104. 8008c52: 4618 mov r0, r3
  1105. 8008c54: f000 fb6a bl 800932c <__aeabi_uidivmod>
  1106. 8008c58: f8dd c008 ldr.w ip, [sp, #8]
  1107. 8008c5c: fb0c f30b mul.w r3, ip, fp
  1108. 8008c60: ea48 4101 orr.w r1, r8, r1, lsl #16
  1109. 8008c64: 428b cmp r3, r1
  1110. 8008c66: d90c bls.n 8008c82 <__divdi3+0x236>
  1111. 8008c68: eb11 010a adds.w r1, r1, sl
  1112. 8008c6c: f10b 30ff add.w r0, fp, #4294967295
  1113. 8008c70: f080 809c bcs.w 8008dac <__divdi3+0x360>
  1114. 8008c74: 428b cmp r3, r1
  1115. 8008c76: bf84 itt hi
  1116. 8008c78: f1ab 0b02 subhi.w fp, fp, #2
  1117. 8008c7c: 4451 addhi r1, sl
  1118. 8008c7e: f240 8095 bls.w 8008dac <__divdi3+0x360>
  1119. 8008c82: 9f03 ldr r7, [sp, #12]
  1120. 8008c84: ea4b 4009 orr.w r0, fp, r9, lsl #16
  1121. 8008c88: 1ac9 subs r1, r1, r3
  1122. 8008c8a: fa1f fc80 uxth.w ip, r0
  1123. 8008c8e: b2ba uxth r2, r7
  1124. 8008c90: ea4f 4917 mov.w r9, r7, lsr #16
  1125. 8008c94: 0c07 lsrs r7, r0, #16
  1126. 8008c96: fb02 f80c mul.w r8, r2, ip
  1127. 8008c9a: fb02 f207 mul.w r2, r2, r7
  1128. 8008c9e: fb09 230c mla r3, r9, ip, r2
  1129. 8008ca2: fb09 f907 mul.w r9, r9, r7
  1130. 8008ca6: eb03 4318 add.w r3, r3, r8, lsr #16
  1131. 8008caa: 429a cmp r2, r3
  1132. 8008cac: bf88 it hi
  1133. 8008cae: f509 3980 addhi.w r9, r9, #65536 ; 0x10000
  1134. 8008cb2: eb09 4913 add.w r9, r9, r3, lsr #16
  1135. 8008cb6: 4549 cmp r1, r9
  1136. 8008cb8: d310 bcc.n 8008cdc <__divdi3+0x290>
  1137. 8008cba: fa1f f888 uxth.w r8, r8
  1138. 8008cbe: bf14 ite ne
  1139. 8008cc0: 2200 movne r2, #0
  1140. 8008cc2: 2201 moveq r2, #1
  1141. 8008cc4: fa06 f404 lsl.w r4, r6, r4
  1142. 8008cc8: eb08 4303 add.w r3, r8, r3, lsl #16
  1143. 8008ccc: 429c cmp r4, r3
  1144. 8008cce: bf2c ite cs
  1145. 8008cd0: 2300 movcs r3, #0
  1146. 8008cd2: f002 0301 andcc.w r3, r2, #1
  1147. 8008cd6: 2b00 cmp r3, #0
  1148. 8008cd8: f43f af15 beq.w 8008b06 <__divdi3+0xba>
  1149. 8008cdc: 3801 subs r0, #1
  1150. 8008cde: f04f 0800 mov.w r8, #0
  1151. 8008ce2: e718 b.n 8008b16 <__divdi3+0xca>
  1152. 8008ce4: 4252 negs r2, r2
  1153. 8008ce6: eb63 0343 sbc.w r3, r3, r3, lsl #1
  1154. 8008cea: 43ed mvns r5, r5
  1155. 8008cec: e6b9 b.n 8008a62 <__divdi3+0x16>
  1156. 8008cee: 4240 negs r0, r0
  1157. 8008cf0: eb61 0141 sbc.w r1, r1, r1, lsl #1
  1158. 8008cf4: f04f 35ff mov.w r5, #4294967295
  1159. 8008cf8: e6b0 b.n 8008a5c <__divdi3+0x10>
  1160. 8008cfa: 409c lsls r4, r3
  1161. 8008cfc: f1c3 0b20 rsb fp, r3, #32
  1162. 8008d00: fa27 f80b lsr.w r8, r7, fp
  1163. 8008d04: fa07 f703 lsl.w r7, r7, r3
  1164. 8008d08: ea4f 4914 mov.w r9, r4, lsr #16
  1165. 8008d0c: 4640 mov r0, r8
  1166. 8008d0e: 4649 mov r1, r9
  1167. 8008d10: fa26 fb0b lsr.w fp, r6, fp
  1168. 8008d14: 409e lsls r6, r3
  1169. 8008d16: f000 f9db bl 80090d0 <__aeabi_uidiv>
  1170. 8008d1a: 4649 mov r1, r9
  1171. 8008d1c: fa1f fa84 uxth.w sl, r4
  1172. 8008d20: ea4b 0b07 orr.w fp, fp, r7
  1173. 8008d24: 4603 mov r3, r0
  1174. 8008d26: 4640 mov r0, r8
  1175. 8008d28: 9301 str r3, [sp, #4]
  1176. 8008d2a: f000 faff bl 800932c <__aeabi_uidivmod>
  1177. 8008d2e: 9b01 ldr r3, [sp, #4]
  1178. 8008d30: ea4f 421b mov.w r2, fp, lsr #16
  1179. 8008d34: fb0a f003 mul.w r0, sl, r3
  1180. 8008d38: ea42 4101 orr.w r1, r2, r1, lsl #16
  1181. 8008d3c: 4288 cmp r0, r1
  1182. 8008d3e: d906 bls.n 8008d4e <__divdi3+0x302>
  1183. 8008d40: 1e5a subs r2, r3, #1
  1184. 8008d42: 1909 adds r1, r1, r4
  1185. 8008d44: d236 bcs.n 8008db4 <__divdi3+0x368>
  1186. 8008d46: 4288 cmp r0, r1
  1187. 8008d48: d934 bls.n 8008db4 <__divdi3+0x368>
  1188. 8008d4a: 3b02 subs r3, #2
  1189. 8008d4c: 1909 adds r1, r1, r4
  1190. 8008d4e: 1a0f subs r7, r1, r0
  1191. 8008d50: 4649 mov r1, r9
  1192. 8008d52: 4638 mov r0, r7
  1193. 8008d54: 9301 str r3, [sp, #4]
  1194. 8008d56: f000 f9bb bl 80090d0 <__aeabi_uidiv>
  1195. 8008d5a: 4649 mov r1, r9
  1196. 8008d5c: fa1f fb8b uxth.w fp, fp
  1197. 8008d60: 4680 mov r8, r0
  1198. 8008d62: 4638 mov r0, r7
  1199. 8008d64: f000 fae2 bl 800932c <__aeabi_uidivmod>
  1200. 8008d68: 9b01 ldr r3, [sp, #4]
  1201. 8008d6a: fb0a f708 mul.w r7, sl, r8
  1202. 8008d6e: ea4b 4101 orr.w r1, fp, r1, lsl #16
  1203. 8008d72: 428f cmp r7, r1
  1204. 8008d74: d90a bls.n 8008d8c <__divdi3+0x340>
  1205. 8008d76: 1909 adds r1, r1, r4
  1206. 8008d78: f108 32ff add.w r2, r8, #4294967295
  1207. 8008d7c: d205 bcs.n 8008d8a <__divdi3+0x33e>
  1208. 8008d7e: 428f cmp r7, r1
  1209. 8008d80: bf84 itt hi
  1210. 8008d82: f1a8 0802 subhi.w r8, r8, #2
  1211. 8008d86: 1909 addhi r1, r1, r4
  1212. 8008d88: d800 bhi.n 8008d8c <__divdi3+0x340>
  1213. 8008d8a: 4690 mov r8, r2
  1214. 8008d8c: 1bcf subs r7, r1, r7
  1215. 8008d8e: ea48 4803 orr.w r8, r8, r3, lsl #16
  1216. 8008d92: e6dd b.n 8008b50 <__divdi3+0x104>
  1217. 8008d94: 2001 movs r0, #1
  1218. 8008d96: 4563 cmp r3, ip
  1219. 8008d98: bf28 it cs
  1220. 8008d9a: 4552 cmpcs r2, sl
  1221. 8008d9c: 46a0 mov r8, r4
  1222. 8008d9e: f67f aeba bls.w 8008b16 <__divdi3+0xca>
  1223. 8008da2: e6b5 b.n 8008b10 <__divdi3+0xc4>
  1224. 8008da4: 469b mov fp, r3
  1225. 8008da6: e6ef b.n 8008b88 <__divdi3+0x13c>
  1226. 8008da8: 461f mov r7, r3
  1227. 8008daa: e6aa b.n 8008b02 <__divdi3+0xb6>
  1228. 8008dac: 4683 mov fp, r0
  1229. 8008dae: e768 b.n 8008c82 <__divdi3+0x236>
  1230. 8008db0: 4689 mov r9, r1
  1231. 8008db2: e741 b.n 8008c38 <__divdi3+0x1ec>
  1232. 8008db4: 4613 mov r3, r2
  1233. 8008db6: e7ca b.n 8008d4e <__divdi3+0x302>
  1234. 08008db8 <__udivdi3>:
  1235. 8008db8: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  1236. 8008dbc: 4606 mov r6, r0
  1237. 8008dbe: b083 sub sp, #12
  1238. 8008dc0: 460d mov r5, r1
  1239. 8008dc2: 4614 mov r4, r2
  1240. 8008dc4: 4607 mov r7, r0
  1241. 8008dc6: 4688 mov r8, r1
  1242. 8008dc8: 2b00 cmp r3, #0
  1243. 8008dca: d14a bne.n 8008e62 <__udivdi3+0xaa>
  1244. 8008dcc: 428a cmp r2, r1
  1245. 8008dce: d955 bls.n 8008e7c <__udivdi3+0xc4>
  1246. 8008dd0: fab2 f382 clz r3, r2
  1247. 8008dd4: b14b cbz r3, 8008dea <__udivdi3+0x32>
  1248. 8008dd6: f1c3 0220 rsb r2, r3, #32
  1249. 8008dda: fa01 f803 lsl.w r8, r1, r3
  1250. 8008dde: fa20 f202 lsr.w r2, r0, r2
  1251. 8008de2: 409c lsls r4, r3
  1252. 8008de4: ea42 0808 orr.w r8, r2, r8
  1253. 8008de8: 409f lsls r7, r3
  1254. 8008dea: 0c25 lsrs r5, r4, #16
  1255. 8008dec: 4640 mov r0, r8
  1256. 8008dee: 4629 mov r1, r5
  1257. 8008df0: fa1f fa84 uxth.w sl, r4
  1258. 8008df4: f000 f96c bl 80090d0 <__aeabi_uidiv>
  1259. 8008df8: 4629 mov r1, r5
  1260. 8008dfa: 4681 mov r9, r0
  1261. 8008dfc: 4640 mov r0, r8
  1262. 8008dfe: f000 fa95 bl 800932c <__aeabi_uidivmod>
  1263. 8008e02: 0c3b lsrs r3, r7, #16
  1264. 8008e04: fb0a f009 mul.w r0, sl, r9
  1265. 8008e08: ea43 4101 orr.w r1, r3, r1, lsl #16
  1266. 8008e0c: 4288 cmp r0, r1
  1267. 8008e0e: d90a bls.n 8008e26 <__udivdi3+0x6e>
  1268. 8008e10: 1909 adds r1, r1, r4
  1269. 8008e12: f109 32ff add.w r2, r9, #4294967295
  1270. 8008e16: d205 bcs.n 8008e24 <__udivdi3+0x6c>
  1271. 8008e18: 4288 cmp r0, r1
  1272. 8008e1a: bf84 itt hi
  1273. 8008e1c: f1a9 0902 subhi.w r9, r9, #2
  1274. 8008e20: 1909 addhi r1, r1, r4
  1275. 8008e22: d800 bhi.n 8008e26 <__udivdi3+0x6e>
  1276. 8008e24: 4691 mov r9, r2
  1277. 8008e26: ebc0 0801 rsb r8, r0, r1
  1278. 8008e2a: 4629 mov r1, r5
  1279. 8008e2c: 4640 mov r0, r8
  1280. 8008e2e: b2bf uxth r7, r7
  1281. 8008e30: f000 f94e bl 80090d0 <__aeabi_uidiv>
  1282. 8008e34: 4629 mov r1, r5
  1283. 8008e36: 4606 mov r6, r0
  1284. 8008e38: 4640 mov r0, r8
  1285. 8008e3a: f000 fa77 bl 800932c <__aeabi_uidivmod>
  1286. 8008e3e: fb0a fa06 mul.w sl, sl, r6
  1287. 8008e42: ea47 4101 orr.w r1, r7, r1, lsl #16
  1288. 8008e46: 458a cmp sl, r1
  1289. 8008e48: d907 bls.n 8008e5a <__udivdi3+0xa2>
  1290. 8008e4a: 1e73 subs r3, r6, #1
  1291. 8008e4c: 190c adds r4, r1, r4
  1292. 8008e4e: f080 8122 bcs.w 8009096 <__udivdi3+0x2de>
  1293. 8008e52: 3e02 subs r6, #2
  1294. 8008e54: 45a2 cmp sl, r4
  1295. 8008e56: f240 811e bls.w 8009096 <__udivdi3+0x2de>
  1296. 8008e5a: ea46 4009 orr.w r0, r6, r9, lsl #16
  1297. 8008e5e: 2600 movs r6, #0
  1298. 8008e60: e058 b.n 8008f14 <__udivdi3+0x15c>
  1299. 8008e62: 428b cmp r3, r1
  1300. 8008e64: d854 bhi.n 8008f10 <__udivdi3+0x158>
  1301. 8008e66: fab3 f483 clz r4, r3
  1302. 8008e6a: 2c00 cmp r4, #0
  1303. 8008e6c: d156 bne.n 8008f1c <__udivdi3+0x164>
  1304. 8008e6e: 428b cmp r3, r1
  1305. 8008e70: bf28 it cs
  1306. 8008e72: 4282 cmpcs r2, r0
  1307. 8008e74: d84c bhi.n 8008f10 <__udivdi3+0x158>
  1308. 8008e76: 4626 mov r6, r4
  1309. 8008e78: 2001 movs r0, #1
  1310. 8008e7a: e04b b.n 8008f14 <__udivdi3+0x15c>
  1311. 8008e7c: b922 cbnz r2, 8008e88 <__udivdi3+0xd0>
  1312. 8008e7e: 2001 movs r0, #1
  1313. 8008e80: 4611 mov r1, r2
  1314. 8008e82: f000 f925 bl 80090d0 <__aeabi_uidiv>
  1315. 8008e86: 4604 mov r4, r0
  1316. 8008e88: fab4 f384 clz r3, r4
  1317. 8008e8c: 2b00 cmp r3, #0
  1318. 8008e8e: f040 80b9 bne.w 8009004 <__udivdi3+0x24c>
  1319. 8008e92: 1b2d subs r5, r5, r4
  1320. 8008e94: ea4f 4814 mov.w r8, r4, lsr #16
  1321. 8008e98: fa1f fa84 uxth.w sl, r4
  1322. 8008e9c: 2601 movs r6, #1
  1323. 8008e9e: 4641 mov r1, r8
  1324. 8008ea0: 4628 mov r0, r5
  1325. 8008ea2: f000 f915 bl 80090d0 <__aeabi_uidiv>
  1326. 8008ea6: 4641 mov r1, r8
  1327. 8008ea8: 4681 mov r9, r0
  1328. 8008eaa: 4628 mov r0, r5
  1329. 8008eac: f000 fa3e bl 800932c <__aeabi_uidivmod>
  1330. 8008eb0: 0c3b lsrs r3, r7, #16
  1331. 8008eb2: fb0a f009 mul.w r0, sl, r9
  1332. 8008eb6: ea43 4101 orr.w r1, r3, r1, lsl #16
  1333. 8008eba: 4288 cmp r0, r1
  1334. 8008ebc: d90b bls.n 8008ed6 <__udivdi3+0x11e>
  1335. 8008ebe: 1909 adds r1, r1, r4
  1336. 8008ec0: f109 33ff add.w r3, r9, #4294967295
  1337. 8008ec4: f080 80e9 bcs.w 800909a <__udivdi3+0x2e2>
  1338. 8008ec8: 4288 cmp r0, r1
  1339. 8008eca: bf84 itt hi
  1340. 8008ecc: f1a9 0902 subhi.w r9, r9, #2
  1341. 8008ed0: 1909 addhi r1, r1, r4
  1342. 8008ed2: f240 80e2 bls.w 800909a <__udivdi3+0x2e2>
  1343. 8008ed6: ebc0 0b01 rsb fp, r0, r1
  1344. 8008eda: 4641 mov r1, r8
  1345. 8008edc: 4658 mov r0, fp
  1346. 8008ede: b2bf uxth r7, r7
  1347. 8008ee0: f000 f8f6 bl 80090d0 <__aeabi_uidiv>
  1348. 8008ee4: 4641 mov r1, r8
  1349. 8008ee6: 4605 mov r5, r0
  1350. 8008ee8: 4658 mov r0, fp
  1351. 8008eea: f000 fa1f bl 800932c <__aeabi_uidivmod>
  1352. 8008eee: fb0a fa05 mul.w sl, sl, r5
  1353. 8008ef2: ea47 4101 orr.w r1, r7, r1, lsl #16
  1354. 8008ef6: 458a cmp sl, r1
  1355. 8008ef8: d907 bls.n 8008f0a <__udivdi3+0x152>
  1356. 8008efa: 1e6b subs r3, r5, #1
  1357. 8008efc: 190c adds r4, r1, r4
  1358. 8008efe: f080 80ce bcs.w 800909e <__udivdi3+0x2e6>
  1359. 8008f02: 3d02 subs r5, #2
  1360. 8008f04: 45a2 cmp sl, r4
  1361. 8008f06: f240 80ca bls.w 800909e <__udivdi3+0x2e6>
  1362. 8008f0a: ea45 4009 orr.w r0, r5, r9, lsl #16
  1363. 8008f0e: e001 b.n 8008f14 <__udivdi3+0x15c>
  1364. 8008f10: 2600 movs r6, #0
  1365. 8008f12: 4630 mov r0, r6
  1366. 8008f14: 4631 mov r1, r6
  1367. 8008f16: b003 add sp, #12
  1368. 8008f18: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  1369. 8008f1c: f1c4 0120 rsb r1, r4, #32
  1370. 8008f20: fa03 f304 lsl.w r3, r3, r4
  1371. 8008f24: fa22 f801 lsr.w r8, r2, r1
  1372. 8008f28: fa25 f701 lsr.w r7, r5, r1
  1373. 8008f2c: ea48 0803 orr.w r8, r8, r3
  1374. 8008f30: fa20 f101 lsr.w r1, r0, r1
  1375. 8008f34: fa05 f504 lsl.w r5, r5, r4
  1376. 8008f38: 4638 mov r0, r7
  1377. 8008f3a: ea4f 4918 mov.w r9, r8, lsr #16
  1378. 8008f3e: 430d orrs r5, r1
  1379. 8008f40: 4649 mov r1, r9
  1380. 8008f42: fa02 f204 lsl.w r2, r2, r4
  1381. 8008f46: 9201 str r2, [sp, #4]
  1382. 8008f48: f000 f8c2 bl 80090d0 <__aeabi_uidiv>
  1383. 8008f4c: 4649 mov r1, r9
  1384. 8008f4e: 4682 mov sl, r0
  1385. 8008f50: 4638 mov r0, r7
  1386. 8008f52: f000 f9eb bl 800932c <__aeabi_uidivmod>
  1387. 8008f56: fa1f f288 uxth.w r2, r8
  1388. 8008f5a: 0c2f lsrs r7, r5, #16
  1389. 8008f5c: fb02 f00a mul.w r0, r2, sl
  1390. 8008f60: ea47 4701 orr.w r7, r7, r1, lsl #16
  1391. 8008f64: 42b8 cmp r0, r7
  1392. 8008f66: d906 bls.n 8008f76 <__udivdi3+0x1be>
  1393. 8008f68: eb17 0708 adds.w r7, r7, r8
  1394. 8008f6c: f10a 31ff add.w r1, sl, #4294967295
  1395. 8008f70: f0c0 809f bcc.w 80090b2 <__udivdi3+0x2fa>
  1396. 8008f74: 468a mov sl, r1
  1397. 8008f76: 1a3f subs r7, r7, r0
  1398. 8008f78: 4649 mov r1, r9
  1399. 8008f7a: 4638 mov r0, r7
  1400. 8008f7c: 9200 str r2, [sp, #0]
  1401. 8008f7e: f000 f8a7 bl 80090d0 <__aeabi_uidiv>
  1402. 8008f82: 4649 mov r1, r9
  1403. 8008f84: b2ad uxth r5, r5
  1404. 8008f86: 4683 mov fp, r0
  1405. 8008f88: 4638 mov r0, r7
  1406. 8008f8a: f000 f9cf bl 800932c <__aeabi_uidivmod>
  1407. 8008f8e: 9a00 ldr r2, [sp, #0]
  1408. 8008f90: fb02 f70b mul.w r7, r2, fp
  1409. 8008f94: ea45 4101 orr.w r1, r5, r1, lsl #16
  1410. 8008f98: 428f cmp r7, r1
  1411. 8008f9a: d905 bls.n 8008fa8 <__udivdi3+0x1f0>
  1412. 8008f9c: eb11 0108 adds.w r1, r1, r8
  1413. 8008fa0: f10b 32ff add.w r2, fp, #4294967295
  1414. 8008fa4: d37d bcc.n 80090a2 <__udivdi3+0x2ea>
  1415. 8008fa6: 4693 mov fp, r2
  1416. 8008fa8: 9b01 ldr r3, [sp, #4]
  1417. 8008faa: ea4b 400a orr.w r0, fp, sl, lsl #16
  1418. 8008fae: 1bc9 subs r1, r1, r7
  1419. 8008fb0: ea4f 4c10 mov.w ip, r0, lsr #16
  1420. 8008fb4: b29d uxth r5, r3
  1421. 8008fb6: ea4f 4a13 mov.w sl, r3, lsr #16
  1422. 8008fba: b283 uxth r3, r0
  1423. 8008fbc: fb05 f203 mul.w r2, r5, r3
  1424. 8008fc0: fb05 f50c mul.w r5, r5, ip
  1425. 8008fc4: fb0a 5303 mla r3, sl, r3, r5
  1426. 8008fc8: fb0a fa0c mul.w sl, sl, ip
  1427. 8008fcc: eb03 4312 add.w r3, r3, r2, lsr #16
  1428. 8008fd0: 429d cmp r5, r3
  1429. 8008fd2: bf88 it hi
  1430. 8008fd4: f50a 3a80 addhi.w sl, sl, #65536 ; 0x10000
  1431. 8008fd8: eb0a 4a13 add.w sl, sl, r3, lsr #16
  1432. 8008fdc: 4551 cmp r1, sl
  1433. 8008fde: d30e bcc.n 8008ffe <__udivdi3+0x246>
  1434. 8008fe0: b292 uxth r2, r2
  1435. 8008fe2: bf14 ite ne
  1436. 8008fe4: 2100 movne r1, #0
  1437. 8008fe6: 2101 moveq r1, #1
  1438. 8008fe8: fa06 f604 lsl.w r6, r6, r4
  1439. 8008fec: eb02 4303 add.w r3, r2, r3, lsl #16
  1440. 8008ff0: 429e cmp r6, r3
  1441. 8008ff2: bf2c ite cs
  1442. 8008ff4: 2600 movcs r6, #0
  1443. 8008ff6: f001 0601 andcc.w r6, r1, #1
  1444. 8008ffa: 2e00 cmp r6, #0
  1445. 8008ffc: d08a beq.n 8008f14 <__udivdi3+0x15c>
  1446. 8008ffe: 3801 subs r0, #1
  1447. 8009000: 2600 movs r6, #0
  1448. 8009002: e787 b.n 8008f14 <__udivdi3+0x15c>
  1449. 8009004: 409c lsls r4, r3
  1450. 8009006: f1c3 0220 rsb r2, r3, #32
  1451. 800900a: fa25 fa02 lsr.w sl, r5, r2
  1452. 800900e: fa26 f902 lsr.w r9, r6, r2
  1453. 8009012: ea4f 4814 mov.w r8, r4, lsr #16
  1454. 8009016: 4650 mov r0, sl
  1455. 8009018: 4641 mov r1, r8
  1456. 800901a: fa05 f503 lsl.w r5, r5, r3
  1457. 800901e: fa06 f703 lsl.w r7, r6, r3
  1458. 8009022: f000 f855 bl 80090d0 <__aeabi_uidiv>
  1459. 8009026: 4641 mov r1, r8
  1460. 8009028: ea49 0905 orr.w r9, r9, r5
  1461. 800902c: 4683 mov fp, r0
  1462. 800902e: 4650 mov r0, sl
  1463. 8009030: f000 f97c bl 800932c <__aeabi_uidivmod>
  1464. 8009034: fa1f fa84 uxth.w sl, r4
  1465. 8009038: ea4f 4319 mov.w r3, r9, lsr #16
  1466. 800903c: fb0a f00b mul.w r0, sl, fp
  1467. 8009040: ea43 4101 orr.w r1, r3, r1, lsl #16
  1468. 8009044: 4288 cmp r0, r1
  1469. 8009046: d909 bls.n 800905c <__udivdi3+0x2a4>
  1470. 8009048: 1909 adds r1, r1, r4
  1471. 800904a: f10b 33ff add.w r3, fp, #4294967295
  1472. 800904e: d238 bcs.n 80090c2 <__udivdi3+0x30a>
  1473. 8009050: 4288 cmp r0, r1
  1474. 8009052: bf84 itt hi
  1475. 8009054: f1ab 0b02 subhi.w fp, fp, #2
  1476. 8009058: 1909 addhi r1, r1, r4
  1477. 800905a: d932 bls.n 80090c2 <__udivdi3+0x30a>
  1478. 800905c: 1a0d subs r5, r1, r0
  1479. 800905e: 4641 mov r1, r8
  1480. 8009060: 4628 mov r0, r5
  1481. 8009062: fa1f f989 uxth.w r9, r9
  1482. 8009066: f000 f833 bl 80090d0 <__aeabi_uidiv>
  1483. 800906a: 4641 mov r1, r8
  1484. 800906c: 4606 mov r6, r0
  1485. 800906e: 4628 mov r0, r5
  1486. 8009070: f000 f95c bl 800932c <__aeabi_uidivmod>
  1487. 8009074: fb0a f506 mul.w r5, sl, r6
  1488. 8009078: ea49 4101 orr.w r1, r9, r1, lsl #16
  1489. 800907c: 428d cmp r5, r1
  1490. 800907e: d906 bls.n 800908e <__udivdi3+0x2d6>
  1491. 8009080: 1e73 subs r3, r6, #1
  1492. 8009082: 1909 adds r1, r1, r4
  1493. 8009084: d21f bcs.n 80090c6 <__udivdi3+0x30e>
  1494. 8009086: 428d cmp r5, r1
  1495. 8009088: d91d bls.n 80090c6 <__udivdi3+0x30e>
  1496. 800908a: 3e02 subs r6, #2
  1497. 800908c: 1909 adds r1, r1, r4
  1498. 800908e: 1b4d subs r5, r1, r5
  1499. 8009090: ea46 460b orr.w r6, r6, fp, lsl #16
  1500. 8009094: e703 b.n 8008e9e <__udivdi3+0xe6>
  1501. 8009096: 461e mov r6, r3
  1502. 8009098: e6df b.n 8008e5a <__udivdi3+0xa2>
  1503. 800909a: 4699 mov r9, r3
  1504. 800909c: e71b b.n 8008ed6 <__udivdi3+0x11e>
  1505. 800909e: 461d mov r5, r3
  1506. 80090a0: e733 b.n 8008f0a <__udivdi3+0x152>
  1507. 80090a2: 428f cmp r7, r1
  1508. 80090a4: bf84 itt hi
  1509. 80090a6: f1ab 0b02 subhi.w fp, fp, #2
  1510. 80090aa: 4441 addhi r1, r8
  1511. 80090ac: f63f af7c bhi.w 8008fa8 <__udivdi3+0x1f0>
  1512. 80090b0: e779 b.n 8008fa6 <__udivdi3+0x1ee>
  1513. 80090b2: 42b8 cmp r0, r7
  1514. 80090b4: bf84 itt hi
  1515. 80090b6: f1aa 0a02 subhi.w sl, sl, #2
  1516. 80090ba: 4447 addhi r7, r8
  1517. 80090bc: f63f af5b bhi.w 8008f76 <__udivdi3+0x1be>
  1518. 80090c0: e758 b.n 8008f74 <__udivdi3+0x1bc>
  1519. 80090c2: 469b mov fp, r3
  1520. 80090c4: e7ca b.n 800905c <__udivdi3+0x2a4>
  1521. 80090c6: 461e mov r6, r3
  1522. 80090c8: e7e1 b.n 800908e <__udivdi3+0x2d6>
  1523. 80090ca: bf00 nop
  1524. 80090cc: 0000 movs r0, r0
  1525. 80090ce: 0000 movs r0, r0
  1526. 080090d0 <__aeabi_uidiv>:
  1527. 80090d0: 1e4a subs r2, r1, #1
  1528. 80090d2: bf08 it eq
  1529. 80090d4: 4770 bxeq lr
  1530. 80090d6: f0c0 8124 bcc.w 8009322 <__aeabi_uidiv+0x252>
  1531. 80090da: 4288 cmp r0, r1
  1532. 80090dc: f240 8116 bls.w 800930c <__aeabi_uidiv+0x23c>
  1533. 80090e0: 4211 tst r1, r2
  1534. 80090e2: f000 8117 beq.w 8009314 <__aeabi_uidiv+0x244>
  1535. 80090e6: fab0 f380 clz r3, r0
  1536. 80090ea: fab1 f281 clz r2, r1
  1537. 80090ee: eba2 0303 sub.w r3, r2, r3
  1538. 80090f2: f1c3 031f rsb r3, r3, #31
  1539. 80090f6: a204 add r2, pc, #16 ; (adr r2, 8009108 <__aeabi_uidiv+0x38>)
  1540. 80090f8: eb02 1303 add.w r3, r2, r3, lsl #4
  1541. 80090fc: f04f 0200 mov.w r2, #0
  1542. 8009100: 469f mov pc, r3
  1543. 8009102: bf00 nop
  1544. 8009104: f3af 8000 nop.w
  1545. 8009108: ebb0 7fc1 cmp.w r0, r1, lsl #31
  1546. 800910c: bf00 nop
  1547. 800910e: eb42 0202 adc.w r2, r2, r2
  1548. 8009112: bf28 it cs
  1549. 8009114: eba0 70c1 subcs.w r0, r0, r1, lsl #31
  1550. 8009118: ebb0 7f81 cmp.w r0, r1, lsl #30
  1551. 800911c: bf00 nop
  1552. 800911e: eb42 0202 adc.w r2, r2, r2
  1553. 8009122: bf28 it cs
  1554. 8009124: eba0 7081 subcs.w r0, r0, r1, lsl #30
  1555. 8009128: ebb0 7f41 cmp.w r0, r1, lsl #29
  1556. 800912c: bf00 nop
  1557. 800912e: eb42 0202 adc.w r2, r2, r2
  1558. 8009132: bf28 it cs
  1559. 8009134: eba0 7041 subcs.w r0, r0, r1, lsl #29
  1560. 8009138: ebb0 7f01 cmp.w r0, r1, lsl #28
  1561. 800913c: bf00 nop
  1562. 800913e: eb42 0202 adc.w r2, r2, r2
  1563. 8009142: bf28 it cs
  1564. 8009144: eba0 7001 subcs.w r0, r0, r1, lsl #28
  1565. 8009148: ebb0 6fc1 cmp.w r0, r1, lsl #27
  1566. 800914c: bf00 nop
  1567. 800914e: eb42 0202 adc.w r2, r2, r2
  1568. 8009152: bf28 it cs
  1569. 8009154: eba0 60c1 subcs.w r0, r0, r1, lsl #27
  1570. 8009158: ebb0 6f81 cmp.w r0, r1, lsl #26
  1571. 800915c: bf00 nop
  1572. 800915e: eb42 0202 adc.w r2, r2, r2
  1573. 8009162: bf28 it cs
  1574. 8009164: eba0 6081 subcs.w r0, r0, r1, lsl #26
  1575. 8009168: ebb0 6f41 cmp.w r0, r1, lsl #25
  1576. 800916c: bf00 nop
  1577. 800916e: eb42 0202 adc.w r2, r2, r2
  1578. 8009172: bf28 it cs
  1579. 8009174: eba0 6041 subcs.w r0, r0, r1, lsl #25
  1580. 8009178: ebb0 6f01 cmp.w r0, r1, lsl #24
  1581. 800917c: bf00 nop
  1582. 800917e: eb42 0202 adc.w r2, r2, r2
  1583. 8009182: bf28 it cs
  1584. 8009184: eba0 6001 subcs.w r0, r0, r1, lsl #24
  1585. 8009188: ebb0 5fc1 cmp.w r0, r1, lsl #23
  1586. 800918c: bf00 nop
  1587. 800918e: eb42 0202 adc.w r2, r2, r2
  1588. 8009192: bf28 it cs
  1589. 8009194: eba0 50c1 subcs.w r0, r0, r1, lsl #23
  1590. 8009198: ebb0 5f81 cmp.w r0, r1, lsl #22
  1591. 800919c: bf00 nop
  1592. 800919e: eb42 0202 adc.w r2, r2, r2
  1593. 80091a2: bf28 it cs
  1594. 80091a4: eba0 5081 subcs.w r0, r0, r1, lsl #22
  1595. 80091a8: ebb0 5f41 cmp.w r0, r1, lsl #21
  1596. 80091ac: bf00 nop
  1597. 80091ae: eb42 0202 adc.w r2, r2, r2
  1598. 80091b2: bf28 it cs
  1599. 80091b4: eba0 5041 subcs.w r0, r0, r1, lsl #21
  1600. 80091b8: ebb0 5f01 cmp.w r0, r1, lsl #20
  1601. 80091bc: bf00 nop
  1602. 80091be: eb42 0202 adc.w r2, r2, r2
  1603. 80091c2: bf28 it cs
  1604. 80091c4: eba0 5001 subcs.w r0, r0, r1, lsl #20
  1605. 80091c8: ebb0 4fc1 cmp.w r0, r1, lsl #19
  1606. 80091cc: bf00 nop
  1607. 80091ce: eb42 0202 adc.w r2, r2, r2
  1608. 80091d2: bf28 it cs
  1609. 80091d4: eba0 40c1 subcs.w r0, r0, r1, lsl #19
  1610. 80091d8: ebb0 4f81 cmp.w r0, r1, lsl #18
  1611. 80091dc: bf00 nop
  1612. 80091de: eb42 0202 adc.w r2, r2, r2
  1613. 80091e2: bf28 it cs
  1614. 80091e4: eba0 4081 subcs.w r0, r0, r1, lsl #18
  1615. 80091e8: ebb0 4f41 cmp.w r0, r1, lsl #17
  1616. 80091ec: bf00 nop
  1617. 80091ee: eb42 0202 adc.w r2, r2, r2
  1618. 80091f2: bf28 it cs
  1619. 80091f4: eba0 4041 subcs.w r0, r0, r1, lsl #17
  1620. 80091f8: ebb0 4f01 cmp.w r0, r1, lsl #16
  1621. 80091fc: bf00 nop
  1622. 80091fe: eb42 0202 adc.w r2, r2, r2
  1623. 8009202: bf28 it cs
  1624. 8009204: eba0 4001 subcs.w r0, r0, r1, lsl #16
  1625. 8009208: ebb0 3fc1 cmp.w r0, r1, lsl #15
  1626. 800920c: bf00 nop
  1627. 800920e: eb42 0202 adc.w r2, r2, r2
  1628. 8009212: bf28 it cs
  1629. 8009214: eba0 30c1 subcs.w r0, r0, r1, lsl #15
  1630. 8009218: ebb0 3f81 cmp.w r0, r1, lsl #14
  1631. 800921c: bf00 nop
  1632. 800921e: eb42 0202 adc.w r2, r2, r2
  1633. 8009222: bf28 it cs
  1634. 8009224: eba0 3081 subcs.w r0, r0, r1, lsl #14
  1635. 8009228: ebb0 3f41 cmp.w r0, r1, lsl #13
  1636. 800922c: bf00 nop
  1637. 800922e: eb42 0202 adc.w r2, r2, r2
  1638. 8009232: bf28 it cs
  1639. 8009234: eba0 3041 subcs.w r0, r0, r1, lsl #13
  1640. 8009238: ebb0 3f01 cmp.w r0, r1, lsl #12
  1641. 800923c: bf00 nop
  1642. 800923e: eb42 0202 adc.w r2, r2, r2
  1643. 8009242: bf28 it cs
  1644. 8009244: eba0 3001 subcs.w r0, r0, r1, lsl #12
  1645. 8009248: ebb0 2fc1 cmp.w r0, r1, lsl #11
  1646. 800924c: bf00 nop
  1647. 800924e: eb42 0202 adc.w r2, r2, r2
  1648. 8009252: bf28 it cs
  1649. 8009254: eba0 20c1 subcs.w r0, r0, r1, lsl #11
  1650. 8009258: ebb0 2f81 cmp.w r0, r1, lsl #10
  1651. 800925c: bf00 nop
  1652. 800925e: eb42 0202 adc.w r2, r2, r2
  1653. 8009262: bf28 it cs
  1654. 8009264: eba0 2081 subcs.w r0, r0, r1, lsl #10
  1655. 8009268: ebb0 2f41 cmp.w r0, r1, lsl #9
  1656. 800926c: bf00 nop
  1657. 800926e: eb42 0202 adc.w r2, r2, r2
  1658. 8009272: bf28 it cs
  1659. 8009274: eba0 2041 subcs.w r0, r0, r1, lsl #9
  1660. 8009278: ebb0 2f01 cmp.w r0, r1, lsl #8
  1661. 800927c: bf00 nop
  1662. 800927e: eb42 0202 adc.w r2, r2, r2
  1663. 8009282: bf28 it cs
  1664. 8009284: eba0 2001 subcs.w r0, r0, r1, lsl #8
  1665. 8009288: ebb0 1fc1 cmp.w r0, r1, lsl #7
  1666. 800928c: bf00 nop
  1667. 800928e: eb42 0202 adc.w r2, r2, r2
  1668. 8009292: bf28 it cs
  1669. 8009294: eba0 10c1 subcs.w r0, r0, r1, lsl #7
  1670. 8009298: ebb0 1f81 cmp.w r0, r1, lsl #6
  1671. 800929c: bf00 nop
  1672. 800929e: eb42 0202 adc.w r2, r2, r2
  1673. 80092a2: bf28 it cs
  1674. 80092a4: eba0 1081 subcs.w r0, r0, r1, lsl #6
  1675. 80092a8: ebb0 1f41 cmp.w r0, r1, lsl #5
  1676. 80092ac: bf00 nop
  1677. 80092ae: eb42 0202 adc.w r2, r2, r2
  1678. 80092b2: bf28 it cs
  1679. 80092b4: eba0 1041 subcs.w r0, r0, r1, lsl #5
  1680. 80092b8: ebb0 1f01 cmp.w r0, r1, lsl #4
  1681. 80092bc: bf00 nop
  1682. 80092be: eb42 0202 adc.w r2, r2, r2
  1683. 80092c2: bf28 it cs
  1684. 80092c4: eba0 1001 subcs.w r0, r0, r1, lsl #4
  1685. 80092c8: ebb0 0fc1 cmp.w r0, r1, lsl #3
  1686. 80092cc: bf00 nop
  1687. 80092ce: eb42 0202 adc.w r2, r2, r2
  1688. 80092d2: bf28 it cs
  1689. 80092d4: eba0 00c1 subcs.w r0, r0, r1, lsl #3
  1690. 80092d8: ebb0 0f81 cmp.w r0, r1, lsl #2
  1691. 80092dc: bf00 nop
  1692. 80092de: eb42 0202 adc.w r2, r2, r2
  1693. 80092e2: bf28 it cs
  1694. 80092e4: eba0 0081 subcs.w r0, r0, r1, lsl #2
  1695. 80092e8: ebb0 0f41 cmp.w r0, r1, lsl #1
  1696. 80092ec: bf00 nop
  1697. 80092ee: eb42 0202 adc.w r2, r2, r2
  1698. 80092f2: bf28 it cs
  1699. 80092f4: eba0 0041 subcs.w r0, r0, r1, lsl #1
  1700. 80092f8: ebb0 0f01 cmp.w r0, r1
  1701. 80092fc: bf00 nop
  1702. 80092fe: eb42 0202 adc.w r2, r2, r2
  1703. 8009302: bf28 it cs
  1704. 8009304: eba0 0001 subcs.w r0, r0, r1
  1705. 8009308: 4610 mov r0, r2
  1706. 800930a: 4770 bx lr
  1707. 800930c: bf0c ite eq
  1708. 800930e: 2001 moveq r0, #1
  1709. 8009310: 2000 movne r0, #0
  1710. 8009312: 4770 bx lr
  1711. 8009314: fab1 f281 clz r2, r1
  1712. 8009318: f1c2 021f rsb r2, r2, #31
  1713. 800931c: fa20 f002 lsr.w r0, r0, r2
  1714. 8009320: 4770 bx lr
  1715. 8009322: b108 cbz r0, 8009328 <__aeabi_uidiv+0x258>
  1716. 8009324: f04f 30ff mov.w r0, #4294967295
  1717. 8009328: f7ff bb8e b.w 8008a48 <__aeabi_idiv0>
  1718. 0800932c <__aeabi_uidivmod>:
  1719. 800932c: 2900 cmp r1, #0
  1720. 800932e: d0f8 beq.n 8009322 <__aeabi_uidiv+0x252>
  1721. 8009330: e92d 4003 stmdb sp!, {r0, r1, lr}
  1722. 8009334: f7ff fecc bl 80090d0 <__aeabi_uidiv>
  1723. 8009338: e8bd 4006 ldmia.w sp!, {r1, r2, lr}
  1724. 800933c: fb02 f300 mul.w r3, r2, r0
  1725. 8009340: eba1 0103 sub.w r1, r1, r3
  1726. 8009344: 4770 bx lr
  1727. 8009346: bf00 nop
  1728. 08009348 <__libc_init_array>:
  1729. 8009348: b570 push {r4, r5, r6, lr}
  1730. 800934a: f243 6690 movw r6, #13968 ; 0x3690
  1731. 800934e: f243 6590 movw r5, #13968 ; 0x3690
  1732. 8009352: f6c0 0601 movt r6, #2049 ; 0x801
  1733. 8009356: f6c0 0501 movt r5, #2049 ; 0x801
  1734. 800935a: 1b76 subs r6, r6, r5
  1735. 800935c: 10b6 asrs r6, r6, #2
  1736. 800935e: d007 beq.n 8009370 <__libc_init_array+0x28>
  1737. 8009360: 3d04 subs r5, #4
  1738. 8009362: 2400 movs r4, #0
  1739. 8009364: f855 3f04 ldr.w r3, [r5, #4]!
  1740. 8009368: 3401 adds r4, #1
  1741. 800936a: 4798 blx r3
  1742. 800936c: 42a6 cmp r6, r4
  1743. 800936e: d1f9 bne.n 8009364 <__libc_init_array+0x1c>
  1744. 8009370: f243 6694 movw r6, #13972 ; 0x3694
  1745. 8009374: f243 6590 movw r5, #13968 ; 0x3690
  1746. 8009378: f6c0 0601 movt r6, #2049 ; 0x801
  1747. 800937c: f6c0 0501 movt r5, #2049 ; 0x801
  1748. 8009380: 1b76 subs r6, r6, r5
  1749. 8009382: f00a f975 bl 8013670 <_init>
  1750. 8009386: 10b6 asrs r6, r6, #2
  1751. 8009388: d008 beq.n 800939c <__libc_init_array+0x54>
  1752. 800938a: 3d04 subs r5, #4
  1753. 800938c: 2400 movs r4, #0
  1754. 800938e: f855 3f04 ldr.w r3, [r5, #4]!
  1755. 8009392: 3401 adds r4, #1
  1756. 8009394: 4798 blx r3
  1757. 8009396: 42a6 cmp r6, r4
  1758. 8009398: d1f9 bne.n 800938e <__libc_init_array+0x46>
  1759. 800939a: bd70 pop {r4, r5, r6, pc}
  1760. 800939c: bd70 pop {r4, r5, r6, pc}
  1761. 800939e: bf00 nop
  1762. 080093a0 <memcmp>:
  1763. 80093a0: 2a03 cmp r2, #3
  1764. 80093a2: b470 push {r4, r5, r6}
  1765. 80093a4: d922 bls.n 80093ec <memcmp+0x4c>
  1766. 80093a6: ea41 0300 orr.w r3, r1, r0
  1767. 80093aa: 079b lsls r3, r3, #30
  1768. 80093ac: d013 beq.n 80093d6 <memcmp+0x36>
  1769. 80093ae: 7805 ldrb r5, [r0, #0]
  1770. 80093b0: 3a01 subs r2, #1
  1771. 80093b2: 780c ldrb r4, [r1, #0]
  1772. 80093b4: 2300 movs r3, #0
  1773. 80093b6: 42a5 cmp r5, r4
  1774. 80093b8: d006 beq.n 80093c8 <memcmp+0x28>
  1775. 80093ba: e01b b.n 80093f4 <memcmp+0x54>
  1776. 80093bc: f810 5f01 ldrb.w r5, [r0, #1]!
  1777. 80093c0: f811 4f01 ldrb.w r4, [r1, #1]!
  1778. 80093c4: 42a5 cmp r5, r4
  1779. 80093c6: d115 bne.n 80093f4 <memcmp+0x54>
  1780. 80093c8: 4293 cmp r3, r2
  1781. 80093ca: f103 0301 add.w r3, r3, #1
  1782. 80093ce: d1f5 bne.n 80093bc <memcmp+0x1c>
  1783. 80093d0: 2000 movs r0, #0
  1784. 80093d2: bc70 pop {r4, r5, r6}
  1785. 80093d4: 4770 bx lr
  1786. 80093d6: 460c mov r4, r1
  1787. 80093d8: 4603 mov r3, r0
  1788. 80093da: 3104 adds r1, #4
  1789. 80093dc: 3004 adds r0, #4
  1790. 80093de: 681e ldr r6, [r3, #0]
  1791. 80093e0: 6825 ldr r5, [r4, #0]
  1792. 80093e2: 42ae cmp r6, r5
  1793. 80093e4: d108 bne.n 80093f8 <memcmp+0x58>
  1794. 80093e6: 3a04 subs r2, #4
  1795. 80093e8: 2a03 cmp r2, #3
  1796. 80093ea: d8f4 bhi.n 80093d6 <memcmp+0x36>
  1797. 80093ec: 2a00 cmp r2, #0
  1798. 80093ee: d1de bne.n 80093ae <memcmp+0xe>
  1799. 80093f0: 4610 mov r0, r2
  1800. 80093f2: e7ee b.n 80093d2 <memcmp+0x32>
  1801. 80093f4: 1b28 subs r0, r5, r4
  1802. 80093f6: e7ec b.n 80093d2 <memcmp+0x32>
  1803. 80093f8: 4621 mov r1, r4
  1804. 80093fa: 4618 mov r0, r3
  1805. 80093fc: 2a00 cmp r2, #0
  1806. 80093fe: d1d6 bne.n 80093ae <memcmp+0xe>
  1807. 8009400: e7f6 b.n 80093f0 <memcmp+0x50>
  1808. 8009402: bf00 nop
  1809. 08009404 <memcpy>:
  1810. 8009404: 2a03 cmp r2, #3
  1811. 8009406: e92d 0ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp}
  1812. 800940a: d809 bhi.n 8009420 <memcpy+0x1c>
  1813. 800940c: b12a cbz r2, 800941a <memcpy+0x16>
  1814. 800940e: 2300 movs r3, #0
  1815. 8009410: 5ccc ldrb r4, [r1, r3]
  1816. 8009412: 54c4 strb r4, [r0, r3]
  1817. 8009414: 3301 adds r3, #1
  1818. 8009416: 4293 cmp r3, r2
  1819. 8009418: d1fa bne.n 8009410 <memcpy+0xc>
  1820. 800941a: e8bd 0ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp}
  1821. 800941e: 4770 bx lr
  1822. 8009420: 0783 lsls r3, r0, #30
  1823. 8009422: 4402 add r2, r0
  1824. 8009424: d00e beq.n 8009444 <memcpy+0x40>
  1825. 8009426: 1c44 adds r4, r0, #1
  1826. 8009428: 1c4d adds r5, r1, #1
  1827. 800942a: f815 7c01 ldrb.w r7, [r5, #-1]
  1828. 800942e: f004 0603 and.w r6, r4, #3
  1829. 8009432: 4623 mov r3, r4
  1830. 8009434: 3401 adds r4, #1
  1831. 8009436: 4629 mov r1, r5
  1832. 8009438: 3501 adds r5, #1
  1833. 800943a: f804 7c02 strb.w r7, [r4, #-2]
  1834. 800943e: 2e00 cmp r6, #0
  1835. 8009440: d1f3 bne.n 800942a <memcpy+0x26>
  1836. 8009442: e000 b.n 8009446 <memcpy+0x42>
  1837. 8009444: 4603 mov r3, r0
  1838. 8009446: f011 0403 ands.w r4, r1, #3
  1839. 800944a: d06d beq.n 8009528 <memcpy+0x124>
  1840. 800944c: 1ad7 subs r7, r2, r3
  1841. 800944e: 1b0d subs r5, r1, r4
  1842. 8009450: 2f03 cmp r7, #3
  1843. 8009452: 682e ldr r6, [r5, #0]
  1844. 8009454: dd19 ble.n 800948a <memcpy+0x86>
  1845. 8009456: f1c4 0c04 rsb ip, r4, #4
  1846. 800945a: ea4f 08c4 mov.w r8, r4, lsl #3
  1847. 800945e: 1d1c adds r4, r3, #4
  1848. 8009460: ea4f 0ccc mov.w ip, ip, lsl #3
  1849. 8009464: f855 7f04 ldr.w r7, [r5, #4]!
  1850. 8009468: ebc4 0902 rsb r9, r4, r2
  1851. 800946c: 4623 mov r3, r4
  1852. 800946e: 3104 adds r1, #4
  1853. 8009470: 3404 adds r4, #4
  1854. 8009472: f1b9 0f03 cmp.w r9, #3
  1855. 8009476: fa26 fa08 lsr.w sl, r6, r8
  1856. 800947a: fa07 fb0c lsl.w fp, r7, ip
  1857. 800947e: 463e mov r6, r7
  1858. 8009480: ea4b 070a orr.w r7, fp, sl
  1859. 8009484: f844 7c08 str.w r7, [r4, #-8]
  1860. 8009488: dcec bgt.n 8009464 <memcpy+0x60>
  1861. 800948a: 429a cmp r2, r3
  1862. 800948c: d9c5 bls.n 800941a <memcpy+0x16>
  1863. 800948e: 3301 adds r3, #1
  1864. 8009490: 3101 adds r1, #1
  1865. 8009492: 3201 adds r2, #1
  1866. 8009494: f811 4c01 ldrb.w r4, [r1, #-1]
  1867. 8009498: 3301 adds r3, #1
  1868. 800949a: 3101 adds r1, #1
  1869. 800949c: 4293 cmp r3, r2
  1870. 800949e: f803 4c02 strb.w r4, [r3, #-2]
  1871. 80094a2: d1f7 bne.n 8009494 <memcpy+0x90>
  1872. 80094a4: e7b9 b.n 800941a <memcpy+0x16>
  1873. 80094a6: 680c ldr r4, [r1, #0]
  1874. 80094a8: 3340 adds r3, #64 ; 0x40
  1875. 80094aa: 3140 adds r1, #64 ; 0x40
  1876. 80094ac: f843 4c40 str.w r4, [r3, #-64]
  1877. 80094b0: f851 4c3c ldr.w r4, [r1, #-60]
  1878. 80094b4: f843 4c3c str.w r4, [r3, #-60]
  1879. 80094b8: f851 4c38 ldr.w r4, [r1, #-56]
  1880. 80094bc: f843 4c38 str.w r4, [r3, #-56]
  1881. 80094c0: f851 4c34 ldr.w r4, [r1, #-52]
  1882. 80094c4: f843 4c34 str.w r4, [r3, #-52]
  1883. 80094c8: f851 4c30 ldr.w r4, [r1, #-48]
  1884. 80094cc: f843 4c30 str.w r4, [r3, #-48]
  1885. 80094d0: f851 4c2c ldr.w r4, [r1, #-44]
  1886. 80094d4: f843 4c2c str.w r4, [r3, #-44]
  1887. 80094d8: f851 4c28 ldr.w r4, [r1, #-40]
  1888. 80094dc: f843 4c28 str.w r4, [r3, #-40]
  1889. 80094e0: f851 4c24 ldr.w r4, [r1, #-36]
  1890. 80094e4: f843 4c24 str.w r4, [r3, #-36]
  1891. 80094e8: f851 4c20 ldr.w r4, [r1, #-32]
  1892. 80094ec: f843 4c20 str.w r4, [r3, #-32]
  1893. 80094f0: f851 4c1c ldr.w r4, [r1, #-28]
  1894. 80094f4: f843 4c1c str.w r4, [r3, #-28]
  1895. 80094f8: f851 4c18 ldr.w r4, [r1, #-24]
  1896. 80094fc: f843 4c18 str.w r4, [r3, #-24]
  1897. 8009500: f851 4c14 ldr.w r4, [r1, #-20]
  1898. 8009504: f843 4c14 str.w r4, [r3, #-20]
  1899. 8009508: f851 4c10 ldr.w r4, [r1, #-16]
  1900. 800950c: f843 4c10 str.w r4, [r3, #-16]
  1901. 8009510: f851 4c0c ldr.w r4, [r1, #-12]
  1902. 8009514: f843 4c0c str.w r4, [r3, #-12]
  1903. 8009518: f851 4c08 ldr.w r4, [r1, #-8]
  1904. 800951c: f843 4c08 str.w r4, [r3, #-8]
  1905. 8009520: f851 4c04 ldr.w r4, [r1, #-4]
  1906. 8009524: f843 4c04 str.w r4, [r3, #-4]
  1907. 8009528: 1ad4 subs r4, r2, r3
  1908. 800952a: 2c3f cmp r4, #63 ; 0x3f
  1909. 800952c: dcbb bgt.n 80094a6 <memcpy+0xa2>
  1910. 800952e: e011 b.n 8009554 <memcpy+0x150>
  1911. 8009530: 680c ldr r4, [r1, #0]
  1912. 8009532: 3310 adds r3, #16
  1913. 8009534: 3110 adds r1, #16
  1914. 8009536: f843 4c10 str.w r4, [r3, #-16]
  1915. 800953a: f851 4c0c ldr.w r4, [r1, #-12]
  1916. 800953e: f843 4c0c str.w r4, [r3, #-12]
  1917. 8009542: f851 4c08 ldr.w r4, [r1, #-8]
  1918. 8009546: f843 4c08 str.w r4, [r3, #-8]
  1919. 800954a: f851 4c04 ldr.w r4, [r1, #-4]
  1920. 800954e: f843 4c04 str.w r4, [r3, #-4]
  1921. 8009552: 1ad4 subs r4, r2, r3
  1922. 8009554: 2c0f cmp r4, #15
  1923. 8009556: dceb bgt.n 8009530 <memcpy+0x12c>
  1924. 8009558: 2c03 cmp r4, #3
  1925. 800955a: dd96 ble.n 800948a <memcpy+0x86>
  1926. 800955c: 1d1c adds r4, r3, #4
  1927. 800955e: 1d0d adds r5, r1, #4
  1928. 8009560: f855 7c04 ldr.w r7, [r5, #-4]
  1929. 8009564: 1b16 subs r6, r2, r4
  1930. 8009566: 4623 mov r3, r4
  1931. 8009568: 4629 mov r1, r5
  1932. 800956a: 3404 adds r4, #4
  1933. 800956c: 3504 adds r5, #4
  1934. 800956e: 2e03 cmp r6, #3
  1935. 8009570: f844 7c08 str.w r7, [r4, #-8]
  1936. 8009574: dcf4 bgt.n 8009560 <memcpy+0x15c>
  1937. 8009576: e788 b.n 800948a <memcpy+0x86>
  1938. 08009578 <memset>:
  1939. 8009578: 2a03 cmp r2, #3
  1940. 800957a: b2c9 uxtb r1, r1
  1941. 800957c: b470 push {r4, r5, r6}
  1942. 800957e: d808 bhi.n 8009592 <memset+0x1a>
  1943. 8009580: b12a cbz r2, 800958e <memset+0x16>
  1944. 8009582: 4603 mov r3, r0
  1945. 8009584: 1812 adds r2, r2, r0
  1946. 8009586: f803 1b01 strb.w r1, [r3], #1
  1947. 800958a: 4293 cmp r3, r2
  1948. 800958c: d1fb bne.n 8009586 <memset+0xe>
  1949. 800958e: bc70 pop {r4, r5, r6}
  1950. 8009590: 4770 bx lr
  1951. 8009592: 0783 lsls r3, r0, #30
  1952. 8009594: 4402 add r2, r0
  1953. 8009596: d009 beq.n 80095ac <memset+0x34>
  1954. 8009598: 1c44 adds r4, r0, #1
  1955. 800959a: f004 0503 and.w r5, r4, #3
  1956. 800959e: 4623 mov r3, r4
  1957. 80095a0: f804 1c01 strb.w r1, [r4, #-1]
  1958. 80095a4: 3401 adds r4, #1
  1959. 80095a6: 2d00 cmp r5, #0
  1960. 80095a8: d1f7 bne.n 800959a <memset+0x22>
  1961. 80095aa: e000 b.n 80095ae <memset+0x36>
  1962. 80095ac: 4603 mov r3, r0
  1963. 80095ae: 1ad5 subs r5, r2, r3
  1964. 80095b0: eb01 2401 add.w r4, r1, r1, lsl #8
  1965. 80095b4: 2d3f cmp r5, #63 ; 0x3f
  1966. 80095b6: eb04 4404 add.w r4, r4, r4, lsl #16
  1967. 80095ba: dd2c ble.n 8009616 <memset+0x9e>
  1968. 80095bc: 601c str r4, [r3, #0]
  1969. 80095be: 3340 adds r3, #64 ; 0x40
  1970. 80095c0: 1ad5 subs r5, r2, r3
  1971. 80095c2: f843 4c3c str.w r4, [r3, #-60]
  1972. 80095c6: 2d3f cmp r5, #63 ; 0x3f
  1973. 80095c8: f843 4c38 str.w r4, [r3, #-56]
  1974. 80095cc: f843 4c34 str.w r4, [r3, #-52]
  1975. 80095d0: f843 4c30 str.w r4, [r3, #-48]
  1976. 80095d4: f843 4c2c str.w r4, [r3, #-44]
  1977. 80095d8: f843 4c28 str.w r4, [r3, #-40]
  1978. 80095dc: f843 4c24 str.w r4, [r3, #-36]
  1979. 80095e0: f843 4c20 str.w r4, [r3, #-32]
  1980. 80095e4: f843 4c1c str.w r4, [r3, #-28]
  1981. 80095e8: f843 4c18 str.w r4, [r3, #-24]
  1982. 80095ec: f843 4c14 str.w r4, [r3, #-20]
  1983. 80095f0: f843 4c10 str.w r4, [r3, #-16]
  1984. 80095f4: f843 4c0c str.w r4, [r3, #-12]
  1985. 80095f8: f843 4c08 str.w r4, [r3, #-8]
  1986. 80095fc: f843 4c04 str.w r4, [r3, #-4]
  1987. 8009600: dcdc bgt.n 80095bc <memset+0x44>
  1988. 8009602: e008 b.n 8009616 <memset+0x9e>
  1989. 8009604: 601c str r4, [r3, #0]
  1990. 8009606: 3310 adds r3, #16
  1991. 8009608: 1ad5 subs r5, r2, r3
  1992. 800960a: f843 4c0c str.w r4, [r3, #-12]
  1993. 800960e: f843 4c08 str.w r4, [r3, #-8]
  1994. 8009612: f843 4c04 str.w r4, [r3, #-4]
  1995. 8009616: 2d0f cmp r5, #15
  1996. 8009618: dcf4 bgt.n 8009604 <memset+0x8c>
  1997. 800961a: 2d03 cmp r5, #3
  1998. 800961c: dd08 ble.n 8009630 <memset+0xb8>
  1999. 800961e: 1d1d adds r5, r3, #4
  2000. 8009620: 1b56 subs r6, r2, r5
  2001. 8009622: f845 4c04 str.w r4, [r5, #-4]
  2002. 8009626: 2e03 cmp r6, #3
  2003. 8009628: 462b mov r3, r5
  2004. 800962a: f105 0504 add.w r5, r5, #4
  2005. 800962e: dcf7 bgt.n 8009620 <memset+0xa8>
  2006. 8009630: 429a cmp r2, r3
  2007. 8009632: d9ac bls.n 800958e <memset+0x16>
  2008. 8009634: 3301 adds r3, #1
  2009. 8009636: 3201 adds r2, #1
  2010. 8009638: f803 1c01 strb.w r1, [r3, #-1]
  2011. 800963c: 3301 adds r3, #1
  2012. 800963e: 4293 cmp r3, r2
  2013. 8009640: d1fa bne.n 8009638 <memset+0xc0>
  2014. 8009642: e7a4 b.n 800958e <memset+0x16>
  2015. 08009644 <strcmp>:
  2016. 8009644: ea80 0201 eor.w r2, r0, r1
  2017. 8009648: f012 0f03 tst.w r2, #3
  2018. 800964c: f040 803a bne.w 80096c4 <strcmp_unaligned>
  2019. 8009650: f010 0203 ands.w r2, r0, #3
  2020. 8009654: f020 0003 bic.w r0, r0, #3
  2021. 8009658: f021 0103 bic.w r1, r1, #3
  2022. 800965c: f850 cb04 ldr.w ip, [r0], #4
  2023. 8009660: bf08 it eq
  2024. 8009662: f851 3b04 ldreq.w r3, [r1], #4
  2025. 8009666: d00d beq.n 8009684 <strcmp+0x40>
  2026. 8009668: f082 0203 eor.w r2, r2, #3
  2027. 800966c: ea4f 02c2 mov.w r2, r2, lsl #3
  2028. 8009670: f06f 437f mvn.w r3, #4278190080 ; 0xff000000
  2029. 8009674: fa23 f202 lsr.w r2, r3, r2
  2030. 8009678: f851 3b04 ldr.w r3, [r1], #4
  2031. 800967c: ea4c 0c02 orr.w ip, ip, r2
  2032. 8009680: ea43 0302 orr.w r3, r3, r2
  2033. 8009684: f1ac 3201 sub.w r2, ip, #16843009 ; 0x1010101
  2034. 8009688: 459c cmp ip, r3
  2035. 800968a: bf01 itttt eq
  2036. 800968c: ea22 020c biceq.w r2, r2, ip
  2037. 8009690: f012 3f80 tsteq.w r2, #2155905152 ; 0x80808080
  2038. 8009694: f850 cb04 ldreq.w ip, [r0], #4
  2039. 8009698: f851 3b04 ldreq.w r3, [r1], #4
  2040. 800969c: d0f2 beq.n 8009684 <strcmp+0x40>
  2041. 800969e: ea4f 600c mov.w r0, ip, lsl #24
  2042. 80096a2: ea4f 2c1c mov.w ip, ip, lsr #8
  2043. 80096a6: 2801 cmp r0, #1
  2044. 80096a8: bf28 it cs
  2045. 80096aa: ebb0 6f03 cmpcs.w r0, r3, lsl #24
  2046. 80096ae: bf08 it eq
  2047. 80096b0: 0a1b lsreq r3, r3, #8
  2048. 80096b2: d0f4 beq.n 800969e <strcmp+0x5a>
  2049. 80096b4: f003 03ff and.w r3, r3, #255 ; 0xff
  2050. 80096b8: ea4f 6010 mov.w r0, r0, lsr #24
  2051. 80096bc: eba0 0003 sub.w r0, r0, r3
  2052. 80096c0: 4770 bx lr
  2053. 80096c2: bf00 nop
  2054. 080096c4 <strcmp_unaligned>:
  2055. 80096c4: f010 0f03 tst.w r0, #3
  2056. 80096c8: d00a beq.n 80096e0 <strcmp_unaligned+0x1c>
  2057. 80096ca: f810 2b01 ldrb.w r2, [r0], #1
  2058. 80096ce: f811 3b01 ldrb.w r3, [r1], #1
  2059. 80096d2: 2a01 cmp r2, #1
  2060. 80096d4: bf28 it cs
  2061. 80096d6: 429a cmpcs r2, r3
  2062. 80096d8: d0f4 beq.n 80096c4 <strcmp_unaligned>
  2063. 80096da: eba2 0003 sub.w r0, r2, r3
  2064. 80096de: 4770 bx lr
  2065. 80096e0: f84d 5d04 str.w r5, [sp, #-4]!
  2066. 80096e4: f84d 4d04 str.w r4, [sp, #-4]!
  2067. 80096e8: f04f 0201 mov.w r2, #1
  2068. 80096ec: ea42 2202 orr.w r2, r2, r2, lsl #8
  2069. 80096f0: ea42 4202 orr.w r2, r2, r2, lsl #16
  2070. 80096f4: f001 0c03 and.w ip, r1, #3
  2071. 80096f8: f021 0103 bic.w r1, r1, #3
  2072. 80096fc: f850 4b04 ldr.w r4, [r0], #4
  2073. 8009700: f851 5b04 ldr.w r5, [r1], #4
  2074. 8009704: f1bc 0f02 cmp.w ip, #2
  2075. 8009708: d026 beq.n 8009758 <strcmp_unaligned+0x94>
  2076. 800970a: d84b bhi.n 80097a4 <strcmp_unaligned+0xe0>
  2077. 800970c: f024 4c7f bic.w ip, r4, #4278190080 ; 0xff000000
  2078. 8009710: ebbc 2f15 cmp.w ip, r5, lsr #8
  2079. 8009714: eba4 0302 sub.w r3, r4, r2
  2080. 8009718: ea23 0304 bic.w r3, r3, r4
  2081. 800971c: d10d bne.n 800973a <strcmp_unaligned+0x76>
  2082. 800971e: ea13 13c2 ands.w r3, r3, r2, lsl #7
  2083. 8009722: bf08 it eq
  2084. 8009724: f851 5b04 ldreq.w r5, [r1], #4
  2085. 8009728: d10a bne.n 8009740 <strcmp_unaligned+0x7c>
  2086. 800972a: ea8c 0c04 eor.w ip, ip, r4
  2087. 800972e: ebbc 6f05 cmp.w ip, r5, lsl #24
  2088. 8009732: d10c bne.n 800974e <strcmp_unaligned+0x8a>
  2089. 8009734: f850 4b04 ldr.w r4, [r0], #4
  2090. 8009738: e7e8 b.n 800970c <strcmp_unaligned+0x48>
  2091. 800973a: ea4f 2515 mov.w r5, r5, lsr #8
  2092. 800973e: e05c b.n 80097fa <strcmp_unaligned+0x136>
  2093. 8009740: f033 437f bics.w r3, r3, #4278190080 ; 0xff000000
  2094. 8009744: d152 bne.n 80097ec <strcmp_unaligned+0x128>
  2095. 8009746: 780d ldrb r5, [r1, #0]
  2096. 8009748: ea4f 6c14 mov.w ip, r4, lsr #24
  2097. 800974c: e055 b.n 80097fa <strcmp_unaligned+0x136>
  2098. 800974e: ea4f 6c14 mov.w ip, r4, lsr #24
  2099. 8009752: f005 05ff and.w r5, r5, #255 ; 0xff
  2100. 8009756: e050 b.n 80097fa <strcmp_unaligned+0x136>
  2101. 8009758: ea4f 4c04 mov.w ip, r4, lsl #16
  2102. 800975c: eba4 0302 sub.w r3, r4, r2
  2103. 8009760: ea4f 4c1c mov.w ip, ip, lsr #16
  2104. 8009764: ea23 0304 bic.w r3, r3, r4
  2105. 8009768: ebbc 4f15 cmp.w ip, r5, lsr #16
  2106. 800976c: d117 bne.n 800979e <strcmp_unaligned+0xda>
  2107. 800976e: ea13 13c2 ands.w r3, r3, r2, lsl #7
  2108. 8009772: bf08 it eq
  2109. 8009774: f851 5b04 ldreq.w r5, [r1], #4
  2110. 8009778: d107 bne.n 800978a <strcmp_unaligned+0xc6>
  2111. 800977a: ea8c 0c04 eor.w ip, ip, r4
  2112. 800977e: ebbc 4f05 cmp.w ip, r5, lsl #16
  2113. 8009782: d108 bne.n 8009796 <strcmp_unaligned+0xd2>
  2114. 8009784: f850 4b04 ldr.w r4, [r0], #4
  2115. 8009788: e7e6 b.n 8009758 <strcmp_unaligned+0x94>
  2116. 800978a: 041b lsls r3, r3, #16
  2117. 800978c: d12e bne.n 80097ec <strcmp_unaligned+0x128>
  2118. 800978e: 880d ldrh r5, [r1, #0]
  2119. 8009790: ea4f 4c14 mov.w ip, r4, lsr #16
  2120. 8009794: e031 b.n 80097fa <strcmp_unaligned+0x136>
  2121. 8009796: ea4f 4505 mov.w r5, r5, lsl #16
  2122. 800979a: ea4f 4c14 mov.w ip, r4, lsr #16
  2123. 800979e: ea4f 4515 mov.w r5, r5, lsr #16
  2124. 80097a2: e02a b.n 80097fa <strcmp_unaligned+0x136>
  2125. 80097a4: f004 0cff and.w ip, r4, #255 ; 0xff
  2126. 80097a8: ebbc 6f15 cmp.w ip, r5, lsr #24
  2127. 80097ac: eba4 0302 sub.w r3, r4, r2
  2128. 80097b0: ea23 0304 bic.w r3, r3, r4
  2129. 80097b4: d10d bne.n 80097d2 <strcmp_unaligned+0x10e>
  2130. 80097b6: ea13 13c2 ands.w r3, r3, r2, lsl #7
  2131. 80097ba: bf08 it eq
  2132. 80097bc: f851 5b04 ldreq.w r5, [r1], #4
  2133. 80097c0: d10a bne.n 80097d8 <strcmp_unaligned+0x114>
  2134. 80097c2: ea8c 0c04 eor.w ip, ip, r4
  2135. 80097c6: ebbc 2f05 cmp.w ip, r5, lsl #8
  2136. 80097ca: d10a bne.n 80097e2 <strcmp_unaligned+0x11e>
  2137. 80097cc: f850 4b04 ldr.w r4, [r0], #4
  2138. 80097d0: e7e8 b.n 80097a4 <strcmp_unaligned+0xe0>
  2139. 80097d2: ea4f 6515 mov.w r5, r5, lsr #24
  2140. 80097d6: e010 b.n 80097fa <strcmp_unaligned+0x136>
  2141. 80097d8: f014 0fff tst.w r4, #255 ; 0xff
  2142. 80097dc: d006 beq.n 80097ec <strcmp_unaligned+0x128>
  2143. 80097de: f851 5b04 ldr.w r5, [r1], #4
  2144. 80097e2: ea4f 2c14 mov.w ip, r4, lsr #8
  2145. 80097e6: f025 457f bic.w r5, r5, #4278190080 ; 0xff000000
  2146. 80097ea: e006 b.n 80097fa <strcmp_unaligned+0x136>
  2147. 80097ec: f04f 0000 mov.w r0, #0
  2148. 80097f0: f85d 4b04 ldr.w r4, [sp], #4
  2149. 80097f4: f85d 5b04 ldr.w r5, [sp], #4
  2150. 80097f8: 4770 bx lr
  2151. 80097fa: f00c 02ff and.w r2, ip, #255 ; 0xff
  2152. 80097fe: f005 00ff and.w r0, r5, #255 ; 0xff
  2153. 8009802: 2801 cmp r0, #1
  2154. 8009804: bf28 it cs
  2155. 8009806: 4290 cmpcs r0, r2
  2156. 8009808: bf04 itt eq
  2157. 800980a: ea4f 2c1c moveq.w ip, ip, lsr #8
  2158. 800980e: 0a2d lsreq r5, r5, #8
  2159. 8009810: d0f3 beq.n 80097fa <strcmp_unaligned+0x136>
  2160. 8009812: eba2 0000 sub.w r0, r2, r0
  2161. 8009816: f85d 4b04 ldr.w r4, [sp], #4
  2162. 800981a: f85d 5b04 ldr.w r5, [sp], #4
  2163. 800981e: 4770 bx lr
  2164. 08009820 <strcpy>:
  2165. 8009820: ea80 0201 eor.w r2, r0, r1
  2166. 8009824: 4684 mov ip, r0
  2167. 8009826: f012 0f03 tst.w r2, #3
  2168. 800982a: d14f bne.n 80098cc <strcpy+0xac>
  2169. 800982c: f011 0f03 tst.w r1, #3
  2170. 8009830: d132 bne.n 8009898 <strcpy+0x78>
  2171. 8009832: f84d 4d04 str.w r4, [sp, #-4]!
  2172. 8009836: f011 0f04 tst.w r1, #4
  2173. 800983a: f851 3b04 ldr.w r3, [r1], #4
  2174. 800983e: d00b beq.n 8009858 <strcpy+0x38>
  2175. 8009840: f1a3 3201 sub.w r2, r3, #16843009 ; 0x1010101
  2176. 8009844: 439a bics r2, r3
  2177. 8009846: f012 3f80 tst.w r2, #2155905152 ; 0x80808080
  2178. 800984a: bf04 itt eq
  2179. 800984c: f84c 3b04 streq.w r3, [ip], #4
  2180. 8009850: f851 3b04 ldreq.w r3, [r1], #4
  2181. 8009854: d116 bne.n 8009884 <strcpy+0x64>
  2182. 8009856: bf00 nop
  2183. 8009858: f851 4b04 ldr.w r4, [r1], #4
  2184. 800985c: f1a3 3201 sub.w r2, r3, #16843009 ; 0x1010101
  2185. 8009860: 439a bics r2, r3
  2186. 8009862: f012 3f80 tst.w r2, #2155905152 ; 0x80808080
  2187. 8009866: f1a4 3201 sub.w r2, r4, #16843009 ; 0x1010101
  2188. 800986a: d10b bne.n 8009884 <strcpy+0x64>
  2189. 800986c: f84c 3b04 str.w r3, [ip], #4
  2190. 8009870: 43a2 bics r2, r4
  2191. 8009872: f012 3f80 tst.w r2, #2155905152 ; 0x80808080
  2192. 8009876: bf04 itt eq
  2193. 8009878: f851 3b04 ldreq.w r3, [r1], #4
  2194. 800987c: f84c 4b04 streq.w r4, [ip], #4
  2195. 8009880: d0ea beq.n 8009858 <strcpy+0x38>
  2196. 8009882: 4623 mov r3, r4
  2197. 8009884: f80c 3b01 strb.w r3, [ip], #1
  2198. 8009888: f013 0fff tst.w r3, #255 ; 0xff
  2199. 800988c: ea4f 2333 mov.w r3, r3, ror #8
  2200. 8009890: d1f8 bne.n 8009884 <strcpy+0x64>
  2201. 8009892: f85d 4b04 ldr.w r4, [sp], #4
  2202. 8009896: 4770 bx lr
  2203. 8009898: f011 0f01 tst.w r1, #1
  2204. 800989c: d006 beq.n 80098ac <strcpy+0x8c>
  2205. 800989e: f811 2b01 ldrb.w r2, [r1], #1
  2206. 80098a2: f80c 2b01 strb.w r2, [ip], #1
  2207. 80098a6: 2a00 cmp r2, #0
  2208. 80098a8: bf08 it eq
  2209. 80098aa: 4770 bxeq lr
  2210. 80098ac: f011 0f02 tst.w r1, #2
  2211. 80098b0: d0bf beq.n 8009832 <strcpy+0x12>
  2212. 80098b2: f831 2b02 ldrh.w r2, [r1], #2
  2213. 80098b6: f012 0fff tst.w r2, #255 ; 0xff
  2214. 80098ba: bf16 itet ne
  2215. 80098bc: f82c 2b02 strhne.w r2, [ip], #2
  2216. 80098c0: f88c 2000 strbeq.w r2, [ip]
  2217. 80098c4: f412 4f7f tstne.w r2, #65280 ; 0xff00
  2218. 80098c8: d1b3 bne.n 8009832 <strcpy+0x12>
  2219. 80098ca: 4770 bx lr
  2220. 80098cc: f811 2b01 ldrb.w r2, [r1], #1
  2221. 80098d0: f80c 2b01 strb.w r2, [ip], #1
  2222. 80098d4: 2a00 cmp r2, #0
  2223. 80098d6: d1f9 bne.n 80098cc <strcpy+0xac>
  2224. 80098d8: 4770 bx lr
  2225. 80098da: bf00 nop
  2226. 080098dc <strncmp>:
  2227. 80098dc: b470 push {r4, r5, r6}
  2228. 80098de: 2a00 cmp r2, #0
  2229. 80098e0: d045 beq.n 800996e <strncmp+0x92>
  2230. 80098e2: ea41 0300 orr.w r3, r1, r0
  2231. 80098e6: f013 0303 ands.w r3, r3, #3
  2232. 80098ea: d129 bne.n 8009940 <strncmp+0x64>
  2233. 80098ec: 2a03 cmp r2, #3
  2234. 80098ee: d927 bls.n 8009940 <strncmp+0x64>
  2235. 80098f0: 6805 ldr r5, [r0, #0]
  2236. 80098f2: 680c ldr r4, [r1, #0]
  2237. 80098f4: 42a5 cmp r5, r4
  2238. 80098f6: d123 bne.n 8009940 <strncmp+0x64>
  2239. 80098f8: 1f14 subs r4, r2, #4
  2240. 80098fa: d03a beq.n 8009972 <strncmp+0x96>
  2241. 80098fc: f1a5 3201 sub.w r2, r5, #16843009 ; 0x1010101
  2242. 8009900: ea22 0505 bic.w r5, r2, r5
  2243. 8009904: f015 3f80 tst.w r5, #2155905152 ; 0x80808080
  2244. 8009908: d00d beq.n 8009926 <strncmp+0x4a>
  2245. 800990a: e03a b.n 8009982 <strncmp+0xa6>
  2246. 800990c: 685b ldr r3, [r3, #4]
  2247. 800990e: 686a ldr r2, [r5, #4]
  2248. 8009910: f1a3 3501 sub.w r5, r3, #16843009 ; 0x1010101
  2249. 8009914: 4293 cmp r3, r2
  2250. 8009916: ea25 0503 bic.w r5, r5, r3
  2251. 800991a: d12e bne.n 800997a <strncmp+0x9e>
  2252. 800991c: 3c04 subs r4, #4
  2253. 800991e: d028 beq.n 8009972 <strncmp+0x96>
  2254. 8009920: f015 3f80 tst.w r5, #2155905152 ; 0x80808080
  2255. 8009924: d127 bne.n 8009976 <strncmp+0x9a>
  2256. 8009926: 460d mov r5, r1
  2257. 8009928: 4603 mov r3, r0
  2258. 800992a: 3104 adds r1, #4
  2259. 800992c: 3004 adds r0, #4
  2260. 800992e: 2c03 cmp r4, #3
  2261. 8009930: d8ec bhi.n 800990c <strncmp+0x30>
  2262. 8009932: 1e66 subs r6, r4, #1
  2263. 8009934: b92c cbnz r4, 8009942 <strncmp+0x66>
  2264. 8009936: 791c ldrb r4, [r3, #4]
  2265. 8009938: 792a ldrb r2, [r5, #4]
  2266. 800993a: 1aa0 subs r0, r4, r2
  2267. 800993c: bc70 pop {r4, r5, r6}
  2268. 800993e: 4770 bx lr
  2269. 8009940: 1e56 subs r6, r2, #1
  2270. 8009942: 7804 ldrb r4, [r0, #0]
  2271. 8009944: 780a ldrb r2, [r1, #0]
  2272. 8009946: 4294 cmp r4, r2
  2273. 8009948: d1f7 bne.n 800993a <strncmp+0x5e>
  2274. 800994a: b1c6 cbz r6, 800997e <strncmp+0xa2>
  2275. 800994c: b18c cbz r4, 8009972 <strncmp+0x96>
  2276. 800994e: 3601 adds r6, #1
  2277. 8009950: 1c8b adds r3, r1, #2
  2278. 8009952: 1989 adds r1, r1, r6
  2279. 8009954: e004 b.n 8009960 <strncmp+0x84>
  2280. 8009956: 428b cmp r3, r1
  2281. 8009958: f103 0301 add.w r3, r3, #1
  2282. 800995c: d00b beq.n 8009976 <strncmp+0x9a>
  2283. 800995e: b144 cbz r4, 8009972 <strncmp+0x96>
  2284. 8009960: f813 2c01 ldrb.w r2, [r3, #-1]
  2285. 8009964: f810 4f01 ldrb.w r4, [r0, #1]!
  2286. 8009968: 4294 cmp r4, r2
  2287. 800996a: d0f4 beq.n 8009956 <strncmp+0x7a>
  2288. 800996c: e7e5 b.n 800993a <strncmp+0x5e>
  2289. 800996e: 4610 mov r0, r2
  2290. 8009970: e7e4 b.n 800993c <strncmp+0x60>
  2291. 8009972: 4620 mov r0, r4
  2292. 8009974: e7e2 b.n 800993c <strncmp+0x60>
  2293. 8009976: 2000 movs r0, #0
  2294. 8009978: e7e0 b.n 800993c <strncmp+0x60>
  2295. 800997a: 1e66 subs r6, r4, #1
  2296. 800997c: e7e1 b.n 8009942 <strncmp+0x66>
  2297. 800997e: 4630 mov r0, r6
  2298. 8009980: e7dc b.n 800993c <strncmp+0x60>
  2299. 8009982: 4618 mov r0, r3
  2300. 8009984: e7da b.n 800993c <strncmp+0x60>
  2301. 8009986: bf00 nop
  2302. 08009988 <strncpy>:
  2303. 8009988: ea41 0300 orr.w r3, r1, r0
  2304. 800998c: f013 0f03 tst.w r3, #3
  2305. 8009990: 4603 mov r3, r0
  2306. 8009992: b470 push {r4, r5, r6}
  2307. 8009994: d025 beq.n 80099e2 <strncpy+0x5a>
  2308. 8009996: b1aa cbz r2, 80099c4 <strncpy+0x3c>
  2309. 8009998: 780c ldrb r4, [r1, #0]
  2310. 800999a: 3a01 subs r2, #1
  2311. 800999c: f803 4b01 strb.w r4, [r3], #1
  2312. 80099a0: b14c cbz r4, 80099b6 <strncpy+0x2e>
  2313. 80099a2: 461c mov r4, r3
  2314. 80099a4: b172 cbz r2, 80099c4 <strncpy+0x3c>
  2315. 80099a6: f811 5f01 ldrb.w r5, [r1, #1]!
  2316. 80099aa: 3a01 subs r2, #1
  2317. 80099ac: f804 5b01 strb.w r5, [r4], #1
  2318. 80099b0: 4623 mov r3, r4
  2319. 80099b2: 2d00 cmp r5, #0
  2320. 80099b4: d1f6 bne.n 80099a4 <strncpy+0x1c>
  2321. 80099b6: b12a cbz r2, 80099c4 <strncpy+0x3c>
  2322. 80099b8: 189a adds r2, r3, r2
  2323. 80099ba: 2100 movs r1, #0
  2324. 80099bc: f803 1b01 strb.w r1, [r3], #1
  2325. 80099c0: 4293 cmp r3, r2
  2326. 80099c2: d1fb bne.n 80099bc <strncpy+0x34>
  2327. 80099c4: bc70 pop {r4, r5, r6}
  2328. 80099c6: 4770 bx lr
  2329. 80099c8: 460e mov r6, r1
  2330. 80099ca: f851 4b04 ldr.w r4, [r1], #4
  2331. 80099ce: f1a4 3501 sub.w r5, r4, #16843009 ; 0x1010101
  2332. 80099d2: ea25 0504 bic.w r5, r5, r4
  2333. 80099d6: f015 3f80 tst.w r5, #2155905152 ; 0x80808080
  2334. 80099da: d105 bne.n 80099e8 <strncpy+0x60>
  2335. 80099dc: 3a04 subs r2, #4
  2336. 80099de: f843 4b04 str.w r4, [r3], #4
  2337. 80099e2: 2a03 cmp r2, #3
  2338. 80099e4: d8f0 bhi.n 80099c8 <strncpy+0x40>
  2339. 80099e6: e7d6 b.n 8009996 <strncpy+0xe>
  2340. 80099e8: 4631 mov r1, r6
  2341. 80099ea: e7d4 b.n 8009996 <strncpy+0xe>
  2342. 080099ec <_strtol_r>:
  2343. 80099ec: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  2344. 80099f0: f240 0400 movw r4, #0
  2345. 80099f4: f2c2 0400 movt r4, #8192 ; 0x2000
  2346. 80099f8: b085 sub sp, #20
  2347. 80099fa: 4699 mov r9, r3
  2348. 80099fc: 460b mov r3, r1
  2349. 80099fe: f8d4 8000 ldr.w r8, [r4]
  2350. 8009a02: 9102 str r1, [sp, #8]
  2351. 8009a04: 9003 str r0, [sp, #12]
  2352. 8009a06: 461c mov r4, r3
  2353. 8009a08: f814 5b01 ldrb.w r5, [r4], #1
  2354. 8009a0c: eb08 0105 add.w r1, r8, r5
  2355. 8009a10: 4623 mov r3, r4
  2356. 8009a12: 7849 ldrb r1, [r1, #1]
  2357. 8009a14: f001 0108 and.w r1, r1, #8
  2358. 8009a18: b2c9 uxtb r1, r1
  2359. 8009a1a: 2900 cmp r1, #0
  2360. 8009a1c: d1f3 bne.n 8009a06 <_strtol_r+0x1a>
  2361. 8009a1e: 2d2d cmp r5, #45 ; 0x2d
  2362. 8009a20: d07b beq.n 8009b1a <_strtol_r+0x12e>
  2363. 8009a22: 2d2b cmp r5, #43 ; 0x2b
  2364. 8009a24: bf05 ittet eq
  2365. 8009a26: 4624 moveq r4, r4
  2366. 8009a28: 460b moveq r3, r1
  2367. 8009a2a: 460b movne r3, r1
  2368. 8009a2c: f814 5b01 ldrbeq.w r5, [r4], #1
  2369. 8009a30: f039 0110 bics.w r1, r9, #16
  2370. 8009a34: d112 bne.n 8009a5c <_strtol_r+0x70>
  2371. 8009a36: f1d9 0001 rsbs r0, r9, #1
  2372. 8009a3a: bf38 it cc
  2373. 8009a3c: 2000 movcc r0, #0
  2374. 8009a3e: 2d30 cmp r5, #48 ; 0x30
  2375. 8009a40: d004 beq.n 8009a4c <_strtol_r+0x60>
  2376. 8009a42: b158 cbz r0, 8009a5c <_strtol_r+0x70>
  2377. 8009a44: f04f 090a mov.w r9, #10
  2378. 8009a48: 46cb mov fp, r9
  2379. 8009a4a: e008 b.n 8009a5e <_strtol_r+0x72>
  2380. 8009a4c: 7821 ldrb r1, [r4, #0]
  2381. 8009a4e: f001 01df and.w r1, r1, #223 ; 0xdf
  2382. 8009a52: 2958 cmp r1, #88 ; 0x58
  2383. 8009a54: d065 beq.n 8009b22 <_strtol_r+0x136>
  2384. 8009a56: b108 cbz r0, 8009a5c <_strtol_r+0x70>
  2385. 8009a58: f04f 0908 mov.w r9, #8
  2386. 8009a5c: 46cb mov fp, r9
  2387. 8009a5e: 2b00 cmp r3, #0
  2388. 8009a60: 4659 mov r1, fp
  2389. 8009a62: bf0c ite eq
  2390. 8009a64: f06f 4600 mvneq.w r6, #2147483648 ; 0x80000000
  2391. 8009a68: f04f 4600 movne.w r6, #2147483648 ; 0x80000000
  2392. 8009a6c: e88d 000c stmia.w sp, {r2, r3}
  2393. 8009a70: 4630 mov r0, r6
  2394. 8009a72: 2700 movs r7, #0
  2395. 8009a74: f7ff fc5a bl 800932c <__aeabi_uidivmod>
  2396. 8009a78: 4630 mov r0, r6
  2397. 8009a7a: 468a mov sl, r1
  2398. 8009a7c: 4659 mov r1, fp
  2399. 8009a7e: f7ff fb27 bl 80090d0 <__aeabi_uidiv>
  2400. 8009a82: 46bc mov ip, r7
  2401. 8009a84: e89d 000c ldmia.w sp, {r2, r3}
  2402. 8009a88: e016 b.n 8009ab8 <_strtol_r+0xcc>
  2403. 8009a8a: 3d30 subs r5, #48 ; 0x30
  2404. 8009a8c: 45a9 cmp r9, r5
  2405. 8009a8e: dd25 ble.n 8009adc <_strtol_r+0xf0>
  2406. 8009a90: 4584 cmp ip, r0
  2407. 8009a92: bf94 ite ls
  2408. 8009a94: 2100 movls r1, #0
  2409. 8009a96: 2101 movhi r1, #1
  2410. 8009a98: ea51 77d7 orrs.w r7, r1, r7, lsr #31
  2411. 8009a9c: d129 bne.n 8009af2 <_strtol_r+0x106>
  2412. 8009a9e: 4555 cmp r5, sl
  2413. 8009aa0: bfd4 ite le
  2414. 8009aa2: 2100 movle r1, #0
  2415. 8009aa4: 2101 movgt r1, #1
  2416. 8009aa6: 4584 cmp ip, r0
  2417. 8009aa8: bf18 it ne
  2418. 8009aaa: 2100 movne r1, #0
  2419. 8009aac: bb09 cbnz r1, 8009af2 <_strtol_r+0x106>
  2420. 8009aae: fb0b 5c0c mla ip, fp, ip, r5
  2421. 8009ab2: 2701 movs r7, #1
  2422. 8009ab4: f814 5b01 ldrb.w r5, [r4], #1
  2423. 8009ab8: eb08 0105 add.w r1, r8, r5
  2424. 8009abc: 7849 ldrb r1, [r1, #1]
  2425. 8009abe: f001 0604 and.w r6, r1, #4
  2426. 8009ac2: b2f6 uxtb r6, r6
  2427. 8009ac4: 2e00 cmp r6, #0
  2428. 8009ac6: d1e0 bne.n 8009a8a <_strtol_r+0x9e>
  2429. 8009ac8: f011 0103 ands.w r1, r1, #3
  2430. 8009acc: d006 beq.n 8009adc <_strtol_r+0xf0>
  2431. 8009ace: 2901 cmp r1, #1
  2432. 8009ad0: bf14 ite ne
  2433. 8009ad2: 2157 movne r1, #87 ; 0x57
  2434. 8009ad4: 2137 moveq r1, #55 ; 0x37
  2435. 8009ad6: 1a6d subs r5, r5, r1
  2436. 8009ad8: 45a9 cmp r9, r5
  2437. 8009ada: dcd9 bgt.n 8009a90 <_strtol_r+0xa4>
  2438. 8009adc: 1c79 adds r1, r7, #1
  2439. 8009ade: d00b beq.n 8009af8 <_strtol_r+0x10c>
  2440. 8009ae0: b9c3 cbnz r3, 8009b14 <_strtol_r+0x128>
  2441. 8009ae2: 4660 mov r0, ip
  2442. 8009ae4: b112 cbz r2, 8009aec <_strtol_r+0x100>
  2443. 8009ae6: b997 cbnz r7, 8009b0e <_strtol_r+0x122>
  2444. 8009ae8: 9b02 ldr r3, [sp, #8]
  2445. 8009aea: 6013 str r3, [r2, #0]
  2446. 8009aec: b005 add sp, #20
  2447. 8009aee: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  2448. 8009af2: f04f 37ff mov.w r7, #4294967295
  2449. 8009af6: e7dd b.n 8009ab4 <_strtol_r+0xc8>
  2450. 8009af8: 9903 ldr r1, [sp, #12]
  2451. 8009afa: 2b00 cmp r3, #0
  2452. 8009afc: bf0c ite eq
  2453. 8009afe: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
  2454. 8009b02: f04f 4000 movne.w r0, #2147483648 ; 0x80000000
  2455. 8009b06: 2322 movs r3, #34 ; 0x22
  2456. 8009b08: 600b str r3, [r1, #0]
  2457. 8009b0a: 2a00 cmp r2, #0
  2458. 8009b0c: d0ee beq.n 8009aec <_strtol_r+0x100>
  2459. 8009b0e: 3c01 subs r4, #1
  2460. 8009b10: 9402 str r4, [sp, #8]
  2461. 8009b12: e7e9 b.n 8009ae8 <_strtol_r+0xfc>
  2462. 8009b14: f1cc 0c00 rsb ip, ip, #0
  2463. 8009b18: e7e3 b.n 8009ae2 <_strtol_r+0xf6>
  2464. 8009b1a: f814 5b01 ldrb.w r5, [r4], #1
  2465. 8009b1e: 2301 movs r3, #1
  2466. 8009b20: e786 b.n 8009a30 <_strtol_r+0x44>
  2467. 8009b22: f04f 0910 mov.w r9, #16
  2468. 8009b26: 7865 ldrb r5, [r4, #1]
  2469. 8009b28: 46cb mov fp, r9
  2470. 8009b2a: 3402 adds r4, #2
  2471. 8009b2c: e797 b.n 8009a5e <_strtol_r+0x72>
  2472. 8009b2e: bf00 nop
  2473. 08009b30 <strtol>:
  2474. 8009b30: b430 push {r4, r5}
  2475. 8009b32: f240 0404 movw r4, #4
  2476. 8009b36: f2c2 0400 movt r4, #8192 ; 0x2000
  2477. 8009b3a: 460d mov r5, r1
  2478. 8009b3c: 4613 mov r3, r2
  2479. 8009b3e: 4601 mov r1, r0
  2480. 8009b40: 462a mov r2, r5
  2481. 8009b42: 6820 ldr r0, [r4, #0]
  2482. 8009b44: bc30 pop {r4, r5}
  2483. 8009b46: f7ff bf51 b.w 80099ec <_strtol_r>
  2484. 8009b4a: bf00 nop
  2485. 08009b4c <SystemInit>:
  2486. SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
  2487. #endif
  2488. /* Reset the RCC clock configuration to the default reset state ------------*/
  2489. /* Set HSION bit */
  2490. RCC->CR |= (uint32_t)0x00000001;
  2491. 8009b4c: 4b35 ldr r3, [pc, #212] ; (8009c24 <SystemInit+0xd8>)
  2492. 8009b4e: 681a ldr r2, [r3, #0]
  2493. 8009b50: f042 0201 orr.w r2, r2, #1
  2494. 8009b54: 601a str r2, [r3, #0]
  2495. /* Reset CFGR register */
  2496. RCC->CFGR = 0x00000000;
  2497. 8009b56: 2200 movs r2, #0
  2498. 8009b58: 609a str r2, [r3, #8]
  2499. /* Reset HSEON, CSSON and PLLON bits */
  2500. RCC->CR &= (uint32_t)0xFEF6FFFF;
  2501. 8009b5a: 6819 ldr r1, [r3, #0]
  2502. 8009b5c: f021 7184 bic.w r1, r1, #17301504 ; 0x1080000
  2503. 8009b60: f421 3180 bic.w r1, r1, #65536 ; 0x10000
  2504. 8009b64: 6019 str r1, [r3, #0]
  2505. /* Reset PLLCFGR register */
  2506. RCC->PLLCFGR = 0x24003010;
  2507. 8009b66: 4930 ldr r1, [pc, #192] ; (8009c28 <SystemInit+0xdc>)
  2508. 8009b68: 6059 str r1, [r3, #4]
  2509. /* Reset HSEBYP bit */
  2510. RCC->CR &= (uint32_t)0xFFFBFFFF;
  2511. 8009b6a: 6819 ldr r1, [r3, #0]
  2512. * SystemFrequency variable.
  2513. * @param None
  2514. * @retval None
  2515. */
  2516. void SystemInit(void)
  2517. {
  2518. 8009b6c: b082 sub sp, #8
  2519. /* Reset PLLCFGR register */
  2520. RCC->PLLCFGR = 0x24003010;
  2521. /* Reset HSEBYP bit */
  2522. RCC->CR &= (uint32_t)0xFFFBFFFF;
  2523. 8009b6e: f421 2180 bic.w r1, r1, #262144 ; 0x40000
  2524. 8009b72: 6019 str r1, [r3, #0]
  2525. /* Disable all interrupts */
  2526. RCC->CIR = 0x00000000;
  2527. 8009b74: 60da str r2, [r3, #12]
  2528. static void SetSysClock(void)
  2529. {
  2530. /******************************************************************************/
  2531. /* PLL (clocked by HSE) used as System clock source */
  2532. /******************************************************************************/
  2533. __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
  2534. 8009b76: 9200 str r2, [sp, #0]
  2535. 8009b78: 9201 str r2, [sp, #4]
  2536. /* Enable HSE */
  2537. RCC->CR |= ((uint32_t)RCC_CR_HSEON);
  2538. 8009b7a: 681a ldr r2, [r3, #0]
  2539. 8009b7c: f442 3280 orr.w r2, r2, #65536 ; 0x10000
  2540. 8009b80: 601a str r2, [r3, #0]
  2541. /* Wait till HSE is ready and if Time out is reached exit */
  2542. do
  2543. {
  2544. HSEStatus = RCC->CR & RCC_CR_HSERDY;
  2545. 8009b82: 681a ldr r2, [r3, #0]
  2546. 8009b84: f402 3200 and.w r2, r2, #131072 ; 0x20000
  2547. 8009b88: 9201 str r2, [sp, #4]
  2548. StartUpCounter++;
  2549. 8009b8a: 9a00 ldr r2, [sp, #0]
  2550. 8009b8c: 3201 adds r2, #1
  2551. 8009b8e: 9200 str r2, [sp, #0]
  2552. } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
  2553. 8009b90: 9a01 ldr r2, [sp, #4]
  2554. 8009b92: b91a cbnz r2, 8009b9c <SystemInit+0x50>
  2555. 8009b94: 9a00 ldr r2, [sp, #0]
  2556. 8009b96: f5b2 6fa0 cmp.w r2, #1280 ; 0x500
  2557. 8009b9a: d1f2 bne.n 8009b82 <SystemInit+0x36>
  2558. if ((RCC->CR & RCC_CR_HSERDY) != RESET)
  2559. 8009b9c: 4b21 ldr r3, [pc, #132] ; (8009c24 <SystemInit+0xd8>)
  2560. 8009b9e: 681b ldr r3, [r3, #0]
  2561. 8009ba0: f413 3300 ands.w r3, r3, #131072 ; 0x20000
  2562. {
  2563. HSEStatus = (uint32_t)0x01;
  2564. 8009ba4: bf18 it ne
  2565. 8009ba6: 2301 movne r3, #1
  2566. }
  2567. else
  2568. {
  2569. HSEStatus = (uint32_t)0x00;
  2570. 8009ba8: 9301 str r3, [sp, #4]
  2571. }
  2572. if (HSEStatus == (uint32_t)0x01)
  2573. 8009baa: 9b01 ldr r3, [sp, #4]
  2574. 8009bac: 2b01 cmp r3, #1
  2575. 8009bae: d133 bne.n 8009c18 <SystemInit+0xcc>
  2576. {
  2577. /* Select regulator voltage output Scale 1 mode, System frequency up to 168 MHz */
  2578. RCC->APB1ENR |= RCC_APB1ENR_PWREN;
  2579. 8009bb0: 4b1c ldr r3, [pc, #112] ; (8009c24 <SystemInit+0xd8>)
  2580. 8009bb2: 6c1a ldr r2, [r3, #64] ; 0x40
  2581. 8009bb4: f042 5280 orr.w r2, r2, #268435456 ; 0x10000000
  2582. 8009bb8: 641a str r2, [r3, #64] ; 0x40
  2583. PWR->CR |= PWR_CR_VOS;
  2584. 8009bba: 4a1c ldr r2, [pc, #112] ; (8009c2c <SystemInit+0xe0>)
  2585. 8009bbc: 6811 ldr r1, [r2, #0]
  2586. 8009bbe: f441 4180 orr.w r1, r1, #16384 ; 0x4000
  2587. 8009bc2: 6011 str r1, [r2, #0]
  2588. /* HCLK = SYSCLK / 1*/
  2589. RCC->CFGR |= RCC_CFGR_HPRE_DIV1;
  2590. 8009bc4: 689a ldr r2, [r3, #8]
  2591. 8009bc6: 609a str r2, [r3, #8]
  2592. /* PCLK2 = HCLK / 2*/
  2593. RCC->CFGR |= RCC_CFGR_PPRE2_DIV2;
  2594. 8009bc8: 689a ldr r2, [r3, #8]
  2595. 8009bca: f442 4200 orr.w r2, r2, #32768 ; 0x8000
  2596. 8009bce: 609a str r2, [r3, #8]
  2597. /* PCLK1 = HCLK / 4*/
  2598. RCC->CFGR |= RCC_CFGR_PPRE1_DIV4;
  2599. 8009bd0: 689a ldr r2, [r3, #8]
  2600. 8009bd2: f442 52a0 orr.w r2, r2, #5120 ; 0x1400
  2601. 8009bd6: 609a str r2, [r3, #8]
  2602. /* Configure the main PLL */
  2603. RCC->PLLCFGR = PLL_M | (PLL_N << 6) | (((PLL_P >> 1) -1) << 16) |
  2604. 8009bd8: 4a15 ldr r2, [pc, #84] ; (8009c30 <SystemInit+0xe4>)
  2605. 8009bda: 605a str r2, [r3, #4]
  2606. (RCC_PLLCFGR_PLLSRC_HSE) | (PLL_Q << 24);
  2607. /* Enable the main PLL */
  2608. RCC->CR |= RCC_CR_PLLON;
  2609. 8009bdc: 681a ldr r2, [r3, #0]
  2610. 8009bde: f042 7280 orr.w r2, r2, #16777216 ; 0x1000000
  2611. 8009be2: 601a str r2, [r3, #0]
  2612. /* Wait till the main PLL is ready */
  2613. while((RCC->CR & RCC_CR_PLLRDY) == 0)
  2614. 8009be4: 6819 ldr r1, [r3, #0]
  2615. 8009be6: 4a0f ldr r2, [pc, #60] ; (8009c24 <SystemInit+0xd8>)
  2616. 8009be8: 0189 lsls r1, r1, #6
  2617. 8009bea: d5fb bpl.n 8009be4 <SystemInit+0x98>
  2618. {
  2619. }
  2620. /* Configure Flash prefetch, Instruction cache, Data cache and wait state */
  2621. FLASH->ACR = FLASH_ACR_ICEN |FLASH_ACR_DCEN |FLASH_ACR_LATENCY_5WS;
  2622. 8009bec: 4b11 ldr r3, [pc, #68] ; (8009c34 <SystemInit+0xe8>)
  2623. 8009bee: f240 6105 movw r1, #1541 ; 0x605
  2624. 8009bf2: 6019 str r1, [r3, #0]
  2625. /* Select the main PLL as system clock source */
  2626. RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
  2627. 8009bf4: 6893 ldr r3, [r2, #8]
  2628. 8009bf6: f023 0303 bic.w r3, r3, #3
  2629. 8009bfa: 6093 str r3, [r2, #8]
  2630. RCC->CFGR |= RCC_CFGR_SW_PLL;
  2631. 8009bfc: 6893 ldr r3, [r2, #8]
  2632. 8009bfe: f043 0302 orr.w r3, r3, #2
  2633. 8009c02: 6093 str r3, [r2, #8]
  2634. /* Wait till the main PLL is used as system clock source */
  2635. while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);
  2636. 8009c04: 6891 ldr r1, [r2, #8]
  2637. 8009c06: 4b07 ldr r3, [pc, #28] ; (8009c24 <SystemInit+0xd8>)
  2638. 8009c08: f001 010c and.w r1, r1, #12
  2639. 8009c0c: 2908 cmp r1, #8
  2640. 8009c0e: d1f9 bne.n 8009c04 <SystemInit+0xb8>
  2641. {
  2642. }
  2643. /* Добавил переход на внутренний генератор в случае отказа HSE */
  2644. RCC->CR|=RCC_CR_CSSON;
  2645. 8009c10: 681a ldr r2, [r3, #0]
  2646. 8009c12: f442 2200 orr.w r2, r2, #524288 ; 0x80000
  2647. 8009c16: 601a str r2, [r3, #0]
  2648. /* Configure the Vector Table location add offset address ------------------*/
  2649. #ifdef VECT_TAB_SRAM
  2650. SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
  2651. #else
  2652. SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
  2653. 8009c18: 4b07 ldr r3, [pc, #28] ; (8009c38 <SystemInit+0xec>)
  2654. 8009c1a: f04f 6200 mov.w r2, #134217728 ; 0x8000000
  2655. 8009c1e: 609a str r2, [r3, #8]
  2656. #endif
  2657. }
  2658. 8009c20: b002 add sp, #8
  2659. 8009c22: 4770 bx lr
  2660. 8009c24: 40023800 .word 0x40023800
  2661. 8009c28: 24003010 .word 0x24003010
  2662. 8009c2c: 40007000 .word 0x40007000
  2663. 8009c30: 07405419 .word 0x07405419
  2664. 8009c34: 40023c00 .word 0x40023c00
  2665. 8009c38: e000ed00 .word 0xe000ed00
  2666. 08009c3c <NVIC_Init>:
  2667. /* Check the parameters */
  2668. assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd));
  2669. assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority));
  2670. assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));
  2671. if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
  2672. 8009c3c: 78c3 ldrb r3, [r0, #3]
  2673. 8009c3e: b30b cbz r3, 8009c84 <NVIC_Init+0x48>
  2674. {
  2675. /* Compute the Corresponding IRQ Priority --------------------------------*/
  2676. tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
  2677. 8009c40: 4b16 ldr r3, [pc, #88] ; (8009c9c <NVIC_Init+0x60>)
  2678. tmppre = (0x4 - tmppriority);
  2679. tmpsub = tmpsub >> tmppriority;
  2680. tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
  2681. 8009c42: 7841 ldrb r1, [r0, #1]
  2682. assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));
  2683. if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
  2684. {
  2685. /* Compute the Corresponding IRQ Priority --------------------------------*/
  2686. tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
  2687. 8009c44: 68db ldr r3, [r3, #12]
  2688. 8009c46: 43db mvns r3, r3
  2689. 8009c48: f3c3 2302 ubfx r3, r3, #8, #3
  2690. tmppre = (0x4 - tmppriority);
  2691. 8009c4c: f1c3 0204 rsb r2, r3, #4
  2692. tmpsub = tmpsub >> tmppriority;
  2693. tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
  2694. 8009c50: b2d2 uxtb r2, r2
  2695. 8009c52: fa01 f202 lsl.w r2, r1, r2
  2696. if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
  2697. {
  2698. /* Compute the Corresponding IRQ Priority --------------------------------*/
  2699. tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
  2700. tmppre = (0x4 - tmppriority);
  2701. tmpsub = tmpsub >> tmppriority;
  2702. 8009c56: 210f movs r1, #15
  2703. 8009c58: fa41 f303 asr.w r3, r1, r3
  2704. tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
  2705. tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub);
  2706. 8009c5c: 7881 ldrb r1, [r0, #2]
  2707. /* Compute the Corresponding IRQ Priority --------------------------------*/
  2708. tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
  2709. tmppre = (0x4 - tmppriority);
  2710. tmpsub = tmpsub >> tmppriority;
  2711. tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
  2712. 8009c5e: b2d2 uxtb r2, r2
  2713. tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub);
  2714. 8009c60: 400b ands r3, r1
  2715. 8009c62: 431a orrs r2, r3
  2716. tmppriority = tmppriority << 0x04;
  2717. NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
  2718. 8009c64: 7803 ldrb r3, [r0, #0]
  2719. 8009c66: f103 4360 add.w r3, r3, #3758096384 ; 0xe0000000
  2720. 8009c6a: f503 4361 add.w r3, r3, #57600 ; 0xe100
  2721. tmpsub = tmpsub >> tmppriority;
  2722. tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
  2723. tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub);
  2724. tmppriority = tmppriority << 0x04;
  2725. 8009c6e: 0112 lsls r2, r2, #4
  2726. NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
  2727. 8009c70: f883 2300 strb.w r2, [r3, #768] ; 0x300
  2728. /* Enable the Selected IRQ Channels --------------------------------------*/
  2729. NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
  2730. 8009c74: 7803 ldrb r3, [r0, #0]
  2731. (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
  2732. 8009c76: 2201 movs r2, #1
  2733. tmppriority = tmppriority << 0x04;
  2734. NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
  2735. /* Enable the Selected IRQ Channels --------------------------------------*/
  2736. NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
  2737. 8009c78: 0959 lsrs r1, r3, #5
  2738. (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
  2739. 8009c7a: f003 031f and.w r3, r3, #31
  2740. 8009c7e: fa02 f303 lsl.w r3, r2, r3
  2741. 8009c82: e007 b.n 8009c94 <NVIC_Init+0x58>
  2742. }
  2743. else
  2744. {
  2745. /* Disable the Selected IRQ Channels -------------------------------------*/
  2746. NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
  2747. 8009c84: 7803 ldrb r3, [r0, #0]
  2748. (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
  2749. 8009c86: 2201 movs r2, #1
  2750. (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
  2751. }
  2752. else
  2753. {
  2754. /* Disable the Selected IRQ Channels -------------------------------------*/
  2755. NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
  2756. 8009c88: 0959 lsrs r1, r3, #5
  2757. (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
  2758. 8009c8a: f003 031f and.w r3, r3, #31
  2759. 8009c8e: fa02 f303 lsl.w r3, r2, r3
  2760. (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
  2761. }
  2762. else
  2763. {
  2764. /* Disable the Selected IRQ Channels -------------------------------------*/
  2765. NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
  2766. 8009c92: 3120 adds r1, #32
  2767. 8009c94: 4a02 ldr r2, [pc, #8] ; (8009ca0 <NVIC_Init+0x64>)
  2768. 8009c96: f842 3021 str.w r3, [r2, r1, lsl #2]
  2769. 8009c9a: 4770 bx lr
  2770. 8009c9c: e000ed00 .word 0xe000ed00
  2771. 8009ca0: e000e100 .word 0xe000e100
  2772. 08009ca4 <CRC_ResetDR>:
  2773. * @retval None
  2774. */
  2775. void CRC_ResetDR(void)
  2776. {
  2777. /* Reset CRC generator */
  2778. CRC->CR = CRC_CR_RESET;
  2779. 8009ca4: 4b01 ldr r3, [pc, #4] ; (8009cac <CRC_ResetDR+0x8>)
  2780. 8009ca6: 2201 movs r2, #1
  2781. 8009ca8: 609a str r2, [r3, #8]
  2782. 8009caa: 4770 bx lr
  2783. 8009cac: 40023000 .word 0x40023000
  2784. 08009cb0 <CRC_CalcBlockCRC>:
  2785. * @param pBuffer: pointer to the buffer containing the data to be computed
  2786. * @param BufferLength: length of the buffer to be computed
  2787. * @retval 32-bit CRC
  2788. */
  2789. uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
  2790. {
  2791. 8009cb0: b510 push {r4, lr}
  2792. uint32_t index = 0;
  2793. for(index = 0; index < BufferLength; index++)
  2794. 8009cb2: 2300 movs r3, #0
  2795. 8009cb4: 4c05 ldr r4, [pc, #20] ; (8009ccc <CRC_CalcBlockCRC+0x1c>)
  2796. 8009cb6: e003 b.n 8009cc0 <CRC_CalcBlockCRC+0x10>
  2797. {
  2798. CRC->DR = pBuffer[index];
  2799. 8009cb8: f850 2023 ldr.w r2, [r0, r3, lsl #2]
  2800. */
  2801. uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
  2802. {
  2803. uint32_t index = 0;
  2804. for(index = 0; index < BufferLength; index++)
  2805. 8009cbc: 3301 adds r3, #1
  2806. {
  2807. CRC->DR = pBuffer[index];
  2808. 8009cbe: 6022 str r2, [r4, #0]
  2809. */
  2810. uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
  2811. {
  2812. uint32_t index = 0;
  2813. for(index = 0; index < BufferLength; index++)
  2814. 8009cc0: 428b cmp r3, r1
  2815. 8009cc2: d1f9 bne.n 8009cb8 <CRC_CalcBlockCRC+0x8>
  2816. {
  2817. CRC->DR = pBuffer[index];
  2818. }
  2819. return (CRC->DR);
  2820. 8009cc4: 4b01 ldr r3, [pc, #4] ; (8009ccc <CRC_CalcBlockCRC+0x1c>)
  2821. 8009cc6: 6818 ldr r0, [r3, #0]
  2822. }
  2823. 8009cc8: bd10 pop {r4, pc}
  2824. 8009cca: bf00 nop
  2825. 8009ccc: 40023000 .word 0x40023000
  2826. 08009cd0 <FLASH_Unlock>:
  2827. * @param None
  2828. * @retval None
  2829. */
  2830. void FLASH_Unlock(void)
  2831. {
  2832. if((FLASH->CR & FLASH_CR_LOCK) != RESET)
  2833. 8009cd0: 4b04 ldr r3, [pc, #16] ; (8009ce4 <FLASH_Unlock+0x14>)
  2834. 8009cd2: 691a ldr r2, [r3, #16]
  2835. 8009cd4: 2a00 cmp r2, #0
  2836. 8009cd6: da04 bge.n 8009ce2 <FLASH_Unlock+0x12>
  2837. {
  2838. /* Authorize the FLASH Registers access */
  2839. FLASH->KEYR = FLASH_KEY1;
  2840. 8009cd8: 4a03 ldr r2, [pc, #12] ; (8009ce8 <FLASH_Unlock+0x18>)
  2841. 8009cda: 605a str r2, [r3, #4]
  2842. FLASH->KEYR = FLASH_KEY2;
  2843. 8009cdc: f102 3288 add.w r2, r2, #2290649224 ; 0x88888888
  2844. 8009ce0: 605a str r2, [r3, #4]
  2845. 8009ce2: 4770 bx lr
  2846. 8009ce4: 40023c00 .word 0x40023c00
  2847. 8009ce8: 45670123 .word 0x45670123
  2848. 08009cec <FLASH_Lock>:
  2849. * @retval None
  2850. */
  2851. void FLASH_Lock(void)
  2852. {
  2853. /* Set the LOCK Bit to lock the FLASH Registers access */
  2854. FLASH->CR |= FLASH_CR_LOCK;
  2855. 8009cec: 4b02 ldr r3, [pc, #8] ; (8009cf8 <FLASH_Lock+0xc>)
  2856. 8009cee: 691a ldr r2, [r3, #16]
  2857. 8009cf0: f042 4200 orr.w r2, r2, #2147483648 ; 0x80000000
  2858. 8009cf4: 611a str r2, [r3, #16]
  2859. 8009cf6: 4770 bx lr
  2860. 8009cf8: 40023c00 .word 0x40023c00
  2861. 08009cfc <FLASH_GetStatus>:
  2862. */
  2863. FLASH_Status FLASH_GetStatus(void)
  2864. {
  2865. FLASH_Status flashstatus = FLASH_COMPLETE;
  2866. if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY)
  2867. 8009cfc: 4b0b ldr r3, [pc, #44] ; (8009d2c <FLASH_GetStatus+0x30>)
  2868. 8009cfe: 68da ldr r2, [r3, #12]
  2869. 8009d00: 03d0 lsls r0, r2, #15
  2870. 8009d02: d40d bmi.n 8009d20 <FLASH_GetStatus+0x24>
  2871. {
  2872. flashstatus = FLASH_BUSY;
  2873. }
  2874. else
  2875. {
  2876. if((FLASH->SR & FLASH_FLAG_WRPERR) != (uint32_t)0x00)
  2877. 8009d04: 68da ldr r2, [r3, #12]
  2878. 8009d06: 06d1 lsls r1, r2, #27
  2879. 8009d08: d40c bmi.n 8009d24 <FLASH_GetStatus+0x28>
  2880. {
  2881. flashstatus = FLASH_ERROR_WRP;
  2882. }
  2883. else
  2884. {
  2885. if((FLASH->SR & (uint32_t)0xEF) != (uint32_t)0x00)
  2886. 8009d0a: 68da ldr r2, [r3, #12]
  2887. 8009d0c: f012 0fef tst.w r2, #239 ; 0xef
  2888. 8009d10: d10a bne.n 8009d28 <FLASH_GetStatus+0x2c>
  2889. {
  2890. flashstatus = FLASH_ERROR_PROGRAM;
  2891. }
  2892. else
  2893. {
  2894. if((FLASH->SR & FLASH_FLAG_OPERR) != (uint32_t)0x00)
  2895. 8009d12: 68db ldr r3, [r3, #12]
  2896. 8009d14: f013 0f02 tst.w r3, #2
  2897. {
  2898. flashstatus = FLASH_ERROR_OPERATION;
  2899. 8009d18: bf0c ite eq
  2900. 8009d1a: 2008 moveq r0, #8
  2901. 8009d1c: 2007 movne r0, #7
  2902. 8009d1e: 4770 bx lr
  2903. {
  2904. FLASH_Status flashstatus = FLASH_COMPLETE;
  2905. if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY)
  2906. {
  2907. flashstatus = FLASH_BUSY;
  2908. 8009d20: 2001 movs r0, #1
  2909. 8009d22: 4770 bx lr
  2910. }
  2911. else
  2912. {
  2913. if((FLASH->SR & FLASH_FLAG_WRPERR) != (uint32_t)0x00)
  2914. {
  2915. flashstatus = FLASH_ERROR_WRP;
  2916. 8009d24: 2005 movs r0, #5
  2917. 8009d26: 4770 bx lr
  2918. }
  2919. else
  2920. {
  2921. if((FLASH->SR & (uint32_t)0xEF) != (uint32_t)0x00)
  2922. {
  2923. flashstatus = FLASH_ERROR_PROGRAM;
  2924. 8009d28: 2006 movs r0, #6
  2925. }
  2926. }
  2927. }
  2928. /* Return the FLASH Status */
  2929. return flashstatus;
  2930. }
  2931. 8009d2a: 4770 bx lr
  2932. 8009d2c: 40023c00 .word 0x40023c00
  2933. 08009d30 <FLASH_WaitForLastOperation>:
  2934. * @param None
  2935. * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
  2936. * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
  2937. */
  2938. FLASH_Status FLASH_WaitForLastOperation(void)
  2939. {
  2940. 8009d30: b507 push {r0, r1, r2, lr}
  2941. __IO FLASH_Status status = FLASH_COMPLETE;
  2942. 8009d32: 2308 movs r3, #8
  2943. 8009d34: f88d 3007 strb.w r3, [sp, #7]
  2944. /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset.
  2945. Even if the FLASH operation fails, the BUSY flag will be reset and an error
  2946. flag will be set */
  2947. while(status == FLASH_BUSY)
  2948. {
  2949. status = FLASH_GetStatus();
  2950. 8009d38: f7ff ffe0 bl 8009cfc <FLASH_GetStatus>
  2951. 8009d3c: f88d 0007 strb.w r0, [sp, #7]
  2952. status = FLASH_GetStatus();
  2953. /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset.
  2954. Even if the FLASH operation fails, the BUSY flag will be reset and an error
  2955. flag will be set */
  2956. while(status == FLASH_BUSY)
  2957. 8009d40: f89d 3007 ldrb.w r3, [sp, #7]
  2958. 8009d44: 2b01 cmp r3, #1
  2959. 8009d46: d0f7 beq.n 8009d38 <FLASH_WaitForLastOperation+0x8>
  2960. {
  2961. status = FLASH_GetStatus();
  2962. }
  2963. /* Return the operation status */
  2964. return status;
  2965. 8009d48: f89d 0007 ldrb.w r0, [sp, #7]
  2966. }
  2967. 8009d4c: bd0e pop {r1, r2, r3, pc}
  2968. 8009d4e: 0000 movs r0, r0
  2969. 08009d50 <FLASH_ProgramByte>:
  2970. * @param Data: specifies the data to be programmed.
  2971. * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
  2972. * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
  2973. */
  2974. FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
  2975. {
  2976. 8009d50: b570 push {r4, r5, r6, lr}
  2977. 8009d52: 4605 mov r5, r0
  2978. 8009d54: 460e mov r6, r1
  2979. /* Check the parameters */
  2980. assert_param(IS_FLASH_ADDRESS(Address));
  2981. /* Wait for last operation to be completed */
  2982. status = FLASH_WaitForLastOperation();
  2983. 8009d56: f7ff ffeb bl 8009d30 <FLASH_WaitForLastOperation>
  2984. if(status == FLASH_COMPLETE)
  2985. 8009d5a: 2808 cmp r0, #8
  2986. 8009d5c: d111 bne.n 8009d82 <FLASH_ProgramByte+0x32>
  2987. {
  2988. /* if the previous operation is completed, proceed to program the new data */
  2989. FLASH->CR &= CR_PSIZE_MASK;
  2990. 8009d5e: 4c09 ldr r4, [pc, #36] ; (8009d84 <FLASH_ProgramByte+0x34>)
  2991. 8009d60: 6923 ldr r3, [r4, #16]
  2992. 8009d62: f423 7340 bic.w r3, r3, #768 ; 0x300
  2993. 8009d66: 6123 str r3, [r4, #16]
  2994. FLASH->CR |= FLASH_PSIZE_BYTE;
  2995. 8009d68: 6923 ldr r3, [r4, #16]
  2996. 8009d6a: 6123 str r3, [r4, #16]
  2997. FLASH->CR |= FLASH_CR_PG;
  2998. 8009d6c: 6923 ldr r3, [r4, #16]
  2999. 8009d6e: f043 0301 orr.w r3, r3, #1
  3000. 8009d72: 6123 str r3, [r4, #16]
  3001. *(__IO uint8_t*)Address = Data;
  3002. 8009d74: 702e strb r6, [r5, #0]
  3003. /* Wait for last operation to be completed */
  3004. status = FLASH_WaitForLastOperation();
  3005. 8009d76: f7ff ffdb bl 8009d30 <FLASH_WaitForLastOperation>
  3006. /* if the program operation is completed, disable the PG Bit */
  3007. FLASH->CR &= (~FLASH_CR_PG);
  3008. 8009d7a: 6923 ldr r3, [r4, #16]
  3009. 8009d7c: f023 0301 bic.w r3, r3, #1
  3010. 8009d80: 6123 str r3, [r4, #16]
  3011. }
  3012. /* Return the Program Status */
  3013. return status;
  3014. }
  3015. 8009d82: bd70 pop {r4, r5, r6, pc}
  3016. 8009d84: 40023c00 .word 0x40023c00
  3017. 08009d88 <FLASH_ProgramWord>:
  3018. * @param Data: specifies the data to be programmed.
  3019. * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
  3020. * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
  3021. */
  3022. FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
  3023. {
  3024. 8009d88: b570 push {r4, r5, r6, lr}
  3025. 8009d8a: 4605 mov r5, r0
  3026. 8009d8c: 460e mov r6, r1
  3027. /* Check the parameters */
  3028. assert_param(IS_FLASH_ADDRESS(Address));
  3029. /* Wait for last operation to be completed */
  3030. status = FLASH_WaitForLastOperation();
  3031. 8009d8e: f7ff ffcf bl 8009d30 <FLASH_WaitForLastOperation>
  3032. if(status == FLASH_COMPLETE)
  3033. 8009d92: 2808 cmp r0, #8
  3034. 8009d94: d113 bne.n 8009dbe <FLASH_ProgramWord+0x36>
  3035. {
  3036. /* if the previous operation is completed, proceed to program the new data */
  3037. FLASH->CR &= CR_PSIZE_MASK;
  3038. 8009d96: 4c0a ldr r4, [pc, #40] ; (8009dc0 <FLASH_ProgramWord+0x38>)
  3039. 8009d98: 6923 ldr r3, [r4, #16]
  3040. 8009d9a: f423 7340 bic.w r3, r3, #768 ; 0x300
  3041. 8009d9e: 6123 str r3, [r4, #16]
  3042. FLASH->CR |= FLASH_PSIZE_WORD;
  3043. 8009da0: 6923 ldr r3, [r4, #16]
  3044. 8009da2: f443 7300 orr.w r3, r3, #512 ; 0x200
  3045. 8009da6: 6123 str r3, [r4, #16]
  3046. FLASH->CR |= FLASH_CR_PG;
  3047. 8009da8: 6923 ldr r3, [r4, #16]
  3048. 8009daa: f043 0301 orr.w r3, r3, #1
  3049. 8009dae: 6123 str r3, [r4, #16]
  3050. *(__IO uint32_t*)Address = Data;
  3051. 8009db0: 602e str r6, [r5, #0]
  3052. /* Wait for last operation to be completed */
  3053. status = FLASH_WaitForLastOperation();
  3054. 8009db2: f7ff ffbd bl 8009d30 <FLASH_WaitForLastOperation>
  3055. /* if the program operation is completed, disable the PG Bit */
  3056. FLASH->CR &= (~FLASH_CR_PG);
  3057. 8009db6: 6923 ldr r3, [r4, #16]
  3058. 8009db8: f023 0301 bic.w r3, r3, #1
  3059. 8009dbc: 6123 str r3, [r4, #16]
  3060. }
  3061. /* Return the Program Status */
  3062. return status;
  3063. }
  3064. 8009dbe: bd70 pop {r4, r5, r6, pc}
  3065. 8009dc0: 40023c00 .word 0x40023c00
  3066. 08009dc4 <FLASH_EraseSector>:
  3067. *
  3068. * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
  3069. * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
  3070. */
  3071. FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
  3072. {
  3073. 8009dc4: b570 push {r4, r5, r6, lr}
  3074. 8009dc6: 4606 mov r6, r0
  3075. /* Check the parameters */
  3076. assert_param(IS_FLASH_SECTOR(FLASH_Sector));
  3077. assert_param(IS_VOLTAGERANGE(VoltageRange));
  3078. if(VoltageRange == VoltageRange_1)
  3079. 8009dc8: b141 cbz r1, 8009ddc <FLASH_EraseSector+0x18>
  3080. {
  3081. tmp_psize = FLASH_PSIZE_BYTE;
  3082. }
  3083. else if(VoltageRange == VoltageRange_2)
  3084. 8009dca: 2901 cmp r1, #1
  3085. 8009dcc: d008 beq.n 8009de0 <FLASH_EraseSector+0x1c>
  3086. {
  3087. tmp_psize = FLASH_PSIZE_HALF_WORD;
  3088. }
  3089. else if(VoltageRange == VoltageRange_3)
  3090. {
  3091. tmp_psize = FLASH_PSIZE_WORD;
  3092. 8009dce: 2902 cmp r1, #2
  3093. 8009dd0: bf14 ite ne
  3094. 8009dd2: f44f 7540 movne.w r5, #768 ; 0x300
  3095. 8009dd6: f44f 7500 moveq.w r5, #512 ; 0x200
  3096. 8009dda: e003 b.n 8009de4 <FLASH_EraseSector+0x20>
  3097. assert_param(IS_FLASH_SECTOR(FLASH_Sector));
  3098. assert_param(IS_VOLTAGERANGE(VoltageRange));
  3099. if(VoltageRange == VoltageRange_1)
  3100. {
  3101. tmp_psize = FLASH_PSIZE_BYTE;
  3102. 8009ddc: 460d mov r5, r1
  3103. 8009dde: e001 b.n 8009de4 <FLASH_EraseSector+0x20>
  3104. }
  3105. else if(VoltageRange == VoltageRange_2)
  3106. {
  3107. tmp_psize = FLASH_PSIZE_HALF_WORD;
  3108. 8009de0: f44f 7580 mov.w r5, #256 ; 0x100
  3109. else
  3110. {
  3111. tmp_psize = FLASH_PSIZE_DOUBLE_WORD;
  3112. }
  3113. /* Wait for last operation to be completed */
  3114. status = FLASH_WaitForLastOperation();
  3115. 8009de4: f7ff ffa4 bl 8009d30 <FLASH_WaitForLastOperation>
  3116. if(status == FLASH_COMPLETE)
  3117. 8009de8: 2808 cmp r0, #8
  3118. 8009dea: d11e bne.n 8009e2a <FLASH_EraseSector+0x66>
  3119. {
  3120. /* if the previous operation is completed, proceed to erase the sector */
  3121. FLASH->CR &= CR_PSIZE_MASK;
  3122. 8009dec: 4c0f ldr r4, [pc, #60] ; (8009e2c <FLASH_EraseSector+0x68>)
  3123. 8009dee: 6923 ldr r3, [r4, #16]
  3124. 8009df0: f423 7340 bic.w r3, r3, #768 ; 0x300
  3125. 8009df4: 6123 str r3, [r4, #16]
  3126. FLASH->CR |= tmp_psize;
  3127. 8009df6: 6921 ldr r1, [r4, #16]
  3128. 8009df8: 430d orrs r5, r1
  3129. 8009dfa: 6125 str r5, [r4, #16]
  3130. FLASH->CR &= SECTOR_MASK;
  3131. 8009dfc: 6923 ldr r3, [r4, #16]
  3132. 8009dfe: f023 03f8 bic.w r3, r3, #248 ; 0xf8
  3133. 8009e02: 6123 str r3, [r4, #16]
  3134. FLASH->CR |= FLASH_CR_SER | FLASH_Sector;
  3135. 8009e04: 6923 ldr r3, [r4, #16]
  3136. 8009e06: f043 0302 orr.w r3, r3, #2
  3137. 8009e0a: 431e orrs r6, r3
  3138. 8009e0c: 6126 str r6, [r4, #16]
  3139. FLASH->CR |= FLASH_CR_STRT;
  3140. 8009e0e: 6923 ldr r3, [r4, #16]
  3141. 8009e10: f443 3380 orr.w r3, r3, #65536 ; 0x10000
  3142. 8009e14: 6123 str r3, [r4, #16]
  3143. /* Wait for last operation to be completed */
  3144. status = FLASH_WaitForLastOperation();
  3145. 8009e16: f7ff ff8b bl 8009d30 <FLASH_WaitForLastOperation>
  3146. /* if the erase operation is completed, disable the SER Bit */
  3147. FLASH->CR &= (~FLASH_CR_SER);
  3148. 8009e1a: 6923 ldr r3, [r4, #16]
  3149. 8009e1c: f023 0302 bic.w r3, r3, #2
  3150. 8009e20: 6123 str r3, [r4, #16]
  3151. FLASH->CR &= SECTOR_MASK;
  3152. 8009e22: 6923 ldr r3, [r4, #16]
  3153. 8009e24: f023 03f8 bic.w r3, r3, #248 ; 0xf8
  3154. 8009e28: 6123 str r3, [r4, #16]
  3155. }
  3156. /* Return the Erase Status */
  3157. return status;
  3158. }
  3159. 8009e2a: bd70 pop {r4, r5, r6, pc}
  3160. 8009e2c: 40023c00 .word 0x40023c00
  3161. 08009e30 <GPIO_Init>:
  3162. * @param GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that contains
  3163. * the configuration information for the specified GPIO peripheral.
  3164. * @retval None
  3165. */
  3166. void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
  3167. {
  3168. 8009e30: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
  3169. /*-- GPIO Mode Configuration --*/
  3170. for (pinpos = 0x00; pinpos < 0x10; pinpos++)
  3171. {
  3172. pos = ((uint32_t)0x01) << pinpos;
  3173. /* Get the port pins position */
  3174. currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
  3175. 8009e34: 680f ldr r7, [r1, #0]
  3176. assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode));
  3177. assert_param(IS_GPIO_PUPD(GPIO_InitStruct->GPIO_PuPd));
  3178. /* -------------------------Configure the port pins---------------- */
  3179. /*-- GPIO Mode Configuration --*/
  3180. for (pinpos = 0x00; pinpos < 0x10; pinpos++)
  3181. 8009e36: 2300 movs r3, #0
  3182. {
  3183. pos = ((uint32_t)0x01) << pinpos;
  3184. 8009e38: f04f 0c01 mov.w ip, #1
  3185. /* Get the port pins position */
  3186. currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
  3187. if (currentpin == pos)
  3188. {
  3189. GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
  3190. 8009e3c: f04f 0803 mov.w r8, #3
  3191. /* -------------------------Configure the port pins---------------- */
  3192. /*-- GPIO Mode Configuration --*/
  3193. for (pinpos = 0x00; pinpos < 0x10; pinpos++)
  3194. {
  3195. pos = ((uint32_t)0x01) << pinpos;
  3196. 8009e40: fa0c f203 lsl.w r2, ip, r3
  3197. /* Get the port pins position */
  3198. currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
  3199. 8009e44: ea02 0507 and.w r5, r2, r7
  3200. if (currentpin == pos)
  3201. 8009e48: 4295 cmp r5, r2
  3202. 8009e4a: d131 bne.n 8009eb0 <GPIO_Init+0x80>
  3203. * @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
  3204. * @param GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that contains
  3205. * the configuration information for the specified GPIO peripheral.
  3206. * @retval None
  3207. */
  3208. void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
  3209. 8009e4c: 005a lsls r2, r3, #1
  3210. /* Get the port pins position */
  3211. currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
  3212. if (currentpin == pos)
  3213. {
  3214. GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
  3215. 8009e4e: 6806 ldr r6, [r0, #0]
  3216. 8009e50: fa08 f402 lsl.w r4, r8, r2
  3217. 8009e54: 43e4 mvns r4, r4
  3218. 8009e56: 4026 ands r6, r4
  3219. 8009e58: 6006 str r6, [r0, #0]
  3220. GPIOx->MODER |= (((uint32_t)GPIO_InitStruct->GPIO_Mode) << (pinpos * 2));
  3221. 8009e5a: 790e ldrb r6, [r1, #4]
  3222. 8009e5c: f8d0 9000 ldr.w r9, [r0]
  3223. 8009e60: fa06 fa02 lsl.w sl, r6, r2
  3224. if ((GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) || (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_AF))
  3225. 8009e64: 3e01 subs r6, #1
  3226. currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
  3227. if (currentpin == pos)
  3228. {
  3229. GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
  3230. GPIOx->MODER |= (((uint32_t)GPIO_InitStruct->GPIO_Mode) << (pinpos * 2));
  3231. 8009e66: ea4a 0909 orr.w r9, sl, r9
  3232. if ((GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) || (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_AF))
  3233. 8009e6a: 2e01 cmp r6, #1
  3234. currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
  3235. if (currentpin == pos)
  3236. {
  3237. GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
  3238. GPIOx->MODER |= (((uint32_t)GPIO_InitStruct->GPIO_Mode) << (pinpos * 2));
  3239. 8009e6c: f8c0 9000 str.w r9, [r0]
  3240. if ((GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) || (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_AF))
  3241. 8009e70: d815 bhi.n 8009e9e <GPIO_Init+0x6e>
  3242. {
  3243. /* Check Speed mode parameters */
  3244. assert_param(IS_GPIO_SPEED(GPIO_InitStruct->GPIO_Speed));
  3245. /* Speed mode configuration */
  3246. GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (pinpos * 2));
  3247. 8009e72: 6886 ldr r6, [r0, #8]
  3248. GPIOx->OSPEEDR |= ((uint32_t)(GPIO_InitStruct->GPIO_Speed) << (pinpos * 2));
  3249. 8009e74: f891 9005 ldrb.w r9, [r1, #5]
  3250. {
  3251. /* Check Speed mode parameters */
  3252. assert_param(IS_GPIO_SPEED(GPIO_InitStruct->GPIO_Speed));
  3253. /* Speed mode configuration */
  3254. GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (pinpos * 2));
  3255. 8009e78: 4026 ands r6, r4
  3256. 8009e7a: 6086 str r6, [r0, #8]
  3257. GPIOx->OSPEEDR |= ((uint32_t)(GPIO_InitStruct->GPIO_Speed) << (pinpos * 2));
  3258. 8009e7c: 6886 ldr r6, [r0, #8]
  3259. 8009e7e: fa09 f902 lsl.w r9, r9, r2
  3260. 8009e82: ea49 0606 orr.w r6, r9, r6
  3261. 8009e86: 6086 str r6, [r0, #8]
  3262. /* Check Output mode parameters */
  3263. assert_param(IS_GPIO_OTYPE(GPIO_InitStruct->GPIO_OType));
  3264. /* Output mode configuration*/
  3265. GPIOx->OTYPER &= ~((GPIO_OTYPER_OT_0) << ((uint16_t)pinpos)) ;
  3266. 8009e88: 6846 ldr r6, [r0, #4]
  3267. 8009e8a: ea26 0505 bic.w r5, r6, r5
  3268. 8009e8e: 6045 str r5, [r0, #4]
  3269. GPIOx->OTYPER |= (uint16_t)(((uint16_t)GPIO_InitStruct->GPIO_OType) << ((uint16_t)pinpos));
  3270. 8009e90: 798d ldrb r5, [r1, #6]
  3271. 8009e92: 6846 ldr r6, [r0, #4]
  3272. 8009e94: fa05 f503 lsl.w r5, r5, r3
  3273. temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3274. GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3275. temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp;
  3276. GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2;
  3277. }
  3278. 8009e98: b2ad uxth r5, r5
  3279. /* Check Output mode parameters */
  3280. assert_param(IS_GPIO_OTYPE(GPIO_InitStruct->GPIO_OType));
  3281. /* Output mode configuration*/
  3282. GPIOx->OTYPER &= ~((GPIO_OTYPER_OT_0) << ((uint16_t)pinpos)) ;
  3283. GPIOx->OTYPER |= (uint16_t)(((uint16_t)GPIO_InitStruct->GPIO_OType) << ((uint16_t)pinpos));
  3284. 8009e9a: 4335 orrs r5, r6
  3285. 8009e9c: 6045 str r5, [r0, #4]
  3286. }
  3287. /* Pull-up Pull down resistor configuration*/
  3288. GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << ((uint16_t)pinpos * 2));
  3289. 8009e9e: 68c5 ldr r5, [r0, #12]
  3290. 8009ea0: 402c ands r4, r5
  3291. 8009ea2: 60c4 str r4, [r0, #12]
  3292. GPIOx->PUPDR |= (((uint32_t)GPIO_InitStruct->GPIO_PuPd) << (pinpos * 2));
  3293. 8009ea4: 79cd ldrb r5, [r1, #7]
  3294. 8009ea6: 68c4 ldr r4, [r0, #12]
  3295. 8009ea8: fa05 f202 lsl.w r2, r5, r2
  3296. 8009eac: 4322 orrs r2, r4
  3297. 8009eae: 60c2 str r2, [r0, #12]
  3298. assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode));
  3299. assert_param(IS_GPIO_PUPD(GPIO_InitStruct->GPIO_PuPd));
  3300. /* -------------------------Configure the port pins---------------- */
  3301. /*-- GPIO Mode Configuration --*/
  3302. for (pinpos = 0x00; pinpos < 0x10; pinpos++)
  3303. 8009eb0: 3301 adds r3, #1
  3304. 8009eb2: 2b10 cmp r3, #16
  3305. 8009eb4: d1c4 bne.n 8009e40 <GPIO_Init+0x10>
  3306. /* Pull-up Pull down resistor configuration*/
  3307. GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << ((uint16_t)pinpos * 2));
  3308. GPIOx->PUPDR |= (((uint32_t)GPIO_InitStruct->GPIO_PuPd) << (pinpos * 2));
  3309. }
  3310. }
  3311. }
  3312. 8009eb6: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  3313. 08009eba <GPIO_ReadInputDataBit>:
  3314. /* Check the parameters */
  3315. assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  3316. assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
  3317. if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)Bit_RESET)
  3318. 8009eba: 6903 ldr r3, [r0, #16]
  3319. 8009ebc: 4219 tst r1, r3
  3320. else
  3321. {
  3322. bitstatus = (uint8_t)Bit_RESET;
  3323. }
  3324. return bitstatus;
  3325. }
  3326. 8009ebe: bf0c ite eq
  3327. 8009ec0: 2000 moveq r0, #0
  3328. 8009ec2: 2001 movne r0, #1
  3329. 8009ec4: 4770 bx lr
  3330. 08009ec6 <GPIO_SetBits>:
  3331. {
  3332. /* Check the parameters */
  3333. assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  3334. assert_param(IS_GPIO_PIN(GPIO_Pin));
  3335. GPIOx->BSRRL = GPIO_Pin;
  3336. 8009ec6: 8301 strh r1, [r0, #24]
  3337. 8009ec8: 4770 bx lr
  3338. 08009eca <GPIO_ResetBits>:
  3339. {
  3340. /* Check the parameters */
  3341. assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  3342. assert_param(IS_GPIO_PIN(GPIO_Pin));
  3343. GPIOx->BSRRH = GPIO_Pin;
  3344. 8009eca: 8341 strh r1, [r0, #26]
  3345. 8009ecc: 4770 bx lr
  3346. 08009ece <GPIO_PinAFConfig>:
  3347. /* Check the parameters */
  3348. assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  3349. assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
  3350. assert_param(IS_GPIO_AF(GPIO_AF));
  3351. temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3352. 8009ece: f001 0307 and.w r3, r1, #7
  3353. GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3354. 8009ed2: 08c9 lsrs r1, r1, #3
  3355. 8009ed4: 3108 adds r1, #8
  3356. * @arg GPIO_AF_DCMI: Connect DCMI pins to AF13
  3357. * @arg GPIO_AF_EVENTOUT: Connect EVENTOUT pins to AF15
  3358. * @retval None
  3359. */
  3360. void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
  3361. {
  3362. 8009ed6: b530 push {r4, r5, lr}
  3363. /* Check the parameters */
  3364. assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  3365. assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
  3366. assert_param(IS_GPIO_AF(GPIO_AF));
  3367. temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3368. 8009ed8: 009b lsls r3, r3, #2
  3369. GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3370. 8009eda: f850 5021 ldr.w r5, [r0, r1, lsl #2]
  3371. 8009ede: 240f movs r4, #15
  3372. 8009ee0: fa04 f403 lsl.w r4, r4, r3
  3373. 8009ee4: ea25 0404 bic.w r4, r5, r4
  3374. 8009ee8: f840 4021 str.w r4, [r0, r1, lsl #2]
  3375. temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp;
  3376. 8009eec: f850 4021 ldr.w r4, [r0, r1, lsl #2]
  3377. /* Check the parameters */
  3378. assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  3379. assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
  3380. assert_param(IS_GPIO_AF(GPIO_AF));
  3381. temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3382. 8009ef0: fa02 f203 lsl.w r2, r2, r3
  3383. GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
  3384. temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp;
  3385. 8009ef4: 4314 orrs r4, r2
  3386. GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2;
  3387. 8009ef6: f840 4021 str.w r4, [r0, r1, lsl #2]
  3388. 8009efa: bd30 pop {r4, r5, pc}
  3389. 08009efc <PWR_BackupAccessCmd>:
  3390. void PWR_BackupAccessCmd(FunctionalState NewState)
  3391. {
  3392. /* Check the parameters */
  3393. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3394. *(__IO uint32_t *) CR_DBP_BB = (uint32_t)NewState;
  3395. 8009efc: 4b01 ldr r3, [pc, #4] ; (8009f04 <PWR_BackupAccessCmd+0x8>)
  3396. 8009efe: 6018 str r0, [r3, #0]
  3397. 8009f00: 4770 bx lr
  3398. 8009f02: bf00 nop
  3399. 8009f04: 420e0020 .word 0x420e0020
  3400. 08009f08 <RCC_GetClocksFreq>:
  3401. void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)
  3402. {
  3403. uint32_t tmp = 0, presc = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
  3404. /* Get SYSCLK source -------------------------------------------------------*/
  3405. tmp = RCC->CFGR & RCC_CFGR_SWS;
  3406. 8009f08: 4b1e ldr r3, [pc, #120] ; (8009f84 <RCC_GetClocksFreq+0x7c>)
  3407. 8009f0a: 689a ldr r2, [r3, #8]
  3408. 8009f0c: f002 020c and.w r2, r2, #12
  3409. switch (tmp)
  3410. 8009f10: 2a04 cmp r2, #4
  3411. * configuration based on this function will be incorrect.
  3412. *
  3413. * @retval None
  3414. */
  3415. void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)
  3416. {
  3417. 8009f12: b510 push {r4, lr}
  3418. uint32_t tmp = 0, presc = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
  3419. /* Get SYSCLK source -------------------------------------------------------*/
  3420. tmp = RCC->CFGR & RCC_CFGR_SWS;
  3421. switch (tmp)
  3422. 8009f14: d003 beq.n 8009f1e <RCC_GetClocksFreq+0x16>
  3423. 8009f16: 2a08 cmp r2, #8
  3424. 8009f18: d003 beq.n 8009f22 <RCC_GetClocksFreq+0x1a>
  3425. 8009f1a: 4b1b ldr r3, [pc, #108] ; (8009f88 <RCC_GetClocksFreq+0x80>)
  3426. 8009f1c: e018 b.n 8009f50 <RCC_GetClocksFreq+0x48>
  3427. {
  3428. case 0x00: /* HSI used as system clock source */
  3429. RCC_Clocks->SYSCLK_Frequency = HSI_VALUE;
  3430. break;
  3431. case 0x04: /* HSE used as system clock source */
  3432. RCC_Clocks->SYSCLK_Frequency = HSE_VALUE;
  3433. 8009f1e: 4b1b ldr r3, [pc, #108] ; (8009f8c <RCC_GetClocksFreq+0x84>)
  3434. 8009f20: e016 b.n 8009f50 <RCC_GetClocksFreq+0x48>
  3435. case 0x08: /* PLL used as system clock source */
  3436. /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN
  3437. SYSCLK = PLL_VCO / PLLP
  3438. */
  3439. pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22;
  3440. 8009f22: 6859 ldr r1, [r3, #4]
  3441. pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
  3442. 8009f24: 685a ldr r2, [r3, #4]
  3443. if (pllsource != 0)
  3444. 8009f26: f411 0f80 tst.w r1, #4194304 ; 0x400000
  3445. {
  3446. /* HSE used as PLL clock source */
  3447. pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3448. 8009f2a: 6859 ldr r1, [r3, #4]
  3449. 8009f2c: bf14 ite ne
  3450. 8009f2e: 4b17 ldrne r3, [pc, #92] ; (8009f8c <RCC_GetClocksFreq+0x84>)
  3451. }
  3452. else
  3453. {
  3454. /* HSI used as PLL clock source */
  3455. pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3456. 8009f30: 4b15 ldreq r3, [pc, #84] ; (8009f88 <RCC_GetClocksFreq+0x80>)
  3457. /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN
  3458. SYSCLK = PLL_VCO / PLLP
  3459. */
  3460. pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22;
  3461. pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
  3462. 8009f32: f002 023f and.w r2, r2, #63 ; 0x3f
  3463. pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3464. }
  3465. else
  3466. {
  3467. /* HSI used as PLL clock source */
  3468. pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3469. 8009f36: fbb3 f3f2 udiv r3, r3, r2
  3470. }
  3471. pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
  3472. 8009f3a: 4a12 ldr r2, [pc, #72] ; (8009f84 <RCC_GetClocksFreq+0x7c>)
  3473. 8009f3c: 6852 ldr r2, [r2, #4]
  3474. 8009f3e: f3c2 4201 ubfx r2, r2, #16, #2
  3475. pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
  3476. if (pllsource != 0)
  3477. {
  3478. /* HSE used as PLL clock source */
  3479. pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3480. 8009f42: f3c1 1188 ubfx r1, r1, #6, #9
  3481. {
  3482. /* HSI used as PLL clock source */
  3483. pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3484. }
  3485. pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
  3486. 8009f46: 3201 adds r2, #1
  3487. pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3488. }
  3489. else
  3490. {
  3491. /* HSI used as PLL clock source */
  3492. pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3493. 8009f48: 434b muls r3, r1
  3494. }
  3495. pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
  3496. 8009f4a: 0052 lsls r2, r2, #1
  3497. RCC_Clocks->SYSCLK_Frequency = pllvco/pllp;
  3498. 8009f4c: fbb3 f3f2 udiv r3, r3, r2
  3499. break;
  3500. }
  3501. /* Compute HCLK, PCLK1 and PCLK2 clocks frequencies ------------------------*/
  3502. /* Get HCLK prescaler */
  3503. tmp = RCC->CFGR & RCC_CFGR_HPRE;
  3504. 8009f50: 490c ldr r1, [pc, #48] ; (8009f84 <RCC_GetClocksFreq+0x7c>)
  3505. /* HSI used as PLL clock source */
  3506. pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
  3507. }
  3508. pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
  3509. RCC_Clocks->SYSCLK_Frequency = pllvco/pllp;
  3510. 8009f52: 6003 str r3, [r0, #0]
  3511. break;
  3512. }
  3513. /* Compute HCLK, PCLK1 and PCLK2 clocks frequencies ------------------------*/
  3514. /* Get HCLK prescaler */
  3515. tmp = RCC->CFGR & RCC_CFGR_HPRE;
  3516. 8009f54: 688b ldr r3, [r1, #8]
  3517. tmp = tmp >> 4;
  3518. presc = APBAHBPrescTable[tmp];
  3519. 8009f56: 4a0e ldr r2, [pc, #56] ; (8009f90 <RCC_GetClocksFreq+0x88>)
  3520. }
  3521. /* Compute HCLK, PCLK1 and PCLK2 clocks frequencies ------------------------*/
  3522. /* Get HCLK prescaler */
  3523. tmp = RCC->CFGR & RCC_CFGR_HPRE;
  3524. tmp = tmp >> 4;
  3525. 8009f58: f3c3 1303 ubfx r3, r3, #4, #4
  3526. presc = APBAHBPrescTable[tmp];
  3527. 8009f5c: 5cd4 ldrb r4, [r2, r3]
  3528. /* HCLK clock frequency */
  3529. RCC_Clocks->HCLK_Frequency = RCC_Clocks->SYSCLK_Frequency >> presc;
  3530. 8009f5e: 6803 ldr r3, [r0, #0]
  3531. 8009f60: fa23 f304 lsr.w r3, r3, r4
  3532. 8009f64: 6043 str r3, [r0, #4]
  3533. /* Get PCLK1 prescaler */
  3534. tmp = RCC->CFGR & RCC_CFGR_PPRE1;
  3535. 8009f66: 688c ldr r4, [r1, #8]
  3536. tmp = tmp >> 10;
  3537. 8009f68: f3c4 2482 ubfx r4, r4, #10, #3
  3538. presc = APBAHBPrescTable[tmp];
  3539. 8009f6c: 5d14 ldrb r4, [r2, r4]
  3540. /* PCLK1 clock frequency */
  3541. RCC_Clocks->PCLK1_Frequency = RCC_Clocks->HCLK_Frequency >> presc;
  3542. 8009f6e: fa23 f404 lsr.w r4, r3, r4
  3543. 8009f72: 6084 str r4, [r0, #8]
  3544. /* Get PCLK2 prescaler */
  3545. tmp = RCC->CFGR & RCC_CFGR_PPRE2;
  3546. 8009f74: 6889 ldr r1, [r1, #8]
  3547. tmp = tmp >> 13;
  3548. 8009f76: f3c1 3142 ubfx r1, r1, #13, #3
  3549. presc = APBAHBPrescTable[tmp];
  3550. 8009f7a: 5c52 ldrb r2, [r2, r1]
  3551. /* PCLK2 clock frequency */
  3552. RCC_Clocks->PCLK2_Frequency = RCC_Clocks->HCLK_Frequency >> presc;
  3553. 8009f7c: fa23 f302 lsr.w r3, r3, r2
  3554. 8009f80: 60c3 str r3, [r0, #12]
  3555. 8009f82: bd10 pop {r4, pc}
  3556. 8009f84: 40023800 .word 0x40023800
  3557. 8009f88: 00f42400 .word 0x00f42400
  3558. 8009f8c: 017d7840 .word 0x017d7840
  3559. 8009f90: 200000f8 .word 0x200000f8
  3560. 08009f94 <RCC_AHB1PeriphClockCmd>:
  3561. * @param NewState: new state of the specified peripheral clock.
  3562. * This parameter can be: ENABLE or DISABLE.
  3563. * @retval None
  3564. */
  3565. void RCC_AHB1PeriphClockCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState)
  3566. {
  3567. 8009f94: 4b04 ldr r3, [pc, #16] ; (8009fa8 <RCC_AHB1PeriphClockCmd+0x14>)
  3568. assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph));
  3569. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3570. if (NewState != DISABLE)
  3571. {
  3572. RCC->AHB1ENR |= RCC_AHB1Periph;
  3573. 8009f96: 6b1a ldr r2, [r3, #48] ; 0x30
  3574. {
  3575. /* Check the parameters */
  3576. assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph));
  3577. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3578. if (NewState != DISABLE)
  3579. 8009f98: b109 cbz r1, 8009f9e <RCC_AHB1PeriphClockCmd+0xa>
  3580. {
  3581. RCC->AHB1ENR |= RCC_AHB1Periph;
  3582. 8009f9a: 4310 orrs r0, r2
  3583. 8009f9c: e001 b.n 8009fa2 <RCC_AHB1PeriphClockCmd+0xe>
  3584. }
  3585. else
  3586. {
  3587. RCC->AHB1ENR &= ~RCC_AHB1Periph;
  3588. 8009f9e: ea22 0000 bic.w r0, r2, r0
  3589. 8009fa2: 6318 str r0, [r3, #48] ; 0x30
  3590. 8009fa4: 4770 bx lr
  3591. 8009fa6: bf00 nop
  3592. 8009fa8: 40023800 .word 0x40023800
  3593. 08009fac <RCC_APB1PeriphClockCmd>:
  3594. * @param NewState: new state of the specified peripheral clock.
  3595. * This parameter can be: ENABLE or DISABLE.
  3596. * @retval None
  3597. */
  3598. void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
  3599. {
  3600. 8009fac: 4b04 ldr r3, [pc, #16] ; (8009fc0 <RCC_APB1PeriphClockCmd+0x14>)
  3601. assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph));
  3602. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3603. if (NewState != DISABLE)
  3604. {
  3605. RCC->APB1ENR |= RCC_APB1Periph;
  3606. 8009fae: 6c1a ldr r2, [r3, #64] ; 0x40
  3607. {
  3608. /* Check the parameters */
  3609. assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph));
  3610. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3611. if (NewState != DISABLE)
  3612. 8009fb0: b109 cbz r1, 8009fb6 <RCC_APB1PeriphClockCmd+0xa>
  3613. {
  3614. RCC->APB1ENR |= RCC_APB1Periph;
  3615. 8009fb2: 4310 orrs r0, r2
  3616. 8009fb4: e001 b.n 8009fba <RCC_APB1PeriphClockCmd+0xe>
  3617. }
  3618. else
  3619. {
  3620. RCC->APB1ENR &= ~RCC_APB1Periph;
  3621. 8009fb6: ea22 0000 bic.w r0, r2, r0
  3622. 8009fba: 6418 str r0, [r3, #64] ; 0x40
  3623. 8009fbc: 4770 bx lr
  3624. 8009fbe: bf00 nop
  3625. 8009fc0: 40023800 .word 0x40023800
  3626. 08009fc4 <RCC_APB2PeriphClockCmd>:
  3627. * @param NewState: new state of the specified peripheral clock.
  3628. * This parameter can be: ENABLE or DISABLE.
  3629. * @retval None
  3630. */
  3631. void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
  3632. {
  3633. 8009fc4: 4b04 ldr r3, [pc, #16] ; (8009fd8 <RCC_APB2PeriphClockCmd+0x14>)
  3634. assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph));
  3635. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3636. if (NewState != DISABLE)
  3637. {
  3638. RCC->APB2ENR |= RCC_APB2Periph;
  3639. 8009fc6: 6c5a ldr r2, [r3, #68] ; 0x44
  3640. {
  3641. /* Check the parameters */
  3642. assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph));
  3643. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3644. if (NewState != DISABLE)
  3645. 8009fc8: b109 cbz r1, 8009fce <RCC_APB2PeriphClockCmd+0xa>
  3646. {
  3647. RCC->APB2ENR |= RCC_APB2Periph;
  3648. 8009fca: 4310 orrs r0, r2
  3649. 8009fcc: e001 b.n 8009fd2 <RCC_APB2PeriphClockCmd+0xe>
  3650. }
  3651. else
  3652. {
  3653. RCC->APB2ENR &= ~RCC_APB2Periph;
  3654. 8009fce: ea22 0000 bic.w r0, r2, r0
  3655. 8009fd2: 6458 str r0, [r3, #68] ; 0x44
  3656. 8009fd4: 4770 bx lr
  3657. 8009fd6: bf00 nop
  3658. 8009fd8: 40023800 .word 0x40023800
  3659. 08009fdc <RCC_AHB1PeriphResetCmd>:
  3660. * @param NewState: new state of the specified peripheral reset.
  3661. * This parameter can be: ENABLE or DISABLE.
  3662. * @retval None
  3663. */
  3664. void RCC_AHB1PeriphResetCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState)
  3665. {
  3666. 8009fdc: 4b04 ldr r3, [pc, #16] ; (8009ff0 <RCC_AHB1PeriphResetCmd+0x14>)
  3667. assert_param(IS_RCC_AHB1_RESET_PERIPH(RCC_AHB1Periph));
  3668. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3669. if (NewState != DISABLE)
  3670. {
  3671. RCC->AHB1RSTR |= RCC_AHB1Periph;
  3672. 8009fde: 691a ldr r2, [r3, #16]
  3673. {
  3674. /* Check the parameters */
  3675. assert_param(IS_RCC_AHB1_RESET_PERIPH(RCC_AHB1Periph));
  3676. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3677. if (NewState != DISABLE)
  3678. 8009fe0: b109 cbz r1, 8009fe6 <RCC_AHB1PeriphResetCmd+0xa>
  3679. {
  3680. RCC->AHB1RSTR |= RCC_AHB1Periph;
  3681. 8009fe2: 4310 orrs r0, r2
  3682. 8009fe4: e001 b.n 8009fea <RCC_AHB1PeriphResetCmd+0xe>
  3683. }
  3684. else
  3685. {
  3686. RCC->AHB1RSTR &= ~RCC_AHB1Periph;
  3687. 8009fe6: ea22 0000 bic.w r0, r2, r0
  3688. 8009fea: 6118 str r0, [r3, #16]
  3689. 8009fec: 4770 bx lr
  3690. 8009fee: bf00 nop
  3691. 8009ff0: 40023800 .word 0x40023800
  3692. 08009ff4 <RTC_WriteBackupRegister>:
  3693. * specify the register.
  3694. * @param Data: Data to be written in the specified RTC Backup data register.
  3695. * @retval None
  3696. */
  3697. void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data)
  3698. {
  3699. 8009ff4: b082 sub sp, #8
  3700. __IO uint32_t tmp = 0;
  3701. 8009ff6: 2300 movs r3, #0
  3702. 8009ff8: 9301 str r3, [sp, #4]
  3703. /* Check the parameters */
  3704. assert_param(IS_RTC_BKP(RTC_BKP_DR));
  3705. tmp = RTC_BASE + 0x50;
  3706. 8009ffa: 4b05 ldr r3, [pc, #20] ; (800a010 <RTC_WriteBackupRegister+0x1c>)
  3707. 8009ffc: 9301 str r3, [sp, #4]
  3708. tmp += (RTC_BKP_DR * 4);
  3709. 8009ffe: 9b01 ldr r3, [sp, #4]
  3710. 800a000: eb03 0080 add.w r0, r3, r0, lsl #2
  3711. 800a004: 9001 str r0, [sp, #4]
  3712. /* Write the specified register */
  3713. *(__IO uint32_t *)tmp = (uint32_t)Data;
  3714. 800a006: 9b01 ldr r3, [sp, #4]
  3715. 800a008: 6019 str r1, [r3, #0]
  3716. }
  3717. 800a00a: b002 add sp, #8
  3718. 800a00c: 4770 bx lr
  3719. 800a00e: bf00 nop
  3720. 800a010: 40002850 .word 0x40002850
  3721. 0800a014 <RTC_ReadBackupRegister>:
  3722. * This parameter can be: RTC_BKP_DRx where x can be from 0 to 19 to
  3723. * specify the register.
  3724. * @retval None
  3725. */
  3726. uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR)
  3727. {
  3728. 800a014: b082 sub sp, #8
  3729. __IO uint32_t tmp = 0;
  3730. 800a016: 2300 movs r3, #0
  3731. 800a018: 9301 str r3, [sp, #4]
  3732. /* Check the parameters */
  3733. assert_param(IS_RTC_BKP(RTC_BKP_DR));
  3734. tmp = RTC_BASE + 0x50;
  3735. 800a01a: 4b05 ldr r3, [pc, #20] ; (800a030 <RTC_ReadBackupRegister+0x1c>)
  3736. 800a01c: 9301 str r3, [sp, #4]
  3737. tmp += (RTC_BKP_DR * 4);
  3738. 800a01e: 9b01 ldr r3, [sp, #4]
  3739. 800a020: eb03 0080 add.w r0, r3, r0, lsl #2
  3740. 800a024: 9001 str r0, [sp, #4]
  3741. /* Read the specified register */
  3742. return (*(__IO uint32_t *)tmp);
  3743. 800a026: 9b01 ldr r3, [sp, #4]
  3744. 800a028: 6818 ldr r0, [r3, #0]
  3745. }
  3746. 800a02a: b002 add sp, #8
  3747. 800a02c: 4770 bx lr
  3748. 800a02e: bf00 nop
  3749. 800a030: 40002850 .word 0x40002850
  3750. 0800a034 <SYSCFG_ETH_MediaInterfaceConfig>:
  3751. */
  3752. void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface)
  3753. {
  3754. assert_param(IS_SYSCFG_ETH_MEDIA_INTERFACE(SYSCFG_ETH_MediaInterface));
  3755. /* Configure MII_RMII selection bit */
  3756. *(__IO uint32_t *) PMC_MII_RMII_SEL_BB = SYSCFG_ETH_MediaInterface;
  3757. 800a034: 4b01 ldr r3, [pc, #4] ; (800a03c <SYSCFG_ETH_MediaInterfaceConfig+0x8>)
  3758. 800a036: 6018 str r0, [r3, #0]
  3759. 800a038: 4770 bx lr
  3760. 800a03a: bf00 nop
  3761. 800a03c: 422700dc .word 0x422700dc
  3762. 0800a040 <TIM_TimeBaseInit>:
  3763. assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode));
  3764. assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision));
  3765. tmpcr1 = TIMx->CR1;
  3766. if((TIMx == TIM1) || (TIMx == TIM8)||
  3767. 800a040: 4a1c ldr r2, [pc, #112] ; (800a0b4 <TIM_TimeBaseInit+0x74>)
  3768. /* Check the parameters */
  3769. assert_param(IS_TIM_ALL_PERIPH(TIMx));
  3770. assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode));
  3771. assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision));
  3772. tmpcr1 = TIMx->CR1;
  3773. 800a042: 8803 ldrh r3, [r0, #0]
  3774. if((TIMx == TIM1) || (TIMx == TIM8)||
  3775. 800a044: 4290 cmp r0, r2
  3776. /* Check the parameters */
  3777. assert_param(IS_TIM_ALL_PERIPH(TIMx));
  3778. assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode));
  3779. assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision));
  3780. tmpcr1 = TIMx->CR1;
  3781. 800a046: b29b uxth r3, r3
  3782. if((TIMx == TIM1) || (TIMx == TIM8)||
  3783. 800a048: d012 beq.n 800a070 <TIM_TimeBaseInit+0x30>
  3784. 800a04a: f502 6280 add.w r2, r2, #1024 ; 0x400
  3785. 800a04e: 4290 cmp r0, r2
  3786. 800a050: d00e beq.n 800a070 <TIM_TimeBaseInit+0x30>
  3787. 800a052: f1b0 4f80 cmp.w r0, #1073741824 ; 0x40000000
  3788. 800a056: d00b beq.n 800a070 <TIM_TimeBaseInit+0x30>
  3789. (TIMx == TIM2) || (TIMx == TIM3)||
  3790. 800a058: f5a2 3280 sub.w r2, r2, #65536 ; 0x10000
  3791. 800a05c: 4290 cmp r0, r2
  3792. 800a05e: d007 beq.n 800a070 <TIM_TimeBaseInit+0x30>
  3793. 800a060: f502 6280 add.w r2, r2, #1024 ; 0x400
  3794. 800a064: 4290 cmp r0, r2
  3795. 800a066: d003 beq.n 800a070 <TIM_TimeBaseInit+0x30>
  3796. (TIMx == TIM4) || (TIMx == TIM5))
  3797. 800a068: f502 6280 add.w r2, r2, #1024 ; 0x400
  3798. 800a06c: 4290 cmp r0, r2
  3799. 800a06e: d103 bne.n 800a078 <TIM_TimeBaseInit+0x38>
  3800. {
  3801. /* Select the Counter Mode */
  3802. tmpcr1 &= (uint16_t)(~(TIM_CR1_DIR | TIM_CR1_CMS));
  3803. tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode;
  3804. 800a070: 884a ldrh r2, [r1, #2]
  3805. if((TIMx == TIM1) || (TIMx == TIM8)||
  3806. (TIMx == TIM2) || (TIMx == TIM3)||
  3807. (TIMx == TIM4) || (TIMx == TIM5))
  3808. {
  3809. /* Select the Counter Mode */
  3810. tmpcr1 &= (uint16_t)(~(TIM_CR1_DIR | TIM_CR1_CMS));
  3811. 800a072: f023 0370 bic.w r3, r3, #112 ; 0x70
  3812. tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode;
  3813. 800a076: 4313 orrs r3, r2
  3814. }
  3815. if((TIMx != TIM6) && (TIMx != TIM7))
  3816. 800a078: 4a0f ldr r2, [pc, #60] ; (800a0b8 <TIM_TimeBaseInit+0x78>)
  3817. 800a07a: 4290 cmp r0, r2
  3818. 800a07c: d008 beq.n 800a090 <TIM_TimeBaseInit+0x50>
  3819. 800a07e: f502 6280 add.w r2, r2, #1024 ; 0x400
  3820. 800a082: 4290 cmp r0, r2
  3821. 800a084: d004 beq.n 800a090 <TIM_TimeBaseInit+0x50>
  3822. {
  3823. /* Set the clock division */
  3824. tmpcr1 &= (uint16_t)(~TIM_CR1_CKD);
  3825. 800a086: f423 7340 bic.w r3, r3, #768 ; 0x300
  3826. tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision;
  3827. 800a08a: 890a ldrh r2, [r1, #8]
  3828. }
  3829. if((TIMx != TIM6) && (TIMx != TIM7))
  3830. {
  3831. /* Set the clock division */
  3832. tmpcr1 &= (uint16_t)(~TIM_CR1_CKD);
  3833. 800a08c: b29b uxth r3, r3
  3834. tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision;
  3835. 800a08e: 4313 orrs r3, r2
  3836. }
  3837. TIMx->CR1 = tmpcr1;
  3838. 800a090: 8003 strh r3, [r0, #0]
  3839. /* Set the Autoreload value */
  3840. TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ;
  3841. 800a092: 684b ldr r3, [r1, #4]
  3842. 800a094: 62c3 str r3, [r0, #44] ; 0x2c
  3843. /* Set the Prescaler value */
  3844. TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler;
  3845. 800a096: 880b ldrh r3, [r1, #0]
  3846. 800a098: 8503 strh r3, [r0, #40] ; 0x28
  3847. if ((TIMx == TIM1) || (TIMx == TIM8))
  3848. 800a09a: 4b06 ldr r3, [pc, #24] ; (800a0b4 <TIM_TimeBaseInit+0x74>)
  3849. 800a09c: 4298 cmp r0, r3
  3850. 800a09e: d003 beq.n 800a0a8 <TIM_TimeBaseInit+0x68>
  3851. 800a0a0: f503 6380 add.w r3, r3, #1024 ; 0x400
  3852. 800a0a4: 4298 cmp r0, r3
  3853. 800a0a6: d101 bne.n 800a0ac <TIM_TimeBaseInit+0x6c>
  3854. {
  3855. /* Set the Repetition Counter value */
  3856. TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter;
  3857. 800a0a8: 7a8b ldrb r3, [r1, #10]
  3858. 800a0aa: 8603 strh r3, [r0, #48] ; 0x30
  3859. }
  3860. /* Generate an update event to reload the Prescaler
  3861. and the repetition counter(only for TIM1 and TIM8) value immediatly */
  3862. TIMx->EGR = TIM_PSCReloadMode_Immediate;
  3863. 800a0ac: 2301 movs r3, #1
  3864. 800a0ae: 8283 strh r3, [r0, #20]
  3865. 800a0b0: 4770 bx lr
  3866. 800a0b2: bf00 nop
  3867. 800a0b4: 40010000 .word 0x40010000
  3868. 800a0b8: 40001000 .word 0x40001000
  3869. 0800a0bc <TIM_Cmd>:
  3870. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3871. if (NewState != DISABLE)
  3872. {
  3873. /* Enable the TIM Counter */
  3874. TIMx->CR1 |= TIM_CR1_CEN;
  3875. 800a0bc: 8803 ldrh r3, [r0, #0]
  3876. {
  3877. /* Check the parameters */
  3878. assert_param(IS_TIM_ALL_PERIPH(TIMx));
  3879. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3880. if (NewState != DISABLE)
  3881. 800a0be: b119 cbz r1, 800a0c8 <TIM_Cmd+0xc>
  3882. {
  3883. /* Enable the TIM Counter */
  3884. TIMx->CR1 |= TIM_CR1_CEN;
  3885. 800a0c0: b29b uxth r3, r3
  3886. 800a0c2: f043 0301 orr.w r3, r3, #1
  3887. 800a0c6: e003 b.n 800a0d0 <TIM_Cmd+0x14>
  3888. }
  3889. else
  3890. {
  3891. /* Disable the TIM Counter */
  3892. TIMx->CR1 &= (uint16_t)~TIM_CR1_CEN;
  3893. 800a0c8: f023 0301 bic.w r3, r3, #1
  3894. 800a0cc: 041b lsls r3, r3, #16
  3895. 800a0ce: 0c1b lsrs r3, r3, #16
  3896. 800a0d0: 8003 strh r3, [r0, #0]
  3897. 800a0d2: 4770 bx lr
  3898. 0800a0d4 <TIM_ITConfig>:
  3899. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3900. if (NewState != DISABLE)
  3901. {
  3902. /* Enable the Interrupt sources */
  3903. TIMx->DIER |= TIM_IT;
  3904. 800a0d4: 8983 ldrh r3, [r0, #12]
  3905. 800a0d6: b29b uxth r3, r3
  3906. /* Check the parameters */
  3907. assert_param(IS_TIM_ALL_PERIPH(TIMx));
  3908. assert_param(IS_TIM_IT(TIM_IT));
  3909. assert_param(IS_FUNCTIONAL_STATE(NewState));
  3910. if (NewState != DISABLE)
  3911. 800a0d8: b10a cbz r2, 800a0de <TIM_ITConfig+0xa>
  3912. {
  3913. /* Enable the Interrupt sources */
  3914. TIMx->DIER |= TIM_IT;
  3915. 800a0da: 4319 orrs r1, r3
  3916. 800a0dc: e001 b.n 800a0e2 <TIM_ITConfig+0xe>
  3917. }
  3918. else
  3919. {
  3920. /* Disable the Interrupt sources */
  3921. TIMx->DIER &= (uint16_t)~TIM_IT;
  3922. 800a0de: ea23 0101 bic.w r1, r3, r1
  3923. 800a0e2: 8181 strh r1, [r0, #12]
  3924. 800a0e4: 4770 bx lr
  3925. 0800a0e6 <TIM_ClearITPendingBit>:
  3926. {
  3927. /* Check the parameters */
  3928. assert_param(IS_TIM_ALL_PERIPH(TIMx));
  3929. /* Clear the IT pending Bit */
  3930. TIMx->SR = (uint16_t)~TIM_IT;
  3931. 800a0e6: 43c9 mvns r1, r1
  3932. 800a0e8: 8201 strh r1, [r0, #16]
  3933. 800a0ea: 4770 bx lr
  3934. 0800a0ec <USART_Init>:
  3935. {
  3936. assert_param(IS_USART_1236_PERIPH(USARTx));
  3937. }
  3938. /*---------------------------- USART CR2 Configuration -----------------------*/
  3939. tmpreg = USARTx->CR2;
  3940. 800a0ec: 8a03 ldrh r3, [r0, #16]
  3941. /* Clear STOP[13:12] bits */
  3942. tmpreg &= (uint32_t)~((uint32_t)USART_CR2_STOP);
  3943. /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit :
  3944. Set STOP[13:12] bits according to USART_StopBits value */
  3945. tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
  3946. 800a0ee: 88ca ldrh r2, [r1, #6]
  3947. {
  3948. assert_param(IS_USART_1236_PERIPH(USARTx));
  3949. }
  3950. /*---------------------------- USART CR2 Configuration -----------------------*/
  3951. tmpreg = USARTx->CR2;
  3952. 800a0f0: b29b uxth r3, r3
  3953. /* Clear STOP[13:12] bits */
  3954. tmpreg &= (uint32_t)~((uint32_t)USART_CR2_STOP);
  3955. 800a0f2: f423 5340 bic.w r3, r3, #12288 ; 0x3000
  3956. * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
  3957. * the configuration information for the specified USART peripheral.
  3958. * @retval None
  3959. */
  3960. void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
  3961. {
  3962. 800a0f6: b530 push {r4, r5, lr}
  3963. /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit :
  3964. Set STOP[13:12] bits according to USART_StopBits value */
  3965. tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
  3966. /* Write to USART CR2 */
  3967. USARTx->CR2 = (uint16_t)tmpreg;
  3968. 800a0f8: 4313 orrs r3, r2
  3969. * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
  3970. * the configuration information for the specified USART peripheral.
  3971. * @retval None
  3972. */
  3973. void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
  3974. {
  3975. 800a0fa: 460d mov r5, r1
  3976. /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit :
  3977. Set STOP[13:12] bits according to USART_StopBits value */
  3978. tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
  3979. /* Write to USART CR2 */
  3980. USARTx->CR2 = (uint16_t)tmpreg;
  3981. 800a0fc: 8203 strh r3, [r0, #16]
  3982. /*---------------------------- USART CR1 Configuration -----------------------*/
  3983. tmpreg = USARTx->CR1;
  3984. 800a0fe: 8983 ldrh r3, [r0, #12]
  3985. /* Configure the USART Word Length, Parity and mode:
  3986. Set the M bits according to USART_WordLength value
  3987. Set PCE and PS bits according to USART_Parity value
  3988. Set TE and RE bits according to USART_Mode value */
  3989. tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
  3990. 800a100: 8909 ldrh r1, [r1, #8]
  3991. 800a102: 88aa ldrh r2, [r5, #4]
  3992. /*---------------------------- USART CR1 Configuration -----------------------*/
  3993. tmpreg = USARTx->CR1;
  3994. /* Clear M, PCE, PS, TE and RE bits */
  3995. tmpreg &= (uint32_t)~((uint32_t)CR1_CLEAR_MASK);
  3996. 800a104: f423 53b0 bic.w r3, r3, #5632 ; 0x1600
  3997. /* Configure the USART Word Length, Parity and mode:
  3998. Set the M bits according to USART_WordLength value
  3999. Set PCE and PS bits according to USART_Parity value
  4000. Set TE and RE bits according to USART_Mode value */
  4001. tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
  4002. 800a108: 430a orrs r2, r1
  4003. 800a10a: 8969 ldrh r1, [r5, #10]
  4004. /*---------------------------- USART CR1 Configuration -----------------------*/
  4005. tmpreg = USARTx->CR1;
  4006. /* Clear M, PCE, PS, TE and RE bits */
  4007. tmpreg &= (uint32_t)~((uint32_t)CR1_CLEAR_MASK);
  4008. 800a10c: f023 030c bic.w r3, r3, #12
  4009. 800a110: 041b lsls r3, r3, #16
  4010. /* Configure the USART Word Length, Parity and mode:
  4011. Set the M bits according to USART_WordLength value
  4012. Set PCE and PS bits according to USART_Parity value
  4013. Set TE and RE bits according to USART_Mode value */
  4014. tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
  4015. 800a112: 430a orrs r2, r1
  4016. /*---------------------------- USART CR1 Configuration -----------------------*/
  4017. tmpreg = USARTx->CR1;
  4018. /* Clear M, PCE, PS, TE and RE bits */
  4019. tmpreg &= (uint32_t)~((uint32_t)CR1_CLEAR_MASK);
  4020. 800a114: 0c1b lsrs r3, r3, #16
  4021. /* Configure the USART Word Length, Parity and mode:
  4022. Set the M bits according to USART_WordLength value
  4023. Set PCE and PS bits according to USART_Parity value
  4024. Set TE and RE bits according to USART_Mode value */
  4025. tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
  4026. 800a116: b292 uxth r2, r2
  4027. USART_InitStruct->USART_Mode;
  4028. /* Write to USART CR1 */
  4029. USARTx->CR1 = (uint16_t)tmpreg;
  4030. 800a118: 4313 orrs r3, r2
  4031. 800a11a: 8183 strh r3, [r0, #12]
  4032. /*---------------------------- USART CR3 Configuration -----------------------*/
  4033. tmpreg = USARTx->CR3;
  4034. 800a11c: 8a83 ldrh r3, [r0, #20]
  4035. /* Clear CTSE and RTSE bits */
  4036. tmpreg &= (uint32_t)~((uint32_t)CR3_CLEAR_MASK);
  4037. /* Configure the USART HFC :
  4038. Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
  4039. tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
  4040. 800a11e: 89aa ldrh r2, [r5, #12]
  4041. /* Write to USART CR1 */
  4042. USARTx->CR1 = (uint16_t)tmpreg;
  4043. /*---------------------------- USART CR3 Configuration -----------------------*/
  4044. tmpreg = USARTx->CR3;
  4045. 800a120: b29b uxth r3, r3
  4046. /* Clear CTSE and RTSE bits */
  4047. tmpreg &= (uint32_t)~((uint32_t)CR3_CLEAR_MASK);
  4048. 800a122: f423 7340 bic.w r3, r3, #768 ; 0x300
  4049. /* Configure the USART HFC :
  4050. Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
  4051. tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
  4052. /* Write to USART CR3 */
  4053. USARTx->CR3 = (uint16_t)tmpreg;
  4054. 800a126: 4313 orrs r3, r2
  4055. * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
  4056. * the configuration information for the specified USART peripheral.
  4057. * @retval None
  4058. */
  4059. void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
  4060. {
  4061. 800a128: b085 sub sp, #20
  4062. /* Configure the USART HFC :
  4063. Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
  4064. tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
  4065. /* Write to USART CR3 */
  4066. USARTx->CR3 = (uint16_t)tmpreg;
  4067. 800a12a: 8283 strh r3, [r0, #20]
  4068. * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
  4069. * the configuration information for the specified USART peripheral.
  4070. * @retval None
  4071. */
  4072. void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
  4073. {
  4074. 800a12c: 4604 mov r4, r0
  4075. /* Write to USART CR3 */
  4076. USARTx->CR3 = (uint16_t)tmpreg;
  4077. /*---------------------------- USART BRR Configuration -----------------------*/
  4078. /* Configure the USART Baud Rate */
  4079. RCC_GetClocksFreq(&RCC_ClocksStatus);
  4080. 800a12e: 4668 mov r0, sp
  4081. 800a130: f7ff feea bl 8009f08 <RCC_GetClocksFreq>
  4082. if ((USARTx == USART1) || (USARTx == USART6))
  4083. 800a134: 4b19 ldr r3, [pc, #100] ; (800a19c <USART_Init+0xb0>)
  4084. 800a136: 429c cmp r4, r3
  4085. 800a138: d003 beq.n 800a142 <USART_Init+0x56>
  4086. 800a13a: f503 6380 add.w r3, r3, #1024 ; 0x400
  4087. 800a13e: 429c cmp r4, r3
  4088. 800a140: d101 bne.n 800a146 <USART_Init+0x5a>
  4089. {
  4090. apbclock = RCC_ClocksStatus.PCLK2_Frequency;
  4091. 800a142: 9b03 ldr r3, [sp, #12]
  4092. 800a144: e000 b.n 800a148 <USART_Init+0x5c>
  4093. }
  4094. else
  4095. {
  4096. apbclock = RCC_ClocksStatus.PCLK1_Frequency;
  4097. 800a146: 9b02 ldr r3, [sp, #8]
  4098. }
  4099. /* Determine the integer part */
  4100. if ((USARTx->CR1 & USART_CR1_OVER8) != 0)
  4101. 800a148: 89a2 ldrh r2, [r4, #12]
  4102. 800a14a: b212 sxth r2, r2
  4103. 800a14c: 2a00 cmp r2, #0
  4104. 800a14e: f04f 0119 mov.w r1, #25
  4105. 800a152: 682a ldr r2, [r5, #0]
  4106. {
  4107. /* Integer part computing in case Oversampling mode is 8 Samples */
  4108. integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));
  4109. 800a154: fb01 f103 mul.w r1, r1, r3
  4110. {
  4111. apbclock = RCC_ClocksStatus.PCLK1_Frequency;
  4112. }
  4113. /* Determine the integer part */
  4114. if ((USARTx->CR1 & USART_CR1_OVER8) != 0)
  4115. 800a158: da01 bge.n 800a15e <USART_Init+0x72>
  4116. {
  4117. /* Integer part computing in case Oversampling mode is 8 Samples */
  4118. integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));
  4119. 800a15a: 0052 lsls r2, r2, #1
  4120. 800a15c: e000 b.n 800a160 <USART_Init+0x74>
  4121. }
  4122. else /* if ((USARTx->CR1 & USART_CR1_OVER8) == 0) */
  4123. {
  4124. /* Integer part computing in case Oversampling mode is 16 Samples */
  4125. integerdivider = ((25 * apbclock) / (4 * (USART_InitStruct->USART_BaudRate)));
  4126. 800a15e: 0092 lsls r2, r2, #2
  4127. }
  4128. tmpreg = (integerdivider / 100) << 4;
  4129. 800a160: 2364 movs r3, #100 ; 0x64
  4130. integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));
  4131. }
  4132. else /* if ((USARTx->CR1 & USART_CR1_OVER8) == 0) */
  4133. {
  4134. /* Integer part computing in case Oversampling mode is 16 Samples */
  4135. integerdivider = ((25 * apbclock) / (4 * (USART_InitStruct->USART_BaudRate)));
  4136. 800a162: fbb1 f1f2 udiv r1, r1, r2
  4137. }
  4138. tmpreg = (integerdivider / 100) << 4;
  4139. 800a166: fbb1 f2f3 udiv r2, r1, r3
  4140. 800a16a: 0112 lsls r2, r2, #4
  4141. /* Determine the fractional part */
  4142. fractionaldivider = integerdivider - (100 * (tmpreg >> 4));
  4143. 800a16c: 0910 lsrs r0, r2, #4
  4144. 800a16e: fb03 1110 mls r1, r3, r0, r1
  4145. /* Implement the fractional part in the register */
  4146. if ((USARTx->CR1 & USART_CR1_OVER8) != 0)
  4147. 800a172: 89a0 ldrh r0, [r4, #12]
  4148. 800a174: b200 sxth r0, r0
  4149. 800a176: 2800 cmp r0, #0
  4150. 800a178: da06 bge.n 800a188 <USART_Init+0x9c>
  4151. {
  4152. tmpreg |= ((((fractionaldivider * 8) + 50) / 100)) & ((uint8_t)0x07);
  4153. 800a17a: 00c9 lsls r1, r1, #3
  4154. 800a17c: 3132 adds r1, #50 ; 0x32
  4155. 800a17e: fbb1 f3f3 udiv r3, r1, r3
  4156. 800a182: f003 0307 and.w r3, r3, #7
  4157. 800a186: e005 b.n 800a194 <USART_Init+0xa8>
  4158. }
  4159. else /* if ((USARTx->CR1 & USART_CR1_OVER8) == 0) */
  4160. {
  4161. tmpreg |= ((((fractionaldivider * 16) + 50) / 100)) & ((uint8_t)0x0F);
  4162. 800a188: 0109 lsls r1, r1, #4
  4163. 800a18a: 3132 adds r1, #50 ; 0x32
  4164. 800a18c: fbb1 f3f3 udiv r3, r1, r3
  4165. 800a190: f003 030f and.w r3, r3, #15
  4166. 800a194: 431a orrs r2, r3
  4167. }
  4168. /* Write to USART BRR register */
  4169. USARTx->BRR = (uint16_t)tmpreg;
  4170. 800a196: 8122 strh r2, [r4, #8]
  4171. }
  4172. 800a198: b005 add sp, #20
  4173. 800a19a: bd30 pop {r4, r5, pc}
  4174. 800a19c: 40011000 .word 0x40011000
  4175. 0800a1a0 <USART_Cmd>:
  4176. assert_param(IS_FUNCTIONAL_STATE(NewState));
  4177. if (NewState != DISABLE)
  4178. {
  4179. /* Enable the selected USART by setting the UE bit in the CR1 register */
  4180. USARTx->CR1 |= USART_CR1_UE;
  4181. 800a1a0: 8983 ldrh r3, [r0, #12]
  4182. {
  4183. /* Check the parameters */
  4184. assert_param(IS_USART_ALL_PERIPH(USARTx));
  4185. assert_param(IS_FUNCTIONAL_STATE(NewState));
  4186. if (NewState != DISABLE)
  4187. 800a1a2: b119 cbz r1, 800a1ac <USART_Cmd+0xc>
  4188. {
  4189. /* Enable the selected USART by setting the UE bit in the CR1 register */
  4190. USARTx->CR1 |= USART_CR1_UE;
  4191. 800a1a4: b29b uxth r3, r3
  4192. 800a1a6: f443 5300 orr.w r3, r3, #8192 ; 0x2000
  4193. 800a1aa: e003 b.n 800a1b4 <USART_Cmd+0x14>
  4194. }
  4195. else
  4196. {
  4197. /* Disable the selected USART by clearing the UE bit in the CR1 register */
  4198. USARTx->CR1 &= (uint16_t)~((uint16_t)USART_CR1_UE);
  4199. 800a1ac: f423 5300 bic.w r3, r3, #8192 ; 0x2000
  4200. 800a1b0: 041b lsls r3, r3, #16
  4201. 800a1b2: 0c1b lsrs r3, r3, #16
  4202. 800a1b4: 8183 strh r3, [r0, #12]
  4203. 800a1b6: 4770 bx lr
  4204. 0800a1b8 <USART_ITConfig>:
  4205. }
  4206. usartxbase = (uint32_t)USARTx;
  4207. /* Get the USART register index */
  4208. usartreg = (((uint8_t)USART_IT) >> 0x05);
  4209. 800a1b8: f3c1 1342 ubfx r3, r1, #5, #3
  4210. * @param NewState: new state of the specified USARTx interrupts.
  4211. * This parameter can be: ENABLE or DISABLE.
  4212. * @retval None
  4213. */
  4214. void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState)
  4215. {
  4216. 800a1bc: b510 push {r4, lr}
  4217. /* Get the USART register index */
  4218. usartreg = (((uint8_t)USART_IT) >> 0x05);
  4219. /* Get the interrupt position */
  4220. itpos = USART_IT & IT_MASK;
  4221. itmask = (((uint32_t)0x01) << itpos);
  4222. 800a1be: 2401 movs r4, #1
  4223. 800a1c0: f001 011f and.w r1, r1, #31
  4224. if (usartreg == 0x01) /* The IT is in CR1 register */
  4225. 800a1c4: 42a3 cmp r3, r4
  4226. /* Get the USART register index */
  4227. usartreg = (((uint8_t)USART_IT) >> 0x05);
  4228. /* Get the interrupt position */
  4229. itpos = USART_IT & IT_MASK;
  4230. itmask = (((uint32_t)0x01) << itpos);
  4231. 800a1c6: fa04 f101 lsl.w r1, r4, r1
  4232. if (usartreg == 0x01) /* The IT is in CR1 register */
  4233. 800a1ca: d101 bne.n 800a1d0 <USART_ITConfig+0x18>
  4234. {
  4235. usartxbase += 0x0C;
  4236. 800a1cc: 300c adds r0, #12
  4237. 800a1ce: e004 b.n 800a1da <USART_ITConfig+0x22>
  4238. }
  4239. else if (usartreg == 0x02) /* The IT is in CR2 register */
  4240. 800a1d0: 2b02 cmp r3, #2
  4241. 800a1d2: d101 bne.n 800a1d8 <USART_ITConfig+0x20>
  4242. {
  4243. usartxbase += 0x10;
  4244. 800a1d4: 3010 adds r0, #16
  4245. 800a1d6: e000 b.n 800a1da <USART_ITConfig+0x22>
  4246. }
  4247. else /* The IT is in CR3 register */
  4248. {
  4249. usartxbase += 0x14;
  4250. 800a1d8: 3014 adds r0, #20
  4251. }
  4252. if (NewState != DISABLE)
  4253. {
  4254. *(__IO uint32_t*)usartxbase |= itmask;
  4255. 800a1da: 6803 ldr r3, [r0, #0]
  4256. }
  4257. else /* The IT is in CR3 register */
  4258. {
  4259. usartxbase += 0x14;
  4260. }
  4261. if (NewState != DISABLE)
  4262. 800a1dc: b10a cbz r2, 800a1e2 <USART_ITConfig+0x2a>
  4263. {
  4264. *(__IO uint32_t*)usartxbase |= itmask;
  4265. 800a1de: 4319 orrs r1, r3
  4266. 800a1e0: e001 b.n 800a1e6 <USART_ITConfig+0x2e>
  4267. }
  4268. else
  4269. {
  4270. *(__IO uint32_t*)usartxbase &= ~itmask;
  4271. 800a1e2: ea23 0101 bic.w r1, r3, r1
  4272. 800a1e6: 6001 str r1, [r0, #0]
  4273. 800a1e8: bd10 pop {r4, pc}
  4274. 0800a1ea <lwip_htons>:
  4275. * @return n in network byte order
  4276. */
  4277. u16_t
  4278. lwip_htons(u16_t n)
  4279. {
  4280. return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
  4281. 800a1ea: 0a03 lsrs r3, r0, #8
  4282. 800a1ec: ea43 2000 orr.w r0, r3, r0, lsl #8
  4283. }
  4284. 800a1f0: b280 uxth r0, r0
  4285. 800a1f2: 4770 bx lr
  4286. 0800a1f4 <lwip_ntohs>:
  4287. * @return n in network byte order
  4288. */
  4289. u16_t
  4290. lwip_htons(u16_t n)
  4291. {
  4292. return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
  4293. 800a1f4: 0a03 lsrs r3, r0, #8
  4294. 800a1f6: ea43 2000 orr.w r0, r3, r0, lsl #8
  4295. */
  4296. u16_t
  4297. lwip_ntohs(u16_t n)
  4298. {
  4299. return lwip_htons(n);
  4300. }
  4301. 800a1fa: b280 uxth r0, r0
  4302. 800a1fc: 4770 bx lr
  4303. 0800a1fe <lwip_htonl>:
  4304. {
  4305. return ((n & 0xff) << 24) |
  4306. ((n & 0xff00) << 8) |
  4307. ((n & 0xff0000UL) >> 8) |
  4308. ((n & 0xff000000UL) >> 24);
  4309. }
  4310. 800a1fe: ba00 rev r0, r0
  4311. 800a200: 4770 bx lr
  4312. 0800a202 <lwip_ntohl>:
  4313. * @return n in host byte order
  4314. */
  4315. u32_t
  4316. lwip_ntohl(u32_t n)
  4317. {
  4318. return lwip_htonl(n);
  4319. 800a202: f7ff bffc b.w 800a1fe <lwip_htonl>
  4320. 0800a206 <dhcp_set_state>:
  4321. * If the state changed, reset the number of tries.
  4322. */
  4323. static void
  4324. dhcp_set_state(struct dhcp *dhcp, u8_t new_state)
  4325. {
  4326. if (new_state != dhcp->state) {
  4327. 800a206: 7b03 ldrb r3, [r0, #12]
  4328. 800a208: 428b cmp r3, r1
  4329. 800a20a: d003 beq.n 800a214 <dhcp_set_state+0xe>
  4330. dhcp->state = new_state;
  4331. dhcp->tries = 0;
  4332. 800a20c: 2300 movs r3, #0
  4333. */
  4334. static void
  4335. dhcp_set_state(struct dhcp *dhcp, u8_t new_state)
  4336. {
  4337. if (new_state != dhcp->state) {
  4338. dhcp->state = new_state;
  4339. 800a20e: 7301 strb r1, [r0, #12]
  4340. dhcp->tries = 0;
  4341. 800a210: 7343 strb r3, [r0, #13]
  4342. dhcp->request_timeout = 0;
  4343. 800a212: 8343 strh r3, [r0, #26]
  4344. 800a214: 4770 bx lr
  4345. 0800a216 <dhcp_option>:
  4346. */
  4347. static void
  4348. dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
  4349. {
  4350. LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
  4351. dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
  4352. 800a216: 8b03 ldrh r3, [r0, #24]
  4353. * DHCP message.
  4354. *
  4355. */
  4356. static void
  4357. dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
  4358. {
  4359. 800a218: b510 push {r4, lr}
  4360. LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
  4361. dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
  4362. 800a21a: 6944 ldr r4, [r0, #20]
  4363. 800a21c: 18e4 adds r4, r4, r3
  4364. 800a21e: f884 10f0 strb.w r1, [r4, #240] ; 0xf0
  4365. dhcp->msg_out->options[dhcp->options_out_len++] = option_len;
  4366. 800a222: 6941 ldr r1, [r0, #20]
  4367. */
  4368. static void
  4369. dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
  4370. {
  4371. LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
  4372. dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
  4373. 800a224: 1c5c adds r4, r3, #1
  4374. dhcp->msg_out->options[dhcp->options_out_len++] = option_len;
  4375. 800a226: fa11 f184 uxtah r1, r1, r4
  4376. 800a22a: 3302 adds r3, #2
  4377. 800a22c: f881 20f0 strb.w r2, [r1, #240] ; 0xf0
  4378. 800a230: 8303 strh r3, [r0, #24]
  4379. 800a232: bd10 pop {r4, pc}
  4380. 0800a234 <dhcp_option_byte>:
  4381. */
  4382. static void
  4383. dhcp_option_byte(struct dhcp *dhcp, u8_t value)
  4384. {
  4385. LWIP_ASSERT("dhcp_option_byte: dhcp->options_out_len < DHCP_OPTIONS_LEN", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  4386. dhcp->msg_out->options[dhcp->options_out_len++] = value;
  4387. 800a234: 8b03 ldrh r3, [r0, #24]
  4388. 800a236: 6942 ldr r2, [r0, #20]
  4389. 800a238: 18d2 adds r2, r2, r3
  4390. 800a23a: 3301 adds r3, #1
  4391. 800a23c: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
  4392. 800a240: 8303 strh r3, [r0, #24]
  4393. 800a242: 4770 bx lr
  4394. 0800a244 <dhcp_option_short>:
  4395. static void
  4396. dhcp_option_short(struct dhcp *dhcp, u16_t value)
  4397. {
  4398. LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
  4399. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
  4400. 800a244: 8b03 ldrh r3, [r0, #24]
  4401. 800a246: 6942 ldr r2, [r0, #20]
  4402. 800a248: 18d2 adds r2, r2, r3
  4403. dhcp->msg_out->options[dhcp->options_out_len++] = value;
  4404. }
  4405. static void
  4406. dhcp_option_short(struct dhcp *dhcp, u16_t value)
  4407. {
  4408. 800a24a: b510 push {r4, lr}
  4409. LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
  4410. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
  4411. 800a24c: 0a0c lsrs r4, r1, #8
  4412. 800a24e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
  4413. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
  4414. 800a252: 6942 ldr r2, [r0, #20]
  4415. static void
  4416. dhcp_option_short(struct dhcp *dhcp, u16_t value)
  4417. {
  4418. LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
  4419. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
  4420. 800a254: 1c5c adds r4, r3, #1
  4421. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
  4422. 800a256: fa12 f284 uxtah r2, r2, r4
  4423. 800a25a: 3302 adds r3, #2
  4424. 800a25c: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
  4425. 800a260: 8303 strh r3, [r0, #24]
  4426. 800a262: bd10 pop {r4, pc}
  4427. 0800a264 <dhcp_option_long>:
  4428. static void
  4429. dhcp_option_long(struct dhcp *dhcp, u32_t value)
  4430. {
  4431. LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
  4432. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
  4433. 800a264: 8b03 ldrh r3, [r0, #24]
  4434. 800a266: 6942 ldr r2, [r0, #20]
  4435. 800a268: 18d2 adds r2, r2, r3
  4436. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
  4437. }
  4438. static void
  4439. dhcp_option_long(struct dhcp *dhcp, u32_t value)
  4440. {
  4441. 800a26a: b510 push {r4, lr}
  4442. LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
  4443. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
  4444. 800a26c: 0e0c lsrs r4, r1, #24
  4445. 800a26e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
  4446. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
  4447. 800a272: 6942 ldr r2, [r0, #20]
  4448. static void
  4449. dhcp_option_long(struct dhcp *dhcp, u32_t value)
  4450. {
  4451. LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
  4452. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
  4453. 800a274: 1c5c adds r4, r3, #1
  4454. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
  4455. 800a276: fa12 f284 uxtah r2, r2, r4
  4456. 800a27a: f3c1 4407 ubfx r4, r1, #16, #8
  4457. 800a27e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
  4458. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
  4459. 800a282: 6942 ldr r2, [r0, #20]
  4460. static void
  4461. dhcp_option_long(struct dhcp *dhcp, u32_t value)
  4462. {
  4463. LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
  4464. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
  4465. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
  4466. 800a284: 1c9c adds r4, r3, #2
  4467. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
  4468. 800a286: fa12 f284 uxtah r2, r2, r4
  4469. 800a28a: f3c1 2407 ubfx r4, r1, #8, #8
  4470. 800a28e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
  4471. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x000000ffUL));
  4472. 800a292: 6942 ldr r2, [r0, #20]
  4473. dhcp_option_long(struct dhcp *dhcp, u32_t value)
  4474. {
  4475. LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
  4476. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
  4477. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
  4478. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
  4479. 800a294: 1cdc adds r4, r3, #3
  4480. dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x000000ffUL));
  4481. 800a296: fa12 f284 uxtah r2, r2, r4
  4482. 800a29a: 3304 adds r3, #4
  4483. 800a29c: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
  4484. 800a2a0: 8303 strh r3, [r0, #24]
  4485. 800a2a2: bd10 pop {r4, pc}
  4486. 0800a2a4 <dhcp_option_trailer>:
  4487. * @param dhcp DHCP state structure
  4488. */
  4489. static void
  4490. dhcp_option_trailer(struct dhcp *dhcp)
  4491. {
  4492. LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
  4493. 800a2a4: b190 cbz r0, 800a2cc <dhcp_option_trailer+0x28>
  4494. LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
  4495. LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  4496. dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
  4497. 800a2a6: 8b03 ldrh r3, [r0, #24]
  4498. 800a2a8: 6942 ldr r2, [r0, #20]
  4499. 800a2aa: 18d2 adds r2, r2, r3
  4500. 800a2ac: 21ff movs r1, #255 ; 0xff
  4501. 800a2ae: 3301 adds r3, #1
  4502. 800a2b0: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
  4503. 800a2b4: 8303 strh r3, [r0, #24]
  4504. /* packet is too small, or not 4 byte aligned? */
  4505. while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) &&
  4506. (dhcp->options_out_len < DHCP_OPTIONS_LEN)) {
  4507. /* add a fill/padding byte */
  4508. dhcp->msg_out->options[dhcp->options_out_len++] = 0;
  4509. 800a2b6: 2100 movs r1, #0
  4510. LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
  4511. LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
  4512. LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  4513. dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
  4514. /* packet is too small, or not 4 byte aligned? */
  4515. while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) &&
  4516. 800a2b8: e005 b.n 800a2c6 <dhcp_option_trailer+0x22>
  4517. (dhcp->options_out_len < DHCP_OPTIONS_LEN)) {
  4518. /* add a fill/padding byte */
  4519. dhcp->msg_out->options[dhcp->options_out_len++] = 0;
  4520. 800a2ba: 6942 ldr r2, [r0, #20]
  4521. 800a2bc: 18d2 adds r2, r2, r3
  4522. 800a2be: 3301 adds r3, #1
  4523. 800a2c0: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
  4524. 800a2c4: 8303 strh r3, [r0, #24]
  4525. LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
  4526. LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
  4527. LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
  4528. dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
  4529. /* packet is too small, or not 4 byte aligned? */
  4530. while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) &&
  4531. 800a2c6: 8b03 ldrh r3, [r0, #24]
  4532. 800a2c8: 2b43 cmp r3, #67 ; 0x43
  4533. 800a2ca: d9f6 bls.n 800a2ba <dhcp_option_trailer+0x16>
  4534. 800a2cc: 4770 bx lr
  4535. 800a2ce: 0000 movs r0, r0
  4536. 0800a2d0 <dhcp_create_msg>:
  4537. * @param dhcp dhcp control struct
  4538. * @param message_type message type of the request
  4539. */
  4540. static err_t
  4541. dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
  4542. {
  4543. 800a2d0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  4544. 800a2d4: 460c mov r4, r1
  4545. 800a2d6: 4617 mov r7, r2
  4546. if (!xid_initialised) {
  4547. xid = DHCP_GLOBAL_XID;
  4548. xid_initialised = !xid_initialised;
  4549. }
  4550. #endif
  4551. LWIP_ERROR("dhcp_create_msg: netif != NULL", (netif != NULL), return ERR_ARG;);
  4552. 800a2d8: 4606 mov r6, r0
  4553. 800a2da: 2800 cmp r0, #0
  4554. 800a2dc: f000 808e beq.w 800a3fc <dhcp_create_msg+0x12c>
  4555. LWIP_ERROR("dhcp_create_msg: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
  4556. 800a2e0: 2900 cmp r1, #0
  4557. 800a2e2: f000 808d beq.w 800a400 <dhcp_create_msg+0x130>
  4558. LWIP_ASSERT("dhcp_create_msg: dhcp->p_out == NULL", dhcp->p_out == NULL);
  4559. LWIP_ASSERT("dhcp_create_msg: dhcp->msg_out == NULL", dhcp->msg_out == NULL);
  4560. dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM);
  4561. 800a2e6: 2000 movs r0, #0
  4562. 800a2e8: f44f 719a mov.w r1, #308 ; 0x134
  4563. 800a2ec: 4602 mov r2, r0
  4564. 800a2ee: f001 f93a bl 800b566 <pbuf_alloc>
  4565. 800a2f2: 6120 str r0, [r4, #16]
  4566. if (dhcp->p_out == NULL) {
  4567. 800a2f4: 2800 cmp r0, #0
  4568. 800a2f6: f000 8085 beq.w 800a404 <dhcp_create_msg+0x134>
  4569. }
  4570. LWIP_ASSERT("dhcp_create_msg: check that first pbuf can hold struct dhcp_msg",
  4571. (dhcp->p_out->len >= sizeof(struct dhcp_msg)));
  4572. /* reuse transaction identifier in retransmissions */
  4573. if (dhcp->tries == 0) {
  4574. 800a2fa: 7b62 ldrb r2, [r4, #13]
  4575. 800a2fc: 4b43 ldr r3, [pc, #268] ; (800a40c <dhcp_create_msg+0x13c>)
  4576. 800a2fe: b912 cbnz r2, 800a306 <dhcp_create_msg+0x36>
  4577. #if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)
  4578. xid = LWIP_RAND();
  4579. #else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
  4580. xid++;
  4581. 800a300: 681a ldr r2, [r3, #0]
  4582. 800a302: 3201 adds r2, #1
  4583. 800a304: 601a str r2, [r3, #0]
  4584. #endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
  4585. }
  4586. dhcp->xid = xid;
  4587. 800a306: 681b ldr r3, [r3, #0]
  4588. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
  4589. ("transaction id xid(%"X32_F")\n", xid));
  4590. dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
  4591. 800a308: 6842 ldr r2, [r0, #4]
  4592. xid = LWIP_RAND();
  4593. #else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
  4594. xid++;
  4595. #endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
  4596. }
  4597. dhcp->xid = xid;
  4598. 800a30a: 6023 str r3, [r4, #0]
  4599. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
  4600. ("transaction id xid(%"X32_F")\n", xid));
  4601. dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
  4602. dhcp->msg_out->op = DHCP_BOOTREQUEST;
  4603. 800a30c: 2301 movs r3, #1
  4604. }
  4605. dhcp->xid = xid;
  4606. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
  4607. ("transaction id xid(%"X32_F")\n", xid));
  4608. dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
  4609. 800a30e: 6162 str r2, [r4, #20]
  4610. dhcp->msg_out->op = DHCP_BOOTREQUEST;
  4611. 800a310: 7013 strb r3, [r2, #0]
  4612. /* TODO: make link layer independent */
  4613. dhcp->msg_out->htype = DHCP_HTYPE_ETH;
  4614. 800a312: 6962 ldr r2, [r4, #20]
  4615. 800a314: 7053 strb r3, [r2, #1]
  4616. dhcp->msg_out->hlen = netif->hwaddr_len;
  4617. 800a316: 6963 ldr r3, [r4, #20]
  4618. 800a318: f896 2026 ldrb.w r2, [r6, #38] ; 0x26
  4619. 800a31c: 709a strb r2, [r3, #2]
  4620. dhcp->msg_out->hops = 0;
  4621. 800a31e: 6963 ldr r3, [r4, #20]
  4622. 800a320: 2500 movs r5, #0
  4623. 800a322: 70dd strb r5, [r3, #3]
  4624. dhcp->msg_out->xid = htonl(dhcp->xid);
  4625. 800a324: 6820 ldr r0, [r4, #0]
  4626. 800a326: f8d4 8014 ldr.w r8, [r4, #20]
  4627. 800a32a: f7ff ff68 bl 800a1fe <lwip_htonl>
  4628. 800a32e: f8c8 0004 str.w r0, [r8, #4]
  4629. dhcp->msg_out->secs = 0;
  4630. 800a332: 6963 ldr r3, [r4, #20]
  4631. /* we don't need the broadcast flag since we can receive unicast traffic
  4632. before being fully configured! */
  4633. dhcp->msg_out->flags = 0;
  4634. ip_addr_set_zero(&dhcp->msg_out->ciaddr);
  4635. /* set ciaddr to netif->ip_addr based on message_type and state */
  4636. if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) ||
  4637. 800a334: 2f08 cmp r7, #8
  4638. /* TODO: make link layer independent */
  4639. dhcp->msg_out->htype = DHCP_HTYPE_ETH;
  4640. dhcp->msg_out->hlen = netif->hwaddr_len;
  4641. dhcp->msg_out->hops = 0;
  4642. dhcp->msg_out->xid = htonl(dhcp->xid);
  4643. dhcp->msg_out->secs = 0;
  4644. 800a336: 721d strb r5, [r3, #8]
  4645. 800a338: 725d strb r5, [r3, #9]
  4646. /* we don't need the broadcast flag since we can receive unicast traffic
  4647. before being fully configured! */
  4648. dhcp->msg_out->flags = 0;
  4649. 800a33a: 729d strb r5, [r3, #10]
  4650. 800a33c: 72dd strb r5, [r3, #11]
  4651. ip_addr_set_zero(&dhcp->msg_out->ciaddr);
  4652. 800a33e: 731d strb r5, [r3, #12]
  4653. 800a340: 735d strb r5, [r3, #13]
  4654. 800a342: 739d strb r5, [r3, #14]
  4655. 800a344: 73dd strb r5, [r3, #15]
  4656. /* set ciaddr to netif->ip_addr based on message_type and state */
  4657. if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) ||
  4658. 800a346: d007 beq.n 800a358 <dhcp_create_msg+0x88>
  4659. 800a348: 2f04 cmp r7, #4
  4660. 800a34a: d005 beq.n 800a358 <dhcp_create_msg+0x88>
  4661. 800a34c: 2f03 cmp r7, #3
  4662. 800a34e: d105 bne.n 800a35c <dhcp_create_msg+0x8c>
  4663. ((message_type == DHCP_REQUEST) && /* DHCP_BOUND not used for sending! */
  4664. ((dhcp->state==DHCP_RENEWING) || dhcp->state==DHCP_REBINDING))) {
  4665. 800a350: 7b22 ldrb r2, [r4, #12]
  4666. before being fully configured! */
  4667. dhcp->msg_out->flags = 0;
  4668. ip_addr_set_zero(&dhcp->msg_out->ciaddr);
  4669. /* set ciaddr to netif->ip_addr based on message_type and state */
  4670. if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) ||
  4671. ((message_type == DHCP_REQUEST) && /* DHCP_BOUND not used for sending! */
  4672. 800a352: 3a04 subs r2, #4
  4673. 800a354: 2a01 cmp r2, #1
  4674. 800a356: d801 bhi.n 800a35c <dhcp_create_msg+0x8c>
  4675. ((dhcp->state==DHCP_RENEWING) || dhcp->state==DHCP_REBINDING))) {
  4676. ip_addr_copy(dhcp->msg_out->ciaddr, netif->ip_addr);
  4677. 800a358: 6872 ldr r2, [r6, #4]
  4678. 800a35a: 60da str r2, [r3, #12]
  4679. }
  4680. ip_addr_set_zero(&dhcp->msg_out->yiaddr);
  4681. 800a35c: 2500 movs r5, #0
  4682. 800a35e: 741d strb r5, [r3, #16]
  4683. 800a360: 745d strb r5, [r3, #17]
  4684. 800a362: 749d strb r5, [r3, #18]
  4685. 800a364: 74dd strb r5, [r3, #19]
  4686. ip_addr_set_zero(&dhcp->msg_out->siaddr);
  4687. 800a366: 751d strb r5, [r3, #20]
  4688. 800a368: 755d strb r5, [r3, #21]
  4689. 800a36a: 759d strb r5, [r3, #22]
  4690. 800a36c: 75dd strb r5, [r3, #23]
  4691. ip_addr_set_zero(&dhcp->msg_out->giaddr);
  4692. 800a36e: 761d strb r5, [r3, #24]
  4693. 800a370: 765d strb r5, [r3, #25]
  4694. 800a372: 769d strb r5, [r3, #26]
  4695. 800a374: 76dd strb r5, [r3, #27]
  4696. for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  4697. /* copy netif hardware address, pad with zeroes */
  4698. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4699. 800a376: f896 1026 ldrb.w r1, [r6, #38] ; 0x26
  4700. 800a37a: 6962 ldr r2, [r4, #20]
  4701. 800a37c: b2ab uxth r3, r5
  4702. 800a37e: 4299 cmp r1, r3
  4703. * @param netif the netif under DHCP control
  4704. * @param dhcp dhcp control struct
  4705. * @param message_type message type of the request
  4706. */
  4707. static err_t
  4708. dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
  4709. 800a380: bf88 it hi
  4710. 800a382: 1973 addhi r3, r6, r5
  4711. ip_addr_set_zero(&dhcp->msg_out->yiaddr);
  4712. ip_addr_set_zero(&dhcp->msg_out->siaddr);
  4713. ip_addr_set_zero(&dhcp->msg_out->giaddr);
  4714. for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  4715. /* copy netif hardware address, pad with zeroes */
  4716. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4717. 800a384: 442a add r2, r5
  4718. 800a386: bf8c ite hi
  4719. 800a388: f893 3027 ldrbhi.w r3, [r3, #39] ; 0x27
  4720. 800a38c: 2300 movls r3, #0
  4721. 800a38e: 3501 adds r5, #1
  4722. ip_addr_copy(dhcp->msg_out->ciaddr, netif->ip_addr);
  4723. }
  4724. ip_addr_set_zero(&dhcp->msg_out->yiaddr);
  4725. ip_addr_set_zero(&dhcp->msg_out->siaddr);
  4726. ip_addr_set_zero(&dhcp->msg_out->giaddr);
  4727. for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  4728. 800a390: 2d10 cmp r5, #16
  4729. /* copy netif hardware address, pad with zeroes */
  4730. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4731. 800a392: 7713 strb r3, [r2, #28]
  4732. ip_addr_copy(dhcp->msg_out->ciaddr, netif->ip_addr);
  4733. }
  4734. ip_addr_set_zero(&dhcp->msg_out->yiaddr);
  4735. ip_addr_set_zero(&dhcp->msg_out->siaddr);
  4736. ip_addr_set_zero(&dhcp->msg_out->giaddr);
  4737. for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  4738. 800a394: d1ef bne.n 800a376 <dhcp_create_msg+0xa6>
  4739. 800a396: 2300 movs r3, #0
  4740. /* copy netif hardware address, pad with zeroes */
  4741. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4742. }
  4743. for (i = 0; i < DHCP_SNAME_LEN; i++) {
  4744. dhcp->msg_out->sname[i] = 0;
  4745. 800a398: 4619 mov r1, r3
  4746. 800a39a: 6962 ldr r2, [r4, #20]
  4747. 800a39c: 18d2 adds r2, r2, r3
  4748. 800a39e: 3301 adds r3, #1
  4749. ip_addr_set_zero(&dhcp->msg_out->giaddr);
  4750. for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  4751. /* copy netif hardware address, pad with zeroes */
  4752. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4753. }
  4754. for (i = 0; i < DHCP_SNAME_LEN; i++) {
  4755. 800a3a0: 2b40 cmp r3, #64 ; 0x40
  4756. dhcp->msg_out->sname[i] = 0;
  4757. 800a3a2: f882 102c strb.w r1, [r2, #44] ; 0x2c
  4758. ip_addr_set_zero(&dhcp->msg_out->giaddr);
  4759. for (i = 0; i < DHCP_CHADDR_LEN; i++) {
  4760. /* copy netif hardware address, pad with zeroes */
  4761. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4762. }
  4763. for (i = 0; i < DHCP_SNAME_LEN; i++) {
  4764. 800a3a6: d1f8 bne.n 800a39a <dhcp_create_msg+0xca>
  4765. 800a3a8: 2200 movs r2, #0
  4766. dhcp->msg_out->sname[i] = 0;
  4767. }
  4768. for (i = 0; i < DHCP_FILE_LEN; i++) {
  4769. dhcp->msg_out->file[i] = 0;
  4770. 800a3aa: 4610 mov r0, r2
  4771. 800a3ac: 6963 ldr r3, [r4, #20]
  4772. 800a3ae: 1899 adds r1, r3, r2
  4773. 800a3b0: 3201 adds r2, #1
  4774. 800a3b2: 2300 movs r3, #0
  4775. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4776. }
  4777. for (i = 0; i < DHCP_SNAME_LEN; i++) {
  4778. dhcp->msg_out->sname[i] = 0;
  4779. }
  4780. for (i = 0; i < DHCP_FILE_LEN; i++) {
  4781. 800a3b4: 2a80 cmp r2, #128 ; 0x80
  4782. dhcp->msg_out->file[i] = 0;
  4783. 800a3b6: f881 006c strb.w r0, [r1, #108] ; 0x6c
  4784. dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
  4785. }
  4786. for (i = 0; i < DHCP_SNAME_LEN; i++) {
  4787. dhcp->msg_out->sname[i] = 0;
  4788. }
  4789. for (i = 0; i < DHCP_FILE_LEN; i++) {
  4790. 800a3ba: d1f7 bne.n 800a3ac <dhcp_create_msg+0xdc>
  4791. dhcp->msg_out->file[i] = 0;
  4792. }
  4793. dhcp->msg_out->cookie = PP_HTONL(DHCP_MAGIC_COOKIE);
  4794. 800a3bc: 6962 ldr r2, [r4, #20]
  4795. 800a3be: f06f 007d mvn.w r0, #125 ; 0x7d
  4796. 800a3c2: 2163 movs r1, #99 ; 0x63
  4797. 800a3c4: f882 00ed strb.w r0, [r2, #237] ; 0xed
  4798. 800a3c8: 2053 movs r0, #83 ; 0x53
  4799. 800a3ca: f882 10ec strb.w r1, [r2, #236] ; 0xec
  4800. 800a3ce: f882 00ee strb.w r0, [r2, #238] ; 0xee
  4801. 800a3d2: f882 10ef strb.w r1, [r2, #239] ; 0xef
  4802. dhcp->options_out_len = 0;
  4803. 800a3d6: 8323 strh r3, [r4, #24]
  4804. /* fill options field with an incrementing array (for debugging purposes) */
  4805. for (i = 0; i < DHCP_OPTIONS_LEN; i++) {
  4806. dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */
  4807. 800a3d8: 6962 ldr r2, [r4, #20]
  4808. 800a3da: 18d2 adds r2, r2, r3
  4809. 800a3dc: f882 30f0 strb.w r3, [r2, #240] ; 0xf0
  4810. 800a3e0: 3301 adds r3, #1
  4811. dhcp->msg_out->file[i] = 0;
  4812. }
  4813. dhcp->msg_out->cookie = PP_HTONL(DHCP_MAGIC_COOKIE);
  4814. dhcp->options_out_len = 0;
  4815. /* fill options field with an incrementing array (for debugging purposes) */
  4816. for (i = 0; i < DHCP_OPTIONS_LEN; i++) {
  4817. 800a3e2: 2b44 cmp r3, #68 ; 0x44
  4818. 800a3e4: d1f8 bne.n 800a3d8 <dhcp_create_msg+0x108>
  4819. dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */
  4820. }
  4821. /* Add option MESSAGE_TYPE */
  4822. dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  4823. 800a3e6: 4620 mov r0, r4
  4824. 800a3e8: 2135 movs r1, #53 ; 0x35
  4825. 800a3ea: 2201 movs r2, #1
  4826. 800a3ec: f7ff ff13 bl 800a216 <dhcp_option>
  4827. dhcp_option_byte(dhcp, message_type);
  4828. 800a3f0: 4620 mov r0, r4
  4829. 800a3f2: 4639 mov r1, r7
  4830. 800a3f4: f7ff ff1e bl 800a234 <dhcp_option_byte>
  4831. return ERR_OK;
  4832. 800a3f8: 2000 movs r0, #0
  4833. 800a3fa: e004 b.n 800a406 <dhcp_create_msg+0x136>
  4834. if (!xid_initialised) {
  4835. xid = DHCP_GLOBAL_XID;
  4836. xid_initialised = !xid_initialised;
  4837. }
  4838. #endif
  4839. LWIP_ERROR("dhcp_create_msg: netif != NULL", (netif != NULL), return ERR_ARG;);
  4840. 800a3fc: 20f2 movs r0, #242 ; 0xf2
  4841. 800a3fe: e002 b.n 800a406 <dhcp_create_msg+0x136>
  4842. LWIP_ERROR("dhcp_create_msg: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
  4843. 800a400: 20fa movs r0, #250 ; 0xfa
  4844. 800a402: e000 b.n 800a406 <dhcp_create_msg+0x136>
  4845. LWIP_ASSERT("dhcp_create_msg: dhcp->msg_out == NULL", dhcp->msg_out == NULL);
  4846. dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM);
  4847. if (dhcp->p_out == NULL) {
  4848. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
  4849. ("dhcp_create_msg(): could not allocate pbuf\n"));
  4850. return ERR_MEM;
  4851. 800a404: 20ff movs r0, #255 ; 0xff
  4852. }
  4853. /* Add option MESSAGE_TYPE */
  4854. dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
  4855. dhcp_option_byte(dhcp, message_type);
  4856. return ERR_OK;
  4857. }
  4858. 800a406: b240 sxtb r0, r0
  4859. 800a408: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  4860. 800a40c: 20000108 .word 0x20000108
  4861. 0800a410 <dhcp_delete_msg>:
  4862. *
  4863. * @param dhcp the dhcp struct to free the request from
  4864. */
  4865. static void
  4866. dhcp_delete_msg(struct dhcp *dhcp)
  4867. {
  4868. 800a410: b510 push {r4, lr}
  4869. LWIP_ERROR("dhcp_delete_msg: dhcp != NULL", (dhcp != NULL), return;);
  4870. 800a412: 4604 mov r4, r0
  4871. 800a414: b130 cbz r0, 800a424 <dhcp_delete_msg+0x14>
  4872. LWIP_ASSERT("dhcp_delete_msg: dhcp->p_out != NULL", dhcp->p_out != NULL);
  4873. LWIP_ASSERT("dhcp_delete_msg: dhcp->msg_out != NULL", dhcp->msg_out != NULL);
  4874. if (dhcp->p_out != NULL) {
  4875. 800a416: 6900 ldr r0, [r0, #16]
  4876. 800a418: b108 cbz r0, 800a41e <dhcp_delete_msg+0xe>
  4877. pbuf_free(dhcp->p_out);
  4878. 800a41a: f001 f853 bl 800b4c4 <pbuf_free>
  4879. }
  4880. dhcp->p_out = NULL;
  4881. 800a41e: 2300 movs r3, #0
  4882. 800a420: 6123 str r3, [r4, #16]
  4883. dhcp->msg_out = NULL;
  4884. 800a422: 6163 str r3, [r4, #20]
  4885. 800a424: bd10 pop {r4, pc}
  4886. 800a426: 0000 movs r0, r0
  4887. 0800a428 <dhcp_discover>:
  4888. *
  4889. * @param netif the netif under DHCP control
  4890. */
  4891. static err_t
  4892. dhcp_discover(struct netif *netif)
  4893. {
  4894. 800a428: b573 push {r0, r1, r4, r5, r6, lr}
  4895. struct dhcp *dhcp = netif->dhcp;
  4896. 800a42a: 6a04 ldr r4, [r0, #32]
  4897. err_t result = ERR_OK;
  4898. u16_t msecs;
  4899. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover()\n"));
  4900. ip_addr_set_any(&dhcp->offered_ip_addr);
  4901. 800a42c: 2300 movs r3, #0
  4902. *
  4903. * @param netif the netif under DHCP control
  4904. */
  4905. static err_t
  4906. dhcp_discover(struct netif *netif)
  4907. {
  4908. 800a42e: 4605 mov r5, r0
  4909. struct dhcp *dhcp = netif->dhcp;
  4910. err_t result = ERR_OK;
  4911. u16_t msecs;
  4912. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover()\n"));
  4913. ip_addr_set_any(&dhcp->offered_ip_addr);
  4914. 800a430: 6263 str r3, [r4, #36] ; 0x24
  4915. dhcp_set_state(dhcp, DHCP_SELECTING);
  4916. 800a432: 4620 mov r0, r4
  4917. 800a434: 2106 movs r1, #6
  4918. 800a436: f7ff fee6 bl 800a206 <dhcp_set_state>
  4919. /* create and initialize the DHCP message header */
  4920. result = dhcp_create_msg(netif, dhcp, DHCP_DISCOVER);
  4921. 800a43a: 4628 mov r0, r5
  4922. 800a43c: 4621 mov r1, r4
  4923. 800a43e: 2201 movs r2, #1
  4924. 800a440: f7ff ff46 bl 800a2d0 <dhcp_create_msg>
  4925. if (result == ERR_OK) {
  4926. 800a444: 4606 mov r6, r0
  4927. 800a446: 2800 cmp r0, #0
  4928. 800a448: d130 bne.n 800a4ac <dhcp_discover+0x84>
  4929. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: making request\n"));
  4930. dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  4931. 800a44a: 2202 movs r2, #2
  4932. 800a44c: 4620 mov r0, r4
  4933. 800a44e: 2139 movs r1, #57 ; 0x39
  4934. 800a450: f7ff fee1 bl 800a216 <dhcp_option>
  4935. dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
  4936. 800a454: 4620 mov r0, r4
  4937. 800a456: 8ca9 ldrh r1, [r5, #36] ; 0x24
  4938. 800a458: f7ff fef4 bl 800a244 <dhcp_option_short>
  4939. dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
  4940. 800a45c: 2204 movs r2, #4
  4941. 800a45e: 4620 mov r0, r4
  4942. 800a460: 2137 movs r1, #55 ; 0x37
  4943. 800a462: f7ff fed8 bl 800a216 <dhcp_option>
  4944. dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);
  4945. 800a466: 4620 mov r0, r4
  4946. 800a468: 2101 movs r1, #1
  4947. 800a46a: f7ff fee3 bl 800a234 <dhcp_option_byte>
  4948. dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);
  4949. 800a46e: 4620 mov r0, r4
  4950. 800a470: 2103 movs r1, #3
  4951. 800a472: f7ff fedf bl 800a234 <dhcp_option_byte>
  4952. dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
  4953. 800a476: 4620 mov r0, r4
  4954. 800a478: 211c movs r1, #28
  4955. 800a47a: f7ff fedb bl 800a234 <dhcp_option_byte>
  4956. dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
  4957. 800a47e: 2106 movs r1, #6
  4958. 800a480: 4620 mov r0, r4
  4959. 800a482: f7ff fed7 bl 800a234 <dhcp_option_byte>
  4960. dhcp_option_trailer(dhcp);
  4961. 800a486: 4620 mov r0, r4
  4962. 800a488: f7ff ff0c bl 800a2a4 <dhcp_option_trailer>
  4963. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: realloc()ing\n"));
  4964. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  4965. 800a48c: 8b21 ldrh r1, [r4, #24]
  4966. 800a48e: 6920 ldr r0, [r4, #16]
  4967. 800a490: 31f0 adds r1, #240 ; 0xf0
  4968. 800a492: b289 uxth r1, r1
  4969. 800a494: f001 f841 bl 800b51a <pbuf_realloc>
  4970. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)\n"));
  4971. udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  4972. 800a498: 9500 str r5, [sp, #0]
  4973. 800a49a: 6860 ldr r0, [r4, #4]
  4974. 800a49c: 6921 ldr r1, [r4, #16]
  4975. 800a49e: 4a0f ldr r2, [pc, #60] ; (800a4dc <dhcp_discover+0xb4>)
  4976. 800a4a0: 2343 movs r3, #67 ; 0x43
  4977. 800a4a2: f003 fd51 bl 800df48 <udp_sendto_if>
  4978. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: deleting()ing\n"));
  4979. dhcp_delete_msg(dhcp);
  4980. 800a4a6: 4620 mov r0, r4
  4981. 800a4a8: f7ff ffb2 bl 800a410 <dhcp_delete_msg>
  4982. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n"));
  4983. } else {
  4984. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_discover: could not allocate DHCP request\n"));
  4985. }
  4986. dhcp->tries++;
  4987. 800a4ac: 7b63 ldrb r3, [r4, #13]
  4988. 800a4ae: 3301 adds r3, #1
  4989. 800a4b0: b2db uxtb r3, r3
  4990. if(dhcp->tries >= LWIP_DHCP_AUTOIP_COOP_TRIES && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) {
  4991. dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON;
  4992. autoip_start(netif);
  4993. }
  4994. #endif /* LWIP_DHCP_AUTOIP_COOP */
  4995. msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
  4996. 800a4b2: 2b05 cmp r3, #5
  4997. 800a4b4: bf98 it ls
  4998. 800a4b6: f44f 727a movls.w r2, #1000 ; 0x3e8
  4999. dhcp_delete_msg(dhcp);
  5000. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n"));
  5001. } else {
  5002. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_discover: could not allocate DHCP request\n"));
  5003. }
  5004. dhcp->tries++;
  5005. 800a4ba: 7363 strb r3, [r4, #13]
  5006. if(dhcp->tries >= LWIP_DHCP_AUTOIP_COOP_TRIES && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) {
  5007. dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON;
  5008. autoip_start(netif);
  5009. }
  5010. #endif /* LWIP_DHCP_AUTOIP_COOP */
  5011. msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
  5012. 800a4bc: bf9a itte ls
  5013. 800a4be: fa02 f303 lslls.w r3, r2, r3
  5014. 800a4c2: b29b uxthls r3, r3
  5015. 800a4c4: f64e 2360 movwhi r3, #60000 ; 0xea60
  5016. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  5017. 800a4c8: f44f 72fa mov.w r2, #500 ; 0x1f4
  5018. 800a4cc: f203 13f3 addw r3, r3, #499 ; 0x1f3
  5019. 800a4d0: fb93 f3f2 sdiv r3, r3, r2
  5020. 800a4d4: 8363 strh r3, [r4, #26]
  5021. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover(): set request timeout %"U16_F" msecs\n", msecs));
  5022. return result;
  5023. }
  5024. 800a4d6: 4630 mov r0, r6
  5025. 800a4d8: bd7c pop {r2, r3, r4, r5, r6, pc}
  5026. 800a4da: bf00 nop
  5027. 800a4dc: 0801187c .word 0x0801187c
  5028. 0800a4e0 <dhcp_rebind>:
  5029. *
  5030. * @param netif network interface which must rebind with a DHCP server
  5031. */
  5032. static err_t
  5033. dhcp_rebind(struct netif *netif)
  5034. {
  5035. 800a4e0: b573 push {r0, r1, r4, r5, r6, lr}
  5036. struct dhcp *dhcp = netif->dhcp;
  5037. 800a4e2: 6a04 ldr r4, [r0, #32]
  5038. *
  5039. * @param netif network interface which must rebind with a DHCP server
  5040. */
  5041. static err_t
  5042. dhcp_rebind(struct netif *netif)
  5043. {
  5044. 800a4e4: 4605 mov r5, r0
  5045. struct dhcp *dhcp = netif->dhcp;
  5046. err_t result;
  5047. u16_t msecs;
  5048. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind()\n"));
  5049. dhcp_set_state(dhcp, DHCP_REBINDING);
  5050. 800a4e6: 2104 movs r1, #4
  5051. 800a4e8: 4620 mov r0, r4
  5052. 800a4ea: f7ff fe8c bl 800a206 <dhcp_set_state>
  5053. /* create and initialize the DHCP message header */
  5054. result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
  5055. 800a4ee: 4628 mov r0, r5
  5056. 800a4f0: 4621 mov r1, r4
  5057. 800a4f2: 2203 movs r2, #3
  5058. 800a4f4: f7ff feec bl 800a2d0 <dhcp_create_msg>
  5059. if (result == ERR_OK) {
  5060. 800a4f8: 4606 mov r6, r0
  5061. 800a4fa: b9d8 cbnz r0, 800a534 <dhcp_rebind+0x54>
  5062. dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  5063. 800a4fc: 2202 movs r2, #2
  5064. 800a4fe: 4620 mov r0, r4
  5065. 800a500: 2139 movs r1, #57 ; 0x39
  5066. 800a502: f7ff fe88 bl 800a216 <dhcp_option>
  5067. dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
  5068. 800a506: 8ca9 ldrh r1, [r5, #36] ; 0x24
  5069. 800a508: 4620 mov r0, r4
  5070. 800a50a: f7ff fe9b bl 800a244 <dhcp_option_short>
  5071. dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
  5072. dhcp_option_long(dhcp, ntohl(dhcp->server_ip_addr.addr));
  5073. #endif
  5074. dhcp_option_trailer(dhcp);
  5075. 800a50e: 4620 mov r0, r4
  5076. 800a510: f7ff fec8 bl 800a2a4 <dhcp_option_trailer>
  5077. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  5078. 800a514: 8b21 ldrh r1, [r4, #24]
  5079. 800a516: 6920 ldr r0, [r4, #16]
  5080. 800a518: 31f0 adds r1, #240 ; 0xf0
  5081. 800a51a: b289 uxth r1, r1
  5082. 800a51c: f000 fffd bl 800b51a <pbuf_realloc>
  5083. /* broadcast to server */
  5084. udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  5085. 800a520: 9500 str r5, [sp, #0]
  5086. 800a522: 6860 ldr r0, [r4, #4]
  5087. 800a524: 6921 ldr r1, [r4, #16]
  5088. 800a526: 4a0e ldr r2, [pc, #56] ; (800a560 <dhcp_rebind+0x80>)
  5089. 800a528: 2343 movs r3, #67 ; 0x43
  5090. 800a52a: f003 fd0d bl 800df48 <udp_sendto_if>
  5091. dhcp_delete_msg(dhcp);
  5092. 800a52e: 4620 mov r0, r4
  5093. 800a530: f7ff ff6e bl 800a410 <dhcp_delete_msg>
  5094. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n"));
  5095. } else {
  5096. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_rebind: could not allocate DHCP request\n"));
  5097. }
  5098. dhcp->tries++;
  5099. 800a534: 7b63 ldrb r3, [r4, #13]
  5100. 800a536: 3301 adds r3, #1
  5101. 800a538: b2db uxtb r3, r3
  5102. msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  5103. 800a53a: 2b09 cmp r3, #9
  5104. dhcp_delete_msg(dhcp);
  5105. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n"));
  5106. } else {
  5107. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_rebind: could not allocate DHCP request\n"));
  5108. }
  5109. dhcp->tries++;
  5110. 800a53c: 7363 strb r3, [r4, #13]
  5111. msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  5112. 800a53e: d804 bhi.n 800a54a <dhcp_rebind+0x6a>
  5113. 800a540: f44f 727a mov.w r2, #1000 ; 0x3e8
  5114. 800a544: 4353 muls r3, r2
  5115. 800a546: b29b uxth r3, r3
  5116. 800a548: e001 b.n 800a54e <dhcp_rebind+0x6e>
  5117. 800a54a: f242 7310 movw r3, #10000 ; 0x2710
  5118. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  5119. 800a54e: f44f 72fa mov.w r2, #500 ; 0x1f4
  5120. 800a552: f203 13f3 addw r3, r3, #499 ; 0x1f3
  5121. 800a556: fb93 f3f2 sdiv r3, r3, r2
  5122. 800a55a: 8363 strh r3, [r4, #26]
  5123. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind(): set request timeout %"U16_F" msecs\n", msecs));
  5124. return result;
  5125. }
  5126. 800a55c: 4630 mov r0, r6
  5127. 800a55e: bd7c pop {r2, r3, r4, r5, r6, pc}
  5128. 800a560: 0801187c .word 0x0801187c
  5129. 0800a564 <dhcp_reboot>:
  5130. *
  5131. * @param netif network interface which must reboot
  5132. */
  5133. static err_t
  5134. dhcp_reboot(struct netif *netif)
  5135. {
  5136. 800a564: b573 push {r0, r1, r4, r5, r6, lr}
  5137. struct dhcp *dhcp = netif->dhcp;
  5138. 800a566: 6a04 ldr r4, [r0, #32]
  5139. *
  5140. * @param netif network interface which must reboot
  5141. */
  5142. static err_t
  5143. dhcp_reboot(struct netif *netif)
  5144. {
  5145. 800a568: 4605 mov r5, r0
  5146. struct dhcp *dhcp = netif->dhcp;
  5147. err_t result;
  5148. u16_t msecs;
  5149. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot()\n"));
  5150. dhcp_set_state(dhcp, DHCP_REBOOTING);
  5151. 800a56a: 2103 movs r1, #3
  5152. 800a56c: 4620 mov r0, r4
  5153. 800a56e: f7ff fe4a bl 800a206 <dhcp_set_state>
  5154. /* create and initialize the DHCP message header */
  5155. result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
  5156. 800a572: 4628 mov r0, r5
  5157. 800a574: 4621 mov r1, r4
  5158. 800a576: 2203 movs r2, #3
  5159. 800a578: f7ff feaa bl 800a2d0 <dhcp_create_msg>
  5160. if (result == ERR_OK) {
  5161. 800a57c: 4606 mov r6, r0
  5162. 800a57e: bb40 cbnz r0, 800a5d2 <dhcp_reboot+0x6e>
  5163. dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  5164. 800a580: 2202 movs r2, #2
  5165. 800a582: 4620 mov r0, r4
  5166. 800a584: 2139 movs r1, #57 ; 0x39
  5167. 800a586: f7ff fe46 bl 800a216 <dhcp_option>
  5168. dhcp_option_short(dhcp, 576);
  5169. 800a58a: 4620 mov r0, r4
  5170. 800a58c: f44f 7110 mov.w r1, #576 ; 0x240
  5171. 800a590: f7ff fe58 bl 800a244 <dhcp_option_short>
  5172. dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
  5173. 800a594: 2204 movs r2, #4
  5174. 800a596: 2132 movs r1, #50 ; 0x32
  5175. 800a598: 4620 mov r0, r4
  5176. 800a59a: f7ff fe3c bl 800a216 <dhcp_option>
  5177. dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr)));
  5178. 800a59e: 6a60 ldr r0, [r4, #36] ; 0x24
  5179. 800a5a0: f7ff fe2f bl 800a202 <lwip_ntohl>
  5180. 800a5a4: 4601 mov r1, r0
  5181. 800a5a6: 4620 mov r0, r4
  5182. 800a5a8: f7ff fe5c bl 800a264 <dhcp_option_long>
  5183. dhcp_option_trailer(dhcp);
  5184. 800a5ac: 4620 mov r0, r4
  5185. 800a5ae: f7ff fe79 bl 800a2a4 <dhcp_option_trailer>
  5186. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  5187. 800a5b2: 8b21 ldrh r1, [r4, #24]
  5188. 800a5b4: 6920 ldr r0, [r4, #16]
  5189. 800a5b6: 31f0 adds r1, #240 ; 0xf0
  5190. 800a5b8: b289 uxth r1, r1
  5191. 800a5ba: f000 ffae bl 800b51a <pbuf_realloc>
  5192. /* broadcast to server */
  5193. udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  5194. 800a5be: 9500 str r5, [sp, #0]
  5195. 800a5c0: 6860 ldr r0, [r4, #4]
  5196. 800a5c2: 6921 ldr r1, [r4, #16]
  5197. 800a5c4: 4a0e ldr r2, [pc, #56] ; (800a600 <dhcp_reboot+0x9c>)
  5198. 800a5c6: 2343 movs r3, #67 ; 0x43
  5199. 800a5c8: f003 fcbe bl 800df48 <udp_sendto_if>
  5200. dhcp_delete_msg(dhcp);
  5201. 800a5cc: 4620 mov r0, r4
  5202. 800a5ce: f7ff ff1f bl 800a410 <dhcp_delete_msg>
  5203. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot: REBOOTING\n"));
  5204. } else {
  5205. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_reboot: could not allocate DHCP request\n"));
  5206. }
  5207. dhcp->tries++;
  5208. 800a5d2: 7b63 ldrb r3, [r4, #13]
  5209. 800a5d4: 3301 adds r3, #1
  5210. 800a5d6: b2db uxtb r3, r3
  5211. msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  5212. 800a5d8: 2b09 cmp r3, #9
  5213. dhcp_delete_msg(dhcp);
  5214. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot: REBOOTING\n"));
  5215. } else {
  5216. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_reboot: could not allocate DHCP request\n"));
  5217. }
  5218. dhcp->tries++;
  5219. 800a5da: 7363 strb r3, [r4, #13]
  5220. msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  5221. 800a5dc: d804 bhi.n 800a5e8 <dhcp_reboot+0x84>
  5222. 800a5de: f44f 727a mov.w r2, #1000 ; 0x3e8
  5223. 800a5e2: 4353 muls r3, r2
  5224. 800a5e4: b29b uxth r3, r3
  5225. 800a5e6: e001 b.n 800a5ec <dhcp_reboot+0x88>
  5226. 800a5e8: f242 7310 movw r3, #10000 ; 0x2710
  5227. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  5228. 800a5ec: f44f 72fa mov.w r2, #500 ; 0x1f4
  5229. 800a5f0: f203 13f3 addw r3, r3, #499 ; 0x1f3
  5230. 800a5f4: fb93 f3f2 sdiv r3, r3, r2
  5231. 800a5f8: 8363 strh r3, [r4, #26]
  5232. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot(): set request timeout %"U16_F" msecs\n", msecs));
  5233. return result;
  5234. }
  5235. 800a5fa: 4630 mov r0, r6
  5236. 800a5fc: bd7c pop {r2, r3, r4, r5, r6, pc}
  5237. 800a5fe: bf00 nop
  5238. 800a600: 0801187c .word 0x0801187c
  5239. 0800a604 <dhcp_select>:
  5240. * @param netif the netif under DHCP control
  5241. * @return lwIP specific error (see error.h)
  5242. */
  5243. static err_t
  5244. dhcp_select(struct netif *netif)
  5245. {
  5246. 800a604: b573 push {r0, r1, r4, r5, r6, lr}
  5247. struct dhcp *dhcp = netif->dhcp;
  5248. 800a606: 6a04 ldr r4, [r0, #32]
  5249. * @param netif the netif under DHCP control
  5250. * @return lwIP specific error (see error.h)
  5251. */
  5252. static err_t
  5253. dhcp_select(struct netif *netif)
  5254. {
  5255. 800a608: 4605 mov r5, r0
  5256. struct dhcp *dhcp = netif->dhcp;
  5257. err_t result;
  5258. u16_t msecs;
  5259. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_select(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  5260. dhcp_set_state(dhcp, DHCP_REQUESTING);
  5261. 800a60a: 2101 movs r1, #1
  5262. 800a60c: 4620 mov r0, r4
  5263. 800a60e: f7ff fdfa bl 800a206 <dhcp_set_state>
  5264. /* create and initialize the DHCP message header */
  5265. result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
  5266. 800a612: 4628 mov r0, r5
  5267. 800a614: 4621 mov r1, r4
  5268. 800a616: 2203 movs r2, #3
  5269. 800a618: f7ff fe5a bl 800a2d0 <dhcp_create_msg>
  5270. if (result == ERR_OK) {
  5271. 800a61c: 4606 mov r6, r0
  5272. 800a61e: 2800 cmp r0, #0
  5273. 800a620: d148 bne.n 800a6b4 <dhcp_select+0xb0>
  5274. dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  5275. 800a622: 2202 movs r2, #2
  5276. 800a624: 4620 mov r0, r4
  5277. 800a626: 2139 movs r1, #57 ; 0x39
  5278. 800a628: f7ff fdf5 bl 800a216 <dhcp_option>
  5279. dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
  5280. 800a62c: 4620 mov r0, r4
  5281. 800a62e: 8ca9 ldrh r1, [r5, #36] ; 0x24
  5282. 800a630: f7ff fe08 bl 800a244 <dhcp_option_short>
  5283. /* MUST request the offered IP address */
  5284. dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
  5285. 800a634: 2204 movs r2, #4
  5286. 800a636: 2132 movs r1, #50 ; 0x32
  5287. 800a638: 4620 mov r0, r4
  5288. 800a63a: f7ff fdec bl 800a216 <dhcp_option>
  5289. dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr)));
  5290. 800a63e: 6a60 ldr r0, [r4, #36] ; 0x24
  5291. 800a640: f7ff fddf bl 800a202 <lwip_ntohl>
  5292. 800a644: 4601 mov r1, r0
  5293. 800a646: 4620 mov r0, r4
  5294. 800a648: f7ff fe0c bl 800a264 <dhcp_option_long>
  5295. dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
  5296. 800a64c: 2204 movs r2, #4
  5297. 800a64e: 2136 movs r1, #54 ; 0x36
  5298. 800a650: 4620 mov r0, r4
  5299. 800a652: f7ff fde0 bl 800a216 <dhcp_option>
  5300. dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->server_ip_addr)));
  5301. 800a656: 6a20 ldr r0, [r4, #32]
  5302. 800a658: f7ff fdd3 bl 800a202 <lwip_ntohl>
  5303. 800a65c: 4601 mov r1, r0
  5304. 800a65e: 4620 mov r0, r4
  5305. 800a660: f7ff fe00 bl 800a264 <dhcp_option_long>
  5306. dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
  5307. 800a664: 2204 movs r2, #4
  5308. 800a666: 4620 mov r0, r4
  5309. 800a668: 2137 movs r1, #55 ; 0x37
  5310. 800a66a: f7ff fdd4 bl 800a216 <dhcp_option>
  5311. dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);
  5312. 800a66e: 4620 mov r0, r4
  5313. 800a670: 2101 movs r1, #1
  5314. 800a672: f7ff fddf bl 800a234 <dhcp_option_byte>
  5315. dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);
  5316. 800a676: 4620 mov r0, r4
  5317. 800a678: 2103 movs r1, #3
  5318. 800a67a: f7ff fddb bl 800a234 <dhcp_option_byte>
  5319. dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
  5320. 800a67e: 4620 mov r0, r4
  5321. 800a680: 211c movs r1, #28
  5322. 800a682: f7ff fdd7 bl 800a234 <dhcp_option_byte>
  5323. dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
  5324. 800a686: 2106 movs r1, #6
  5325. 800a688: 4620 mov r0, r4
  5326. 800a68a: f7ff fdd3 bl 800a234 <dhcp_option_byte>
  5327. #if LWIP_NETIF_HOSTNAME
  5328. dhcp_option_hostname(dhcp, netif);
  5329. #endif /* LWIP_NETIF_HOSTNAME */
  5330. dhcp_option_trailer(dhcp);
  5331. 800a68e: 4620 mov r0, r4
  5332. 800a690: f7ff fe08 bl 800a2a4 <dhcp_option_trailer>
  5333. /* shrink the pbuf to the actual content length */
  5334. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  5335. 800a694: 8b21 ldrh r1, [r4, #24]
  5336. 800a696: 6920 ldr r0, [r4, #16]
  5337. 800a698: 31f0 adds r1, #240 ; 0xf0
  5338. 800a69a: b289 uxth r1, r1
  5339. 800a69c: f000 ff3d bl 800b51a <pbuf_realloc>
  5340. /* send broadcast to any DHCP server */
  5341. udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  5342. 800a6a0: 9500 str r5, [sp, #0]
  5343. 800a6a2: 6860 ldr r0, [r4, #4]
  5344. 800a6a4: 6921 ldr r1, [r4, #16]
  5345. 800a6a6: 4a0f ldr r2, [pc, #60] ; (800a6e4 <dhcp_select+0xe0>)
  5346. 800a6a8: 2343 movs r3, #67 ; 0x43
  5347. 800a6aa: f003 fc4d bl 800df48 <udp_sendto_if>
  5348. dhcp_delete_msg(dhcp);
  5349. 800a6ae: 4620 mov r0, r4
  5350. 800a6b0: f7ff feae bl 800a410 <dhcp_delete_msg>
  5351. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n"));
  5352. } else {
  5353. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_select: could not allocate DHCP request\n"));
  5354. }
  5355. dhcp->tries++;
  5356. 800a6b4: 7b63 ldrb r3, [r4, #13]
  5357. 800a6b6: 3301 adds r3, #1
  5358. 800a6b8: b2db uxtb r3, r3
  5359. msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
  5360. 800a6ba: 2b05 cmp r3, #5
  5361. 800a6bc: bf98 it ls
  5362. 800a6be: f44f 727a movls.w r2, #1000 ; 0x3e8
  5363. dhcp_delete_msg(dhcp);
  5364. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n"));
  5365. } else {
  5366. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_select: could not allocate DHCP request\n"));
  5367. }
  5368. dhcp->tries++;
  5369. 800a6c2: 7363 strb r3, [r4, #13]
  5370. msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
  5371. 800a6c4: bf9a itte ls
  5372. 800a6c6: fa02 f303 lslls.w r3, r2, r3
  5373. 800a6ca: b29b uxthls r3, r3
  5374. 800a6cc: f64e 2360 movwhi r3, #60000 ; 0xea60
  5375. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  5376. 800a6d0: f44f 72fa mov.w r2, #500 ; 0x1f4
  5377. 800a6d4: f203 13f3 addw r3, r3, #499 ; 0x1f3
  5378. 800a6d8: fb93 f3f2 sdiv r3, r3, r2
  5379. 800a6dc: 8363 strh r3, [r4, #26]
  5380. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_select(): set request timeout %"U16_F" msecs\n", msecs));
  5381. return result;
  5382. }
  5383. 800a6de: 4630 mov r0, r6
  5384. 800a6e0: bd7c pop {r2, r3, r4, r5, r6, pc}
  5385. 800a6e2: bf00 nop
  5386. 800a6e4: 0801187c .word 0x0801187c
  5387. 0800a6e8 <dhcp_check>:
  5388. *
  5389. * @param netif the netif under DHCP control
  5390. */
  5391. static void
  5392. dhcp_check(struct netif *netif)
  5393. {
  5394. 800a6e8: b538 push {r3, r4, r5, lr}
  5395. struct dhcp *dhcp = netif->dhcp;
  5396. 800a6ea: 6a04 ldr r4, [r0, #32]
  5397. *
  5398. * @param netif the netif under DHCP control
  5399. */
  5400. static void
  5401. dhcp_check(struct netif *netif)
  5402. {
  5403. 800a6ec: 4605 mov r5, r0
  5404. struct dhcp *dhcp = netif->dhcp;
  5405. err_t result;
  5406. u16_t msecs;
  5407. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_check(netif=%p) %c%c\n", (void *)netif, (s16_t)netif->name[0],
  5408. (s16_t)netif->name[1]));
  5409. dhcp_set_state(dhcp, DHCP_CHECKING);
  5410. 800a6ee: 2108 movs r1, #8
  5411. 800a6f0: 4620 mov r0, r4
  5412. 800a6f2: f7ff fd88 bl 800a206 <dhcp_set_state>
  5413. /* create an ARP query for the offered IP address, expecting that no host
  5414. responds, as the IP address should not be in use. */
  5415. result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);
  5416. 800a6f6: 4628 mov r0, r5
  5417. 800a6f8: f104 0124 add.w r1, r4, #36 ; 0x24
  5418. 800a6fc: 2200 movs r2, #0
  5419. 800a6fe: f004 fc73 bl 800efe8 <etharp_query>
  5420. if (result != ERR_OK) {
  5421. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_check: could not perform ARP query\n"));
  5422. }
  5423. dhcp->tries++;
  5424. 800a702: 7b63 ldrb r3, [r4, #13]
  5425. 800a704: 3301 adds r3, #1
  5426. 800a706: 7363 strb r3, [r4, #13]
  5427. msecs = 500;
  5428. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  5429. 800a708: 2301 movs r3, #1
  5430. 800a70a: 8363 strh r3, [r4, #26]
  5431. 800a70c: bd38 pop {r3, r4, r5, pc}
  5432. 0800a70e <dhcp_bind>:
  5433. *
  5434. * @param netif network interface to bind to the offered address
  5435. */
  5436. static void
  5437. dhcp_bind(struct netif *netif)
  5438. {
  5439. 800a70e: b537 push {r0, r1, r2, r4, r5, lr}
  5440. u32_t timeout;
  5441. struct dhcp *dhcp;
  5442. ip_addr_t sn_mask, gw_addr;
  5443. LWIP_ERROR("dhcp_bind: netif != NULL", (netif != NULL), return;);
  5444. 800a710: 4605 mov r5, r0
  5445. 800a712: 2800 cmp r0, #0
  5446. 800a714: d059 beq.n 800a7ca <dhcp_bind+0xbc>
  5447. dhcp = netif->dhcp;
  5448. 800a716: 6a04 ldr r4, [r0, #32]
  5449. LWIP_ERROR("dhcp_bind: dhcp != NULL", (dhcp != NULL), return;);
  5450. 800a718: 2c00 cmp r4, #0
  5451. 800a71a: d056 beq.n 800a7ca <dhcp_bind+0xbc>
  5452. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  5453. /* temporary DHCP lease? */
  5454. if (dhcp->offered_t1_renew != 0xffffffffUL) {
  5455. 800a71c: 6b63 ldr r3, [r4, #52] ; 0x34
  5456. 800a71e: 1c58 adds r0, r3, #1
  5457. 800a720: d00d beq.n 800a73e <dhcp_bind+0x30>
  5458. /* set renewal period timer */
  5459. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t1 renewal timer %"U32_F" secs\n", dhcp->offered_t1_renew));
  5460. timeout = (dhcp->offered_t1_renew + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS;
  5461. 800a722: 223c movs r2, #60 ; 0x3c
  5462. 800a724: 331e adds r3, #30
  5463. 800a726: fbb3 f3f2 udiv r3, r3, r2
  5464. if(timeout > 0xffff) {
  5465. timeout = 0xffff;
  5466. }
  5467. dhcp->t1_timeout = (u16_t)timeout;
  5468. 800a72a: f64f 72ff movw r2, #65535 ; 0xffff
  5469. 800a72e: 4293 cmp r3, r2
  5470. 800a730: bf28 it cs
  5471. 800a732: 4613 movcs r3, r2
  5472. 800a734: b29b uxth r3, r3
  5473. 800a736: 83a3 strh r3, [r4, #28]
  5474. if (dhcp->t1_timeout == 0) {
  5475. 800a738: b90b cbnz r3, 800a73e <dhcp_bind+0x30>
  5476. dhcp->t1_timeout = 1;
  5477. 800a73a: 2301 movs r3, #1
  5478. 800a73c: 83a3 strh r3, [r4, #28]
  5479. }
  5480. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t1_renew*1000));
  5481. }
  5482. /* set renewal period timer */
  5483. if (dhcp->offered_t2_rebind != 0xffffffffUL) {
  5484. 800a73e: 6ba3 ldr r3, [r4, #56] ; 0x38
  5485. 800a740: 1c59 adds r1, r3, #1
  5486. 800a742: d00d beq.n 800a760 <dhcp_bind+0x52>
  5487. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t2 rebind timer %"U32_F" secs\n", dhcp->offered_t2_rebind));
  5488. timeout = (dhcp->offered_t2_rebind + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS;
  5489. 800a744: 223c movs r2, #60 ; 0x3c
  5490. 800a746: 331e adds r3, #30
  5491. 800a748: fbb3 f3f2 udiv r3, r3, r2
  5492. if(timeout > 0xffff) {
  5493. timeout = 0xffff;
  5494. }
  5495. dhcp->t2_timeout = (u16_t)timeout;
  5496. 800a74c: f64f 72ff movw r2, #65535 ; 0xffff
  5497. 800a750: 4293 cmp r3, r2
  5498. 800a752: bf28 it cs
  5499. 800a754: 4613 movcs r3, r2
  5500. 800a756: b29b uxth r3, r3
  5501. 800a758: 83e3 strh r3, [r4, #30]
  5502. if (dhcp->t2_timeout == 0) {
  5503. 800a75a: b90b cbnz r3, 800a760 <dhcp_bind+0x52>
  5504. dhcp->t2_timeout = 1;
  5505. 800a75c: 2301 movs r3, #1
  5506. 800a75e: 83e3 strh r3, [r4, #30]
  5507. }
  5508. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000));
  5509. }
  5510. /* If we have sub 1 minute lease, t2 and t1 will kick in at the same time. */
  5511. if ((dhcp->t1_timeout >= dhcp->t2_timeout) && (dhcp->t2_timeout > 0)) {
  5512. 800a760: 8be3 ldrh r3, [r4, #30]
  5513. 800a762: 8ba2 ldrh r2, [r4, #28]
  5514. 800a764: 429a cmp r2, r3
  5515. 800a766: d302 bcc.n 800a76e <dhcp_bind+0x60>
  5516. 800a768: b10b cbz r3, 800a76e <dhcp_bind+0x60>
  5517. dhcp->t1_timeout = 0;
  5518. 800a76a: 2300 movs r3, #0
  5519. 800a76c: 83a3 strh r3, [r4, #28]
  5520. }
  5521. if (dhcp->subnet_mask_given) {
  5522. 800a76e: 7ba3 ldrb r3, [r4, #14]
  5523. 800a770: b10b cbz r3, 800a776 <dhcp_bind+0x68>
  5524. /* copy offered network mask */
  5525. ip_addr_copy(sn_mask, dhcp->offered_sn_mask);
  5526. 800a772: 6aa3 ldr r3, [r4, #40] ; 0x28
  5527. 800a774: e00b b.n 800a78e <dhcp_bind+0x80>
  5528. } else {
  5529. /* subnet mask not given, choose a safe subnet mask given the network class */
  5530. u8_t first_octet = ip4_addr1(&dhcp->offered_ip_addr);
  5531. 800a776: f894 3024 ldrb.w r3, [r4, #36] ; 0x24
  5532. if (first_octet <= 127) {
  5533. 800a77a: 061a lsls r2, r3, #24
  5534. 800a77c: d401 bmi.n 800a782 <dhcp_bind+0x74>
  5535. ip4_addr_set_u32(&sn_mask, PP_HTONL(0xff000000UL));
  5536. 800a77e: 23ff movs r3, #255 ; 0xff
  5537. 800a780: e005 b.n 800a78e <dhcp_bind+0x80>
  5538. } else if (first_octet >= 192) {
  5539. 800a782: 2bbf cmp r3, #191 ; 0xbf
  5540. ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffffff00UL));
  5541. 800a784: bf8c ite hi
  5542. 800a786: f06f 437f mvnhi.w r3, #4278190080 ; 0xff000000
  5543. } else {
  5544. ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffff0000UL));
  5545. 800a78a: f64f 73ff movwls r3, #65535 ; 0xffff
  5546. 800a78e: 9300 str r3, [sp, #0]
  5547. }
  5548. }
  5549. ip_addr_copy(gw_addr, dhcp->offered_gw_addr);
  5550. 800a790: 6ae3 ldr r3, [r4, #44] ; 0x2c
  5551. 800a792: 9301 str r3, [sp, #4]
  5552. /* gateway address not given? */
  5553. if (ip_addr_isany(&gw_addr)) {
  5554. 800a794: b92b cbnz r3, 800a7a2 <dhcp_bind+0x94>
  5555. /* copy network address */
  5556. ip_addr_get_network(&gw_addr, &dhcp->offered_ip_addr, &sn_mask);
  5557. 800a796: 6a63 ldr r3, [r4, #36] ; 0x24
  5558. 800a798: 9a00 ldr r2, [sp, #0]
  5559. 800a79a: 4013 ands r3, r2
  5560. /* use first host address on network as gateway */
  5561. ip4_addr_set_u32(&gw_addr, ip4_addr_get_u32(&gw_addr) | PP_HTONL(0x00000001UL));
  5562. 800a79c: f043 7380 orr.w r3, r3, #16777216 ; 0x1000000
  5563. 800a7a0: 9301 str r3, [sp, #4]
  5564. }
  5565. #endif /* LWIP_DHCP_AUTOIP_COOP */
  5566. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): IP: 0x%08"X32_F"\n",
  5567. ip4_addr_get_u32(&dhcp->offered_ip_addr)));
  5568. netif_set_ipaddr(netif, &dhcp->offered_ip_addr);
  5569. 800a7a2: 4628 mov r0, r5
  5570. 800a7a4: f104 0124 add.w r1, r4, #36 ; 0x24
  5571. 800a7a8: f000 fdac bl 800b304 <netif_set_ipaddr>
  5572. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): SN: 0x%08"X32_F"\n",
  5573. ip4_addr_get_u32(&sn_mask)));
  5574. netif_set_netmask(netif, &sn_mask);
  5575. 800a7ac: 4628 mov r0, r5
  5576. 800a7ae: 4669 mov r1, sp
  5577. 800a7b0: f000 fe0c bl 800b3cc <netif_set_netmask>
  5578. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): GW: 0x%08"X32_F"\n",
  5579. ip4_addr_get_u32(&gw_addr)));
  5580. netif_set_gw(netif, &gw_addr);
  5581. 800a7b4: a901 add r1, sp, #4
  5582. 800a7b6: 4628 mov r0, r5
  5583. 800a7b8: f000 fe04 bl 800b3c4 <netif_set_gw>
  5584. /* bring the interface up */
  5585. netif_set_up(netif);
  5586. 800a7bc: 4628 mov r0, r5
  5587. 800a7be: f000 fe0f bl 800b3e0 <netif_set_up>
  5588. /* netif is now bound to DHCP leased address */
  5589. dhcp_set_state(dhcp, DHCP_BOUND);
  5590. 800a7c2: 4620 mov r0, r4
  5591. 800a7c4: 210a movs r1, #10
  5592. 800a7c6: f7ff fd1e bl 800a206 <dhcp_set_state>
  5593. }
  5594. 800a7ca: bd3e pop {r1, r2, r3, r4, r5, pc}
  5595. 0800a7cc <dhcp_recv>:
  5596. /**
  5597. * If an incoming DHCP message is in response to us, then trigger the state machine
  5598. */
  5599. static void
  5600. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  5601. {
  5602. 800a7cc: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  5603. 800a7d0: 4692 mov sl, r2
  5604. 800a7d2: b08b sub sp, #44 ; 0x2c
  5605. LWIP_UNUSED_ARG(addr);
  5606. LWIP_UNUSED_ARG(port);
  5607. LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
  5608. if (p->len < DHCP_MIN_REPLY_LEN) {
  5609. 800a7d4: f8ba 300a ldrh.w r3, [sl, #10]
  5610. */
  5611. static void
  5612. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  5613. {
  5614. struct netif *netif = (struct netif *)arg;
  5615. struct dhcp *dhcp = netif->dhcp;
  5616. 800a7d8: f8d0 8020 ldr.w r8, [r0, #32]
  5617. struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload;
  5618. 800a7dc: 6852 ldr r2, [r2, #4]
  5619. LWIP_UNUSED_ARG(addr);
  5620. LWIP_UNUSED_ARG(port);
  5621. LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
  5622. if (p->len < DHCP_MIN_REPLY_LEN) {
  5623. 800a7de: 2b2b cmp r3, #43 ; 0x2b
  5624. /**
  5625. * If an incoming DHCP message is in response to us, then trigger the state machine
  5626. */
  5627. static void
  5628. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  5629. {
  5630. 800a7e0: 4605 mov r5, r0
  5631. LWIP_UNUSED_ARG(addr);
  5632. LWIP_UNUSED_ARG(port);
  5633. LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
  5634. if (p->len < DHCP_MIN_REPLY_LEN) {
  5635. 800a7e2: f240 81b8 bls.w 800ab56 <dhcp_recv+0x38a>
  5636. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP reply message or pbuf too short\n"));
  5637. goto free_pbuf_and_return;
  5638. }
  5639. if (reply_msg->op != DHCP_BOOTREPLY) {
  5640. 800a7e6: 7813 ldrb r3, [r2, #0]
  5641. 800a7e8: 2b02 cmp r3, #2
  5642. 800a7ea: f040 81b4 bne.w 800ab56 <dhcp_recv+0x38a>
  5643. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op));
  5644. goto free_pbuf_and_return;
  5645. }
  5646. /* iterate through hardware address and match against DHCP message */
  5647. for (i = 0; i < netif->hwaddr_len; i++) {
  5648. 800a7ee: f890 1026 ldrb.w r1, [r0, #38] ; 0x26
  5649. 800a7f2: 2300 movs r3, #0
  5650. 800a7f4: e008 b.n 800a808 <dhcp_recv+0x3c>
  5651. /**
  5652. * If an incoming DHCP message is in response to us, then trigger the state machine
  5653. */
  5654. static void
  5655. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  5656. 800a7f6: 18e8 adds r0, r5, r3
  5657. 800a7f8: 3301 adds r3, #1
  5658. 800a7fa: 18d4 adds r4, r2, r3
  5659. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op));
  5660. goto free_pbuf_and_return;
  5661. }
  5662. /* iterate through hardware address and match against DHCP message */
  5663. for (i = 0; i < netif->hwaddr_len; i++) {
  5664. if (netif->hwaddr[i] != reply_msg->chaddr[i]) {
  5665. 800a7fc: f890 0027 ldrb.w r0, [r0, #39] ; 0x27
  5666. 800a800: 7ee4 ldrb r4, [r4, #27]
  5667. 800a802: 4284 cmp r4, r0
  5668. 800a804: f040 81a7 bne.w 800ab56 <dhcp_recv+0x38a>
  5669. if (reply_msg->op != DHCP_BOOTREPLY) {
  5670. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op));
  5671. goto free_pbuf_and_return;
  5672. }
  5673. /* iterate through hardware address and match against DHCP message */
  5674. for (i = 0; i < netif->hwaddr_len; i++) {
  5675. 800a808: b2d8 uxtb r0, r3
  5676. 800a80a: 4288 cmp r0, r1
  5677. 800a80c: d3f3 bcc.n 800a7f6 <dhcp_recv+0x2a>
  5678. (u16_t)i, (u16_t)netif->hwaddr[i], (u16_t)i, (u16_t)reply_msg->chaddr[i]));
  5679. goto free_pbuf_and_return;
  5680. }
  5681. }
  5682. /* match transaction ID against what we expected */
  5683. if (ntohl(reply_msg->xid) != dhcp->xid) {
  5684. 800a80e: 6850 ldr r0, [r2, #4]
  5685. 800a810: f7ff fcf7 bl 800a202 <lwip_ntohl>
  5686. 800a814: f8d8 3000 ldr.w r3, [r8]
  5687. 800a818: 4298 cmp r0, r3
  5688. 800a81a: f040 819c bne.w 800ab56 <dhcp_recv+0x38a>
  5689. struct pbuf *q;
  5690. int parse_file_as_options = 0;
  5691. int parse_sname_as_options = 0;
  5692. /* clear received options */
  5693. dhcp_clear_all_options(dhcp);
  5694. 800a81e: 2100 movs r1, #0
  5695. 800a820: 220a movs r2, #10
  5696. 800a822: 489d ldr r0, [pc, #628] ; (800aa98 <dhcp_recv+0x2cc>)
  5697. 800a824: f7fe fea8 bl 8009578 <memset>
  5698. /* check that beginning of dhcp_msg (up to and including chaddr) is in first pbuf */
  5699. if (p->len < DHCP_SNAME_OFS) {
  5700. 800a828: f8ba 300a ldrh.w r3, [sl, #10]
  5701. 800a82c: 2b2b cmp r3, #43 ; 0x2b
  5702. 800a82e: f240 8192 bls.w 800ab56 <dhcp_recv+0x38a>
  5703. return ERR_BUF;
  5704. }
  5705. dhcp->msg_in = (struct dhcp_msg *)p->payload;
  5706. 800a832: f8da 3004 ldr.w r3, [sl, #4]
  5707. /* parse options */
  5708. /* start with options field */
  5709. options_idx = DHCP_OPTIONS_OFS;
  5710. /* parse options to the end of the received packet */
  5711. options_idx_max = p->tot_len;
  5712. 800a836: f8ba 9008 ldrh.w r9, [sl, #8]
  5713. dhcp_clear_all_options(dhcp);
  5714. /* check that beginning of dhcp_msg (up to and including chaddr) is in first pbuf */
  5715. if (p->len < DHCP_SNAME_OFS) {
  5716. return ERR_BUF;
  5717. }
  5718. dhcp->msg_in = (struct dhcp_msg *)p->payload;
  5719. 800a83a: f8c8 3008 str.w r3, [r8, #8]
  5720. u16_t offset_max;
  5721. u16_t options_idx;
  5722. u16_t options_idx_max;
  5723. struct pbuf *q;
  5724. int parse_file_as_options = 0;
  5725. int parse_sname_as_options = 0;
  5726. 800a83e: f04f 0b00 mov.w fp, #0
  5727. #endif /* LWIP_DHCP_BOOTP_FILE */
  5728. /* parse options */
  5729. /* start with options field */
  5730. options_idx = DHCP_OPTIONS_OFS;
  5731. 800a842: 22f0 movs r2, #240 ; 0xf0
  5732. 800a844: e004 b.n 800a850 <dhcp_recv+0x84>
  5733. parse_file_as_options = 0;
  5734. options_idx = DHCP_FILE_OFS;
  5735. options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
  5736. goto again;
  5737. } else if (parse_sname_as_options) {
  5738. parse_sname_as_options = 0;
  5739. 800a846: f04f 0b00 mov.w fp, #0
  5740. options_idx = DHCP_SNAME_OFS;
  5741. options_idx_max = DHCP_SNAME_OFS + DHCP_SNAME_LEN;
  5742. 800a84a: f04f 096c mov.w r9, #108 ; 0x6c
  5743. options_idx = DHCP_FILE_OFS;
  5744. options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
  5745. goto again;
  5746. } else if (parse_sname_as_options) {
  5747. parse_sname_as_options = 0;
  5748. options_idx = DHCP_SNAME_OFS;
  5749. 800a84e: 222c movs r2, #44 ; 0x2c
  5750. #endif /* LWIP_DHCP_BOOTP_FILE */
  5751. /* parse options */
  5752. /* start with options field */
  5753. options_idx = DHCP_OPTIONS_OFS;
  5754. 800a850: 4657 mov r7, sl
  5755. 800a852: e009 b.n 800a868 <dhcp_recv+0x9c>
  5756. again:
  5757. q = p;
  5758. while((q != NULL) && (options_idx >= q->len)) {
  5759. options_idx -= q->len;
  5760. options_idx_max -= q->len;
  5761. q = q->next;
  5762. 800a854: 683f ldr r7, [r7, #0]
  5763. /* parse options to the end of the received packet */
  5764. options_idx_max = p->tot_len;
  5765. again:
  5766. q = p;
  5767. while((q != NULL) && (options_idx >= q->len)) {
  5768. options_idx -= q->len;
  5769. 800a856: 1ad2 subs r2, r2, r3
  5770. options_idx_max -= q->len;
  5771. 800a858: ebc3 0909 rsb r9, r3, r9
  5772. /* parse options to the end of the received packet */
  5773. options_idx_max = p->tot_len;
  5774. again:
  5775. q = p;
  5776. while((q != NULL) && (options_idx >= q->len)) {
  5777. options_idx -= q->len;
  5778. 800a85c: b292 uxth r2, r2
  5779. options_idx_max -= q->len;
  5780. 800a85e: fa1f f989 uxth.w r9, r9
  5781. options_idx = DHCP_OPTIONS_OFS;
  5782. /* parse options to the end of the received packet */
  5783. options_idx_max = p->tot_len;
  5784. again:
  5785. q = p;
  5786. while((q != NULL) && (options_idx >= q->len)) {
  5787. 800a862: 2f00 cmp r7, #0
  5788. 800a864: f000 8177 beq.w 800ab56 <dhcp_recv+0x38a>
  5789. 800a868: 897b ldrh r3, [r7, #10]
  5790. 800a86a: 429a cmp r2, r3
  5791. 800a86c: d2f2 bcs.n 800a854 <dhcp_recv+0x88>
  5792. if (q == NULL) {
  5793. return ERR_BUF;
  5794. }
  5795. offset = options_idx;
  5796. offset_max = options_idx_max;
  5797. options = (u8_t*)q->payload;
  5798. 800a86e: 6878 ldr r0, [r7, #4]
  5799. 800a870: 9003 str r0, [sp, #12]
  5800. 800a872: e0db b.n 800aa2c <dhcp_recv+0x260>
  5801. u8_t len;
  5802. u8_t decode_len = 0;
  5803. int decode_idx = -1;
  5804. u16_t val_offset = offset + 2;
  5805. /* len byte might be in the next pbuf */
  5806. if (offset + 1 < q->len) {
  5807. 800a874: 897b ldrh r3, [r7, #10]
  5808. 800a876: 1c50 adds r0, r2, #1
  5809. 800a878: 4298 cmp r0, r3
  5810. 800a87a: da03 bge.n 800a884 <dhcp_recv+0xb8>
  5811. len = options[offset + 1];
  5812. 800a87c: 9803 ldr r0, [sp, #12]
  5813. 800a87e: 1883 adds r3, r0, r2
  5814. 800a880: 785b ldrb r3, [r3, #1]
  5815. 800a882: e003 b.n 800a88c <dhcp_recv+0xc0>
  5816. } else {
  5817. len = (q->next != NULL ? ((u8_t*)q->next->payload)[0] : 0);
  5818. 800a884: 683b ldr r3, [r7, #0]
  5819. 800a886: b10b cbz r3, 800a88c <dhcp_recv+0xc0>
  5820. 800a888: 685b ldr r3, [r3, #4]
  5821. 800a88a: 781b ldrb r3, [r3, #0]
  5822. }
  5823. /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */
  5824. decode_len = len;
  5825. switch(op) {
  5826. 800a88c: 2933 cmp r1, #51 ; 0x33
  5827. 800a88e: d038 beq.n 800a902 <dhcp_recv+0x136>
  5828. 800a890: d807 bhi.n 800a8a2 <dhcp_recv+0xd6>
  5829. 800a892: 2901 cmp r1, #1
  5830. 800a894: d019 beq.n 800a8ca <dhcp_recv+0xfe>
  5831. 800a896: d311 bcc.n 800a8bc <dhcp_recv+0xf0>
  5832. 800a898: 2903 cmp r1, #3
  5833. 800a89a: d01d beq.n 800a8d8 <dhcp_recv+0x10c>
  5834. 800a89c: 2906 cmp r1, #6
  5835. 800a89e: d155 bne.n 800a94c <dhcp_recv+0x180>
  5836. 800a8a0: e021 b.n 800a8e6 <dhcp_recv+0x11a>
  5837. 800a8a2: 2936 cmp r1, #54 ; 0x36
  5838. 800a8a4: d03d beq.n 800a922 <dhcp_recv+0x156>
  5839. 800a8a6: d804 bhi.n 800a8b2 <dhcp_recv+0xe6>
  5840. 800a8a8: 2934 cmp r1, #52 ; 0x34
  5841. 800a8aa: d031 beq.n 800a910 <dhcp_recv+0x144>
  5842. 800a8ac: 2935 cmp r1, #53 ; 0x35
  5843. 800a8ae: d14d bne.n 800a94c <dhcp_recv+0x180>
  5844. 800a8b0: e035 b.n 800a91e <dhcp_recv+0x152>
  5845. 800a8b2: 293a cmp r1, #58 ; 0x3a
  5846. 800a8b4: d03c beq.n 800a930 <dhcp_recv+0x164>
  5847. 800a8b6: 293b cmp r1, #59 ; 0x3b
  5848. 800a8b8: d148 bne.n 800a94c <dhcp_recv+0x180>
  5849. 800a8ba: e040 b.n 800a93e <dhcp_recv+0x172>
  5850. /* case(DHCP_OPTION_END): handled above */
  5851. case(DHCP_OPTION_PAD):
  5852. /* special option: no len encoded */
  5853. decode_len = len = 0;
  5854. /* will be increased below */
  5855. offset--;
  5856. 800a8bc: 1e51 subs r1, r2, #1
  5857. decode_len = len;
  5858. switch(op) {
  5859. /* case(DHCP_OPTION_END): handled above */
  5860. case(DHCP_OPTION_PAD):
  5861. /* special option: no len encoded */
  5862. decode_len = len = 0;
  5863. 800a8be: 2300 movs r3, #0
  5864. /* will be increased below */
  5865. offset--;
  5866. 800a8c0: b289 uxth r1, r1
  5867. /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
  5868. while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
  5869. u8_t op = options[offset];
  5870. u8_t len;
  5871. u8_t decode_len = 0;
  5872. int decode_idx = -1;
  5873. 800a8c2: f04f 34ff mov.w r4, #4294967295
  5874. decode_len = len;
  5875. switch(op) {
  5876. /* case(DHCP_OPTION_END): handled above */
  5877. case(DHCP_OPTION_PAD):
  5878. /* special option: no len encoded */
  5879. decode_len = len = 0;
  5880. 800a8c6: 461e mov r6, r3
  5881. 800a8c8: e044 b.n 800a954 <dhcp_recv+0x188>
  5882. /* will be increased below */
  5883. offset--;
  5884. break;
  5885. case(DHCP_OPTION_SUBNET_MASK):
  5886. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  5887. 800a8ca: 2b04 cmp r3, #4
  5888. 800a8cc: f040 8143 bne.w 800ab56 <dhcp_recv+0x38a>
  5889. 800a8d0: 461e mov r6, r3
  5890. 800a8d2: 4611 mov r1, r2
  5891. decode_idx = DHCP_OPTION_IDX_SUBNET_MASK;
  5892. 800a8d4: 2406 movs r4, #6
  5893. 800a8d6: e03d b.n 800a954 <dhcp_recv+0x188>
  5894. break;
  5895. case(DHCP_OPTION_ROUTER):
  5896. decode_len = 4; /* only copy the first given router */
  5897. LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
  5898. 800a8d8: 2b03 cmp r3, #3
  5899. 800a8da: f240 813c bls.w 800ab56 <dhcp_recv+0x38a>
  5900. 800a8de: 4611 mov r1, r2
  5901. decode_idx = DHCP_OPTION_IDX_ROUTER;
  5902. 800a8e0: 2407 movs r4, #7
  5903. case(DHCP_OPTION_SUBNET_MASK):
  5904. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  5905. decode_idx = DHCP_OPTION_IDX_SUBNET_MASK;
  5906. break;
  5907. case(DHCP_OPTION_ROUTER):
  5908. decode_len = 4; /* only copy the first given router */
  5909. 800a8e2: 2604 movs r6, #4
  5910. 800a8e4: e036 b.n 800a954 <dhcp_recv+0x188>
  5911. LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
  5912. decode_idx = DHCP_OPTION_IDX_ROUTER;
  5913. break;
  5914. case(DHCP_OPTION_DNS_SERVER):
  5915. /* special case: there might be more than one server */
  5916. LWIP_ERROR("len % 4 == 0", len % 4 == 0, return ERR_VAL;);
  5917. 800a8e6: 0799 lsls r1, r3, #30
  5918. 800a8e8: f040 8135 bne.w 800ab56 <dhcp_recv+0x38a>
  5919. /* limit number of DNS servers */
  5920. decode_len = LWIP_MIN(len, 4 * DNS_MAX_SERVERS);
  5921. 800a8ec: 2b08 cmp r3, #8
  5922. 800a8ee: bf34 ite cc
  5923. 800a8f0: 461e movcc r6, r3
  5924. 800a8f2: 2608 movcs r6, #8
  5925. 800a8f4: b2f6 uxtb r6, r6
  5926. LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
  5927. 800a8f6: 42b3 cmp r3, r6
  5928. 800a8f8: f0c0 812d bcc.w 800ab56 <dhcp_recv+0x38a>
  5929. 800a8fc: 4611 mov r1, r2
  5930. decode_idx = DHCP_OPTION_IDX_DNS_SERVER;
  5931. 800a8fe: 2408 movs r4, #8
  5932. 800a900: e028 b.n 800a954 <dhcp_recv+0x188>
  5933. break;
  5934. case(DHCP_OPTION_LEASE_TIME):
  5935. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  5936. 800a902: 2b04 cmp r3, #4
  5937. 800a904: f040 8127 bne.w 800ab56 <dhcp_recv+0x38a>
  5938. 800a908: 461e mov r6, r3
  5939. 800a90a: 4611 mov r1, r2
  5940. decode_idx = DHCP_OPTION_IDX_LEASE_TIME;
  5941. 800a90c: 2403 movs r4, #3
  5942. 800a90e: e021 b.n 800a954 <dhcp_recv+0x188>
  5943. break;
  5944. case(DHCP_OPTION_OVERLOAD):
  5945. LWIP_ERROR("len == 1", len == 1, return ERR_VAL;);
  5946. 800a910: 2b01 cmp r3, #1
  5947. 800a912: f040 8120 bne.w 800ab56 <dhcp_recv+0x38a>
  5948. 800a916: 461e mov r6, r3
  5949. 800a918: 4611 mov r1, r2
  5950. decode_idx = DHCP_OPTION_IDX_OVERLOAD;
  5951. 800a91a: 2400 movs r4, #0
  5952. 800a91c: e01a b.n 800a954 <dhcp_recv+0x188>
  5953. break;
  5954. case(DHCP_OPTION_MESSAGE_TYPE):
  5955. LWIP_ERROR("len == 1", len == 1, return ERR_VAL;);
  5956. 800a91e: 2b01 cmp r3, #1
  5957. 800a920: e007 b.n 800a932 <dhcp_recv+0x166>
  5958. decode_idx = DHCP_OPTION_IDX_MSG_TYPE;
  5959. break;
  5960. case(DHCP_OPTION_SERVER_ID):
  5961. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  5962. 800a922: 2b04 cmp r3, #4
  5963. 800a924: f040 8117 bne.w 800ab56 <dhcp_recv+0x38a>
  5964. 800a928: 461e mov r6, r3
  5965. 800a92a: 4611 mov r1, r2
  5966. decode_idx = DHCP_OPTION_IDX_SERVER_ID;
  5967. 800a92c: 2402 movs r4, #2
  5968. 800a92e: e011 b.n 800a954 <dhcp_recv+0x188>
  5969. break;
  5970. case(DHCP_OPTION_T1):
  5971. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  5972. 800a930: 2b04 cmp r3, #4
  5973. 800a932: f040 8110 bne.w 800ab56 <dhcp_recv+0x38a>
  5974. 800a936: 461e mov r6, r3
  5975. 800a938: 4611 mov r1, r2
  5976. decode_idx = DHCP_OPTION_IDX_T1;
  5977. 800a93a: 461c mov r4, r3
  5978. 800a93c: e00a b.n 800a954 <dhcp_recv+0x188>
  5979. break;
  5980. case(DHCP_OPTION_T2):
  5981. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  5982. 800a93e: 2b04 cmp r3, #4
  5983. 800a940: f040 8109 bne.w 800ab56 <dhcp_recv+0x38a>
  5984. 800a944: 461e mov r6, r3
  5985. 800a946: 4611 mov r1, r2
  5986. decode_idx = DHCP_OPTION_IDX_T2;
  5987. 800a948: 2405 movs r4, #5
  5988. 800a94a: e003 b.n 800a954 <dhcp_recv+0x188>
  5989. } else {
  5990. len = (q->next != NULL ? ((u8_t*)q->next->payload)[0] : 0);
  5991. }
  5992. /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */
  5993. decode_len = len;
  5994. switch(op) {
  5995. 800a94c: 4611 mov r1, r2
  5996. /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
  5997. while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
  5998. u8_t op = options[offset];
  5999. u8_t len;
  6000. u8_t decode_len = 0;
  6001. int decode_idx = -1;
  6002. 800a94e: f04f 34ff mov.w r4, #4294967295
  6003. case(DHCP_OPTION_T2):
  6004. LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
  6005. decode_idx = DHCP_OPTION_IDX_T2;
  6006. break;
  6007. default:
  6008. decode_len = 0;
  6009. 800a952: 2600 movs r6, #0
  6010. LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
  6011. break;
  6012. }
  6013. offset += len + 2;
  6014. 800a954: 3102 adds r1, #2
  6015. 800a956: fa13 f381 uxtah r3, r3, r1
  6016. 800a95a: b29b uxth r3, r3
  6017. 800a95c: 9301 str r3, [sp, #4]
  6018. if (decode_len > 0) {
  6019. 800a95e: 2e00 cmp r6, #0
  6020. 800a960: d04f beq.n 800aa02 <dhcp_recv+0x236>
  6021. while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
  6022. u8_t op = options[offset];
  6023. u8_t len;
  6024. u8_t decode_len = 0;
  6025. int decode_idx = -1;
  6026. u16_t val_offset = offset + 2;
  6027. 800a962: 3202 adds r2, #2
  6028. 800a964: b292 uxth r2, r2
  6029. LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
  6030. break;
  6031. }
  6032. offset += len + 2;
  6033. if (decode_len > 0) {
  6034. u32_t value = 0;
  6035. 800a966: a90a add r1, sp, #40 ; 0x28
  6036. while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
  6037. u8_t op = options[offset];
  6038. u8_t len;
  6039. u8_t decode_len = 0;
  6040. int decode_idx = -1;
  6041. u16_t val_offset = offset + 2;
  6042. 800a968: 9205 str r2, [sp, #20]
  6043. LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
  6044. break;
  6045. }
  6046. offset += len + 2;
  6047. if (decode_len > 0) {
  6048. u32_t value = 0;
  6049. 800a96a: 2300 movs r3, #0
  6050. /**
  6051. * If an incoming DHCP message is in response to us, then trigger the state machine
  6052. */
  6053. static void
  6054. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  6055. 800a96c: 4a4b ldr r2, [pc, #300] ; (800aa9c <dhcp_recv+0x2d0>)
  6056. LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
  6057. break;
  6058. }
  6059. offset += len + 2;
  6060. if (decode_len > 0) {
  6061. u32_t value = 0;
  6062. 800a96e: f841 3d04 str.w r3, [r1, #-4]!
  6063. /**
  6064. * If an incoming DHCP message is in response to us, then trigger the state machine
  6065. */
  6066. static void
  6067. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  6068. 800a972: eb02 0284 add.w r2, r2, r4, lsl #2
  6069. LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
  6070. break;
  6071. }
  6072. offset += len + 2;
  6073. if (decode_len > 0) {
  6074. u32_t value = 0;
  6075. 800a976: 9104 str r1, [sp, #16]
  6076. /**
  6077. * If an incoming DHCP message is in response to us, then trigger the state machine
  6078. */
  6079. static void
  6080. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  6081. 800a978: 9206 str r2, [sp, #24]
  6082. 800a97a: 9302 str r3, [sp, #8]
  6083. 800a97c: 9805 ldr r0, [sp, #20]
  6084. 800a97e: 9902 ldr r1, [sp, #8]
  6085. if (decode_len > 0) {
  6086. u32_t value = 0;
  6087. u16_t copy_len;
  6088. decode_next:
  6089. LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
  6090. if (!dhcp_option_given(dhcp, decode_idx)) {
  6091. 800a980: 4a45 ldr r2, [pc, #276] ; (800aa98 <dhcp_recv+0x2cc>)
  6092. /**
  6093. * If an incoming DHCP message is in response to us, then trigger the state machine
  6094. */
  6095. static void
  6096. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  6097. 800a982: 1843 adds r3, r0, r1
  6098. if (decode_len > 0) {
  6099. u32_t value = 0;
  6100. u16_t copy_len;
  6101. decode_next:
  6102. LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
  6103. if (!dhcp_option_given(dhcp, decode_idx)) {
  6104. 800a984: 4844 ldr r0, [pc, #272] ; (800aa98 <dhcp_recv+0x2cc>)
  6105. 800a986: 18a2 adds r2, r4, r2
  6106. 800a988: 9207 str r2, [sp, #28]
  6107. 800a98a: 5c22 ldrb r2, [r4, r0]
  6108. /**
  6109. * If an incoming DHCP message is in response to us, then trigger the state machine
  6110. */
  6111. static void
  6112. dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
  6113. 800a98c: ebc1 0c06 rsb ip, r1, r6
  6114. 800a990: b29b uxth r3, r3
  6115. 800a992: fa5f fc8c uxtb.w ip, ip
  6116. if (decode_len > 0) {
  6117. u32_t value = 0;
  6118. u16_t copy_len;
  6119. decode_next:
  6120. LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
  6121. if (!dhcp_option_given(dhcp, decode_idx)) {
  6122. 800a996: 2a00 cmp r2, #0
  6123. 800a998: d133 bne.n 800aa02 <dhcp_recv+0x236>
  6124. copy_len = LWIP_MIN(decode_len, 4);
  6125. pbuf_copy_partial(q, &value, copy_len, val_offset);
  6126. 800a99a: f1bc 0f03 cmp.w ip, #3
  6127. 800a99e: bf94 ite ls
  6128. 800a9a0: 4662 movls r2, ip
  6129. 800a9a2: 2204 movhi r2, #4
  6130. 800a9a4: 4638 mov r0, r7
  6131. 800a9a6: 9904 ldr r1, [sp, #16]
  6132. 800a9a8: f8cd c000 str.w ip, [sp]
  6133. 800a9ac: f000 fed4 bl 800b758 <pbuf_copy_partial>
  6134. if (decode_len > 4) {
  6135. 800a9b0: f8dd c000 ldr.w ip, [sp]
  6136. 800a9b4: f1bc 0f04 cmp.w ip, #4
  6137. 800a9b8: d90f bls.n 800a9da <dhcp_recv+0x20e>
  6138. /* decode more than one u32_t */
  6139. LWIP_ERROR("decode_len % 4 == 0", decode_len % 4 == 0, return ERR_VAL;);
  6140. 800a9ba: f01c 0f03 tst.w ip, #3
  6141. 800a9be: f040 80ca bne.w 800ab56 <dhcp_recv+0x38a>
  6142. dhcp_got_option(dhcp, decode_idx);
  6143. 800a9c2: 9907 ldr r1, [sp, #28]
  6144. dhcp_set_option_value(dhcp, decode_idx, htonl(value));
  6145. 800a9c4: 9809 ldr r0, [sp, #36] ; 0x24
  6146. copy_len = LWIP_MIN(decode_len, 4);
  6147. pbuf_copy_partial(q, &value, copy_len, val_offset);
  6148. if (decode_len > 4) {
  6149. /* decode more than one u32_t */
  6150. LWIP_ERROR("decode_len % 4 == 0", decode_len % 4 == 0, return ERR_VAL;);
  6151. dhcp_got_option(dhcp, decode_idx);
  6152. 800a9c6: 2201 movs r2, #1
  6153. 800a9c8: 700a strb r2, [r1, #0]
  6154. dhcp_set_option_value(dhcp, decode_idx, htonl(value));
  6155. 800a9ca: f7ff fc18 bl 800a1fe <lwip_htonl>
  6156. 800a9ce: 9b02 ldr r3, [sp, #8]
  6157. 800a9d0: 9906 ldr r1, [sp, #24]
  6158. decode_len -= 4;
  6159. val_offset += 4;
  6160. decode_idx++;
  6161. 800a9d2: 3401 adds r4, #1
  6162. pbuf_copy_partial(q, &value, copy_len, val_offset);
  6163. if (decode_len > 4) {
  6164. /* decode more than one u32_t */
  6165. LWIP_ERROR("decode_len % 4 == 0", decode_len % 4 == 0, return ERR_VAL;);
  6166. dhcp_got_option(dhcp, decode_idx);
  6167. dhcp_set_option_value(dhcp, decode_idx, htonl(value));
  6168. 800a9d4: 50c8 str r0, [r1, r3]
  6169. 800a9d6: 3304 adds r3, #4
  6170. 800a9d8: e7cf b.n 800a97a <dhcp_recv+0x1ae>
  6171. decode_len -= 4;
  6172. val_offset += 4;
  6173. decode_idx++;
  6174. goto decode_next;
  6175. } else if (decode_len == 4) {
  6176. 800a9da: d104 bne.n 800a9e6 <dhcp_recv+0x21a>
  6177. value = ntohl(value);
  6178. 800a9dc: 9809 ldr r0, [sp, #36] ; 0x24
  6179. 800a9de: f7ff fc10 bl 800a202 <lwip_ntohl>
  6180. 800a9e2: 9009 str r0, [sp, #36] ; 0x24
  6181. 800a9e4: e006 b.n 800a9f4 <dhcp_recv+0x228>
  6182. } else {
  6183. LWIP_ERROR("invalid decode_len", decode_len == 1, return ERR_VAL;);
  6184. 800a9e6: f1bc 0f01 cmp.w ip, #1
  6185. 800a9ea: f040 80b4 bne.w 800ab56 <dhcp_recv+0x38a>
  6186. value = ((u8_t*)&value)[0];
  6187. 800a9ee: f89d 3024 ldrb.w r3, [sp, #36] ; 0x24
  6188. 800a9f2: 9309 str r3, [sp, #36] ; 0x24
  6189. }
  6190. dhcp_got_option(dhcp, decode_idx);
  6191. 800a9f4: 4a28 ldr r2, [pc, #160] ; (800aa98 <dhcp_recv+0x2cc>)
  6192. dhcp_set_option_value(dhcp, decode_idx, value);
  6193. 800a9f6: 4829 ldr r0, [pc, #164] ; (800aa9c <dhcp_recv+0x2d0>)
  6194. value = ntohl(value);
  6195. } else {
  6196. LWIP_ERROR("invalid decode_len", decode_len == 1, return ERR_VAL;);
  6197. value = ((u8_t*)&value)[0];
  6198. }
  6199. dhcp_got_option(dhcp, decode_idx);
  6200. 800a9f8: 2301 movs r3, #1
  6201. 800a9fa: 5513 strb r3, [r2, r4]
  6202. dhcp_set_option_value(dhcp, decode_idx, value);
  6203. 800a9fc: 9b09 ldr r3, [sp, #36] ; 0x24
  6204. 800a9fe: f840 3024 str.w r3, [r0, r4, lsl #2]
  6205. }
  6206. }
  6207. if (offset >= q->len) {
  6208. 800aa02: 897b ldrh r3, [r7, #10]
  6209. 800aa04: 9901 ldr r1, [sp, #4]
  6210. 800aa06: 4299 cmp r1, r3
  6211. 800aa08: d30f bcc.n 800aa2a <dhcp_recv+0x25e>
  6212. offset -= q->len;
  6213. 800aa0a: 1aca subs r2, r1, r3
  6214. offset_max -= q->len;
  6215. 800aa0c: ebc3 0909 rsb r9, r3, r9
  6216. dhcp_got_option(dhcp, decode_idx);
  6217. dhcp_set_option_value(dhcp, decode_idx, value);
  6218. }
  6219. }
  6220. if (offset >= q->len) {
  6221. offset -= q->len;
  6222. 800aa10: b292 uxth r2, r2
  6223. offset_max -= q->len;
  6224. 800aa12: fa1f f989 uxth.w r9, r9
  6225. if ((offset < offset_max) && offset_max) {
  6226. 800aa16: 454a cmp r2, r9
  6227. dhcp_got_option(dhcp, decode_idx);
  6228. dhcp_set_option_value(dhcp, decode_idx, value);
  6229. }
  6230. }
  6231. if (offset >= q->len) {
  6232. offset -= q->len;
  6233. 800aa18: 9201 str r2, [sp, #4]
  6234. offset_max -= q->len;
  6235. if ((offset < offset_max) && offset_max) {
  6236. 800aa1a: d303 bcc.n 800aa24 <dhcp_recv+0x258>
  6237. break;
  6238. }
  6239. }
  6240. }
  6241. /* is this an overloaded message? */
  6242. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
  6243. 800aa1c: 4a1e ldr r2, [pc, #120] ; (800aa98 <dhcp_recv+0x2cc>)
  6244. 800aa1e: 7813 ldrb r3, [r2, #0]
  6245. 800aa20: b963 cbnz r3, 800aa3c <dhcp_recv+0x270>
  6246. 800aa22: e09f b.n 800ab64 <dhcp_recv+0x398>
  6247. }
  6248. if (offset >= q->len) {
  6249. offset -= q->len;
  6250. offset_max -= q->len;
  6251. if ((offset < offset_max) && offset_max) {
  6252. q = q->next;
  6253. 800aa24: 683f ldr r7, [r7, #0]
  6254. LWIP_ASSERT("next pbuf was null", q);
  6255. options = (u8_t*)q->payload;
  6256. 800aa26: 687b ldr r3, [r7, #4]
  6257. 800aa28: 9303 str r3, [sp, #12]
  6258. u32_t value = 0;
  6259. u16_t copy_len;
  6260. decode_next:
  6261. LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
  6262. if (!dhcp_option_given(dhcp, decode_idx)) {
  6263. copy_len = LWIP_MIN(decode_len, 4);
  6264. 800aa2a: 9a01 ldr r2, [sp, #4]
  6265. }
  6266. offset = options_idx;
  6267. offset_max = options_idx_max;
  6268. options = (u8_t*)q->payload;
  6269. /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
  6270. while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
  6271. 800aa2c: 9803 ldr r0, [sp, #12]
  6272. 800aa2e: 5c81 ldrb r1, [r0, r2]
  6273. 800aa30: 29ff cmp r1, #255 ; 0xff
  6274. 800aa32: d0f3 beq.n 800aa1c <dhcp_recv+0x250>
  6275. 800aa34: 454a cmp r2, r9
  6276. 800aa36: f4ff af1d bcc.w 800a874 <dhcp_recv+0xa8>
  6277. 800aa3a: e7ef b.n 800aa1c <dhcp_recv+0x250>
  6278. }
  6279. }
  6280. }
  6281. /* is this an overloaded message? */
  6282. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
  6283. u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD);
  6284. 800aa3c: 4b17 ldr r3, [pc, #92] ; (800aa9c <dhcp_recv+0x2d0>)
  6285. dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD);
  6286. 800aa3e: 4916 ldr r1, [pc, #88] ; (800aa98 <dhcp_recv+0x2cc>)
  6287. }
  6288. }
  6289. }
  6290. /* is this an overloaded message? */
  6291. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
  6292. u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD);
  6293. 800aa40: 681b ldr r3, [r3, #0]
  6294. dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD);
  6295. 800aa42: 2200 movs r2, #0
  6296. if (overload == DHCP_OVERLOAD_FILE) {
  6297. 800aa44: 2b01 cmp r3, #1
  6298. }
  6299. }
  6300. /* is this an overloaded message? */
  6301. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
  6302. u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD);
  6303. dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD);
  6304. 800aa46: 700a strb r2, [r1, #0]
  6305. if (overload == DHCP_OVERLOAD_FILE) {
  6306. 800aa48: f000 8093 beq.w 800ab72 <dhcp_recv+0x3a6>
  6307. parse_file_as_options = 1;
  6308. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded file field\n"));
  6309. } else if (overload == DHCP_OVERLOAD_SNAME) {
  6310. 800aa4c: 2b02 cmp r3, #2
  6311. 800aa4e: f43f aefa beq.w 800a846 <dhcp_recv+0x7a>
  6312. parse_sname_as_options = 1;
  6313. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname field\n"));
  6314. } else if (overload == DHCP_OVERLOAD_SNAME_FILE) {
  6315. 800aa52: 2b03 cmp r3, #3
  6316. 800aa54: f040 8086 bne.w 800ab64 <dhcp_recv+0x398>
  6317. 800aa58: e089 b.n 800ab6e <dhcp_recv+0x3a2>
  6318. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP_OPTION_MESSAGE_TYPE option not found\n"));
  6319. goto free_pbuf_and_return;
  6320. }
  6321. /* read DHCP message type */
  6322. msg_type = (u8_t)dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_MSG_TYPE);
  6323. 800aa5a: 4a10 ldr r2, [pc, #64] ; (800aa9c <dhcp_recv+0x2d0>)
  6324. 800aa5c: 7911 ldrb r1, [r2, #4]
  6325. /* message type is DHCP ACK? */
  6326. if (msg_type == DHCP_ACK) {
  6327. 800aa5e: 2905 cmp r1, #5
  6328. 800aa60: d140 bne.n 800aae4 <dhcp_recv+0x318>
  6329. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_ACK received\n"));
  6330. /* in requesting state? */
  6331. if (dhcp->state == DHCP_REQUESTING) {
  6332. 800aa62: f898 100c ldrb.w r1, [r8, #12]
  6333. 800aa66: 2901 cmp r1, #1
  6334. 800aa68: d135 bne.n 800aad6 <dhcp_recv+0x30a>
  6335. * @param netif the netif under DHCP control
  6336. */
  6337. static void
  6338. dhcp_handle_ack(struct netif *netif)
  6339. {
  6340. struct dhcp *dhcp = netif->dhcp;
  6341. 800aa6a: 6a2c ldr r4, [r5, #32]
  6342. #if LWIP_DHCP_BOOTP_FILE
  6343. ip_addr_set_zero(&dhcp->offered_si_addr);
  6344. #endif /* LWIP_DHCP_BOOTP_FILE */
  6345. /* lease time given? */
  6346. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_LEASE_TIME)) {
  6347. 800aa6c: 78db ldrb r3, [r3, #3]
  6348. #if LWIP_DNS
  6349. u8_t n;
  6350. #endif /* LWIP_DNS */
  6351. /* clear options we might not get from the ACK */
  6352. ip_addr_set_zero(&dhcp->offered_sn_mask);
  6353. 800aa6e: f8c4 b028 str.w fp, [r4, #40] ; 0x28
  6354. ip_addr_set_zero(&dhcp->offered_gw_addr);
  6355. 800aa72: f8c4 b02c str.w fp, [r4, #44] ; 0x2c
  6356. #if LWIP_DHCP_BOOTP_FILE
  6357. ip_addr_set_zero(&dhcp->offered_si_addr);
  6358. #endif /* LWIP_DHCP_BOOTP_FILE */
  6359. /* lease time given? */
  6360. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_LEASE_TIME)) {
  6361. 800aa76: b10b cbz r3, 800aa7c <dhcp_recv+0x2b0>
  6362. /* remember offered lease time */
  6363. dhcp->offered_t0_lease = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_LEASE_TIME);
  6364. 800aa78: 68d3 ldr r3, [r2, #12]
  6365. 800aa7a: 6323 str r3, [r4, #48] ; 0x30
  6366. }
  6367. /* renewal period given? */
  6368. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T1)) {
  6369. 800aa7c: 4b06 ldr r3, [pc, #24] ; (800aa98 <dhcp_recv+0x2cc>)
  6370. 800aa7e: 791a ldrb r2, [r3, #4]
  6371. 800aa80: b112 cbz r2, 800aa88 <dhcp_recv+0x2bc>
  6372. /* remember given renewal period */
  6373. dhcp->offered_t1_renew = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T1);
  6374. 800aa82: 4a06 ldr r2, [pc, #24] ; (800aa9c <dhcp_recv+0x2d0>)
  6375. 800aa84: 6912 ldr r2, [r2, #16]
  6376. 800aa86: e001 b.n 800aa8c <dhcp_recv+0x2c0>
  6377. } else {
  6378. /* calculate safe periods for renewal */
  6379. dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2;
  6380. 800aa88: 6b22 ldr r2, [r4, #48] ; 0x30
  6381. 800aa8a: 0852 lsrs r2, r2, #1
  6382. }
  6383. /* renewal period given? */
  6384. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T2)) {
  6385. 800aa8c: 795b ldrb r3, [r3, #5]
  6386. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T1)) {
  6387. /* remember given renewal period */
  6388. dhcp->offered_t1_renew = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T1);
  6389. } else {
  6390. /* calculate safe periods for renewal */
  6391. dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2;
  6392. 800aa8e: 6362 str r2, [r4, #52] ; 0x34
  6393. }
  6394. /* renewal period given? */
  6395. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T2)) {
  6396. 800aa90: b133 cbz r3, 800aaa0 <dhcp_recv+0x2d4>
  6397. /* remember given rebind period */
  6398. dhcp->offered_t2_rebind = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T2);
  6399. 800aa92: 4b02 ldr r3, [pc, #8] ; (800aa9c <dhcp_recv+0x2d0>)
  6400. 800aa94: 695b ldr r3, [r3, #20]
  6401. 800aa96: e004 b.n 800aaa2 <dhcp_recv+0x2d6>
  6402. 800aa98: 20006dd0 .word 0x20006dd0
  6403. 800aa9c: 20006ddc .word 0x20006ddc
  6404. } else {
  6405. /* calculate safe periods for rebinding */
  6406. dhcp->offered_t2_rebind = dhcp->offered_t0_lease;
  6407. 800aaa0: 6b23 ldr r3, [r4, #48] ; 0x30
  6408. 800aaa2: 63a3 str r3, [r4, #56] ; 0x38
  6409. }
  6410. /* (y)our internet address */
  6411. ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
  6412. 800aaa4: 68a3 ldr r3, [r4, #8]
  6413. boot file name copied in dhcp_parse_reply if not overloaded */
  6414. ip_addr_copy(dhcp->offered_si_addr, dhcp->msg_in->siaddr);
  6415. #endif /* LWIP_DHCP_BOOTP_FILE */
  6416. /* subnet mask given? */
  6417. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
  6418. 800aaa6: 4a39 ldr r2, [pc, #228] ; (800ab8c <dhcp_recv+0x3c0>)
  6419. /* calculate safe periods for rebinding */
  6420. dhcp->offered_t2_rebind = dhcp->offered_t0_lease;
  6421. }
  6422. /* (y)our internet address */
  6423. ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
  6424. 800aaa8: 691b ldr r3, [r3, #16]
  6425. 800aaaa: 6263 str r3, [r4, #36] ; 0x24
  6426. boot file name copied in dhcp_parse_reply if not overloaded */
  6427. ip_addr_copy(dhcp->offered_si_addr, dhcp->msg_in->siaddr);
  6428. #endif /* LWIP_DHCP_BOOTP_FILE */
  6429. /* subnet mask given? */
  6430. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
  6431. 800aaac: 7993 ldrb r3, [r2, #6]
  6432. 800aaae: 4616 mov r6, r2
  6433. 800aab0: b12b cbz r3, 800aabe <dhcp_recv+0x2f2>
  6434. /* remember given subnet mask */
  6435. ip4_addr_set_u32(&dhcp->offered_sn_mask, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)));
  6436. 800aab2: 4b37 ldr r3, [pc, #220] ; (800ab90 <dhcp_recv+0x3c4>)
  6437. 800aab4: 6998 ldr r0, [r3, #24]
  6438. 800aab6: f7ff fba2 bl 800a1fe <lwip_htonl>
  6439. dhcp->subnet_mask_given = 1;
  6440. 800aaba: 2301 movs r3, #1
  6441. #endif /* LWIP_DHCP_BOOTP_FILE */
  6442. /* subnet mask given? */
  6443. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
  6444. /* remember given subnet mask */
  6445. ip4_addr_set_u32(&dhcp->offered_sn_mask, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)));
  6446. 800aabc: 62a0 str r0, [r4, #40] ; 0x28
  6447. dhcp->subnet_mask_given = 1;
  6448. } else {
  6449. dhcp->subnet_mask_given = 0;
  6450. 800aabe: 73a3 strb r3, [r4, #14]
  6451. }
  6452. /* gateway router */
  6453. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) {
  6454. 800aac0: 79f3 ldrb r3, [r6, #7]
  6455. 800aac2: b123 cbz r3, 800aace <dhcp_recv+0x302>
  6456. ip4_addr_set_u32(&dhcp->offered_gw_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER)));
  6457. 800aac4: 4b32 ldr r3, [pc, #200] ; (800ab90 <dhcp_recv+0x3c4>)
  6458. 800aac6: 69d8 ldr r0, [r3, #28]
  6459. 800aac8: f7ff fb99 bl 800a1fe <lwip_htonl>
  6460. 800aacc: 62e0 str r0, [r4, #44] ; 0x2c
  6461. /* in requesting state? */
  6462. if (dhcp->state == DHCP_REQUESTING) {
  6463. dhcp_handle_ack(netif);
  6464. #if DHCP_DOES_ARP_CHECK
  6465. /* check if the acknowledged lease address is already in use */
  6466. dhcp_check(netif);
  6467. 800aace: 4628 mov r0, r5
  6468. 800aad0: f7ff fe0a bl 800a6e8 <dhcp_check>
  6469. 800aad4: e03f b.n 800ab56 <dhcp_recv+0x38a>
  6470. /* bind interface to the acknowledged lease address */
  6471. dhcp_bind(netif);
  6472. #endif
  6473. }
  6474. /* already bound to the given lease address? */
  6475. else if ((dhcp->state == DHCP_REBOOTING) || (dhcp->state == DHCP_REBINDING) || (dhcp->state == DHCP_RENEWING)) {
  6476. 800aad6: 3903 subs r1, #3
  6477. 800aad8: 2902 cmp r1, #2
  6478. 800aada: d83c bhi.n 800ab56 <dhcp_recv+0x38a>
  6479. dhcp_bind(netif);
  6480. 800aadc: 4628 mov r0, r5
  6481. 800aade: f7ff fe16 bl 800a70e <dhcp_bind>
  6482. 800aae2: e038 b.n 800ab56 <dhcp_recv+0x38a>
  6483. }
  6484. }
  6485. /* received a DHCP_NAK in appropriate state? */
  6486. else if ((msg_type == DHCP_NAK) &&
  6487. 800aae4: 2906 cmp r1, #6
  6488. 800aae6: d121 bne.n 800ab2c <dhcp_recv+0x360>
  6489. 800aae8: f898 300c ldrb.w r3, [r8, #12]
  6490. 800aaec: 2b05 cmp r3, #5
  6491. 800aaee: d832 bhi.n 800ab56 <dhcp_recv+0x38a>
  6492. 800aaf0: f998 300c ldrsb.w r3, [r8, #12]
  6493. 800aaf4: f04f 42b8 mov.w r2, #1543503872 ; 0x5c000000
  6494. 800aaf8: 409a lsls r2, r3
  6495. 800aafa: d52c bpl.n 800ab56 <dhcp_recv+0x38a>
  6496. {
  6497. struct dhcp *dhcp = netif->dhcp;
  6498. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
  6499. (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  6500. /* Set the interface down since the address must no longer be used, as per RFC2131 */
  6501. netif_set_down(netif);
  6502. 800aafc: 4628 mov r0, r5
  6503. * @param netif the netif under DHCP control
  6504. */
  6505. static void
  6506. dhcp_handle_nak(struct netif *netif)
  6507. {
  6508. struct dhcp *dhcp = netif->dhcp;
  6509. 800aafe: 6a2c ldr r4, [r5, #32]
  6510. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
  6511. (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  6512. /* Set the interface down since the address must no longer be used, as per RFC2131 */
  6513. netif_set_down(netif);
  6514. 800ab00: f000 fc7e bl 800b400 <netif_set_down>
  6515. /* remove IP address from interface */
  6516. netif_set_ipaddr(netif, IP_ADDR_ANY);
  6517. 800ab04: 4628 mov r0, r5
  6518. 800ab06: 4923 ldr r1, [pc, #140] ; (800ab94 <dhcp_recv+0x3c8>)
  6519. 800ab08: f000 fbfc bl 800b304 <netif_set_ipaddr>
  6520. netif_set_gw(netif, IP_ADDR_ANY);
  6521. 800ab0c: 4628 mov r0, r5
  6522. 800ab0e: 4921 ldr r1, [pc, #132] ; (800ab94 <dhcp_recv+0x3c8>)
  6523. 800ab10: f000 fc58 bl 800b3c4 <netif_set_gw>
  6524. netif_set_netmask(netif, IP_ADDR_ANY);
  6525. 800ab14: 4628 mov r0, r5
  6526. 800ab16: 491f ldr r1, [pc, #124] ; (800ab94 <dhcp_recv+0x3c8>)
  6527. 800ab18: f000 fc58 bl 800b3cc <netif_set_netmask>
  6528. /* Change to a defined state */
  6529. dhcp_set_state(dhcp, DHCP_BACKING_OFF);
  6530. 800ab1c: 4620 mov r0, r4
  6531. 800ab1e: 210c movs r1, #12
  6532. 800ab20: f7ff fb71 bl 800a206 <dhcp_set_state>
  6533. /* We can immediately restart discovery */
  6534. dhcp_discover(netif);
  6535. 800ab24: 4628 mov r0, r5
  6536. 800ab26: f7ff fc7f bl 800a428 <dhcp_discover>
  6537. 800ab2a: e014 b.n 800ab56 <dhcp_recv+0x38a>
  6538. (dhcp->state == DHCP_REBINDING) || (dhcp->state == DHCP_RENEWING ))) {
  6539. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_NAK received\n"));
  6540. dhcp_handle_nak(netif);
  6541. }
  6542. /* received a DHCP_OFFER in DHCP_SELECTING state? */
  6543. else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_SELECTING)) {
  6544. 800ab2c: 2902 cmp r1, #2
  6545. 800ab2e: d112 bne.n 800ab56 <dhcp_recv+0x38a>
  6546. 800ab30: f898 100c ldrb.w r1, [r8, #12]
  6547. 800ab34: 2906 cmp r1, #6
  6548. 800ab36: d10e bne.n 800ab56 <dhcp_recv+0x38a>
  6549. {
  6550. struct dhcp *dhcp = netif->dhcp;
  6551. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
  6552. (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  6553. /* obtain the server address */
  6554. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
  6555. 800ab38: 789b ldrb r3, [r3, #2]
  6556. dhcp_handle_nak(netif);
  6557. }
  6558. /* received a DHCP_OFFER in DHCP_SELECTING state? */
  6559. else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_SELECTING)) {
  6560. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_OFFER received in DHCP_SELECTING state\n"));
  6561. dhcp->request_timeout = 0;
  6562. 800ab3a: f8a8 b01a strh.w fp, [r8, #26]
  6563. * @param netif the netif under DHCP control
  6564. */
  6565. static void
  6566. dhcp_handle_offer(struct netif *netif)
  6567. {
  6568. struct dhcp *dhcp = netif->dhcp;
  6569. 800ab3e: 6a2c ldr r4, [r5, #32]
  6570. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
  6571. (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  6572. /* obtain the server address */
  6573. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
  6574. 800ab40: b14b cbz r3, 800ab56 <dhcp_recv+0x38a>
  6575. ip4_addr_set_u32(&dhcp->server_ip_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID)));
  6576. 800ab42: 6890 ldr r0, [r2, #8]
  6577. 800ab44: f7ff fb5b bl 800a1fe <lwip_htonl>
  6578. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n",
  6579. ip4_addr_get_u32(&dhcp->server_ip_addr)));
  6580. /* remember offered address */
  6581. ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
  6582. 800ab48: 68a3 ldr r3, [r4, #8]
  6583. struct dhcp *dhcp = netif->dhcp;
  6584. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
  6585. (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  6586. /* obtain the server address */
  6587. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
  6588. ip4_addr_set_u32(&dhcp->server_ip_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID)));
  6589. 800ab4a: 6220 str r0, [r4, #32]
  6590. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n",
  6591. ip4_addr_get_u32(&dhcp->server_ip_addr)));
  6592. /* remember offered address */
  6593. ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
  6594. 800ab4c: 691b ldr r3, [r3, #16]
  6595. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n",
  6596. ip4_addr_get_u32(&dhcp->offered_ip_addr)));
  6597. dhcp_select(netif);
  6598. 800ab4e: 4628 mov r0, r5
  6599. if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
  6600. ip4_addr_set_u32(&dhcp->server_ip_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID)));
  6601. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n",
  6602. ip4_addr_get_u32(&dhcp->server_ip_addr)));
  6603. /* remember offered address */
  6604. ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
  6605. 800ab50: 6263 str r3, [r4, #36] ; 0x24
  6606. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n",
  6607. ip4_addr_get_u32(&dhcp->offered_ip_addr)));
  6608. dhcp_select(netif);
  6609. 800ab52: f7ff fd57 bl 800a604 <dhcp_select>
  6610. dhcp->request_timeout = 0;
  6611. /* remember offered lease */
  6612. dhcp_handle_offer(netif);
  6613. }
  6614. free_pbuf_and_return:
  6615. dhcp->msg_in = NULL;
  6616. 800ab56: 2300 movs r3, #0
  6617. 800ab58: f8c8 3008 str.w r3, [r8, #8]
  6618. pbuf_free(p);
  6619. 800ab5c: 4650 mov r0, sl
  6620. 800ab5e: f000 fcb1 bl 800b4c4 <pbuf_free>
  6621. 800ab62: e010 b.n 800ab86 <dhcp_recv+0x3ba>
  6622. /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */
  6623. parse_file_as_options = 0;
  6624. options_idx = DHCP_FILE_OFS;
  6625. options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
  6626. goto again;
  6627. } else if (parse_sname_as_options) {
  6628. 800ab64: f1bb 0f00 cmp.w fp, #0
  6629. 800ab68: f47f ae6d bne.w 800a846 <dhcp_recv+0x7a>
  6630. 800ab6c: e005 b.n 800ab7a <dhcp_recv+0x3ae>
  6631. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded file field\n"));
  6632. } else if (overload == DHCP_OVERLOAD_SNAME) {
  6633. parse_sname_as_options = 1;
  6634. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname field\n"));
  6635. } else if (overload == DHCP_OVERLOAD_SNAME_FILE) {
  6636. parse_sname_as_options = 1;
  6637. 800ab6e: f04f 0b01 mov.w fp, #1
  6638. }
  6639. if (parse_file_as_options) {
  6640. /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */
  6641. parse_file_as_options = 0;
  6642. options_idx = DHCP_FILE_OFS;
  6643. options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
  6644. 800ab72: f04f 09ec mov.w r9, #236 ; 0xec
  6645. #endif /* LWIP_DHCP_BOOTP_FILE */
  6646. }
  6647. if (parse_file_as_options) {
  6648. /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */
  6649. parse_file_as_options = 0;
  6650. options_idx = DHCP_FILE_OFS;
  6651. 800ab76: 226c movs r2, #108 ; 0x6c
  6652. 800ab78: e66a b.n 800a850 <dhcp_recv+0x84>
  6653. goto free_pbuf_and_return;
  6654. }
  6655. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("searching DHCP_OPTION_MESSAGE_TYPE\n"));
  6656. /* obtain pointer to DHCP message type */
  6657. if (!dhcp_option_given(dhcp, DHCP_OPTION_IDX_MSG_TYPE)) {
  6658. 800ab7a: 4b04 ldr r3, [pc, #16] ; (800ab8c <dhcp_recv+0x3c0>)
  6659. 800ab7c: 785a ldrb r2, [r3, #1]
  6660. 800ab7e: 2a00 cmp r2, #0
  6661. 800ab80: f47f af6b bne.w 800aa5a <dhcp_recv+0x28e>
  6662. 800ab84: e7e7 b.n 800ab56 <dhcp_recv+0x38a>
  6663. dhcp_handle_offer(netif);
  6664. }
  6665. free_pbuf_and_return:
  6666. dhcp->msg_in = NULL;
  6667. pbuf_free(p);
  6668. }
  6669. 800ab86: b00b add sp, #44 ; 0x2c
  6670. 800ab88: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  6671. 800ab8c: 20006dd0 .word 0x20006dd0
  6672. 800ab90: 20006ddc .word 0x20006ddc
  6673. 800ab94: 08011880 .word 0x08011880
  6674. 0800ab98 <dhcp_arp_reply>:
  6675. *
  6676. * @param netif the network interface on which the reply was received
  6677. * @param addr The IP address we received a reply from
  6678. */
  6679. void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr)
  6680. {
  6681. 800ab98: b537 push {r0, r1, r2, r4, r5, lr}
  6682. LWIP_ERROR("netif != NULL", (netif != NULL), return;);
  6683. 800ab9a: 4605 mov r5, r0
  6684. 800ab9c: 2800 cmp r0, #0
  6685. 800ab9e: d037 beq.n 800ac10 <dhcp_arp_reply+0x78>
  6686. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_arp_reply()\n"));
  6687. /* is a DHCP client doing an ARP check? */
  6688. if ((netif->dhcp != NULL) && (netif->dhcp->state == DHCP_CHECKING)) {
  6689. 800aba0: 6a04 ldr r4, [r0, #32]
  6690. 800aba2: 2c00 cmp r4, #0
  6691. 800aba4: d034 beq.n 800ac10 <dhcp_arp_reply+0x78>
  6692. 800aba6: 7b23 ldrb r3, [r4, #12]
  6693. 800aba8: 2b08 cmp r3, #8
  6694. 800abaa: d131 bne.n 800ac10 <dhcp_arp_reply+0x78>
  6695. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_arp_reply(): CHECKING, arp reply for 0x%08"X32_F"\n",
  6696. ip4_addr_get_u32(addr)));
  6697. /* did a host respond with the address we
  6698. were offered by the DHCP server? */
  6699. if (ip_addr_cmp(addr, &netif->dhcp->offered_ip_addr)) {
  6700. 800abac: 680a ldr r2, [r1, #0]
  6701. 800abae: 6a63 ldr r3, [r4, #36] ; 0x24
  6702. 800abb0: 429a cmp r2, r3
  6703. 800abb2: d12d bne.n 800ac10 <dhcp_arp_reply+0x78>
  6704. {
  6705. struct dhcp *dhcp = netif->dhcp;
  6706. err_t result = ERR_OK;
  6707. u16_t msecs;
  6708. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_decline()\n"));
  6709. dhcp_set_state(dhcp, DHCP_BACKING_OFF);
  6710. 800abb4: 4620 mov r0, r4
  6711. 800abb6: 210c movs r1, #12
  6712. 800abb8: f7ff fb25 bl 800a206 <dhcp_set_state>
  6713. /* create and initialize the DHCP message header */
  6714. result = dhcp_create_msg(netif, dhcp, DHCP_DECLINE);
  6715. 800abbc: 4628 mov r0, r5
  6716. 800abbe: 4621 mov r1, r4
  6717. 800abc0: 2204 movs r2, #4
  6718. 800abc2: f7ff fb85 bl 800a2d0 <dhcp_create_msg>
  6719. if (result == ERR_OK) {
  6720. 800abc6: b9f0 cbnz r0, 800ac06 <dhcp_arp_reply+0x6e>
  6721. dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
  6722. 800abc8: 2204 movs r2, #4
  6723. 800abca: 2132 movs r1, #50 ; 0x32
  6724. 800abcc: 4620 mov r0, r4
  6725. 800abce: f7ff fb22 bl 800a216 <dhcp_option>
  6726. dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr)));
  6727. 800abd2: 6a60 ldr r0, [r4, #36] ; 0x24
  6728. 800abd4: f7ff fb15 bl 800a202 <lwip_ntohl>
  6729. 800abd8: 4601 mov r1, r0
  6730. 800abda: 4620 mov r0, r4
  6731. 800abdc: f7ff fb42 bl 800a264 <dhcp_option_long>
  6732. dhcp_option_trailer(dhcp);
  6733. 800abe0: 4620 mov r0, r4
  6734. 800abe2: f7ff fb5f bl 800a2a4 <dhcp_option_trailer>
  6735. /* resize pbuf to reflect true size of options */
  6736. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  6737. 800abe6: 8b21 ldrh r1, [r4, #24]
  6738. 800abe8: 6920 ldr r0, [r4, #16]
  6739. 800abea: 31f0 adds r1, #240 ; 0xf0
  6740. 800abec: b289 uxth r1, r1
  6741. 800abee: f000 fc94 bl 800b51a <pbuf_realloc>
  6742. /* per section 4.4.4, broadcast DECLINE messages */
  6743. udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
  6744. 800abf2: 9500 str r5, [sp, #0]
  6745. 800abf4: 6860 ldr r0, [r4, #4]
  6746. 800abf6: 6921 ldr r1, [r4, #16]
  6747. 800abf8: 4a06 ldr r2, [pc, #24] ; (800ac14 <dhcp_arp_reply+0x7c>)
  6748. 800abfa: 2343 movs r3, #67 ; 0x43
  6749. 800abfc: f003 f9a4 bl 800df48 <udp_sendto_if>
  6750. dhcp_delete_msg(dhcp);
  6751. 800ac00: 4620 mov r0, r4
  6752. 800ac02: f7ff fc05 bl 800a410 <dhcp_delete_msg>
  6753. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_decline: BACKING OFF\n"));
  6754. } else {
  6755. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
  6756. ("dhcp_decline: could not allocate DHCP request\n"));
  6757. }
  6758. dhcp->tries++;
  6759. 800ac06: 7b63 ldrb r3, [r4, #13]
  6760. 800ac08: 3301 adds r3, #1
  6761. 800ac0a: 7363 strb r3, [r4, #13]
  6762. msecs = 10*1000;
  6763. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  6764. 800ac0c: 2314 movs r3, #20
  6765. 800ac0e: 8363 strh r3, [r4, #26]
  6766. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING,
  6767. ("dhcp_arp_reply(): arp reply matched with offered address, declining\n"));
  6768. dhcp_decline(netif);
  6769. }
  6770. }
  6771. }
  6772. 800ac10: bd3e pop {r1, r2, r3, r4, r5, pc}
  6773. 800ac12: bf00 nop
  6774. 800ac14: 0801187c .word 0x0801187c
  6775. 0800ac18 <dhcp_renew>:
  6776. *
  6777. * @param netif network interface which must renew its lease
  6778. */
  6779. err_t
  6780. dhcp_renew(struct netif *netif)
  6781. {
  6782. 800ac18: b573 push {r0, r1, r4, r5, r6, lr}
  6783. struct dhcp *dhcp = netif->dhcp;
  6784. 800ac1a: 6a04 ldr r4, [r0, #32]
  6785. *
  6786. * @param netif network interface which must renew its lease
  6787. */
  6788. err_t
  6789. dhcp_renew(struct netif *netif)
  6790. {
  6791. 800ac1c: 4605 mov r5, r0
  6792. struct dhcp *dhcp = netif->dhcp;
  6793. err_t result;
  6794. u16_t msecs;
  6795. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_renew()\n"));
  6796. dhcp_set_state(dhcp, DHCP_RENEWING);
  6797. 800ac1e: 2105 movs r1, #5
  6798. 800ac20: 4620 mov r0, r4
  6799. 800ac22: f7ff faf0 bl 800a206 <dhcp_set_state>
  6800. /* create and initialize the DHCP message header */
  6801. result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
  6802. 800ac26: 4628 mov r0, r5
  6803. 800ac28: 4621 mov r1, r4
  6804. 800ac2a: 2203 movs r2, #3
  6805. 800ac2c: f7ff fb50 bl 800a2d0 <dhcp_create_msg>
  6806. if (result == ERR_OK) {
  6807. 800ac30: 4606 mov r6, r0
  6808. 800ac32: b9e0 cbnz r0, 800ac6e <dhcp_renew+0x56>
  6809. dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
  6810. 800ac34: 2202 movs r2, #2
  6811. 800ac36: 4620 mov r0, r4
  6812. 800ac38: 2139 movs r1, #57 ; 0x39
  6813. 800ac3a: f7ff faec bl 800a216 <dhcp_option>
  6814. dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
  6815. 800ac3e: 8ca9 ldrh r1, [r5, #36] ; 0x24
  6816. 800ac40: 4620 mov r0, r4
  6817. 800ac42: f7ff faff bl 800a244 <dhcp_option_short>
  6818. #if LWIP_NETIF_HOSTNAME
  6819. dhcp_option_hostname(dhcp, netif);
  6820. #endif /* LWIP_NETIF_HOSTNAME */
  6821. /* append DHCP message trailer */
  6822. dhcp_option_trailer(dhcp);
  6823. 800ac46: 4620 mov r0, r4
  6824. 800ac48: f7ff fb2c bl 800a2a4 <dhcp_option_trailer>
  6825. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  6826. 800ac4c: 8b21 ldrh r1, [r4, #24]
  6827. 800ac4e: 6920 ldr r0, [r4, #16]
  6828. 800ac50: 31f0 adds r1, #240 ; 0xf0
  6829. 800ac52: b289 uxth r1, r1
  6830. 800ac54: f000 fc61 bl 800b51a <pbuf_realloc>
  6831. udp_sendto_if(dhcp->pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif);
  6832. 800ac58: 9500 str r5, [sp, #0]
  6833. 800ac5a: 6860 ldr r0, [r4, #4]
  6834. 800ac5c: 6921 ldr r1, [r4, #16]
  6835. 800ac5e: f104 0220 add.w r2, r4, #32
  6836. 800ac62: 2343 movs r3, #67 ; 0x43
  6837. 800ac64: f003 f970 bl 800df48 <udp_sendto_if>
  6838. dhcp_delete_msg(dhcp);
  6839. 800ac68: 4620 mov r0, r4
  6840. 800ac6a: f7ff fbd1 bl 800a410 <dhcp_delete_msg>
  6841. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n"));
  6842. } else {
  6843. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_renew: could not allocate DHCP request\n"));
  6844. }
  6845. dhcp->tries++;
  6846. 800ac6e: 7b63 ldrb r3, [r4, #13]
  6847. 800ac70: 3301 adds r3, #1
  6848. 800ac72: b2db uxtb r3, r3
  6849. /* back-off on retries, but to a maximum of 20 seconds */
  6850. msecs = dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000;
  6851. 800ac74: 2b09 cmp r3, #9
  6852. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n"));
  6853. } else {
  6854. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_renew: could not allocate DHCP request\n"));
  6855. }
  6856. dhcp->tries++;
  6857. 800ac76: 7363 strb r3, [r4, #13]
  6858. /* back-off on retries, but to a maximum of 20 seconds */
  6859. msecs = dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000;
  6860. 800ac78: d804 bhi.n 800ac84 <dhcp_renew+0x6c>
  6861. 800ac7a: f44f 62fa mov.w r2, #2000 ; 0x7d0
  6862. 800ac7e: 4353 muls r3, r2
  6863. 800ac80: b29b uxth r3, r3
  6864. 800ac82: e001 b.n 800ac88 <dhcp_renew+0x70>
  6865. 800ac84: f644 6320 movw r3, #20000 ; 0x4e20
  6866. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  6867. 800ac88: f44f 72fa mov.w r2, #500 ; 0x1f4
  6868. 800ac8c: f203 13f3 addw r3, r3, #499 ; 0x1f3
  6869. 800ac90: fb93 f3f2 sdiv r3, r3, r2
  6870. 800ac94: 8363 strh r3, [r4, #26]
  6871. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew(): set request timeout %"U16_F" msecs\n", msecs));
  6872. return result;
  6873. }
  6874. 800ac96: 4630 mov r0, r6
  6875. 800ac98: bd7c pop {r2, r3, r4, r5, r6, pc}
  6876. 800ac9a: 0000 movs r0, r0
  6877. 0800ac9c <dhcp_coarse_tmr>:
  6878. /**
  6879. * The DHCP timer that checks for lease renewal/rebind timeouts.
  6880. */
  6881. void
  6882. dhcp_coarse_tmr()
  6883. {
  6884. 800ac9c: b538 push {r3, r4, r5, lr}
  6885. struct netif *netif = netif_list;
  6886. 800ac9e: 4b15 ldr r3, [pc, #84] ; (800acf4 <dhcp_coarse_tmr+0x58>)
  6887. 800aca0: 4d15 ldr r5, [pc, #84] ; (800acf8 <dhcp_coarse_tmr+0x5c>)
  6888. 800aca2: 681c ldr r4, [r3, #0]
  6889. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n"));
  6890. /* iterate through all network interfaces */
  6891. while (netif != NULL) {
  6892. 800aca4: e023 b.n 800acee <dhcp_coarse_tmr+0x52>
  6893. /* only act on DHCP configured interfaces */
  6894. if (netif->dhcp != NULL) {
  6895. 800aca6: 6a23 ldr r3, [r4, #32]
  6896. 800aca8: b303 cbz r3, 800acec <dhcp_coarse_tmr+0x50>
  6897. /* timer is active (non zero), and triggers (zeroes) now? */
  6898. if (netif->dhcp->t2_timeout-- == 1) {
  6899. 800acaa: 8bda ldrh r2, [r3, #30]
  6900. 800acac: 1e51 subs r1, r2, #1
  6901. 800acae: 2a01 cmp r2, #1
  6902. 800acb0: 83d9 strh r1, [r3, #30]
  6903. 800acb2: d10b bne.n 800accc <dhcp_coarse_tmr+0x30>
  6904. 800acb4: 7b1a ldrb r2, [r3, #12]
  6905. 800acb6: 2a0a cmp r2, #10
  6906. 800acb8: d818 bhi.n 800acec <dhcp_coarse_tmr+0x50>
  6907. 800acba: f993 300c ldrsb.w r3, [r3, #12]
  6908. 800acbe: fa15 f303 lsls.w r3, r5, r3
  6909. 800acc2: d513 bpl.n 800acec <dhcp_coarse_tmr+0x50>
  6910. /* just retry to rebind */
  6911. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
  6912. ("dhcp_t2_timeout(): must rebind\n"));
  6913. /* This slightly different to RFC2131: DHCPREQUEST will be sent from state
  6914. DHCP_REBINDING, not DHCP_BOUND */
  6915. dhcp_rebind(netif);
  6916. 800acc4: 4620 mov r0, r4
  6917. 800acc6: f7ff fc0b bl 800a4e0 <dhcp_rebind>
  6918. 800acca: e00f b.n 800acec <dhcp_coarse_tmr+0x50>
  6919. if (netif->dhcp->t2_timeout-- == 1) {
  6920. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t2 timeout\n"));
  6921. /* this clients' rebind timeout triggered */
  6922. dhcp_t2_timeout(netif);
  6923. /* timer is active (non zero), and triggers (zeroes) now */
  6924. } else if (netif->dhcp->t1_timeout-- == 1) {
  6925. 800accc: 8b9a ldrh r2, [r3, #28]
  6926. 800acce: 1e51 subs r1, r2, #1
  6927. 800acd0: 2a01 cmp r2, #1
  6928. 800acd2: 8399 strh r1, [r3, #28]
  6929. 800acd4: d10a bne.n 800acec <dhcp_coarse_tmr+0x50>
  6930. 800acd6: 7b1a ldrb r2, [r3, #12]
  6931. 800acd8: 2a0a cmp r2, #10
  6932. 800acda: d807 bhi.n 800acec <dhcp_coarse_tmr+0x50>
  6933. 800acdc: f993 300c ldrsb.w r3, [r3, #12]
  6934. 800ace0: fa15 f303 lsls.w r3, r5, r3
  6935. 800ace4: d502 bpl.n 800acec <dhcp_coarse_tmr+0x50>
  6936. * eventually time-out if renew tries fail. */
  6937. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
  6938. ("dhcp_t1_timeout(): must renew\n"));
  6939. /* This slightly different to RFC2131: DHCPREQUEST will be sent from state
  6940. DHCP_RENEWING, not DHCP_BOUND */
  6941. dhcp_renew(netif);
  6942. 800ace6: 4620 mov r0, r4
  6943. 800ace8: f7ff ff96 bl 800ac18 <dhcp_renew>
  6944. /* this clients' renewal timeout triggered */
  6945. dhcp_t1_timeout(netif);
  6946. }
  6947. }
  6948. /* proceed to next netif */
  6949. netif = netif->next;
  6950. 800acec: 6824 ldr r4, [r4, #0]
  6951. dhcp_coarse_tmr()
  6952. {
  6953. struct netif *netif = netif_list;
  6954. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n"));
  6955. /* iterate through all network interfaces */
  6956. while (netif != NULL) {
  6957. 800acee: 2c00 cmp r4, #0
  6958. 800acf0: d1d9 bne.n 800aca6 <dhcp_coarse_tmr+0xa>
  6959. }
  6960. }
  6961. /* proceed to next netif */
  6962. netif = netif->next;
  6963. }
  6964. }
  6965. 800acf2: bd38 pop {r3, r4, r5, pc}
  6966. 800acf4: 20008218 .word 0x20008218
  6967. 800acf8: 44200000 .word 0x44200000
  6968. 0800acfc <dhcp_release>:
  6969. *
  6970. * @param netif network interface which must release its lease
  6971. */
  6972. err_t
  6973. dhcp_release(struct netif *netif)
  6974. {
  6975. 800acfc: b573 push {r0, r1, r4, r5, r6, lr}
  6976. struct dhcp *dhcp = netif->dhcp;
  6977. 800acfe: 6a04 ldr r4, [r0, #32]
  6978. *
  6979. * @param netif network interface which must release its lease
  6980. */
  6981. err_t
  6982. dhcp_release(struct netif *netif)
  6983. {
  6984. 800ad00: 4605 mov r5, r0
  6985. err_t result;
  6986. u16_t msecs;
  6987. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_release()\n"));
  6988. /* idle DHCP client */
  6989. dhcp_set_state(dhcp, DHCP_OFF);
  6990. 800ad02: 2100 movs r1, #0
  6991. 800ad04: 4620 mov r0, r4
  6992. 800ad06: f7ff fa7e bl 800a206 <dhcp_set_state>
  6993. /* clean old DHCP offer */
  6994. ip_addr_set_zero(&dhcp->server_ip_addr);
  6995. 800ad0a: 2300 movs r3, #0
  6996. 800ad0c: 6223 str r3, [r4, #32]
  6997. ip_addr_set_zero(&dhcp->offered_ip_addr);
  6998. 800ad0e: 6263 str r3, [r4, #36] ; 0x24
  6999. ip_addr_set_zero(&dhcp->offered_sn_mask);
  7000. 800ad10: 62a3 str r3, [r4, #40] ; 0x28
  7001. ip_addr_set_zero(&dhcp->offered_gw_addr);
  7002. 800ad12: 62e3 str r3, [r4, #44] ; 0x2c
  7003. #if LWIP_DHCP_BOOTP_FILE
  7004. ip_addr_set_zero(&dhcp->offered_si_addr);
  7005. #endif /* LWIP_DHCP_BOOTP_FILE */
  7006. dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0;
  7007. 800ad14: 63a3 str r3, [r4, #56] ; 0x38
  7008. 800ad16: 6363 str r3, [r4, #52] ; 0x34
  7009. 800ad18: 6323 str r3, [r4, #48] ; 0x30
  7010. /* create and initialize the DHCP message header */
  7011. result = dhcp_create_msg(netif, dhcp, DHCP_RELEASE);
  7012. 800ad1a: 4628 mov r0, r5
  7013. 800ad1c: 4621 mov r1, r4
  7014. 800ad1e: 2207 movs r2, #7
  7015. 800ad20: f7ff fad6 bl 800a2d0 <dhcp_create_msg>
  7016. if (result == ERR_OK) {
  7017. 800ad24: 4606 mov r6, r0
  7018. 800ad26: b998 cbnz r0, 800ad50 <dhcp_release+0x54>
  7019. dhcp_option_trailer(dhcp);
  7020. 800ad28: 4620 mov r0, r4
  7021. 800ad2a: f7ff fabb bl 800a2a4 <dhcp_option_trailer>
  7022. pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
  7023. 800ad2e: 8b21 ldrh r1, [r4, #24]
  7024. 800ad30: 6920 ldr r0, [r4, #16]
  7025. 800ad32: 31f0 adds r1, #240 ; 0xf0
  7026. 800ad34: b289 uxth r1, r1
  7027. 800ad36: f000 fbf0 bl 800b51a <pbuf_realloc>
  7028. udp_sendto_if(dhcp->pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif);
  7029. 800ad3a: 9500 str r5, [sp, #0]
  7030. 800ad3c: 6860 ldr r0, [r4, #4]
  7031. 800ad3e: 6921 ldr r1, [r4, #16]
  7032. 800ad40: f104 0220 add.w r2, r4, #32
  7033. 800ad44: 2343 movs r3, #67 ; 0x43
  7034. 800ad46: f003 f8ff bl 800df48 <udp_sendto_if>
  7035. dhcp_delete_msg(dhcp);
  7036. 800ad4a: 4620 mov r0, r4
  7037. 800ad4c: f7ff fb60 bl 800a410 <dhcp_delete_msg>
  7038. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release: RELEASED, DHCP_OFF\n"));
  7039. } else {
  7040. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_release: could not allocate DHCP request\n"));
  7041. }
  7042. dhcp->tries++;
  7043. 800ad50: 7b63 ldrb r3, [r4, #13]
  7044. 800ad52: 3301 adds r3, #1
  7045. 800ad54: b2db uxtb r3, r3
  7046. msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  7047. 800ad56: 2b09 cmp r3, #9
  7048. dhcp_delete_msg(dhcp);
  7049. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release: RELEASED, DHCP_OFF\n"));
  7050. } else {
  7051. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_release: could not allocate DHCP request\n"));
  7052. }
  7053. dhcp->tries++;
  7054. 800ad58: 7363 strb r3, [r4, #13]
  7055. msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
  7056. 800ad5a: d804 bhi.n 800ad66 <dhcp_release+0x6a>
  7057. 800ad5c: f44f 727a mov.w r2, #1000 ; 0x3e8
  7058. 800ad60: 4353 muls r3, r2
  7059. 800ad62: b29b uxth r3, r3
  7060. 800ad64: e001 b.n 800ad6a <dhcp_release+0x6e>
  7061. 800ad66: f242 7310 movw r3, #10000 ; 0x2710
  7062. dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
  7063. 800ad6a: f44f 72fa mov.w r2, #500 ; 0x1f4
  7064. 800ad6e: f203 13f3 addw r3, r3, #499 ; 0x1f3
  7065. 800ad72: fb93 f3f2 sdiv r3, r3, r2
  7066. 800ad76: 8363 strh r3, [r4, #26]
  7067. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release(): set request timeout %"U16_F" msecs\n", msecs));
  7068. /* bring the interface down */
  7069. netif_set_down(netif);
  7070. 800ad78: 4628 mov r0, r5
  7071. 800ad7a: f000 fb41 bl 800b400 <netif_set_down>
  7072. /* remove IP address from interface */
  7073. netif_set_ipaddr(netif, IP_ADDR_ANY);
  7074. 800ad7e: 4628 mov r0, r5
  7075. 800ad80: 4906 ldr r1, [pc, #24] ; (800ad9c <dhcp_release+0xa0>)
  7076. 800ad82: f000 fabf bl 800b304 <netif_set_ipaddr>
  7077. netif_set_gw(netif, IP_ADDR_ANY);
  7078. 800ad86: 4628 mov r0, r5
  7079. 800ad88: 4904 ldr r1, [pc, #16] ; (800ad9c <dhcp_release+0xa0>)
  7080. 800ad8a: f000 fb1b bl 800b3c4 <netif_set_gw>
  7081. netif_set_netmask(netif, IP_ADDR_ANY);
  7082. 800ad8e: 4628 mov r0, r5
  7083. 800ad90: 4902 ldr r1, [pc, #8] ; (800ad9c <dhcp_release+0xa0>)
  7084. 800ad92: f000 fb1b bl 800b3cc <netif_set_netmask>
  7085. return result;
  7086. }
  7087. 800ad96: 4630 mov r0, r6
  7088. 800ad98: bd7c pop {r2, r3, r4, r5, r6, pc}
  7089. 800ad9a: bf00 nop
  7090. 800ad9c: 08011880 .word 0x08011880
  7091. 0800ada0 <dhcp_fine_tmr>:
  7092. * A DHCP server is expected to respond within a short period of time.
  7093. * This timer checks whether an outstanding DHCP request is timed out.
  7094. */
  7095. void
  7096. dhcp_fine_tmr()
  7097. {
  7098. 800ada0: b538 push {r3, r4, r5, lr}
  7099. struct netif *netif = netif_list;
  7100. 800ada2: 4b26 ldr r3, [pc, #152] ; (800ae3c <dhcp_fine_tmr+0x9c>)
  7101. /* timer is active (non zero), and is about to trigger now */
  7102. if (netif->dhcp->request_timeout > 1) {
  7103. netif->dhcp->request_timeout--;
  7104. }
  7105. else if (netif->dhcp->request_timeout == 1) {
  7106. netif->dhcp->request_timeout--;
  7107. 800ada4: 2500 movs r5, #0
  7108. * This timer checks whether an outstanding DHCP request is timed out.
  7109. */
  7110. void
  7111. dhcp_fine_tmr()
  7112. {
  7113. struct netif *netif = netif_list;
  7114. 800ada6: 681c ldr r4, [r3, #0]
  7115. /* loop through netif's */
  7116. while (netif != NULL) {
  7117. 800ada8: e044 b.n 800ae34 <dhcp_fine_tmr+0x94>
  7118. /* only act on DHCP configured interfaces */
  7119. if (netif->dhcp != NULL) {
  7120. 800adaa: 6a23 ldr r3, [r4, #32]
  7121. 800adac: 2b00 cmp r3, #0
  7122. 800adae: d040 beq.n 800ae32 <dhcp_fine_tmr+0x92>
  7123. /* timer is active (non zero), and is about to trigger now */
  7124. if (netif->dhcp->request_timeout > 1) {
  7125. 800adb0: 8b5a ldrh r2, [r3, #26]
  7126. 800adb2: 2a01 cmp r2, #1
  7127. 800adb4: d902 bls.n 800adbc <dhcp_fine_tmr+0x1c>
  7128. netif->dhcp->request_timeout--;
  7129. 800adb6: 3a01 subs r2, #1
  7130. 800adb8: 835a strh r2, [r3, #26]
  7131. 800adba: e03a b.n 800ae32 <dhcp_fine_tmr+0x92>
  7132. }
  7133. else if (netif->dhcp->request_timeout == 1) {
  7134. 800adbc: d139 bne.n 800ae32 <dhcp_fine_tmr+0x92>
  7135. dhcp_timeout(struct netif *netif)
  7136. {
  7137. struct dhcp *dhcp = netif->dhcp;
  7138. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout()\n"));
  7139. /* back-off period has passed, or server selection timed out */
  7140. if ((dhcp->state == DHCP_BACKING_OFF) || (dhcp->state == DHCP_SELECTING)) {
  7141. 800adbe: 7b1a ldrb r2, [r3, #12]
  7142. /* timer is active (non zero), and is about to trigger now */
  7143. if (netif->dhcp->request_timeout > 1) {
  7144. netif->dhcp->request_timeout--;
  7145. }
  7146. else if (netif->dhcp->request_timeout == 1) {
  7147. netif->dhcp->request_timeout--;
  7148. 800adc0: 835d strh r5, [r3, #26]
  7149. dhcp_timeout(struct netif *netif)
  7150. {
  7151. struct dhcp *dhcp = netif->dhcp;
  7152. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout()\n"));
  7153. /* back-off period has passed, or server selection timed out */
  7154. if ((dhcp->state == DHCP_BACKING_OFF) || (dhcp->state == DHCP_SELECTING)) {
  7155. 800adc2: 2a0c cmp r2, #12
  7156. 800adc4: d028 beq.n 800ae18 <dhcp_fine_tmr+0x78>
  7157. 800adc6: 2a06 cmp r2, #6
  7158. 800adc8: d100 bne.n 800adcc <dhcp_fine_tmr+0x2c>
  7159. 800adca: e025 b.n 800ae18 <dhcp_fine_tmr+0x78>
  7160. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n"));
  7161. dhcp_discover(netif);
  7162. /* receiving the requested lease timed out */
  7163. } else if (dhcp->state == DHCP_REQUESTING) {
  7164. 800adcc: 2a01 cmp r2, #1
  7165. 800adce: d106 bne.n 800adde <dhcp_fine_tmr+0x3e>
  7166. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, DHCP request timed out\n"));
  7167. if (dhcp->tries <= 5) {
  7168. 800add0: 7b5b ldrb r3, [r3, #13]
  7169. 800add2: 2b05 cmp r3, #5
  7170. dhcp_select(netif);
  7171. 800add4: 4620 mov r0, r4
  7172. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n"));
  7173. dhcp_discover(netif);
  7174. /* receiving the requested lease timed out */
  7175. } else if (dhcp->state == DHCP_REQUESTING) {
  7176. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, DHCP request timed out\n"));
  7177. if (dhcp->tries <= 5) {
  7178. 800add6: d81d bhi.n 800ae14 <dhcp_fine_tmr+0x74>
  7179. dhcp_select(netif);
  7180. 800add8: f7ff fc14 bl 800a604 <dhcp_select>
  7181. 800addc: e029 b.n 800ae32 <dhcp_fine_tmr+0x92>
  7182. dhcp_release(netif);
  7183. dhcp_discover(netif);
  7184. }
  7185. #if DHCP_DOES_ARP_CHECK
  7186. /* received no ARP reply for the offered address (which is good) */
  7187. } else if (dhcp->state == DHCP_CHECKING) {
  7188. 800adde: 2a08 cmp r2, #8
  7189. 800ade0: d109 bne.n 800adf6 <dhcp_fine_tmr+0x56>
  7190. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): CHECKING, ARP request timed out\n"));
  7191. if (dhcp->tries <= 1) {
  7192. 800ade2: 7b5b ldrb r3, [r3, #13]
  7193. 800ade4: 2b01 cmp r3, #1
  7194. dhcp_check(netif);
  7195. 800ade6: 4620 mov r0, r4
  7196. }
  7197. #if DHCP_DOES_ARP_CHECK
  7198. /* received no ARP reply for the offered address (which is good) */
  7199. } else if (dhcp->state == DHCP_CHECKING) {
  7200. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): CHECKING, ARP request timed out\n"));
  7201. if (dhcp->tries <= 1) {
  7202. 800ade8: d802 bhi.n 800adf0 <dhcp_fine_tmr+0x50>
  7203. dhcp_check(netif);
  7204. 800adea: f7ff fc7d bl 800a6e8 <dhcp_check>
  7205. 800adee: e020 b.n 800ae32 <dhcp_fine_tmr+0x92>
  7206. /* no ARP replies on the offered address,
  7207. looks like the IP address is indeed free */
  7208. } else {
  7209. /* bind the interface to the offered address */
  7210. dhcp_bind(netif);
  7211. 800adf0: f7ff fc8d bl 800a70e <dhcp_bind>
  7212. 800adf4: e01d b.n 800ae32 <dhcp_fine_tmr+0x92>
  7213. }
  7214. #endif /* DHCP_DOES_ARP_CHECK */
  7215. }
  7216. /* did not get response to renew request? */
  7217. else if (dhcp->state == DHCP_RENEWING) {
  7218. 800adf6: 2a05 cmp r2, #5
  7219. 800adf8: d103 bne.n 800ae02 <dhcp_fine_tmr+0x62>
  7220. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RENEWING, DHCP request timed out\n"));
  7221. /* just retry renewal */
  7222. /* note that the rebind timer will eventually time-out if renew does not work */
  7223. dhcp_renew(netif);
  7224. 800adfa: 4620 mov r0, r4
  7225. 800adfc: f7ff ff0c bl 800ac18 <dhcp_renew>
  7226. 800ae00: e017 b.n 800ae32 <dhcp_fine_tmr+0x92>
  7227. /* did not get response to rebind request? */
  7228. } else if (dhcp->state == DHCP_REBINDING) {
  7229. 800ae02: 2a04 cmp r2, #4
  7230. 800ae04: d10a bne.n 800ae1c <dhcp_fine_tmr+0x7c>
  7231. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REBINDING, DHCP request timed out\n"));
  7232. if (dhcp->tries <= 8) {
  7233. 800ae06: 7b5b ldrb r3, [r3, #13]
  7234. 800ae08: 2b08 cmp r3, #8
  7235. dhcp_rebind(netif);
  7236. 800ae0a: 4620 mov r0, r4
  7237. /* note that the rebind timer will eventually time-out if renew does not work */
  7238. dhcp_renew(netif);
  7239. /* did not get response to rebind request? */
  7240. } else if (dhcp->state == DHCP_REBINDING) {
  7241. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REBINDING, DHCP request timed out\n"));
  7242. if (dhcp->tries <= 8) {
  7243. 800ae0c: d802 bhi.n 800ae14 <dhcp_fine_tmr+0x74>
  7244. dhcp_rebind(netif);
  7245. 800ae0e: f7ff fb67 bl 800a4e0 <dhcp_rebind>
  7246. 800ae12: e00e b.n 800ae32 <dhcp_fine_tmr+0x92>
  7247. } else {
  7248. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RELEASING, DISCOVERING\n"));
  7249. dhcp_release(netif);
  7250. 800ae14: f7ff ff72 bl 800acfc <dhcp_release>
  7251. dhcp_discover(netif);
  7252. 800ae18: 4620 mov r0, r4
  7253. 800ae1a: e008 b.n 800ae2e <dhcp_fine_tmr+0x8e>
  7254. }
  7255. } else if (dhcp->state == DHCP_REBOOTING) {
  7256. 800ae1c: 2a03 cmp r2, #3
  7257. 800ae1e: d108 bne.n 800ae32 <dhcp_fine_tmr+0x92>
  7258. if (dhcp->tries < REBOOT_TRIES) {
  7259. 800ae20: 7b5b ldrb r3, [r3, #13]
  7260. 800ae22: 2b01 cmp r3, #1
  7261. dhcp_reboot(netif);
  7262. 800ae24: 4620 mov r0, r4
  7263. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RELEASING, DISCOVERING\n"));
  7264. dhcp_release(netif);
  7265. dhcp_discover(netif);
  7266. }
  7267. } else if (dhcp->state == DHCP_REBOOTING) {
  7268. if (dhcp->tries < REBOOT_TRIES) {
  7269. 800ae26: d802 bhi.n 800ae2e <dhcp_fine_tmr+0x8e>
  7270. dhcp_reboot(netif);
  7271. 800ae28: f7ff fb9c bl 800a564 <dhcp_reboot>
  7272. 800ae2c: e001 b.n 800ae32 <dhcp_fine_tmr+0x92>
  7273. } else {
  7274. dhcp_discover(netif);
  7275. 800ae2e: f7ff fafb bl 800a428 <dhcp_discover>
  7276. /* this client's request timeout triggered */
  7277. dhcp_timeout(netif);
  7278. }
  7279. }
  7280. /* proceed to next network interface */
  7281. netif = netif->next;
  7282. 800ae32: 6824 ldr r4, [r4, #0]
  7283. void
  7284. dhcp_fine_tmr()
  7285. {
  7286. struct netif *netif = netif_list;
  7287. /* loop through netif's */
  7288. while (netif != NULL) {
  7289. 800ae34: 2c00 cmp r4, #0
  7290. 800ae36: d1b8 bne.n 800adaa <dhcp_fine_tmr+0xa>
  7291. }
  7292. }
  7293. /* proceed to next network interface */
  7294. netif = netif->next;
  7295. }
  7296. }
  7297. 800ae38: bd38 pop {r3, r4, r5, pc}
  7298. 800ae3a: bf00 nop
  7299. 800ae3c: 20008218 .word 0x20008218
  7300. 0800ae40 <dhcp_stop>:
  7301. *
  7302. * @param netif The network interface to stop DHCP on
  7303. */
  7304. void
  7305. dhcp_stop(struct netif *netif)
  7306. {
  7307. 800ae40: b510 push {r4, lr}
  7308. struct dhcp *dhcp;
  7309. LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;);
  7310. 800ae42: b198 cbz r0, 800ae6c <dhcp_stop+0x2c>
  7311. dhcp = netif->dhcp;
  7312. /* Remove the flag that says this netif is handled by DHCP. */
  7313. netif->flags &= ~NETIF_FLAG_DHCP;
  7314. 800ae44: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
  7315. void
  7316. dhcp_stop(struct netif *netif)
  7317. {
  7318. struct dhcp *dhcp;
  7319. LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;);
  7320. dhcp = netif->dhcp;
  7321. 800ae48: 6a04 ldr r4, [r0, #32]
  7322. /* Remove the flag that says this netif is handled by DHCP. */
  7323. netif->flags &= ~NETIF_FLAG_DHCP;
  7324. 800ae4a: f023 0308 bic.w r3, r3, #8
  7325. 800ae4e: f880 302d strb.w r3, [r0, #45] ; 0x2d
  7326. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_stop()\n"));
  7327. /* netif is DHCP configured? */
  7328. if (dhcp != NULL) {
  7329. 800ae52: b15c cbz r4, 800ae6c <dhcp_stop+0x2c>
  7330. autoip_stop(netif);
  7331. dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF;
  7332. }
  7333. #endif /* LWIP_DHCP_AUTOIP_COOP */
  7334. if (dhcp->pcb != NULL) {
  7335. 800ae54: 6860 ldr r0, [r4, #4]
  7336. 800ae56: b118 cbz r0, 800ae60 <dhcp_stop+0x20>
  7337. udp_remove(dhcp->pcb);
  7338. 800ae58: f003 f908 bl 800e06c <udp_remove>
  7339. dhcp->pcb = NULL;
  7340. 800ae5c: 2300 movs r3, #0
  7341. 800ae5e: 6063 str r3, [r4, #4]
  7342. }
  7343. LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
  7344. dhcp_set_state(dhcp, DHCP_OFF);
  7345. 800ae60: 4620 mov r0, r4
  7346. 800ae62: 2100 movs r1, #0
  7347. }
  7348. }
  7349. 800ae64: e8bd 4010 ldmia.w sp!, {r4, lr}
  7350. if (dhcp->pcb != NULL) {
  7351. udp_remove(dhcp->pcb);
  7352. dhcp->pcb = NULL;
  7353. }
  7354. LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
  7355. dhcp_set_state(dhcp, DHCP_OFF);
  7356. 800ae68: f7ff b9cd b.w 800a206 <dhcp_set_state>
  7357. 800ae6c: bd10 pop {r4, pc}
  7358. 800ae6e: 0000 movs r0, r0
  7359. 0800ae70 <dhcp_start>:
  7360. * - ERR_OK - No error
  7361. * - ERR_MEM - Out of memory
  7362. */
  7363. err_t
  7364. dhcp_start(struct netif *netif)
  7365. {
  7366. 800ae70: b538 push {r3, r4, r5, lr}
  7367. struct dhcp *dhcp;
  7368. err_t result = ERR_OK;
  7369. LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
  7370. 800ae72: 4604 mov r4, r0
  7371. 800ae74: b908 cbnz r0, 800ae7a <dhcp_start+0xa>
  7372. 800ae76: 20f2 movs r0, #242 ; 0xf2
  7373. 800ae78: e047 b.n 800af0a <dhcp_start+0x9a>
  7374. dhcp = netif->dhcp;
  7375. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  7376. /* Remove the flag that says this netif is handled by DHCP,
  7377. it is set when we succeeded starting. */
  7378. netif->flags &= ~NETIF_FLAG_DHCP;
  7379. 800ae7a: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
  7380. {
  7381. struct dhcp *dhcp;
  7382. err_t result = ERR_OK;
  7383. LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
  7384. dhcp = netif->dhcp;
  7385. 800ae7e: 6a05 ldr r5, [r0, #32]
  7386. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  7387. /* Remove the flag that says this netif is handled by DHCP,
  7388. it is set when we succeeded starting. */
  7389. netif->flags &= ~NETIF_FLAG_DHCP;
  7390. 800ae80: f023 0208 bic.w r2, r3, #8
  7391. /* check hwtype of the netif */
  7392. if ((netif->flags & NETIF_FLAG_ETHARP) == 0) {
  7393. 800ae84: f003 0320 and.w r3, r3, #32
  7394. 800ae88: b2db uxtb r3, r3
  7395. LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
  7396. dhcp = netif->dhcp;
  7397. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
  7398. /* Remove the flag that says this netif is handled by DHCP,
  7399. it is set when we succeeded starting. */
  7400. netif->flags &= ~NETIF_FLAG_DHCP;
  7401. 800ae8a: f880 202d strb.w r2, [r0, #45] ; 0x2d
  7402. /* check hwtype of the netif */
  7403. if ((netif->flags & NETIF_FLAG_ETHARP) == 0) {
  7404. 800ae8e: 2b00 cmp r3, #0
  7405. 800ae90: d0f1 beq.n 800ae76 <dhcp_start+0x6>
  7406. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): No ETHARP netif\n"));
  7407. return ERR_ARG;
  7408. }
  7409. /* check MTU of the netif */
  7410. if (netif->mtu < DHCP_MAX_MSG_LEN_MIN_REQUIRED) {
  7411. 800ae92: 8c83 ldrh r3, [r0, #36] ; 0x24
  7412. 800ae94: f5b3 7f10 cmp.w r3, #576 ; 0x240
  7413. 800ae98: d200 bcs.n 800ae9c <dhcp_start+0x2c>
  7414. 800ae9a: e02e b.n 800aefa <dhcp_start+0x8a>
  7415. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): Cannot use this netif with DHCP: MTU is too small\n"));
  7416. return ERR_MEM;
  7417. }
  7418. /* no DHCP client attached yet? */
  7419. if (dhcp == NULL) {
  7420. 800ae9c: b935 cbnz r5, 800aeac <dhcp_start+0x3c>
  7421. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting new DHCP client\n"));
  7422. dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp));
  7423. 800ae9e: 203c movs r0, #60 ; 0x3c
  7424. 800aea0: f000 f934 bl 800b10c <mem_malloc>
  7425. if (dhcp == NULL) {
  7426. 800aea4: 4605 mov r5, r0
  7427. 800aea6: b340 cbz r0, 800aefa <dhcp_start+0x8a>
  7428. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n"));
  7429. return ERR_MEM;
  7430. }
  7431. /* store this dhcp client in the netif */
  7432. netif->dhcp = dhcp;
  7433. 800aea8: 6220 str r0, [r4, #32]
  7434. 800aeaa: e003 b.n 800aeb4 <dhcp_start+0x44>
  7435. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp"));
  7436. /* already has DHCP client attached */
  7437. } else {
  7438. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(): restarting DHCP configuration\n"));
  7439. if (dhcp->pcb != NULL) {
  7440. 800aeac: 6868 ldr r0, [r5, #4]
  7441. 800aeae: b108 cbz r0, 800aeb4 <dhcp_start+0x44>
  7442. udp_remove(dhcp->pcb);
  7443. 800aeb0: f003 f8dc bl 800e06c <udp_remove>
  7444. LWIP_ASSERT("pbuf p_out wasn't freed", dhcp->p_out == NULL);
  7445. LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL );
  7446. }
  7447. /* clear data structure */
  7448. memset(dhcp, 0, sizeof(struct dhcp));
  7449. 800aeb4: 2100 movs r1, #0
  7450. 800aeb6: 223c movs r2, #60 ; 0x3c
  7451. 800aeb8: 4628 mov r0, r5
  7452. 800aeba: f7fe fb5d bl 8009578 <memset>
  7453. /* dhcp_set_state(&dhcp, DHCP_OFF); */
  7454. /* allocate UDP PCB */
  7455. dhcp->pcb = udp_new();
  7456. 800aebe: f003 f8eb bl 800e098 <udp_new>
  7457. 800aec2: 6068 str r0, [r5, #4]
  7458. if (dhcp->pcb == NULL) {
  7459. 800aec4: b1c8 cbz r0, 800aefa <dhcp_start+0x8a>
  7460. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not obtain pcb\n"));
  7461. return ERR_MEM;
  7462. }
  7463. ip_set_option(dhcp->pcb, SOF_BROADCAST);
  7464. 800aec6: 7a03 ldrb r3, [r0, #8]
  7465. /* set up local and remote port for the pcb */
  7466. udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
  7467. 800aec8: 4911 ldr r1, [pc, #68] ; (800af10 <dhcp_start+0xa0>)
  7468. dhcp->pcb = udp_new();
  7469. if (dhcp->pcb == NULL) {
  7470. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not obtain pcb\n"));
  7471. return ERR_MEM;
  7472. }
  7473. ip_set_option(dhcp->pcb, SOF_BROADCAST);
  7474. 800aeca: f043 0320 orr.w r3, r3, #32
  7475. 800aece: 7203 strb r3, [r0, #8]
  7476. /* set up local and remote port for the pcb */
  7477. udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
  7478. 800aed0: 2244 movs r2, #68 ; 0x44
  7479. 800aed2: 6868 ldr r0, [r5, #4]
  7480. 800aed4: f002 ffec bl 800deb0 <udp_bind>
  7481. udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
  7482. 800aed8: 490d ldr r1, [pc, #52] ; (800af10 <dhcp_start+0xa0>)
  7483. 800aeda: 6868 ldr r0, [r5, #4]
  7484. 800aedc: 2243 movs r2, #67 ; 0x43
  7485. 800aede: f003 f89b bl 800e018 <udp_connect>
  7486. /* set up the recv callback and argument */
  7487. udp_recv(dhcp->pcb, dhcp_recv, netif);
  7488. 800aee2: 6868 ldr r0, [r5, #4]
  7489. 800aee4: 490b ldr r1, [pc, #44] ; (800af14 <dhcp_start+0xa4>)
  7490. 800aee6: 4622 mov r2, r4
  7491. 800aee8: f003 f8bc bl 800e064 <udp_recv>
  7492. LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n"));
  7493. /* (re)start the DHCP negotiation */
  7494. result = dhcp_discover(netif);
  7495. 800aeec: 4620 mov r0, r4
  7496. 800aeee: f7ff fa9b bl 800a428 <dhcp_discover>
  7497. if (result != ERR_OK) {
  7498. 800aef2: b120 cbz r0, 800aefe <dhcp_start+0x8e>
  7499. /* free resources allocated above */
  7500. dhcp_stop(netif);
  7501. 800aef4: 4620 mov r0, r4
  7502. 800aef6: f7ff ffa3 bl 800ae40 <dhcp_stop>
  7503. return ERR_MEM;
  7504. 800aefa: 20ff movs r0, #255 ; 0xff
  7505. 800aefc: e005 b.n 800af0a <dhcp_start+0x9a>
  7506. }
  7507. /* Set the flag that says this netif is handled by DHCP. */
  7508. netif->flags |= NETIF_FLAG_DHCP;
  7509. 800aefe: f894 302d ldrb.w r3, [r4, #45] ; 0x2d
  7510. 800af02: f043 0308 orr.w r3, r3, #8
  7511. 800af06: f884 302d strb.w r3, [r4, #45] ; 0x2d
  7512. return result;
  7513. }
  7514. 800af0a: b240 sxtb r0, r0
  7515. 800af0c: bd38 pop {r3, r4, r5, pc}
  7516. 800af0e: bf00 nop
  7517. 800af10: 08011880 .word 0x08011880
  7518. 800af14: 0800a7cd .word 0x0800a7cd
  7519. 0800af18 <lwip_init>:
  7520. /**
  7521. * Perform Sanity check of user-configurable values, and initialize all modules.
  7522. */
  7523. void
  7524. lwip_init(void)
  7525. {
  7526. 800af18: b508 push {r3, lr}
  7527. /* Modules initialization */
  7528. stats_init();
  7529. 800af1a: f000 fc8f bl 800b83c <stats_init>
  7530. #if !NO_SYS
  7531. sys_init();
  7532. #endif /* !NO_SYS */
  7533. mem_init();
  7534. 800af1e: f000 f80d bl 800af3c <mem_init>
  7535. memp_init();
  7536. 800af22: f000 f973 bl 800b20c <memp_init>
  7537. pbuf_init();
  7538. netif_init();
  7539. 800af26: f000 f9eb bl 800b300 <netif_init>
  7540. #endif /* LWIP_ARP */
  7541. #if LWIP_RAW
  7542. raw_init();
  7543. #endif /* LWIP_RAW */
  7544. #if LWIP_UDP
  7545. udp_init();
  7546. 800af2a: f002 fee3 bl 800dcf4 <udp_init>
  7547. #endif /* LWIP_UDP */
  7548. #if LWIP_TCP
  7549. tcp_init();
  7550. 800af2e: f000 fcb5 bl 800b89c <tcp_init>
  7551. #endif /* LWIP_DNS */
  7552. #if LWIP_TIMERS
  7553. sys_timeouts_init();
  7554. #endif /* LWIP_TIMERS */
  7555. }
  7556. 800af32: e8bd 4008 ldmia.w sp!, {r3, lr}
  7557. #if LWIP_DNS
  7558. dns_init();
  7559. #endif /* LWIP_DNS */
  7560. #if LWIP_TIMERS
  7561. sys_timeouts_init();
  7562. 800af36: f002 be1f b.w 800db78 <sys_timeouts_init>
  7563. 800af3a: 0000 movs r0, r0
  7564. 0800af3c <mem_init>:
  7565. LWIP_ASSERT("Sanity check alignment",
  7566. (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
  7567. /* align the heap */
  7568. ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
  7569. 800af3c: 4b0b ldr r3, [pc, #44] ; (800af6c <mem_init+0x30>)
  7570. 800af3e: 4a0c ldr r2, [pc, #48] ; (800af70 <mem_init+0x34>)
  7571. mem = (struct mem *)(void *)ram;
  7572. mem->next = MEM_SIZE_ALIGNED;
  7573. mem->prev = 0;
  7574. mem->used = 0;
  7575. /* initialize the end of the heap */
  7576. ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
  7577. 800af40: 480c ldr r0, [pc, #48] ; (800af74 <mem_init+0x38>)
  7578. LWIP_ASSERT("Sanity check alignment",
  7579. (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
  7580. /* align the heap */
  7581. ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
  7582. 800af42: f023 0303 bic.w r3, r3, #3
  7583. /* initialize the start of the heap */
  7584. mem = (struct mem *)(void *)ram;
  7585. mem->next = MEM_SIZE_ALIGNED;
  7586. mem->prev = 0;
  7587. 800af46: 2100 movs r1, #0
  7588. LWIP_ASSERT("Sanity check alignment",
  7589. (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
  7590. /* align the heap */
  7591. ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
  7592. 800af48: 6013 str r3, [r2, #0]
  7593. /* initialize the start of the heap */
  7594. mem = (struct mem *)(void *)ram;
  7595. mem->next = MEM_SIZE_ALIGNED;
  7596. 800af4a: f44f 52a0 mov.w r2, #5120 ; 0x1400
  7597. mem->prev = 0;
  7598. 800af4e: 8059 strh r1, [r3, #2]
  7599. mem->used = 0;
  7600. 800af50: 7119 strb r1, [r3, #4]
  7601. /* initialize the end of the heap */
  7602. ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
  7603. 800af52: 1899 adds r1, r3, r2
  7604. 800af54: 6001 str r1, [r0, #0]
  7605. ram_end->used = 1;
  7606. 800af56: 2001 movs r0, #1
  7607. /* align the heap */
  7608. ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
  7609. /* initialize the start of the heap */
  7610. mem = (struct mem *)(void *)ram;
  7611. mem->next = MEM_SIZE_ALIGNED;
  7612. 800af58: 801a strh r2, [r3, #0]
  7613. mem->used = 0;
  7614. /* initialize the end of the heap */
  7615. ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
  7616. ram_end->used = 1;
  7617. ram_end->next = MEM_SIZE_ALIGNED;
  7618. ram_end->prev = MEM_SIZE_ALIGNED;
  7619. 800af5a: 804a strh r2, [r1, #2]
  7620. mem->prev = 0;
  7621. mem->used = 0;
  7622. /* initialize the end of the heap */
  7623. ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
  7624. ram_end->used = 1;
  7625. ram_end->next = MEM_SIZE_ALIGNED;
  7626. 800af5c: 800a strh r2, [r1, #0]
  7627. mem->next = MEM_SIZE_ALIGNED;
  7628. mem->prev = 0;
  7629. mem->used = 0;
  7630. /* initialize the end of the heap */
  7631. ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
  7632. ram_end->used = 1;
  7633. 800af5e: 7108 strb r0, [r1, #4]
  7634. ram_end->next = MEM_SIZE_ALIGNED;
  7635. ram_end->prev = MEM_SIZE_ALIGNED;
  7636. /* initialize the lowest-free pointer to the start of the heap */
  7637. lfree = (struct mem *)(void *)ram;
  7638. 800af60: 4905 ldr r1, [pc, #20] ; (800af78 <mem_init+0x3c>)
  7639. 800af62: 600b str r3, [r1, #0]
  7640. MEM_STATS_AVAIL(avail, MEM_SIZE_ALIGNED);
  7641. 800af64: 4b05 ldr r3, [pc, #20] ; (800af7c <mem_init+0x40>)
  7642. 800af66: f8a3 20a8 strh.w r2, [r3, #168] ; 0xa8
  7643. 800af6a: 4770 bx lr
  7644. 800af6c: 20006e07 .word 0x20006e07
  7645. 800af70: 2000013c .word 0x2000013c
  7646. 800af74: 20000138 .word 0x20000138
  7647. 800af78: 20000134 .word 0x20000134
  7648. 800af7c: 20008220 .word 0x20008220
  7649. 0800af80 <mem_free>:
  7650. * @param rmem is the data portion of a struct mem as returned by a previous
  7651. * call to mem_malloc()
  7652. */
  7653. void
  7654. mem_free(void *rmem)
  7655. {
  7656. 800af80: b5f0 push {r4, r5, r6, r7, lr}
  7657. struct mem *mem;
  7658. LWIP_MEM_FREE_DECL_PROTECT();
  7659. if (rmem == NULL) {
  7660. 800af82: 2800 cmp r0, #0
  7661. 800af84: d048 beq.n 800b018 <mem_free+0x98>
  7662. LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("mem_free(p == NULL) was called.\n"));
  7663. return;
  7664. }
  7665. LWIP_ASSERT("mem_free: sanity check alignment", (((mem_ptr_t)rmem) & (MEM_ALIGNMENT-1)) == 0);
  7666. LWIP_ASSERT("mem_free: legal memory", (u8_t *)rmem >= (u8_t *)ram &&
  7667. 800af86: 4b25 ldr r3, [pc, #148] ; (800b01c <mem_free+0x9c>)
  7668. 800af88: 681b ldr r3, [r3, #0]
  7669. (u8_t *)rmem < (u8_t *)ram_end);
  7670. if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {
  7671. 800af8a: 4298 cmp r0, r3
  7672. 800af8c: d303 bcc.n 800af96 <mem_free+0x16>
  7673. 800af8e: 4a24 ldr r2, [pc, #144] ; (800b020 <mem_free+0xa0>)
  7674. 800af90: 6816 ldr r6, [r2, #0]
  7675. 800af92: 42b0 cmp r0, r6
  7676. 800af94: d306 bcc.n 800afa4 <mem_free+0x24>
  7677. SYS_ARCH_DECL_PROTECT(lev);
  7678. LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: illegal memory\n"));
  7679. /* protect mem stats from concurrent access */
  7680. SYS_ARCH_PROTECT(lev);
  7681. MEM_STATS_INC(illegal);
  7682. 800af96: 4b23 ldr r3, [pc, #140] ; (800b024 <mem_free+0xa4>)
  7683. 800af98: f8b3 20b0 ldrh.w r2, [r3, #176] ; 0xb0
  7684. 800af9c: 3201 adds r2, #1
  7685. 800af9e: f8a3 20b0 strh.w r2, [r3, #176] ; 0xb0
  7686. SYS_ARCH_UNPROTECT(lev);
  7687. return;
  7688. 800afa2: bdf0 pop {r4, r5, r6, r7, pc}
  7689. /* Get the corresponding struct mem ... */
  7690. mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
  7691. /* ... which has to be in a used state ... */
  7692. LWIP_ASSERT("mem_free: mem->used", mem->used);
  7693. /* ... and is now unused. */
  7694. mem->used = 0;
  7695. 800afa4: 2100 movs r1, #0
  7696. 800afa6: f800 1c04 strb.w r1, [r0, #-4]
  7697. if (mem < lfree) {
  7698. 800afaa: 491f ldr r1, [pc, #124] ; (800b028 <mem_free+0xa8>)
  7699. 800afac: 680c ldr r4, [r1, #0]
  7700. return;
  7701. }
  7702. /* protect the heap from concurrent access */
  7703. LWIP_MEM_FREE_PROTECT();
  7704. /* Get the corresponding struct mem ... */
  7705. mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
  7706. 800afae: f1a0 0208 sub.w r2, r0, #8
  7707. /* ... which has to be in a used state ... */
  7708. LWIP_ASSERT("mem_free: mem->used", mem->used);
  7709. /* ... and is now unused. */
  7710. mem->used = 0;
  7711. if (mem < lfree) {
  7712. 800afb2: 42a2 cmp r2, r4
  7713. /* the newly freed struct is now the lowest */
  7714. lfree = mem;
  7715. }
  7716. MEM_STATS_DEC_USED(used, mem->next - (mem_size_t)(((u8_t *)mem - ram)));
  7717. 800afb4: 4c1b ldr r4, [pc, #108] ; (800b024 <mem_free+0xa4>)
  7718. /* ... and is now unused. */
  7719. mem->used = 0;
  7720. if (mem < lfree) {
  7721. /* the newly freed struct is now the lowest */
  7722. lfree = mem;
  7723. 800afb6: bf38 it cc
  7724. 800afb8: 600a strcc r2, [r1, #0]
  7725. }
  7726. MEM_STATS_DEC_USED(used, mem->next - (mem_size_t)(((u8_t *)mem - ram)));
  7727. 800afba: f8b4 70aa ldrh.w r7, [r4, #170] ; 0xaa
  7728. 800afbe: f830 1c08 ldrh.w r1, [r0, #-8]
  7729. 800afc2: 1ad5 subs r5, r2, r3
  7730. 800afc4: 1a7f subs r7, r7, r1
  7731. 800afc6: 197f adds r7, r7, r5
  7732. 800afc8: f8a4 70aa strh.w r7, [r4, #170] ; 0xaa
  7733. LWIP_ASSERT("plug_holes: mem->used == 0", mem->used == 0);
  7734. /* plug hole forward */
  7735. LWIP_ASSERT("plug_holes: mem->next <= MEM_SIZE_ALIGNED", mem->next <= MEM_SIZE_ALIGNED);
  7736. nmem = (struct mem *)(void *)&ram[mem->next];
  7737. 800afcc: 185c adds r4, r3, r1
  7738. if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) {
  7739. 800afce: 42a2 cmp r2, r4
  7740. 800afd0: d00e beq.n 800aff0 <mem_free+0x70>
  7741. 800afd2: 7927 ldrb r7, [r4, #4]
  7742. 800afd4: b967 cbnz r7, 800aff0 <mem_free+0x70>
  7743. 800afd6: 42b4 cmp r4, r6
  7744. 800afd8: d00a beq.n 800aff0 <mem_free+0x70>
  7745. /* if mem->next is unused and not end of ram, combine mem and mem->next */
  7746. if (lfree == nmem) {
  7747. 800afda: 4e13 ldr r6, [pc, #76] ; (800b028 <mem_free+0xa8>)
  7748. 800afdc: 6837 ldr r7, [r6, #0]
  7749. 800afde: 42a7 cmp r7, r4
  7750. lfree = mem;
  7751. }
  7752. mem->next = nmem->next;
  7753. 800afe0: 5a5c ldrh r4, [r3, r1]
  7754. nmem = (struct mem *)(void *)&ram[mem->next];
  7755. if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) {
  7756. /* if mem->next is unused and not end of ram, combine mem and mem->next */
  7757. if (lfree == nmem) {
  7758. lfree = mem;
  7759. 800afe2: bf08 it eq
  7760. 800afe4: 6032 streq r2, [r6, #0]
  7761. }
  7762. mem->next = nmem->next;
  7763. 800afe6: f820 4c08 strh.w r4, [r0, #-8]
  7764. ((struct mem *)(void *)&ram[nmem->next])->prev = (mem_size_t)((u8_t *)mem - ram);
  7765. 800afea: 5a59 ldrh r1, [r3, r1]
  7766. 800afec: 1859 adds r1, r3, r1
  7767. 800afee: 804d strh r5, [r1, #2]
  7768. }
  7769. /* plug hole backward */
  7770. pmem = (struct mem *)(void *)&ram[mem->prev];
  7771. 800aff0: f830 4c06 ldrh.w r4, [r0, #-6]
  7772. 800aff4: 1919 adds r1, r3, r4
  7773. if (pmem != mem && pmem->used == 0) {
  7774. 800aff6: 4291 cmp r1, r2
  7775. 800aff8: d00e beq.n 800b018 <mem_free+0x98>
  7776. 800affa: 790d ldrb r5, [r1, #4]
  7777. 800affc: b965 cbnz r5, 800b018 <mem_free+0x98>
  7778. /* if mem->prev is unused, combine mem and mem->prev */
  7779. if (lfree == mem) {
  7780. 800affe: 4d0a ldr r5, [pc, #40] ; (800b028 <mem_free+0xa8>)
  7781. 800b000: 682e ldr r6, [r5, #0]
  7782. 800b002: 4296 cmp r6, r2
  7783. lfree = pmem;
  7784. }
  7785. pmem->next = mem->next;
  7786. 800b004: f830 2c08 ldrh.w r2, [r0, #-8]
  7787. /* plug hole backward */
  7788. pmem = (struct mem *)(void *)&ram[mem->prev];
  7789. if (pmem != mem && pmem->used == 0) {
  7790. /* if mem->prev is unused, combine mem and mem->prev */
  7791. if (lfree == mem) {
  7792. lfree = pmem;
  7793. 800b008: bf08 it eq
  7794. 800b00a: 6029 streq r1, [r5, #0]
  7795. }
  7796. pmem->next = mem->next;
  7797. 800b00c: 531a strh r2, [r3, r4]
  7798. ((struct mem *)(void *)&ram[mem->next])->prev = (mem_size_t)((u8_t *)pmem - ram);
  7799. 800b00e: f830 2c08 ldrh.w r2, [r0, #-8]
  7800. 800b012: 189a adds r2, r3, r2
  7801. 800b014: 1acb subs r3, r1, r3
  7802. 800b016: 8053 strh r3, [r2, #2]
  7803. 800b018: bdf0 pop {r4, r5, r6, r7, pc}
  7804. 800b01a: bf00 nop
  7805. 800b01c: 2000013c .word 0x2000013c
  7806. 800b020: 20000138 .word 0x20000138
  7807. 800b024: 20008220 .word 0x20008220
  7808. 800b028: 20000134 .word 0x20000134
  7809. 0800b02c <mem_trim>:
  7810. /* use the FREE_PROTECT here: it protects with sem OR SYS_ARCH_PROTECT */
  7811. LWIP_MEM_FREE_DECL_PROTECT();
  7812. /* Expand the size of the allocated memory region so that we can
  7813. adjust for alignment. */
  7814. newsize = LWIP_MEM_ALIGN_SIZE(newsize);
  7815. 800b02c: 3103 adds r1, #3
  7816. 800b02e: f64f 72fc movw r2, #65532 ; 0xfffc
  7817. 800b032: 400a ands r2, r1
  7818. if(newsize < MIN_SIZE_ALIGNED) {
  7819. 800b034: 2a0b cmp r2, #11
  7820. * or NULL if newsize is > old size, in which case rmem is NOT touched
  7821. * or freed!
  7822. */
  7823. void *
  7824. mem_trim(void *rmem, mem_size_t newsize)
  7825. {
  7826. 800b036: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  7827. /* Expand the size of the allocated memory region so that we can
  7828. adjust for alignment. */
  7829. newsize = LWIP_MEM_ALIGN_SIZE(newsize);
  7830. if(newsize < MIN_SIZE_ALIGNED) {
  7831. 800b03a: d903 bls.n 800b044 <mem_trim+0x18>
  7832. /* every data block must be at least MIN_SIZE_ALIGNED long */
  7833. newsize = MIN_SIZE_ALIGNED;
  7834. }
  7835. if (newsize > MEM_SIZE_ALIGNED) {
  7836. 800b03c: f5b2 5fa0 cmp.w r2, #5120 ; 0x1400
  7837. 800b040: d901 bls.n 800b046 <mem_trim+0x1a>
  7838. 800b042: e057 b.n 800b0f4 <mem_trim+0xc8>
  7839. adjust for alignment. */
  7840. newsize = LWIP_MEM_ALIGN_SIZE(newsize);
  7841. if(newsize < MIN_SIZE_ALIGNED) {
  7842. /* every data block must be at least MIN_SIZE_ALIGNED long */
  7843. newsize = MIN_SIZE_ALIGNED;
  7844. 800b044: 220c movs r2, #12
  7845. }
  7846. LWIP_ASSERT("mem_trim: legal memory", (u8_t *)rmem >= (u8_t *)ram &&
  7847. (u8_t *)rmem < (u8_t *)ram_end);
  7848. if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {
  7849. 800b046: 4b2d ldr r3, [pc, #180] ; (800b0fc <mem_trim+0xd0>)
  7850. 800b048: 681b ldr r3, [r3, #0]
  7851. 800b04a: 4298 cmp r0, r3
  7852. 800b04c: d303 bcc.n 800b056 <mem_trim+0x2a>
  7853. 800b04e: 492c ldr r1, [pc, #176] ; (800b100 <mem_trim+0xd4>)
  7854. 800b050: 6809 ldr r1, [r1, #0]
  7855. 800b052: 4288 cmp r0, r1
  7856. 800b054: d307 bcc.n 800b066 <mem_trim+0x3a>
  7857. SYS_ARCH_DECL_PROTECT(lev);
  7858. LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_trim: illegal memory\n"));
  7859. /* protect mem stats from concurrent access */
  7860. SYS_ARCH_PROTECT(lev);
  7861. MEM_STATS_INC(illegal);
  7862. 800b056: 4b2b ldr r3, [pc, #172] ; (800b104 <mem_trim+0xd8>)
  7863. 800b058: f8b3 20b0 ldrh.w r2, [r3, #176] ; 0xb0
  7864. 800b05c: 3201 adds r2, #1
  7865. 800b05e: f8a3 20b0 strh.w r2, [r3, #176] ; 0xb0
  7866. SYS_ARCH_UNPROTECT(lev);
  7867. return rmem;
  7868. 800b062: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  7869. }
  7870. /* Get the corresponding struct mem ... */
  7871. mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
  7872. 800b066: f1a0 0408 sub.w r4, r0, #8
  7873. /* ... and its offset pointer */
  7874. ptr = (mem_size_t)((u8_t *)mem - ram);
  7875. size = mem->next - ptr - SIZEOF_STRUCT_MEM;
  7876. 800b06a: f830 cc08 ldrh.w ip, [r0, #-8]
  7877. return rmem;
  7878. }
  7879. /* Get the corresponding struct mem ... */
  7880. mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
  7881. /* ... and its offset pointer */
  7882. ptr = (mem_size_t)((u8_t *)mem - ram);
  7883. 800b06e: 1ae4 subs r4, r4, r3
  7884. 800b070: b2a4 uxth r4, r4
  7885. size = mem->next - ptr - SIZEOF_STRUCT_MEM;
  7886. 800b072: f1ac 0508 sub.w r5, ip, #8
  7887. 800b076: 1b2d subs r5, r5, r4
  7888. 800b078: b2ad uxth r5, r5
  7889. LWIP_ASSERT("mem_trim can only shrink memory", newsize <= size);
  7890. if (newsize > size) {
  7891. 800b07a: 42aa cmp r2, r5
  7892. 800b07c: d83a bhi.n 800b0f4 <mem_trim+0xc8>
  7893. /* not supported */
  7894. return NULL;
  7895. }
  7896. if (newsize == size) {
  7897. 800b07e: d03a beq.n 800b0f6 <mem_trim+0xca>
  7898. }
  7899. /* protect the heap from concurrent access */
  7900. LWIP_MEM_FREE_PROTECT();
  7901. mem2 = (struct mem *)(void *)&ram[mem->next];
  7902. 800b080: eb03 080c add.w r8, r3, ip
  7903. if(mem2->used == 0) {
  7904. 800b084: f898 1004 ldrb.w r1, [r8, #4]
  7905. 800b088: b969 cbnz r1, 800b0a6 <mem_trim+0x7a>
  7906. mem_size_t next;
  7907. /* remember the old next pointer */
  7908. next = mem2->next;
  7909. /* create new struct mem which is moved directly after the shrinked mem */
  7910. ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  7911. if (lfree == mem2) {
  7912. 800b08a: 4f1f ldr r7, [pc, #124] ; (800b108 <mem_trim+0xdc>)
  7913. mem2 = (struct mem *)(void *)&ram[mem->next];
  7914. if(mem2->used == 0) {
  7915. /* The next struct is unused, we can simply move it at little */
  7916. mem_size_t next;
  7917. /* remember the old next pointer */
  7918. next = mem2->next;
  7919. 800b08c: f833 c00c ldrh.w ip, [r3, ip]
  7920. /* create new struct mem which is moved directly after the shrinked mem */
  7921. ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  7922. if (lfree == mem2) {
  7923. 800b090: 683e ldr r6, [r7, #0]
  7924. /* The next struct is unused, we can simply move it at little */
  7925. mem_size_t next;
  7926. /* remember the old next pointer */
  7927. next = mem2->next;
  7928. /* create new struct mem which is moved directly after the shrinked mem */
  7929. ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  7930. 800b092: f104 0108 add.w r1, r4, #8
  7931. 800b096: 1851 adds r1, r2, r1
  7932. 800b098: b289 uxth r1, r1
  7933. if (lfree == mem2) {
  7934. 800b09a: 4546 cmp r6, r8
  7935. 800b09c: eb03 0601 add.w r6, r3, r1
  7936. 800b0a0: d112 bne.n 800b0c8 <mem_trim+0x9c>
  7937. lfree = (struct mem *)(void *)&ram[ptr2];
  7938. 800b0a2: 603e str r6, [r7, #0]
  7939. 800b0a4: e010 b.n 800b0c8 <mem_trim+0x9c>
  7940. if (mem2->next != MEM_SIZE_ALIGNED) {
  7941. ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
  7942. }
  7943. MEM_STATS_DEC_USED(used, (size - newsize));
  7944. /* no need to plug holes, we've already done that */
  7945. } else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) {
  7946. 800b0a6: f102 0114 add.w r1, r2, #20
  7947. 800b0aa: 42a9 cmp r1, r5
  7948. 800b0ac: d823 bhi.n 800b0f6 <mem_trim+0xca>
  7949. * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
  7950. * region that couldn't hold data, but when mem->next gets freed,
  7951. * the 2 regions would be combined, resulting in more free memory */
  7952. ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  7953. mem2 = (struct mem *)(void *)&ram[ptr2];
  7954. if (mem2 < lfree) {
  7955. 800b0ae: f8df 8058 ldr.w r8, [pc, #88] ; 800b108 <mem_trim+0xdc>
  7956. * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem
  7957. * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED').
  7958. * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
  7959. * region that couldn't hold data, but when mem->next gets freed,
  7960. * the 2 regions would be combined, resulting in more free memory */
  7961. ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  7962. 800b0b2: f104 0108 add.w r1, r4, #8
  7963. 800b0b6: 1851 adds r1, r2, r1
  7964. mem2 = (struct mem *)(void *)&ram[ptr2];
  7965. if (mem2 < lfree) {
  7966. 800b0b8: f8d8 7000 ldr.w r7, [r8]
  7967. * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem
  7968. * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED').
  7969. * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
  7970. * region that couldn't hold data, but when mem->next gets freed,
  7971. * the 2 regions would be combined, resulting in more free memory */
  7972. ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
  7973. 800b0bc: b289 uxth r1, r1
  7974. mem2 = (struct mem *)(void *)&ram[ptr2];
  7975. 800b0be: 185e adds r6, r3, r1
  7976. if (mem2 < lfree) {
  7977. 800b0c0: 42be cmp r6, r7
  7978. lfree = mem2;
  7979. 800b0c2: bf38 it cc
  7980. 800b0c4: f8c8 6000 strcc.w r6, [r8]
  7981. }
  7982. mem2->used = 0;
  7983. 800b0c8: 2700 movs r7, #0
  7984. 800b0ca: 7137 strb r7, [r6, #4]
  7985. mem2->next = mem->next;
  7986. 800b0cc: f823 c001 strh.w ip, [r3, r1]
  7987. mem2->prev = ptr;
  7988. 800b0d0: 8074 strh r4, [r6, #2]
  7989. mem->next = ptr2;
  7990. 800b0d2: f820 1c08 strh.w r1, [r0, #-8]
  7991. if (mem2->next != MEM_SIZE_ALIGNED) {
  7992. 800b0d6: 5a5c ldrh r4, [r3, r1]
  7993. 800b0d8: f5b4 5fa0 cmp.w r4, #5120 ; 0x1400
  7994. ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
  7995. 800b0dc: bf1c itt ne
  7996. 800b0de: 191b addne r3, r3, r4
  7997. 800b0e0: 8059 strhne r1, [r3, #2]
  7998. }
  7999. MEM_STATS_DEC_USED(used, (size - newsize));
  8000. 800b0e2: 4b08 ldr r3, [pc, #32] ; (800b104 <mem_trim+0xd8>)
  8001. 800b0e4: f8b3 10aa ldrh.w r1, [r3, #170] ; 0xaa
  8002. 800b0e8: 1b4d subs r5, r1, r5
  8003. 800b0ea: 1952 adds r2, r2, r5
  8004. 800b0ec: f8a3 20aa strh.w r2, [r3, #170] ; 0xaa
  8005. 800b0f0: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  8006. /* every data block must be at least MIN_SIZE_ALIGNED long */
  8007. newsize = MIN_SIZE_ALIGNED;
  8008. }
  8009. if (newsize > MEM_SIZE_ALIGNED) {
  8010. return NULL;
  8011. 800b0f4: 2000 movs r0, #0
  8012. #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  8013. mem_free_count = 1;
  8014. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8015. LWIP_MEM_FREE_UNPROTECT();
  8016. return rmem;
  8017. }
  8018. 800b0f6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  8019. 800b0fa: bf00 nop
  8020. 800b0fc: 2000013c .word 0x2000013c
  8021. 800b100: 20000138 .word 0x20000138
  8022. 800b104: 20008220 .word 0x20008220
  8023. 800b108: 20000134 .word 0x20000134
  8024. 0800b10c <mem_malloc>:
  8025. *
  8026. * Note that the returned value will always be aligned (as defined by MEM_ALIGNMENT).
  8027. */
  8028. void *
  8029. mem_malloc(mem_size_t size)
  8030. {
  8031. 800b10c: b5f0 push {r4, r5, r6, r7, lr}
  8032. #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  8033. u8_t local_mem_free_count = 0;
  8034. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8035. LWIP_MEM_ALLOC_DECL_PROTECT();
  8036. if (size == 0) {
  8037. 800b10e: 2800 cmp r0, #0
  8038. 800b110: d073 beq.n 800b1fa <mem_malloc+0xee>
  8039. return NULL;
  8040. }
  8041. /* Expand the size of the allocated memory region so that we can
  8042. adjust for alignment. */
  8043. size = LWIP_MEM_ALIGN_SIZE(size);
  8044. 800b112: 3003 adds r0, #3
  8045. 800b114: f64f 73fc movw r3, #65532 ; 0xfffc
  8046. 800b118: 4003 ands r3, r0
  8047. if(size < MIN_SIZE_ALIGNED) {
  8048. 800b11a: 2b0b cmp r3, #11
  8049. 800b11c: d903 bls.n 800b126 <mem_malloc+0x1a>
  8050. /* every data block must be at least MIN_SIZE_ALIGNED long */
  8051. size = MIN_SIZE_ALIGNED;
  8052. }
  8053. if (size > MEM_SIZE_ALIGNED) {
  8054. 800b11e: f5b3 5fa0 cmp.w r3, #5120 ; 0x1400
  8055. 800b122: d901 bls.n 800b128 <mem_malloc+0x1c>
  8056. 800b124: e068 b.n 800b1f8 <mem_malloc+0xec>
  8057. adjust for alignment. */
  8058. size = LWIP_MEM_ALIGN_SIZE(size);
  8059. if(size < MIN_SIZE_ALIGNED) {
  8060. /* every data block must be at least MIN_SIZE_ALIGNED long */
  8061. size = MIN_SIZE_ALIGNED;
  8062. 800b126: 230c movs r3, #12
  8063. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8064. /* Scan through the heap searching for a free block that is big enough,
  8065. * beginning with the lowest free block.
  8066. */
  8067. for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size;
  8068. 800b128: 4a34 ldr r2, [pc, #208] ; (800b1fc <mem_malloc+0xf0>)
  8069. 800b12a: 6816 ldr r6, [r2, #0]
  8070. 800b12c: 4a34 ldr r2, [pc, #208] ; (800b200 <mem_malloc+0xf4>)
  8071. 800b12e: 6812 ldr r2, [r2, #0]
  8072. 800b130: 1ab1 subs r1, r6, r2
  8073. 800b132: b289 uxth r1, r1
  8074. 800b134: f5c3 57a0 rsb r7, r3, #5120 ; 0x1400
  8075. 800b138: e056 b.n 800b1e8 <mem_malloc+0xdc>
  8076. ptr = ((struct mem *)(void *)&ram[ptr])->next) {
  8077. mem = (struct mem *)(void *)&ram[ptr];
  8078. 800b13a: 1850 adds r0, r2, r1
  8079. local_mem_free_count = 1;
  8080. break;
  8081. }
  8082. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8083. if ((!mem->used) &&
  8084. 800b13c: f890 c004 ldrb.w ip, [r0, #4]
  8085. 800b140: f1bc 0f00 cmp.w ip, #0
  8086. 800b144: d14f bne.n 800b1e6 <mem_malloc+0xda>
  8087. (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) {
  8088. 800b146: 5a55 ldrh r5, [r2, r1]
  8089. 800b148: f1a5 0408 sub.w r4, r5, #8
  8090. 800b14c: 1a64 subs r4, r4, r1
  8091. local_mem_free_count = 1;
  8092. break;
  8093. }
  8094. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8095. if ((!mem->used) &&
  8096. 800b14e: 429c cmp r4, r3
  8097. 800b150: d349 bcc.n 800b1e6 <mem_malloc+0xda>
  8098. (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) {
  8099. /* mem is not used and at least perfect fit is possible:
  8100. * mem->next - (ptr + SIZEOF_STRUCT_MEM) gives us the 'user data size' of mem */
  8101. if (mem->next - (ptr + SIZEOF_STRUCT_MEM) >= (size + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED)) {
  8102. 800b152: f103 0714 add.w r7, r3, #20
  8103. 800b156: 42bc cmp r4, r7
  8104. 800b158: d320 bcc.n 800b19c <mem_malloc+0x90>
  8105. * struct mem would fit in but no data between mem2 and mem2->next
  8106. * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
  8107. * region that couldn't hold data, but when mem->next gets freed,
  8108. * the 2 regions would be combined, resulting in more free memory
  8109. */
  8110. ptr2 = ptr + SIZEOF_STRUCT_MEM + size;
  8111. 800b15a: f103 0408 add.w r4, r3, #8
  8112. 800b15e: 190c adds r4, r1, r4
  8113. 800b160: b2a4 uxth r4, r4
  8114. /* create mem2 struct */
  8115. mem2 = (struct mem *)(void *)&ram[ptr2];
  8116. 800b162: 1917 adds r7, r2, r4
  8117. mem2->used = 0;
  8118. mem2->next = mem->next;
  8119. 800b164: 5315 strh r5, [r2, r4]
  8120. mem2->prev = ptr;
  8121. 800b166: 8079 strh r1, [r7, #2]
  8122. /* and insert it between mem and mem->next */
  8123. mem->next = ptr2;
  8124. 800b168: 8004 strh r4, [r0, #0]
  8125. mem->used = 1;
  8126. 800b16a: 2101 movs r1, #1
  8127. * the 2 regions would be combined, resulting in more free memory
  8128. */
  8129. ptr2 = ptr + SIZEOF_STRUCT_MEM + size;
  8130. /* create mem2 struct */
  8131. mem2 = (struct mem *)(void *)&ram[ptr2];
  8132. mem2->used = 0;
  8133. 800b16c: f887 c004 strb.w ip, [r7, #4]
  8134. mem2->next = mem->next;
  8135. mem2->prev = ptr;
  8136. /* and insert it between mem and mem->next */
  8137. mem->next = ptr2;
  8138. mem->used = 1;
  8139. 800b170: 7101 strb r1, [r0, #4]
  8140. if (mem2->next != MEM_SIZE_ALIGNED) {
  8141. 800b172: 5b11 ldrh r1, [r2, r4]
  8142. 800b174: f5b1 5fa0 cmp.w r1, #5120 ; 0x1400
  8143. ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
  8144. 800b178: bf1c itt ne
  8145. 800b17a: 1852 addne r2, r2, r1
  8146. 800b17c: 8054 strhne r4, [r2, #2]
  8147. }
  8148. MEM_STATS_INC_USED(used, (size + SIZEOF_STRUCT_MEM));
  8149. 800b17e: 4a21 ldr r2, [pc, #132] ; (800b204 <mem_malloc+0xf8>)
  8150. 800b180: f8b2 10aa ldrh.w r1, [r2, #170] ; 0xaa
  8151. 800b184: 3108 adds r1, #8
  8152. 800b186: 185b adds r3, r3, r1
  8153. 800b188: f8b2 10ac ldrh.w r1, [r2, #172] ; 0xac
  8154. 800b18c: b29b uxth r3, r3
  8155. 800b18e: 4299 cmp r1, r3
  8156. 800b190: f8a2 30aa strh.w r3, [r2, #170] ; 0xaa
  8157. 800b194: d213 bcs.n 800b1be <mem_malloc+0xb2>
  8158. 800b196: f8a2 30ac strh.w r3, [r2, #172] ; 0xac
  8159. 800b19a: e010 b.n 800b1be <mem_malloc+0xb2>
  8160. * take care of this).
  8161. * -> near fit or excact fit: do not split, no mem2 creation
  8162. * also can't move mem->next directly behind mem, since mem->next
  8163. * will always be used at this point!
  8164. */
  8165. mem->used = 1;
  8166. 800b19c: 2301 movs r3, #1
  8167. 800b19e: 7103 strb r3, [r0, #4]
  8168. MEM_STATS_INC_USED(used, mem->next - (mem_size_t)((u8_t *)mem - ram));
  8169. 800b1a0: 4b18 ldr r3, [pc, #96] ; (800b204 <mem_malloc+0xf8>)
  8170. 800b1a2: f8b3 10aa ldrh.w r1, [r3, #170] ; 0xaa
  8171. 800b1a6: 1a82 subs r2, r0, r2
  8172. 800b1a8: 186d adds r5, r5, r1
  8173. 800b1aa: 1aaa subs r2, r5, r2
  8174. 800b1ac: f8b3 10ac ldrh.w r1, [r3, #172] ; 0xac
  8175. 800b1b0: b292 uxth r2, r2
  8176. 800b1b2: 4291 cmp r1, r2
  8177. 800b1b4: f8a3 20aa strh.w r2, [r3, #170] ; 0xaa
  8178. 800b1b8: bf38 it cc
  8179. 800b1ba: f8a3 20ac strhcc.w r2, [r3, #172] ; 0xac
  8180. }
  8181. #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  8182. mem_malloc_adjust_lfree:
  8183. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8184. if (mem == lfree) {
  8185. 800b1be: 42b0 cmp r0, r6
  8186. 800b1c0: d10f bne.n 800b1e2 <mem_malloc+0xd6>
  8187. struct mem *cur = lfree;
  8188. /* Find next free block after mem and update lowest free pointer */
  8189. while (cur->used && cur != ram_end) {
  8190. 800b1c2: 4b11 ldr r3, [pc, #68] ; (800b208 <mem_malloc+0xfc>)
  8191. 800b1c4: 681a ldr r2, [r3, #0]
  8192. /* If mem_free or mem_trim have run, we have to restart since they
  8193. could have altered our current struct mem or lfree. */
  8194. goto mem_malloc_adjust_lfree;
  8195. }
  8196. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8197. cur = (struct mem *)(void *)&ram[cur->next];
  8198. 800b1c6: 4b0e ldr r3, [pc, #56] ; (800b200 <mem_malloc+0xf4>)
  8199. 800b1c8: 6819 ldr r1, [r3, #0]
  8200. 800b1ca: 4603 mov r3, r0
  8201. 800b1cc: e001 b.n 800b1d2 <mem_malloc+0xc6>
  8202. 800b1ce: 881b ldrh r3, [r3, #0]
  8203. 800b1d0: 18cb adds r3, r1, r3
  8204. mem_malloc_adjust_lfree:
  8205. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8206. if (mem == lfree) {
  8207. struct mem *cur = lfree;
  8208. /* Find next free block after mem and update lowest free pointer */
  8209. while (cur->used && cur != ram_end) {
  8210. 800b1d2: 791c ldrb r4, [r3, #4]
  8211. 800b1d4: b914 cbnz r4, 800b1dc <mem_malloc+0xd0>
  8212. goto mem_malloc_adjust_lfree;
  8213. }
  8214. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8215. cur = (struct mem *)(void *)&ram[cur->next];
  8216. }
  8217. lfree = cur;
  8218. 800b1d6: 4a09 ldr r2, [pc, #36] ; (800b1fc <mem_malloc+0xf0>)
  8219. 800b1d8: 6013 str r3, [r2, #0]
  8220. 800b1da: e002 b.n 800b1e2 <mem_malloc+0xd6>
  8221. mem_malloc_adjust_lfree:
  8222. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8223. if (mem == lfree) {
  8224. struct mem *cur = lfree;
  8225. /* Find next free block after mem and update lowest free pointer */
  8226. while (cur->used && cur != ram_end) {
  8227. 800b1dc: 4293 cmp r3, r2
  8228. 800b1de: d1f6 bne.n 800b1ce <mem_malloc+0xc2>
  8229. 800b1e0: e7f9 b.n 800b1d6 <mem_malloc+0xca>
  8230. LWIP_ASSERT("mem_malloc: allocated memory properly aligned.",
  8231. ((mem_ptr_t)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0);
  8232. LWIP_ASSERT("mem_malloc: sanity check alignment",
  8233. (((mem_ptr_t)mem) & (MEM_ALIGNMENT-1)) == 0);
  8234. return (u8_t *)mem + SIZEOF_STRUCT_MEM;
  8235. 800b1e2: 3008 adds r0, #8
  8236. 800b1e4: bdf0 pop {r4, r5, r6, r7, pc}
  8237. /* Scan through the heap searching for a free block that is big enough,
  8238. * beginning with the lowest free block.
  8239. */
  8240. for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size;
  8241. ptr = ((struct mem *)(void *)&ram[ptr])->next) {
  8242. 800b1e6: 8801 ldrh r1, [r0, #0]
  8243. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8244. /* Scan through the heap searching for a free block that is big enough,
  8245. * beginning with the lowest free block.
  8246. */
  8247. for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size;
  8248. 800b1e8: 42b9 cmp r1, r7
  8249. 800b1ea: dba6 blt.n 800b13a <mem_malloc+0x2e>
  8250. #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
  8251. /* if we got interrupted by a mem_free, try again */
  8252. } while(local_mem_free_count != 0);
  8253. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8254. LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size));
  8255. MEM_STATS_INC(err);
  8256. 800b1ec: 4b05 ldr r3, [pc, #20] ; (800b204 <mem_malloc+0xf8>)
  8257. 800b1ee: f8b3 20ae ldrh.w r2, [r3, #174] ; 0xae
  8258. 800b1f2: 3201 adds r2, #1
  8259. 800b1f4: f8a3 20ae strh.w r2, [r3, #174] ; 0xae
  8260. u8_t local_mem_free_count = 0;
  8261. #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
  8262. LWIP_MEM_ALLOC_DECL_PROTECT();
  8263. if (size == 0) {
  8264. return NULL;
  8265. 800b1f8: 2000 movs r0, #0
  8266. LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size));
  8267. MEM_STATS_INC(err);
  8268. LWIP_MEM_ALLOC_UNPROTECT();
  8269. sys_mutex_unlock(&mem_mutex);
  8270. return NULL;
  8271. }
  8272. 800b1fa: bdf0 pop {r4, r5, r6, r7, pc}
  8273. 800b1fc: 20000134 .word 0x20000134
  8274. 800b200: 2000013c .word 0x2000013c
  8275. 800b204: 20008220 .word 0x20008220
  8276. 800b208: 20000138 .word 0x20000138
  8277. 0800b20c <memp_init>:
  8278. *
  8279. * Carves out memp_memory into linked lists for each pool-type.
  8280. */
  8281. void
  8282. memp_init(void)
  8283. {
  8284. 800b20c: b5f0 push {r4, r5, r6, r7, lr}
  8285. 800b20e: 2200 movs r2, #0
  8286. 800b210: 4b16 ldr r3, [pc, #88] ; (800b26c <memp_init+0x60>)
  8287. for (i = 0; i < MEMP_MAX; ++i) {
  8288. MEMP_STATS_AVAIL(used, i, 0);
  8289. MEMP_STATS_AVAIL(max, i, 0);
  8290. MEMP_STATS_AVAIL(err, i, 0);
  8291. MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  8292. 800b212: 4c17 ldr r4, [pc, #92] ; (800b270 <memp_init+0x64>)
  8293. {
  8294. struct memp *memp;
  8295. u16_t i, j;
  8296. for (i = 0; i < MEMP_MAX; ++i) {
  8297. MEMP_STATS_AVAIL(used, i, 0);
  8298. 800b214: 4611 mov r1, r2
  8299. MEMP_STATS_AVAIL(max, i, 0);
  8300. MEMP_STATS_AVAIL(err, i, 0);
  8301. MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  8302. 800b216: 5b10 ldrh r0, [r2, r4]
  8303. {
  8304. struct memp *memp;
  8305. u16_t i, j;
  8306. for (i = 0; i < MEMP_MAX; ++i) {
  8307. MEMP_STATS_AVAIL(used, i, 0);
  8308. 800b218: f8a3 10b4 strh.w r1, [r3, #180] ; 0xb4
  8309. 800b21c: 3202 adds r2, #2
  8310. MEMP_STATS_AVAIL(max, i, 0);
  8311. 800b21e: f8a3 10b6 strh.w r1, [r3, #182] ; 0xb6
  8312. MEMP_STATS_AVAIL(err, i, 0);
  8313. 800b222: f8a3 10b8 strh.w r1, [r3, #184] ; 0xb8
  8314. MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  8315. 800b226: f8a3 00b2 strh.w r0, [r3, #178] ; 0xb2
  8316. 800b22a: 330a adds r3, #10
  8317. memp_init(void)
  8318. {
  8319. struct memp *memp;
  8320. u16_t i, j;
  8321. for (i = 0; i < MEMP_MAX; ++i) {
  8322. 800b22c: 2a14 cmp r2, #20
  8323. 800b22e: d1f2 bne.n 800b216 <memp_init+0xa>
  8324. MEMP_STATS_AVAIL(err, i, 0);
  8325. MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  8326. }
  8327. #if !MEMP_SEPARATE_POOLS
  8328. memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
  8329. 800b230: 4a10 ldr r2, [pc, #64] ; (800b274 <memp_init+0x68>)
  8330. 800b232: 4911 ldr r1, [pc, #68] ; (800b278 <memp_init+0x6c>)
  8331. memp_tab[i] = NULL;
  8332. #if MEMP_SEPARATE_POOLS
  8333. memp = (struct memp*)memp_bases[i];
  8334. #endif /* MEMP_SEPARATE_POOLS */
  8335. /* create a linked list of memp elements */
  8336. for (j = 0; j < memp_num[i]; ++j) {
  8337. 800b234: 4e0e ldr r6, [pc, #56] ; (800b270 <memp_init+0x64>)
  8338. memp->next = memp_tab[i];
  8339. memp_tab[i] = memp;
  8340. memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
  8341. 800b236: 4f11 ldr r7, [pc, #68] ; (800b27c <memp_init+0x70>)
  8342. MEMP_STATS_AVAIL(err, i, 0);
  8343. MEMP_STATS_AVAIL(avail, i, memp_num[i]);
  8344. }
  8345. #if !MEMP_SEPARATE_POOLS
  8346. memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
  8347. 800b238: 2300 movs r3, #0
  8348. 800b23a: f022 0203 bic.w r2, r2, #3
  8349. #endif /* !MEMP_SEPARATE_POOLS */
  8350. /* for every pool: */
  8351. for (i = 0; i < MEMP_MAX; ++i) {
  8352. memp_tab[i] = NULL;
  8353. 800b23e: 461d mov r5, r3
  8354. 800b240: f841 5b04 str.w r5, [r1], #4
  8355. #if MEMP_SEPARATE_POOLS
  8356. memp = (struct memp*)memp_bases[i];
  8357. #endif /* MEMP_SEPARATE_POOLS */
  8358. /* create a linked list of memp elements */
  8359. for (j = 0; j < memp_num[i]; ++j) {
  8360. 800b244: f833 c006 ldrh.w ip, [r3, r6]
  8361. 800b248: 2000 movs r0, #0
  8362. 800b24a: e008 b.n 800b25e <memp_init+0x52>
  8363. memp->next = memp_tab[i];
  8364. 800b24c: f851 4c04 ldr.w r4, [r1, #-4]
  8365. 800b250: 6014 str r4, [r2, #0]
  8366. memp_tab[i] = memp;
  8367. memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
  8368. 800b252: 5bdc ldrh r4, [r3, r7]
  8369. memp = (struct memp*)memp_bases[i];
  8370. #endif /* MEMP_SEPARATE_POOLS */
  8371. /* create a linked list of memp elements */
  8372. for (j = 0; j < memp_num[i]; ++j) {
  8373. memp->next = memp_tab[i];
  8374. memp_tab[i] = memp;
  8375. 800b254: f841 2c04 str.w r2, [r1, #-4]
  8376. memp_tab[i] = NULL;
  8377. #if MEMP_SEPARATE_POOLS
  8378. memp = (struct memp*)memp_bases[i];
  8379. #endif /* MEMP_SEPARATE_POOLS */
  8380. /* create a linked list of memp elements */
  8381. for (j = 0; j < memp_num[i]; ++j) {
  8382. 800b258: 3001 adds r0, #1
  8383. memp->next = memp_tab[i];
  8384. memp_tab[i] = memp;
  8385. memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
  8386. 800b25a: 1912 adds r2, r2, r4
  8387. memp_tab[i] = NULL;
  8388. #if MEMP_SEPARATE_POOLS
  8389. memp = (struct memp*)memp_bases[i];
  8390. #endif /* MEMP_SEPARATE_POOLS */
  8391. /* create a linked list of memp elements */
  8392. for (j = 0; j < memp_num[i]; ++j) {
  8393. 800b25c: b280 uxth r0, r0
  8394. 800b25e: 4560 cmp r0, ip
  8395. 800b260: d1f4 bne.n 800b24c <memp_init+0x40>
  8396. 800b262: 3302 adds r3, #2
  8397. #if !MEMP_SEPARATE_POOLS
  8398. memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
  8399. #endif /* !MEMP_SEPARATE_POOLS */
  8400. /* for every pool: */
  8401. for (i = 0; i < MEMP_MAX; ++i) {
  8402. 800b264: 2b14 cmp r3, #20
  8403. 800b266: d1eb bne.n 800b240 <memp_init+0x34>
  8404. #if MEMP_OVERFLOW_CHECK
  8405. memp_overflow_init();
  8406. /* check everything a first time to see if it worked */
  8407. memp_overflow_check_all();
  8408. #endif /* MEMP_OVERFLOW_CHECK */
  8409. }
  8410. 800b268: bdf0 pop {r4, r5, r6, r7, pc}
  8411. 800b26a: bf00 nop
  8412. 800b26c: 20008220 .word 0x20008220
  8413. 800b270: 08011830 .word 0x08011830
  8414. 800b274: 20000143 .word 0x20000143
  8415. 800b278: 20006b4c .word 0x20006b4c
  8416. 800b27c: 08011844 .word 0x08011844
  8417. 0800b280 <memp_malloc>:
  8418. #endif
  8419. {
  8420. struct memp *memp;
  8421. SYS_ARCH_DECL_PROTECT(old_level);
  8422. LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
  8423. 800b280: 2809 cmp r0, #9
  8424. #if !MEMP_OVERFLOW_CHECK
  8425. memp_malloc(memp_t type)
  8426. #else
  8427. memp_malloc_fn(memp_t type, const char* file, const int line)
  8428. #endif
  8429. {
  8430. 800b282: b530 push {r4, r5, lr}
  8431. 800b284: 4603 mov r3, r0
  8432. struct memp *memp;
  8433. SYS_ARCH_DECL_PROTECT(old_level);
  8434. LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
  8435. 800b286: d81f bhi.n 800b2c8 <memp_malloc+0x48>
  8436. SYS_ARCH_PROTECT(old_level);
  8437. #if MEMP_OVERFLOW_CHECK >= 2
  8438. memp_overflow_check_all();
  8439. #endif /* MEMP_OVERFLOW_CHECK >= 2 */
  8440. memp = memp_tab[type];
  8441. 800b288: 4c10 ldr r4, [pc, #64] ; (800b2cc <memp_malloc+0x4c>)
  8442. 800b28a: 4a11 ldr r2, [pc, #68] ; (800b2d0 <memp_malloc+0x50>)
  8443. 800b28c: f854 0020 ldr.w r0, [r4, r0, lsl #2]
  8444. 800b290: 210a movs r1, #10
  8445. if (memp != NULL) {
  8446. 800b292: b188 cbz r0, 800b2b8 <memp_malloc+0x38>
  8447. memp_tab[type] = memp->next;
  8448. 800b294: 6805 ldr r5, [r0, #0]
  8449. 800b296: f844 5023 str.w r5, [r4, r3, lsl #2]
  8450. #if MEMP_OVERFLOW_CHECK
  8451. memp->next = NULL;
  8452. memp->file = file;
  8453. memp->line = line;
  8454. #endif /* MEMP_OVERFLOW_CHECK */
  8455. MEMP_STATS_INC_USED(used, type);
  8456. 800b29a: fb01 2303 mla r3, r1, r3, r2
  8457. 800b29e: f8b3 20b4 ldrh.w r2, [r3, #180] ; 0xb4
  8458. 800b2a2: f8b3 10b6 ldrh.w r1, [r3, #182] ; 0xb6
  8459. 800b2a6: 3201 adds r2, #1
  8460. 800b2a8: b292 uxth r2, r2
  8461. 800b2aa: 4291 cmp r1, r2
  8462. 800b2ac: f8a3 20b4 strh.w r2, [r3, #180] ; 0xb4
  8463. 800b2b0: d20b bcs.n 800b2ca <memp_malloc+0x4a>
  8464. 800b2b2: f8a3 20b6 strh.w r2, [r3, #182] ; 0xb6
  8465. 800b2b6: bd30 pop {r4, r5, pc}
  8466. LWIP_ASSERT("memp_malloc: memp properly aligned",
  8467. ((mem_ptr_t)memp % MEM_ALIGNMENT) == 0);
  8468. memp = (struct memp*)(void *)((u8_t*)memp + MEMP_SIZE);
  8469. } else {
  8470. LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", memp_desc[type]));
  8471. MEMP_STATS_INC(err, type);
  8472. 800b2b8: fb01 2303 mla r3, r1, r3, r2
  8473. 800b2bc: f8b3 20b8 ldrh.w r2, [r3, #184] ; 0xb8
  8474. 800b2c0: 3201 adds r2, #1
  8475. 800b2c2: f8a3 20b8 strh.w r2, [r3, #184] ; 0xb8
  8476. 800b2c6: bd30 pop {r4, r5, pc}
  8477. #endif
  8478. {
  8479. struct memp *memp;
  8480. SYS_ARCH_DECL_PROTECT(old_level);
  8481. LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
  8482. 800b2c8: 2000 movs r0, #0
  8483. }
  8484. SYS_ARCH_UNPROTECT(old_level);
  8485. return memp;
  8486. }
  8487. 800b2ca: bd30 pop {r4, r5, pc}
  8488. 800b2cc: 20006b4c .word 0x20006b4c
  8489. 800b2d0: 20008220 .word 0x20008220
  8490. 0800b2d4 <memp_free>:
  8491. memp_free(memp_t type, void *mem)
  8492. {
  8493. struct memp *memp;
  8494. SYS_ARCH_DECL_PROTECT(old_level);
  8495. if (mem == NULL) {
  8496. 800b2d4: b171 cbz r1, 800b2f4 <memp_free+0x20>
  8497. memp_overflow_check_element_overflow(memp, type);
  8498. memp_overflow_check_element_underflow(memp, type);
  8499. #endif /* MEMP_OVERFLOW_CHECK >= 2 */
  8500. #endif /* MEMP_OVERFLOW_CHECK */
  8501. MEMP_STATS_DEC(used, type);
  8502. 800b2d6: 4b08 ldr r3, [pc, #32] ; (800b2f8 <memp_free+0x24>)
  8503. 800b2d8: 220a movs r2, #10
  8504. 800b2da: fb02 3300 mla r3, r2, r0, r3
  8505. 800b2de: f8b3 20b4 ldrh.w r2, [r3, #180] ; 0xb4
  8506. 800b2e2: 3a01 subs r2, #1
  8507. 800b2e4: f8a3 20b4 strh.w r2, [r3, #180] ; 0xb4
  8508. memp->next = memp_tab[type];
  8509. 800b2e8: 4b04 ldr r3, [pc, #16] ; (800b2fc <memp_free+0x28>)
  8510. 800b2ea: f853 2020 ldr.w r2, [r3, r0, lsl #2]
  8511. 800b2ee: 600a str r2, [r1, #0]
  8512. memp_tab[type] = memp;
  8513. 800b2f0: f843 1020 str.w r1, [r3, r0, lsl #2]
  8514. 800b2f4: 4770 bx lr
  8515. 800b2f6: bf00 nop
  8516. 800b2f8: 20008220 .word 0x20008220
  8517. 800b2fc: 20006b4c .word 0x20006b4c
  8518. 0800b300 <netif_init>:
  8519. }
  8520. #endif /* LWIP_HAVE_LOOPIF */
  8521. void
  8522. netif_init(void)
  8523. {
  8524. 800b300: 4770 bx lr
  8525. 800b302: 0000 movs r0, r0
  8526. 0800b304 <netif_set_ipaddr>:
  8527. * @note call netif_set_addr() if you also want to change netmask and
  8528. * default gateway
  8529. */
  8530. void
  8531. netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
  8532. {
  8533. 800b304: b570 push {r4, r5, r6, lr}
  8534. 800b306: 4605 mov r5, r0
  8535. #if LWIP_TCP
  8536. struct tcp_pcb *pcb;
  8537. struct tcp_pcb_listen *lpcb;
  8538. /* address is actually being changed? */
  8539. if (ipaddr && (ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
  8540. 800b308: 460c mov r4, r1
  8541. 800b30a: b1f1 cbz r1, 800b34a <netif_set_ipaddr+0x46>
  8542. 800b30c: 680a ldr r2, [r1, #0]
  8543. 800b30e: 6843 ldr r3, [r0, #4]
  8544. 800b310: 429a cmp r2, r3
  8545. 800b312: d01c beq.n 800b34e <netif_set_ipaddr+0x4a>
  8546. /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
  8547. LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n"));
  8548. pcb = tcp_active_pcbs;
  8549. 800b314: 4b0f ldr r3, [pc, #60] ; (800b354 <netif_set_ipaddr+0x50>)
  8550. 800b316: 6818 ldr r0, [r3, #0]
  8551. while (pcb != NULL) {
  8552. 800b318: e007 b.n 800b32a <netif_set_ipaddr+0x26>
  8553. /* PCB bound to current local interface address? */
  8554. if (ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))
  8555. 800b31a: 6801 ldr r1, [r0, #0]
  8556. 800b31c: 686a ldr r2, [r5, #4]
  8557. 800b31e: 68c6 ldr r6, [r0, #12]
  8558. 800b320: 4291 cmp r1, r2
  8559. 800b322: d101 bne.n 800b328 <netif_set_ipaddr+0x24>
  8560. #endif /* LWIP_AUTOIP */
  8561. ) {
  8562. /* this connection must be aborted */
  8563. struct tcp_pcb *next = pcb->next;
  8564. LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb));
  8565. tcp_abort(pcb);
  8566. 800b324: f000 fdae bl 800be84 <tcp_abort>
  8567. pcb = next;
  8568. } else {
  8569. pcb = pcb->next;
  8570. 800b328: 4630 mov r0, r6
  8571. /* address is actually being changed? */
  8572. if (ipaddr && (ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
  8573. /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
  8574. LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n"));
  8575. pcb = tcp_active_pcbs;
  8576. while (pcb != NULL) {
  8577. 800b32a: 2800 cmp r0, #0
  8578. 800b32c: d1f5 bne.n 800b31a <netif_set_ipaddr+0x16>
  8579. pcb = next;
  8580. } else {
  8581. pcb = pcb->next;
  8582. }
  8583. }
  8584. for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  8585. 800b32e: 4b0a ldr r3, [pc, #40] ; (800b358 <netif_set_ipaddr+0x54>)
  8586. 800b330: 681b ldr r3, [r3, #0]
  8587. 800b332: e007 b.n 800b344 <netif_set_ipaddr+0x40>
  8588. /* PCB bound to current local interface address? */
  8589. if ((!(ip_addr_isany(&(lpcb->local_ip)))) &&
  8590. 800b334: 681a ldr r2, [r3, #0]
  8591. 800b336: b122 cbz r2, 800b342 <netif_set_ipaddr+0x3e>
  8592. 800b338: 6869 ldr r1, [r5, #4]
  8593. 800b33a: 428a cmp r2, r1
  8594. (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr)))) {
  8595. /* The PCB is listening to the old ipaddr and
  8596. * is set to listen to the new one instead */
  8597. ip_addr_set(&(lpcb->local_ip), ipaddr);
  8598. 800b33c: bf04 itt eq
  8599. 800b33e: 6822 ldreq r2, [r4, #0]
  8600. 800b340: 601a streq r2, [r3, #0]
  8601. pcb = next;
  8602. } else {
  8603. pcb = pcb->next;
  8604. }
  8605. }
  8606. for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  8607. 800b342: 68db ldr r3, [r3, #12]
  8608. 800b344: 2b00 cmp r3, #0
  8609. 800b346: d1f5 bne.n 800b334 <netif_set_ipaddr+0x30>
  8610. 800b348: e001 b.n 800b34e <netif_set_ipaddr+0x4a>
  8611. }
  8612. #endif
  8613. snmp_delete_ipaddridx_tree(netif);
  8614. snmp_delete_iprteidx_tree(0,netif);
  8615. /* set new IP address to netif */
  8616. ip_addr_set(&(netif->ip_addr), ipaddr);
  8617. 800b34a: 606c str r4, [r5, #4]
  8618. 800b34c: bd70 pop {r4, r5, r6, pc}
  8619. 800b34e: 6824 ldr r4, [r4, #0]
  8620. 800b350: e7fb b.n 800b34a <netif_set_ipaddr+0x46>
  8621. 800b352: bf00 nop
  8622. 800b354: 2000833c .word 0x2000833c
  8623. 800b358: 20008344 .word 0x20008344
  8624. 0800b35c <netif_set_addr>:
  8625. * @param gw the new default gateway
  8626. */
  8627. void
  8628. netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
  8629. ip_addr_t *gw)
  8630. {
  8631. 800b35c: b570 push {r4, r5, r6, lr}
  8632. 800b35e: 4614 mov r4, r2
  8633. 800b360: 4606 mov r6, r0
  8634. 800b362: 461d mov r5, r3
  8635. netif_set_ipaddr(netif, ipaddr);
  8636. 800b364: f7ff ffce bl 800b304 <netif_set_ipaddr>
  8637. void
  8638. netif_set_netmask(struct netif *netif, ip_addr_t *netmask)
  8639. {
  8640. snmp_delete_iprteidx_tree(0, netif);
  8641. /* set new netmask to netif */
  8642. ip_addr_set(&(netif->netmask), netmask);
  8643. 800b368: b104 cbz r4, 800b36c <netif_set_addr+0x10>
  8644. 800b36a: 6824 ldr r4, [r4, #0]
  8645. 800b36c: 60b4 str r4, [r6, #8]
  8646. * @note call netif_set_addr() if you also want to change ip address and netmask
  8647. */
  8648. void
  8649. netif_set_gw(struct netif *netif, ip_addr_t *gw)
  8650. {
  8651. ip_addr_set(&(netif->gw), gw);
  8652. 800b36e: b105 cbz r5, 800b372 <netif_set_addr+0x16>
  8653. 800b370: 682d ldr r5, [r5, #0]
  8654. 800b372: 60f5 str r5, [r6, #12]
  8655. 800b374: bd70 pop {r4, r5, r6, pc}
  8656. 800b376: 0000 movs r0, r0
  8657. 0800b378 <netif_add>:
  8658. * @return netif, or NULL if failed.
  8659. */
  8660. struct netif *
  8661. netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
  8662. ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
  8663. {
  8664. 800b378: b5f8 push {r3, r4, r5, r6, r7, lr}
  8665. netif->loop_first = NULL;
  8666. netif->loop_last = NULL;
  8667. #endif /* ENABLE_LOOPBACK */
  8668. /* remember netif specific state information data */
  8669. netif->state = state;
  8670. 800b37a: 9e06 ldr r6, [sp, #24]
  8671. 800b37c: 61c6 str r6, [r0, #28]
  8672. netif->num = netif_num++;
  8673. 800b37e: 4e0f ldr r6, [pc, #60] ; (800b3bc <netif_add+0x44>)
  8674. 800b380: 7837 ldrb r7, [r6, #0]
  8675. 800b382: f880 7030 strb.w r7, [r0, #48] ; 0x30
  8676. 800b386: 3701 adds r7, #1
  8677. 800b388: 7037 strb r7, [r6, #0]
  8678. netif->input = input;
  8679. 800b38a: 9e08 ldr r6, [sp, #32]
  8680. {
  8681. LWIP_ASSERT("No init function given", init != NULL);
  8682. /* reset new interface configuration state */
  8683. ip_addr_set_zero(&netif->ip_addr);
  8684. 800b38c: 2500 movs r5, #0
  8685. * @return netif, or NULL if failed.
  8686. */
  8687. struct netif *
  8688. netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
  8689. ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
  8690. {
  8691. 800b38e: 4604 mov r4, r0
  8692. LWIP_ASSERT("No init function given", init != NULL);
  8693. /* reset new interface configuration state */
  8694. ip_addr_set_zero(&netif->ip_addr);
  8695. 800b390: 6045 str r5, [r0, #4]
  8696. ip_addr_set_zero(&netif->netmask);
  8697. 800b392: 6085 str r5, [r0, #8]
  8698. ip_addr_set_zero(&netif->gw);
  8699. 800b394: 60c5 str r5, [r0, #12]
  8700. netif->flags = 0;
  8701. 800b396: f880 502d strb.w r5, [r0, #45] ; 0x2d
  8702. #if LWIP_DHCP
  8703. /* netif not under DHCP control by default */
  8704. netif->dhcp = NULL;
  8705. 800b39a: 6205 str r5, [r0, #32]
  8706. #endif /* ENABLE_LOOPBACK */
  8707. /* remember netif specific state information data */
  8708. netif->state = state;
  8709. netif->num = netif_num++;
  8710. netif->input = input;
  8711. 800b39c: 6106 str r6, [r0, #16]
  8712. NETIF_SET_HWADDRHINT(netif, NULL);
  8713. #if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
  8714. netif->loop_cnt_current = 0;
  8715. #endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */
  8716. netif_set_addr(netif, ipaddr, netmask, gw);
  8717. 800b39e: f7ff ffdd bl 800b35c <netif_set_addr>
  8718. /* call user specified initialization function for netif */
  8719. if (init(netif) != ERR_OK) {
  8720. 800b3a2: 4620 mov r0, r4
  8721. 800b3a4: 9b07 ldr r3, [sp, #28]
  8722. 800b3a6: 4798 blx r3
  8723. 800b3a8: b920 cbnz r0, 800b3b4 <netif_add+0x3c>
  8724. return NULL;
  8725. }
  8726. /* add this netif to the list */
  8727. netif->next = netif_list;
  8728. 800b3aa: 4b05 ldr r3, [pc, #20] ; (800b3c0 <netif_add+0x48>)
  8729. 800b3ac: 681a ldr r2, [r3, #0]
  8730. 800b3ae: 6022 str r2, [r4, #0]
  8731. netif_list = netif;
  8732. 800b3b0: 601c str r4, [r3, #0]
  8733. LWIP_DEBUGF(NETIF_DEBUG, (" netmask "));
  8734. ip_addr_debug_print(NETIF_DEBUG, netmask);
  8735. LWIP_DEBUGF(NETIF_DEBUG, (" gw "));
  8736. ip_addr_debug_print(NETIF_DEBUG, gw);
  8737. LWIP_DEBUGF(NETIF_DEBUG, ("\n"));
  8738. return netif;
  8739. 800b3b2: e000 b.n 800b3b6 <netif_add+0x3e>
  8740. netif_set_addr(netif, ipaddr, netmask, gw);
  8741. /* call user specified initialization function for netif */
  8742. if (init(netif) != ERR_OK) {
  8743. return NULL;
  8744. 800b3b4: 462c mov r4, r5
  8745. ip_addr_debug_print(NETIF_DEBUG, netmask);
  8746. LWIP_DEBUGF(NETIF_DEBUG, (" gw "));
  8747. ip_addr_debug_print(NETIF_DEBUG, gw);
  8748. LWIP_DEBUGF(NETIF_DEBUG, ("\n"));
  8749. return netif;
  8750. }
  8751. 800b3b6: 4620 mov r0, r4
  8752. 800b3b8: bdf8 pop {r3, r4, r5, r6, r7, pc}
  8753. 800b3ba: bf00 nop
  8754. 800b3bc: 20006b74 .word 0x20006b74
  8755. 800b3c0: 20008218 .word 0x20008218
  8756. 0800b3c4 <netif_set_gw>:
  8757. * @note call netif_set_addr() if you also want to change ip address and netmask
  8758. */
  8759. void
  8760. netif_set_gw(struct netif *netif, ip_addr_t *gw)
  8761. {
  8762. ip_addr_set(&(netif->gw), gw);
  8763. 800b3c4: b101 cbz r1, 800b3c8 <netif_set_gw+0x4>
  8764. 800b3c6: 6809 ldr r1, [r1, #0]
  8765. 800b3c8: 60c1 str r1, [r0, #12]
  8766. 800b3ca: 4770 bx lr
  8767. 0800b3cc <netif_set_netmask>:
  8768. void
  8769. netif_set_netmask(struct netif *netif, ip_addr_t *netmask)
  8770. {
  8771. snmp_delete_iprteidx_tree(0, netif);
  8772. /* set new netmask to netif */
  8773. ip_addr_set(&(netif->netmask), netmask);
  8774. 800b3cc: b101 cbz r1, 800b3d0 <netif_set_netmask+0x4>
  8775. 800b3ce: 6809 ldr r1, [r1, #0]
  8776. 800b3d0: 6081 str r1, [r0, #8]
  8777. 800b3d2: 4770 bx lr
  8778. 0800b3d4 <netif_set_default>:
  8779. snmp_delete_iprteidx_tree(1, netif);
  8780. } else {
  8781. /* install default route */
  8782. snmp_insert_iprteidx_tree(1, netif);
  8783. }
  8784. netif_default = netif;
  8785. 800b3d4: 4b01 ldr r3, [pc, #4] ; (800b3dc <netif_set_default+0x8>)
  8786. 800b3d6: 6018 str r0, [r3, #0]
  8787. 800b3d8: 4770 bx lr
  8788. 800b3da: bf00 nop
  8789. 800b3dc: 2000821c .word 0x2000821c
  8790. 0800b3e0 <netif_set_up>:
  8791. *
  8792. * @see dhcp_start()
  8793. */
  8794. void netif_set_up(struct netif *netif)
  8795. {
  8796. if (!(netif->flags & NETIF_FLAG_UP)) {
  8797. 800b3e0: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
  8798. 800b3e4: 07da lsls r2, r3, #31
  8799. 800b3e6: d40a bmi.n 800b3fe <netif_set_up+0x1e>
  8800. netif->flags |= NETIF_FLAG_UP;
  8801. 800b3e8: f043 0201 orr.w r2, r3, #1
  8802. NETIF_STATUS_CALLBACK(netif);
  8803. if (netif->flags & NETIF_FLAG_LINK_UP) {
  8804. #if LWIP_ARP
  8805. /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */
  8806. if (netif->flags & (NETIF_FLAG_ETHARP)) {
  8807. 800b3ec: f003 0330 and.w r3, r3, #48 ; 0x30
  8808. 800b3f0: 2b30 cmp r3, #48 ; 0x30
  8809. * @see dhcp_start()
  8810. */
  8811. void netif_set_up(struct netif *netif)
  8812. {
  8813. if (!(netif->flags & NETIF_FLAG_UP)) {
  8814. netif->flags |= NETIF_FLAG_UP;
  8815. 800b3f2: f880 202d strb.w r2, [r0, #45] ; 0x2d
  8816. NETIF_STATUS_CALLBACK(netif);
  8817. if (netif->flags & NETIF_FLAG_LINK_UP) {
  8818. #if LWIP_ARP
  8819. /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */
  8820. if (netif->flags & (NETIF_FLAG_ETHARP)) {
  8821. 800b3f6: d102 bne.n 800b3fe <netif_set_up+0x1e>
  8822. etharp_gratuitous(netif);
  8823. 800b3f8: 1d01 adds r1, r0, #4
  8824. 800b3fa: f003 bd97 b.w 800ef2c <etharp_request>
  8825. 800b3fe: 4770 bx lr
  8826. 0800b400 <netif_set_down>:
  8827. *
  8828. * @see dhcp_start()
  8829. */
  8830. void netif_set_down(struct netif *netif)
  8831. {
  8832. if (netif->flags & NETIF_FLAG_UP) {
  8833. 800b400: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
  8834. 800b404: 07d9 lsls r1, r3, #31
  8835. 800b406: d509 bpl.n 800b41c <netif_set_down+0x1c>
  8836. netif->flags &= ~NETIF_FLAG_UP;
  8837. 800b408: f023 0101 bic.w r1, r3, #1
  8838. #if LWIP_SNMP
  8839. snmp_get_sysuptime(&netif->ts);
  8840. #endif
  8841. #if LWIP_ARP
  8842. if (netif->flags & NETIF_FLAG_ETHARP) {
  8843. 800b40c: f003 0320 and.w r3, r3, #32
  8844. 800b410: b2db uxtb r3, r3
  8845. * @see dhcp_start()
  8846. */
  8847. void netif_set_down(struct netif *netif)
  8848. {
  8849. if (netif->flags & NETIF_FLAG_UP) {
  8850. netif->flags &= ~NETIF_FLAG_UP;
  8851. 800b412: f880 102d strb.w r1, [r0, #45] ; 0x2d
  8852. #if LWIP_SNMP
  8853. snmp_get_sysuptime(&netif->ts);
  8854. #endif
  8855. #if LWIP_ARP
  8856. if (netif->flags & NETIF_FLAG_ETHARP) {
  8857. 800b416: b10b cbz r3, 800b41c <netif_set_down+0x1c>
  8858. etharp_cleanup_netif(netif);
  8859. 800b418: f003 bd74 b.w 800ef04 <etharp_cleanup_netif>
  8860. 800b41c: 4770 bx lr
  8861. 0800b41e <pbuf_alloced_custom>:
  8862. * big enough to hold 'length' plus the header size
  8863. */
  8864. struct pbuf*
  8865. pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p,
  8866. void *payload_mem, u16_t payload_mem_len)
  8867. {
  8868. 800b41e: b570 push {r4, r5, r6, lr}
  8869. 800b420: 9c04 ldr r4, [sp, #16]
  8870. u16_t offset;
  8871. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloced_custom(length=%"U16_F")\n", length));
  8872. /* determine header offset */
  8873. switch (l) {
  8874. 800b422: 2803 cmp r0, #3
  8875. 800b424: d821 bhi.n 800b46a <pbuf_alloced_custom+0x4c>
  8876. 800b426: e8df f000 tbb [pc, r0]
  8877. 800b42a: 0802 .short 0x0802
  8878. 800b42c: 0604 .short 0x0604
  8879. case PBUF_TRANSPORT:
  8880. /* add room for transport (often TCP) layer header */
  8881. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
  8882. 800b42e: 2036 movs r0, #54 ; 0x36
  8883. 800b430: e004 b.n 800b43c <pbuf_alloced_custom+0x1e>
  8884. /* add room for IP layer header */
  8885. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
  8886. break;
  8887. case PBUF_LINK:
  8888. /* add room for link layer header */
  8889. offset = PBUF_LINK_HLEN;
  8890. 800b432: 200e movs r0, #14
  8891. break;
  8892. 800b434: e002 b.n 800b43c <pbuf_alloced_custom+0x1e>
  8893. case PBUF_RAW:
  8894. offset = 0;
  8895. 800b436: 2000 movs r0, #0
  8896. break;
  8897. 800b438: e000 b.n 800b43c <pbuf_alloced_custom+0x1e>
  8898. /* add room for transport (often TCP) layer header */
  8899. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
  8900. break;
  8901. case PBUF_IP:
  8902. /* add room for IP layer header */
  8903. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
  8904. 800b43a: 2022 movs r0, #34 ; 0x22
  8905. default:
  8906. LWIP_ASSERT("pbuf_alloced_custom: bad pbuf layer", 0);
  8907. return NULL;
  8908. }
  8909. if (LWIP_MEM_ALIGN_SIZE(offset) + length > payload_mem_len) {
  8910. 800b43c: 3003 adds r0, #3
  8911. 800b43e: f020 0503 bic.w r5, r0, #3
  8912. 800b442: f8bd 0014 ldrh.w r0, [sp, #20]
  8913. 800b446: 186e adds r6, r5, r1
  8914. 800b448: 4286 cmp r6, r0
  8915. 800b44a: f04f 0000 mov.w r0, #0
  8916. 800b44e: dc0d bgt.n 800b46c <pbuf_alloced_custom+0x4e>
  8917. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_WARNING, ("pbuf_alloced_custom(length=%"U16_F") buffer too short\n", length));
  8918. return NULL;
  8919. }
  8920. p->pbuf.next = NULL;
  8921. 800b450: 6018 str r0, [r3, #0]
  8922. if (payload_mem != NULL) {
  8923. 800b452: b104 cbz r4, 800b456 <pbuf_alloced_custom+0x38>
  8924. p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
  8925. 800b454: 1964 adds r4, r4, r5
  8926. } else {
  8927. p->pbuf.payload = NULL;
  8928. }
  8929. p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
  8930. 800b456: 2002 movs r0, #2
  8931. p->pbuf.len = p->pbuf.tot_len = length;
  8932. p->pbuf.type = type;
  8933. 800b458: 731a strb r2, [r3, #12]
  8934. p->pbuf.ref = 1;
  8935. 800b45a: 2201 movs r2, #1
  8936. if (payload_mem != NULL) {
  8937. p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
  8938. } else {
  8939. p->pbuf.payload = NULL;
  8940. }
  8941. p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
  8942. 800b45c: 7358 strb r0, [r3, #13]
  8943. p->pbuf.next = NULL;
  8944. if (payload_mem != NULL) {
  8945. p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
  8946. } else {
  8947. p->pbuf.payload = NULL;
  8948. 800b45e: 605c str r4, [r3, #4]
  8949. }
  8950. p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
  8951. p->pbuf.len = p->pbuf.tot_len = length;
  8952. 800b460: 8119 strh r1, [r3, #8]
  8953. 800b462: 8159 strh r1, [r3, #10]
  8954. p->pbuf.type = type;
  8955. p->pbuf.ref = 1;
  8956. 800b464: 81da strh r2, [r3, #14]
  8957. return &p->pbuf;
  8958. 800b466: 4618 mov r0, r3
  8959. 800b468: bd70 pop {r4, r5, r6, pc}
  8960. case PBUF_RAW:
  8961. offset = 0;
  8962. break;
  8963. default:
  8964. LWIP_ASSERT("pbuf_alloced_custom: bad pbuf layer", 0);
  8965. return NULL;
  8966. 800b46a: 2000 movs r0, #0
  8967. p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
  8968. p->pbuf.len = p->pbuf.tot_len = length;
  8969. p->pbuf.type = type;
  8970. p->pbuf.ref = 1;
  8971. return &p->pbuf;
  8972. }
  8973. 800b46c: bd70 pop {r4, r5, r6, pc}
  8974. 0800b46e <pbuf_header>:
  8975. * @return non-zero on failure, zero on success.
  8976. *
  8977. */
  8978. u8_t
  8979. pbuf_header(struct pbuf *p, s16_t header_size_increment)
  8980. {
  8981. 800b46e: b510 push {r4, lr}
  8982. u16_t type;
  8983. void *payload;
  8984. u16_t increment_magnitude;
  8985. LWIP_ASSERT("p != NULL", p != NULL);
  8986. if ((header_size_increment == 0) || (p == NULL)) {
  8987. 800b470: b321 cbz r1, 800b4bc <pbuf_header+0x4e>
  8988. 800b472: b330 cbz r0, 800b4c2 <pbuf_header+0x54>
  8989. return 0;
  8990. }
  8991. if (header_size_increment < 0){
  8992. 800b474: 2900 cmp r1, #0
  8993. 800b476: da05 bge.n 800b484 <pbuf_header+0x16>
  8994. increment_magnitude = -header_size_increment;
  8995. 800b478: 424b negs r3, r1
  8996. /* Check that we aren't going to move off the end of the pbuf */
  8997. LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
  8998. 800b47a: 8942 ldrh r2, [r0, #10]
  8999. if ((header_size_increment == 0) || (p == NULL)) {
  9000. return 0;
  9001. }
  9002. if (header_size_increment < 0){
  9003. increment_magnitude = -header_size_increment;
  9004. 800b47c: b29b uxth r3, r3
  9005. /* Check that we aren't going to move off the end of the pbuf */
  9006. LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
  9007. 800b47e: 429a cmp r2, r3
  9008. 800b480: d201 bcs.n 800b486 <pbuf_header+0x18>
  9009. 800b482: e01d b.n 800b4c0 <pbuf_header+0x52>
  9010. } else {
  9011. increment_magnitude = header_size_increment;
  9012. 800b484: b28b uxth r3, r1
  9013. LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF",
  9014. (u8_t *)p->payload - increment_magnitude >= (u8_t *)p + SIZEOF_STRUCT_PBUF);
  9015. #endif
  9016. }
  9017. type = p->type;
  9018. 800b486: 7b02 ldrb r2, [r0, #12]
  9019. /* remember current payload pointer */
  9020. payload = p->payload;
  9021. 800b488: 6844 ldr r4, [r0, #4]
  9022. /* pbuf types containing payloads? */
  9023. if (type == PBUF_RAM || type == PBUF_POOL) {
  9024. 800b48a: b10a cbz r2, 800b490 <pbuf_header+0x22>
  9025. 800b48c: 2a03 cmp r2, #3
  9026. 800b48e: d105 bne.n 800b49c <pbuf_header+0x2e>
  9027. /* set new payload pointer */
  9028. p->payload = (u8_t *)p->payload - header_size_increment;
  9029. 800b490: 1a64 subs r4, r4, r1
  9030. /* boundary check fails? */
  9031. if ((u8_t *)p->payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) {
  9032. 800b492: f100 0310 add.w r3, r0, #16
  9033. 800b496: 429c cmp r4, r3
  9034. 800b498: d312 bcc.n 800b4c0 <pbuf_header+0x52>
  9035. 800b49a: e008 b.n 800b4ae <pbuf_header+0x40>
  9036. p->payload = payload;
  9037. /* bail out unsuccesfully */
  9038. return 1;
  9039. }
  9040. /* pbuf types refering to external payloads? */
  9041. } else if (type == PBUF_REF || type == PBUF_ROM) {
  9042. 800b49c: 3a01 subs r2, #1
  9043. 800b49e: 2a01 cmp r2, #1
  9044. 800b4a0: d80e bhi.n 800b4c0 <pbuf_header+0x52>
  9045. /* hide a header in the payload? */
  9046. if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
  9047. 800b4a2: 2900 cmp r1, #0
  9048. 800b4a4: da0c bge.n 800b4c0 <pbuf_header+0x52>
  9049. 800b4a6: 8942 ldrh r2, [r0, #10]
  9050. 800b4a8: 429a cmp r2, r3
  9051. 800b4aa: d309 bcc.n 800b4c0 <pbuf_header+0x52>
  9052. /* increase payload pointer */
  9053. p->payload = (u8_t *)p->payload - header_size_increment;
  9054. 800b4ac: 1a64 subs r4, r4, r1
  9055. /* Unknown type */
  9056. LWIP_ASSERT("bad pbuf type", 0);
  9057. return 1;
  9058. }
  9059. /* modify pbuf length fields */
  9060. p->len += header_size_increment;
  9061. 800b4ae: 8943 ldrh r3, [r0, #10]
  9062. /* pbuf types refering to external payloads? */
  9063. } else if (type == PBUF_REF || type == PBUF_ROM) {
  9064. /* hide a header in the payload? */
  9065. if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
  9066. /* increase payload pointer */
  9067. p->payload = (u8_t *)p->payload - header_size_increment;
  9068. 800b4b0: 6044 str r4, [r0, #4]
  9069. /* Unknown type */
  9070. LWIP_ASSERT("bad pbuf type", 0);
  9071. return 1;
  9072. }
  9073. /* modify pbuf length fields */
  9074. p->len += header_size_increment;
  9075. 800b4b2: 18cb adds r3, r1, r3
  9076. 800b4b4: 8143 strh r3, [r0, #10]
  9077. p->tot_len += header_size_increment;
  9078. 800b4b6: 8903 ldrh r3, [r0, #8]
  9079. 800b4b8: 18c9 adds r1, r1, r3
  9080. 800b4ba: 8101 strh r1, [r0, #8]
  9081. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%"S16_F")\n",
  9082. (void *)payload, (void *)p->payload, header_size_increment));
  9083. return 0;
  9084. 800b4bc: 2000 movs r0, #0
  9085. 800b4be: bd10 pop {r4, pc}
  9086. }
  9087. if (header_size_increment < 0){
  9088. increment_magnitude = -header_size_increment;
  9089. /* Check that we aren't going to move off the end of the pbuf */
  9090. LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
  9091. 800b4c0: 2001 movs r0, #1
  9092. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%"S16_F")\n",
  9093. (void *)payload, (void *)p->payload, header_size_increment));
  9094. return 0;
  9095. }
  9096. 800b4c2: bd10 pop {r4, pc}
  9097. 0800b4c4 <pbuf_free>:
  9098. * 1->1->1 becomes .......
  9099. *
  9100. */
  9101. u8_t
  9102. pbuf_free(struct pbuf *p)
  9103. {
  9104. 800b4c4: b538 push {r3, r4, r5, lr}
  9105. u16_t type;
  9106. struct pbuf *q;
  9107. u8_t count;
  9108. if (p == NULL) {
  9109. 800b4c6: 4601 mov r1, r0
  9110. 800b4c8: b320 cbz r0, 800b514 <pbuf_free+0x50>
  9111. 800b4ca: 2400 movs r4, #0
  9112. * further protection. */
  9113. SYS_ARCH_PROTECT(old_level);
  9114. /* all pbufs in a chain are referenced at least once */
  9115. LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
  9116. /* decrease reference count (number of pointers to pbuf) */
  9117. ref = --(p->ref);
  9118. 800b4cc: 89cb ldrh r3, [r1, #14]
  9119. 800b4ce: 3b01 subs r3, #1
  9120. 800b4d0: b29b uxth r3, r3
  9121. 800b4d2: 81cb strh r3, [r1, #14]
  9122. SYS_ARCH_UNPROTECT(old_level);
  9123. /* this pbuf is no longer referenced to? */
  9124. if (ref == 0) {
  9125. 800b4d4: b9fb cbnz r3, 800b516 <pbuf_free+0x52>
  9126. q = p->next;
  9127. LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p));
  9128. type = p->type;
  9129. #if LWIP_SUPPORT_CUSTOM_PBUF
  9130. /* is this a custom pbuf? */
  9131. if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) {
  9132. 800b4d6: 7b4a ldrb r2, [r1, #13]
  9133. ref = --(p->ref);
  9134. SYS_ARCH_UNPROTECT(old_level);
  9135. /* this pbuf is no longer referenced to? */
  9136. if (ref == 0) {
  9137. /* remember next pbuf in chain for next iteration */
  9138. q = p->next;
  9139. 800b4d8: 680d ldr r5, [r1, #0]
  9140. LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p));
  9141. type = p->type;
  9142. 800b4da: 7b0b ldrb r3, [r1, #12]
  9143. #if LWIP_SUPPORT_CUSTOM_PBUF
  9144. /* is this a custom pbuf? */
  9145. if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) {
  9146. 800b4dc: f002 0202 and.w r2, r2, #2
  9147. 800b4e0: b2d2 uxtb r2, r2
  9148. 800b4e2: b11a cbz r2, 800b4ec <pbuf_free+0x28>
  9149. struct pbuf_custom *pc = (struct pbuf_custom*)p;
  9150. LWIP_ASSERT("pc->custom_free_function != NULL", pc->custom_free_function != NULL);
  9151. pc->custom_free_function(p);
  9152. 800b4e4: 690b ldr r3, [r1, #16]
  9153. 800b4e6: 4608 mov r0, r1
  9154. 800b4e8: 4798 blx r3
  9155. 800b4ea: e00d b.n 800b508 <pbuf_free+0x44>
  9156. } else
  9157. #endif /* LWIP_SUPPORT_CUSTOM_PBUF */
  9158. {
  9159. /* is this a pbuf from the pool? */
  9160. if (type == PBUF_POOL) {
  9161. 800b4ec: 2b03 cmp r3, #3
  9162. 800b4ee: d101 bne.n 800b4f4 <pbuf_free+0x30>
  9163. memp_free(MEMP_PBUF_POOL, p);
  9164. 800b4f0: 2009 movs r0, #9
  9165. 800b4f2: e003 b.n 800b4fc <pbuf_free+0x38>
  9166. /* is this a ROM or RAM referencing pbuf? */
  9167. } else if (type == PBUF_ROM || type == PBUF_REF) {
  9168. 800b4f4: 3b01 subs r3, #1
  9169. 800b4f6: 2b01 cmp r3, #1
  9170. 800b4f8: d803 bhi.n 800b502 <pbuf_free+0x3e>
  9171. memp_free(MEMP_PBUF, p);
  9172. 800b4fa: 2008 movs r0, #8
  9173. 800b4fc: f7ff feea bl 800b2d4 <memp_free>
  9174. 800b500: e002 b.n 800b508 <pbuf_free+0x44>
  9175. /* type == PBUF_RAM */
  9176. } else {
  9177. mem_free(p);
  9178. 800b502: 4608 mov r0, r1
  9179. 800b504: f7ff fd3c bl 800af80 <mem_free>
  9180. }
  9181. }
  9182. count++;
  9183. 800b508: 3401 adds r4, #1
  9184. 800b50a: b2e4 uxtb r4, r4
  9185. p->type == PBUF_REF || p->type == PBUF_POOL);
  9186. count = 0;
  9187. /* de-allocate all consecutive pbufs from the head of the chain that
  9188. * obtain a zero reference count after decrementing*/
  9189. while (p != NULL) {
  9190. 800b50c: 4629 mov r1, r5
  9191. 800b50e: 2d00 cmp r5, #0
  9192. 800b510: d1dc bne.n 800b4cc <pbuf_free+0x8>
  9193. 800b512: e000 b.n 800b516 <pbuf_free+0x52>
  9194. if (p == NULL) {
  9195. LWIP_ASSERT("p != NULL", p != NULL);
  9196. /* if assertions are disabled, proceed with debug output */
  9197. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
  9198. ("pbuf_free(p == NULL) was called.\n"));
  9199. return 0;
  9200. 800b514: 4604 mov r4, r0
  9201. }
  9202. }
  9203. PERF_STOP("pbuf_free");
  9204. /* return number of de-allocated pbufs */
  9205. return count;
  9206. }
  9207. 800b516: 4620 mov r0, r4
  9208. 800b518: bd38 pop {r3, r4, r5, pc}
  9209. 0800b51a <pbuf_realloc>:
  9210. *
  9211. * @note Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain).
  9212. */
  9213. void
  9214. pbuf_realloc(struct pbuf *p, u16_t new_len)
  9215. {
  9216. 800b51a: b538 push {r3, r4, r5, lr}
  9217. p->type == PBUF_ROM ||
  9218. p->type == PBUF_RAM ||
  9219. p->type == PBUF_REF);
  9220. /* desired length larger than current length? */
  9221. if (new_len >= p->tot_len) {
  9222. 800b51c: 8903 ldrh r3, [r0, #8]
  9223. 800b51e: 4299 cmp r1, r3
  9224. 800b520: d220 bcs.n 800b564 <pbuf_realloc+0x4a>
  9225. return;
  9226. }
  9227. /* the pbuf chain grows by (new_len - p->tot_len) bytes
  9228. * (which may be negative in case of shrinking) */
  9229. grow = new_len - p->tot_len;
  9230. 800b522: 1aca subs r2, r1, r3
  9231. /* first, step over any pbufs that should remain in the chain */
  9232. rem_len = new_len;
  9233. q = p;
  9234. /* should this pbuf be kept? */
  9235. while (rem_len > q->len) {
  9236. 800b524: 460d mov r5, r1
  9237. 800b526: 4604 mov r4, r0
  9238. 800b528: e005 b.n 800b536 <pbuf_realloc+0x1c>
  9239. /* decrease remaining length by pbuf length */
  9240. rem_len -= q->len;
  9241. 800b52a: 1aed subs r5, r5, r3
  9242. /* decrease total length indicator */
  9243. LWIP_ASSERT("grow < max_u16_t", grow < 0xffff);
  9244. q->tot_len += (u16_t)grow;
  9245. 800b52c: 8923 ldrh r3, [r4, #8]
  9246. 800b52e: 18d3 adds r3, r2, r3
  9247. 800b530: 8123 strh r3, [r4, #8]
  9248. /* proceed to next pbuf in chain */
  9249. q = q->next;
  9250. 800b532: 6824 ldr r4, [r4, #0]
  9251. rem_len = new_len;
  9252. q = p;
  9253. /* should this pbuf be kept? */
  9254. while (rem_len > q->len) {
  9255. /* decrease remaining length by pbuf length */
  9256. rem_len -= q->len;
  9257. 800b534: b2ad uxth r5, r5
  9258. /* first, step over any pbufs that should remain in the chain */
  9259. rem_len = new_len;
  9260. q = p;
  9261. /* should this pbuf be kept? */
  9262. while (rem_len > q->len) {
  9263. 800b536: 8963 ldrh r3, [r4, #10]
  9264. 800b538: 429d cmp r5, r3
  9265. 800b53a: d8f6 bhi.n 800b52a <pbuf_realloc+0x10>
  9266. /* we have now reached the new last pbuf (in q) */
  9267. /* rem_len == desired length for pbuf q */
  9268. /* shrink allocated memory for PBUF_RAM */
  9269. /* (other types merely adjust their length fields */
  9270. if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
  9271. 800b53c: 7b22 ldrb r2, [r4, #12]
  9272. 800b53e: b94a cbnz r2, 800b554 <pbuf_realloc+0x3a>
  9273. 800b540: 429d cmp r5, r3
  9274. 800b542: d007 beq.n 800b554 <pbuf_realloc+0x3a>
  9275. /* reallocate and adjust the length of the pbuf that will be split */
  9276. q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len);
  9277. 800b544: 6863 ldr r3, [r4, #4]
  9278. 800b546: 1b1b subs r3, r3, r4
  9279. 800b548: 18e9 adds r1, r5, r3
  9280. 800b54a: 4620 mov r0, r4
  9281. 800b54c: b289 uxth r1, r1
  9282. 800b54e: f7ff fd6d bl 800b02c <mem_trim>
  9283. 800b552: 4604 mov r4, r0
  9284. /* adjust length fields for new last pbuf */
  9285. q->len = rem_len;
  9286. q->tot_len = q->len;
  9287. /* any remaining pbufs in chain? */
  9288. if (q->next != NULL) {
  9289. 800b554: 6820 ldr r0, [r4, #0]
  9290. /* reallocate and adjust the length of the pbuf that will be split */
  9291. q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len);
  9292. LWIP_ASSERT("mem_trim returned q == NULL", q != NULL);
  9293. }
  9294. /* adjust length fields for new last pbuf */
  9295. q->len = rem_len;
  9296. 800b556: 8165 strh r5, [r4, #10]
  9297. q->tot_len = q->len;
  9298. 800b558: 8125 strh r5, [r4, #8]
  9299. /* any remaining pbufs in chain? */
  9300. if (q->next != NULL) {
  9301. 800b55a: b108 cbz r0, 800b560 <pbuf_realloc+0x46>
  9302. /* free remaining pbufs in chain */
  9303. pbuf_free(q->next);
  9304. 800b55c: f7ff ffb2 bl 800b4c4 <pbuf_free>
  9305. }
  9306. /* q is last packet in chain */
  9307. q->next = NULL;
  9308. 800b560: 2300 movs r3, #0
  9309. 800b562: 6023 str r3, [r4, #0]
  9310. 800b564: bd38 pop {r3, r4, r5, pc}
  9311. 0800b566 <pbuf_alloc>:
  9312. * @return the allocated pbuf. If multiple pbufs where allocated, this
  9313. * is the first pbuf of a pbuf chain.
  9314. */
  9315. struct pbuf *
  9316. pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
  9317. {
  9318. 800b566: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
  9319. 800b56a: 460d mov r5, r1
  9320. 800b56c: 4617 mov r7, r2
  9321. u16_t offset;
  9322. s32_t rem_len; /* remaining length */
  9323. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F")\n", length));
  9324. /* determine header offset */
  9325. switch (layer) {
  9326. 800b56e: 2803 cmp r0, #3
  9327. 800b570: d87c bhi.n 800b66c <pbuf_alloc+0x106>
  9328. 800b572: e8df f000 tbb [pc, r0]
  9329. 800b576: 0802 .short 0x0802
  9330. 800b578: 0604 .short 0x0604
  9331. case PBUF_TRANSPORT:
  9332. /* add room for transport (often TCP) layer header */
  9333. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
  9334. 800b57a: 2636 movs r6, #54 ; 0x36
  9335. 800b57c: e004 b.n 800b588 <pbuf_alloc+0x22>
  9336. /* add room for IP layer header */
  9337. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
  9338. break;
  9339. case PBUF_LINK:
  9340. /* add room for link layer header */
  9341. offset = PBUF_LINK_HLEN;
  9342. 800b57e: 260e movs r6, #14
  9343. break;
  9344. 800b580: e002 b.n 800b588 <pbuf_alloc+0x22>
  9345. case PBUF_RAW:
  9346. offset = 0;
  9347. 800b582: 2600 movs r6, #0
  9348. break;
  9349. 800b584: e000 b.n 800b588 <pbuf_alloc+0x22>
  9350. /* add room for transport (often TCP) layer header */
  9351. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
  9352. break;
  9353. case PBUF_IP:
  9354. /* add room for IP layer header */
  9355. offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
  9356. 800b586: 2622 movs r6, #34 ; 0x22
  9357. default:
  9358. LWIP_ASSERT("pbuf_alloc: bad pbuf layer", 0);
  9359. return NULL;
  9360. }
  9361. switch (type) {
  9362. 800b588: 2f03 cmp r7, #3
  9363. 800b58a: d86f bhi.n 800b66c <pbuf_alloc+0x106>
  9364. 800b58c: e8df f007 tbb [pc, r7]
  9365. 800b590: 025e5e46 .word 0x025e5e46
  9366. case PBUF_POOL:
  9367. /* allocate head of pbuf chain into p */
  9368. p = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
  9369. 800b594: 2009 movs r0, #9
  9370. 800b596: f7ff fe73 bl 800b280 <memp_malloc>
  9371. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
  9372. if (p == NULL) {
  9373. 800b59a: 4604 mov r4, r0
  9374. 800b59c: b900 cbnz r0, 800b5a0 <pbuf_alloc+0x3a>
  9375. 800b59e: e065 b.n 800b66c <pbuf_alloc+0x106>
  9376. }
  9377. p->type = type;
  9378. p->next = NULL;
  9379. /* make the payload pointer point 'offset' bytes into pbuf data memory */
  9380. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
  9381. 800b5a0: 1982 adds r2, r0, r6
  9382. LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
  9383. ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
  9384. /* the total length of the pbuf chain is the requested size */
  9385. p->tot_len = length;
  9386. /* set the length of the first pbuf in the chain */
  9387. p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
  9388. 800b5a2: 3603 adds r6, #3
  9389. 800b5a4: f026 0603 bic.w r6, r6, #3
  9390. }
  9391. p->type = type;
  9392. p->next = NULL;
  9393. /* make the payload pointer point 'offset' bytes into pbuf data memory */
  9394. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
  9395. 800b5a8: 3213 adds r2, #19
  9396. LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
  9397. ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
  9398. /* the total length of the pbuf chain is the requested size */
  9399. p->tot_len = length;
  9400. /* set the length of the first pbuf in the chain */
  9401. p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
  9402. 800b5aa: f5c6 66c0 rsb r6, r6, #1536 ; 0x600
  9403. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
  9404. if (p == NULL) {
  9405. PBUF_POOL_IS_EMPTY();
  9406. return NULL;
  9407. }
  9408. p->type = type;
  9409. 800b5ae: 2303 movs r3, #3
  9410. p->next = NULL;
  9411. /* make the payload pointer point 'offset' bytes into pbuf data memory */
  9412. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
  9413. 800b5b0: f022 0203 bic.w r2, r2, #3
  9414. LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
  9415. ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
  9416. /* the total length of the pbuf chain is the requested size */
  9417. p->tot_len = length;
  9418. /* set the length of the first pbuf in the chain */
  9419. p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
  9420. 800b5b4: 3604 adds r6, #4
  9421. 800b5b6: 42ae cmp r6, r5
  9422. 800b5b8: bfa8 it ge
  9423. 800b5ba: 462e movge r6, r5
  9424. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
  9425. if (p == NULL) {
  9426. PBUF_POOL_IS_EMPTY();
  9427. return NULL;
  9428. }
  9429. p->type = type;
  9430. 800b5bc: 7303 strb r3, [r0, #12]
  9431. p->next = NULL;
  9432. /* make the payload pointer point 'offset' bytes into pbuf data memory */
  9433. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
  9434. 800b5be: 6042 str r2, [r0, #4]
  9435. if (p == NULL) {
  9436. PBUF_POOL_IS_EMPTY();
  9437. return NULL;
  9438. }
  9439. p->type = type;
  9440. p->next = NULL;
  9441. 800b5c0: 2300 movs r3, #0
  9442. ((u8_t*)p->payload + p->len <=
  9443. (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
  9444. LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT",
  9445. (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 );
  9446. /* set reference count (needed here in case we fail) */
  9447. p->ref = 1;
  9448. 800b5c2: 2201 movs r2, #1
  9449. LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
  9450. ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
  9451. /* the total length of the pbuf chain is the requested size */
  9452. p->tot_len = length;
  9453. /* set the length of the first pbuf in the chain */
  9454. p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
  9455. 800b5c4: 8146 strh r6, [r0, #10]
  9456. if (p == NULL) {
  9457. PBUF_POOL_IS_EMPTY();
  9458. return NULL;
  9459. }
  9460. p->type = type;
  9461. p->next = NULL;
  9462. 800b5c6: 6003 str r3, [r0, #0]
  9463. /* make the payload pointer point 'offset' bytes into pbuf data memory */
  9464. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
  9465. LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
  9466. ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
  9467. /* the total length of the pbuf chain is the requested size */
  9468. p->tot_len = length;
  9469. 800b5c8: 8105 strh r5, [r0, #8]
  9470. ((u8_t*)p->payload + p->len <=
  9471. (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
  9472. LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT",
  9473. (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 );
  9474. /* set reference count (needed here in case we fail) */
  9475. p->ref = 1;
  9476. 800b5ca: 81c2 strh r2, [r0, #14]
  9477. /* now allocate the tail of the pbuf chain */
  9478. /* remember first pbuf for linkage in next iteration */
  9479. r = p;
  9480. /* remaining length to be allocated */
  9481. rem_len = length - p->len;
  9482. 800b5cc: 1bae subs r6, r5, r6
  9483. /* any remaining pbufs to be allocated? */
  9484. while (rem_len > 0) {
  9485. 800b5ce: 4607 mov r7, r0
  9486. 800b5d0: 4698 mov r8, r3
  9487. r->next = q;
  9488. /* set total length of this pbuf and next in chain */
  9489. LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
  9490. q->tot_len = (u16_t)rem_len;
  9491. /* this pbuf length is pool size, unless smaller sized tail */
  9492. q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
  9493. 800b5d2: f240 6903 movw r9, #1539 ; 0x603
  9494. 800b5d6: f240 6a04 movw sl, #1540 ; 0x604
  9495. /* remember first pbuf for linkage in next iteration */
  9496. r = p;
  9497. /* remaining length to be allocated */
  9498. rem_len = length - p->len;
  9499. /* any remaining pbufs to be allocated? */
  9500. while (rem_len > 0) {
  9501. 800b5da: e01c b.n 800b616 <pbuf_alloc+0xb0>
  9502. q = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
  9503. 800b5dc: 2009 movs r0, #9
  9504. 800b5de: f7ff fe4f bl 800b280 <memp_malloc>
  9505. if (q == NULL) {
  9506. 800b5e2: 4605 mov r5, r0
  9507. 800b5e4: b918 cbnz r0, 800b5ee <pbuf_alloc+0x88>
  9508. PBUF_POOL_IS_EMPTY();
  9509. /* free chain so far allocated */
  9510. pbuf_free(p);
  9511. 800b5e6: 4620 mov r0, r4
  9512. 800b5e8: f7ff ff6c bl 800b4c4 <pbuf_free>
  9513. 800b5ec: e03e b.n 800b66c <pbuf_alloc+0x106>
  9514. /* bail out unsuccesfully */
  9515. return NULL;
  9516. }
  9517. q->type = type;
  9518. 800b5ee: 2303 movs r3, #3
  9519. /* set total length of this pbuf and next in chain */
  9520. LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
  9521. q->tot_len = (u16_t)rem_len;
  9522. /* this pbuf length is pool size, unless smaller sized tail */
  9523. q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
  9524. q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
  9525. 800b5f0: f100 0210 add.w r2, r0, #16
  9526. /* free chain so far allocated */
  9527. pbuf_free(p);
  9528. /* bail out unsuccesfully */
  9529. return NULL;
  9530. }
  9531. q->type = type;
  9532. 800b5f4: 7303 strb r3, [r0, #12]
  9533. q->next = NULL;
  9534. /* make previous pbuf point to this pbuf */
  9535. r->next = q;
  9536. /* set total length of this pbuf and next in chain */
  9537. LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
  9538. q->tot_len = (u16_t)rem_len;
  9539. 800b5f6: b2b3 uxth r3, r6
  9540. 800b5f8: 8103 strh r3, [r0, #8]
  9541. /* this pbuf length is pool size, unless smaller sized tail */
  9542. q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
  9543. q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
  9544. 800b5fa: 6042 str r2, [r0, #4]
  9545. r->next = q;
  9546. /* set total length of this pbuf and next in chain */
  9547. LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
  9548. q->tot_len = (u16_t)rem_len;
  9549. /* this pbuf length is pool size, unless smaller sized tail */
  9550. q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
  9551. 800b5fc: 454b cmp r3, r9
  9552. 800b5fe: bf88 it hi
  9553. 800b600: 4653 movhi r3, sl
  9554. LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
  9555. ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
  9556. LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
  9557. ((u8_t*)p->payload + p->len <=
  9558. (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
  9559. q->ref = 1;
  9560. 800b602: 2201 movs r2, #1
  9561. /* bail out unsuccesfully */
  9562. return NULL;
  9563. }
  9564. q->type = type;
  9565. q->flags = 0;
  9566. q->next = NULL;
  9567. 800b604: f8c0 8000 str.w r8, [r0]
  9568. pbuf_free(p);
  9569. /* bail out unsuccesfully */
  9570. return NULL;
  9571. }
  9572. q->type = type;
  9573. q->flags = 0;
  9574. 800b608: f880 800d strb.w r8, [r0, #13]
  9575. q->next = NULL;
  9576. /* make previous pbuf point to this pbuf */
  9577. r->next = q;
  9578. 800b60c: 6038 str r0, [r7, #0]
  9579. /* set total length of this pbuf and next in chain */
  9580. LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
  9581. q->tot_len = (u16_t)rem_len;
  9582. /* this pbuf length is pool size, unless smaller sized tail */
  9583. q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
  9584. 800b60e: 8143 strh r3, [r0, #10]
  9585. LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
  9586. ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
  9587. LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
  9588. ((u8_t*)p->payload + p->len <=
  9589. (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
  9590. q->ref = 1;
  9591. 800b610: 81c2 strh r2, [r0, #14]
  9592. /* calculate remaining length to be allocated */
  9593. rem_len -= q->len;
  9594. 800b612: 1af6 subs r6, r6, r3
  9595. 800b614: 4607 mov r7, r0
  9596. /* remember first pbuf for linkage in next iteration */
  9597. r = p;
  9598. /* remaining length to be allocated */
  9599. rem_len = length - p->len;
  9600. /* any remaining pbufs to be allocated? */
  9601. while (rem_len > 0) {
  9602. 800b616: 2e00 cmp r6, #0
  9603. 800b618: dce0 bgt.n 800b5dc <pbuf_alloc+0x76>
  9604. 800b61a: e022 b.n 800b662 <pbuf_alloc+0xfc>
  9605. /*r->next = NULL;*/
  9606. break;
  9607. case PBUF_RAM:
  9608. /* If pbuf is to be allocated in RAM, allocate memory for it. */
  9609. p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
  9610. 800b61c: f106 0013 add.w r0, r6, #19
  9611. 800b620: 1ceb adds r3, r5, #3
  9612. 800b622: f023 0303 bic.w r3, r3, #3
  9613. 800b626: f020 0003 bic.w r0, r0, #3
  9614. 800b62a: 18c0 adds r0, r0, r3
  9615. 800b62c: b280 uxth r0, r0
  9616. 800b62e: f7ff fd6d bl 800b10c <mem_malloc>
  9617. if (p == NULL) {
  9618. 800b632: 4604 mov r4, r0
  9619. 800b634: b1d0 cbz r0, 800b66c <pbuf_alloc+0x106>
  9620. return NULL;
  9621. }
  9622. /* Set up internal structure of the pbuf. */
  9623. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
  9624. 800b636: 1986 adds r6, r0, r6
  9625. 800b638: 3613 adds r6, #19
  9626. p->len = p->tot_len = length;
  9627. p->next = NULL;
  9628. 800b63a: 2300 movs r3, #0
  9629. p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
  9630. if (p == NULL) {
  9631. return NULL;
  9632. }
  9633. /* Set up internal structure of the pbuf. */
  9634. p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
  9635. 800b63c: f026 0603 bic.w r6, r6, #3
  9636. 800b640: 6046 str r6, [r0, #4]
  9637. p->len = p->tot_len = length;
  9638. 800b642: 8105 strh r5, [r0, #8]
  9639. 800b644: 8145 strh r5, [r0, #10]
  9640. p->next = NULL;
  9641. 800b646: 6003 str r3, [r0, #0]
  9642. p->type = type;
  9643. 800b648: 7303 strb r3, [r0, #12]
  9644. 800b64a: e00a b.n 800b662 <pbuf_alloc+0xfc>
  9645. /* pbuf references existing (non-volatile static constant) ROM payload? */
  9646. case PBUF_ROM:
  9647. /* pbuf references existing (externally allocated) RAM payload? */
  9648. case PBUF_REF:
  9649. /* only allocate memory for the pbuf structure */
  9650. p = (struct pbuf *)memp_malloc(MEMP_PBUF);
  9651. 800b64c: 2008 movs r0, #8
  9652. 800b64e: f7ff fe17 bl 800b280 <memp_malloc>
  9653. if (p == NULL) {
  9654. 800b652: 4604 mov r4, r0
  9655. 800b654: b150 cbz r0, 800b66c <pbuf_alloc+0x106>
  9656. ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n",
  9657. (type == PBUF_ROM) ? "ROM" : "REF"));
  9658. return NULL;
  9659. }
  9660. /* caller must set this field properly, afterwards */
  9661. p->payload = NULL;
  9662. 800b656: 2300 movs r3, #0
  9663. 800b658: 6043 str r3, [r0, #4]
  9664. p->len = p->tot_len = length;
  9665. 800b65a: 8105 strh r5, [r0, #8]
  9666. 800b65c: 8145 strh r5, [r0, #10]
  9667. p->next = NULL;
  9668. 800b65e: 6003 str r3, [r0, #0]
  9669. p->type = type;
  9670. 800b660: 7307 strb r7, [r0, #12]
  9671. default:
  9672. LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
  9673. return NULL;
  9674. }
  9675. /* set reference count */
  9676. p->ref = 1;
  9677. 800b662: 2301 movs r3, #1
  9678. 800b664: 81e3 strh r3, [r4, #14]
  9679. /* set flags */
  9680. p->flags = 0;
  9681. 800b666: 2300 movs r3, #0
  9682. 800b668: 7363 strb r3, [r4, #13]
  9683. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p));
  9684. return p;
  9685. 800b66a: e000 b.n 800b66e <pbuf_alloc+0x108>
  9686. p->next = NULL;
  9687. p->type = type;
  9688. break;
  9689. default:
  9690. LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
  9691. return NULL;
  9692. 800b66c: 2400 movs r4, #0
  9693. p->ref = 1;
  9694. /* set flags */
  9695. p->flags = 0;
  9696. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p));
  9697. return p;
  9698. }
  9699. 800b66e: 4620 mov r0, r4
  9700. 800b670: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  9701. 0800b674 <pbuf_clen>:
  9702. * @return the number of pbufs in a chain
  9703. */
  9704. u8_t
  9705. pbuf_clen(struct pbuf *p)
  9706. {
  9707. 800b674: 4603 mov r3, r0
  9708. u8_t len;
  9709. len = 0;
  9710. 800b676: 2000 movs r0, #0
  9711. while (p != NULL) {
  9712. 800b678: e002 b.n 800b680 <pbuf_clen+0xc>
  9713. ++len;
  9714. 800b67a: 3001 adds r0, #1
  9715. p = p->next;
  9716. 800b67c: 681b ldr r3, [r3, #0]
  9717. {
  9718. u8_t len;
  9719. len = 0;
  9720. while (p != NULL) {
  9721. ++len;
  9722. 800b67e: b2c0 uxtb r0, r0
  9723. pbuf_clen(struct pbuf *p)
  9724. {
  9725. u8_t len;
  9726. len = 0;
  9727. while (p != NULL) {
  9728. 800b680: 2b00 cmp r3, #0
  9729. 800b682: d1fa bne.n 800b67a <pbuf_clen+0x6>
  9730. ++len;
  9731. p = p->next;
  9732. }
  9733. return len;
  9734. }
  9735. 800b684: 4770 bx lr
  9736. 0800b686 <pbuf_ref>:
  9737. void
  9738. pbuf_ref(struct pbuf *p)
  9739. {
  9740. SYS_ARCH_DECL_PROTECT(old_level);
  9741. /* pbuf given? */
  9742. if (p != NULL) {
  9743. 800b686: b110 cbz r0, 800b68e <pbuf_ref+0x8>
  9744. SYS_ARCH_PROTECT(old_level);
  9745. ++(p->ref);
  9746. 800b688: 89c3 ldrh r3, [r0, #14]
  9747. 800b68a: 3301 adds r3, #1
  9748. 800b68c: 81c3 strh r3, [r0, #14]
  9749. 800b68e: 4770 bx lr
  9750. 0800b690 <pbuf_cat>:
  9751. * @see pbuf_chain()
  9752. */
  9753. void
  9754. pbuf_cat(struct pbuf *h, struct pbuf *t)
  9755. {
  9756. 800b690: b510 push {r4, lr}
  9757. struct pbuf *p;
  9758. LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
  9759. 800b692: b168 cbz r0, 800b6b0 <pbuf_cat+0x20>
  9760. 800b694: b161 cbz r1, 800b6b0 <pbuf_cat+0x20>
  9761. 800b696: e003 b.n 800b6a0 <pbuf_cat+0x10>
  9762. ((h != NULL) && (t != NULL)), return;);
  9763. /* proceed to last pbuf of chain */
  9764. for (p = h; p->next != NULL; p = p->next) {
  9765. /* add total length of second chain to all totals of first chain */
  9766. p->tot_len += t->tot_len;
  9767. 800b698: 8904 ldrh r4, [r0, #8]
  9768. 800b69a: 191b adds r3, r3, r4
  9769. 800b69c: 8103 strh r3, [r0, #8]
  9770. LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
  9771. ((h != NULL) && (t != NULL)), return;);
  9772. /* proceed to last pbuf of chain */
  9773. for (p = h; p->next != NULL; p = p->next) {
  9774. 800b69e: 4610 mov r0, r2
  9775. 800b6a0: 6802 ldr r2, [r0, #0]
  9776. 800b6a2: 890b ldrh r3, [r1, #8]
  9777. 800b6a4: 2a00 cmp r2, #0
  9778. 800b6a6: d1f7 bne.n 800b698 <pbuf_cat+0x8>
  9779. }
  9780. /* { p is last pbuf of first h chain, p->next == NULL } */
  9781. LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
  9782. LWIP_ASSERT("p->next == NULL", p->next == NULL);
  9783. /* add total length of second chain to last pbuf total of first chain */
  9784. p->tot_len += t->tot_len;
  9785. 800b6a8: 8902 ldrh r2, [r0, #8]
  9786. /* chain last pbuf of head (p) with first of tail (t) */
  9787. p->next = t;
  9788. 800b6aa: 6001 str r1, [r0, #0]
  9789. }
  9790. /* { p is last pbuf of first h chain, p->next == NULL } */
  9791. LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
  9792. LWIP_ASSERT("p->next == NULL", p->next == NULL);
  9793. /* add total length of second chain to last pbuf total of first chain */
  9794. p->tot_len += t->tot_len;
  9795. 800b6ac: 189b adds r3, r3, r2
  9796. 800b6ae: 8103 strh r3, [r0, #8]
  9797. 800b6b0: bd10 pop {r4, pc}
  9798. 0800b6b2 <pbuf_chain>:
  9799. * The ->ref field of the first pbuf of the tail chain is adjusted.
  9800. *
  9801. */
  9802. void
  9803. pbuf_chain(struct pbuf *h, struct pbuf *t)
  9804. {
  9805. 800b6b2: b510 push {r4, lr}
  9806. 800b6b4: 460c mov r4, r1
  9807. pbuf_cat(h, t);
  9808. 800b6b6: f7ff ffeb bl 800b690 <pbuf_cat>
  9809. /* t is now referenced by h */
  9810. pbuf_ref(t);
  9811. 800b6ba: 4620 mov r0, r4
  9812. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t));
  9813. }
  9814. 800b6bc: e8bd 4010 ldmia.w sp!, {r4, lr}
  9815. void
  9816. pbuf_chain(struct pbuf *h, struct pbuf *t)
  9817. {
  9818. pbuf_cat(h, t);
  9819. /* t is now referenced by h */
  9820. pbuf_ref(t);
  9821. 800b6c0: f7ff bfe1 b.w 800b686 <pbuf_ref>
  9822. 0800b6c4 <pbuf_copy>:
  9823. * ERR_ARG if one of the pbufs is NULL or p_to is not big
  9824. * enough to hold p_from
  9825. */
  9826. err_t
  9827. pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
  9828. {
  9829. 800b6c4: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  9830. 800b6c8: 460c mov r4, r1
  9831. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy(%p, %p)\n",
  9832. (void*)p_to, (void*)p_from));
  9833. /* is the target big enough to hold the source? */
  9834. LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&
  9835. 800b6ca: 4605 mov r5, r0
  9836. 800b6cc: b908 cbnz r0, 800b6d2 <pbuf_copy+0xe>
  9837. 800b6ce: 20f2 movs r0, #242 ; 0xf2
  9838. 800b6d0: e03f b.n 800b752 <pbuf_copy+0x8e>
  9839. 800b6d2: 2900 cmp r1, #0
  9840. 800b6d4: d0fb beq.n 800b6ce <pbuf_copy+0xa>
  9841. 800b6d6: 8902 ldrh r2, [r0, #8]
  9842. 800b6d8: 890b ldrh r3, [r1, #8]
  9843. 800b6da: 429a cmp r2, r3
  9844. 800b6dc: d3f7 bcc.n 800b6ce <pbuf_copy+0xa>
  9845. 800b6de: 2600 movs r6, #0
  9846. 800b6e0: 4637 mov r7, r6
  9847. /* iterate through pbuf chain */
  9848. do
  9849. {
  9850. /* copy one part of the original chain */
  9851. if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
  9852. 800b6e2: f8b4 800a ldrh.w r8, [r4, #10]
  9853. 800b6e6: 896b ldrh r3, [r5, #10]
  9854. len = p_from->len - offset_from;
  9855. } else {
  9856. /* current p_from does not fit into current p_to */
  9857. len = p_to->len - offset_to;
  9858. }
  9859. MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
  9860. 800b6e8: 6861 ldr r1, [r4, #4]
  9861. 800b6ea: 6868 ldr r0, [r5, #4]
  9862. /* iterate through pbuf chain */
  9863. do
  9864. {
  9865. /* copy one part of the original chain */
  9866. if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
  9867. 800b6ec: ebc6 0808 rsb r8, r6, r8
  9868. 800b6f0: 1bdb subs r3, r3, r7
  9869. 800b6f2: 4543 cmp r3, r8
  9870. /* complete current p_from fits into current p_to */
  9871. len = p_from->len - offset_from;
  9872. } else {
  9873. /* current p_from does not fit into current p_to */
  9874. len = p_to->len - offset_to;
  9875. 800b6f4: bfb4 ite lt
  9876. 800b6f6: fa1f f883 uxthlt.w r8, r3
  9877. do
  9878. {
  9879. /* copy one part of the original chain */
  9880. if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
  9881. /* complete current p_from fits into current p_to */
  9882. len = p_from->len - offset_from;
  9883. 800b6fa: fa1f f888 uxthge.w r8, r8
  9884. } else {
  9885. /* current p_from does not fit into current p_to */
  9886. len = p_to->len - offset_to;
  9887. }
  9888. MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
  9889. 800b6fe: 19c0 adds r0, r0, r7
  9890. 800b700: 1989 adds r1, r1, r6
  9891. 800b702: 4642 mov r2, r8
  9892. 800b704: f7fd fe7e bl 8009404 <memcpy>
  9893. offset_to += len;
  9894. offset_from += len;
  9895. 800b708: 4446 add r6, r8
  9896. LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
  9897. LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
  9898. if (offset_from >= p_from->len) {
  9899. 800b70a: 8963 ldrh r3, [r4, #10]
  9900. /* current p_from does not fit into current p_to */
  9901. len = p_to->len - offset_to;
  9902. }
  9903. MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
  9904. offset_to += len;
  9905. offset_from += len;
  9906. 800b70c: b2b6 uxth r6, r6
  9907. LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
  9908. LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
  9909. if (offset_from >= p_from->len) {
  9910. 800b70e: 42b3 cmp r3, r6
  9911. } else {
  9912. /* current p_from does not fit into current p_to */
  9913. len = p_to->len - offset_to;
  9914. }
  9915. MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
  9916. offset_to += len;
  9917. 800b710: 4447 add r7, r8
  9918. if (offset_from >= p_from->len) {
  9919. /* on to next p_from (if any) */
  9920. offset_from = 0;
  9921. p_from = p_from->next;
  9922. }
  9923. if (offset_to == p_to->len) {
  9924. 800b712: 896b ldrh r3, [r5, #10]
  9925. LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
  9926. LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
  9927. if (offset_from >= p_from->len) {
  9928. /* on to next p_from (if any) */
  9929. offset_from = 0;
  9930. p_from = p_from->next;
  9931. 800b714: bf98 it ls
  9932. 800b716: 6824 ldrls r4, [r4, #0]
  9933. } else {
  9934. /* current p_from does not fit into current p_to */
  9935. len = p_to->len - offset_to;
  9936. }
  9937. MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
  9938. offset_to += len;
  9939. 800b718: b2bf uxth r7, r7
  9940. offset_from += len;
  9941. LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
  9942. LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
  9943. if (offset_from >= p_from->len) {
  9944. /* on to next p_from (if any) */
  9945. offset_from = 0;
  9946. 800b71a: bf98 it ls
  9947. 800b71c: 2600 movls r6, #0
  9948. p_from = p_from->next;
  9949. }
  9950. if (offset_to == p_to->len) {
  9951. 800b71e: 42bb cmp r3, r7
  9952. 800b720: d105 bne.n 800b72e <pbuf_copy+0x6a>
  9953. /* on to next p_to (if any) */
  9954. offset_to = 0;
  9955. p_to = p_to->next;
  9956. 800b722: 682d ldr r5, [r5, #0]
  9957. LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
  9958. 800b724: b915 cbnz r5, 800b72c <pbuf_copy+0x68>
  9959. 800b726: 2c00 cmp r4, #0
  9960. 800b728: d1d1 bne.n 800b6ce <pbuf_copy+0xa>
  9961. 800b72a: e00f b.n 800b74c <pbuf_copy+0x88>
  9962. offset_from = 0;
  9963. p_from = p_from->next;
  9964. }
  9965. if (offset_to == p_to->len) {
  9966. /* on to next p_to (if any) */
  9967. offset_to = 0;
  9968. 800b72c: 2700 movs r7, #0
  9969. p_to = p_to->next;
  9970. LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
  9971. }
  9972. if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
  9973. 800b72e: b12c cbz r4, 800b73c <pbuf_copy+0x78>
  9974. 800b730: 8962 ldrh r2, [r4, #10]
  9975. 800b732: 8923 ldrh r3, [r4, #8]
  9976. 800b734: 429a cmp r2, r3
  9977. 800b736: d101 bne.n 800b73c <pbuf_copy+0x78>
  9978. /* don't copy more than one packet! */
  9979. LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
  9980. 800b738: 6823 ldr r3, [r4, #0]
  9981. 800b73a: b94b cbnz r3, 800b750 <pbuf_copy+0x8c>
  9982. (p_from->next == NULL), return ERR_VAL;);
  9983. }
  9984. if((p_to != NULL) && (p_to->len == p_to->tot_len)) {
  9985. 800b73c: 896a ldrh r2, [r5, #10]
  9986. 800b73e: 892b ldrh r3, [r5, #8]
  9987. 800b740: 429a cmp r2, r3
  9988. 800b742: d101 bne.n 800b748 <pbuf_copy+0x84>
  9989. /* don't copy more than one packet! */
  9990. LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
  9991. 800b744: 682b ldr r3, [r5, #0]
  9992. 800b746: b91b cbnz r3, 800b750 <pbuf_copy+0x8c>
  9993. (p_to->next == NULL), return ERR_VAL;);
  9994. }
  9995. } while (p_from);
  9996. 800b748: 2c00 cmp r4, #0
  9997. 800b74a: d1ca bne.n 800b6e2 <pbuf_copy+0x1e>
  9998. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n"));
  9999. return ERR_OK;
  10000. 800b74c: 4620 mov r0, r4
  10001. 800b74e: e000 b.n 800b752 <pbuf_copy+0x8e>
  10002. LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
  10003. }
  10004. if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
  10005. /* don't copy more than one packet! */
  10006. LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
  10007. 800b750: 20fa movs r0, #250 ; 0xfa
  10008. (p_to->next == NULL), return ERR_VAL;);
  10009. }
  10010. } while (p_from);
  10011. LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n"));
  10012. return ERR_OK;
  10013. }
  10014. 800b752: b240 sxtb r0, r0
  10015. 800b754: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  10016. 0800b758 <pbuf_copy_partial>:
  10017. * @param offset offset into the packet buffer from where to begin copying len bytes
  10018. * @return the number of bytes copied, or 0 on failure
  10019. */
  10020. u16_t
  10021. pbuf_copy_partial(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
  10022. {
  10023. 800b758: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
  10024. 800b75c: 4688 mov r8, r1
  10025. 800b75e: 4616 mov r6, r2
  10026. struct pbuf *p;
  10027. u16_t left;
  10028. u16_t buf_copy_len;
  10029. u16_t copied_total = 0;
  10030. LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
  10031. 800b760: b328 cbz r0, 800b7ae <pbuf_copy_partial+0x56>
  10032. LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;);
  10033. 800b762: b331 cbz r1, 800b7b2 <pbuf_copy_partial+0x5a>
  10034. 800b764: 2400 movs r4, #0
  10035. 800b766: 4605 mov r5, r0
  10036. 800b768: 46a1 mov r9, r4
  10037. 800b76a: e01c b.n 800b7a6 <pbuf_copy_partial+0x4e>
  10038. return 0;
  10039. }
  10040. /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  10041. for(p = buf; len != 0 && p != NULL; p = p->next) {
  10042. if ((offset != 0) && (offset >= p->len)) {
  10043. 800b76c: b12b cbz r3, 800b77a <pbuf_copy_partial+0x22>
  10044. 800b76e: 896a ldrh r2, [r5, #10]
  10045. 800b770: 4293 cmp r3, r2
  10046. 800b772: d302 bcc.n 800b77a <pbuf_copy_partial+0x22>
  10047. /* don't copy from this buffer -> on to the next */
  10048. offset -= p->len;
  10049. 800b774: 1a9b subs r3, r3, r2
  10050. 800b776: b29b uxth r3, r3
  10051. 800b778: e014 b.n 800b7a4 <pbuf_copy_partial+0x4c>
  10052. } else {
  10053. /* copy from this buffer. maybe only partially. */
  10054. buf_copy_len = p->len - offset;
  10055. 800b77a: 896f ldrh r7, [r5, #10]
  10056. if (buf_copy_len > len)
  10057. buf_copy_len = len;
  10058. /* copy the necessary parts of the buffer */
  10059. MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
  10060. 800b77c: 6869 ldr r1, [r5, #4]
  10061. if ((offset != 0) && (offset >= p->len)) {
  10062. /* don't copy from this buffer -> on to the next */
  10063. offset -= p->len;
  10064. } else {
  10065. /* copy from this buffer. maybe only partially. */
  10066. buf_copy_len = p->len - offset;
  10067. 800b77e: 1aff subs r7, r7, r3
  10068. 800b780: b2bf uxth r7, r7
  10069. 800b782: 42b7 cmp r7, r6
  10070. 800b784: bf28 it cs
  10071. 800b786: 4637 movcs r7, r6
  10072. if (buf_copy_len > len)
  10073. buf_copy_len = len;
  10074. /* copy the necessary parts of the buffer */
  10075. MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
  10076. 800b788: eb08 0009 add.w r0, r8, r9
  10077. 800b78c: 18c9 adds r1, r1, r3
  10078. 800b78e: 463a mov r2, r7
  10079. copied_total += buf_copy_len;
  10080. 800b790: 193c adds r4, r7, r4
  10081. left += buf_copy_len;
  10082. 800b792: 44b9 add r9, r7
  10083. len -= buf_copy_len;
  10084. 800b794: 1bf6 subs r6, r6, r7
  10085. /* copy from this buffer. maybe only partially. */
  10086. buf_copy_len = p->len - offset;
  10087. if (buf_copy_len > len)
  10088. buf_copy_len = len;
  10089. /* copy the necessary parts of the buffer */
  10090. MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
  10091. 800b796: f7fd fe35 bl 8009404 <memcpy>
  10092. copied_total += buf_copy_len;
  10093. 800b79a: b2a4 uxth r4, r4
  10094. left += buf_copy_len;
  10095. 800b79c: fa1f f989 uxth.w r9, r9
  10096. len -= buf_copy_len;
  10097. 800b7a0: b2b6 uxth r6, r6
  10098. offset = 0;
  10099. 800b7a2: 2300 movs r3, #0
  10100. if((buf == NULL) || (dataptr == NULL)) {
  10101. return 0;
  10102. }
  10103. /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  10104. for(p = buf; len != 0 && p != NULL; p = p->next) {
  10105. 800b7a4: 682d ldr r5, [r5, #0]
  10106. 800b7a6: b12e cbz r6, 800b7b4 <pbuf_copy_partial+0x5c>
  10107. 800b7a8: 2d00 cmp r5, #0
  10108. 800b7aa: d1df bne.n 800b76c <pbuf_copy_partial+0x14>
  10109. 800b7ac: e002 b.n 800b7b4 <pbuf_copy_partial+0x5c>
  10110. struct pbuf *p;
  10111. u16_t left;
  10112. u16_t buf_copy_len;
  10113. u16_t copied_total = 0;
  10114. LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
  10115. 800b7ae: 4604 mov r4, r0
  10116. 800b7b0: e000 b.n 800b7b4 <pbuf_copy_partial+0x5c>
  10117. 800b7b2: 460c mov r4, r1
  10118. len -= buf_copy_len;
  10119. offset = 0;
  10120. }
  10121. }
  10122. return copied_total;
  10123. }
  10124. 800b7b4: 4620 mov r0, r4
  10125. 800b7b6: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
  10126. 800b7ba: 0000 movs r0, r0
  10127. 0800b7bc <raw_input>:
  10128. * caller).
  10129. *
  10130. */
  10131. u8_t
  10132. raw_input(struct pbuf *p, struct netif *inp)
  10133. {
  10134. 800b7bc: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
  10135. u8_t eaten = 0;
  10136. LWIP_UNUSED_ARG(inp);
  10137. iphdr = (struct ip_hdr *)p->payload;
  10138. proto = IPH_PROTO(iphdr);
  10139. 800b7c0: 6843 ldr r3, [r0, #4]
  10140. /* loop through all raw pcbs until the packet is eaten by one */
  10141. /* this allows multiple pcbs to match against the packet by design */
  10142. while ((eaten == 0) && (pcb != NULL)) {
  10143. if ((pcb->protocol == proto) &&
  10144. (ip_addr_isany(&pcb->local_ip) ||
  10145. ip_addr_cmp(&(pcb->local_ip), &current_iphdr_dest))) {
  10146. 800b7c2: f8df a074 ldr.w sl, [pc, #116] ; 800b838 <raw_input+0x7c>
  10147. u8_t eaten = 0;
  10148. LWIP_UNUSED_ARG(inp);
  10149. iphdr = (struct ip_hdr *)p->payload;
  10150. proto = IPH_PROTO(iphdr);
  10151. 800b7c6: f893 9009 ldrb.w r9, [r3, #9]
  10152. prev = NULL;
  10153. pcb = raw_pcbs;
  10154. 800b7ca: 4b19 ldr r3, [pc, #100] ; (800b830 <raw_input+0x74>)
  10155. * caller).
  10156. *
  10157. */
  10158. u8_t
  10159. raw_input(struct pbuf *p, struct netif *inp)
  10160. {
  10161. 800b7cc: 4606 mov r6, r0
  10162. iphdr = (struct ip_hdr *)p->payload;
  10163. proto = IPH_PROTO(iphdr);
  10164. prev = NULL;
  10165. pcb = raw_pcbs;
  10166. 800b7ce: 681c ldr r4, [r3, #0]
  10167. LWIP_UNUSED_ARG(inp);
  10168. iphdr = (struct ip_hdr *)p->payload;
  10169. proto = IPH_PROTO(iphdr);
  10170. prev = NULL;
  10171. 800b7d0: 2500 movs r5, #0
  10172. eaten = 1;
  10173. if (prev != NULL) {
  10174. /* move the pcb to the front of raw_pcbs so that is
  10175. found faster next time */
  10176. prev->next = pcb->next;
  10177. pcb->next = raw_pcbs;
  10178. 800b7d2: 4698 mov r8, r3
  10179. 800b7d4: e023 b.n 800b81e <raw_input+0x62>
  10180. prev = NULL;
  10181. pcb = raw_pcbs;
  10182. /* loop through all raw pcbs until the packet is eaten by one */
  10183. /* this allows multiple pcbs to match against the packet by design */
  10184. while ((eaten == 0) && (pcb != NULL)) {
  10185. if ((pcb->protocol == proto) &&
  10186. 800b7d6: 7c23 ldrb r3, [r4, #16]
  10187. 800b7d8: 454b cmp r3, r9
  10188. 800b7da: d118 bne.n 800b80e <raw_input+0x52>
  10189. (ip_addr_isany(&pcb->local_ip) ||
  10190. 800b7dc: 6823 ldr r3, [r4, #0]
  10191. 800b7de: b11b cbz r3, 800b7e8 <raw_input+0x2c>
  10192. 800b7e0: f8da 2000 ldr.w r2, [sl]
  10193. 800b7e4: 4293 cmp r3, r2
  10194. 800b7e6: d112 bne.n 800b80e <raw_input+0x52>
  10195. /* broadcast filter? */
  10196. if (ip_get_option(pcb, SOF_BROADCAST) || !ip_addr_isbroadcast(&current_iphdr_dest, inp))
  10197. #endif /* IP_SOF_BROADCAST_RECV */
  10198. {
  10199. /* receive callback function available? */
  10200. if (pcb->recv != NULL) {
  10201. 800b7e8: 6967 ldr r7, [r4, #20]
  10202. 800b7ea: b187 cbz r7, 800b80e <raw_input+0x52>
  10203. /* the receive callback function did not eat the packet? */
  10204. if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
  10205. 800b7ec: 69a0 ldr r0, [r4, #24]
  10206. 800b7ee: 4b11 ldr r3, [pc, #68] ; (800b834 <raw_input+0x78>)
  10207. 800b7f0: 4621 mov r1, r4
  10208. 800b7f2: 4632 mov r2, r6
  10209. 800b7f4: 47b8 blx r7
  10210. 800b7f6: b150 cbz r0, 800b80e <raw_input+0x52>
  10211. /* receive function ate the packet */
  10212. p = NULL;
  10213. eaten = 1;
  10214. if (prev != NULL) {
  10215. 800b7f8: b15d cbz r5, 800b812 <raw_input+0x56>
  10216. /* move the pcb to the front of raw_pcbs so that is
  10217. found faster next time */
  10218. prev->next = pcb->next;
  10219. 800b7fa: 68e3 ldr r3, [r4, #12]
  10220. 800b7fc: 60eb str r3, [r5, #12]
  10221. pcb->next = raw_pcbs;
  10222. 800b7fe: f8d8 3000 ldr.w r3, [r8]
  10223. raw_pcbs = pcb;
  10224. 800b802: f8c8 4000 str.w r4, [r8]
  10225. eaten = 1;
  10226. if (prev != NULL) {
  10227. /* move the pcb to the front of raw_pcbs so that is
  10228. found faster next time */
  10229. prev->next = pcb->next;
  10230. pcb->next = raw_pcbs;
  10231. 800b806: 60e3 str r3, [r4, #12]
  10232. /* receive callback function available? */
  10233. if (pcb->recv != NULL) {
  10234. /* the receive callback function did not eat the packet? */
  10235. if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
  10236. /* receive function ate the packet */
  10237. p = NULL;
  10238. 800b808: 2600 movs r6, #0
  10239. eaten = 1;
  10240. 800b80a: 2301 movs r3, #1
  10241. 800b80c: e003 b.n 800b816 <raw_input+0x5a>
  10242. pcb = raw_pcbs;
  10243. /* loop through all raw pcbs until the packet is eaten by one */
  10244. /* this allows multiple pcbs to match against the packet by design */
  10245. while ((eaten == 0) && (pcb != NULL)) {
  10246. if ((pcb->protocol == proto) &&
  10247. (ip_addr_isany(&pcb->local_ip) ||
  10248. 800b80e: 2300 movs r3, #0
  10249. 800b810: e001 b.n 800b816 <raw_input+0x5a>
  10250. if (pcb->recv != NULL) {
  10251. /* the receive callback function did not eat the packet? */
  10252. if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
  10253. /* receive function ate the packet */
  10254. p = NULL;
  10255. eaten = 1;
  10256. 800b812: 2301 movs r3, #1
  10257. /* receive callback function available? */
  10258. if (pcb->recv != NULL) {
  10259. /* the receive callback function did not eat the packet? */
  10260. if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
  10261. /* receive function ate the packet */
  10262. p = NULL;
  10263. 800b814: 462e mov r6, r5
  10264. /* no receive callback function was set for this raw PCB */
  10265. }
  10266. /* drop the packet */
  10267. }
  10268. prev = pcb;
  10269. pcb = pcb->next;
  10270. 800b816: 68e2 ldr r2, [r4, #12]
  10271. 800b818: 4625 mov r5, r4
  10272. prev = NULL;
  10273. pcb = raw_pcbs;
  10274. /* loop through all raw pcbs until the packet is eaten by one */
  10275. /* this allows multiple pcbs to match against the packet by design */
  10276. while ((eaten == 0) && (pcb != NULL)) {
  10277. 800b81a: b92b cbnz r3, 800b828 <raw_input+0x6c>
  10278. /* no receive callback function was set for this raw PCB */
  10279. }
  10280. /* drop the packet */
  10281. }
  10282. prev = pcb;
  10283. pcb = pcb->next;
  10284. 800b81c: 4614 mov r4, r2
  10285. prev = NULL;
  10286. pcb = raw_pcbs;
  10287. /* loop through all raw pcbs until the packet is eaten by one */
  10288. /* this allows multiple pcbs to match against the packet by design */
  10289. while ((eaten == 0) && (pcb != NULL)) {
  10290. 800b81e: 2c00 cmp r4, #0
  10291. 800b820: d1d9 bne.n 800b7d6 <raw_input+0x1a>
  10292. 800b822: 4620 mov r0, r4
  10293. 800b824: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  10294. 800b828: 2001 movs r0, #1
  10295. }
  10296. prev = pcb;
  10297. pcb = pcb->next;
  10298. }
  10299. return eaten;
  10300. }
  10301. 800b82a: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  10302. 800b82e: bf00 nop
  10303. 800b830: 20006b78 .word 0x20006b78
  10304. 800b834: 2000835c .word 0x2000835c
  10305. 800b838: 20008364 .word 0x20008364
  10306. 0800b83c <stats_init>:
  10307. #include <string.h>
  10308. struct stats_ lwip_stats;
  10309. void stats_init(void)
  10310. {
  10311. 800b83c: 4770 bx lr
  10312. 0800b83e <tcp_accept_null>:
  10313. LWIP_UNUSED_ARG(arg);
  10314. LWIP_UNUSED_ARG(pcb);
  10315. LWIP_UNUSED_ARG(err);
  10316. return ERR_ABRT;
  10317. }
  10318. 800b83e: f06f 0009 mvn.w r0, #9
  10319. 800b842: 4770 bx lr
  10320. 0800b844 <tcp_new_port>:
  10321. *
  10322. * @return a new (free) local TCP port number
  10323. */
  10324. static u16_t
  10325. tcp_new_port(void)
  10326. {
  10327. 800b844: 4b13 ldr r3, [pc, #76] ; (800b894 <tcp_new_port+0x50>)
  10328. 800b846: b570 push {r4, r5, r6, lr}
  10329. 800b848: 8818 ldrh r0, [r3, #0]
  10330. if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
  10331. tcp_port = TCP_LOCAL_PORT_RANGE_START;
  10332. }
  10333. /* Check all PCB lists. */
  10334. for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
  10335. for(pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
  10336. 800b84a: 4d13 ldr r5, [pc, #76] ; (800b898 <tcp_new_port+0x54>)
  10337. *
  10338. * @return a new (free) local TCP port number
  10339. */
  10340. static u16_t
  10341. tcp_new_port(void)
  10342. {
  10343. 800b84c: f44f 4280 mov.w r2, #16384 ; 0x4000
  10344. u8_t i;
  10345. u16_t n = 0;
  10346. struct tcp_pcb *pcb;
  10347. again:
  10348. if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
  10349. 800b850: f64f 74ff movw r4, #65535 ; 0xffff
  10350. 800b854: 42a0 cmp r0, r4
  10351. 800b856: d002 beq.n 800b85e <tcp_new_port+0x1a>
  10352. 800b858: 3001 adds r0, #1
  10353. 800b85a: b280 uxth r0, r0
  10354. 800b85c: e001 b.n 800b862 <tcp_new_port+0x1e>
  10355. tcp_port = TCP_LOCAL_PORT_RANGE_START;
  10356. 800b85e: f44f 4040 mov.w r0, #49152 ; 0xc000
  10357. 800b862: 2300 movs r3, #0
  10358. }
  10359. /* Check all PCB lists. */
  10360. for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
  10361. for(pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
  10362. 800b864: 5959 ldr r1, [r3, r5]
  10363. 800b866: 6809 ldr r1, [r1, #0]
  10364. 800b868: e00b b.n 800b882 <tcp_new_port+0x3e>
  10365. if (pcb->local_port == tcp_port) {
  10366. 800b86a: 8b4e ldrh r6, [r1, #26]
  10367. 800b86c: 4286 cmp r6, r0
  10368. 800b86e: d107 bne.n 800b880 <tcp_new_port+0x3c>
  10369. 800b870: 3a01 subs r2, #1
  10370. 800b872: b292 uxth r2, r2
  10371. if (++n > (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) {
  10372. 800b874: 2a00 cmp r2, #0
  10373. 800b876: d1ed bne.n 800b854 <tcp_new_port+0x10>
  10374. 800b878: 4b06 ldr r3, [pc, #24] ; (800b894 <tcp_new_port+0x50>)
  10375. 800b87a: 8018 strh r0, [r3, #0]
  10376. return 0;
  10377. 800b87c: 4610 mov r0, r2
  10378. 800b87e: bd70 pop {r4, r5, r6, pc}
  10379. if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
  10380. tcp_port = TCP_LOCAL_PORT_RANGE_START;
  10381. }
  10382. /* Check all PCB lists. */
  10383. for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
  10384. for(pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
  10385. 800b880: 68c9 ldr r1, [r1, #12]
  10386. 800b882: 2900 cmp r1, #0
  10387. 800b884: d1f1 bne.n 800b86a <tcp_new_port+0x26>
  10388. 800b886: 3304 adds r3, #4
  10389. again:
  10390. if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
  10391. tcp_port = TCP_LOCAL_PORT_RANGE_START;
  10392. }
  10393. /* Check all PCB lists. */
  10394. for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
  10395. 800b888: 2b10 cmp r3, #16
  10396. 800b88a: d1eb bne.n 800b864 <tcp_new_port+0x20>
  10397. 800b88c: 4b01 ldr r3, [pc, #4] ; (800b894 <tcp_new_port+0x50>)
  10398. 800b88e: 8018 strh r0, [r3, #0]
  10399. goto again;
  10400. }
  10401. }
  10402. }
  10403. return tcp_port;
  10404. }
  10405. 800b890: bd70 pop {r4, r5, r6, pc}
  10406. 800b892: bf00 nop
  10407. 800b894: 20000110 .word 0x20000110
  10408. 800b898: 08011858 .word 0x08011858
  10409. 0800b89c <tcp_init>:
  10410. /**
  10411. * Initialize this module.
  10412. */
  10413. void
  10414. tcp_init(void)
  10415. {
  10416. 800b89c: 4770 bx lr
  10417. 800b89e: 0000 movs r0, r0
  10418. 0800b8a0 <tcp_bind>:
  10419. * ERR_VAL if bind failed because the PCB is not in a valid state
  10420. * ERR_OK if bound
  10421. */
  10422. err_t
  10423. tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  10424. {
  10425. 800b8a0: b5f8 push {r3, r4, r5, r6, r7, lr}
  10426. int i;
  10427. int max_pcb_list = NUM_TCP_PCB_LISTS;
  10428. struct tcp_pcb *cpcb;
  10429. LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);
  10430. 800b8a2: 7e03 ldrb r3, [r0, #24]
  10431. * ERR_VAL if bind failed because the PCB is not in a valid state
  10432. * ERR_OK if bound
  10433. */
  10434. err_t
  10435. tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  10436. {
  10437. 800b8a4: 4604 mov r4, r0
  10438. 800b8a6: 460d mov r5, r1
  10439. int i;
  10440. int max_pcb_list = NUM_TCP_PCB_LISTS;
  10441. struct tcp_pcb *cpcb;
  10442. LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);
  10443. 800b8a8: bb33 cbnz r3, 800b8f8 <tcp_bind+0x58>
  10444. if (ip_get_option(pcb, SOF_REUSEADDR)) {
  10445. max_pcb_list = NUM_TCP_PCB_LISTS_NO_TIME_WAIT;
  10446. }
  10447. #endif /* SO_REUSE */
  10448. if (port == 0) {
  10449. 800b8aa: b91a cbnz r2, 800b8b4 <tcp_bind+0x14>
  10450. port = tcp_new_port();
  10451. 800b8ac: f7ff ffca bl 800b844 <tcp_new_port>
  10452. if (port == 0) {
  10453. 800b8b0: 4602 mov r2, r0
  10454. 800b8b2: b318 cbz r0, 800b8fc <tcp_bind+0x5c>
  10455. }
  10456. }
  10457. /* Check if the address already is in use (on all lists) */
  10458. for (i = 0; i < max_pcb_list; i++) {
  10459. for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
  10460. 800b8b4: 4f14 ldr r7, [pc, #80] ; (800b908 <tcp_bind+0x68>)
  10461. * ERR_VAL if bind failed because the PCB is not in a valid state
  10462. * ERR_OK if bound
  10463. */
  10464. err_t
  10465. tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  10466. {
  10467. 800b8b6: 2100 movs r1, #0
  10468. }
  10469. }
  10470. /* Check if the address already is in use (on all lists) */
  10471. for (i = 0; i < max_pcb_list; i++) {
  10472. for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
  10473. 800b8b8: 59cb ldr r3, [r1, r7]
  10474. 800b8ba: 681b ldr r3, [r3, #0]
  10475. 800b8bc: e00a b.n 800b8d4 <tcp_bind+0x34>
  10476. if (cpcb->local_port == port) {
  10477. 800b8be: 8b58 ldrh r0, [r3, #26]
  10478. 800b8c0: 4290 cmp r0, r2
  10479. 800b8c2: d106 bne.n 800b8d2 <tcp_bind+0x32>
  10480. tcp_connect. */
  10481. if (!ip_get_option(pcb, SOF_REUSEADDR) ||
  10482. !ip_get_option(cpcb, SOF_REUSEADDR))
  10483. #endif /* SO_REUSE */
  10484. {
  10485. if (ip_addr_isany(&(cpcb->local_ip)) ||
  10486. 800b8c4: 681e ldr r6, [r3, #0]
  10487. 800b8c6: b1de cbz r6, 800b900 <tcp_bind+0x60>
  10488. 800b8c8: b1d5 cbz r5, 800b900 <tcp_bind+0x60>
  10489. ip_addr_isany(ipaddr) ||
  10490. 800b8ca: 6828 ldr r0, [r5, #0]
  10491. 800b8cc: b1c0 cbz r0, 800b900 <tcp_bind+0x60>
  10492. 800b8ce: 4286 cmp r6, r0
  10493. 800b8d0: d016 beq.n 800b900 <tcp_bind+0x60>
  10494. }
  10495. }
  10496. /* Check if the address already is in use (on all lists) */
  10497. for (i = 0; i < max_pcb_list; i++) {
  10498. for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
  10499. 800b8d2: 68db ldr r3, [r3, #12]
  10500. 800b8d4: 2b00 cmp r3, #0
  10501. 800b8d6: d1f2 bne.n 800b8be <tcp_bind+0x1e>
  10502. 800b8d8: 3104 adds r1, #4
  10503. return ERR_BUF;
  10504. }
  10505. }
  10506. /* Check if the address already is in use (on all lists) */
  10507. for (i = 0; i < max_pcb_list; i++) {
  10508. 800b8da: 2910 cmp r1, #16
  10509. 800b8dc: d1ec bne.n 800b8b8 <tcp_bind+0x18>
  10510. }
  10511. }
  10512. }
  10513. }
  10514. if (!ip_addr_isany(ipaddr)) {
  10515. 800b8de: b115 cbz r5, 800b8e6 <tcp_bind+0x46>
  10516. 800b8e0: 682b ldr r3, [r5, #0]
  10517. 800b8e2: b103 cbz r3, 800b8e6 <tcp_bind+0x46>
  10518. pcb->local_ip = *ipaddr;
  10519. 800b8e4: 6023 str r3, [r4, #0]
  10520. }
  10521. pcb->local_port = port;
  10522. TCP_REG(&tcp_bound_pcbs, pcb);
  10523. 800b8e6: 4b09 ldr r3, [pc, #36] ; (800b90c <tcp_bind+0x6c>)
  10524. }
  10525. if (!ip_addr_isany(ipaddr)) {
  10526. pcb->local_ip = *ipaddr;
  10527. }
  10528. pcb->local_port = port;
  10529. 800b8e8: 8362 strh r2, [r4, #26]
  10530. TCP_REG(&tcp_bound_pcbs, pcb);
  10531. 800b8ea: 681a ldr r2, [r3, #0]
  10532. 800b8ec: 601c str r4, [r3, #0]
  10533. 800b8ee: 60e2 str r2, [r4, #12]
  10534. 800b8f0: f002 f9a2 bl 800dc38 <tcp_timer_needed>
  10535. LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port));
  10536. return ERR_OK;
  10537. 800b8f4: 2000 movs r0, #0
  10538. 800b8f6: e004 b.n 800b902 <tcp_bind+0x62>
  10539. {
  10540. int i;
  10541. int max_pcb_list = NUM_TCP_PCB_LISTS;
  10542. struct tcp_pcb *cpcb;
  10543. LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);
  10544. 800b8f8: 20fa movs r0, #250 ; 0xfa
  10545. 800b8fa: e002 b.n 800b902 <tcp_bind+0x62>
  10546. #endif /* SO_REUSE */
  10547. if (port == 0) {
  10548. port = tcp_new_port();
  10549. if (port == 0) {
  10550. return ERR_BUF;
  10551. 800b8fc: 20fe movs r0, #254 ; 0xfe
  10552. 800b8fe: e000 b.n 800b902 <tcp_bind+0x62>
  10553. #endif /* SO_REUSE */
  10554. {
  10555. if (ip_addr_isany(&(cpcb->local_ip)) ||
  10556. ip_addr_isany(ipaddr) ||
  10557. ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {
  10558. return ERR_USE;
  10559. 800b900: 20f8 movs r0, #248 ; 0xf8
  10560. }
  10561. pcb->local_port = port;
  10562. TCP_REG(&tcp_bound_pcbs, pcb);
  10563. LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port));
  10564. return ERR_OK;
  10565. }
  10566. 800b902: b240 sxtb r0, r0
  10567. 800b904: bdf8 pop {r3, r4, r5, r6, r7, pc}
  10568. 800b906: bf00 nop
  10569. 800b908: 08011858 .word 0x08011858
  10570. 800b90c: 2000834c .word 0x2000834c
  10571. 0800b910 <tcp_listen_with_backlog>:
  10572. * called like this:
  10573. * tpcb = tcp_listen(tpcb);
  10574. */
  10575. struct tcp_pcb *
  10576. tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
  10577. {
  10578. 800b910: b538 push {r3, r4, r5, lr}
  10579. struct tcp_pcb_listen *lpcb;
  10580. LWIP_UNUSED_ARG(backlog);
  10581. LWIP_ERROR("tcp_listen: pcb already connected", pcb->state == CLOSED, return NULL);
  10582. 800b912: 7e03 ldrb r3, [r0, #24]
  10583. * called like this:
  10584. * tpcb = tcp_listen(tpcb);
  10585. */
  10586. struct tcp_pcb *
  10587. tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
  10588. {
  10589. 800b914: 4604 mov r4, r0
  10590. struct tcp_pcb_listen *lpcb;
  10591. LWIP_UNUSED_ARG(backlog);
  10592. LWIP_ERROR("tcp_listen: pcb already connected", pcb->state == CLOSED, return NULL);
  10593. 800b916: b10b cbz r3, 800b91c <tcp_listen_with_backlog+0xc>
  10594. 800b918: 2000 movs r0, #0
  10595. 800b91a: bd38 pop {r3, r4, r5, pc}
  10596. }
  10597. }
  10598. }
  10599. }
  10600. #endif /* SO_REUSE */
  10601. lpcb = (struct tcp_pcb_listen *)memp_malloc(MEMP_TCP_PCB_LISTEN);
  10602. 800b91c: 2003 movs r0, #3
  10603. 800b91e: f7ff fcaf bl 800b280 <memp_malloc>
  10604. if (lpcb == NULL) {
  10605. 800b922: 4605 mov r5, r0
  10606. 800b924: 2800 cmp r0, #0
  10607. 800b926: d0f7 beq.n 800b918 <tcp_listen_with_backlog+0x8>
  10608. return NULL;
  10609. }
  10610. lpcb->callback_arg = pcb->callback_arg;
  10611. 800b928: 6923 ldr r3, [r4, #16]
  10612. 800b92a: 6103 str r3, [r0, #16]
  10613. lpcb->local_port = pcb->local_port;
  10614. 800b92c: 8b63 ldrh r3, [r4, #26]
  10615. 800b92e: 8343 strh r3, [r0, #26]
  10616. lpcb->state = LISTEN;
  10617. 800b930: 2301 movs r3, #1
  10618. 800b932: 7603 strb r3, [r0, #24]
  10619. lpcb->prio = pcb->prio;
  10620. 800b934: 7e63 ldrb r3, [r4, #25]
  10621. 800b936: 7643 strb r3, [r0, #25]
  10622. lpcb->so_options = pcb->so_options;
  10623. ip_set_option(lpcb, SOF_ACCEPTCONN);
  10624. 800b938: 7a23 ldrb r3, [r4, #8]
  10625. 800b93a: f043 0302 orr.w r3, r3, #2
  10626. 800b93e: 7203 strb r3, [r0, #8]
  10627. lpcb->ttl = pcb->ttl;
  10628. 800b940: 7aa3 ldrb r3, [r4, #10]
  10629. 800b942: 7283 strb r3, [r0, #10]
  10630. lpcb->tos = pcb->tos;
  10631. 800b944: 7a63 ldrb r3, [r4, #9]
  10632. 800b946: 7243 strb r3, [r0, #9]
  10633. ip_addr_copy(lpcb->local_ip, pcb->local_ip);
  10634. 800b948: 6823 ldr r3, [r4, #0]
  10635. 800b94a: 6003 str r3, [r0, #0]
  10636. if (pcb->local_port != 0) {
  10637. 800b94c: 8b63 ldrh r3, [r4, #26]
  10638. 800b94e: b1ab cbz r3, 800b97c <tcp_listen_with_backlog+0x6c>
  10639. TCP_RMV(&tcp_bound_pcbs, pcb);
  10640. 800b950: 4a11 ldr r2, [pc, #68] ; (800b998 <tcp_listen_with_backlog+0x88>)
  10641. 800b952: 6813 ldr r3, [r2, #0]
  10642. 800b954: 42a3 cmp r3, r4
  10643. 800b956: d101 bne.n 800b95c <tcp_listen_with_backlog+0x4c>
  10644. 800b958: 68e3 ldr r3, [r4, #12]
  10645. 800b95a: e00c b.n 800b976 <tcp_listen_with_backlog+0x66>
  10646. 800b95c: 4a0f ldr r2, [pc, #60] ; (800b99c <tcp_listen_with_backlog+0x8c>)
  10647. 800b95e: 6013 str r3, [r2, #0]
  10648. 800b960: e007 b.n 800b972 <tcp_listen_with_backlog+0x62>
  10649. 800b962: 68d9 ldr r1, [r3, #12]
  10650. 800b964: 42a1 cmp r1, r4
  10651. 800b966: d103 bne.n 800b970 <tcp_listen_with_backlog+0x60>
  10652. 800b968: 6013 str r3, [r2, #0]
  10653. 800b96a: 68e2 ldr r2, [r4, #12]
  10654. 800b96c: 60da str r2, [r3, #12]
  10655. 800b96e: e003 b.n 800b978 <tcp_listen_with_backlog+0x68>
  10656. 800b970: 460b mov r3, r1
  10657. 800b972: 2b00 cmp r3, #0
  10658. 800b974: d1f5 bne.n 800b962 <tcp_listen_with_backlog+0x52>
  10659. 800b976: 6013 str r3, [r2, #0]
  10660. 800b978: 2300 movs r3, #0
  10661. 800b97a: 60e3 str r3, [r4, #12]
  10662. }
  10663. memp_free(MEMP_TCP_PCB, pcb);
  10664. 800b97c: 2002 movs r0, #2
  10665. 800b97e: 4621 mov r1, r4
  10666. 800b980: f7ff fca8 bl 800b2d4 <memp_free>
  10667. #if LWIP_CALLBACK_API
  10668. lpcb->accept = tcp_accept_null;
  10669. 800b984: 4b06 ldr r3, [pc, #24] ; (800b9a0 <tcp_listen_with_backlog+0x90>)
  10670. 800b986: 616b str r3, [r5, #20]
  10671. #endif /* LWIP_CALLBACK_API */
  10672. #if TCP_LISTEN_BACKLOG
  10673. lpcb->accepts_pending = 0;
  10674. lpcb->backlog = (backlog ? backlog : 1);
  10675. #endif /* TCP_LISTEN_BACKLOG */
  10676. TCP_REG(&tcp_listen_pcbs.pcbs, (struct tcp_pcb *)lpcb);
  10677. 800b988: 4b06 ldr r3, [pc, #24] ; (800b9a4 <tcp_listen_with_backlog+0x94>)
  10678. 800b98a: 681a ldr r2, [r3, #0]
  10679. 800b98c: 601d str r5, [r3, #0]
  10680. 800b98e: 60ea str r2, [r5, #12]
  10681. 800b990: f002 f952 bl 800dc38 <tcp_timer_needed>
  10682. return (struct tcp_pcb *)lpcb;
  10683. 800b994: 4628 mov r0, r5
  10684. }
  10685. 800b996: bd38 pop {r3, r4, r5, pc}
  10686. 800b998: 2000834c .word 0x2000834c
  10687. 800b99c: 20008348 .word 0x20008348
  10688. 800b9a0: 0800b83f .word 0x0800b83f
  10689. 800b9a4: 20008344 .word 0x20008344
  10690. 0800b9a8 <tcp_update_rcv_ann_wnd>:
  10691. *
  10692. * Returns how much extra window would be advertised if we sent an
  10693. * update now.
  10694. */
  10695. u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
  10696. {
  10697. 800b9a8: b530 push {r4, r5, lr}
  10698. u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
  10699. if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
  10700. 800b9aa: 6b01 ldr r1, [r0, #48] ; 0x30
  10701. * Returns how much extra window would be advertised if we sent an
  10702. * update now.
  10703. */
  10704. u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
  10705. {
  10706. u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
  10707. 800b9ac: 8d84 ldrh r4, [r0, #44] ; 0x2c
  10708. if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
  10709. 800b9ae: 8ec5 ldrh r5, [r0, #54] ; 0x36
  10710. * Returns how much extra window would be advertised if we sent an
  10711. * update now.
  10712. */
  10713. u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
  10714. {
  10715. u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
  10716. 800b9b0: 6a82 ldr r2, [r0, #40] ; 0x28
  10717. *
  10718. * Returns how much extra window would be advertised if we sent an
  10719. * update now.
  10720. */
  10721. u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
  10722. {
  10723. 800b9b2: 4603 mov r3, r0
  10724. u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
  10725. if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
  10726. 800b9b4: f640 3068 movw r0, #2920 ; 0xb68
  10727. 800b9b8: 4285 cmp r5, r0
  10728. 800b9ba: bf28 it cs
  10729. 800b9bc: 4605 movcs r5, r0
  10730. * Returns how much extra window would be advertised if we sent an
  10731. * update now.
  10732. */
  10733. u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
  10734. {
  10735. u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
  10736. 800b9be: 1a60 subs r0, r4, r1
  10737. if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
  10738. 800b9c0: 1880 adds r0, r0, r2
  10739. 800b9c2: 1b45 subs r5, r0, r5
  10740. 800b9c4: 2d00 cmp r5, #0
  10741. 800b9c6: db01 blt.n 800b9cc <tcp_update_rcv_ann_wnd+0x24>
  10742. /* we can advertise more window */
  10743. pcb->rcv_ann_wnd = pcb->rcv_wnd;
  10744. 800b9c8: 85dc strh r4, [r3, #46] ; 0x2e
  10745. return new_right_edge - pcb->rcv_ann_right_edge;
  10746. 800b9ca: bd30 pop {r4, r5, pc}
  10747. } else {
  10748. if (TCP_SEQ_GT(pcb->rcv_nxt, pcb->rcv_ann_right_edge)) {
  10749. 800b9cc: 1a50 subs r0, r2, r1
  10750. 800b9ce: 2800 cmp r0, #0
  10751. 800b9d0: f04f 0000 mov.w r0, #0
  10752. 800b9d4: dd01 ble.n 800b9da <tcp_update_rcv_ann_wnd+0x32>
  10753. /* Can happen due to other end sending out of advertised window,
  10754. * but within actual available (but not yet advertised) window */
  10755. pcb->rcv_ann_wnd = 0;
  10756. 800b9d6: 85d8 strh r0, [r3, #46] ; 0x2e
  10757. 800b9d8: bd30 pop {r4, r5, pc}
  10758. } else {
  10759. /* keep the right edge of window constant */
  10760. u32_t new_rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt;
  10761. 800b9da: 1a8a subs r2, r1, r2
  10762. LWIP_ASSERT("new_rcv_ann_wnd <= 0xffff", new_rcv_ann_wnd <= 0xffff);
  10763. pcb->rcv_ann_wnd = (u16_t)new_rcv_ann_wnd;
  10764. 800b9dc: 85da strh r2, [r3, #46] ; 0x2e
  10765. }
  10766. return 0;
  10767. }
  10768. }
  10769. 800b9de: bd30 pop {r4, r5, pc}
  10770. 0800b9e0 <tcp_recved>:
  10771. LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
  10772. pcb->state != LISTEN);
  10773. LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n",
  10774. len <= 0xffff - pcb->rcv_wnd );
  10775. pcb->rcv_wnd += len;
  10776. 800b9e0: 8d83 ldrh r3, [r0, #44] ; 0x2c
  10777. 800b9e2: 18c9 adds r1, r1, r3
  10778. 800b9e4: b289 uxth r1, r1
  10779. if (pcb->rcv_wnd > TCP_WND) {
  10780. 800b9e6: f241 63d0 movw r3, #5840 ; 0x16d0
  10781. 800b9ea: 4299 cmp r1, r3
  10782. * @param pcb the tcp_pcb for which data is read
  10783. * @param len the amount of bytes that have been read by the application
  10784. */
  10785. void
  10786. tcp_recved(struct tcp_pcb *pcb, u16_t len)
  10787. {
  10788. 800b9ec: b510 push {r4, lr}
  10789. LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n",
  10790. len <= 0xffff - pcb->rcv_wnd );
  10791. pcb->rcv_wnd += len;
  10792. if (pcb->rcv_wnd > TCP_WND) {
  10793. pcb->rcv_wnd = TCP_WND;
  10794. 800b9ee: bf8c ite hi
  10795. 800b9f0: 8583 strhhi r3, [r0, #44] ; 0x2c
  10796. LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
  10797. pcb->state != LISTEN);
  10798. LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n",
  10799. len <= 0xffff - pcb->rcv_wnd );
  10800. pcb->rcv_wnd += len;
  10801. 800b9f2: 8581 strhls r1, [r0, #44] ; 0x2c
  10802. * @param pcb the tcp_pcb for which data is read
  10803. * @param len the amount of bytes that have been read by the application
  10804. */
  10805. void
  10806. tcp_recved(struct tcp_pcb *pcb, u16_t len)
  10807. {
  10808. 800b9f4: 4604 mov r4, r0
  10809. pcb->rcv_wnd += len;
  10810. if (pcb->rcv_wnd > TCP_WND) {
  10811. pcb->rcv_wnd = TCP_WND;
  10812. }
  10813. wnd_inflation = tcp_update_rcv_ann_wnd(pcb);
  10814. 800b9f6: f7ff ffd7 bl 800b9a8 <tcp_update_rcv_ann_wnd>
  10815. /* If the change in the right edge of window is significant (default
  10816. * watermark is TCP_WND/4), then send an explicit update now.
  10817. * Otherwise wait for a packet to be sent in the normal course of
  10818. * events (or more window to be available later) */
  10819. if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
  10820. 800b9fa: f240 53b3 movw r3, #1459 ; 0x5b3
  10821. 800b9fe: 4298 cmp r0, r3
  10822. 800ba00: dd08 ble.n 800ba14 <tcp_recved+0x34>
  10823. tcp_ack_now(pcb);
  10824. 800ba02: 7fa3 ldrb r3, [r4, #30]
  10825. tcp_output(pcb);
  10826. 800ba04: 4620 mov r0, r4
  10827. /* If the change in the right edge of window is significant (default
  10828. * watermark is TCP_WND/4), then send an explicit update now.
  10829. * Otherwise wait for a packet to be sent in the normal course of
  10830. * events (or more window to be available later) */
  10831. if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
  10832. tcp_ack_now(pcb);
  10833. 800ba06: f043 0302 orr.w r3, r3, #2
  10834. 800ba0a: 77a3 strb r3, [r4, #30]
  10835. tcp_output(pcb);
  10836. }
  10837. LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n",
  10838. len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd));
  10839. }
  10840. 800ba0c: e8bd 4010 ldmia.w sp!, {r4, lr}
  10841. * watermark is TCP_WND/4), then send an explicit update now.
  10842. * Otherwise wait for a packet to be sent in the normal course of
  10843. * events (or more window to be available later) */
  10844. if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
  10845. tcp_ack_now(pcb);
  10846. tcp_output(pcb);
  10847. 800ba10: f001 be10 b.w 800d634 <tcp_output>
  10848. 800ba14: bd10 pop {r4, pc}
  10849. 0800ba16 <tcp_seg_free>:
  10850. *
  10851. * @param seg single tcp_seg to free
  10852. */
  10853. void
  10854. tcp_seg_free(struct tcp_seg *seg)
  10855. {
  10856. 800ba16: b510 push {r4, lr}
  10857. if (seg != NULL) {
  10858. 800ba18: 4604 mov r4, r0
  10859. 800ba1a: b158 cbz r0, 800ba34 <tcp_seg_free+0x1e>
  10860. if (seg->p != NULL) {
  10861. 800ba1c: 6840 ldr r0, [r0, #4]
  10862. 800ba1e: b118 cbz r0, 800ba28 <tcp_seg_free+0x12>
  10863. pbuf_free(seg->p);
  10864. 800ba20: f7ff fd50 bl 800b4c4 <pbuf_free>
  10865. #if TCP_DEBUG
  10866. seg->p = NULL;
  10867. 800ba24: 2300 movs r3, #0
  10868. 800ba26: 6063 str r3, [r4, #4]
  10869. #endif /* TCP_DEBUG */
  10870. }
  10871. memp_free(MEMP_TCP_SEG, seg);
  10872. 800ba28: 2004 movs r0, #4
  10873. 800ba2a: 4621 mov r1, r4
  10874. }
  10875. }
  10876. 800ba2c: e8bd 4010 ldmia.w sp!, {r4, lr}
  10877. pbuf_free(seg->p);
  10878. #if TCP_DEBUG
  10879. seg->p = NULL;
  10880. #endif /* TCP_DEBUG */
  10881. }
  10882. memp_free(MEMP_TCP_SEG, seg);
  10883. 800ba30: f7ff bc50 b.w 800b2d4 <memp_free>
  10884. 800ba34: bd10 pop {r4, pc}
  10885. 0800ba36 <tcp_segs_free>:
  10886. *
  10887. * @param seg tcp_seg list of TCP segments to free
  10888. */
  10889. void
  10890. tcp_segs_free(struct tcp_seg *seg)
  10891. {
  10892. 800ba36: b510 push {r4, lr}
  10893. while (seg != NULL) {
  10894. 800ba38: e003 b.n 800ba42 <tcp_segs_free+0xc>
  10895. struct tcp_seg *next = seg->next;
  10896. 800ba3a: 6804 ldr r4, [r0, #0]
  10897. tcp_seg_free(seg);
  10898. 800ba3c: f7ff ffeb bl 800ba16 <tcp_seg_free>
  10899. seg = next;
  10900. 800ba40: 4620 mov r0, r4
  10901. * @param seg tcp_seg list of TCP segments to free
  10902. */
  10903. void
  10904. tcp_segs_free(struct tcp_seg *seg)
  10905. {
  10906. while (seg != NULL) {
  10907. 800ba42: 2800 cmp r0, #0
  10908. 800ba44: d1f9 bne.n 800ba3a <tcp_segs_free+0x4>
  10909. struct tcp_seg *next = seg->next;
  10910. tcp_seg_free(seg);
  10911. seg = next;
  10912. }
  10913. }
  10914. 800ba46: bd10 pop {r4, pc}
  10915. 0800ba48 <tcp_arg>:
  10916. void
  10917. tcp_arg(struct tcp_pcb *pcb, void *arg)
  10918. {
  10919. /* This function is allowed to be called for both listen pcbs and
  10920. connection pcbs. */
  10921. pcb->callback_arg = arg;
  10922. 800ba48: 6101 str r1, [r0, #16]
  10923. 800ba4a: 4770 bx lr
  10924. 0800ba4c <tcp_recv>:
  10925. */
  10926. void
  10927. tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv)
  10928. {
  10929. LWIP_ASSERT("invalid socket state for recv callback", pcb->state != LISTEN);
  10930. pcb->recv = recv;
  10931. 800ba4c: 67c1 str r1, [r0, #124] ; 0x7c
  10932. 800ba4e: 4770 bx lr
  10933. 0800ba50 <tcp_sent>:
  10934. */
  10935. void
  10936. tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent)
  10937. {
  10938. LWIP_ASSERT("invalid socket state for sent callback", pcb->state != LISTEN);
  10939. pcb->sent = sent;
  10940. 800ba50: 6781 str r1, [r0, #120] ; 0x78
  10941. 800ba52: 4770 bx lr
  10942. 0800ba54 <tcp_err>:
  10943. */
  10944. void
  10945. tcp_err(struct tcp_pcb *pcb, tcp_err_fn err)
  10946. {
  10947. LWIP_ASSERT("invalid socket state for err callback", pcb->state != LISTEN);
  10948. pcb->errf = err;
  10949. 800ba54: f8c0 1088 str.w r1, [r0, #136] ; 0x88
  10950. 800ba58: 4770 bx lr
  10951. 0800ba5a <tcp_accept>:
  10952. void
  10953. tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept)
  10954. {
  10955. /* This function is allowed to be called for both listen pcbs and
  10956. connection pcbs. */
  10957. pcb->accept = accept;
  10958. 800ba5a: 6141 str r1, [r0, #20]
  10959. 800ba5c: 4770 bx lr
  10960. 0800ba5e <tcp_poll>:
  10961. void
  10962. tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval)
  10963. {
  10964. LWIP_ASSERT("invalid socket state for poll", pcb->state != LISTEN);
  10965. #if LWIP_CALLBACK_API
  10966. pcb->poll = poll;
  10967. 800ba5e: f8c0 1084 str.w r1, [r0, #132] ; 0x84
  10968. #else /* LWIP_CALLBACK_API */
  10969. LWIP_UNUSED_ARG(poll);
  10970. #endif /* LWIP_CALLBACK_API */
  10971. pcb->pollinterval = interval;
  10972. 800ba62: f880 2020 strb.w r2, [r0, #32]
  10973. 800ba66: 4770 bx lr
  10974. 0800ba68 <tcp_pcb_purge>:
  10975. * @param pcb tcp_pcb to purge. The pcb itself is not deallocated!
  10976. */
  10977. void
  10978. tcp_pcb_purge(struct tcp_pcb *pcb)
  10979. {
  10980. if (pcb->state != CLOSED &&
  10981. 800ba68: 7e03 ldrb r3, [r0, #24]
  10982. *
  10983. * @param pcb tcp_pcb to purge. The pcb itself is not deallocated!
  10984. */
  10985. void
  10986. tcp_pcb_purge(struct tcp_pcb *pcb)
  10987. {
  10988. 800ba6a: b510 push {r4, lr}
  10989. 800ba6c: 4604 mov r4, r0
  10990. if (pcb->state != CLOSED &&
  10991. 800ba6e: b1bb cbz r3, 800baa0 <tcp_pcb_purge+0x38>
  10992. 800ba70: 2b0a cmp r3, #10
  10993. 800ba72: d015 beq.n 800baa0 <tcp_pcb_purge+0x38>
  10994. pcb->state != TIME_WAIT &&
  10995. 800ba74: 2b01 cmp r3, #1
  10996. 800ba76: d013 beq.n 800baa0 <tcp_pcb_purge+0x38>
  10997. }
  10998. }
  10999. #endif /* TCP_LISTEN_BACKLOG */
  11000. if (pcb->refused_data != NULL) {
  11001. 800ba78: 6f40 ldr r0, [r0, #116] ; 0x74
  11002. 800ba7a: b118 cbz r0, 800ba84 <tcp_pcb_purge+0x1c>
  11003. LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->refused_data\n"));
  11004. pbuf_free(pcb->refused_data);
  11005. 800ba7c: f7ff fd22 bl 800b4c4 <pbuf_free>
  11006. pcb->refused_data = NULL;
  11007. 800ba80: 2300 movs r3, #0
  11008. 800ba82: 6763 str r3, [r4, #116] ; 0x74
  11009. pcb->ooseq = NULL;
  11010. #endif /* TCP_QUEUE_OOSEQ */
  11011. /* Stop the retransmission timer as it will expect data on unacked
  11012. queue if it fires */
  11013. pcb->rtime = -1;
  11014. 800ba84: f64f 73ff movw r3, #65535 ; 0xffff
  11015. 800ba88: 86a3 strh r3, [r4, #52] ; 0x34
  11016. tcp_segs_free(pcb->unsent);
  11017. 800ba8a: 6ee0 ldr r0, [r4, #108] ; 0x6c
  11018. 800ba8c: f7ff ffd3 bl 800ba36 <tcp_segs_free>
  11019. tcp_segs_free(pcb->unacked);
  11020. 800ba90: 6f20 ldr r0, [r4, #112] ; 0x70
  11021. 800ba92: f7ff ffd0 bl 800ba36 <tcp_segs_free>
  11022. pcb->unacked = pcb->unsent = NULL;
  11023. 800ba96: 2300 movs r3, #0
  11024. 800ba98: 66e3 str r3, [r4, #108] ; 0x6c
  11025. 800ba9a: 6723 str r3, [r4, #112] ; 0x70
  11026. #if TCP_OVERSIZE
  11027. pcb->unsent_oversize = 0;
  11028. 800ba9c: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
  11029. 800baa0: bd10 pop {r4, pc}
  11030. 800baa2: 0000 movs r0, r0
  11031. 0800baa4 <tcp_slowtmr>:
  11032. u8_t pcb_reset; /* flag if a RST should be sent when removing */
  11033. err_t err;
  11034. err = ERR_OK;
  11035. ++tcp_ticks;
  11036. 800baa4: 4b9c ldr r3, [pc, #624] ; (800bd18 <tcp_slowtmr+0x274>)
  11037. *
  11038. * Automatically called from tcp_tmr().
  11039. */
  11040. void
  11041. tcp_slowtmr(void)
  11042. {
  11043. 800baa6: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  11044. u8_t pcb_reset; /* flag if a RST should be sent when removing */
  11045. err_t err;
  11046. err = ERR_OK;
  11047. ++tcp_ticks;
  11048. 800baaa: 681a ldr r2, [r3, #0]
  11049. err_arg = pcb->callback_arg;
  11050. pcb2 = pcb;
  11051. pcb = pcb->next;
  11052. memp_free(MEMP_TCP_PCB, pcb2);
  11053. tcp_active_pcbs_changed = 0;
  11054. 800baac: f8df 8284 ldr.w r8, [pc, #644] ; 800bd34 <tcp_slowtmr+0x290>
  11055. u8_t pcb_reset; /* flag if a RST should be sent when removing */
  11056. err_t err;
  11057. err = ERR_OK;
  11058. ++tcp_ticks;
  11059. 800bab0: 3201 adds r2, #1
  11060. 800bab2: 601a str r2, [r3, #0]
  11061. ++tcp_timer_ctr;
  11062. 800bab4: 4b99 ldr r3, [pc, #612] ; (800bd1c <tcp_slowtmr+0x278>)
  11063. 800bab6: 781a ldrb r2, [r3, #0]
  11064. 800bab8: 3201 adds r2, #1
  11065. 800baba: 701a strb r2, [r3, #0]
  11066. 800babc: 46c1 mov r9, r8
  11067. tcp_slowtmr_start:
  11068. /* Steps through all of the active PCBs. */
  11069. prev = NULL;
  11070. pcb = tcp_active_pcbs;
  11071. 800babe: 4b98 ldr r3, [pc, #608] ; (800bd20 <tcp_slowtmr+0x27c>)
  11072. while (pcb != NULL) {
  11073. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n"));
  11074. LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED);
  11075. LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN);
  11076. LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT);
  11077. if (pcb->last_timer == tcp_timer_ctr) {
  11078. 800bac0: f8df a258 ldr.w sl, [pc, #600] ; 800bd1c <tcp_slowtmr+0x278>
  11079. ++tcp_timer_ctr;
  11080. tcp_slowtmr_start:
  11081. /* Steps through all of the active PCBs. */
  11082. prev = NULL;
  11083. pcb = tcp_active_pcbs;
  11084. 800bac4: 681c ldr r4, [r3, #0]
  11085. ++tcp_ticks;
  11086. ++tcp_timer_ctr;
  11087. tcp_slowtmr_start:
  11088. /* Steps through all of the active PCBs. */
  11089. prev = NULL;
  11090. 800bac6: 2600 movs r6, #0
  11091. pcb = tcp_active_pcbs;
  11092. if (pcb == NULL) {
  11093. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
  11094. }
  11095. while (pcb != NULL) {
  11096. 800bac8: e0ff b.n 800bcca <tcp_slowtmr+0x226>
  11097. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n"));
  11098. LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED);
  11099. LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN);
  11100. LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT);
  11101. if (pcb->last_timer == tcp_timer_ctr) {
  11102. 800baca: f89a 3000 ldrb.w r3, [sl]
  11103. 800bace: f894 2021 ldrb.w r2, [r4, #33] ; 0x21
  11104. 800bad2: 429a cmp r2, r3
  11105. 800bad4: d101 bne.n 800bada <tcp_slowtmr+0x36>
  11106. /* skip this pcb, we have already processed it */
  11107. pcb = pcb->next;
  11108. 800bad6: 68e7 ldr r7, [r4, #12]
  11109. continue;
  11110. 800bad8: e0f6 b.n 800bcc8 <tcp_slowtmr+0x224>
  11111. pcb->last_timer = tcp_timer_ctr;
  11112. pcb_remove = 0;
  11113. pcb_reset = 0;
  11114. if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
  11115. 800bada: 7e21 ldrb r1, [r4, #24]
  11116. if (pcb->last_timer == tcp_timer_ctr) {
  11117. /* skip this pcb, we have already processed it */
  11118. pcb = pcb->next;
  11119. continue;
  11120. }
  11121. pcb->last_timer = tcp_timer_ctr;
  11122. 800badc: f884 3021 strb.w r3, [r4, #33] ; 0x21
  11123. pcb_remove = 0;
  11124. pcb_reset = 0;
  11125. if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
  11126. 800bae0: 2902 cmp r1, #2
  11127. 800bae2: f894 2046 ldrb.w r2, [r4, #70] ; 0x46
  11128. 800bae6: d101 bne.n 800baec <tcp_slowtmr+0x48>
  11129. 800bae8: 2a06 cmp r2, #6
  11130. 800baea: d051 beq.n 800bb90 <tcp_slowtmr+0xec>
  11131. ++pcb_remove;
  11132. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n"));
  11133. }
  11134. else if (pcb->nrtx == TCP_MAXRTX) {
  11135. 800baec: 2a0c cmp r2, #12
  11136. 800baee: d04f beq.n 800bb90 <tcp_slowtmr+0xec>
  11137. ++pcb_remove;
  11138. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
  11139. } else {
  11140. if (pcb->persist_backoff > 0) {
  11141. 800baf0: f894 3091 ldrb.w r3, [r4, #145] ; 0x91
  11142. 800baf4: b1c3 cbz r3, 800bb28 <tcp_slowtmr+0x84>
  11143. /* If snd_wnd is zero, use persist timer to send 1 byte probes
  11144. * instead of using the standard retransmission mechanism. */
  11145. pcb->persist_cnt++;
  11146. if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  11147. 800baf6: 498b ldr r1, [pc, #556] ; (800bd24 <tcp_slowtmr+0x280>)
  11148. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
  11149. } else {
  11150. if (pcb->persist_backoff > 0) {
  11151. /* If snd_wnd is zero, use persist timer to send 1 byte probes
  11152. * instead of using the standard retransmission mechanism. */
  11153. pcb->persist_cnt++;
  11154. 800baf8: f894 2090 ldrb.w r2, [r4, #144] ; 0x90
  11155. if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  11156. 800bafc: 18c9 adds r1, r1, r3
  11157. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
  11158. } else {
  11159. if (pcb->persist_backoff > 0) {
  11160. /* If snd_wnd is zero, use persist timer to send 1 byte probes
  11161. * instead of using the standard retransmission mechanism. */
  11162. pcb->persist_cnt++;
  11163. 800bafe: 3201 adds r2, #1
  11164. if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  11165. 800bb00: f811 1c01 ldrb.w r1, [r1, #-1]
  11166. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
  11167. } else {
  11168. if (pcb->persist_backoff > 0) {
  11169. /* If snd_wnd is zero, use persist timer to send 1 byte probes
  11170. * instead of using the standard retransmission mechanism. */
  11171. pcb->persist_cnt++;
  11172. 800bb04: b2d2 uxtb r2, r2
  11173. if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  11174. 800bb06: 4291 cmp r1, r2
  11175. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
  11176. } else {
  11177. if (pcb->persist_backoff > 0) {
  11178. /* If snd_wnd is zero, use persist timer to send 1 byte probes
  11179. * instead of using the standard retransmission mechanism. */
  11180. pcb->persist_cnt++;
  11181. 800bb08: f884 2090 strb.w r2, [r4, #144] ; 0x90
  11182. if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  11183. 800bb0c: d900 bls.n 800bb10 <tcp_slowtmr+0x6c>
  11184. 800bb0e: e03d b.n 800bb8c <tcp_slowtmr+0xe8>
  11185. pcb->persist_cnt = 0;
  11186. 800bb10: 2200 movs r2, #0
  11187. if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) {
  11188. 800bb12: 2b06 cmp r3, #6
  11189. if (pcb->persist_backoff > 0) {
  11190. /* If snd_wnd is zero, use persist timer to send 1 byte probes
  11191. * instead of using the standard retransmission mechanism. */
  11192. pcb->persist_cnt++;
  11193. if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
  11194. pcb->persist_cnt = 0;
  11195. 800bb14: f884 2090 strb.w r2, [r4, #144] ; 0x90
  11196. if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) {
  11197. 800bb18: d802 bhi.n 800bb20 <tcp_slowtmr+0x7c>
  11198. pcb->persist_backoff++;
  11199. 800bb1a: 3301 adds r3, #1
  11200. 800bb1c: f884 3091 strb.w r3, [r4, #145] ; 0x91
  11201. }
  11202. tcp_zero_window_probe(pcb);
  11203. 800bb20: 4620 mov r0, r4
  11204. 800bb22: f001 ffa5 bl 800da70 <tcp_zero_window_probe>
  11205. 800bb26: e031 b.n 800bb8c <tcp_slowtmr+0xe8>
  11206. }
  11207. } else {
  11208. /* Increase the retransmission timer if it is running */
  11209. if(pcb->rtime >= 0) {
  11210. 800bb28: 8ea3 ldrh r3, [r4, #52] ; 0x34
  11211. 800bb2a: 0418 lsls r0, r3, #16
  11212. 800bb2c: d401 bmi.n 800bb32 <tcp_slowtmr+0x8e>
  11213. ++pcb->rtime;
  11214. 800bb2e: 3301 adds r3, #1
  11215. 800bb30: 86a3 strh r3, [r4, #52] ; 0x34
  11216. }
  11217. if (pcb->unacked != NULL && pcb->rtime >= pcb->rto) {
  11218. 800bb32: 6f23 ldr r3, [r4, #112] ; 0x70
  11219. 800bb34: b353 cbz r3, 800bb8c <tcp_slowtmr+0xe8>
  11220. 800bb36: f9b4 0034 ldrsh.w r0, [r4, #52] ; 0x34
  11221. 800bb3a: f9b4 3044 ldrsh.w r3, [r4, #68] ; 0x44
  11222. 800bb3e: 4298 cmp r0, r3
  11223. 800bb40: db24 blt.n 800bb8c <tcp_slowtmr+0xe8>
  11224. " pcb->rto %"S16_F"\n",
  11225. pcb->rtime, pcb->rto));
  11226. /* Double retransmission time-out unless we are trying to
  11227. * connect to somebody (i.e., we are in SYN_SENT). */
  11228. if (pcb->state != SYN_SENT) {
  11229. 800bb42: 2902 cmp r1, #2
  11230. 800bb44: d00b beq.n 800bb5e <tcp_slowtmr+0xba>
  11231. pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx];
  11232. 800bb46: f9b4 1040 ldrsh.w r1, [r4, #64] ; 0x40
  11233. 800bb4a: f9b4 3042 ldrsh.w r3, [r4, #66] ; 0x42
  11234. 800bb4e: eb03 03e1 add.w r3, r3, r1, asr #3
  11235. 800bb52: 4975 ldr r1, [pc, #468] ; (800bd28 <tcp_slowtmr+0x284>)
  11236. 800bb54: 5c8a ldrb r2, [r1, r2]
  11237. 800bb56: fa03 f302 lsl.w r3, r3, r2
  11238. 800bb5a: f8a4 3044 strh.w r3, [r4, #68] ; 0x44
  11239. }
  11240. /* Reset the retransmission timer. */
  11241. pcb->rtime = 0;
  11242. 800bb5e: 2300 movs r3, #0
  11243. /* Reduce congestion window and ssthresh. */
  11244. eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
  11245. 800bb60: f8b4 104c ldrh.w r1, [r4, #76] ; 0x4c
  11246. if (pcb->state != SYN_SENT) {
  11247. pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx];
  11248. }
  11249. /* Reset the retransmission timer. */
  11250. pcb->rtime = 0;
  11251. 800bb64: 86a3 strh r3, [r4, #52] ; 0x34
  11252. /* Reduce congestion window and ssthresh. */
  11253. eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
  11254. 800bb66: f8b4 3060 ldrh.w r3, [r4, #96] ; 0x60
  11255. pcb->ssthresh = eff_wnd >> 1;
  11256. 800bb6a: 4299 cmp r1, r3
  11257. 800bb6c: bf28 it cs
  11258. 800bb6e: 4619 movcs r1, r3
  11259. if (pcb->ssthresh < (pcb->mss << 1)) {
  11260. 800bb70: 8ee3 ldrh r3, [r4, #54] ; 0x36
  11261. /* Reset the retransmission timer. */
  11262. pcb->rtime = 0;
  11263. /* Reduce congestion window and ssthresh. */
  11264. eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
  11265. pcb->ssthresh = eff_wnd >> 1;
  11266. 800bb72: 0849 lsrs r1, r1, #1
  11267. if (pcb->ssthresh < (pcb->mss << 1)) {
  11268. 800bb74: 005a lsls r2, r3, #1
  11269. 800bb76: 4291 cmp r1, r2
  11270. /* Reset the retransmission timer. */
  11271. pcb->rtime = 0;
  11272. /* Reduce congestion window and ssthresh. */
  11273. eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
  11274. pcb->ssthresh = eff_wnd >> 1;
  11275. 800bb78: f8a4 104e strh.w r1, [r4, #78] ; 0x4e
  11276. if (pcb->ssthresh < (pcb->mss << 1)) {
  11277. pcb->ssthresh = (pcb->mss << 1);
  11278. }
  11279. pcb->cwnd = pcb->mss;
  11280. 800bb7c: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
  11281. /* Reduce congestion window and ssthresh. */
  11282. eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
  11283. pcb->ssthresh = eff_wnd >> 1;
  11284. if (pcb->ssthresh < (pcb->mss << 1)) {
  11285. pcb->ssthresh = (pcb->mss << 1);
  11286. 800bb80: bfb8 it lt
  11287. 800bb82: f8a4 204e strhlt.w r2, [r4, #78] ; 0x4e
  11288. " ssthresh %"U16_F"\n",
  11289. pcb->cwnd, pcb->ssthresh));
  11290. /* The following needs to be called AFTER cwnd is set to one
  11291. mss - STJ */
  11292. tcp_rexmit_rto(pcb);
  11293. 800bb86: 4620 mov r0, r4
  11294. 800bb88: f001 fedc bl 800d944 <tcp_rexmit_rto>
  11295. pcb = pcb->next;
  11296. continue;
  11297. }
  11298. pcb->last_timer = tcp_timer_ctr;
  11299. pcb_remove = 0;
  11300. 800bb8c: 2500 movs r5, #0
  11301. 800bb8e: e000 b.n 800bb92 <tcp_slowtmr+0xee>
  11302. pcb_reset = 0;
  11303. if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
  11304. ++pcb_remove;
  11305. 800bb90: 2501 movs r5, #1
  11306. tcp_rexmit_rto(pcb);
  11307. }
  11308. }
  11309. }
  11310. /* Check if this PCB has stayed too long in FIN-WAIT-2 */
  11311. if (pcb->state == FIN_WAIT_2) {
  11312. 800bb92: 7e23 ldrb r3, [r4, #24]
  11313. 800bb94: 2b06 cmp r3, #6
  11314. 800bb96: d10c bne.n 800bbb2 <tcp_slowtmr+0x10e>
  11315. /* If this PCB is in FIN_WAIT_2 because of SHUT_WR don't let it time out. */
  11316. if (pcb->flags & TF_RXCLOSED) {
  11317. 800bb98: 7fa2 ldrb r2, [r4, #30]
  11318. 800bb9a: f002 0210 and.w r2, r2, #16
  11319. 800bb9e: b2d2 uxtb r2, r2
  11320. 800bba0: b13a cbz r2, 800bbb2 <tcp_slowtmr+0x10e>
  11321. /* PCB was fully closed (either through close() or SHUT_RDWR):
  11322. normal FIN-WAIT timeout handling. */
  11323. if ((u32_t)(tcp_ticks - pcb->tmr) >
  11324. 800bba2: 4a5d ldr r2, [pc, #372] ; (800bd18 <tcp_slowtmr+0x274>)
  11325. 800bba4: 6811 ldr r1, [r2, #0]
  11326. 800bba6: 6a62 ldr r2, [r4, #36] ; 0x24
  11327. 800bba8: 1a8a subs r2, r1, r2
  11328. 800bbaa: 2a28 cmp r2, #40 ; 0x28
  11329. 800bbac: d901 bls.n 800bbb2 <tcp_slowtmr+0x10e>
  11330. TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) {
  11331. ++pcb_remove;
  11332. 800bbae: 3501 adds r5, #1
  11333. 800bbb0: b2ed uxtb r5, r5
  11334. }
  11335. }
  11336. }
  11337. /* Check if KEEPALIVE should be sent */
  11338. if(ip_get_option(pcb, SOF_KEEPALIVE) &&
  11339. 800bbb2: 7a27 ldrb r7, [r4, #8]
  11340. 800bbb4: f007 0708 and.w r7, r7, #8
  11341. 800bbb8: b2ff uxtb r7, r7
  11342. 800bbba: b34f cbz r7, 800bc10 <tcp_slowtmr+0x16c>
  11343. 800bbbc: 2b04 cmp r3, #4
  11344. 800bbbe: d001 beq.n 800bbc4 <tcp_slowtmr+0x120>
  11345. ((pcb->state == ESTABLISHED) ||
  11346. 800bbc0: 2b07 cmp r3, #7
  11347. 800bbc2: d124 bne.n 800bc0e <tcp_slowtmr+0x16a>
  11348. (pcb->state == CLOSE_WAIT))) {
  11349. if((u32_t)(tcp_ticks - pcb->tmr) >
  11350. 800bbc4: 4b54 ldr r3, [pc, #336] ; (800bd18 <tcp_slowtmr+0x274>)
  11351. (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL)
  11352. 800bbc6: f8d4 008c ldr.w r0, [r4, #140] ; 0x8c
  11353. /* Check if KEEPALIVE should be sent */
  11354. if(ip_get_option(pcb, SOF_KEEPALIVE) &&
  11355. ((pcb->state == ESTABLISHED) ||
  11356. (pcb->state == CLOSE_WAIT))) {
  11357. if((u32_t)(tcp_ticks - pcb->tmr) >
  11358. 800bbca: 681a ldr r2, [r3, #0]
  11359. 800bbcc: 6a63 ldr r3, [r4, #36] ; 0x24
  11360. 800bbce: 1ad2 subs r2, r2, r3
  11361. (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL)
  11362. 800bbd0: f500 2324 add.w r3, r0, #671744 ; 0xa4000
  11363. 800bbd4: f603 43b8 addw r3, r3, #3256 ; 0xcb8
  11364. 800bbd8: f44f 71fa mov.w r1, #500 ; 0x1f4
  11365. 800bbdc: fbb3 f3f1 udiv r3, r3, r1
  11366. /* Check if KEEPALIVE should be sent */
  11367. if(ip_get_option(pcb, SOF_KEEPALIVE) &&
  11368. ((pcb->state == ESTABLISHED) ||
  11369. (pcb->state == CLOSE_WAIT))) {
  11370. if((u32_t)(tcp_ticks - pcb->tmr) >
  11371. 800bbe0: 429a cmp r2, r3
  11372. 800bbe2: d903 bls.n 800bbec <tcp_slowtmr+0x148>
  11373. {
  11374. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to %"U16_F".%"U16_F".%"U16_F".%"U16_F".\n",
  11375. ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip),
  11376. ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip)));
  11377. ++pcb_remove;
  11378. 800bbe4: 3501 adds r5, #1
  11379. 800bbe6: b2ed uxtb r5, r5
  11380. ++pcb_reset;
  11381. 800bbe8: 2701 movs r7, #1
  11382. 800bbea: e011 b.n 800bc10 <tcp_slowtmr+0x16c>
  11383. }
  11384. else if((u32_t)(tcp_ticks - pcb->tmr) >
  11385. (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb))
  11386. 800bbec: f894 3092 ldrb.w r3, [r4, #146] ; 0x92
  11387. 800bbf0: 4f4e ldr r7, [pc, #312] ; (800bd2c <tcp_slowtmr+0x288>)
  11388. 800bbf2: fb07 0003 mla r0, r7, r3, r0
  11389. / TCP_SLOW_INTERVAL)
  11390. 800bbf6: fbb0 f1f1 udiv r1, r0, r1
  11391. ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip)));
  11392. ++pcb_remove;
  11393. ++pcb_reset;
  11394. }
  11395. else if((u32_t)(tcp_ticks - pcb->tmr) >
  11396. 800bbfa: 428a cmp r2, r1
  11397. 800bbfc: d907 bls.n 800bc0e <tcp_slowtmr+0x16a>
  11398. (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb))
  11399. / TCP_SLOW_INTERVAL)
  11400. {
  11401. tcp_keepalive(pcb);
  11402. 800bbfe: 4620 mov r0, r4
  11403. 800bc00: f001 ff0e bl 800da20 <tcp_keepalive>
  11404. pcb->keep_cnt_sent++;
  11405. 800bc04: f894 3092 ldrb.w r3, [r4, #146] ; 0x92
  11406. 800bc08: 3301 adds r3, #1
  11407. 800bc0a: f884 3092 strb.w r3, [r4, #146] ; 0x92
  11408. continue;
  11409. }
  11410. pcb->last_timer = tcp_timer_ctr;
  11411. pcb_remove = 0;
  11412. pcb_reset = 0;
  11413. 800bc0e: 2700 movs r7, #0
  11414. LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: dropping OOSEQ queued data\n"));
  11415. }
  11416. #endif /* TCP_QUEUE_OOSEQ */
  11417. /* Check if this PCB has stayed too long in SYN-RCVD */
  11418. if (pcb->state == SYN_RCVD) {
  11419. 800bc10: 7e23 ldrb r3, [r4, #24]
  11420. 800bc12: 2b03 cmp r3, #3
  11421. 800bc14: d108 bne.n 800bc28 <tcp_slowtmr+0x184>
  11422. if ((u32_t)(tcp_ticks - pcb->tmr) >
  11423. 800bc16: 4b40 ldr r3, [pc, #256] ; (800bd18 <tcp_slowtmr+0x274>)
  11424. 800bc18: 681a ldr r2, [r3, #0]
  11425. 800bc1a: 6a63 ldr r3, [r4, #36] ; 0x24
  11426. 800bc1c: 1ad3 subs r3, r2, r3
  11427. 800bc1e: 2b28 cmp r3, #40 ; 0x28
  11428. 800bc20: d90a bls.n 800bc38 <tcp_slowtmr+0x194>
  11429. TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) {
  11430. ++pcb_remove;
  11431. 800bc22: 3501 adds r5, #1
  11432. 800bc24: b2ed uxtb r5, r5
  11433. 800bc26: e007 b.n 800bc38 <tcp_slowtmr+0x194>
  11434. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in SYN-RCVD\n"));
  11435. }
  11436. }
  11437. /* Check if this PCB has stayed too long in LAST-ACK */
  11438. if (pcb->state == LAST_ACK) {
  11439. 800bc28: 2b09 cmp r3, #9
  11440. 800bc2a: d105 bne.n 800bc38 <tcp_slowtmr+0x194>
  11441. if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
  11442. 800bc2c: 4b3a ldr r3, [pc, #232] ; (800bd18 <tcp_slowtmr+0x274>)
  11443. 800bc2e: 681a ldr r2, [r3, #0]
  11444. 800bc30: 6a63 ldr r3, [r4, #36] ; 0x24
  11445. 800bc32: 1ad3 subs r3, r2, r3
  11446. 800bc34: 2bf0 cmp r3, #240 ; 0xf0
  11447. 800bc36: d800 bhi.n 800bc3a <tcp_slowtmr+0x196>
  11448. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in LAST-ACK\n"));
  11449. }
  11450. }
  11451. /* If the PCB should be removed, do it. */
  11452. if (pcb_remove) {
  11453. 800bc38: b345 cbz r5, 800bc8c <tcp_slowtmr+0x1e8>
  11454. struct tcp_pcb *pcb2;
  11455. tcp_err_fn err_fn;
  11456. void *err_arg;
  11457. tcp_pcb_purge(pcb);
  11458. 800bc3a: 4620 mov r0, r4
  11459. 800bc3c: f7ff ff14 bl 800ba68 <tcp_pcb_purge>
  11460. 800bc40: 68e3 ldr r3, [r4, #12]
  11461. /* Remove PCB from tcp_active_pcbs list. */
  11462. if (prev != NULL) {
  11463. 800bc42: b10e cbz r6, 800bc48 <tcp_slowtmr+0x1a4>
  11464. LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_active_pcbs", pcb != tcp_active_pcbs);
  11465. prev->next = pcb->next;
  11466. 800bc44: 60f3 str r3, [r6, #12]
  11467. 800bc46: e001 b.n 800bc4c <tcp_slowtmr+0x1a8>
  11468. } else {
  11469. /* This PCB was the first. */
  11470. LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_active_pcbs", tcp_active_pcbs == pcb);
  11471. tcp_active_pcbs = pcb->next;
  11472. 800bc48: 4a35 ldr r2, [pc, #212] ; (800bd20 <tcp_slowtmr+0x27c>)
  11473. 800bc4a: 6013 str r3, [r2, #0]
  11474. }
  11475. if (pcb_reset) {
  11476. 800bc4c: b14f cbz r7, 800bc62 <tcp_slowtmr+0x1be>
  11477. tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
  11478. 800bc4e: 8b63 ldrh r3, [r4, #26]
  11479. 800bc50: 9300 str r3, [sp, #0]
  11480. 800bc52: 8ba3 ldrh r3, [r4, #28]
  11481. 800bc54: 9301 str r3, [sp, #4]
  11482. 800bc56: 6d20 ldr r0, [r4, #80] ; 0x50
  11483. 800bc58: 6aa1 ldr r1, [r4, #40] ; 0x28
  11484. 800bc5a: 4622 mov r2, r4
  11485. 800bc5c: 1d23 adds r3, r4, #4
  11486. 800bc5e: f001 fe25 bl 800d8ac <tcp_rst>
  11487. pcb->local_port, pcb->remote_port);
  11488. }
  11489. err_fn = pcb->errf;
  11490. 800bc62: f8d4 5088 ldr.w r5, [r4, #136] ; 0x88
  11491. err_arg = pcb->callback_arg;
  11492. 800bc66: f8d4 b010 ldr.w fp, [r4, #16]
  11493. pcb2 = pcb;
  11494. pcb = pcb->next;
  11495. 800bc6a: 68e7 ldr r7, [r4, #12]
  11496. memp_free(MEMP_TCP_PCB, pcb2);
  11497. 800bc6c: 2002 movs r0, #2
  11498. 800bc6e: 4621 mov r1, r4
  11499. 800bc70: f7ff fb30 bl 800b2d4 <memp_free>
  11500. tcp_active_pcbs_changed = 0;
  11501. 800bc74: 2300 movs r3, #0
  11502. 800bc76: f888 3000 strb.w r3, [r8]
  11503. TCP_EVENT_ERR(err_fn, err_arg, ERR_ABRT);
  11504. 800bc7a: b11d cbz r5, 800bc84 <tcp_slowtmr+0x1e0>
  11505. 800bc7c: 4658 mov r0, fp
  11506. 800bc7e: f06f 0109 mvn.w r1, #9
  11507. 800bc82: 47a8 blx r5
  11508. if (tcp_active_pcbs_changed) {
  11509. 800bc84: f899 3000 ldrb.w r3, [r9]
  11510. 800bc88: b1f3 cbz r3, 800bcc8 <tcp_slowtmr+0x224>
  11511. 800bc8a: e718 b.n 800babe <tcp_slowtmr+0x1a>
  11512. /* get the 'next' element now and work with 'prev' below (in case of abort) */
  11513. prev = pcb;
  11514. pcb = pcb->next;
  11515. /* We check if we should poll the connection. */
  11516. ++prev->polltmr;
  11517. 800bc8c: 7fe3 ldrb r3, [r4, #31]
  11518. if (prev->polltmr >= prev->pollinterval) {
  11519. 800bc8e: f894 2020 ldrb.w r2, [r4, #32]
  11520. goto tcp_slowtmr_start;
  11521. }
  11522. } else {
  11523. /* get the 'next' element now and work with 'prev' below (in case of abort) */
  11524. prev = pcb;
  11525. pcb = pcb->next;
  11526. 800bc92: 68e7 ldr r7, [r4, #12]
  11527. /* We check if we should poll the connection. */
  11528. ++prev->polltmr;
  11529. 800bc94: 3301 adds r3, #1
  11530. 800bc96: b2db uxtb r3, r3
  11531. if (prev->polltmr >= prev->pollinterval) {
  11532. 800bc98: 429a cmp r2, r3
  11533. /* get the 'next' element now and work with 'prev' below (in case of abort) */
  11534. prev = pcb;
  11535. pcb = pcb->next;
  11536. /* We check if we should poll the connection. */
  11537. ++prev->polltmr;
  11538. 800bc9a: 77e3 strb r3, [r4, #31]
  11539. if (prev->polltmr >= prev->pollinterval) {
  11540. 800bc9c: d813 bhi.n 800bcc6 <tcp_slowtmr+0x222>
  11541. prev->polltmr = 0;
  11542. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n"));
  11543. tcp_active_pcbs_changed = 0;
  11544. TCP_EVENT_POLL(prev, err);
  11545. 800bc9e: f8d4 3084 ldr.w r3, [r4, #132] ; 0x84
  11546. pcb = pcb->next;
  11547. /* We check if we should poll the connection. */
  11548. ++prev->polltmr;
  11549. if (prev->polltmr >= prev->pollinterval) {
  11550. prev->polltmr = 0;
  11551. 800bca2: 77e5 strb r5, [r4, #31]
  11552. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n"));
  11553. tcp_active_pcbs_changed = 0;
  11554. 800bca4: f888 5000 strb.w r5, [r8]
  11555. TCP_EVENT_POLL(prev, err);
  11556. 800bca8: b11b cbz r3, 800bcb2 <tcp_slowtmr+0x20e>
  11557. 800bcaa: 6920 ldr r0, [r4, #16]
  11558. 800bcac: 4621 mov r1, r4
  11559. 800bcae: 4798 blx r3
  11560. 800bcb0: e000 b.n 800bcb4 <tcp_slowtmr+0x210>
  11561. 800bcb2: 4628 mov r0, r5
  11562. if (tcp_active_pcbs_changed) {
  11563. 800bcb4: f899 3000 ldrb.w r3, [r9]
  11564. 800bcb8: 2b00 cmp r3, #0
  11565. 800bcba: f47f af00 bne.w 800babe <tcp_slowtmr+0x1a>
  11566. goto tcp_slowtmr_start;
  11567. }
  11568. /* if err == ERR_ABRT, 'prev' is already deallocated */
  11569. if (err == ERR_OK) {
  11570. 800bcbe: b910 cbnz r0, 800bcc6 <tcp_slowtmr+0x222>
  11571. tcp_output(prev);
  11572. 800bcc0: 4620 mov r0, r4
  11573. 800bcc2: f001 fcb7 bl 800d634 <tcp_output>
  11574. TCP_EVENT_POLL(prev, err);
  11575. if (tcp_active_pcbs_changed) {
  11576. goto tcp_slowtmr_start;
  11577. }
  11578. /* if err == ERR_ABRT, 'prev' is already deallocated */
  11579. if (err == ERR_OK) {
  11580. 800bcc6: 4626 mov r6, r4
  11581. prev = pcb;
  11582. pcb = pcb->next;
  11583. /* We check if we should poll the connection. */
  11584. ++prev->polltmr;
  11585. if (prev->polltmr >= prev->pollinterval) {
  11586. 800bcc8: 463c mov r4, r7
  11587. prev = NULL;
  11588. pcb = tcp_active_pcbs;
  11589. if (pcb == NULL) {
  11590. LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
  11591. }
  11592. while (pcb != NULL) {
  11593. 800bcca: 2c00 cmp r4, #0
  11594. 800bccc: f47f aefd bne.w 800baca <tcp_slowtmr+0x26>
  11595. }
  11596. /* Steps through all of the TIME-WAIT PCBs. */
  11597. prev = NULL;
  11598. pcb = tcp_tw_pcbs;
  11599. 800bcd0: 4b17 ldr r3, [pc, #92] ; (800bd30 <tcp_slowtmr+0x28c>)
  11600. while (pcb != NULL) {
  11601. LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  11602. pcb_remove = 0;
  11603. /* Check if this PCB has stayed long enough in TIME-WAIT */
  11604. if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
  11605. 800bcd2: 4e11 ldr r6, [pc, #68] ; (800bd18 <tcp_slowtmr+0x274>)
  11606. }
  11607. /* Steps through all of the TIME-WAIT PCBs. */
  11608. prev = NULL;
  11609. pcb = tcp_tw_pcbs;
  11610. 800bcd4: 681d ldr r5, [r3, #0]
  11611. LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs);
  11612. prev->next = pcb->next;
  11613. } else {
  11614. /* This PCB was the first. */
  11615. LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
  11616. tcp_tw_pcbs = pcb->next;
  11617. 800bcd6: 461f mov r7, r3
  11618. /* Steps through all of the TIME-WAIT PCBs. */
  11619. prev = NULL;
  11620. pcb = tcp_tw_pcbs;
  11621. while (pcb != NULL) {
  11622. 800bcd8: e00f b.n 800bcfa <tcp_slowtmr+0x256>
  11623. LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  11624. pcb_remove = 0;
  11625. /* Check if this PCB has stayed long enough in TIME-WAIT */
  11626. if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
  11627. 800bcda: 6832 ldr r2, [r6, #0]
  11628. 800bcdc: 6a6b ldr r3, [r5, #36] ; 0x24
  11629. 800bcde: 1ad3 subs r3, r2, r3
  11630. 800bce0: 2bf0 cmp r3, #240 ; 0xf0
  11631. 800bce2: d810 bhi.n 800bd06 <tcp_slowtmr+0x262>
  11632. 800bce4: e00c b.n 800bd00 <tcp_slowtmr+0x25c>
  11633. struct tcp_pcb *pcb2;
  11634. tcp_pcb_purge(pcb);
  11635. /* Remove PCB from tcp_tw_pcbs list. */
  11636. if (prev != NULL) {
  11637. LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs);
  11638. prev->next = pcb->next;
  11639. 800bce6: 60e2 str r2, [r4, #12]
  11640. 800bce8: e000 b.n 800bcec <tcp_slowtmr+0x248>
  11641. } else {
  11642. /* This PCB was the first. */
  11643. LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
  11644. tcp_tw_pcbs = pcb->next;
  11645. 800bcea: 603a str r2, [r7, #0]
  11646. }
  11647. pcb2 = pcb;
  11648. pcb = pcb->next;
  11649. memp_free(MEMP_TCP_PCB, pcb2);
  11650. 800bcec: 4629 mov r1, r5
  11651. 800bcee: 2002 movs r0, #2
  11652. /* This PCB was the first. */
  11653. LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
  11654. tcp_tw_pcbs = pcb->next;
  11655. }
  11656. pcb2 = pcb;
  11657. pcb = pcb->next;
  11658. 800bcf0: f8d5 800c ldr.w r8, [r5, #12]
  11659. memp_free(MEMP_TCP_PCB, pcb2);
  11660. 800bcf4: f7ff faee bl 800b2d4 <memp_free>
  11661. /* This PCB was the first. */
  11662. LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
  11663. tcp_tw_pcbs = pcb->next;
  11664. }
  11665. pcb2 = pcb;
  11666. pcb = pcb->next;
  11667. 800bcf8: 4645 mov r5, r8
  11668. /* Steps through all of the TIME-WAIT PCBs. */
  11669. prev = NULL;
  11670. pcb = tcp_tw_pcbs;
  11671. while (pcb != NULL) {
  11672. 800bcfa: 2d00 cmp r5, #0
  11673. 800bcfc: d1ed bne.n 800bcda <tcp_slowtmr+0x236>
  11674. 800bcfe: e009 b.n 800bd14 <tcp_slowtmr+0x270>
  11675. pcb2 = pcb;
  11676. pcb = pcb->next;
  11677. memp_free(MEMP_TCP_PCB, pcb2);
  11678. } else {
  11679. prev = pcb;
  11680. pcb = pcb->next;
  11681. 800bd00: 462c mov r4, r5
  11682. 800bd02: 68ed ldr r5, [r5, #12]
  11683. 800bd04: e7f9 b.n 800bcfa <tcp_slowtmr+0x256>
  11684. /* If the PCB should be removed, do it. */
  11685. if (pcb_remove) {
  11686. struct tcp_pcb *pcb2;
  11687. tcp_pcb_purge(pcb);
  11688. 800bd06: 4628 mov r0, r5
  11689. 800bd08: f7ff feae bl 800ba68 <tcp_pcb_purge>
  11690. 800bd0c: 68ea ldr r2, [r5, #12]
  11691. /* Remove PCB from tcp_tw_pcbs list. */
  11692. if (prev != NULL) {
  11693. 800bd0e: 2c00 cmp r4, #0
  11694. 800bd10: d1e9 bne.n 800bce6 <tcp_slowtmr+0x242>
  11695. 800bd12: e7ea b.n 800bcea <tcp_slowtmr+0x246>
  11696. } else {
  11697. prev = pcb;
  11698. pcb = pcb->next;
  11699. }
  11700. }
  11701. }
  11702. 800bd14: e8bd 8ffe ldmia.w sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
  11703. 800bd18: 20008340 .word 0x20008340
  11704. 800bd1c: 20006b7d .word 0x20006b7d
  11705. 800bd20: 2000833c .word 0x2000833c
  11706. 800bd24: 08011875 .word 0x08011875
  11707. 800bd28: 08011868 .word 0x08011868
  11708. 800bd2c: 000124f8 .word 0x000124f8
  11709. 800bd30: 20008350 .word 0x20008350
  11710. 800bd34: 20008338 .word 0x20008338
  11711. 0800bd38 <tcp_next_iss>:
  11712. u32_t
  11713. tcp_next_iss(void)
  11714. {
  11715. static u32_t iss = 6510;
  11716. iss += tcp_ticks; /* XXX */
  11717. 800bd38: 4b03 ldr r3, [pc, #12] ; (800bd48 <tcp_next_iss+0x10>)
  11718. 800bd3a: 4a04 ldr r2, [pc, #16] ; (800bd4c <tcp_next_iss+0x14>)
  11719. 800bd3c: 6810 ldr r0, [r2, #0]
  11720. 800bd3e: 681a ldr r2, [r3, #0]
  11721. 800bd40: 1880 adds r0, r0, r2
  11722. 800bd42: 6018 str r0, [r3, #0]
  11723. return iss;
  11724. }
  11725. 800bd44: 4770 bx lr
  11726. 800bd46: bf00 nop
  11727. 800bd48: 2000010c .word 0x2000010c
  11728. 800bd4c: 20008340 .word 0x20008340
  11729. 0800bd50 <tcp_eff_send_mss>:
  11730. * by using ip_route to determin the netif used to send to the address and
  11731. * calculating the minimum of TCP_MSS and that netif's mtu (if set).
  11732. */
  11733. u16_t
  11734. tcp_eff_send_mss(u16_t sendmss, ip_addr_t *addr)
  11735. {
  11736. 800bd50: b510 push {r4, lr}
  11737. 800bd52: 4604 mov r4, r0
  11738. u16_t mss_s;
  11739. struct netif *outif;
  11740. outif = ip_route(addr);
  11741. 800bd54: 4608 mov r0, r1
  11742. 800bd56: f002 fbb5 bl 800e4c4 <ip_route>
  11743. if ((outif != NULL) && (outif->mtu != 0)) {
  11744. 800bd5a: b130 cbz r0, 800bd6a <tcp_eff_send_mss+0x1a>
  11745. 800bd5c: 8c83 ldrh r3, [r0, #36] ; 0x24
  11746. 800bd5e: b123 cbz r3, 800bd6a <tcp_eff_send_mss+0x1a>
  11747. mss_s = outif->mtu - IP_HLEN - TCP_HLEN;
  11748. 800bd60: 3b28 subs r3, #40 ; 0x28
  11749. /* RFC 1122, chap 4.2.2.6:
  11750. * Eff.snd.MSS = min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize
  11751. * We correct for TCP options in tcp_write(), and don't support IP options.
  11752. */
  11753. sendmss = LWIP_MIN(sendmss, mss_s);
  11754. 800bd62: b29b uxth r3, r3
  11755. 800bd64: 429c cmp r4, r3
  11756. 800bd66: bf28 it cs
  11757. 800bd68: 461c movcs r4, r3
  11758. }
  11759. return sendmss;
  11760. }
  11761. 800bd6a: 4620 mov r0, r4
  11762. 800bd6c: bd10 pop {r4, pc}
  11763. 800bd6e: 0000 movs r0, r0
  11764. 0800bd70 <tcp_pcbs_sane>:
  11765. */
  11766. s16_t
  11767. tcp_pcbs_sane(void)
  11768. {
  11769. struct tcp_pcb *pcb;
  11770. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  11771. 800bd70: 4b06 ldr r3, [pc, #24] ; (800bd8c <tcp_pcbs_sane+0x1c>)
  11772. 800bd72: 681b ldr r3, [r3, #0]
  11773. 800bd74: e000 b.n 800bd78 <tcp_pcbs_sane+0x8>
  11774. 800bd76: 68db ldr r3, [r3, #12]
  11775. 800bd78: 2b00 cmp r3, #0
  11776. 800bd7a: d1fc bne.n 800bd76 <tcp_pcbs_sane+0x6>
  11777. LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != CLOSED", pcb->state != CLOSED);
  11778. LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != LISTEN", pcb->state != LISTEN);
  11779. LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  11780. }
  11781. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  11782. 800bd7c: 4b04 ldr r3, [pc, #16] ; (800bd90 <tcp_pcbs_sane+0x20>)
  11783. 800bd7e: 681b ldr r3, [r3, #0]
  11784. 800bd80: e000 b.n 800bd84 <tcp_pcbs_sane+0x14>
  11785. 800bd82: 68db ldr r3, [r3, #12]
  11786. 800bd84: 2b00 cmp r3, #0
  11787. 800bd86: d1fc bne.n 800bd82 <tcp_pcbs_sane+0x12>
  11788. LWIP_ASSERT("tcp_pcbs_sane: tw pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  11789. }
  11790. return 1;
  11791. }
  11792. 800bd88: 2001 movs r0, #1
  11793. 800bd8a: 4770 bx lr
  11794. 800bd8c: 2000833c .word 0x2000833c
  11795. 800bd90: 20008350 .word 0x20008350
  11796. 0800bd94 <tcp_pcb_remove>:
  11797. * @param pcb tcp_pcb to purge. The pcb itself is NOT deallocated!
  11798. */
  11799. void
  11800. tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
  11801. {
  11802. TCP_RMV(pcblist, pcb);
  11803. 800bd94: 6803 ldr r3, [r0, #0]
  11804. 800bd96: 428b cmp r3, r1
  11805. * @param pcblist PCB list to purge.
  11806. * @param pcb tcp_pcb to purge. The pcb itself is NOT deallocated!
  11807. */
  11808. void
  11809. tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
  11810. {
  11811. 800bd98: b510 push {r4, lr}
  11812. 800bd9a: 460c mov r4, r1
  11813. TCP_RMV(pcblist, pcb);
  11814. 800bd9c: d102 bne.n 800bda4 <tcp_pcb_remove+0x10>
  11815. 800bd9e: 68cb ldr r3, [r1, #12]
  11816. 800bda0: 6003 str r3, [r0, #0]
  11817. 800bda2: e00d b.n 800bdc0 <tcp_pcb_remove+0x2c>
  11818. 800bda4: 4a13 ldr r2, [pc, #76] ; (800bdf4 <tcp_pcb_remove+0x60>)
  11819. 800bda6: 6013 str r3, [r2, #0]
  11820. 800bda8: e007 b.n 800bdba <tcp_pcb_remove+0x26>
  11821. 800bdaa: 68d9 ldr r1, [r3, #12]
  11822. 800bdac: 42a1 cmp r1, r4
  11823. 800bdae: d103 bne.n 800bdb8 <tcp_pcb_remove+0x24>
  11824. 800bdb0: 6013 str r3, [r2, #0]
  11825. 800bdb2: 68e2 ldr r2, [r4, #12]
  11826. 800bdb4: 60da str r2, [r3, #12]
  11827. 800bdb6: e003 b.n 800bdc0 <tcp_pcb_remove+0x2c>
  11828. 800bdb8: 460b mov r3, r1
  11829. 800bdba: 2b00 cmp r3, #0
  11830. 800bdbc: d1f5 bne.n 800bdaa <tcp_pcb_remove+0x16>
  11831. 800bdbe: 6013 str r3, [r2, #0]
  11832. 800bdc0: 2300 movs r3, #0
  11833. 800bdc2: 60e3 str r3, [r4, #12]
  11834. tcp_pcb_purge(pcb);
  11835. 800bdc4: 4620 mov r0, r4
  11836. 800bdc6: f7ff fe4f bl 800ba68 <tcp_pcb_purge>
  11837. /* if there is an outstanding delayed ACKs, send it */
  11838. if (pcb->state != TIME_WAIT &&
  11839. 800bdca: 7e23 ldrb r3, [r4, #24]
  11840. 800bdcc: 2b0a cmp r3, #10
  11841. 800bdce: d00a beq.n 800bde6 <tcp_pcb_remove+0x52>
  11842. 800bdd0: 2b01 cmp r3, #1
  11843. 800bdd2: d008 beq.n 800bde6 <tcp_pcb_remove+0x52>
  11844. pcb->state != LISTEN &&
  11845. pcb->flags & TF_ACK_DELAY) {
  11846. 800bdd4: 7fa3 ldrb r3, [r4, #30]
  11847. tcp_pcb_purge(pcb);
  11848. /* if there is an outstanding delayed ACKs, send it */
  11849. if (pcb->state != TIME_WAIT &&
  11850. pcb->state != LISTEN &&
  11851. 800bdd6: 07da lsls r2, r3, #31
  11852. 800bdd8: d505 bpl.n 800bde6 <tcp_pcb_remove+0x52>
  11853. pcb->flags & TF_ACK_DELAY) {
  11854. pcb->flags |= TF_ACK_NOW;
  11855. 800bdda: f043 0302 orr.w r3, r3, #2
  11856. 800bdde: 77a3 strb r3, [r4, #30]
  11857. tcp_output(pcb);
  11858. 800bde0: 4620 mov r0, r4
  11859. 800bde2: f001 fc27 bl 800d634 <tcp_output>
  11860. #if TCP_QUEUE_OOSEQ
  11861. LWIP_ASSERT("ooseq segments leaking", pcb->ooseq == NULL);
  11862. #endif /* TCP_QUEUE_OOSEQ */
  11863. }
  11864. pcb->state = CLOSED;
  11865. 800bde6: 2300 movs r3, #0
  11866. 800bde8: 7623 strb r3, [r4, #24]
  11867. LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane());
  11868. }
  11869. 800bdea: e8bd 4010 ldmia.w sp!, {r4, lr}
  11870. #endif /* TCP_QUEUE_OOSEQ */
  11871. }
  11872. pcb->state = CLOSED;
  11873. LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane());
  11874. 800bdee: f7ff bfbf b.w 800bd70 <tcp_pcbs_sane>
  11875. 800bdf2: bf00 nop
  11876. 800bdf4: 20008348 .word 0x20008348
  11877. 0800bdf8 <tcp_abandon>:
  11878. LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs",
  11879. pcb->state != LISTEN);
  11880. /* Figure out on which TCP PCB list we are, and remove us. If we
  11881. are in an active state, call the receive function associated with
  11882. the PCB with a NULL argument, and send an RST to the remote end. */
  11883. if (pcb->state == TIME_WAIT) {
  11884. 800bdf8: 7e03 ldrb r3, [r0, #24]
  11885. 800bdfa: 2b0a cmp r3, #10
  11886. * @param pcb the tcp_pcb to abort
  11887. * @param reset boolean to indicate whether a reset should be sent
  11888. */
  11889. void
  11890. tcp_abandon(struct tcp_pcb *pcb, int reset)
  11891. {
  11892. 800bdfc: e92d 43f7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, lr}
  11893. 800be00: 4604 mov r4, r0
  11894. 800be02: 4689 mov r9, r1
  11895. LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs",
  11896. pcb->state != LISTEN);
  11897. /* Figure out on which TCP PCB list we are, and remove us. If we
  11898. are in an active state, call the receive function associated with
  11899. the PCB with a NULL argument, and send an RST to the remote end. */
  11900. if (pcb->state == TIME_WAIT) {
  11901. 800be04: d10a bne.n 800be1c <tcp_abandon+0x24>
  11902. tcp_pcb_remove(&tcp_tw_pcbs, pcb);
  11903. 800be06: 4621 mov r1, r4
  11904. 800be08: 481b ldr r0, [pc, #108] ; (800be78 <tcp_abandon+0x80>)
  11905. 800be0a: f7ff ffc3 bl 800bd94 <tcp_pcb_remove>
  11906. memp_free(MEMP_TCP_PCB, pcb);
  11907. 800be0e: 2002 movs r0, #2
  11908. 800be10: 4621 mov r1, r4
  11909. tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port);
  11910. }
  11911. memp_free(MEMP_TCP_PCB, pcb);
  11912. TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
  11913. }
  11914. }
  11915. 800be12: b003 add sp, #12
  11916. 800be14: e8bd 43f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, lr}
  11917. /* Figure out on which TCP PCB list we are, and remove us. If we
  11918. are in an active state, call the receive function associated with
  11919. the PCB with a NULL argument, and send an RST to the remote end. */
  11920. if (pcb->state == TIME_WAIT) {
  11921. tcp_pcb_remove(&tcp_tw_pcbs, pcb);
  11922. memp_free(MEMP_TCP_PCB, pcb);
  11923. 800be18: f7ff ba5c b.w 800b2d4 <memp_free>
  11924. } else {
  11925. seqno = pcb->snd_nxt;
  11926. 800be1c: f8d0 8050 ldr.w r8, [r0, #80] ; 0x50
  11927. ackno = pcb->rcv_nxt;
  11928. 800be20: 6a87 ldr r7, [r0, #40] ; 0x28
  11929. #if LWIP_CALLBACK_API
  11930. errf = pcb->errf;
  11931. 800be22: f8d0 5088 ldr.w r5, [r0, #136] ; 0x88
  11932. #endif /* LWIP_CALLBACK_API */
  11933. errf_arg = pcb->callback_arg;
  11934. 800be26: 6906 ldr r6, [r0, #16]
  11935. TCP_PCB_REMOVE_ACTIVE(pcb);
  11936. 800be28: 4814 ldr r0, [pc, #80] ; (800be7c <tcp_abandon+0x84>)
  11937. 800be2a: 4621 mov r1, r4
  11938. 800be2c: f7ff ffb2 bl 800bd94 <tcp_pcb_remove>
  11939. 800be30: 4b13 ldr r3, [pc, #76] ; (800be80 <tcp_abandon+0x88>)
  11940. if (pcb->unacked != NULL) {
  11941. 800be32: 6f20 ldr r0, [r4, #112] ; 0x70
  11942. ackno = pcb->rcv_nxt;
  11943. #if LWIP_CALLBACK_API
  11944. errf = pcb->errf;
  11945. #endif /* LWIP_CALLBACK_API */
  11946. errf_arg = pcb->callback_arg;
  11947. TCP_PCB_REMOVE_ACTIVE(pcb);
  11948. 800be34: 2201 movs r2, #1
  11949. 800be36: 701a strb r2, [r3, #0]
  11950. if (pcb->unacked != NULL) {
  11951. 800be38: b108 cbz r0, 800be3e <tcp_abandon+0x46>
  11952. tcp_segs_free(pcb->unacked);
  11953. 800be3a: f7ff fdfc bl 800ba36 <tcp_segs_free>
  11954. }
  11955. if (pcb->unsent != NULL) {
  11956. 800be3e: 6ee0 ldr r0, [r4, #108] ; 0x6c
  11957. 800be40: b108 cbz r0, 800be46 <tcp_abandon+0x4e>
  11958. tcp_segs_free(pcb->unsent);
  11959. 800be42: f7ff fdf8 bl 800ba36 <tcp_segs_free>
  11960. #if TCP_QUEUE_OOSEQ
  11961. if (pcb->ooseq != NULL) {
  11962. tcp_segs_free(pcb->ooseq);
  11963. }
  11964. #endif /* TCP_QUEUE_OOSEQ */
  11965. if (reset) {
  11966. 800be46: f1b9 0f00 cmp.w r9, #0
  11967. 800be4a: d009 beq.n 800be60 <tcp_abandon+0x68>
  11968. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n"));
  11969. tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port);
  11970. 800be4c: 8b63 ldrh r3, [r4, #26]
  11971. 800be4e: 9300 str r3, [sp, #0]
  11972. 800be50: 8ba3 ldrh r3, [r4, #28]
  11973. 800be52: 4640 mov r0, r8
  11974. 800be54: 9301 str r3, [sp, #4]
  11975. 800be56: 4639 mov r1, r7
  11976. 800be58: 4622 mov r2, r4
  11977. 800be5a: 1d23 adds r3, r4, #4
  11978. 800be5c: f001 fd26 bl 800d8ac <tcp_rst>
  11979. }
  11980. memp_free(MEMP_TCP_PCB, pcb);
  11981. 800be60: 2002 movs r0, #2
  11982. 800be62: 4621 mov r1, r4
  11983. 800be64: f7ff fa36 bl 800b2d4 <memp_free>
  11984. TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
  11985. 800be68: b11d cbz r5, 800be72 <tcp_abandon+0x7a>
  11986. 800be6a: 4630 mov r0, r6
  11987. 800be6c: f06f 0109 mvn.w r1, #9
  11988. 800be70: 47a8 blx r5
  11989. }
  11990. }
  11991. 800be72: b003 add sp, #12
  11992. 800be74: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
  11993. 800be78: 20008350 .word 0x20008350
  11994. 800be7c: 2000833c .word 0x2000833c
  11995. 800be80: 20008338 .word 0x20008338
  11996. 0800be84 <tcp_abort>:
  11997. * @param pcb the tcp pcb to abort
  11998. */
  11999. void
  12000. tcp_abort(struct tcp_pcb *pcb)
  12001. {
  12002. tcp_abandon(pcb, 1);
  12003. 800be84: 2101 movs r1, #1
  12004. 800be86: f7ff bfb7 b.w 800bdf8 <tcp_abandon>
  12005. 800be8a: 0000 movs r0, r0
  12006. 0800be8c <tcp_alloc>:
  12007. * @param prio priority for the new pcb
  12008. * @return a new tcp_pcb that initially is in state CLOSED
  12009. */
  12010. struct tcp_pcb *
  12011. tcp_alloc(u8_t prio)
  12012. {
  12013. 800be8c: b5f8 push {r3, r4, r5, r6, r7, lr}
  12014. 800be8e: 4605 mov r5, r0
  12015. struct tcp_pcb *pcb;
  12016. u32_t iss;
  12017. pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);
  12018. 800be90: 2002 movs r0, #2
  12019. 800be92: f7ff f9f5 bl 800b280 <memp_malloc>
  12020. if (pcb == NULL) {
  12021. 800be96: 4604 mov r4, r0
  12022. 800be98: 2800 cmp r0, #0
  12023. 800be9a: d142 bne.n 800bf22 <tcp_alloc+0x96>
  12024. u32_t inactivity;
  12025. inactivity = 0;
  12026. inactive = NULL;
  12027. /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
  12028. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  12029. 800be9c: 4b3f ldr r3, [pc, #252] ; (800bf9c <tcp_alloc+0x110>)
  12030. if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  12031. 800be9e: 4a40 ldr r2, [pc, #256] ; (800bfa0 <tcp_alloc+0x114>)
  12032. u32_t inactivity;
  12033. inactivity = 0;
  12034. inactive = NULL;
  12035. /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
  12036. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  12037. 800bea0: 681b ldr r3, [r3, #0]
  12038. if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  12039. 800bea2: 6811 ldr r1, [r2, #0]
  12040. 800bea4: e007 b.n 800beb6 <tcp_alloc+0x2a>
  12041. 800bea6: 6a5a ldr r2, [r3, #36] ; 0x24
  12042. 800bea8: 1a8a subs r2, r1, r2
  12043. 800beaa: 42a2 cmp r2, r4
  12044. 800beac: bf34 ite cc
  12045. 800beae: 4622 movcc r2, r4
  12046. 800beb0: 4618 movcs r0, r3
  12047. u32_t inactivity;
  12048. inactivity = 0;
  12049. inactive = NULL;
  12050. /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
  12051. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  12052. 800beb2: 68db ldr r3, [r3, #12]
  12053. 800beb4: 4614 mov r4, r2
  12054. 800beb6: 2b00 cmp r3, #0
  12055. 800beb8: d1f5 bne.n 800bea6 <tcp_alloc+0x1a>
  12056. if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  12057. inactivity = tcp_ticks - pcb->tmr;
  12058. inactive = pcb;
  12059. }
  12060. }
  12061. if (inactive != NULL) {
  12062. 800beba: b108 cbz r0, 800bec0 <tcp_alloc+0x34>
  12063. LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_timewait: killing oldest TIME-WAIT PCB %p (%"S32_F")\n",
  12064. (void *)inactive, inactivity));
  12065. tcp_abort(inactive);
  12066. 800bebc: f7ff ffe2 bl 800be84 <tcp_abort>
  12067. if (pcb == NULL) {
  12068. /* Try killing oldest connection in TIME-WAIT. */
  12069. LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest TIME-WAIT connection\n"));
  12070. tcp_kill_timewait();
  12071. /* Try to allocate a tcp_pcb again. */
  12072. pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);
  12073. 800bec0: 2002 movs r0, #2
  12074. 800bec2: f7ff f9dd bl 800b280 <memp_malloc>
  12075. if (pcb == NULL) {
  12076. 800bec6: 4604 mov r4, r0
  12077. 800bec8: bb28 cbnz r0, 800bf16 <tcp_alloc+0x8a>
  12078. inactivity = 0;
  12079. inactive = NULL;
  12080. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  12081. if (pcb->prio <= prio &&
  12082. pcb->prio <= mprio &&
  12083. (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  12084. 800beca: 4a35 ldr r2, [pc, #212] ; (800bfa0 <tcp_alloc+0x114>)
  12085. mprio = TCP_PRIO_MAX;
  12086. /* We kill the oldest active connection that has lower priority than prio. */
  12087. inactivity = 0;
  12088. inactive = NULL;
  12089. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  12090. 800becc: 4b35 ldr r3, [pc, #212] ; (800bfa4 <tcp_alloc+0x118>)
  12091. if (pcb->prio <= prio &&
  12092. pcb->prio <= mprio &&
  12093. (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  12094. 800bece: 6817 ldr r7, [r2, #0]
  12095. mprio = TCP_PRIO_MAX;
  12096. /* We kill the oldest active connection that has lower priority than prio. */
  12097. inactivity = 0;
  12098. inactive = NULL;
  12099. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  12100. 800bed0: 681b ldr r3, [r3, #0]
  12101. struct tcp_pcb *pcb, *inactive;
  12102. u32_t inactivity;
  12103. u8_t mprio;
  12104. mprio = TCP_PRIO_MAX;
  12105. 800bed2: 207f movs r0, #127 ; 0x7f
  12106. /* We kill the oldest active connection that has lower priority than prio. */
  12107. inactivity = 0;
  12108. inactive = NULL;
  12109. 800bed4: 4622 mov r2, r4
  12110. 800bed6: e00c b.n 800bef2 <tcp_alloc+0x66>
  12111. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  12112. if (pcb->prio <= prio &&
  12113. 800bed8: 7e59 ldrb r1, [r3, #25]
  12114. 800beda: 42a9 cmp r1, r5
  12115. 800bedc: d808 bhi.n 800bef0 <tcp_alloc+0x64>
  12116. 800bede: 4281 cmp r1, r0
  12117. 800bee0: d806 bhi.n 800bef0 <tcp_alloc+0x64>
  12118. pcb->prio <= mprio &&
  12119. (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
  12120. 800bee2: 6a5e ldr r6, [r3, #36] ; 0x24
  12121. 800bee4: 1bbe subs r6, r7, r6
  12122. /* We kill the oldest active connection that has lower priority than prio. */
  12123. inactivity = 0;
  12124. inactive = NULL;
  12125. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  12126. if (pcb->prio <= prio &&
  12127. pcb->prio <= mprio &&
  12128. 800bee6: 42a6 cmp r6, r4
  12129. 800bee8: d302 bcc.n 800bef0 <tcp_alloc+0x64>
  12130. 800beea: 4608 mov r0, r1
  12131. 800beec: 4634 mov r4, r6
  12132. 800beee: 461a mov r2, r3
  12133. mprio = TCP_PRIO_MAX;
  12134. /* We kill the oldest active connection that has lower priority than prio. */
  12135. inactivity = 0;
  12136. inactive = NULL;
  12137. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  12138. 800bef0: 68db ldr r3, [r3, #12]
  12139. 800bef2: 2b00 cmp r3, #0
  12140. 800bef4: d1f0 bne.n 800bed8 <tcp_alloc+0x4c>
  12141. inactivity = tcp_ticks - pcb->tmr;
  12142. inactive = pcb;
  12143. mprio = pcb->prio;
  12144. }
  12145. }
  12146. if (inactive != NULL) {
  12147. 800bef6: b112 cbz r2, 800befe <tcp_alloc+0x72>
  12148. LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_prio: killing oldest PCB %p (%"S32_F")\n",
  12149. (void *)inactive, inactivity));
  12150. tcp_abort(inactive);
  12151. 800bef8: 4610 mov r0, r2
  12152. 800befa: f7ff ffc3 bl 800be84 <tcp_abort>
  12153. if (pcb == NULL) {
  12154. /* Try killing active connections with lower priority than the new one. */
  12155. LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing connection with prio lower than %d\n", prio));
  12156. tcp_kill_prio(prio);
  12157. /* Try to allocate a tcp_pcb again. */
  12158. pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);
  12159. 800befe: 2002 movs r0, #2
  12160. 800bf00: f7ff f9be bl 800b280 <memp_malloc>
  12161. if (pcb != NULL) {
  12162. 800bf04: 4604 mov r4, r0
  12163. 800bf06: 2800 cmp r0, #0
  12164. 800bf08: d045 beq.n 800bf96 <tcp_alloc+0x10a>
  12165. /* adjust err stats: memp_malloc failed twice before */
  12166. MEMP_STATS_DEC(err, MEMP_TCP_PCB);
  12167. 800bf0a: 4b27 ldr r3, [pc, #156] ; (800bfa8 <tcp_alloc+0x11c>)
  12168. 800bf0c: f8b3 20cc ldrh.w r2, [r3, #204] ; 0xcc
  12169. 800bf10: 3a01 subs r2, #1
  12170. 800bf12: f8a3 20cc strh.w r2, [r3, #204] ; 0xcc
  12171. }
  12172. }
  12173. if (pcb != NULL) {
  12174. /* adjust err stats: timewait PCB was freed above */
  12175. MEMP_STATS_DEC(err, MEMP_TCP_PCB);
  12176. 800bf16: 4b24 ldr r3, [pc, #144] ; (800bfa8 <tcp_alloc+0x11c>)
  12177. 800bf18: f8b3 20cc ldrh.w r2, [r3, #204] ; 0xcc
  12178. 800bf1c: 3a01 subs r2, #1
  12179. 800bf1e: f8a3 20cc strh.w r2, [r3, #204] ; 0xcc
  12180. }
  12181. }
  12182. if (pcb != NULL) {
  12183. memset(pcb, 0, sizeof(struct tcp_pcb));
  12184. 800bf22: 2100 movs r1, #0
  12185. 800bf24: 2294 movs r2, #148 ; 0x94
  12186. 800bf26: 4620 mov r0, r4
  12187. 800bf28: f7fd fb26 bl 8009578 <memset>
  12188. pcb->prio = prio;
  12189. pcb->snd_buf = TCP_SND_BUF;
  12190. pcb->snd_queuelen = 0;
  12191. pcb->rcv_wnd = TCP_WND;
  12192. 800bf2c: f241 62d0 movw r2, #5840 ; 0x16d0
  12193. }
  12194. }
  12195. if (pcb != NULL) {
  12196. memset(pcb, 0, sizeof(struct tcp_pcb));
  12197. pcb->prio = prio;
  12198. pcb->snd_buf = TCP_SND_BUF;
  12199. 800bf30: f246 63a8 movw r3, #26280 ; 0x66a8
  12200. 800bf34: f8a4 3066 strh.w r3, [r4, #102] ; 0x66
  12201. pcb->snd_queuelen = 0;
  12202. pcb->rcv_wnd = TCP_WND;
  12203. 800bf38: 85a2 strh r2, [r4, #44] ; 0x2c
  12204. }
  12205. if (pcb != NULL) {
  12206. memset(pcb, 0, sizeof(struct tcp_pcb));
  12207. pcb->prio = prio;
  12208. pcb->snd_buf = TCP_SND_BUF;
  12209. pcb->snd_queuelen = 0;
  12210. 800bf3a: 2300 movs r3, #0
  12211. pcb->rcv_wnd = TCP_WND;
  12212. pcb->rcv_ann_wnd = TCP_WND;
  12213. 800bf3c: 85e2 strh r2, [r4, #46] ; 0x2e
  12214. pcb->tos = 0;
  12215. pcb->ttl = TCP_TTL;
  12216. 800bf3e: 22ff movs r2, #255 ; 0xff
  12217. MEMP_STATS_DEC(err, MEMP_TCP_PCB);
  12218. }
  12219. }
  12220. if (pcb != NULL) {
  12221. memset(pcb, 0, sizeof(struct tcp_pcb));
  12222. pcb->prio = prio;
  12223. 800bf40: 7665 strb r5, [r4, #25]
  12224. pcb->snd_buf = TCP_SND_BUF;
  12225. pcb->snd_queuelen = 0;
  12226. 800bf42: f8a4 3068 strh.w r3, [r4, #104] ; 0x68
  12227. 800bf46: 461d mov r5, r3
  12228. pcb->rcv_wnd = TCP_WND;
  12229. pcb->rcv_ann_wnd = TCP_WND;
  12230. pcb->tos = 0;
  12231. 800bf48: 7263 strb r3, [r4, #9]
  12232. pcb->ttl = TCP_TTL;
  12233. 800bf4a: 72a2 strb r2, [r4, #10]
  12234. /* As initial send MSS, we use TCP_MSS but limit it to 536.
  12235. The send MSS is updated when an MSS option is received. */
  12236. pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  12237. pcb->rto = 3000 / TCP_SLOW_INTERVAL;
  12238. pcb->sa = 0;
  12239. 800bf4c: f8a4 3040 strh.w r3, [r4, #64] ; 0x40
  12240. pcb->rcv_ann_wnd = TCP_WND;
  12241. pcb->tos = 0;
  12242. pcb->ttl = TCP_TTL;
  12243. /* As initial send MSS, we use TCP_MSS but limit it to 536.
  12244. The send MSS is updated when an MSS option is received. */
  12245. pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  12246. 800bf50: f44f 7206 mov.w r2, #536 ; 0x218
  12247. pcb->rto = 3000 / TCP_SLOW_INTERVAL;
  12248. pcb->sa = 0;
  12249. pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  12250. pcb->rtime = -1;
  12251. 800bf54: f64f 73ff movw r3, #65535 ; 0xffff
  12252. pcb->rcv_ann_wnd = TCP_WND;
  12253. pcb->tos = 0;
  12254. pcb->ttl = TCP_TTL;
  12255. /* As initial send MSS, we use TCP_MSS but limit it to 536.
  12256. The send MSS is updated when an MSS option is received. */
  12257. pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  12258. 800bf58: 86e2 strh r2, [r4, #54] ; 0x36
  12259. pcb->rto = 3000 / TCP_SLOW_INTERVAL;
  12260. pcb->sa = 0;
  12261. pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  12262. pcb->rtime = -1;
  12263. 800bf5a: 86a3 strh r3, [r4, #52] ; 0x34
  12264. pcb->tos = 0;
  12265. pcb->ttl = TCP_TTL;
  12266. /* As initial send MSS, we use TCP_MSS but limit it to 536.
  12267. The send MSS is updated when an MSS option is received. */
  12268. pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  12269. pcb->rto = 3000 / TCP_SLOW_INTERVAL;
  12270. 800bf5c: 2206 movs r2, #6
  12271. pcb->sa = 0;
  12272. pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  12273. pcb->rtime = -1;
  12274. pcb->cwnd = 1;
  12275. 800bf5e: 2301 movs r3, #1
  12276. 800bf60: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
  12277. pcb->tos = 0;
  12278. pcb->ttl = TCP_TTL;
  12279. /* As initial send MSS, we use TCP_MSS but limit it to 536.
  12280. The send MSS is updated when an MSS option is received. */
  12281. pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
  12282. pcb->rto = 3000 / TCP_SLOW_INTERVAL;
  12283. 800bf64: f8a4 2044 strh.w r2, [r4, #68] ; 0x44
  12284. pcb->sa = 0;
  12285. pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  12286. 800bf68: f8a4 2042 strh.w r2, [r4, #66] ; 0x42
  12287. pcb->rtime = -1;
  12288. pcb->cwnd = 1;
  12289. iss = tcp_next_iss();
  12290. 800bf6c: f7ff fee4 bl 800bd38 <tcp_next_iss>
  12291. pcb->snd_wl2 = iss;
  12292. pcb->snd_nxt = iss;
  12293. pcb->lastack = iss;
  12294. pcb->snd_lbb = iss;
  12295. pcb->tmr = tcp_ticks;
  12296. 800bf70: 4b0b ldr r3, [pc, #44] ; (800bfa0 <tcp_alloc+0x114>)
  12297. pcb->sa = 0;
  12298. pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  12299. pcb->rtime = -1;
  12300. pcb->cwnd = 1;
  12301. iss = tcp_next_iss();
  12302. pcb->snd_wl2 = iss;
  12303. 800bf72: 65a0 str r0, [r4, #88] ; 0x58
  12304. pcb->snd_nxt = iss;
  12305. pcb->lastack = iss;
  12306. pcb->snd_lbb = iss;
  12307. pcb->tmr = tcp_ticks;
  12308. 800bf74: 681b ldr r3, [r3, #0]
  12309. pcb->sv = 3000 / TCP_SLOW_INTERVAL;
  12310. pcb->rtime = -1;
  12311. pcb->cwnd = 1;
  12312. iss = tcp_next_iss();
  12313. pcb->snd_wl2 = iss;
  12314. pcb->snd_nxt = iss;
  12315. 800bf76: 6520 str r0, [r4, #80] ; 0x50
  12316. pcb->lastack = iss;
  12317. pcb->snd_lbb = iss;
  12318. pcb->tmr = tcp_ticks;
  12319. 800bf78: 6263 str r3, [r4, #36] ; 0x24
  12320. pcb->last_timer = tcp_timer_ctr;
  12321. 800bf7a: 4b0c ldr r3, [pc, #48] ; (800bfac <tcp_alloc+0x120>)
  12322. pcb->rtime = -1;
  12323. pcb->cwnd = 1;
  12324. iss = tcp_next_iss();
  12325. pcb->snd_wl2 = iss;
  12326. pcb->snd_nxt = iss;
  12327. pcb->lastack = iss;
  12328. 800bf7c: 64a0 str r0, [r4, #72] ; 0x48
  12329. pcb->snd_lbb = iss;
  12330. pcb->tmr = tcp_ticks;
  12331. pcb->last_timer = tcp_timer_ctr;
  12332. 800bf7e: 781b ldrb r3, [r3, #0]
  12333. pcb->cwnd = 1;
  12334. iss = tcp_next_iss();
  12335. pcb->snd_wl2 = iss;
  12336. pcb->snd_nxt = iss;
  12337. pcb->lastack = iss;
  12338. pcb->snd_lbb = iss;
  12339. 800bf80: 65e0 str r0, [r4, #92] ; 0x5c
  12340. pcb->tmr = tcp_ticks;
  12341. pcb->last_timer = tcp_timer_ctr;
  12342. 800bf82: f884 3021 strb.w r3, [r4, #33] ; 0x21
  12343. pcb->polltmr = 0;
  12344. #if LWIP_CALLBACK_API
  12345. pcb->recv = tcp_recv_null;
  12346. 800bf86: 4b0a ldr r3, [pc, #40] ; (800bfb0 <tcp_alloc+0x124>)
  12347. pcb->lastack = iss;
  12348. pcb->snd_lbb = iss;
  12349. pcb->tmr = tcp_ticks;
  12350. pcb->last_timer = tcp_timer_ctr;
  12351. pcb->polltmr = 0;
  12352. 800bf88: 77e5 strb r5, [r4, #31]
  12353. #if LWIP_CALLBACK_API
  12354. pcb->recv = tcp_recv_null;
  12355. 800bf8a: 67e3 str r3, [r4, #124] ; 0x7c
  12356. #endif /* LWIP_CALLBACK_API */
  12357. /* Init KEEPALIVE timer */
  12358. pcb->keep_idle = TCP_KEEPIDLE_DEFAULT;
  12359. 800bf8c: 4b09 ldr r3, [pc, #36] ; (800bfb4 <tcp_alloc+0x128>)
  12360. #if LWIP_TCP_KEEPALIVE
  12361. pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT;
  12362. pcb->keep_cnt = TCP_KEEPCNT_DEFAULT;
  12363. #endif /* LWIP_TCP_KEEPALIVE */
  12364. pcb->keep_cnt_sent = 0;
  12365. 800bf8e: f884 5092 strb.w r5, [r4, #146] ; 0x92
  12366. #if LWIP_CALLBACK_API
  12367. pcb->recv = tcp_recv_null;
  12368. #endif /* LWIP_CALLBACK_API */
  12369. /* Init KEEPALIVE timer */
  12370. pcb->keep_idle = TCP_KEEPIDLE_DEFAULT;
  12371. 800bf92: f8c4 308c str.w r3, [r4, #140] ; 0x8c
  12372. #endif /* LWIP_TCP_KEEPALIVE */
  12373. pcb->keep_cnt_sent = 0;
  12374. }
  12375. return pcb;
  12376. }
  12377. 800bf96: 4620 mov r0, r4
  12378. 800bf98: bdf8 pop {r3, r4, r5, r6, r7, pc}
  12379. 800bf9a: bf00 nop
  12380. 800bf9c: 20008350 .word 0x20008350
  12381. 800bfa0: 20008340 .word 0x20008340
  12382. 800bfa4: 2000833c .word 0x2000833c
  12383. 800bfa8: 20008220 .word 0x20008220
  12384. 800bfac: 20006b7d .word 0x20006b7d
  12385. 800bfb0: 0800c111 .word 0x0800c111
  12386. 800bfb4: 006ddd00 .word 0x006ddd00
  12387. 0800bfb8 <tcp_new>:
  12388. * @return a new tcp_pcb that initially is in state CLOSED
  12389. */
  12390. struct tcp_pcb *
  12391. tcp_new(void)
  12392. {
  12393. return tcp_alloc(TCP_PRIO_NORMAL);
  12394. 800bfb8: 2040 movs r0, #64 ; 0x40
  12395. 800bfba: f7ff bf67 b.w 800be8c <tcp_alloc>
  12396. 800bfbe: 0000 movs r0, r0
  12397. 0800bfc0 <tcp_close_shutdown>:
  12398. * @return ERR_OK if connection has been closed
  12399. * another err_t if closing failed and pcb is not freed
  12400. */
  12401. static err_t
  12402. tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data)
  12403. {
  12404. 800bfc0: b537 push {r0, r1, r2, r4, r5, lr}
  12405. 800bfc2: 4604 mov r4, r0
  12406. err_t err;
  12407. if (rst_on_unacked_data && ((pcb->state == ESTABLISHED) || (pcb->state == CLOSE_WAIT))) {
  12408. 800bfc4: 2900 cmp r1, #0
  12409. 800bfc6: d043 beq.n 800c050 <tcp_close_shutdown+0x90>
  12410. 800bfc8: 7e03 ldrb r3, [r0, #24]
  12411. 800bfca: 2b04 cmp r3, #4
  12412. 800bfcc: d001 beq.n 800bfd2 <tcp_close_shutdown+0x12>
  12413. 800bfce: 2b07 cmp r3, #7
  12414. 800bfd0: d13e bne.n 800c050 <tcp_close_shutdown+0x90>
  12415. if ((pcb->refused_data != NULL) || (pcb->rcv_wnd != TCP_WND)) {
  12416. 800bfd2: 6f63 ldr r3, [r4, #116] ; 0x74
  12417. 800bfd4: b923 cbnz r3, 800bfe0 <tcp_close_shutdown+0x20>
  12418. 800bfd6: 8da2 ldrh r2, [r4, #44] ; 0x2c
  12419. 800bfd8: f241 63d0 movw r3, #5840 ; 0x16d0
  12420. 800bfdc: 429a cmp r2, r3
  12421. 800bfde: d037 beq.n 800c050 <tcp_close_shutdown+0x90>
  12422. side about this. */
  12423. LWIP_ASSERT("pcb->flags & TF_RXCLOSED", pcb->flags & TF_RXCLOSED);
  12424. /* don't call tcp_abort here: we must not deallocate the pcb since
  12425. that might not be expected when calling tcp_close */
  12426. tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
  12427. 800bfe0: 8b63 ldrh r3, [r4, #26]
  12428. 800bfe2: 6d20 ldr r0, [r4, #80] ; 0x50
  12429. 800bfe4: 9300 str r3, [sp, #0]
  12430. 800bfe6: 8ba3 ldrh r3, [r4, #28]
  12431. 800bfe8: 6aa1 ldr r1, [r4, #40] ; 0x28
  12432. 800bfea: 9301 str r3, [sp, #4]
  12433. 800bfec: 4622 mov r2, r4
  12434. 800bfee: 1d23 adds r3, r4, #4
  12435. 800bff0: f001 fc5c bl 800d8ac <tcp_rst>
  12436. pcb->local_port, pcb->remote_port);
  12437. tcp_pcb_purge(pcb);
  12438. 800bff4: 4620 mov r0, r4
  12439. 800bff6: f7ff fd37 bl 800ba68 <tcp_pcb_purge>
  12440. TCP_RMV_ACTIVE(pcb);
  12441. 800bffa: 4a3a ldr r2, [pc, #232] ; (800c0e4 <tcp_close_shutdown+0x124>)
  12442. 800bffc: 6813 ldr r3, [r2, #0]
  12443. 800bffe: 42a3 cmp r3, r4
  12444. 800c000: d101 bne.n 800c006 <tcp_close_shutdown+0x46>
  12445. 800c002: 68e3 ldr r3, [r4, #12]
  12446. 800c004: e00c b.n 800c020 <tcp_close_shutdown+0x60>
  12447. 800c006: 4a38 ldr r2, [pc, #224] ; (800c0e8 <tcp_close_shutdown+0x128>)
  12448. 800c008: 6013 str r3, [r2, #0]
  12449. 800c00a: e007 b.n 800c01c <tcp_close_shutdown+0x5c>
  12450. 800c00c: 68d9 ldr r1, [r3, #12]
  12451. 800c00e: 42a1 cmp r1, r4
  12452. 800c010: d103 bne.n 800c01a <tcp_close_shutdown+0x5a>
  12453. 800c012: 6013 str r3, [r2, #0]
  12454. 800c014: 68e2 ldr r2, [r4, #12]
  12455. 800c016: 60da str r2, [r3, #12]
  12456. 800c018: e003 b.n 800c022 <tcp_close_shutdown+0x62>
  12457. 800c01a: 460b mov r3, r1
  12458. 800c01c: 2b00 cmp r3, #0
  12459. 800c01e: d1f5 bne.n 800c00c <tcp_close_shutdown+0x4c>
  12460. 800c020: 6013 str r3, [r2, #0]
  12461. 800c022: 4b32 ldr r3, [pc, #200] ; (800c0ec <tcp_close_shutdown+0x12c>)
  12462. 800c024: 2201 movs r2, #1
  12463. 800c026: 701a strb r2, [r3, #0]
  12464. if (pcb->state == ESTABLISHED) {
  12465. 800c028: 7e23 ldrb r3, [r4, #24]
  12466. that might not be expected when calling tcp_close */
  12467. tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
  12468. pcb->local_port, pcb->remote_port);
  12469. tcp_pcb_purge(pcb);
  12470. TCP_RMV_ACTIVE(pcb);
  12471. 800c02a: 2500 movs r5, #0
  12472. if (pcb->state == ESTABLISHED) {
  12473. 800c02c: 2b04 cmp r3, #4
  12474. that might not be expected when calling tcp_close */
  12475. tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
  12476. pcb->local_port, pcb->remote_port);
  12477. tcp_pcb_purge(pcb);
  12478. TCP_RMV_ACTIVE(pcb);
  12479. 800c02e: 60e5 str r5, [r4, #12]
  12480. if (pcb->state == ESTABLISHED) {
  12481. 800c030: d108 bne.n 800c044 <tcp_close_shutdown+0x84>
  12482. /* move to TIME_WAIT since we close actively */
  12483. pcb->state = TIME_WAIT;
  12484. 800c032: 230a movs r3, #10
  12485. 800c034: 7623 strb r3, [r4, #24]
  12486. TCP_REG(&tcp_tw_pcbs, pcb);
  12487. 800c036: 4b2e ldr r3, [pc, #184] ; (800c0f0 <tcp_close_shutdown+0x130>)
  12488. 800c038: 681a ldr r2, [r3, #0]
  12489. 800c03a: 601c str r4, [r3, #0]
  12490. 800c03c: 60e2 str r2, [r4, #12]
  12491. 800c03e: f001 fdfb bl 800dc38 <tcp_timer_needed>
  12492. 800c042: e003 b.n 800c04c <tcp_close_shutdown+0x8c>
  12493. } else {
  12494. /* CLOSE_WAIT: deallocate the pcb since we already sent a RST for it */
  12495. memp_free(MEMP_TCP_PCB, pcb);
  12496. 800c044: 2002 movs r0, #2
  12497. 800c046: 4621 mov r1, r4
  12498. 800c048: f7ff f944 bl 800b2d4 <memp_free>
  12499. }
  12500. return ERR_OK;
  12501. 800c04c: 4628 mov r0, r5
  12502. 800c04e: e040 b.n 800c0d2 <tcp_close_shutdown+0x112>
  12503. }
  12504. }
  12505. switch (pcb->state) {
  12506. 800c050: 7e23 ldrb r3, [r4, #24]
  12507. 800c052: 2b07 cmp r3, #7
  12508. 800c054: d842 bhi.n 800c0dc <tcp_close_shutdown+0x11c>
  12509. 800c056: e8df f003 tbb [pc, r3]
  12510. 800c05a: 1d04 .short 0x1d04
  12511. 800c05c: 412f2f23 .word 0x412f2f23
  12512. 800c060: 3541 .short 0x3541
  12513. * Calling tcp_close() with a pcb that has already been closed, (i.e. twice)
  12514. * or for a pcb that has been used and then entered the CLOSED state
  12515. * is erroneous, but this should never happen as the pcb has in those cases
  12516. * been freed, and so any remaining handles are bogus. */
  12517. err = ERR_OK;
  12518. if (pcb->local_port != 0) {
  12519. 800c062: 8b63 ldrh r3, [r4, #26]
  12520. 800c064: b31b cbz r3, 800c0ae <tcp_close_shutdown+0xee>
  12521. TCP_RMV(&tcp_bound_pcbs, pcb);
  12522. 800c066: 4a23 ldr r2, [pc, #140] ; (800c0f4 <tcp_close_shutdown+0x134>)
  12523. 800c068: 6813 ldr r3, [r2, #0]
  12524. 800c06a: 42a3 cmp r3, r4
  12525. 800c06c: d101 bne.n 800c072 <tcp_close_shutdown+0xb2>
  12526. 800c06e: 68e3 ldr r3, [r4, #12]
  12527. 800c070: e00c b.n 800c08c <tcp_close_shutdown+0xcc>
  12528. 800c072: 4a1d ldr r2, [pc, #116] ; (800c0e8 <tcp_close_shutdown+0x128>)
  12529. 800c074: 6013 str r3, [r2, #0]
  12530. 800c076: e007 b.n 800c088 <tcp_close_shutdown+0xc8>
  12531. 800c078: 68d9 ldr r1, [r3, #12]
  12532. 800c07a: 42a1 cmp r1, r4
  12533. 800c07c: d103 bne.n 800c086 <tcp_close_shutdown+0xc6>
  12534. 800c07e: 6013 str r3, [r2, #0]
  12535. 800c080: 68e2 ldr r2, [r4, #12]
  12536. 800c082: 60da str r2, [r3, #12]
  12537. 800c084: e003 b.n 800c08e <tcp_close_shutdown+0xce>
  12538. 800c086: 460b mov r3, r1
  12539. 800c088: 2b00 cmp r3, #0
  12540. 800c08a: d1f5 bne.n 800c078 <tcp_close_shutdown+0xb8>
  12541. 800c08c: 6013 str r3, [r2, #0]
  12542. 800c08e: 2300 movs r3, #0
  12543. 800c090: 60e3 str r3, [r4, #12]
  12544. 800c092: e00c b.n 800c0ae <tcp_close_shutdown+0xee>
  12545. memp_free(MEMP_TCP_PCB, pcb);
  12546. pcb = NULL;
  12547. break;
  12548. case LISTEN:
  12549. err = ERR_OK;
  12550. tcp_pcb_remove(&tcp_listen_pcbs.pcbs, pcb);
  12551. 800c094: 4818 ldr r0, [pc, #96] ; (800c0f8 <tcp_close_shutdown+0x138>)
  12552. 800c096: 4621 mov r1, r4
  12553. 800c098: f7ff fe7c bl 800bd94 <tcp_pcb_remove>
  12554. memp_free(MEMP_TCP_PCB_LISTEN, pcb);
  12555. 800c09c: 2003 movs r0, #3
  12556. 800c09e: e007 b.n 800c0b0 <tcp_close_shutdown+0xf0>
  12557. pcb = NULL;
  12558. break;
  12559. case SYN_SENT:
  12560. err = ERR_OK;
  12561. TCP_PCB_REMOVE_ACTIVE(pcb);
  12562. 800c0a0: 4810 ldr r0, [pc, #64] ; (800c0e4 <tcp_close_shutdown+0x124>)
  12563. 800c0a2: 4621 mov r1, r4
  12564. 800c0a4: f7ff fe76 bl 800bd94 <tcp_pcb_remove>
  12565. 800c0a8: 4b10 ldr r3, [pc, #64] ; (800c0ec <tcp_close_shutdown+0x12c>)
  12566. 800c0aa: 2201 movs r2, #1
  12567. 800c0ac: 701a strb r2, [r3, #0]
  12568. memp_free(MEMP_TCP_PCB, pcb);
  12569. 800c0ae: 2002 movs r0, #2
  12570. 800c0b0: 4621 mov r1, r4
  12571. 800c0b2: f7ff f90f bl 800b2d4 <memp_free>
  12572. pcb = NULL;
  12573. snmp_inc_tcpattemptfails();
  12574. break;
  12575. 800c0b6: e011 b.n 800c0dc <tcp_close_shutdown+0x11c>
  12576. snmp_inc_tcpattemptfails();
  12577. pcb->state = FIN_WAIT_1;
  12578. }
  12579. break;
  12580. case ESTABLISHED:
  12581. err = tcp_send_fin(pcb);
  12582. 800c0b8: 4620 mov r0, r4
  12583. 800c0ba: f001 fa77 bl 800d5ac <tcp_send_fin>
  12584. if (err == ERR_OK) {
  12585. 800c0be: b940 cbnz r0, 800c0d2 <tcp_close_shutdown+0x112>
  12586. snmp_inc_tcpestabresets();
  12587. pcb->state = FIN_WAIT_1;
  12588. 800c0c0: 2305 movs r3, #5
  12589. 800c0c2: e004 b.n 800c0ce <tcp_close_shutdown+0x10e>
  12590. }
  12591. break;
  12592. case CLOSE_WAIT:
  12593. err = tcp_send_fin(pcb);
  12594. 800c0c4: 4620 mov r0, r4
  12595. 800c0c6: f001 fa71 bl 800d5ac <tcp_send_fin>
  12596. if (err == ERR_OK) {
  12597. 800c0ca: b910 cbnz r0, 800c0d2 <tcp_close_shutdown+0x112>
  12598. snmp_inc_tcpestabresets();
  12599. pcb->state = LAST_ACK;
  12600. 800c0cc: 2309 movs r3, #9
  12601. 800c0ce: 7623 strb r3, [r4, #24]
  12602. 800c0d0: e001 b.n 800c0d6 <tcp_close_shutdown+0x116>
  12603. 800c0d2: b240 sxtb r0, r0
  12604. 800c0d4: e004 b.n 800c0e0 <tcp_close_shutdown+0x120>
  12605. returns (unsent data is sent from tcp timer functions, also), we don't care
  12606. for the return value of tcp_output for now. */
  12607. /* @todo: When implementing SO_LINGER, this must be changed somehow:
  12608. If SOF_LINGER is set, the data should be sent and acked before close returns.
  12609. This can only be valid for sequential APIs, not for the raw API. */
  12610. tcp_output(pcb);
  12611. 800c0d6: 4620 mov r0, r4
  12612. 800c0d8: f001 faac bl 800d634 <tcp_output>
  12613. 800c0dc: 2000 movs r0, #0
  12614. 800c0de: e7f8 b.n 800c0d2 <tcp_close_shutdown+0x112>
  12615. }
  12616. return err;
  12617. }
  12618. 800c0e0: bd3e pop {r1, r2, r3, r4, r5, pc}
  12619. 800c0e2: bf00 nop
  12620. 800c0e4: 2000833c .word 0x2000833c
  12621. 800c0e8: 20008348 .word 0x20008348
  12622. 800c0ec: 20008338 .word 0x20008338
  12623. 800c0f0: 20008350 .word 0x20008350
  12624. 800c0f4: 2000834c .word 0x2000834c
  12625. 800c0f8: 20008344 .word 0x20008344
  12626. 0800c0fc <tcp_close>:
  12627. #if TCP_DEBUG
  12628. LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in "));
  12629. tcp_debug_print_state(pcb->state);
  12630. #endif /* TCP_DEBUG */
  12631. if (pcb->state != LISTEN) {
  12632. 800c0fc: 7e03 ldrb r3, [r0, #24]
  12633. 800c0fe: 2b01 cmp r3, #1
  12634. 800c100: d003 beq.n 800c10a <tcp_close+0xe>
  12635. /* Set a flag not to receive any more data... */
  12636. pcb->flags |= TF_RXCLOSED;
  12637. 800c102: 7f83 ldrb r3, [r0, #30]
  12638. 800c104: f043 0310 orr.w r3, r3, #16
  12639. 800c108: 7783 strb r3, [r0, #30]
  12640. }
  12641. /* ... and close */
  12642. return tcp_close_shutdown(pcb, 1);
  12643. 800c10a: 2101 movs r1, #1
  12644. 800c10c: f7ff bf58 b.w 800bfc0 <tcp_close_shutdown>
  12645. 0800c110 <tcp_recv_null>:
  12646. * Default receive callback that is called if the user didn't register
  12647. * a recv callback for the pcb.
  12648. */
  12649. err_t
  12650. tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
  12651. {
  12652. 800c110: b510 push {r4, lr}
  12653. 800c112: 4608 mov r0, r1
  12654. LWIP_UNUSED_ARG(arg);
  12655. if (p != NULL) {
  12656. 800c114: 4614 mov r4, r2
  12657. 800c116: b132 cbz r2, 800c126 <tcp_recv_null+0x16>
  12658. tcp_recved(pcb, p->tot_len);
  12659. 800c118: 8911 ldrh r1, [r2, #8]
  12660. 800c11a: f7ff fc61 bl 800b9e0 <tcp_recved>
  12661. pbuf_free(p);
  12662. 800c11e: 4620 mov r0, r4
  12663. 800c120: f7ff f9d0 bl 800b4c4 <pbuf_free>
  12664. 800c124: e004 b.n 800c130 <tcp_recv_null+0x20>
  12665. } else if (err == ERR_OK) {
  12666. 800c126: b91b cbnz r3, 800c130 <tcp_recv_null+0x20>
  12667. return tcp_close(pcb);
  12668. }
  12669. return ERR_OK;
  12670. }
  12671. 800c128: e8bd 4010 ldmia.w sp!, {r4, lr}
  12672. LWIP_UNUSED_ARG(arg);
  12673. if (p != NULL) {
  12674. tcp_recved(pcb, p->tot_len);
  12675. pbuf_free(p);
  12676. } else if (err == ERR_OK) {
  12677. return tcp_close(pcb);
  12678. 800c12c: f7ff bfe6 b.w 800c0fc <tcp_close>
  12679. }
  12680. return ERR_OK;
  12681. }
  12682. 800c130: 2000 movs r0, #0
  12683. 800c132: bd10 pop {r4, pc}
  12684. 0800c134 <tcp_process_refused_data>:
  12685. }
  12686. /** Pass pcb->refused_data to the recv callback */
  12687. err_t
  12688. tcp_process_refused_data(struct tcp_pcb *pcb)
  12689. {
  12690. 800c134: b5f8 push {r3, r4, r5, r6, r7, lr}
  12691. err_t err;
  12692. u8_t refused_flags = pcb->refused_data->flags;
  12693. 800c136: 6f45 ldr r5, [r0, #116] ; 0x74
  12694. closes the pcb */
  12695. struct pbuf *refused_data = pcb->refused_data;
  12696. pcb->refused_data = NULL;
  12697. /* Notify again application with data previously received. */
  12698. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
  12699. TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err);
  12700. 800c138: 6fc6 ldr r6, [r0, #124] ; 0x7c
  12701. /** Pass pcb->refused_data to the recv callback */
  12702. err_t
  12703. tcp_process_refused_data(struct tcp_pcb *pcb)
  12704. {
  12705. err_t err;
  12706. u8_t refused_flags = pcb->refused_data->flags;
  12707. 800c13a: 7b6f ldrb r7, [r5, #13]
  12708. /* set pcb->refused_data to NULL in case the callback frees it and then
  12709. closes the pcb */
  12710. struct pbuf *refused_data = pcb->refused_data;
  12711. pcb->refused_data = NULL;
  12712. 800c13c: 2300 movs r3, #0
  12713. }
  12714. /** Pass pcb->refused_data to the recv callback */
  12715. err_t
  12716. tcp_process_refused_data(struct tcp_pcb *pcb)
  12717. {
  12718. 800c13e: 4604 mov r4, r0
  12719. err_t err;
  12720. u8_t refused_flags = pcb->refused_data->flags;
  12721. /* set pcb->refused_data to NULL in case the callback frees it and then
  12722. closes the pcb */
  12723. struct pbuf *refused_data = pcb->refused_data;
  12724. pcb->refused_data = NULL;
  12725. 800c140: 6743 str r3, [r0, #116] ; 0x74
  12726. /* Notify again application with data previously received. */
  12727. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
  12728. TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err);
  12729. 800c142: b126 cbz r6, 800c14e <tcp_process_refused_data+0x1a>
  12730. 800c144: 4621 mov r1, r4
  12731. 800c146: 462a mov r2, r5
  12732. 800c148: 6900 ldr r0, [r0, #16]
  12733. 800c14a: 47b0 blx r6
  12734. 800c14c: e005 b.n 800c15a <tcp_process_refused_data+0x26>
  12735. 800c14e: 4630 mov r0, r6
  12736. 800c150: 4621 mov r1, r4
  12737. 800c152: 462a mov r2, r5
  12738. 800c154: 4633 mov r3, r6
  12739. 800c156: f7ff ffdb bl 800c110 <tcp_recv_null>
  12740. if (err == ERR_OK) {
  12741. 800c15a: b9b0 cbnz r0, 800c18a <tcp_process_refused_data+0x56>
  12742. /* did refused_data include a FIN? */
  12743. if (refused_flags & PBUF_FLAG_TCP_FIN) {
  12744. 800c15c: f007 0720 and.w r7, r7, #32
  12745. 800c160: b2ff uxtb r7, r7
  12746. 800c162: b1bf cbz r7, 800c194 <tcp_process_refused_data+0x60>
  12747. /* correct rcv_wnd as the application won't call tcp_recved()
  12748. for the FIN's seqno */
  12749. if (pcb->rcv_wnd != TCP_WND) {
  12750. 800c164: 8da3 ldrh r3, [r4, #44] ; 0x2c
  12751. 800c166: f241 62d0 movw r2, #5840 ; 0x16d0
  12752. 800c16a: 4293 cmp r3, r2
  12753. 800c16c: d001 beq.n 800c172 <tcp_process_refused_data+0x3e>
  12754. pcb->rcv_wnd++;
  12755. 800c16e: 3301 adds r3, #1
  12756. 800c170: 85a3 strh r3, [r4, #44] ; 0x2c
  12757. }
  12758. TCP_EVENT_CLOSED(pcb, err);
  12759. 800c172: 6fe5 ldr r5, [r4, #124] ; 0x7c
  12760. 800c174: b905 cbnz r5, 800c178 <tcp_process_refused_data+0x44>
  12761. 800c176: e00c b.n 800c192 <tcp_process_refused_data+0x5e>
  12762. 800c178: 2200 movs r2, #0
  12763. 800c17a: 6920 ldr r0, [r4, #16]
  12764. 800c17c: 4621 mov r1, r4
  12765. 800c17e: 4613 mov r3, r2
  12766. 800c180: 47a8 blx r5
  12767. if (err == ERR_ABRT) {
  12768. 800c182: 300a adds r0, #10
  12769. 800c184: d105 bne.n 800c192 <tcp_process_refused_data+0x5e>
  12770. return ERR_ABRT;
  12771. 800c186: 20f6 movs r0, #246 ; 0xf6
  12772. 800c188: e004 b.n 800c194 <tcp_process_refused_data+0x60>
  12773. }
  12774. }
  12775. } else if (err == ERR_ABRT) {
  12776. 800c18a: b240 sxtb r0, r0
  12777. 800c18c: 300a adds r0, #10
  12778. 800c18e: d0fa beq.n 800c186 <tcp_process_refused_data+0x52>
  12779. segment contains data). */
  12780. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: drop incoming packets, because pcb is \"full\"\n"));
  12781. return ERR_ABRT;
  12782. } else {
  12783. /* data is still refused, pbuf is still valid (go on for ACK-only packets) */
  12784. pcb->refused_data = refused_data;
  12785. 800c190: 6765 str r5, [r4, #116] ; 0x74
  12786. }
  12787. return ERR_OK;
  12788. 800c192: 2000 movs r0, #0
  12789. }
  12790. 800c194: b240 sxtb r0, r0
  12791. 800c196: bdf8 pop {r3, r4, r5, r6, r7, pc}
  12792. 0800c198 <tcp_fasttmr>:
  12793. *
  12794. * Automatically called from tcp_tmr().
  12795. */
  12796. void
  12797. tcp_fasttmr(void)
  12798. {
  12799. 800c198: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
  12800. struct tcp_pcb *pcb;
  12801. ++tcp_timer_ctr;
  12802. 800c19c: 4b18 ldr r3, [pc, #96] ; (800c200 <tcp_fasttmr+0x68>)
  12803. tcp_fasttmr_start:
  12804. pcb = tcp_active_pcbs;
  12805. 800c19e: 4f19 ldr r7, [pc, #100] ; (800c204 <tcp_fasttmr+0x6c>)
  12806. void
  12807. tcp_fasttmr(void)
  12808. {
  12809. struct tcp_pcb *pcb;
  12810. ++tcp_timer_ctr;
  12811. 800c1a0: 781a ldrb r2, [r3, #0]
  12812. 800c1a2: 3201 adds r2, #1
  12813. 800c1a4: 701a strb r2, [r3, #0]
  12814. tcp_fasttmr_start:
  12815. pcb = tcp_active_pcbs;
  12816. while(pcb != NULL) {
  12817. if (pcb->last_timer != tcp_timer_ctr) {
  12818. 800c1a6: 4698 mov r8, r3
  12819. struct tcp_pcb *pcb;
  12820. ++tcp_timer_ctr;
  12821. tcp_fasttmr_start:
  12822. pcb = tcp_active_pcbs;
  12823. 800c1a8: 683c ldr r4, [r7, #0]
  12824. next = pcb->next;
  12825. /* If there is data which was previously "refused" by upper layer */
  12826. if (pcb->refused_data != NULL) {
  12827. tcp_active_pcbs_changed = 0;
  12828. 800c1aa: 4d17 ldr r5, [pc, #92] ; (800c208 <tcp_fasttmr+0x70>)
  12829. 800c1ac: 2600 movs r6, #0
  12830. ++tcp_timer_ctr;
  12831. tcp_fasttmr_start:
  12832. pcb = tcp_active_pcbs;
  12833. while(pcb != NULL) {
  12834. 800c1ae: e022 b.n 800c1f6 <tcp_fasttmr+0x5e>
  12835. if (pcb->last_timer != tcp_timer_ctr) {
  12836. 800c1b0: f898 2000 ldrb.w r2, [r8]
  12837. 800c1b4: f894 3021 ldrb.w r3, [r4, #33] ; 0x21
  12838. 800c1b8: 4293 cmp r3, r2
  12839. 800c1ba: d020 beq.n 800c1fe <tcp_fasttmr+0x66>
  12840. struct tcp_pcb *next;
  12841. pcb->last_timer = tcp_timer_ctr;
  12842. 800c1bc: f884 2021 strb.w r2, [r4, #33] ; 0x21
  12843. /* send delayed ACKs */
  12844. if (pcb->flags & TF_ACK_DELAY) {
  12845. 800c1c0: 7fa2 ldrb r2, [r4, #30]
  12846. 800c1c2: 07d1 lsls r1, r2, #31
  12847. 800c1c4: d509 bpl.n 800c1da <tcp_fasttmr+0x42>
  12848. LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
  12849. tcp_ack_now(pcb);
  12850. 800c1c6: f042 0202 orr.w r2, r2, #2
  12851. 800c1ca: 77a2 strb r2, [r4, #30]
  12852. tcp_output(pcb);
  12853. 800c1cc: 4620 mov r0, r4
  12854. 800c1ce: f001 fa31 bl 800d634 <tcp_output>
  12855. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  12856. 800c1d2: 7fa3 ldrb r3, [r4, #30]
  12857. 800c1d4: f023 0303 bic.w r3, r3, #3
  12858. 800c1d8: 77a3 strb r3, [r4, #30]
  12859. }
  12860. next = pcb->next;
  12861. /* If there is data which was previously "refused" by upper layer */
  12862. if (pcb->refused_data != NULL) {
  12863. 800c1da: 6f63 ldr r3, [r4, #116] ; 0x74
  12864. tcp_ack_now(pcb);
  12865. tcp_output(pcb);
  12866. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  12867. }
  12868. next = pcb->next;
  12869. 800c1dc: f8d4 900c ldr.w r9, [r4, #12]
  12870. /* If there is data which was previously "refused" by upper layer */
  12871. if (pcb->refused_data != NULL) {
  12872. 800c1e0: b90b cbnz r3, 800c1e6 <tcp_fasttmr+0x4e>
  12873. 800c1e2: 464c mov r4, r9
  12874. 800c1e4: e007 b.n 800c1f6 <tcp_fasttmr+0x5e>
  12875. tcp_active_pcbs_changed = 0;
  12876. tcp_process_refused_data(pcb);
  12877. 800c1e6: 4620 mov r0, r4
  12878. next = pcb->next;
  12879. /* If there is data which was previously "refused" by upper layer */
  12880. if (pcb->refused_data != NULL) {
  12881. tcp_active_pcbs_changed = 0;
  12882. 800c1e8: 702e strb r6, [r5, #0]
  12883. tcp_process_refused_data(pcb);
  12884. 800c1ea: f7ff ffa3 bl 800c134 <tcp_process_refused_data>
  12885. if (tcp_active_pcbs_changed) {
  12886. 800c1ee: 782b ldrb r3, [r5, #0]
  12887. 800c1f0: 2b00 cmp r3, #0
  12888. 800c1f2: d1d9 bne.n 800c1a8 <tcp_fasttmr+0x10>
  12889. 800c1f4: e7f5 b.n 800c1e2 <tcp_fasttmr+0x4a>
  12890. ++tcp_timer_ctr;
  12891. tcp_fasttmr_start:
  12892. pcb = tcp_active_pcbs;
  12893. while(pcb != NULL) {
  12894. 800c1f6: 2c00 cmp r4, #0
  12895. 800c1f8: d1da bne.n 800c1b0 <tcp_fasttmr+0x18>
  12896. 800c1fa: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
  12897. 800c1fe: e7fe b.n 800c1fe <tcp_fasttmr+0x66>
  12898. 800c200: 20006b7d .word 0x20006b7d
  12899. 800c204: 2000833c .word 0x2000833c
  12900. 800c208: 20008338 .word 0x20008338
  12901. 0800c20c <tcp_tmr>:
  12902. /**
  12903. * Called periodically to dispatch TCP timers.
  12904. */
  12905. void
  12906. tcp_tmr(void)
  12907. {
  12908. 800c20c: b508 push {r3, lr}
  12909. /* Call tcp_fasttmr() every 250 ms */
  12910. tcp_fasttmr();
  12911. 800c20e: f7ff ffc3 bl 800c198 <tcp_fasttmr>
  12912. if (++tcp_timer & 1) {
  12913. 800c212: 4a06 ldr r2, [pc, #24] ; (800c22c <tcp_tmr+0x20>)
  12914. 800c214: 7813 ldrb r3, [r2, #0]
  12915. 800c216: 3301 adds r3, #1
  12916. 800c218: b2db uxtb r3, r3
  12917. 800c21a: 07d8 lsls r0, r3, #31
  12918. 800c21c: 7013 strb r3, [r2, #0]
  12919. 800c21e: d503 bpl.n 800c228 <tcp_tmr+0x1c>
  12920. /* Call tcp_tmr() every 500 ms, i.e., every other timer
  12921. tcp_tmr() is called. */
  12922. tcp_slowtmr();
  12923. }
  12924. }
  12925. 800c220: e8bd 4008 ldmia.w sp!, {r3, lr}
  12926. tcp_fasttmr();
  12927. if (++tcp_timer & 1) {
  12928. /* Call tcp_tmr() every 500 ms, i.e., every other timer
  12929. tcp_tmr() is called. */
  12930. tcp_slowtmr();
  12931. 800c224: f7ff bc3e b.w 800baa4 <tcp_slowtmr>
  12932. 800c228: bd08 pop {r3, pc}
  12933. 800c22a: bf00 nop
  12934. 800c22c: 20006b7c .word 0x20006b7c
  12935. 0800c230 <tcp_parseopt>:
  12936. *
  12937. * @param pcb the tcp_pcb for which a segment arrived
  12938. */
  12939. static void
  12940. tcp_parseopt(struct tcp_pcb *pcb)
  12941. {
  12942. 800c230: b5f8 push {r3, r4, r5, r6, r7, lr}
  12943. u8_t *opts, opt;
  12944. #if LWIP_TCP_TIMESTAMPS
  12945. u32_t tsval;
  12946. #endif
  12947. opts = (u8_t *)tcphdr + TCP_HLEN;
  12948. 800c232: 4d1e ldr r5, [pc, #120] ; (800c2ac <tcp_parseopt+0x7c>)
  12949. 800c234: 682c ldr r4, [r5, #0]
  12950. *
  12951. * @param pcb the tcp_pcb for which a segment arrived
  12952. */
  12953. static void
  12954. tcp_parseopt(struct tcp_pcb *pcb)
  12955. {
  12956. 800c236: 4606 mov r6, r0
  12957. #endif
  12958. opts = (u8_t *)tcphdr + TCP_HLEN;
  12959. /* Parse the TCP MSS option, if present. */
  12960. if(TCPH_HDRLEN(tcphdr) > 0x5) {
  12961. 800c238: 89a0 ldrh r0, [r4, #12]
  12962. 800c23a: f7fd ffdb bl 800a1f4 <lwip_ntohs>
  12963. 800c23e: f3c0 300f ubfx r0, r0, #12, #16
  12964. 800c242: 2805 cmp r0, #5
  12965. 800c244: d931 bls.n 800c2aa <tcp_parseopt+0x7a>
  12966. max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
  12967. 800c246: 682b ldr r3, [r5, #0]
  12968. 800c248: 8998 ldrh r0, [r3, #12]
  12969. 800c24a: f7fd ffd3 bl 800a1f4 <lwip_ntohs>
  12970. 800c24e: 0b00 lsrs r0, r0, #12
  12971. 800c250: 1f41 subs r1, r0, #5
  12972. 800c252: 0089 lsls r1, r1, #2
  12973. u8_t *opts, opt;
  12974. #if LWIP_TCP_TIMESTAMPS
  12975. u32_t tsval;
  12976. #endif
  12977. opts = (u8_t *)tcphdr + TCP_HLEN;
  12978. 800c254: 3414 adds r4, #20
  12979. /* Parse the TCP MSS option, if present. */
  12980. if(TCPH_HDRLEN(tcphdr) > 0x5) {
  12981. max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
  12982. 800c256: b289 uxth r1, r1
  12983. for (c = 0; c < max_c; ) {
  12984. 800c258: 2300 movs r3, #0
  12985. return;
  12986. }
  12987. /* An MSS option with the right option length. */
  12988. mss = (opts[c + 2] << 8) | opts[c + 3];
  12989. /* Limit the mss to the configured TCP_MSS and prevent division by zero */
  12990. pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss;
  12991. 800c25a: f240 50b3 movw r0, #1459 ; 0x5b3
  12992. 800c25e: f240 55b4 movw r5, #1460 ; 0x5b4
  12993. opts = (u8_t *)tcphdr + TCP_HLEN;
  12994. /* Parse the TCP MSS option, if present. */
  12995. if(TCPH_HDRLEN(tcphdr) > 0x5) {
  12996. max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
  12997. for (c = 0; c < max_c; ) {
  12998. 800c262: e020 b.n 800c2a6 <tcp_parseopt+0x76>
  12999. opt = opts[c];
  13000. switch (opt) {
  13001. 800c264: 5ce2 ldrb r2, [r4, r3]
  13002. 800c266: 2a01 cmp r2, #1
  13003. 800c268: d005 beq.n 800c276 <tcp_parseopt+0x46>
  13004. 800c26a: d31e bcc.n 800c2aa <tcp_parseopt+0x7a>
  13005. 800c26c: 2a02 cmp r2, #2
  13006. 800c26e: eb04 0203 add.w r2, r4, r3
  13007. 800c272: d114 bne.n 800c29e <tcp_parseopt+0x6e>
  13008. 800c274: e001 b.n 800c27a <tcp_parseopt+0x4a>
  13009. /* End of options. */
  13010. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: EOL\n"));
  13011. return;
  13012. case 0x01:
  13013. /* NOP option. */
  13014. ++c;
  13015. 800c276: 3301 adds r3, #1
  13016. 800c278: e014 b.n 800c2a4 <tcp_parseopt+0x74>
  13017. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: NOP\n"));
  13018. break;
  13019. case 0x02:
  13020. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: MSS\n"));
  13021. if (opts[c + 1] != 0x04 || c + 0x04 > max_c) {
  13022. 800c27a: 7857 ldrb r7, [r2, #1]
  13023. 800c27c: 2f04 cmp r7, #4
  13024. 800c27e: d114 bne.n 800c2aa <tcp_parseopt+0x7a>
  13025. 800c280: 1cdf adds r7, r3, #3
  13026. 800c282: 428f cmp r7, r1
  13027. 800c284: da11 bge.n 800c2aa <tcp_parseopt+0x7a>
  13028. /* Bad length */
  13029. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n"));
  13030. return;
  13031. }
  13032. /* An MSS option with the right option length. */
  13033. mss = (opts[c + 2] << 8) | opts[c + 3];
  13034. 800c286: 7897 ldrb r7, [r2, #2]
  13035. 800c288: 78d2 ldrb r2, [r2, #3]
  13036. 800c28a: ea42 2207 orr.w r2, r2, r7, lsl #8
  13037. /* Limit the mss to the configured TCP_MSS and prevent division by zero */
  13038. pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss;
  13039. 800c28e: 1e57 subs r7, r2, #1
  13040. 800c290: b2bf uxth r7, r7
  13041. 800c292: 4287 cmp r7, r0
  13042. 800c294: bf88 it hi
  13043. 800c296: 462a movhi r2, r5
  13044. 800c298: 86f2 strh r2, [r6, #54] ; 0x36
  13045. /* Advance to next option */
  13046. c += 0x04;
  13047. 800c29a: 3304 adds r3, #4
  13048. 800c29c: e002 b.n 800c2a4 <tcp_parseopt+0x74>
  13049. c += 0x0A;
  13050. break;
  13051. #endif
  13052. default:
  13053. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: other\n"));
  13054. if (opts[c + 1] == 0) {
  13055. 800c29e: 7852 ldrb r2, [r2, #1]
  13056. 800c2a0: b11a cbz r2, 800c2aa <tcp_parseopt+0x7a>
  13057. and we don't process them further. */
  13058. return;
  13059. }
  13060. /* All other options have a length field, so that we easily
  13061. can skip past them. */
  13062. c += opts[c + 1];
  13063. 800c2a2: 18d3 adds r3, r2, r3
  13064. 800c2a4: b29b uxth r3, r3
  13065. opts = (u8_t *)tcphdr + TCP_HLEN;
  13066. /* Parse the TCP MSS option, if present. */
  13067. if(TCPH_HDRLEN(tcphdr) > 0x5) {
  13068. max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
  13069. for (c = 0; c < max_c; ) {
  13070. 800c2a6: 428b cmp r3, r1
  13071. 800c2a8: d3dc bcc.n 800c264 <tcp_parseopt+0x34>
  13072. 800c2aa: bdf8 pop {r3, r4, r5, r6, r7, pc}
  13073. 800c2ac: 20006b80 .word 0x20006b80
  13074. 0800c2b0 <tcp_receive>:
  13075. *
  13076. * Called from tcp_process().
  13077. */
  13078. static void
  13079. tcp_receive(struct tcp_pcb *pcb)
  13080. {
  13081. 800c2b0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  13082. u16_t ooseq_qlen;
  13083. #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
  13084. LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
  13085. if (flags & TCP_ACK) {
  13086. 800c2b4: 4ba0 ldr r3, [pc, #640] ; (800c538 <tcp_receive+0x288>)
  13087. 800c2b6: 781b ldrb r3, [r3, #0]
  13088. 800c2b8: f003 0310 and.w r3, r3, #16
  13089. 800c2bc: b2db uxtb r3, r3
  13090. *
  13091. * Called from tcp_process().
  13092. */
  13093. static void
  13094. tcp_receive(struct tcp_pcb *pcb)
  13095. {
  13096. 800c2be: 4604 mov r4, r0
  13097. u16_t ooseq_qlen;
  13098. #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
  13099. LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
  13100. if (flags & TCP_ACK) {
  13101. 800c2c0: 2b00 cmp r3, #0
  13102. 800c2c2: f000 816b beq.w 800c59c <tcp_receive+0x2ec>
  13103. right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
  13104. /* Update window. */
  13105. if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
  13106. 800c2c6: 4a9d ldr r2, [pc, #628] ; (800c53c <tcp_receive+0x28c>)
  13107. 800c2c8: 6d43 ldr r3, [r0, #84] ; 0x54
  13108. 800c2ca: 6812 ldr r2, [r2, #0]
  13109. #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
  13110. LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
  13111. if (flags & TCP_ACK) {
  13112. right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
  13113. 800c2cc: f8b0 5060 ldrh.w r5, [r0, #96] ; 0x60
  13114. 800c2d0: 6d81 ldr r1, [r0, #88] ; 0x58
  13115. /* Update window. */
  13116. if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
  13117. 800c2d2: 1a98 subs r0, r3, r2
  13118. 800c2d4: 2800 cmp r0, #0
  13119. 800c2d6: db0e blt.n 800c2f6 <tcp_receive+0x46>
  13120. 800c2d8: 4293 cmp r3, r2
  13121. 800c2da: 4b99 ldr r3, [pc, #612] ; (800c540 <tcp_receive+0x290>)
  13122. 800c2dc: d103 bne.n 800c2e6 <tcp_receive+0x36>
  13123. (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
  13124. 800c2de: 6818 ldr r0, [r3, #0]
  13125. 800c2e0: 1a08 subs r0, r1, r0
  13126. 800c2e2: 2800 cmp r0, #0
  13127. 800c2e4: db07 blt.n 800c2f6 <tcp_receive+0x46>
  13128. 800c2e6: 681b ldr r3, [r3, #0]
  13129. 800c2e8: 4299 cmp r1, r3
  13130. 800c2ea: d11f bne.n 800c32c <tcp_receive+0x7c>
  13131. (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
  13132. 800c2ec: 4b95 ldr r3, [pc, #596] ; (800c544 <tcp_receive+0x294>)
  13133. 800c2ee: 681b ldr r3, [r3, #0]
  13134. 800c2f0: 89db ldrh r3, [r3, #14]
  13135. 800c2f2: 42ab cmp r3, r5
  13136. 800c2f4: d91a bls.n 800c32c <tcp_receive+0x7c>
  13137. pcb->snd_wnd = tcphdr->wnd;
  13138. 800c2f6: 4b93 ldr r3, [pc, #588] ; (800c544 <tcp_receive+0x294>)
  13139. /* keep track of the biggest window announced by the remote host to calculate
  13140. the maximum segment size */
  13141. if (pcb->snd_wnd_max < tcphdr->wnd) {
  13142. 800c2f8: f8b4 6062 ldrh.w r6, [r4, #98] ; 0x62
  13143. /* Update window. */
  13144. if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
  13145. (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
  13146. (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
  13147. pcb->snd_wnd = tcphdr->wnd;
  13148. 800c2fc: 681b ldr r3, [r3, #0]
  13149. 800c2fe: 89d8 ldrh r0, [r3, #14]
  13150. /* keep track of the biggest window announced by the remote host to calculate
  13151. the maximum segment size */
  13152. if (pcb->snd_wnd_max < tcphdr->wnd) {
  13153. pcb->snd_wnd_max = tcphdr->wnd;
  13154. }
  13155. pcb->snd_wl1 = seqno;
  13156. 800c300: 6562 str r2, [r4, #84] ; 0x54
  13157. pcb->snd_wl2 = ackno;
  13158. 800c302: 4a8f ldr r2, [pc, #572] ; (800c540 <tcp_receive+0x290>)
  13159. /* Update window. */
  13160. if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
  13161. (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
  13162. (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
  13163. pcb->snd_wnd = tcphdr->wnd;
  13164. 800c304: f8a4 0060 strh.w r0, [r4, #96] ; 0x60
  13165. the maximum segment size */
  13166. if (pcb->snd_wnd_max < tcphdr->wnd) {
  13167. pcb->snd_wnd_max = tcphdr->wnd;
  13168. }
  13169. pcb->snd_wl1 = seqno;
  13170. pcb->snd_wl2 = ackno;
  13171. 800c308: 6812 ldr r2, [r2, #0]
  13172. (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
  13173. (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
  13174. pcb->snd_wnd = tcphdr->wnd;
  13175. /* keep track of the biggest window announced by the remote host to calculate
  13176. the maximum segment size */
  13177. if (pcb->snd_wnd_max < tcphdr->wnd) {
  13178. 800c30a: 4286 cmp r6, r0
  13179. pcb->snd_wnd_max = tcphdr->wnd;
  13180. }
  13181. pcb->snd_wl1 = seqno;
  13182. pcb->snd_wl2 = ackno;
  13183. 800c30c: 65a2 str r2, [r4, #88] ; 0x58
  13184. (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
  13185. pcb->snd_wnd = tcphdr->wnd;
  13186. /* keep track of the biggest window announced by the remote host to calculate
  13187. the maximum segment size */
  13188. if (pcb->snd_wnd_max < tcphdr->wnd) {
  13189. pcb->snd_wnd_max = tcphdr->wnd;
  13190. 800c30e: bf38 it cc
  13191. 800c310: f8a4 0062 strhcc.w r0, [r4, #98] ; 0x62
  13192. 800c314: f894 2091 ldrb.w r2, [r4, #145] ; 0x91
  13193. }
  13194. pcb->snd_wl1 = seqno;
  13195. pcb->snd_wl2 = ackno;
  13196. if (pcb->snd_wnd == 0) {
  13197. 800c318: b920 cbnz r0, 800c324 <tcp_receive+0x74>
  13198. if (pcb->persist_backoff == 0) {
  13199. 800c31a: b93a cbnz r2, 800c32c <tcp_receive+0x7c>
  13200. /* start persist timer */
  13201. pcb->persist_cnt = 0;
  13202. 800c31c: f884 0090 strb.w r0, [r4, #144] ; 0x90
  13203. pcb->persist_backoff = 1;
  13204. 800c320: 2301 movs r3, #1
  13205. 800c322: e001 b.n 800c328 <tcp_receive+0x78>
  13206. }
  13207. } else if (pcb->persist_backoff > 0) {
  13208. 800c324: b112 cbz r2, 800c32c <tcp_receive+0x7c>
  13209. /* stop persist timer */
  13210. pcb->persist_backoff = 0;
  13211. 800c326: 2300 movs r3, #0
  13212. 800c328: f884 3091 strb.w r3, [r4, #145] ; 0x91
  13213. * If it only passes 1, should reset dupack counter
  13214. *
  13215. */
  13216. /* Clause 1 */
  13217. if (TCP_SEQ_LEQ(ackno, pcb->lastack)) {
  13218. 800c32c: 4b84 ldr r3, [pc, #528] ; (800c540 <tcp_receive+0x290>)
  13219. 800c32e: 6ca2 ldr r2, [r4, #72] ; 0x48
  13220. 800c330: 681b ldr r3, [r3, #0]
  13221. 800c332: 1a98 subs r0, r3, r2
  13222. 800c334: 2800 cmp r0, #0
  13223. 800c336: dc34 bgt.n 800c3a2 <tcp_receive+0xf2>
  13224. pcb->acked = 0;
  13225. 800c338: 2000 movs r0, #0
  13226. 800c33a: f8a4 0064 strh.w r0, [r4, #100] ; 0x64
  13227. /* Clause 2 */
  13228. if (tcplen == 0) {
  13229. 800c33e: 4882 ldr r0, [pc, #520] ; (800c548 <tcp_receive+0x298>)
  13230. 800c340: 8800 ldrh r0, [r0, #0]
  13231. 800c342: 2800 cmp r0, #0
  13232. 800c344: f040 81f4 bne.w 800c730 <tcp_receive+0x480>
  13233. /* Clause 3 */
  13234. if (pcb->snd_wl2 + pcb->snd_wnd == right_wnd_edge){
  13235. 800c348: f8b4 6060 ldrh.w r6, [r4, #96] ; 0x60
  13236. 800c34c: 6da0 ldr r0, [r4, #88] ; 0x58
  13237. #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
  13238. LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
  13239. if (flags & TCP_ACK) {
  13240. right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
  13241. 800c34e: 1869 adds r1, r5, r1
  13242. if (TCP_SEQ_LEQ(ackno, pcb->lastack)) {
  13243. pcb->acked = 0;
  13244. /* Clause 2 */
  13245. if (tcplen == 0) {
  13246. /* Clause 3 */
  13247. if (pcb->snd_wl2 + pcb->snd_wnd == right_wnd_edge){
  13248. 800c350: 1830 adds r0, r6, r0
  13249. 800c352: 4288 cmp r0, r1
  13250. 800c354: f040 81ec bne.w 800c730 <tcp_receive+0x480>
  13251. /* Clause 4 */
  13252. if (pcb->rtime >= 0) {
  13253. 800c358: f9b4 1034 ldrsh.w r1, [r4, #52] ; 0x34
  13254. 800c35c: 2900 cmp r1, #0
  13255. 800c35e: f2c0 81e7 blt.w 800c730 <tcp_receive+0x480>
  13256. /* Clause 5 */
  13257. if (pcb->lastack == ackno) {
  13258. 800c362: 429a cmp r2, r3
  13259. 800c364: f040 81e4 bne.w 800c730 <tcp_receive+0x480>
  13260. found_dupack = 1;
  13261. if ((u8_t)(pcb->dupacks + 1) > pcb->dupacks) {
  13262. 800c368: f894 2047 ldrb.w r2, [r4, #71] ; 0x47
  13263. 800c36c: 1c53 adds r3, r2, #1
  13264. 800c36e: b2db uxtb r3, r3
  13265. 800c370: 4293 cmp r3, r2
  13266. ++pcb->dupacks;
  13267. 800c372: bf88 it hi
  13268. 800c374: f884 3047 strbhi.w r3, [r4, #71] ; 0x47
  13269. }
  13270. if (pcb->dupacks > 3) {
  13271. 800c378: f894 3047 ldrb.w r3, [r4, #71] ; 0x47
  13272. 800c37c: 2b03 cmp r3, #3
  13273. 800c37e: d90a bls.n 800c396 <tcp_receive+0xe6>
  13274. /* Inflate the congestion window, but not if it means that
  13275. the value overflows. */
  13276. if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
  13277. 800c380: f8b4 204c ldrh.w r2, [r4, #76] ; 0x4c
  13278. 800c384: 8ee3 ldrh r3, [r4, #54] ; 0x36
  13279. 800c386: 18d3 adds r3, r2, r3
  13280. 800c388: b29b uxth r3, r3
  13281. 800c38a: 4293 cmp r3, r2
  13282. 800c38c: f240 80b2 bls.w 800c4f4 <tcp_receive+0x244>
  13283. pcb->cwnd += pcb->mss;
  13284. 800c390: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
  13285. 800c394: e0ae b.n 800c4f4 <tcp_receive+0x244>
  13286. }
  13287. } else if (pcb->dupacks == 3) {
  13288. 800c396: f040 80ad bne.w 800c4f4 <tcp_receive+0x244>
  13289. /* Do fast retransmit */
  13290. tcp_rexmit_fast(pcb);
  13291. 800c39a: 4620 mov r0, r4
  13292. 800c39c: f001 fb13 bl 800d9c6 <tcp_rexmit_fast>
  13293. 800c3a0: e0a8 b.n 800c4f4 <tcp_receive+0x244>
  13294. /* If Clause (1) or more is true, but not a duplicate ack, reset
  13295. * count of consecutive duplicate acks */
  13296. if (!found_dupack) {
  13297. pcb->dupacks = 0;
  13298. }
  13299. } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)){
  13300. 800c3a2: 43d1 mvns r1, r2
  13301. 800c3a4: 42d9 cmn r1, r3
  13302. 800c3a6: d47e bmi.n 800c4a6 <tcp_receive+0x1f6>
  13303. 800c3a8: 6d21 ldr r1, [r4, #80] ; 0x50
  13304. 800c3aa: 1a59 subs r1, r3, r1
  13305. 800c3ac: 2900 cmp r1, #0
  13306. 800c3ae: dc7a bgt.n 800c4a6 <tcp_receive+0x1f6>
  13307. /* We come here when the ACK acknowledges new data. */
  13308. /* Reset the "IN Fast Retransmit" flag, since we are no longer
  13309. in fast retransmit. Also reset the congestion window to the
  13310. slow start threshold. */
  13311. if (pcb->flags & TF_INFR) {
  13312. 800c3b0: 7fa1 ldrb r1, [r4, #30]
  13313. 800c3b2: f001 0004 and.w r0, r1, #4
  13314. 800c3b6: b2c0 uxtb r0, r0
  13315. 800c3b8: b130 cbz r0, 800c3c8 <tcp_receive+0x118>
  13316. pcb->flags &= ~TF_INFR;
  13317. 800c3ba: f021 0104 bic.w r1, r1, #4
  13318. 800c3be: 77a1 strb r1, [r4, #30]
  13319. pcb->cwnd = pcb->ssthresh;
  13320. 800c3c0: f8b4 104e ldrh.w r1, [r4, #78] ; 0x4e
  13321. 800c3c4: f8a4 104c strh.w r1, [r4, #76] ; 0x4c
  13322. /* Reset the number of retransmissions. */
  13323. pcb->nrtx = 0;
  13324. /* Reset the retransmission time-out. */
  13325. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13326. 800c3c8: f9b4 5040 ldrsh.w r5, [r4, #64] ; 0x40
  13327. 800c3cc: f8b4 0042 ldrh.w r0, [r4, #66] ; 0x42
  13328. pcb->snd_buf += pcb->acked;
  13329. /* Reset the fast retransmit variables. */
  13330. pcb->dupacks = 0;
  13331. pcb->lastack = ackno;
  13332. 800c3d0: 64a3 str r3, [r4, #72] ; 0x48
  13333. /* Reset the number of retransmissions. */
  13334. pcb->nrtx = 0;
  13335. /* Reset the retransmission time-out. */
  13336. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13337. 800c3d2: eb00 00e5 add.w r0, r0, r5, asr #3
  13338. /* Update the send buffer space. Diff between the two can never exceed 64K? */
  13339. pcb->acked = (u16_t)(ackno - pcb->lastack);
  13340. 800c3d6: 1a9a subs r2, r3, r2
  13341. /* Reset the number of retransmissions. */
  13342. pcb->nrtx = 0;
  13343. /* Reset the retransmission time-out. */
  13344. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13345. 800c3d8: f8a4 0044 strh.w r0, [r4, #68] ; 0x44
  13346. pcb->dupacks = 0;
  13347. pcb->lastack = ackno;
  13348. /* Update the congestion control variables (cwnd and
  13349. ssthresh). */
  13350. if (pcb->state >= ESTABLISHED) {
  13351. 800c3dc: 7e23 ldrb r3, [r4, #24]
  13352. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13353. /* Update the send buffer space. Diff between the two can never exceed 64K? */
  13354. pcb->acked = (u16_t)(ackno - pcb->lastack);
  13355. pcb->snd_buf += pcb->acked;
  13356. 800c3de: f8b4 0066 ldrh.w r0, [r4, #102] ; 0x66
  13357. /* Reset the retransmission time-out. */
  13358. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13359. /* Update the send buffer space. Diff between the two can never exceed 64K? */
  13360. pcb->acked = (u16_t)(ackno - pcb->lastack);
  13361. 800c3e2: f8a4 2064 strh.w r2, [r4, #100] ; 0x64
  13362. pcb->flags &= ~TF_INFR;
  13363. pcb->cwnd = pcb->ssthresh;
  13364. }
  13365. /* Reset the number of retransmissions. */
  13366. pcb->nrtx = 0;
  13367. 800c3e6: 2100 movs r1, #0
  13368. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13369. /* Update the send buffer space. Diff between the two can never exceed 64K? */
  13370. pcb->acked = (u16_t)(ackno - pcb->lastack);
  13371. pcb->snd_buf += pcb->acked;
  13372. 800c3e8: 1812 adds r2, r2, r0
  13373. pcb->dupacks = 0;
  13374. pcb->lastack = ackno;
  13375. /* Update the congestion control variables (cwnd and
  13376. ssthresh). */
  13377. if (pcb->state >= ESTABLISHED) {
  13378. 800c3ea: 2b03 cmp r3, #3
  13379. pcb->flags &= ~TF_INFR;
  13380. pcb->cwnd = pcb->ssthresh;
  13381. }
  13382. /* Reset the number of retransmissions. */
  13383. pcb->nrtx = 0;
  13384. 800c3ec: f884 1046 strb.w r1, [r4, #70] ; 0x46
  13385. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13386. /* Update the send buffer space. Diff between the two can never exceed 64K? */
  13387. pcb->acked = (u16_t)(ackno - pcb->lastack);
  13388. pcb->snd_buf += pcb->acked;
  13389. 800c3f0: f8a4 2066 strh.w r2, [r4, #102] ; 0x66
  13390. /* Reset the fast retransmit variables. */
  13391. pcb->dupacks = 0;
  13392. 800c3f4: f884 1047 strb.w r1, [r4, #71] ; 0x47
  13393. pcb->lastack = ackno;
  13394. /* Update the congestion control variables (cwnd and
  13395. ssthresh). */
  13396. if (pcb->state >= ESTABLISHED) {
  13397. 800c3f8: d931 bls.n 800c45e <tcp_receive+0x1ae>
  13398. if (pcb->cwnd < pcb->ssthresh) {
  13399. 800c3fa: f8b4 204e ldrh.w r2, [r4, #78] ; 0x4e
  13400. 800c3fe: f8b4 304c ldrh.w r3, [r4, #76] ; 0x4c
  13401. 800c402: 429a cmp r2, r3
  13402. if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
  13403. 800c404: 8ee2 ldrh r2, [r4, #54] ; 0x36
  13404. pcb->lastack = ackno;
  13405. /* Update the congestion control variables (cwnd and
  13406. ssthresh). */
  13407. if (pcb->state >= ESTABLISHED) {
  13408. if (pcb->cwnd < pcb->ssthresh) {
  13409. 800c406: d900 bls.n 800c40a <tcp_receive+0x15a>
  13410. 800c408: e002 b.n 800c410 <tcp_receive+0x160>
  13411. if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
  13412. pcb->cwnd += pcb->mss;
  13413. }
  13414. LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %"U16_F"\n", pcb->cwnd));
  13415. } else {
  13416. u16_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd);
  13417. 800c40a: 4352 muls r2, r2
  13418. 800c40c: fb92 f2f3 sdiv r2, r2, r3
  13419. 800c410: 189a adds r2, r3, r2
  13420. 800c412: b292 uxth r2, r2
  13421. if (new_cwnd > pcb->cwnd) {
  13422. 800c414: 429a cmp r2, r3
  13423. 800c416: d922 bls.n 800c45e <tcp_receive+0x1ae>
  13424. pcb->cwnd = new_cwnd;
  13425. 800c418: f8a4 204c strh.w r2, [r4, #76] ; 0x4c
  13426. 800c41c: e01f b.n 800c45e <tcp_receive+0x1ae>
  13427. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unacked\n",
  13428. ntohl(pcb->unacked->tcphdr->seqno),
  13429. ntohl(pcb->unacked->tcphdr->seqno) +
  13430. TCP_TCPLEN(pcb->unacked)));
  13431. next = pcb->unacked;
  13432. 800c41e: 6f25 ldr r5, [r4, #112] ; 0x70
  13433. pcb->unacked = pcb->unacked->next;
  13434. 800c420: 682b ldr r3, [r5, #0]
  13435. LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
  13436. LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
  13437. 800c422: 6868 ldr r0, [r5, #4]
  13438. ntohl(pcb->unacked->tcphdr->seqno),
  13439. ntohl(pcb->unacked->tcphdr->seqno) +
  13440. TCP_TCPLEN(pcb->unacked)));
  13441. next = pcb->unacked;
  13442. pcb->unacked = pcb->unacked->next;
  13443. 800c424: 6723 str r3, [r4, #112] ; 0x70
  13444. LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
  13445. LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
  13446. 800c426: f7ff f925 bl 800b674 <pbuf_clen>
  13447. /* Prevent ACK for FIN to generate a sent event */
  13448. if ((pcb->acked != 0) && ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0)) {
  13449. 800c42a: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
  13450. 800c42e: b153 cbz r3, 800c446 <tcp_receive+0x196>
  13451. 800c430: 68eb ldr r3, [r5, #12]
  13452. 800c432: 8998 ldrh r0, [r3, #12]
  13453. 800c434: f7fd fede bl 800a1f4 <lwip_ntohs>
  13454. 800c438: 07c3 lsls r3, r0, #31
  13455. 800c43a: d504 bpl.n 800c446 <tcp_receive+0x196>
  13456. pcb->acked--;
  13457. 800c43c: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
  13458. 800c440: 3b01 subs r3, #1
  13459. 800c442: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
  13460. }
  13461. pcb->snd_queuelen -= pbuf_clen(next->p);
  13462. 800c446: 6868 ldr r0, [r5, #4]
  13463. 800c448: f8b4 7068 ldrh.w r7, [r4, #104] ; 0x68
  13464. 800c44c: f7ff f912 bl 800b674 <pbuf_clen>
  13465. 800c450: 1a38 subs r0, r7, r0
  13466. 800c452: f8a4 0068 strh.w r0, [r4, #104] ; 0x68
  13467. tcp_seg_free(next);
  13468. 800c456: 4628 mov r0, r5
  13469. 800c458: f7ff fadd bl 800ba16 <tcp_seg_free>
  13470. 800c45c: e000 b.n 800c460 <tcp_receive+0x1b0>
  13471. ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
  13472. /* Remove segment from the unacknowledged list if the incoming
  13473. ACK acknowlegdes them. */
  13474. while (pcb->unacked != NULL &&
  13475. TCP_SEQ_LEQ(ntohl(pcb->unacked->tcphdr->seqno) +
  13476. 800c45e: 4e38 ldr r6, [pc, #224] ; (800c540 <tcp_receive+0x290>)
  13477. pcb->unacked != NULL?
  13478. ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
  13479. /* Remove segment from the unacknowledged list if the incoming
  13480. ACK acknowlegdes them. */
  13481. while (pcb->unacked != NULL &&
  13482. 800c460: 6f23 ldr r3, [r4, #112] ; 0x70
  13483. 800c462: b91b cbnz r3, 800c46c <tcp_receive+0x1bc>
  13484. }
  13485. }
  13486. /* If there's nothing left to acknowledge, stop the retransmit
  13487. timer, otherwise reset it to start again */
  13488. if(pcb->unacked == NULL)
  13489. 800c464: 6f22 ldr r2, [r4, #112] ; 0x70
  13490. 800c466: 2300 movs r3, #0
  13491. 800c468: b9d2 cbnz r2, 800c4a0 <tcp_receive+0x1f0>
  13492. 800c46a: e015 b.n 800c498 <tcp_receive+0x1e8>
  13493. ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
  13494. /* Remove segment from the unacknowledged list if the incoming
  13495. ACK acknowlegdes them. */
  13496. while (pcb->unacked != NULL &&
  13497. TCP_SEQ_LEQ(ntohl(pcb->unacked->tcphdr->seqno) +
  13498. 800c46c: 68db ldr r3, [r3, #12]
  13499. 800c46e: 6858 ldr r0, [r3, #4]
  13500. 800c470: f7fd fec7 bl 800a202 <lwip_ntohl>
  13501. 800c474: 6f23 ldr r3, [r4, #112] ; 0x70
  13502. 800c476: 891d ldrh r5, [r3, #8]
  13503. 800c478: 68db ldr r3, [r3, #12]
  13504. 800c47a: 4607 mov r7, r0
  13505. 800c47c: 8998 ldrh r0, [r3, #12]
  13506. 800c47e: f7fd feb9 bl 800a1f4 <lwip_ntohs>
  13507. 800c482: 6833 ldr r3, [r6, #0]
  13508. 800c484: f010 0003 ands.w r0, r0, #3
  13509. 800c488: bf18 it ne
  13510. 800c48a: 2001 movne r0, #1
  13511. 800c48c: 1afb subs r3, r7, r3
  13512. 800c48e: 1828 adds r0, r5, r0
  13513. 800c490: 181b adds r3, r3, r0
  13514. pcb->unacked != NULL?
  13515. ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
  13516. /* Remove segment from the unacknowledged list if the incoming
  13517. ACK acknowlegdes them. */
  13518. while (pcb->unacked != NULL &&
  13519. 800c492: 2b00 cmp r3, #0
  13520. 800c494: ddc3 ble.n 800c41e <tcp_receive+0x16e>
  13521. 800c496: e7e5 b.n 800c464 <tcp_receive+0x1b4>
  13522. }
  13523. /* If there's nothing left to acknowledge, stop the retransmit
  13524. timer, otherwise reset it to start again */
  13525. if(pcb->unacked == NULL)
  13526. pcb->rtime = -1;
  13527. 800c498: f64f 72ff movw r2, #65535 ; 0xffff
  13528. 800c49c: 86a2 strh r2, [r4, #52] ; 0x34
  13529. 800c49e: e000 b.n 800c4a2 <tcp_receive+0x1f2>
  13530. else
  13531. pcb->rtime = 0;
  13532. 800c4a0: 86a3 strh r3, [r4, #52] ; 0x34
  13533. pcb->polltmr = 0;
  13534. 800c4a2: 77e3 strb r3, [r4, #31]
  13535. 800c4a4: e026 b.n 800c4f4 <tcp_receive+0x244>
  13536. } else {
  13537. /* Fix bug bug #21582: out of sequence ACK, didn't really ack anything */
  13538. pcb->acked = 0;
  13539. 800c4a6: 2300 movs r3, #0
  13540. 800c4a8: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
  13541. 800c4ac: e022 b.n 800c4f4 <tcp_receive+0x244>
  13542. TCP_TCPLEN(pcb->unsent), pcb->snd_nxt)) {
  13543. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unsent\n",
  13544. ntohl(pcb->unsent->tcphdr->seqno), ntohl(pcb->unsent->tcphdr->seqno) +
  13545. TCP_TCPLEN(pcb->unsent)));
  13546. next = pcb->unsent;
  13547. 800c4ae: 6ee5 ldr r5, [r4, #108] ; 0x6c
  13548. pcb->unsent = pcb->unsent->next;
  13549. 800c4b0: 682b ldr r3, [r5, #0]
  13550. 800c4b2: 66e3 str r3, [r4, #108] ; 0x6c
  13551. #if TCP_OVERSIZE
  13552. if (pcb->unsent == NULL) {
  13553. 800c4b4: b90b cbnz r3, 800c4ba <tcp_receive+0x20a>
  13554. pcb->unsent_oversize = 0;
  13555. 800c4b6: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
  13556. }
  13557. #endif /* TCP_OVERSIZE */
  13558. LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
  13559. LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
  13560. 800c4ba: 6868 ldr r0, [r5, #4]
  13561. 800c4bc: f7ff f8da bl 800b674 <pbuf_clen>
  13562. /* Prevent ACK for FIN to generate a sent event */
  13563. if ((pcb->acked != 0) && ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0)) {
  13564. 800c4c0: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
  13565. 800c4c4: b153 cbz r3, 800c4dc <tcp_receive+0x22c>
  13566. 800c4c6: 68eb ldr r3, [r5, #12]
  13567. 800c4c8: 8998 ldrh r0, [r3, #12]
  13568. 800c4ca: f7fd fe93 bl 800a1f4 <lwip_ntohs>
  13569. 800c4ce: 07c7 lsls r7, r0, #31
  13570. 800c4d0: d504 bpl.n 800c4dc <tcp_receive+0x22c>
  13571. pcb->acked--;
  13572. 800c4d2: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
  13573. 800c4d6: 3b01 subs r3, #1
  13574. 800c4d8: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
  13575. }
  13576. pcb->snd_queuelen -= pbuf_clen(next->p);
  13577. 800c4dc: 6868 ldr r0, [r5, #4]
  13578. 800c4de: f8b4 7068 ldrh.w r7, [r4, #104] ; 0x68
  13579. 800c4e2: f7ff f8c7 bl 800b674 <pbuf_clen>
  13580. 800c4e6: 1a38 subs r0, r7, r0
  13581. 800c4e8: f8a4 0068 strh.w r0, [r4, #104] ; 0x68
  13582. tcp_seg_free(next);
  13583. 800c4ec: 4628 mov r0, r5
  13584. 800c4ee: f7ff fa92 bl 800ba16 <tcp_seg_free>
  13585. 800c4f2: e000 b.n 800c4f6 <tcp_receive+0x246>
  13586. strange since an "unsent" segment shouldn't be acked. The
  13587. rationale is that lwIP puts all outstanding segments on the
  13588. ->unsent list after a retransmission, so these segments may
  13589. in fact have been sent once. */
  13590. while (pcb->unsent != NULL &&
  13591. TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
  13592. 800c4f4: 4e12 ldr r6, [pc, #72] ; (800c540 <tcp_receive+0x290>)
  13593. on the list are acknowledged by the ACK. This may seem
  13594. strange since an "unsent" segment shouldn't be acked. The
  13595. rationale is that lwIP puts all outstanding segments on the
  13596. ->unsent list after a retransmission, so these segments may
  13597. in fact have been sent once. */
  13598. while (pcb->unsent != NULL &&
  13599. 800c4f6: 6ee3 ldr r3, [r4, #108] ; 0x6c
  13600. 800c4f8: b913 cbnz r3, 800c500 <tcp_receive+0x250>
  13601. pcb->rttest, pcb->rtseq, ackno));
  13602. /* RTT estimation calculations. This is done by checking if the
  13603. incoming segment acknowledges the segment we use to take a
  13604. round-trip time measurement. */
  13605. if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
  13606. 800c4fa: 6ba3 ldr r3, [r4, #56] ; 0x38
  13607. 800c4fc: bb33 cbnz r3, 800c54c <tcp_receive+0x29c>
  13608. 800c4fe: e04d b.n 800c59c <tcp_receive+0x2ec>
  13609. strange since an "unsent" segment shouldn't be acked. The
  13610. rationale is that lwIP puts all outstanding segments on the
  13611. ->unsent list after a retransmission, so these segments may
  13612. in fact have been sent once. */
  13613. while (pcb->unsent != NULL &&
  13614. TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
  13615. 800c500: 68db ldr r3, [r3, #12]
  13616. 800c502: 6835 ldr r5, [r6, #0]
  13617. 800c504: 6858 ldr r0, [r3, #4]
  13618. 800c506: f7fd fe7c bl 800a202 <lwip_ntohl>
  13619. 800c50a: 6ee3 ldr r3, [r4, #108] ; 0x6c
  13620. 800c50c: 891f ldrh r7, [r3, #8]
  13621. 800c50e: 68db ldr r3, [r3, #12]
  13622. 800c510: 4680 mov r8, r0
  13623. 800c512: 8998 ldrh r0, [r3, #12]
  13624. 800c514: f7fd fe6e bl 800a1f4 <lwip_ntohs>
  13625. 800c518: f010 0003 ands.w r0, r0, #3
  13626. 800c51c: bf18 it ne
  13627. 800c51e: 2001 movne r0, #1
  13628. 800c520: ebc8 0505 rsb r5, r8, r5
  13629. 800c524: 1838 adds r0, r7, r0
  13630. 800c526: 1a2d subs r5, r5, r0
  13631. on the list are acknowledged by the ACK. This may seem
  13632. strange since an "unsent" segment shouldn't be acked. The
  13633. rationale is that lwIP puts all outstanding segments on the
  13634. ->unsent list after a retransmission, so these segments may
  13635. in fact have been sent once. */
  13636. while (pcb->unsent != NULL &&
  13637. 800c528: 2d00 cmp r5, #0
  13638. 800c52a: dbe6 blt.n 800c4fa <tcp_receive+0x24a>
  13639. TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
  13640. 800c52c: 6832 ldr r2, [r6, #0]
  13641. 800c52e: 6d23 ldr r3, [r4, #80] ; 0x50
  13642. 800c530: 1ad3 subs r3, r2, r3
  13643. 800c532: 2b00 cmp r3, #0
  13644. 800c534: ddbb ble.n 800c4ae <tcp_receive+0x1fe>
  13645. 800c536: e7e0 b.n 800c4fa <tcp_receive+0x24a>
  13646. 800c538: 20006b90 .word 0x20006b90
  13647. 800c53c: 20006b84 .word 0x20006b84
  13648. 800c540: 20006b8c .word 0x20006b8c
  13649. 800c544: 20006b80 .word 0x20006b80
  13650. 800c548: 20006b88 .word 0x20006b88
  13651. pcb->rttest, pcb->rtseq, ackno));
  13652. /* RTT estimation calculations. This is done by checking if the
  13653. incoming segment acknowledges the segment we use to take a
  13654. round-trip time measurement. */
  13655. if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
  13656. 800c54c: 497b ldr r1, [pc, #492] ; (800c73c <tcp_receive+0x48c>)
  13657. 800c54e: 6be2 ldr r2, [r4, #60] ; 0x3c
  13658. 800c550: 6809 ldr r1, [r1, #0]
  13659. 800c552: 1a52 subs r2, r2, r1
  13660. 800c554: 2a00 cmp r2, #0
  13661. 800c556: da21 bge.n 800c59c <tcp_receive+0x2ec>
  13662. /* diff between this shouldn't exceed 32K since this are tcp timer ticks
  13663. and a round-trip shouldn't be that long... */
  13664. m = (s16_t)(tcp_ticks - pcb->rttest);
  13665. 800c558: 4a79 ldr r2, [pc, #484] ; (800c740 <tcp_receive+0x490>)
  13666. LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
  13667. m, m * TCP_SLOW_INTERVAL));
  13668. /* This is taken directly from VJs original code in his paper */
  13669. m = m - (pcb->sa >> 3);
  13670. 800c55a: f8b4 1040 ldrh.w r1, [r4, #64] ; 0x40
  13671. incoming segment acknowledges the segment we use to take a
  13672. round-trip time measurement. */
  13673. if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
  13674. /* diff between this shouldn't exceed 32K since this are tcp timer ticks
  13675. and a round-trip shouldn't be that long... */
  13676. m = (s16_t)(tcp_ticks - pcb->rttest);
  13677. 800c55e: 6812 ldr r2, [r2, #0]
  13678. LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
  13679. m, m * TCP_SLOW_INTERVAL));
  13680. /* This is taken directly from VJs original code in his paper */
  13681. m = m - (pcb->sa >> 3);
  13682. 800c560: f341 00cc sbfx r0, r1, #3, #13
  13683. incoming segment acknowledges the segment we use to take a
  13684. round-trip time measurement. */
  13685. if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
  13686. /* diff between this shouldn't exceed 32K since this are tcp timer ticks
  13687. and a round-trip shouldn't be that long... */
  13688. m = (s16_t)(tcp_ticks - pcb->rttest);
  13689. 800c564: 1ad2 subs r2, r2, r3
  13690. LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
  13691. m, m * TCP_SLOW_INTERVAL));
  13692. /* This is taken directly from VJs original code in his paper */
  13693. m = m - (pcb->sa >> 3);
  13694. 800c566: 1a12 subs r2, r2, r0
  13695. 800c568: b292 uxth r2, r2
  13696. 800c56a: b293 uxth r3, r2
  13697. pcb->sa += m;
  13698. 800c56c: 1851 adds r1, r2, r1
  13699. 800c56e: b289 uxth r1, r1
  13700. if (m < 0) {
  13701. 800c570: 0418 lsls r0, r3, #16
  13702. LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
  13703. m, m * TCP_SLOW_INTERVAL));
  13704. /* This is taken directly from VJs original code in his paper */
  13705. m = m - (pcb->sa >> 3);
  13706. pcb->sa += m;
  13707. 800c572: f8a4 1040 strh.w r1, [r4, #64] ; 0x40
  13708. if (m < 0) {
  13709. 800c576: d501 bpl.n 800c57c <tcp_receive+0x2cc>
  13710. m = -m;
  13711. 800c578: 4253 negs r3, r2
  13712. 800c57a: b29b uxth r3, r3
  13713. }
  13714. m = m - (pcb->sv >> 2);
  13715. 800c57c: f8b4 2042 ldrh.w r2, [r4, #66] ; 0x42
  13716. 800c580: f342 008d sbfx r0, r2, #2, #14
  13717. 800c584: 1a12 subs r2, r2, r0
  13718. pcb->sv += m;
  13719. 800c586: 18d3 adds r3, r2, r3
  13720. 800c588: b29b uxth r3, r3
  13721. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13722. 800c58a: f341 01cc sbfx r1, r1, #3, #13
  13723. pcb->sa += m;
  13724. if (m < 0) {
  13725. m = -m;
  13726. }
  13727. m = m - (pcb->sv >> 2);
  13728. pcb->sv += m;
  13729. 800c58e: f8a4 3042 strh.w r3, [r4, #66] ; 0x42
  13730. pcb->rto = (pcb->sa >> 3) + pcb->sv;
  13731. 800c592: 185b adds r3, r3, r1
  13732. 800c594: f8a4 3044 strh.w r3, [r4, #68] ; 0x44
  13733. LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: RTO %"U16_F" (%"U16_F" milliseconds)\n",
  13734. pcb->rto, pcb->rto * TCP_SLOW_INTERVAL));
  13735. pcb->rttest = 0;
  13736. 800c598: 2300 movs r3, #0
  13737. 800c59a: 63a3 str r3, [r4, #56] ; 0x38
  13738. /* If the incoming segment contains data, we must process it
  13739. further unless the pcb already received a FIN.
  13740. (RFC 793, chapeter 3.9, "SEGMENT ARRIVES" in states CLOSE-WAIT, CLOSING,
  13741. LAST-ACK and TIME-WAIT: "Ignore the segment text.") */
  13742. if ((tcplen > 0) && (pcb->state < CLOSE_WAIT)) {
  13743. 800c59c: 4b69 ldr r3, [pc, #420] ; (800c744 <tcp_receive+0x494>)
  13744. 800c59e: 4a6a ldr r2, [pc, #424] ; (800c748 <tcp_receive+0x498>)
  13745. 800c5a0: 8818 ldrh r0, [r3, #0]
  13746. 800c5a2: 2800 cmp r0, #0
  13747. 800c5a4: f000 80b3 beq.w 800c70e <tcp_receive+0x45e>
  13748. 800c5a8: 7e23 ldrb r3, [r4, #24]
  13749. 800c5aa: 2b06 cmp r3, #6
  13750. 800c5ac: f200 80af bhi.w 800c70e <tcp_receive+0x45e>
  13751. this if the sequence number of the incoming segment is less
  13752. than rcv_nxt, and the sequence number plus the length of the
  13753. segment is larger than rcv_nxt. */
  13754. /* if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
  13755. if (TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {*/
  13756. if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)){
  13757. 800c5b0: 6811 ldr r1, [r2, #0]
  13758. 800c5b2: 6aa3 ldr r3, [r4, #40] ; 0x28
  13759. 800c5b4: 43ca mvns r2, r1
  13760. 800c5b6: 42da cmn r2, r3
  13761. 800c5b8: d425 bmi.n 800c606 <tcp_receive+0x356>
  13762. 800c5ba: 1c5a adds r2, r3, #1
  13763. 800c5bc: 1a52 subs r2, r2, r1
  13764. 800c5be: 1a10 subs r0, r2, r0
  13765. 800c5c0: 2800 cmp r0, #0
  13766. 800c5c2: dc20 bgt.n 800c606 <tcp_receive+0x356>
  13767. After we are done with adjusting the pbuf pointers we must
  13768. adjust the ->data pointer in the seg and the segment
  13769. length.*/
  13770. off = pcb->rcv_nxt - seqno;
  13771. 800c5c4: 1a59 subs r1, r3, r1
  13772. p = inseg.p;
  13773. 800c5c6: 4b61 ldr r3, [pc, #388] ; (800c74c <tcp_receive+0x49c>)
  13774. 800c5c8: 6858 ldr r0, [r3, #4]
  13775. LWIP_ASSERT("inseg.p != NULL", inseg.p);
  13776. LWIP_ASSERT("insane offset!", (off < 0x7fff));
  13777. if (inseg.p->len < off) {
  13778. 800c5ca: 8943 ldrh r3, [r0, #10]
  13779. 800c5cc: 428b cmp r3, r1
  13780. 800c5ce: da0a bge.n 800c5e6 <tcp_receive+0x336>
  13781. LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
  13782. new_tot_len = (u16_t)(inseg.p->tot_len - off);
  13783. 800c5d0: 8902 ldrh r2, [r0, #8]
  13784. off -= p->len;
  13785. /* KJM following line changed (with addition of new_tot_len var)
  13786. to fix bug #9076
  13787. inseg.p->tot_len -= p->len; */
  13788. p->tot_len = new_tot_len;
  13789. p->len = 0;
  13790. 800c5d2: 2500 movs r5, #0
  13791. p = inseg.p;
  13792. LWIP_ASSERT("inseg.p != NULL", inseg.p);
  13793. LWIP_ASSERT("insane offset!", (off < 0x7fff));
  13794. if (inseg.p->len < off) {
  13795. LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
  13796. new_tot_len = (u16_t)(inseg.p->tot_len - off);
  13797. 800c5d4: 1a52 subs r2, r2, r1
  13798. while (p->len < off) {
  13799. 800c5d6: e003 b.n 800c5e0 <tcp_receive+0x330>
  13800. off -= p->len;
  13801. /* KJM following line changed (with addition of new_tot_len var)
  13802. to fix bug #9076
  13803. inseg.p->tot_len -= p->len; */
  13804. p->tot_len = new_tot_len;
  13805. 800c5d8: 8102 strh r2, [r0, #8]
  13806. p->len = 0;
  13807. 800c5da: 8145 strh r5, [r0, #10]
  13808. p = p->next;
  13809. 800c5dc: 6800 ldr r0, [r0, #0]
  13810. LWIP_ASSERT("insane offset!", (off < 0x7fff));
  13811. if (inseg.p->len < off) {
  13812. LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
  13813. new_tot_len = (u16_t)(inseg.p->tot_len - off);
  13814. while (p->len < off) {
  13815. off -= p->len;
  13816. 800c5de: 1ac9 subs r1, r1, r3
  13817. LWIP_ASSERT("inseg.p != NULL", inseg.p);
  13818. LWIP_ASSERT("insane offset!", (off < 0x7fff));
  13819. if (inseg.p->len < off) {
  13820. LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
  13821. new_tot_len = (u16_t)(inseg.p->tot_len - off);
  13822. while (p->len < off) {
  13823. 800c5e0: 8943 ldrh r3, [r0, #10]
  13824. 800c5e2: 428b cmp r3, r1
  13825. 800c5e4: dbf8 blt.n 800c5d8 <tcp_receive+0x328>
  13826. if(pbuf_header(p, (s16_t)-off)) {
  13827. /* Do we need to cope with this failing? Assert for now */
  13828. LWIP_ASSERT("pbuf_header failed", 0);
  13829. }
  13830. } else {
  13831. if(pbuf_header(inseg.p, (s16_t)-off)) {
  13832. 800c5e6: 4249 negs r1, r1
  13833. 800c5e8: b209 sxth r1, r1
  13834. 800c5ea: f7fe ff40 bl 800b46e <pbuf_header>
  13835. /* Do we need to cope with this failing? Assert for now */
  13836. LWIP_ASSERT("pbuf_header failed", 0);
  13837. }
  13838. }
  13839. inseg.len -= (u16_t)(pcb->rcv_nxt - seqno);
  13840. 800c5ee: 4a57 ldr r2, [pc, #348] ; (800c74c <tcp_receive+0x49c>)
  13841. 800c5f0: 4955 ldr r1, [pc, #340] ; (800c748 <tcp_receive+0x498>)
  13842. 800c5f2: 8915 ldrh r5, [r2, #8]
  13843. 800c5f4: 6808 ldr r0, [r1, #0]
  13844. 800c5f6: 6aa3 ldr r3, [r4, #40] ; 0x28
  13845. 800c5f8: 1940 adds r0, r0, r5
  13846. 800c5fa: 1ac0 subs r0, r0, r3
  13847. 800c5fc: 8110 strh r0, [r2, #8]
  13848. inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
  13849. 800c5fe: 68d2 ldr r2, [r2, #12]
  13850. 800c600: 600b str r3, [r1, #0]
  13851. 800c602: 6053 str r3, [r2, #4]
  13852. 800c604: e006 b.n 800c614 <tcp_receive+0x364>
  13853. }
  13854. else {
  13855. if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
  13856. 800c606: 1ac9 subs r1, r1, r3
  13857. 800c608: 2900 cmp r1, #0
  13858. 800c60a: da03 bge.n 800c614 <tcp_receive+0x364>
  13859. /* the whole segment is < rcv_nxt */
  13860. /* must be a duplicate of a packet that has already been correctly handled */
  13861. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: duplicate seqno %"U32_F"\n", seqno));
  13862. tcp_ack_now(pcb);
  13863. 800c60c: 7fa3 ldrb r3, [r4, #30]
  13864. 800c60e: f043 0302 orr.w r3, r3, #2
  13865. 800c612: 77a3 strb r3, [r4, #30]
  13866. }
  13867. /* The sequence number must be within the window (above rcv_nxt
  13868. and below rcv_nxt + rcv_wnd) in order to be further
  13869. processed. */
  13870. if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,
  13871. 800c614: 4b4c ldr r3, [pc, #304] ; (800c748 <tcp_receive+0x498>)
  13872. 800c616: 6aa2 ldr r2, [r4, #40] ; 0x28
  13873. 800c618: 681b ldr r3, [r3, #0]
  13874. 800c61a: 1a99 subs r1, r3, r2
  13875. 800c61c: 2900 cmp r1, #0
  13876. 800c61e: db71 blt.n 800c704 <tcp_receive+0x454>
  13877. 800c620: 1c59 adds r1, r3, #1
  13878. 800c622: 8da0 ldrh r0, [r4, #44] ; 0x2c
  13879. 800c624: 1a89 subs r1, r1, r2
  13880. 800c626: 1a09 subs r1, r1, r0
  13881. 800c628: 2900 cmp r1, #0
  13882. 800c62a: dc6b bgt.n 800c704 <tcp_receive+0x454>
  13883. pcb->rcv_nxt + pcb->rcv_wnd - 1)){
  13884. if (pcb->rcv_nxt == seqno) {
  13885. 800c62c: 429a cmp r2, r3
  13886. 800c62e: d169 bne.n 800c704 <tcp_receive+0x454>
  13887. /* The incoming segment is the next in sequence. We check if
  13888. we have to trim the end of the segment and update rcv_nxt
  13889. and pass the data to the application. */
  13890. tcplen = TCP_TCPLEN(&inseg);
  13891. 800c630: 4d46 ldr r5, [pc, #280] ; (800c74c <tcp_receive+0x49c>)
  13892. 800c632: 68eb ldr r3, [r5, #12]
  13893. 800c634: 892e ldrh r6, [r5, #8]
  13894. 800c636: 8998 ldrh r0, [r3, #12]
  13895. 800c638: f7fd fddc bl 800a1f4 <lwip_ntohs>
  13896. 800c63c: f010 0003 ands.w r0, r0, #3
  13897. 800c640: bf18 it ne
  13898. 800c642: 2001 movne r0, #1
  13899. 800c644: 4b3f ldr r3, [pc, #252] ; (800c744 <tcp_receive+0x494>)
  13900. 800c646: 1830 adds r0, r6, r0
  13901. 800c648: b280 uxth r0, r0
  13902. 800c64a: 8018 strh r0, [r3, #0]
  13903. if (tcplen > pcb->rcv_wnd) {
  13904. 800c64c: 8da3 ldrh r3, [r4, #44] ; 0x2c
  13905. 800c64e: 4283 cmp r3, r0
  13906. 800c650: d230 bcs.n 800c6b4 <tcp_receive+0x404>
  13907. LWIP_DEBUGF(TCP_INPUT_DEBUG,
  13908. ("tcp_receive: other end overran receive window"
  13909. "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n",
  13910. seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd));
  13911. if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
  13912. 800c652: 68eb ldr r3, [r5, #12]
  13913. 800c654: 8998 ldrh r0, [r3, #12]
  13914. 800c656: f7fd fdcd bl 800a1f4 <lwip_ntohs>
  13915. 800c65a: 07c0 lsls r0, r0, #31
  13916. 800c65c: d50c bpl.n 800c678 <tcp_receive+0x3c8>
  13917. /* Must remove the FIN from the header as we're trimming
  13918. * that byte of sequence-space from the packet */
  13919. TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) &~ TCP_FIN);
  13920. 800c65e: 68ed ldr r5, [r5, #12]
  13921. 800c660: 89ae ldrh r6, [r5, #12]
  13922. 800c662: 4630 mov r0, r6
  13923. 800c664: f7fd fdc6 bl 800a1f4 <lwip_ntohs>
  13924. 800c668: f000 003e and.w r0, r0, #62 ; 0x3e
  13925. 800c66c: f7fd fdbd bl 800a1ea <lwip_htons>
  13926. 800c670: f426 567c bic.w r6, r6, #16128 ; 0x3f00
  13927. 800c674: 4330 orrs r0, r6
  13928. 800c676: 81a8 strh r0, [r5, #12]
  13929. }
  13930. /* Adjust length of segment to fit in the window. */
  13931. inseg.len = pcb->rcv_wnd;
  13932. 800c678: 8da3 ldrh r3, [r4, #44] ; 0x2c
  13933. 800c67a: 4d34 ldr r5, [pc, #208] ; (800c74c <tcp_receive+0x49c>)
  13934. 800c67c: 812b strh r3, [r5, #8]
  13935. if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) {
  13936. 800c67e: 68eb ldr r3, [r5, #12]
  13937. 800c680: 8998 ldrh r0, [r3, #12]
  13938. 800c682: f7fd fdb7 bl 800a1f4 <lwip_ntohs>
  13939. 800c686: f000 0002 and.w r0, r0, #2
  13940. 800c68a: b280 uxth r0, r0
  13941. 800c68c: b110 cbz r0, 800c694 <tcp_receive+0x3e4>
  13942. inseg.len -= 1;
  13943. 800c68e: 892b ldrh r3, [r5, #8]
  13944. 800c690: 3b01 subs r3, #1
  13945. 800c692: 812b strh r3, [r5, #8]
  13946. }
  13947. pbuf_realloc(inseg.p, inseg.len);
  13948. 800c694: 6868 ldr r0, [r5, #4]
  13949. 800c696: 8929 ldrh r1, [r5, #8]
  13950. 800c698: f7fe ff3f bl 800b51a <pbuf_realloc>
  13951. tcplen = TCP_TCPLEN(&inseg);
  13952. 800c69c: 68eb ldr r3, [r5, #12]
  13953. 800c69e: 892e ldrh r6, [r5, #8]
  13954. 800c6a0: 8998 ldrh r0, [r3, #12]
  13955. 800c6a2: f7fd fda7 bl 800a1f4 <lwip_ntohs>
  13956. 800c6a6: f010 0003 ands.w r0, r0, #3
  13957. 800c6aa: bf18 it ne
  13958. 800c6ac: 2001 movne r0, #1
  13959. 800c6ae: 4b25 ldr r3, [pc, #148] ; (800c744 <tcp_receive+0x494>)
  13960. 800c6b0: 1830 adds r0, r6, r0
  13961. 800c6b2: 8018 strh r0, [r3, #0]
  13962. pcb->ooseq = next;
  13963. }
  13964. }
  13965. #endif /* TCP_QUEUE_OOSEQ */
  13966. pcb->rcv_nxt = seqno + tcplen;
  13967. 800c6b4: 4b23 ldr r3, [pc, #140] ; (800c744 <tcp_receive+0x494>)
  13968. 800c6b6: 4a24 ldr r2, [pc, #144] ; (800c748 <tcp_receive+0x498>)
  13969. 800c6b8: 881b ldrh r3, [r3, #0]
  13970. 800c6ba: 6812 ldr r2, [r2, #0]
  13971. 800c6bc: 189a adds r2, r3, r2
  13972. 800c6be: 62a2 str r2, [r4, #40] ; 0x28
  13973. /* Update the receiver's (our) window. */
  13974. LWIP_ASSERT("tcp_receive: tcplen > rcv_wnd\n", pcb->rcv_wnd >= tcplen);
  13975. pcb->rcv_wnd -= tcplen;
  13976. 800c6c0: 8da2 ldrh r2, [r4, #44] ; 0x2c
  13977. 800c6c2: 1ad3 subs r3, r2, r3
  13978. 800c6c4: 85a3 strh r3, [r4, #44] ; 0x2c
  13979. tcp_update_rcv_ann_wnd(pcb);
  13980. 800c6c6: 4620 mov r0, r4
  13981. 800c6c8: f7ff f96e bl 800b9a8 <tcp_update_rcv_ann_wnd>
  13982. chains its data on this pbuf as well.
  13983. If the segment was a FIN, we set the TF_GOT_FIN flag that will
  13984. be used to indicate to the application that the remote side has
  13985. closed its end of the connection. */
  13986. if (inseg.p->tot_len > 0) {
  13987. 800c6cc: 4b1f ldr r3, [pc, #124] ; (800c74c <tcp_receive+0x49c>)
  13988. 800c6ce: 685a ldr r2, [r3, #4]
  13989. 800c6d0: 8911 ldrh r1, [r2, #8]
  13990. 800c6d2: b119 cbz r1, 800c6dc <tcp_receive+0x42c>
  13991. recv_data = inseg.p;
  13992. 800c6d4: 491e ldr r1, [pc, #120] ; (800c750 <tcp_receive+0x4a0>)
  13993. 800c6d6: 600a str r2, [r1, #0]
  13994. /* Since this pbuf now is the responsibility of the
  13995. application, we delete our reference to it so that we won't
  13996. (mistakingly) deallocate it. */
  13997. inseg.p = NULL;
  13998. 800c6d8: 2200 movs r2, #0
  13999. 800c6da: 605a str r2, [r3, #4]
  14000. }
  14001. if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
  14002. 800c6dc: 68db ldr r3, [r3, #12]
  14003. 800c6de: 8998 ldrh r0, [r3, #12]
  14004. 800c6e0: f7fd fd88 bl 800a1f4 <lwip_ntohs>
  14005. 800c6e4: 07c1 lsls r1, r0, #31
  14006. 800c6e6: d504 bpl.n 800c6f2 <tcp_receive+0x442>
  14007. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received FIN.\n"));
  14008. recv_flags |= TF_GOT_FIN;
  14009. 800c6e8: 4b1a ldr r3, [pc, #104] ; (800c754 <tcp_receive+0x4a4>)
  14010. 800c6ea: 781a ldrb r2, [r3, #0]
  14011. 800c6ec: f042 0220 orr.w r2, r2, #32
  14012. 800c6f0: 701a strb r2, [r3, #0]
  14013. }
  14014. #endif /* TCP_QUEUE_OOSEQ */
  14015. /* Acknowledge the segment(s). */
  14016. tcp_ack(pcb);
  14017. 800c6f2: 7fa3 ldrb r3, [r4, #30]
  14018. 800c6f4: 07da lsls r2, r3, #31
  14019. 800c6f6: d502 bpl.n 800c6fe <tcp_receive+0x44e>
  14020. 800c6f8: f023 0301 bic.w r3, r3, #1
  14021. 800c6fc: e013 b.n 800c726 <tcp_receive+0x476>
  14022. 800c6fe: f043 0301 orr.w r3, r3, #1
  14023. 800c702: e012 b.n 800c72a <tcp_receive+0x47a>
  14024. } else {
  14025. /* We get here if the incoming segment is out-of-sequence. */
  14026. tcp_send_empty_ack(pcb);
  14027. 800c704: 4620 mov r0, r4
  14028. TCP_SEQ_GEQ(seqno, pcb->rcv_nxt + pcb->rcv_wnd)) {*/
  14029. if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd-1)){
  14030. tcp_ack_now(pcb);
  14031. }
  14032. }
  14033. }
  14034. 800c706: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
  14035. /* Acknowledge the segment(s). */
  14036. tcp_ack(pcb);
  14037. } else {
  14038. /* We get here if the incoming segment is out-of-sequence. */
  14039. tcp_send_empty_ack(pcb);
  14040. 800c70a: f000 bf72 b.w 800d5f2 <tcp_send_empty_ack>
  14041. } else {
  14042. /* Segments with length 0 is taken care of here. Segments that
  14043. fall out of the window are ACKed. */
  14044. /*if (TCP_SEQ_GT(pcb->rcv_nxt, seqno) ||
  14045. TCP_SEQ_GEQ(seqno, pcb->rcv_nxt + pcb->rcv_wnd)) {*/
  14046. if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd-1)){
  14047. 800c70e: 6812 ldr r2, [r2, #0]
  14048. 800c710: 6aa3 ldr r3, [r4, #40] ; 0x28
  14049. 800c712: 1ad1 subs r1, r2, r3
  14050. 800c714: 2900 cmp r1, #0
  14051. 800c716: db05 blt.n 800c724 <tcp_receive+0x474>
  14052. 800c718: 3201 adds r2, #1
  14053. 800c71a: 8da1 ldrh r1, [r4, #44] ; 0x2c
  14054. 800c71c: 1ad3 subs r3, r2, r3
  14055. 800c71e: 1a5b subs r3, r3, r1
  14056. 800c720: 2b00 cmp r3, #0
  14057. 800c722: dd09 ble.n 800c738 <tcp_receive+0x488>
  14058. tcp_ack_now(pcb);
  14059. 800c724: 7fa3 ldrb r3, [r4, #30]
  14060. 800c726: f043 0302 orr.w r3, r3, #2
  14061. 800c72a: 77a3 strb r3, [r4, #30]
  14062. 800c72c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  14063. }
  14064. }
  14065. /* If Clause (1) or more is true, but not a duplicate ack, reset
  14066. * count of consecutive duplicate acks */
  14067. if (!found_dupack) {
  14068. pcb->dupacks = 0;
  14069. 800c730: 2300 movs r3, #0
  14070. 800c732: f884 3047 strb.w r3, [r4, #71] ; 0x47
  14071. 800c736: e6dd b.n 800c4f4 <tcp_receive+0x244>
  14072. 800c738: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  14073. 800c73c: 20006b8c .word 0x20006b8c
  14074. 800c740: 20008340 .word 0x20008340
  14075. 800c744: 20006b88 .word 0x20006b88
  14076. 800c748: 20006b84 .word 0x20006b84
  14077. 800c74c: 20006b9c .word 0x20006b9c
  14078. 800c750: 20006b94 .word 0x20006b94
  14079. 800c754: 20006b91 .word 0x20006b91
  14080. 0800c758 <tcp_input>:
  14081. * @param p received TCP segment to process (p->payload pointing to the IP header)
  14082. * @param inp network interface on which this segment was received
  14083. */
  14084. void
  14085. tcp_input(struct pbuf *p, struct netif *inp)
  14086. {
  14087. 800c758: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  14088. u8_t hdrlen;
  14089. err_t err;
  14090. PERF_START;
  14091. TCP_STATS_INC(tcp.recv);
  14092. 800c75c: 4f91 ldr r7, [pc, #580] ; (800c9a4 <tcp_input+0x24c>)
  14093. snmp_inc_tcpinsegs();
  14094. iphdr = (struct ip_hdr *)p->payload;
  14095. 800c75e: 4a92 ldr r2, [pc, #584] ; (800c9a8 <tcp_input+0x250>)
  14096. u8_t hdrlen;
  14097. err_t err;
  14098. PERF_START;
  14099. TCP_STATS_INC(tcp.recv);
  14100. 800c760: f8b7 3092 ldrh.w r3, [r7, #146] ; 0x92
  14101. snmp_inc_tcpinsegs();
  14102. iphdr = (struct ip_hdr *)p->payload;
  14103. tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
  14104. 800c764: 4c91 ldr r4, [pc, #580] ; (800c9ac <tcp_input+0x254>)
  14105. u8_t hdrlen;
  14106. err_t err;
  14107. PERF_START;
  14108. TCP_STATS_INC(tcp.recv);
  14109. 800c766: 3301 adds r3, #1
  14110. 800c768: f8a7 3092 strh.w r3, [r7, #146] ; 0x92
  14111. snmp_inc_tcpinsegs();
  14112. iphdr = (struct ip_hdr *)p->payload;
  14113. 800c76c: 6843 ldr r3, [r0, #4]
  14114. 800c76e: 6013 str r3, [r2, #0]
  14115. tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
  14116. 800c770: 781a ldrb r2, [r3, #0]
  14117. 800c772: f002 020f and.w r2, r2, #15
  14118. * @param p received TCP segment to process (p->payload pointing to the IP header)
  14119. * @param inp network interface on which this segment was received
  14120. */
  14121. void
  14122. tcp_input(struct pbuf *p, struct netif *inp)
  14123. {
  14124. 800c776: 4688 mov r8, r1
  14125. #if TCP_INPUT_DEBUG
  14126. tcp_debug_print(tcphdr);
  14127. #endif
  14128. /* remove header from payload */
  14129. if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
  14130. 800c778: 0091 lsls r1, r2, #2
  14131. TCP_STATS_INC(tcp.recv);
  14132. snmp_inc_tcpinsegs();
  14133. iphdr = (struct ip_hdr *)p->payload;
  14134. tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
  14135. 800c77a: eb03 0382 add.w r3, r3, r2, lsl #2
  14136. #if TCP_INPUT_DEBUG
  14137. tcp_debug_print(tcphdr);
  14138. #endif
  14139. /* remove header from payload */
  14140. if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
  14141. 800c77e: 4249 negs r1, r1
  14142. TCP_STATS_INC(tcp.recv);
  14143. snmp_inc_tcpinsegs();
  14144. iphdr = (struct ip_hdr *)p->payload;
  14145. tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
  14146. 800c780: 6023 str r3, [r4, #0]
  14147. * @param p received TCP segment to process (p->payload pointing to the IP header)
  14148. * @param inp network interface on which this segment was received
  14149. */
  14150. void
  14151. tcp_input(struct pbuf *p, struct netif *inp)
  14152. {
  14153. 800c782: 4606 mov r6, r0
  14154. #if TCP_INPUT_DEBUG
  14155. tcp_debug_print(tcphdr);
  14156. #endif
  14157. /* remove header from payload */
  14158. if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
  14159. 800c784: f7fe fe73 bl 800b46e <pbuf_header>
  14160. 800c788: 463b mov r3, r7
  14161. 800c78a: b910 cbnz r0, 800c792 <tcp_input+0x3a>
  14162. 800c78c: 8932 ldrh r2, [r6, #8]
  14163. 800c78e: 2a13 cmp r2, #19
  14164. 800c790: d806 bhi.n 800c7a0 <tcp_input+0x48>
  14165. /* drop short packets */
  14166. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet (%"U16_F" bytes) discarded\n", p->tot_len));
  14167. TCP_STATS_INC(tcp.lenerr);
  14168. 800c792: f8b3 209a ldrh.w r2, [r3, #154] ; 0x9a
  14169. 800c796: 3201 adds r2, #1
  14170. 800c798: f8a3 209a strh.w r2, [r3, #154] ; 0x9a
  14171. goto dropped;
  14172. 800c79c: f000 bc09 b.w 800cfb2 <tcp_input+0x85a>
  14173. }
  14174. /* Don't even process incoming broadcasts/multicasts. */
  14175. if (ip_addr_isbroadcast(&current_iphdr_dest, inp) ||
  14176. 800c7a0: 4d83 ldr r5, [pc, #524] ; (800c9b0 <tcp_input+0x258>)
  14177. 800c7a2: 4641 mov r1, r8
  14178. 800c7a4: 6828 ldr r0, [r5, #0]
  14179. 800c7a6: f001 fdec bl 800e382 <ip4_addr_isbroadcast>
  14180. 800c7aa: b920 cbnz r0, 800c7b6 <tcp_input+0x5e>
  14181. ip_addr_ismulticast(&current_iphdr_dest)) {
  14182. 800c7ac: 682b ldr r3, [r5, #0]
  14183. 800c7ae: f003 03f0 and.w r3, r3, #240 ; 0xf0
  14184. TCP_STATS_INC(tcp.lenerr);
  14185. goto dropped;
  14186. }
  14187. /* Don't even process incoming broadcasts/multicasts. */
  14188. if (ip_addr_isbroadcast(&current_iphdr_dest, inp) ||
  14189. 800c7b2: 2be0 cmp r3, #224 ; 0xe0
  14190. 800c7b4: d106 bne.n 800c7c4 <tcp_input+0x6c>
  14191. ip_addr_ismulticast(&current_iphdr_dest)) {
  14192. TCP_STATS_INC(tcp.proterr);
  14193. 800c7b6: 4b7b ldr r3, [pc, #492] ; (800c9a4 <tcp_input+0x24c>)
  14194. 800c7b8: f8b3 20a0 ldrh.w r2, [r3, #160] ; 0xa0
  14195. 800c7bc: 3201 adds r2, #1
  14196. 800c7be: f8a3 20a0 strh.w r2, [r3, #160] ; 0xa0
  14197. goto dropped;
  14198. 800c7c2: e3f6 b.n 800cfb2 <tcp_input+0x85a>
  14199. }
  14200. #endif
  14201. /* Move the payload pointer in the pbuf so that it points to the
  14202. TCP data instead of the TCP header. */
  14203. hdrlen = TCPH_HDRLEN(tcphdr);
  14204. 800c7c4: 6823 ldr r3, [r4, #0]
  14205. 800c7c6: 8998 ldrh r0, [r3, #12]
  14206. 800c7c8: f7fd fd14 bl 800a1f4 <lwip_ntohs>
  14207. if(pbuf_header(p, -(hdrlen * 4))){
  14208. 800c7cc: f06f 0103 mvn.w r1, #3
  14209. 800c7d0: f3c0 3307 ubfx r3, r0, #12, #8
  14210. 800c7d4: 4359 muls r1, r3
  14211. 800c7d6: 4630 mov r0, r6
  14212. 800c7d8: f7fe fe49 bl 800b46e <pbuf_header>
  14213. 800c7dc: 4683 mov fp, r0
  14214. 800c7de: b128 cbz r0, 800c7ec <tcp_input+0x94>
  14215. /* drop short packets */
  14216. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet\n"));
  14217. TCP_STATS_INC(tcp.lenerr);
  14218. 800c7e0: f8b7 309a ldrh.w r3, [r7, #154] ; 0x9a
  14219. 800c7e4: 3301 adds r3, #1
  14220. 800c7e6: f8a7 309a strh.w r3, [r7, #154] ; 0x9a
  14221. goto dropped;
  14222. 800c7ea: e3e2 b.n 800cfb2 <tcp_input+0x85a>
  14223. }
  14224. /* Convert fields in TCP header to host byte order. */
  14225. tcphdr->src = ntohs(tcphdr->src);
  14226. 800c7ec: 6827 ldr r7, [r4, #0]
  14227. 800c7ee: 8838 ldrh r0, [r7, #0]
  14228. 800c7f0: f7fd fd00 bl 800a1f4 <lwip_ntohs>
  14229. 800c7f4: 8038 strh r0, [r7, #0]
  14230. tcphdr->dest = ntohs(tcphdr->dest);
  14231. 800c7f6: 6827 ldr r7, [r4, #0]
  14232. 800c7f8: 8878 ldrh r0, [r7, #2]
  14233. 800c7fa: f7fd fcfb bl 800a1f4 <lwip_ntohs>
  14234. 800c7fe: 8078 strh r0, [r7, #2]
  14235. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14236. 800c800: 6827 ldr r7, [r4, #0]
  14237. 800c802: 6878 ldr r0, [r7, #4]
  14238. 800c804: f7fd fcfd bl 800a202 <lwip_ntohl>
  14239. 800c808: 4b6a ldr r3, [pc, #424] ; (800c9b4 <tcp_input+0x25c>)
  14240. 800c80a: 6078 str r0, [r7, #4]
  14241. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14242. 800c80c: 6827 ldr r7, [r4, #0]
  14243. }
  14244. /* Convert fields in TCP header to host byte order. */
  14245. tcphdr->src = ntohs(tcphdr->src);
  14246. tcphdr->dest = ntohs(tcphdr->dest);
  14247. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14248. 800c80e: 6018 str r0, [r3, #0]
  14249. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14250. 800c810: 68b8 ldr r0, [r7, #8]
  14251. 800c812: f7fd fcf6 bl 800a202 <lwip_ntohl>
  14252. 800c816: 4b68 ldr r3, [pc, #416] ; (800c9b8 <tcp_input+0x260>)
  14253. 800c818: 60b8 str r0, [r7, #8]
  14254. tcphdr->wnd = ntohs(tcphdr->wnd);
  14255. 800c81a: 6827 ldr r7, [r4, #0]
  14256. /* Convert fields in TCP header to host byte order. */
  14257. tcphdr->src = ntohs(tcphdr->src);
  14258. tcphdr->dest = ntohs(tcphdr->dest);
  14259. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14260. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14261. 800c81c: 6018 str r0, [r3, #0]
  14262. tcphdr->wnd = ntohs(tcphdr->wnd);
  14263. 800c81e: 89f8 ldrh r0, [r7, #14]
  14264. 800c820: f7fd fce8 bl 800a1f4 <lwip_ntohs>
  14265. 800c824: 81f8 strh r0, [r7, #14]
  14266. flags = TCPH_FLAGS(tcphdr);
  14267. 800c826: 6823 ldr r3, [r4, #0]
  14268. 800c828: 8998 ldrh r0, [r3, #12]
  14269. 800c82a: f7fd fce3 bl 800a1f4 <lwip_ntohs>
  14270. 800c82e: 4b63 ldr r3, [pc, #396] ; (800c9bc <tcp_input+0x264>)
  14271. tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
  14272. 800c830: f8b6 9008 ldrh.w r9, [r6, #8]
  14273. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  14274. LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
  14275. LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  14276. LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  14277. if (pcb->remote_port == tcphdr->src &&
  14278. 800c834: 6827 ldr r7, [r4, #0]
  14279. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14280. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14281. tcphdr->wnd = ntohs(tcphdr->wnd);
  14282. flags = TCPH_FLAGS(tcphdr);
  14283. tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
  14284. 800c836: f010 0c03 ands.w ip, r0, #3
  14285. tcphdr->dest = ntohs(tcphdr->dest);
  14286. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14287. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14288. tcphdr->wnd = ntohs(tcphdr->wnd);
  14289. flags = TCPH_FLAGS(tcphdr);
  14290. 800c83a: f000 013f and.w r1, r0, #63 ; 0x3f
  14291. tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
  14292. 800c83e: bf18 it ne
  14293. 800c840: f04f 0c01 movne.w ip, #1
  14294. tcphdr->dest = ntohs(tcphdr->dest);
  14295. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14296. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14297. tcphdr->wnd = ntohs(tcphdr->wnd);
  14298. flags = TCPH_FLAGS(tcphdr);
  14299. 800c844: 7019 strb r1, [r3, #0]
  14300. tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
  14301. 800c846: 44cc add ip, r9
  14302. 800c848: 4b5d ldr r3, [pc, #372] ; (800c9c0 <tcp_input+0x268>)
  14303. LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  14304. LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  14305. if (pcb->remote_port == tcphdr->src &&
  14306. pcb->local_port == tcphdr->dest &&
  14307. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src) &&
  14308. ip_addr_cmp(&(pcb->local_ip), &current_iphdr_dest)) {
  14309. 800c84a: 6829 ldr r1, [r5, #0]
  14310. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14311. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14312. tcphdr->wnd = ntohs(tcphdr->wnd);
  14313. flags = TCPH_FLAGS(tcphdr);
  14314. tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
  14315. 800c84c: fa1f fc8c uxth.w ip, ip
  14316. 800c850: f8a3 c000 strh.w ip, [r3]
  14317. /* Demultiplex an incoming segment. First, we check if it is destined
  14318. for an active connection. */
  14319. prev = NULL;
  14320. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  14321. 800c854: 4b5b ldr r3, [pc, #364] ; (800c9c4 <tcp_input+0x26c>)
  14322. 800c856: f8d3 a000 ldr.w sl, [r3]
  14323. LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
  14324. LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  14325. LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  14326. if (pcb->remote_port == tcphdr->src &&
  14327. pcb->local_port == tcphdr->dest &&
  14328. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src) &&
  14329. 800c85a: 4b5b ldr r3, [pc, #364] ; (800c9c8 <tcp_input+0x270>)
  14330. tcphdr->dest = ntohs(tcphdr->dest);
  14331. seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
  14332. ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
  14333. tcphdr->wnd = ntohs(tcphdr->wnd);
  14334. flags = TCPH_FLAGS(tcphdr);
  14335. 800c85c: 4602 mov r2, r0
  14336. LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
  14337. LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  14338. LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  14339. if (pcb->remote_port == tcphdr->src &&
  14340. pcb->local_port == tcphdr->dest &&
  14341. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src) &&
  14342. 800c85e: f8d3 8000 ldr.w r8, [r3]
  14343. /* Demultiplex an incoming segment. First, we check if it is destined
  14344. for an active connection. */
  14345. prev = NULL;
  14346. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  14347. 800c862: 4654 mov r4, sl
  14348. flags = TCPH_FLAGS(tcphdr);
  14349. tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
  14350. /* Demultiplex an incoming segment. First, we check if it is destined
  14351. for an active connection. */
  14352. prev = NULL;
  14353. 800c864: 4658 mov r0, fp
  14354. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  14355. 800c866: e019 b.n 800c89c <tcp_input+0x144>
  14356. LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
  14357. LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  14358. LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
  14359. if (pcb->remote_port == tcphdr->src &&
  14360. 800c868: 8ba5 ldrh r5, [r4, #28]
  14361. 800c86a: 883b ldrh r3, [r7, #0]
  14362. 800c86c: 429d cmp r5, r3
  14363. 800c86e: d113 bne.n 800c898 <tcp_input+0x140>
  14364. 800c870: 8b65 ldrh r5, [r4, #26]
  14365. 800c872: 887b ldrh r3, [r7, #2]
  14366. 800c874: 429d cmp r5, r3
  14367. 800c876: d10f bne.n 800c898 <tcp_input+0x140>
  14368. pcb->local_port == tcphdr->dest &&
  14369. 800c878: 6863 ldr r3, [r4, #4]
  14370. 800c87a: 4543 cmp r3, r8
  14371. 800c87c: d10c bne.n 800c898 <tcp_input+0x140>
  14372. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src) &&
  14373. 800c87e: 6823 ldr r3, [r4, #0]
  14374. 800c880: 428b cmp r3, r1
  14375. 800c882: d109 bne.n 800c898 <tcp_input+0x140>
  14376. /* Move this PCB to the front of the list so that subsequent
  14377. lookups will be faster (we exploit locality in TCP segment
  14378. arrivals). */
  14379. LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb);
  14380. if (prev != NULL) {
  14381. 800c884: 2800 cmp r0, #0
  14382. 800c886: f000 83a0 beq.w 800cfca <tcp_input+0x872>
  14383. prev->next = pcb->next;
  14384. 800c88a: 68e3 ldr r3, [r4, #12]
  14385. 800c88c: 60c3 str r3, [r0, #12]
  14386. pcb->next = tcp_active_pcbs;
  14387. tcp_active_pcbs = pcb;
  14388. 800c88e: 4b4d ldr r3, [pc, #308] ; (800c9c4 <tcp_input+0x26c>)
  14389. lookups will be faster (we exploit locality in TCP segment
  14390. arrivals). */
  14391. LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb);
  14392. if (prev != NULL) {
  14393. prev->next = pcb->next;
  14394. pcb->next = tcp_active_pcbs;
  14395. 800c890: f8c4 a00c str.w sl, [r4, #12]
  14396. tcp_active_pcbs = pcb;
  14397. 800c894: 601c str r4, [r3, #0]
  14398. 800c896: e398 b.n 800cfca <tcp_input+0x872>
  14399. 800c898: 4620 mov r0, r4
  14400. /* Demultiplex an incoming segment. First, we check if it is destined
  14401. for an active connection. */
  14402. prev = NULL;
  14403. for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
  14404. 800c89a: 68e4 ldr r4, [r4, #12]
  14405. 800c89c: 2c00 cmp r4, #0
  14406. 800c89e: d1e3 bne.n 800c868 <tcp_input+0x110>
  14407. 800c8a0: e3a5 b.n 800cfee <tcp_input+0x896>
  14408. if (pcb == NULL) {
  14409. /* If it did not go to an active connection, we check the connections
  14410. in the TIME-WAIT state. */
  14411. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  14412. LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  14413. if (pcb->remote_port == tcphdr->src &&
  14414. 800c8a2: 8b98 ldrh r0, [r3, #28]
  14415. 800c8a4: 883c ldrh r4, [r7, #0]
  14416. 800c8a6: 4284 cmp r4, r0
  14417. 800c8a8: d130 bne.n 800c90c <tcp_input+0x1b4>
  14418. pcb->local_port == tcphdr->dest &&
  14419. 800c8aa: 8b58 ldrh r0, [r3, #26]
  14420. if (pcb == NULL) {
  14421. /* If it did not go to an active connection, we check the connections
  14422. in the TIME-WAIT state. */
  14423. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  14424. LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  14425. if (pcb->remote_port == tcphdr->src &&
  14426. 800c8ac: 887d ldrh r5, [r7, #2]
  14427. 800c8ae: 4285 cmp r5, r0
  14428. 800c8b0: d12c bne.n 800c90c <tcp_input+0x1b4>
  14429. pcb->local_port == tcphdr->dest &&
  14430. 800c8b2: 6858 ldr r0, [r3, #4]
  14431. 800c8b4: 4540 cmp r0, r8
  14432. 800c8b6: d129 bne.n 800c90c <tcp_input+0x1b4>
  14433. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src) &&
  14434. 800c8b8: 6818 ldr r0, [r3, #0]
  14435. 800c8ba: 4288 cmp r0, r1
  14436. 800c8bc: d126 bne.n 800c90c <tcp_input+0x1b4>
  14437. /* RFC 1337: in TIME_WAIT, ignore RST and ACK FINs + any 'acceptable' segments */
  14438. /* RFC 793 3.9 Event Processing - Segment Arrives:
  14439. * - first check sequence number - we skip that one in TIME_WAIT (always
  14440. * acceptable since we only send ACKs)
  14441. * - second check the RST bit (... return) */
  14442. if (flags & TCP_RST) {
  14443. 800c8be: f002 0104 and.w r1, r2, #4
  14444. 800c8c2: b2c9 uxtb r1, r1
  14445. 800c8c4: 2900 cmp r1, #0
  14446. 800c8c6: f040 837a bne.w 800cfbe <tcp_input+0x866>
  14447. return ERR_OK;
  14448. }
  14449. /* - fourth, check the SYN bit, */
  14450. if (flags & TCP_SYN) {
  14451. 800c8ca: f002 0102 and.w r1, r2, #2
  14452. 800c8ce: b2c9 uxtb r1, r1
  14453. 800c8d0: b159 cbz r1, 800c8ea <tcp_input+0x192>
  14454. /* If an incoming segment is not acceptable, an acknowledgment
  14455. should be sent in reply */
  14456. if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt+pcb->rcv_wnd)) {
  14457. 800c8d2: 4a38 ldr r2, [pc, #224] ; (800c9b4 <tcp_input+0x25c>)
  14458. 800c8d4: 6811 ldr r1, [r2, #0]
  14459. 800c8d6: 6a9a ldr r2, [r3, #40] ; 0x28
  14460. 800c8d8: 1a8a subs r2, r1, r2
  14461. 800c8da: d40b bmi.n 800c8f4 <tcp_input+0x19c>
  14462. 800c8dc: 8d98 ldrh r0, [r3, #44] ; 0x2c
  14463. 800c8de: 1a12 subs r2, r2, r0
  14464. 800c8e0: 2a00 cmp r2, #0
  14465. 800c8e2: dc07 bgt.n 800c8f4 <tcp_input+0x19c>
  14466. /* If the SYN is in the window it is an error, send a reset */
  14467. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  14468. 800c8e4: 9500 str r5, [sp, #0]
  14469. 800c8e6: 9401 str r4, [sp, #4]
  14470. 800c8e8: e041 b.n 800c96e <tcp_input+0x216>
  14471. tcphdr->dest, tcphdr->src);
  14472. return ERR_OK;
  14473. }
  14474. } else if (flags & TCP_FIN) {
  14475. 800c8ea: 07d2 lsls r2, r2, #31
  14476. 800c8ec: d502 bpl.n 800c8f4 <tcp_input+0x19c>
  14477. /* - eighth, check the FIN bit: Remain in the TIME-WAIT state.
  14478. Restart the 2 MSL time-wait timeout.*/
  14479. pcb->tmr = tcp_ticks;
  14480. 800c8ee: 4a37 ldr r2, [pc, #220] ; (800c9cc <tcp_input+0x274>)
  14481. 800c8f0: 6812 ldr r2, [r2, #0]
  14482. 800c8f2: 625a str r2, [r3, #36] ; 0x24
  14483. }
  14484. if ((tcplen > 0)) {
  14485. 800c8f4: f1bc 0f00 cmp.w ip, #0
  14486. 800c8f8: f000 8361 beq.w 800cfbe <tcp_input+0x866>
  14487. /* Acknowledge data, FIN or out-of-window SYN */
  14488. pcb->flags |= TF_ACK_NOW;
  14489. 800c8fc: 7f9a ldrb r2, [r3, #30]
  14490. 800c8fe: f042 0202 orr.w r2, r2, #2
  14491. 800c902: 779a strb r2, [r3, #30]
  14492. return tcp_output(pcb);
  14493. 800c904: 4618 mov r0, r3
  14494. 800c906: f000 fe95 bl 800d634 <tcp_output>
  14495. 800c90a: e358 b.n 800cfbe <tcp_input+0x866>
  14496. }
  14497. if (pcb == NULL) {
  14498. /* If it did not go to an active connection, we check the connections
  14499. in the TIME-WAIT state. */
  14500. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  14501. 800c90c: 68db ldr r3, [r3, #12]
  14502. 800c90e: 2b00 cmp r3, #0
  14503. 800c910: d1c7 bne.n 800c8a2 <tcp_input+0x14a>
  14504. }
  14505. /* Finally, if we still did not get a match, we check all PCBs that
  14506. are LISTENing for incoming connections. */
  14507. prev = NULL;
  14508. for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  14509. 800c912: 482f ldr r0, [pc, #188] ; (800c9d0 <tcp_input+0x278>)
  14510. 800c914: 6804 ldr r4, [r0, #0]
  14511. 800c916: 4625 mov r5, r4
  14512. 800c918: e00f b.n 800c93a <tcp_input+0x1e2>
  14513. if (lpcb->local_port == tcphdr->dest) {
  14514. 800c91a: 8b68 ldrh r0, [r5, #26]
  14515. 800c91c: f8b7 8002 ldrh.w r8, [r7, #2]
  14516. 800c920: 4580 cmp r8, r0
  14517. 800c922: d108 bne.n 800c936 <tcp_input+0x1de>
  14518. /* found an ANY-match */
  14519. lpcb_any = lpcb;
  14520. lpcb_prev = prev;
  14521. }
  14522. #else /* SO_REUSE */
  14523. if (ip_addr_cmp(&(lpcb->local_ip), &current_iphdr_dest) ||
  14524. 800c924: f8d5 8000 ldr.w r8, [r5]
  14525. 800c928: 4588 cmp r8, r1
  14526. 800c92a: f000 8363 beq.w 800cff4 <tcp_input+0x89c>
  14527. ip_addr_isany(&(lpcb->local_ip))) {
  14528. 800c92e: f1b8 0f00 cmp.w r8, #0
  14529. 800c932: f000 835f beq.w 800cff4 <tcp_input+0x89c>
  14530. 800c936: 462b mov r3, r5
  14531. }
  14532. /* Finally, if we still did not get a match, we check all PCBs that
  14533. are LISTENing for incoming connections. */
  14534. prev = NULL;
  14535. for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
  14536. 800c938: 68ed ldr r5, [r5, #12]
  14537. 800c93a: 2d00 cmp r5, #0
  14538. 800c93c: d1ed bne.n 800c91a <tcp_input+0x1c2>
  14539. 800c93e: e35d b.n 800cffc <tcp_input+0x8a4>
  14540. if (lpcb != NULL) {
  14541. /* Move this PCB to the front of the list so that subsequent
  14542. lookups will be faster (we exploit locality in TCP segment
  14543. arrivals). */
  14544. if (prev != NULL) {
  14545. ((struct tcp_pcb_listen *)prev)->next = lpcb->next;
  14546. 800c940: 68e9 ldr r1, [r5, #12]
  14547. 800c942: 60d9 str r1, [r3, #12]
  14548. /* our successor is the remainder of the listening list */
  14549. lpcb->next = tcp_listen_pcbs.listen_pcbs;
  14550. /* put this listening pcb at the head of the listening list */
  14551. tcp_listen_pcbs.listen_pcbs = lpcb;
  14552. 800c944: 4b22 ldr r3, [pc, #136] ; (800c9d0 <tcp_input+0x278>)
  14553. lookups will be faster (we exploit locality in TCP segment
  14554. arrivals). */
  14555. if (prev != NULL) {
  14556. ((struct tcp_pcb_listen *)prev)->next = lpcb->next;
  14557. /* our successor is the remainder of the listening list */
  14558. lpcb->next = tcp_listen_pcbs.listen_pcbs;
  14559. 800c946: 60ec str r4, [r5, #12]
  14560. /* put this listening pcb at the head of the listening list */
  14561. tcp_listen_pcbs.listen_pcbs = lpcb;
  14562. 800c948: 601d str r5, [r3, #0]
  14563. tcp_listen_input(struct tcp_pcb_listen *pcb)
  14564. {
  14565. struct tcp_pcb *npcb;
  14566. err_t rc;
  14567. if (flags & TCP_RST) {
  14568. 800c94a: f002 0304 and.w r3, r2, #4
  14569. 800c94e: b2db uxtb r3, r3
  14570. 800c950: 2b00 cmp r3, #0
  14571. 800c952: f040 8334 bne.w 800cfbe <tcp_input+0x866>
  14572. return ERR_OK;
  14573. }
  14574. /* In the LISTEN state, we check for incoming SYN segments,
  14575. creates a new PCB, and responds with a SYN|ACK. */
  14576. if (flags & TCP_ACK) {
  14577. 800c956: f002 0810 and.w r8, r2, #16
  14578. 800c95a: fa5f f888 uxtb.w r8, r8
  14579. 800c95e: f1b8 0f00 cmp.w r8, #0
  14580. 800c962: d00c beq.n 800c97e <tcp_input+0x226>
  14581. /* For incoming segments with the ACK flag set, respond with a
  14582. RST. */
  14583. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n"));
  14584. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(),
  14585. 800c964: 4b13 ldr r3, [pc, #76] ; (800c9b4 <tcp_input+0x25c>)
  14586. 800c966: 6819 ldr r1, [r3, #0]
  14587. 800c968: 9000 str r0, [sp, #0]
  14588. 800c96a: 883b ldrh r3, [r7, #0]
  14589. 800c96c: 9301 str r3, [sp, #4]
  14590. 800c96e: 4b12 ldr r3, [pc, #72] ; (800c9b8 <tcp_input+0x260>)
  14591. 800c970: 4a0f ldr r2, [pc, #60] ; (800c9b0 <tcp_input+0x258>)
  14592. 800c972: 6818 ldr r0, [r3, #0]
  14593. 800c974: 4b14 ldr r3, [pc, #80] ; (800c9c8 <tcp_input+0x270>)
  14594. 800c976: 4461 add r1, ip
  14595. 800c978: f000 ff98 bl 800d8ac <tcp_rst>
  14596. 800c97c: e31f b.n 800cfbe <tcp_input+0x866>
  14597. ip_current_src_addr(), tcphdr->dest, tcphdr->src);
  14598. } else if (flags & TCP_SYN) {
  14599. 800c97e: f002 0202 and.w r2, r2, #2
  14600. 800c982: b2d2 uxtb r2, r2
  14601. 800c984: 2a00 cmp r2, #0
  14602. 800c986: f000 831a beq.w 800cfbe <tcp_input+0x866>
  14603. if (pcb->accepts_pending >= pcb->backlog) {
  14604. LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: listen backlog exceeded for port %"U16_F"\n", tcphdr->dest));
  14605. return ERR_ABRT;
  14606. }
  14607. #endif /* TCP_LISTEN_BACKLOG */
  14608. npcb = tcp_alloc(pcb->prio);
  14609. 800c98a: 7e68 ldrb r0, [r5, #25]
  14610. 800c98c: f7ff fa7e bl 800be8c <tcp_alloc>
  14611. /* If a new PCB could not be created (probably due to lack of memory),
  14612. we don't do anything, but rely on the sender will retransmit the
  14613. SYN at a time when we have more memory available. */
  14614. if (npcb == NULL) {
  14615. 800c990: 4604 mov r4, r0
  14616. 800c992: b9f8 cbnz r0, 800c9d4 <tcp_input+0x27c>
  14617. LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: could not allocate PCB\n"));
  14618. TCP_STATS_INC(tcp.memerr);
  14619. 800c994: 4b03 ldr r3, [pc, #12] ; (800c9a4 <tcp_input+0x24c>)
  14620. 800c996: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
  14621. 800c99a: 3201 adds r2, #1
  14622. 800c99c: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
  14623. 800c9a0: e30d b.n 800cfbe <tcp_input+0x866>
  14624. 800c9a2: bf00 nop
  14625. 800c9a4: 20008220 .word 0x20008220
  14626. 800c9a8: 20006b98 .word 0x20006b98
  14627. 800c9ac: 20006b80 .word 0x20006b80
  14628. 800c9b0: 20008364 .word 0x20008364
  14629. 800c9b4: 20006b84 .word 0x20006b84
  14630. 800c9b8: 20006b8c .word 0x20006b8c
  14631. 800c9bc: 20006b90 .word 0x20006b90
  14632. 800c9c0: 20006b88 .word 0x20006b88
  14633. 800c9c4: 2000833c .word 0x2000833c
  14634. 800c9c8: 2000835c .word 0x2000835c
  14635. 800c9cc: 20008340 .word 0x20008340
  14636. 800c9d0: 20008344 .word 0x20008344
  14637. }
  14638. #if TCP_LISTEN_BACKLOG
  14639. pcb->accepts_pending++;
  14640. #endif /* TCP_LISTEN_BACKLOG */
  14641. /* Set up the new PCB. */
  14642. ip_addr_copy(npcb->local_ip, current_iphdr_dest);
  14643. 800c9d4: 4b96 ldr r3, [pc, #600] ; (800cc30 <tcp_input+0x4d8>)
  14644. 800c9d6: 681b ldr r3, [r3, #0]
  14645. 800c9d8: 6003 str r3, [r0, #0]
  14646. npcb->local_port = pcb->local_port;
  14647. 800c9da: 8b6b ldrh r3, [r5, #26]
  14648. 800c9dc: 8343 strh r3, [r0, #26]
  14649. ip_addr_copy(npcb->remote_ip, current_iphdr_src);
  14650. 800c9de: 4b95 ldr r3, [pc, #596] ; (800cc34 <tcp_input+0x4dc>)
  14651. 800c9e0: 681b ldr r3, [r3, #0]
  14652. 800c9e2: 6043 str r3, [r0, #4]
  14653. npcb->remote_port = tcphdr->src;
  14654. 800c9e4: 4b94 ldr r3, [pc, #592] ; (800cc38 <tcp_input+0x4e0>)
  14655. 800c9e6: 681b ldr r3, [r3, #0]
  14656. 800c9e8: 7859 ldrb r1, [r3, #1]
  14657. 800c9ea: 781a ldrb r2, [r3, #0]
  14658. 800c9ec: ea42 2201 orr.w r2, r2, r1, lsl #8
  14659. 800c9f0: 8382 strh r2, [r0, #28]
  14660. npcb->state = SYN_RCVD;
  14661. 800c9f2: 2203 movs r2, #3
  14662. 800c9f4: 7602 strb r2, [r0, #24]
  14663. npcb->rcv_nxt = seqno + 1;
  14664. 800c9f6: 4a91 ldr r2, [pc, #580] ; (800cc3c <tcp_input+0x4e4>)
  14665. 800c9f8: 6812 ldr r2, [r2, #0]
  14666. 800c9fa: 1c51 adds r1, r2, #1
  14667. 800c9fc: 6281 str r1, [r0, #40] ; 0x28
  14668. npcb->rcv_ann_right_edge = npcb->rcv_nxt;
  14669. 800c9fe: 6301 str r1, [r0, #48] ; 0x30
  14670. npcb->snd_wnd = tcphdr->wnd;
  14671. 800ca00: 89db ldrh r3, [r3, #14]
  14672. 800ca02: f8a0 3060 strh.w r3, [r0, #96] ; 0x60
  14673. npcb->snd_wnd_max = tcphdr->wnd;
  14674. 800ca06: f8a0 3062 strh.w r3, [r0, #98] ; 0x62
  14675. npcb->ssthresh = npcb->snd_wnd;
  14676. 800ca0a: f8a0 304e strh.w r3, [r0, #78] ; 0x4e
  14677. npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */
  14678. npcb->callback_arg = pcb->callback_arg;
  14679. 800ca0e: 692b ldr r3, [r5, #16]
  14680. 800ca10: 6103 str r3, [r0, #16]
  14681. #if LWIP_CALLBACK_API
  14682. npcb->accept = pcb->accept;
  14683. 800ca12: 696b ldr r3, [r5, #20]
  14684. npcb->rcv_nxt = seqno + 1;
  14685. npcb->rcv_ann_right_edge = npcb->rcv_nxt;
  14686. npcb->snd_wnd = tcphdr->wnd;
  14687. npcb->snd_wnd_max = tcphdr->wnd;
  14688. npcb->ssthresh = npcb->snd_wnd;
  14689. npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */
  14690. 800ca14: 3a01 subs r2, #1
  14691. 800ca16: 6542 str r2, [r0, #84] ; 0x54
  14692. npcb->callback_arg = pcb->callback_arg;
  14693. #if LWIP_CALLBACK_API
  14694. npcb->accept = pcb->accept;
  14695. 800ca18: 6143 str r3, [r0, #20]
  14696. #endif /* LWIP_CALLBACK_API */
  14697. /* inherit socket options */
  14698. npcb->so_options = pcb->so_options & SOF_INHERITED;
  14699. 800ca1a: 7a2b ldrb r3, [r5, #8]
  14700. 800ca1c: f023 0373 bic.w r3, r3, #115 ; 0x73
  14701. 800ca20: 7203 strb r3, [r0, #8]
  14702. /* Register the new PCB so that we can begin receiving segments
  14703. for it. */
  14704. TCP_REG_ACTIVE(npcb);
  14705. 800ca22: 4b87 ldr r3, [pc, #540] ; (800cc40 <tcp_input+0x4e8>)
  14706. 800ca24: 681a ldr r2, [r3, #0]
  14707. 800ca26: 6018 str r0, [r3, #0]
  14708. 800ca28: 60c2 str r2, [r0, #12]
  14709. 800ca2a: f001 f905 bl 800dc38 <tcp_timer_needed>
  14710. 800ca2e: 4b85 ldr r3, [pc, #532] ; (800cc44 <tcp_input+0x4ec>)
  14711. 800ca30: 2201 movs r2, #1
  14712. /* Parse any options in the SYN. */
  14713. tcp_parseopt(npcb);
  14714. 800ca32: 4620 mov r0, r4
  14715. #endif /* LWIP_CALLBACK_API */
  14716. /* inherit socket options */
  14717. npcb->so_options = pcb->so_options & SOF_INHERITED;
  14718. /* Register the new PCB so that we can begin receiving segments
  14719. for it. */
  14720. TCP_REG_ACTIVE(npcb);
  14721. 800ca34: 701a strb r2, [r3, #0]
  14722. /* Parse any options in the SYN. */
  14723. tcp_parseopt(npcb);
  14724. 800ca36: f7ff fbfb bl 800c230 <tcp_parseopt>
  14725. #if TCP_CALCULATE_EFF_SEND_MSS
  14726. npcb->mss = tcp_eff_send_mss(npcb->mss, &(npcb->remote_ip));
  14727. 800ca3a: 1d21 adds r1, r4, #4
  14728. 800ca3c: 8ee0 ldrh r0, [r4, #54] ; 0x36
  14729. 800ca3e: f7ff f987 bl 800bd50 <tcp_eff_send_mss>
  14730. #endif /* TCP_CALCULATE_EFF_SEND_MSS */
  14731. snmp_inc_tcppassiveopens();
  14732. /* Send a SYN|ACK together with the MSS option. */
  14733. rc = tcp_enqueue_flags(npcb, TCP_SYN | TCP_ACK);
  14734. 800ca42: 2112 movs r1, #18
  14735. TCP_REG_ACTIVE(npcb);
  14736. /* Parse any options in the SYN. */
  14737. tcp_parseopt(npcb);
  14738. #if TCP_CALCULATE_EFF_SEND_MSS
  14739. npcb->mss = tcp_eff_send_mss(npcb->mss, &(npcb->remote_ip));
  14740. 800ca44: 86e0 strh r0, [r4, #54] ; 0x36
  14741. #endif /* TCP_CALCULATE_EFF_SEND_MSS */
  14742. snmp_inc_tcppassiveopens();
  14743. /* Send a SYN|ACK together with the MSS option. */
  14744. rc = tcp_enqueue_flags(npcb, TCP_SYN | TCP_ACK);
  14745. 800ca46: 4620 mov r0, r4
  14746. 800ca48: f000 fd54 bl 800d4f4 <tcp_enqueue_flags>
  14747. if (rc != ERR_OK) {
  14748. 800ca4c: b120 cbz r0, 800ca58 <tcp_input+0x300>
  14749. tcp_abandon(npcb, 0);
  14750. 800ca4e: 4620 mov r0, r4
  14751. 800ca50: 4641 mov r1, r8
  14752. 800ca52: f7ff f9d1 bl 800bdf8 <tcp_abandon>
  14753. 800ca56: e2b2 b.n 800cfbe <tcp_input+0x866>
  14754. return rc;
  14755. }
  14756. return tcp_output(npcb);
  14757. 800ca58: 4620 mov r0, r4
  14758. 800ca5a: e754 b.n 800c906 <tcp_input+0x1ae>
  14759. recv_data = NULL;
  14760. recv_flags = 0;
  14761. if (flags & TCP_PSH) {
  14762. p->flags |= PBUF_FLAG_PUSH;
  14763. 800ca5c: 7b73 ldrb r3, [r6, #13]
  14764. 800ca5e: f043 0301 orr.w r3, r3, #1
  14765. 800ca62: 7373 strb r3, [r6, #13]
  14766. }
  14767. /* If there is data which was previously "refused" by upper layer */
  14768. if (pcb->refused_data != NULL) {
  14769. 800ca64: 6f63 ldr r3, [r4, #116] ; 0x74
  14770. 800ca66: b183 cbz r3, 800ca8a <tcp_input+0x332>
  14771. if ((tcp_process_refused_data(pcb) == ERR_ABRT) ||
  14772. 800ca68: 4620 mov r0, r4
  14773. 800ca6a: f7ff fb63 bl 800c134 <tcp_process_refused_data>
  14774. 800ca6e: 300a adds r0, #10
  14775. 800ca70: d004 beq.n 800ca7c <tcp_input+0x324>
  14776. 800ca72: 6f63 ldr r3, [r4, #116] ; 0x74
  14777. 800ca74: b14b cbz r3, 800ca8a <tcp_input+0x332>
  14778. ((pcb->refused_data != NULL) && (tcplen > 0))) {
  14779. 800ca76: 4b74 ldr r3, [pc, #464] ; (800cc48 <tcp_input+0x4f0>)
  14780. 800ca78: 881b ldrh r3, [r3, #0]
  14781. 800ca7a: b133 cbz r3, 800ca8a <tcp_input+0x332>
  14782. /* pcb has been aborted or refused data is still refused and the new
  14783. segment contains data */
  14784. TCP_STATS_INC(tcp.drop);
  14785. 800ca7c: 4b73 ldr r3, [pc, #460] ; (800cc4c <tcp_input+0x4f4>)
  14786. 800ca7e: f8b3 2096 ldrh.w r2, [r3, #150] ; 0x96
  14787. 800ca82: 3201 adds r2, #1
  14788. 800ca84: f8a3 2096 strh.w r2, [r3, #150] ; 0x96
  14789. snmp_inc_tcpinerrs();
  14790. goto aborted;
  14791. 800ca88: e263 b.n 800cf52 <tcp_input+0x7fa>
  14792. }
  14793. }
  14794. tcp_input_pcb = pcb;
  14795. 800ca8a: 4b71 ldr r3, [pc, #452] ; (800cc50 <tcp_input+0x4f8>)
  14796. 800ca8c: 601c str r4, [r3, #0]
  14797. err_t err;
  14798. err = ERR_OK;
  14799. /* Process incoming RST segments. */
  14800. if (flags & TCP_RST) {
  14801. 800ca8e: 4b71 ldr r3, [pc, #452] ; (800cc54 <tcp_input+0x4fc>)
  14802. 800ca90: 781b ldrb r3, [r3, #0]
  14803. 800ca92: f003 0204 and.w r2, r3, #4
  14804. 800ca96: b2d2 uxtb r2, r2
  14805. 800ca98: b1aa cbz r2, 800cac6 <tcp_input+0x36e>
  14806. /* First, determine if the reset is acceptable. */
  14807. if (pcb->state == SYN_SENT) {
  14808. 800ca9a: 7e23 ldrb r3, [r4, #24]
  14809. 800ca9c: 2b02 cmp r3, #2
  14810. 800ca9e: d106 bne.n 800caae <tcp_input+0x356>
  14811. if (ackno == pcb->snd_nxt) {
  14812. 800caa0: 4b6d ldr r3, [pc, #436] ; (800cc58 <tcp_input+0x500>)
  14813. 800caa2: 681a ldr r2, [r3, #0]
  14814. 800caa4: 6d23 ldr r3, [r4, #80] ; 0x50
  14815. 800caa6: 429a cmp r2, r3
  14816. 800caa8: f040 82ba bne.w 800d020 <tcp_input+0x8c8>
  14817. 800caac: e2af b.n 800d00e <tcp_input+0x8b6>
  14818. acceptable = 1;
  14819. }
  14820. } else {
  14821. if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,
  14822. 800caae: 4b63 ldr r3, [pc, #396] ; (800cc3c <tcp_input+0x4e4>)
  14823. 800cab0: 681a ldr r2, [r3, #0]
  14824. 800cab2: 6aa3 ldr r3, [r4, #40] ; 0x28
  14825. 800cab4: 1ad3 subs r3, r2, r3
  14826. 800cab6: f100 82b3 bmi.w 800d020 <tcp_input+0x8c8>
  14827. 800caba: 8da1 ldrh r1, [r4, #44] ; 0x2c
  14828. 800cabc: 1a5b subs r3, r3, r1
  14829. 800cabe: 2b00 cmp r3, #0
  14830. 800cac0: f300 82ae bgt.w 800d020 <tcp_input+0x8c8>
  14831. 800cac4: e2a3 b.n 800d00e <tcp_input+0x8b6>
  14832. seqno, pcb->rcv_nxt));
  14833. return ERR_OK;
  14834. }
  14835. }
  14836. if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) {
  14837. 800cac6: f003 0302 and.w r3, r3, #2
  14838. 800caca: b2db uxtb r3, r3
  14839. 800cacc: b123 cbz r3, 800cad8 <tcp_input+0x380>
  14840. 800cace: 7e23 ldrb r3, [r4, #24]
  14841. 800cad0: 3b02 subs r3, #2
  14842. 800cad2: 2b01 cmp r3, #1
  14843. 800cad4: d900 bls.n 800cad8 <tcp_input+0x380>
  14844. 800cad6: e06b b.n 800cbb0 <tcp_input+0x458>
  14845. /* Cope with new connection attempt after remote end crashed */
  14846. tcp_ack_now(pcb);
  14847. return ERR_OK;
  14848. }
  14849. if ((pcb->flags & TF_RXCLOSED) == 0) {
  14850. 800cad8: 7fa3 ldrb r3, [r4, #30]
  14851. 800cada: f003 0310 and.w r3, r3, #16
  14852. 800cade: b2db uxtb r3, r3
  14853. 800cae0: b913 cbnz r3, 800cae8 <tcp_input+0x390>
  14854. /* Update the PCB (in)activity timer unless rx is closed (see tcp_shutdown) */
  14855. pcb->tmr = tcp_ticks;
  14856. 800cae2: 4b5e ldr r3, [pc, #376] ; (800cc5c <tcp_input+0x504>)
  14857. 800cae4: 681b ldr r3, [r3, #0]
  14858. 800cae6: 6263 str r3, [r4, #36] ; 0x24
  14859. }
  14860. pcb->keep_cnt_sent = 0;
  14861. 800cae8: 2300 movs r3, #0
  14862. 800caea: f884 3092 strb.w r3, [r4, #146] ; 0x92
  14863. tcp_parseopt(pcb);
  14864. 800caee: 4620 mov r0, r4
  14865. 800caf0: f7ff fb9e bl 800c230 <tcp_parseopt>
  14866. /* Do different things depending on the TCP state. */
  14867. switch (pcb->state) {
  14868. 800caf4: 7e23 ldrb r3, [r4, #24]
  14869. 800caf6: 3b02 subs r3, #2
  14870. 800caf8: 2b07 cmp r3, #7
  14871. 800cafa: f200 8291 bhi.w 800d020 <tcp_input+0x8c8>
  14872. 800cafe: e8df f013 tbh [pc, r3, lsl #1]
  14873. 800cb02: 0008 .short 0x0008
  14874. 800cb04: 00e20077 .word 0x00e20077
  14875. 800cb08: 013000f3 .word 0x013000f3
  14876. 800cb0c: 015200e2 .word 0x015200e2
  14877. 800cb10: 0186 .short 0x0186
  14878. case SYN_SENT:
  14879. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno,
  14880. pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
  14881. /* received SYN ACK with expected sequence number? */
  14882. if ((flags & TCP_ACK) && (flags & TCP_SYN)
  14883. 800cb12: 4b50 ldr r3, [pc, #320] ; (800cc54 <tcp_input+0x4fc>)
  14884. 800cb14: 781b ldrb r3, [r3, #0]
  14885. 800cb16: f003 0312 and.w r3, r3, #18
  14886. 800cb1a: 2b12 cmp r3, #18
  14887. 800cb1c: d153 bne.n 800cbc6 <tcp_input+0x46e>
  14888. && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
  14889. 800cb1e: 6f23 ldr r3, [r4, #112] ; 0x70
  14890. 800cb20: 4d4d ldr r5, [pc, #308] ; (800cc58 <tcp_input+0x500>)
  14891. 800cb22: 68db ldr r3, [r3, #12]
  14892. 800cb24: 682e ldr r6, [r5, #0]
  14893. 800cb26: 6858 ldr r0, [r3, #4]
  14894. 800cb28: f7fd fb6b bl 800a202 <lwip_ntohl>
  14895. 800cb2c: 3001 adds r0, #1
  14896. 800cb2e: 4286 cmp r6, r0
  14897. 800cb30: d149 bne.n 800cbc6 <tcp_input+0x46e>
  14898. pcb->snd_buf++;
  14899. 800cb32: f8b4 3066 ldrh.w r3, [r4, #102] ; 0x66
  14900. pcb->snd_wnd_max = tcphdr->wnd;
  14901. pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
  14902. pcb->state = ESTABLISHED;
  14903. #if TCP_CALCULATE_EFF_SEND_MSS
  14904. pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
  14905. 800cb36: 8ee0 ldrh r0, [r4, #54] ; 0x36
  14906. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno,
  14907. pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
  14908. /* received SYN ACK with expected sequence number? */
  14909. if ((flags & TCP_ACK) && (flags & TCP_SYN)
  14910. && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
  14911. pcb->snd_buf++;
  14912. 800cb38: 3301 adds r3, #1
  14913. 800cb3a: f8a4 3066 strh.w r3, [r4, #102] ; 0x66
  14914. pcb->rcv_nxt = seqno + 1;
  14915. 800cb3e: 4b3f ldr r3, [pc, #252] ; (800cc3c <tcp_input+0x4e4>)
  14916. 800cb40: 681b ldr r3, [r3, #0]
  14917. 800cb42: 1c5a adds r2, r3, #1
  14918. 800cb44: 62a2 str r2, [r4, #40] ; 0x28
  14919. pcb->rcv_ann_right_edge = pcb->rcv_nxt;
  14920. 800cb46: 6322 str r2, [r4, #48] ; 0x30
  14921. pcb->lastack = ackno;
  14922. 800cb48: 682a ldr r2, [r5, #0]
  14923. 800cb4a: 64a2 str r2, [r4, #72] ; 0x48
  14924. pcb->snd_wnd = tcphdr->wnd;
  14925. 800cb4c: 4a3a ldr r2, [pc, #232] ; (800cc38 <tcp_input+0x4e0>)
  14926. 800cb4e: 6812 ldr r2, [r2, #0]
  14927. pcb->snd_wnd_max = tcphdr->wnd;
  14928. pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
  14929. 800cb50: 3b01 subs r3, #1
  14930. && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
  14931. pcb->snd_buf++;
  14932. pcb->rcv_nxt = seqno + 1;
  14933. pcb->rcv_ann_right_edge = pcb->rcv_nxt;
  14934. pcb->lastack = ackno;
  14935. pcb->snd_wnd = tcphdr->wnd;
  14936. 800cb52: 89d2 ldrh r2, [r2, #14]
  14937. pcb->snd_wnd_max = tcphdr->wnd;
  14938. pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
  14939. 800cb54: 6563 str r3, [r4, #84] ; 0x54
  14940. pcb->state = ESTABLISHED;
  14941. 800cb56: 2304 movs r3, #4
  14942. 800cb58: 7623 strb r3, [r4, #24]
  14943. #if TCP_CALCULATE_EFF_SEND_MSS
  14944. pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
  14945. 800cb5a: 18e1 adds r1, r4, r3
  14946. && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
  14947. pcb->snd_buf++;
  14948. pcb->rcv_nxt = seqno + 1;
  14949. pcb->rcv_ann_right_edge = pcb->rcv_nxt;
  14950. pcb->lastack = ackno;
  14951. pcb->snd_wnd = tcphdr->wnd;
  14952. 800cb5c: f8a4 2060 strh.w r2, [r4, #96] ; 0x60
  14953. pcb->snd_wnd_max = tcphdr->wnd;
  14954. 800cb60: f8a4 2062 strh.w r2, [r4, #98] ; 0x62
  14955. pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
  14956. pcb->state = ESTABLISHED;
  14957. #if TCP_CALCULATE_EFF_SEND_MSS
  14958. pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
  14959. 800cb64: f7ff f8f4 bl 800bd50 <tcp_eff_send_mss>
  14960. #endif /* TCP_CALCULATE_EFF_SEND_MSS */
  14961. /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
  14962. * but for the default value of pcb->mss) */
  14963. pcb->ssthresh = pcb->mss * 10;
  14964. 800cb68: 230a movs r3, #10
  14965. 800cb6a: 4343 muls r3, r0
  14966. 800cb6c: f8a4 304e strh.w r3, [r4, #78] ; 0x4e
  14967. pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  14968. 800cb70: f8b4 304c ldrh.w r3, [r4, #76] ; 0x4c
  14969. pcb->snd_wnd_max = tcphdr->wnd;
  14970. pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
  14971. pcb->state = ESTABLISHED;
  14972. #if TCP_CALCULATE_EFF_SEND_MSS
  14973. pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
  14974. 800cb74: 86e0 strh r0, [r4, #54] ; 0x36
  14975. /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
  14976. * but for the default value of pcb->mss) */
  14977. pcb->ssthresh = pcb->mss * 10;
  14978. pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  14979. 800cb76: 2b01 cmp r3, #1
  14980. 800cb78: d101 bne.n 800cb7e <tcp_input+0x426>
  14981. 800cb7a: 0040 lsls r0, r0, #1
  14982. 800cb7c: b280 uxth r0, r0
  14983. LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
  14984. --pcb->snd_queuelen;
  14985. 800cb7e: f8b4 3068 ldrh.w r3, [r4, #104] ; 0x68
  14986. /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
  14987. * but for the default value of pcb->mss) */
  14988. pcb->ssthresh = pcb->mss * 10;
  14989. pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  14990. 800cb82: f8a4 004c strh.w r0, [r4, #76] ; 0x4c
  14991. LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
  14992. --pcb->snd_queuelen;
  14993. LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen));
  14994. rseg = pcb->unacked;
  14995. 800cb86: 6f20 ldr r0, [r4, #112] ; 0x70
  14996. * but for the default value of pcb->mss) */
  14997. pcb->ssthresh = pcb->mss * 10;
  14998. pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  14999. LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
  15000. --pcb->snd_queuelen;
  15001. 800cb88: 3b01 subs r3, #1
  15002. 800cb8a: f8a4 3068 strh.w r3, [r4, #104] ; 0x68
  15003. LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen));
  15004. rseg = pcb->unacked;
  15005. pcb->unacked = rseg->next;
  15006. 800cb8e: 6803 ldr r3, [r0, #0]
  15007. 800cb90: 6723 str r3, [r4, #112] ; 0x70
  15008. tcp_seg_free(rseg);
  15009. 800cb92: f7fe ff40 bl 800ba16 <tcp_seg_free>
  15010. /* If there's nothing left to acknowledge, stop the retransmit
  15011. timer, otherwise reset it to start again */
  15012. if(pcb->unacked == NULL)
  15013. 800cb96: 6f23 ldr r3, [r4, #112] ; 0x70
  15014. 800cb98: b91b cbnz r3, 800cba2 <tcp_input+0x44a>
  15015. pcb->rtime = -1;
  15016. 800cb9a: f64f 73ff movw r3, #65535 ; 0xffff
  15017. 800cb9e: 86a3 strh r3, [r4, #52] ; 0x34
  15018. 800cba0: e003 b.n 800cbaa <tcp_input+0x452>
  15019. else {
  15020. pcb->rtime = 0;
  15021. 800cba2: 2300 movs r3, #0
  15022. 800cba4: 86a3 strh r3, [r4, #52] ; 0x34
  15023. pcb->nrtx = 0;
  15024. 800cba6: f884 3046 strb.w r3, [r4, #70] ; 0x46
  15025. }
  15026. /* Call the user specified function to call when sucessfully
  15027. * connected. */
  15028. TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
  15029. 800cbaa: f8d4 3080 ldr.w r3, [r4, #128] ; 0x80
  15030. 800cbae: b91b cbnz r3, 800cbb8 <tcp_input+0x460>
  15031. if (err == ERR_ABRT) {
  15032. return ERR_ABRT;
  15033. }
  15034. tcp_ack_now(pcb);
  15035. 800cbb0: 7fa3 ldrb r3, [r4, #30]
  15036. 800cbb2: f043 0302 orr.w r3, r3, #2
  15037. 800cbb6: e232 b.n 800d01e <tcp_input+0x8c6>
  15038. pcb->nrtx = 0;
  15039. }
  15040. /* Call the user specified function to call when sucessfully
  15041. * connected. */
  15042. TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
  15043. 800cbb8: 2200 movs r2, #0
  15044. 800cbba: 6920 ldr r0, [r4, #16]
  15045. 800cbbc: 4621 mov r1, r4
  15046. 800cbbe: 4798 blx r3
  15047. if (err == ERR_ABRT) {
  15048. 800cbc0: 300a adds r0, #10
  15049. 800cbc2: d1f5 bne.n 800cbb0 <tcp_input+0x458>
  15050. 800cbc4: e1c5 b.n 800cf52 <tcp_input+0x7fa>
  15051. return ERR_ABRT;
  15052. }
  15053. tcp_ack_now(pcb);
  15054. }
  15055. /* received ACK? possibly a half-open connection */
  15056. else if (flags & TCP_ACK) {
  15057. 800cbc6: 4b23 ldr r3, [pc, #140] ; (800cc54 <tcp_input+0x4fc>)
  15058. 800cbc8: 781b ldrb r3, [r3, #0]
  15059. 800cbca: f003 0310 and.w r3, r3, #16
  15060. 800cbce: b2db uxtb r3, r3
  15061. 800cbd0: 2b00 cmp r3, #0
  15062. 800cbd2: f000 8225 beq.w 800d020 <tcp_input+0x8c8>
  15063. /* send a RST to bring the other side in a non-synchronized state. */
  15064. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  15065. tcphdr->dest, tcphdr->src);
  15066. 800cbd6: 4b18 ldr r3, [pc, #96] ; (800cc38 <tcp_input+0x4e0>)
  15067. tcp_ack_now(pcb);
  15068. }
  15069. /* received ACK? possibly a half-open connection */
  15070. else if (flags & TCP_ACK) {
  15071. /* send a RST to bring the other side in a non-synchronized state. */
  15072. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  15073. 800cbd8: 4a1b ldr r2, [pc, #108] ; (800cc48 <tcp_input+0x4f0>)
  15074. tcphdr->dest, tcphdr->src);
  15075. 800cbda: 681b ldr r3, [r3, #0]
  15076. tcp_ack_now(pcb);
  15077. }
  15078. /* received ACK? possibly a half-open connection */
  15079. else if (flags & TCP_ACK) {
  15080. /* send a RST to bring the other side in a non-synchronized state. */
  15081. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  15082. 800cbdc: 8811 ldrh r1, [r2, #0]
  15083. 800cbde: 8858 ldrh r0, [r3, #2]
  15084. 800cbe0: 4a16 ldr r2, [pc, #88] ; (800cc3c <tcp_input+0x4e4>)
  15085. 800cbe2: 6812 ldr r2, [r2, #0]
  15086. 800cbe4: 9000 str r0, [sp, #0]
  15087. 800cbe6: 881b ldrh r3, [r3, #0]
  15088. 800cbe8: 9301 str r3, [sp, #4]
  15089. 800cbea: 4b1b ldr r3, [pc, #108] ; (800cc58 <tcp_input+0x500>)
  15090. 800cbec: 6818 ldr r0, [r3, #0]
  15091. 800cbee: e053 b.n 800cc98 <tcp_input+0x540>
  15092. tcphdr->dest, tcphdr->src);
  15093. }
  15094. break;
  15095. case SYN_RCVD:
  15096. if (flags & TCP_ACK) {
  15097. 800cbf0: 4b18 ldr r3, [pc, #96] ; (800cc54 <tcp_input+0x4fc>)
  15098. 800cbf2: 781b ldrb r3, [r3, #0]
  15099. 800cbf4: f003 0210 and.w r2, r3, #16
  15100. 800cbf8: b2d2 uxtb r2, r2
  15101. 800cbfa: 2a00 cmp r2, #0
  15102. 800cbfc: d052 beq.n 800cca4 <tcp_input+0x54c>
  15103. /* expected ACK number? */
  15104. if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)) {
  15105. 800cbfe: 4b16 ldr r3, [pc, #88] ; (800cc58 <tcp_input+0x500>)
  15106. 800cc00: 6818 ldr r0, [r3, #0]
  15107. 800cc02: 6ca3 ldr r3, [r4, #72] ; 0x48
  15108. 800cc04: 43db mvns r3, r3
  15109. 800cc06: 42c3 cmn r3, r0
  15110. 800cc08: d43c bmi.n 800cc84 <tcp_input+0x52c>
  15111. 800cc0a: 6d23 ldr r3, [r4, #80] ; 0x50
  15112. 800cc0c: 1ac3 subs r3, r0, r3
  15113. 800cc0e: 2b00 cmp r3, #0
  15114. 800cc10: dc38 bgt.n 800cc84 <tcp_input+0x52c>
  15115. u16_t old_cwnd;
  15116. pcb->state = ESTABLISHED;
  15117. 800cc12: 2304 movs r3, #4
  15118. 800cc14: 7623 strb r3, [r4, #24]
  15119. LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
  15120. #if LWIP_CALLBACK_API
  15121. LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);
  15122. #endif
  15123. /* Call the accept function. */
  15124. TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
  15125. 800cc16: 6963 ldr r3, [r4, #20]
  15126. 800cc18: b903 cbnz r3, 800cc1c <tcp_input+0x4c4>
  15127. 800cc1a: e147 b.n 800ceac <tcp_input+0x754>
  15128. 800cc1c: 6920 ldr r0, [r4, #16]
  15129. 800cc1e: 4621 mov r1, r4
  15130. 800cc20: 2200 movs r2, #0
  15131. 800cc22: 4798 blx r3
  15132. if (err != ERR_OK) {
  15133. 800cc24: b1e0 cbz r0, 800cc60 <tcp_input+0x508>
  15134. /* If the accept function returns with an error, we abort
  15135. * the connection. */
  15136. /* Already aborted? */
  15137. if (err != ERR_ABRT) {
  15138. 800cc26: 300a adds r0, #10
  15139. 800cc28: f040 8140 bne.w 800ceac <tcp_input+0x754>
  15140. 800cc2c: e191 b.n 800cf52 <tcp_input+0x7fa>
  15141. 800cc2e: bf00 nop
  15142. 800cc30: 20008364 .word 0x20008364
  15143. 800cc34: 2000835c .word 0x2000835c
  15144. 800cc38: 20006b80 .word 0x20006b80
  15145. 800cc3c: 20006b84 .word 0x20006b84
  15146. 800cc40: 2000833c .word 0x2000833c
  15147. 800cc44: 20008338 .word 0x20008338
  15148. 800cc48: 20006b88 .word 0x20006b88
  15149. 800cc4c: 20008220 .word 0x20008220
  15150. 800cc50: 20008354 .word 0x20008354
  15151. 800cc54: 20006b90 .word 0x20006b90
  15152. 800cc58: 20006b8c .word 0x20006b8c
  15153. 800cc5c: 20008340 .word 0x20008340
  15154. return ERR_ABRT;
  15155. }
  15156. old_cwnd = pcb->cwnd;
  15157. /* If there was any data contained within this ACK,
  15158. * we'd better pass it on to the application as well. */
  15159. tcp_receive(pcb);
  15160. 800cc60: 4620 mov r0, r4
  15161. if (err != ERR_ABRT) {
  15162. tcp_abort(pcb);
  15163. }
  15164. return ERR_ABRT;
  15165. }
  15166. old_cwnd = pcb->cwnd;
  15167. 800cc62: f8b4 504c ldrh.w r5, [r4, #76] ; 0x4c
  15168. /* If there was any data contained within this ACK,
  15169. * we'd better pass it on to the application as well. */
  15170. tcp_receive(pcb);
  15171. 800cc66: f7ff fb23 bl 800c2b0 <tcp_receive>
  15172. /* Prevent ACK for SYN to generate a sent event */
  15173. if (pcb->acked != 0) {
  15174. 800cc6a: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
  15175. 800cc6e: b113 cbz r3, 800cc76 <tcp_input+0x51e>
  15176. pcb->acked--;
  15177. 800cc70: 3b01 subs r3, #1
  15178. 800cc72: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
  15179. }
  15180. pcb->cwnd = ((old_cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
  15181. 800cc76: 8ee3 ldrh r3, [r4, #54] ; 0x36
  15182. 800cc78: 2d01 cmp r5, #1
  15183. 800cc7a: bf08 it eq
  15184. 800cc7c: 005b lsleq r3, r3, #1
  15185. 800cc7e: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
  15186. 800cc82: e023 b.n 800cccc <tcp_input+0x574>
  15187. pcb->state = CLOSE_WAIT;
  15188. }
  15189. } else {
  15190. /* incorrect ACK number, send RST */
  15191. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  15192. tcphdr->dest, tcphdr->src);
  15193. 800cc84: 4b8e ldr r3, [pc, #568] ; (800cec0 <tcp_input+0x768>)
  15194. tcp_ack_now(pcb);
  15195. pcb->state = CLOSE_WAIT;
  15196. }
  15197. } else {
  15198. /* incorrect ACK number, send RST */
  15199. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  15200. 800cc86: 4a8f ldr r2, [pc, #572] ; (800cec4 <tcp_input+0x76c>)
  15201. tcphdr->dest, tcphdr->src);
  15202. 800cc88: 681b ldr r3, [r3, #0]
  15203. tcp_ack_now(pcb);
  15204. pcb->state = CLOSE_WAIT;
  15205. }
  15206. } else {
  15207. /* incorrect ACK number, send RST */
  15208. tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
  15209. 800cc8a: 8811 ldrh r1, [r2, #0]
  15210. 800cc8c: 885d ldrh r5, [r3, #2]
  15211. 800cc8e: 4a8e ldr r2, [pc, #568] ; (800cec8 <tcp_input+0x770>)
  15212. 800cc90: 6812 ldr r2, [r2, #0]
  15213. 800cc92: 9500 str r5, [sp, #0]
  15214. 800cc94: 881b ldrh r3, [r3, #0]
  15215. 800cc96: 9301 str r3, [sp, #4]
  15216. 800cc98: 1889 adds r1, r1, r2
  15217. 800cc9a: 4b8c ldr r3, [pc, #560] ; (800cecc <tcp_input+0x774>)
  15218. 800cc9c: 4a8c ldr r2, [pc, #560] ; (800ced0 <tcp_input+0x778>)
  15219. 800cc9e: f000 fe05 bl 800d8ac <tcp_rst>
  15220. 800cca2: e1bd b.n 800d020 <tcp_input+0x8c8>
  15221. tcphdr->dest, tcphdr->src);
  15222. }
  15223. } else if ((flags & TCP_SYN) && (seqno == pcb->rcv_nxt - 1)) {
  15224. 800cca4: f003 0302 and.w r3, r3, #2
  15225. 800cca8: b2db uxtb r3, r3
  15226. 800ccaa: 2b00 cmp r3, #0
  15227. 800ccac: f000 81b8 beq.w 800d020 <tcp_input+0x8c8>
  15228. 800ccb0: 4a85 ldr r2, [pc, #532] ; (800cec8 <tcp_input+0x770>)
  15229. 800ccb2: 6aa3 ldr r3, [r4, #40] ; 0x28
  15230. 800ccb4: 6812 ldr r2, [r2, #0]
  15231. 800ccb6: 3b01 subs r3, #1
  15232. 800ccb8: 429a cmp r2, r3
  15233. 800ccba: f040 81b1 bne.w 800d020 <tcp_input+0x8c8>
  15234. /* Looks like another copy of the SYN - retransmit our SYN-ACK */
  15235. tcp_rexmit(pcb);
  15236. 800ccbe: 4620 mov r0, r4
  15237. 800ccc0: f000 fe58 bl 800d974 <tcp_rexmit>
  15238. 800ccc4: e1ac b.n 800d020 <tcp_input+0x8c8>
  15239. }
  15240. break;
  15241. case CLOSE_WAIT:
  15242. /* FALLTHROUGH */
  15243. case ESTABLISHED:
  15244. tcp_receive(pcb);
  15245. 800ccc6: 4620 mov r0, r4
  15246. 800ccc8: f7ff faf2 bl 800c2b0 <tcp_receive>
  15247. if (recv_flags & TF_GOT_FIN) { /* passive close */
  15248. 800cccc: 4b81 ldr r3, [pc, #516] ; (800ced4 <tcp_input+0x77c>)
  15249. 800ccce: 781b ldrb r3, [r3, #0]
  15250. 800ccd0: f003 0320 and.w r3, r3, #32
  15251. 800ccd4: b2db uxtb r3, r3
  15252. 800ccd6: 2b00 cmp r3, #0
  15253. 800ccd8: f000 81a2 beq.w 800d020 <tcp_input+0x8c8>
  15254. tcp_ack_now(pcb);
  15255. 800ccdc: 7fa3 ldrb r3, [r4, #30]
  15256. 800ccde: f043 0302 orr.w r3, r3, #2
  15257. 800cce2: 77a3 strb r3, [r4, #30]
  15258. pcb->state = CLOSE_WAIT;
  15259. 800cce4: 2307 movs r3, #7
  15260. 800cce6: e03a b.n 800cd5e <tcp_input+0x606>
  15261. }
  15262. break;
  15263. case FIN_WAIT_1:
  15264. tcp_receive(pcb);
  15265. 800cce8: 4620 mov r0, r4
  15266. 800ccea: f7ff fae1 bl 800c2b0 <tcp_receive>
  15267. if (recv_flags & TF_GOT_FIN) {
  15268. 800ccee: 4b79 ldr r3, [pc, #484] ; (800ced4 <tcp_input+0x77c>)
  15269. 800ccf0: 781a ldrb r2, [r3, #0]
  15270. 800ccf2: 4b79 ldr r3, [pc, #484] ; (800ced8 <tcp_input+0x780>)
  15271. if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
  15272. 800ccf4: 781b ldrb r3, [r3, #0]
  15273. pcb->state = CLOSE_WAIT;
  15274. }
  15275. break;
  15276. case FIN_WAIT_1:
  15277. tcp_receive(pcb);
  15278. if (recv_flags & TF_GOT_FIN) {
  15279. 800ccf6: f002 0220 and.w r2, r2, #32
  15280. if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
  15281. 800ccfa: f003 0310 and.w r3, r3, #16
  15282. pcb->state = CLOSE_WAIT;
  15283. }
  15284. break;
  15285. case FIN_WAIT_1:
  15286. tcp_receive(pcb);
  15287. if (recv_flags & TF_GOT_FIN) {
  15288. 800ccfe: b2d2 uxtb r2, r2
  15289. if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
  15290. 800cd00: b2db uxtb r3, r3
  15291. pcb->state = CLOSE_WAIT;
  15292. }
  15293. break;
  15294. case FIN_WAIT_1:
  15295. tcp_receive(pcb);
  15296. if (recv_flags & TF_GOT_FIN) {
  15297. 800cd02: b312 cbz r2, 800cd4a <tcp_input+0x5f2>
  15298. if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
  15299. 800cd04: b1db cbz r3, 800cd3e <tcp_input+0x5e6>
  15300. 800cd06: 4b75 ldr r3, [pc, #468] ; (800cedc <tcp_input+0x784>)
  15301. 800cd08: 681a ldr r2, [r3, #0]
  15302. 800cd0a: 6d23 ldr r3, [r4, #80] ; 0x50
  15303. 800cd0c: 429a cmp r2, r3
  15304. 800cd0e: d116 bne.n 800cd3e <tcp_input+0x5e6>
  15305. LWIP_DEBUGF(TCP_DEBUG,
  15306. ("TCP connection closed: FIN_WAIT_1 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
  15307. tcp_ack_now(pcb);
  15308. 800cd10: 7fa3 ldrb r3, [r4, #30]
  15309. 800cd12: f043 0302 orr.w r3, r3, #2
  15310. 800cd16: 77a3 strb r3, [r4, #30]
  15311. tcp_pcb_purge(pcb);
  15312. 800cd18: 4620 mov r0, r4
  15313. 800cd1a: f7fe fea5 bl 800ba68 <tcp_pcb_purge>
  15314. TCP_RMV_ACTIVE(pcb);
  15315. 800cd1e: 4a70 ldr r2, [pc, #448] ; (800cee0 <tcp_input+0x788>)
  15316. 800cd20: 6813 ldr r3, [r2, #0]
  15317. 800cd22: 42a3 cmp r3, r4
  15318. 800cd24: d100 bne.n 800cd28 <tcp_input+0x5d0>
  15319. 800cd26: e056 b.n 800cdd6 <tcp_input+0x67e>
  15320. 800cd28: 4a6e ldr r2, [pc, #440] ; (800cee4 <tcp_input+0x78c>)
  15321. 800cd2a: 6013 str r3, [r2, #0]
  15322. 800cd2c: e004 b.n 800cd38 <tcp_input+0x5e0>
  15323. 800cd2e: 68d9 ldr r1, [r3, #12]
  15324. 800cd30: 42a1 cmp r1, r4
  15325. 800cd32: d100 bne.n 800cd36 <tcp_input+0x5de>
  15326. 800cd34: e057 b.n 800cde6 <tcp_input+0x68e>
  15327. 800cd36: 460b mov r3, r1
  15328. 800cd38: 2b00 cmp r3, #0
  15329. 800cd3a: d1f8 bne.n 800cd2e <tcp_input+0x5d6>
  15330. 800cd3c: e05a b.n 800cdf4 <tcp_input+0x69c>
  15331. pcb->state = TIME_WAIT;
  15332. TCP_REG(&tcp_tw_pcbs, pcb);
  15333. } else {
  15334. tcp_ack_now(pcb);
  15335. 800cd3e: 7fa3 ldrb r3, [r4, #30]
  15336. 800cd40: f043 0302 orr.w r3, r3, #2
  15337. 800cd44: 77a3 strb r3, [r4, #30]
  15338. pcb->state = CLOSING;
  15339. 800cd46: 2308 movs r3, #8
  15340. 800cd48: e009 b.n 800cd5e <tcp_input+0x606>
  15341. }
  15342. } else if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
  15343. 800cd4a: 2b00 cmp r3, #0
  15344. 800cd4c: f000 8168 beq.w 800d020 <tcp_input+0x8c8>
  15345. 800cd50: 4b62 ldr r3, [pc, #392] ; (800cedc <tcp_input+0x784>)
  15346. 800cd52: 681a ldr r2, [r3, #0]
  15347. 800cd54: 6d23 ldr r3, [r4, #80] ; 0x50
  15348. 800cd56: 429a cmp r2, r3
  15349. 800cd58: f040 8162 bne.w 800d020 <tcp_input+0x8c8>
  15350. pcb->state = FIN_WAIT_2;
  15351. 800cd5c: 2306 movs r3, #6
  15352. 800cd5e: 7623 strb r3, [r4, #24]
  15353. 800cd60: e15e b.n 800d020 <tcp_input+0x8c8>
  15354. }
  15355. break;
  15356. case FIN_WAIT_2:
  15357. tcp_receive(pcb);
  15358. 800cd62: 4620 mov r0, r4
  15359. 800cd64: f7ff faa4 bl 800c2b0 <tcp_receive>
  15360. if (recv_flags & TF_GOT_FIN) {
  15361. 800cd68: 4b5a ldr r3, [pc, #360] ; (800ced4 <tcp_input+0x77c>)
  15362. 800cd6a: 781b ldrb r3, [r3, #0]
  15363. 800cd6c: f003 0320 and.w r3, r3, #32
  15364. 800cd70: b2db uxtb r3, r3
  15365. 800cd72: 2b00 cmp r3, #0
  15366. 800cd74: f000 8154 beq.w 800d020 <tcp_input+0x8c8>
  15367. LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: FIN_WAIT_2 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
  15368. tcp_ack_now(pcb);
  15369. 800cd78: 7fa3 ldrb r3, [r4, #30]
  15370. 800cd7a: f043 0302 orr.w r3, r3, #2
  15371. 800cd7e: 77a3 strb r3, [r4, #30]
  15372. tcp_pcb_purge(pcb);
  15373. 800cd80: 4620 mov r0, r4
  15374. 800cd82: f7fe fe71 bl 800ba68 <tcp_pcb_purge>
  15375. TCP_RMV_ACTIVE(pcb);
  15376. 800cd86: 4a56 ldr r2, [pc, #344] ; (800cee0 <tcp_input+0x788>)
  15377. 800cd88: 6813 ldr r3, [r2, #0]
  15378. 800cd8a: 42a3 cmp r3, r4
  15379. 800cd8c: d100 bne.n 800cd90 <tcp_input+0x638>
  15380. 800cd8e: e022 b.n 800cdd6 <tcp_input+0x67e>
  15381. 800cd90: 4a54 ldr r2, [pc, #336] ; (800cee4 <tcp_input+0x78c>)
  15382. 800cd92: 6013 str r3, [r2, #0]
  15383. 800cd94: e004 b.n 800cda0 <tcp_input+0x648>
  15384. 800cd96: 68d9 ldr r1, [r3, #12]
  15385. 800cd98: 42a1 cmp r1, r4
  15386. 800cd9a: d100 bne.n 800cd9e <tcp_input+0x646>
  15387. 800cd9c: e023 b.n 800cde6 <tcp_input+0x68e>
  15388. 800cd9e: 460b mov r3, r1
  15389. 800cda0: 2b00 cmp r3, #0
  15390. 800cda2: d1f8 bne.n 800cd96 <tcp_input+0x63e>
  15391. 800cda4: e026 b.n 800cdf4 <tcp_input+0x69c>
  15392. pcb->state = TIME_WAIT;
  15393. TCP_REG(&tcp_tw_pcbs, pcb);
  15394. }
  15395. break;
  15396. case CLOSING:
  15397. tcp_receive(pcb);
  15398. 800cda6: 4620 mov r0, r4
  15399. 800cda8: f7ff fa82 bl 800c2b0 <tcp_receive>
  15400. if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
  15401. 800cdac: 4b4a ldr r3, [pc, #296] ; (800ced8 <tcp_input+0x780>)
  15402. 800cdae: 781b ldrb r3, [r3, #0]
  15403. 800cdb0: f003 0310 and.w r3, r3, #16
  15404. 800cdb4: b2db uxtb r3, r3
  15405. 800cdb6: 2b00 cmp r3, #0
  15406. 800cdb8: f000 8132 beq.w 800d020 <tcp_input+0x8c8>
  15407. 800cdbc: 4b47 ldr r3, [pc, #284] ; (800cedc <tcp_input+0x784>)
  15408. 800cdbe: 681a ldr r2, [r3, #0]
  15409. 800cdc0: 6d23 ldr r3, [r4, #80] ; 0x50
  15410. 800cdc2: 429a cmp r2, r3
  15411. 800cdc4: f040 812c bne.w 800d020 <tcp_input+0x8c8>
  15412. LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: CLOSING %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
  15413. tcp_pcb_purge(pcb);
  15414. 800cdc8: 4620 mov r0, r4
  15415. 800cdca: f7fe fe4d bl 800ba68 <tcp_pcb_purge>
  15416. TCP_RMV_ACTIVE(pcb);
  15417. 800cdce: 4a44 ldr r2, [pc, #272] ; (800cee0 <tcp_input+0x788>)
  15418. 800cdd0: 6813 ldr r3, [r2, #0]
  15419. 800cdd2: 42a3 cmp r3, r4
  15420. 800cdd4: d101 bne.n 800cdda <tcp_input+0x682>
  15421. 800cdd6: 68e3 ldr r3, [r4, #12]
  15422. 800cdd8: e00c b.n 800cdf4 <tcp_input+0x69c>
  15423. 800cdda: 4a42 ldr r2, [pc, #264] ; (800cee4 <tcp_input+0x78c>)
  15424. 800cddc: 6013 str r3, [r2, #0]
  15425. 800cdde: e007 b.n 800cdf0 <tcp_input+0x698>
  15426. 800cde0: 68d9 ldr r1, [r3, #12]
  15427. 800cde2: 42a1 cmp r1, r4
  15428. 800cde4: d103 bne.n 800cdee <tcp_input+0x696>
  15429. 800cde6: 6013 str r3, [r2, #0]
  15430. 800cde8: 68e2 ldr r2, [r4, #12]
  15431. 800cdea: 60da str r2, [r3, #12]
  15432. 800cdec: e003 b.n 800cdf6 <tcp_input+0x69e>
  15433. 800cdee: 460b mov r3, r1
  15434. 800cdf0: 2b00 cmp r3, #0
  15435. 800cdf2: d1f5 bne.n 800cde0 <tcp_input+0x688>
  15436. 800cdf4: 6013 str r3, [r2, #0]
  15437. 800cdf6: 4b3c ldr r3, [pc, #240] ; (800cee8 <tcp_input+0x790>)
  15438. 800cdf8: 2201 movs r2, #1
  15439. 800cdfa: 701a strb r2, [r3, #0]
  15440. pcb->state = TIME_WAIT;
  15441. 800cdfc: 230a movs r3, #10
  15442. 800cdfe: 7623 strb r3, [r4, #24]
  15443. TCP_REG(&tcp_tw_pcbs, pcb);
  15444. 800ce00: 4b3a ldr r3, [pc, #232] ; (800ceec <tcp_input+0x794>)
  15445. 800ce02: 681a ldr r2, [r3, #0]
  15446. 800ce04: 601c str r4, [r3, #0]
  15447. 800ce06: 60e2 str r2, [r4, #12]
  15448. 800ce08: f000 ff16 bl 800dc38 <tcp_timer_needed>
  15449. 800ce0c: e108 b.n 800d020 <tcp_input+0x8c8>
  15450. }
  15451. break;
  15452. case LAST_ACK:
  15453. tcp_receive(pcb);
  15454. 800ce0e: 4620 mov r0, r4
  15455. 800ce10: f7ff fa4e bl 800c2b0 <tcp_receive>
  15456. if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
  15457. 800ce14: 4b30 ldr r3, [pc, #192] ; (800ced8 <tcp_input+0x780>)
  15458. 800ce16: 781b ldrb r3, [r3, #0]
  15459. 800ce18: f003 0310 and.w r3, r3, #16
  15460. 800ce1c: b2db uxtb r3, r3
  15461. 800ce1e: 2b00 cmp r3, #0
  15462. 800ce20: f000 80fe beq.w 800d020 <tcp_input+0x8c8>
  15463. 800ce24: 4b2d ldr r3, [pc, #180] ; (800cedc <tcp_input+0x784>)
  15464. 800ce26: 681a ldr r2, [r3, #0]
  15465. 800ce28: 6d23 ldr r3, [r4, #80] ; 0x50
  15466. 800ce2a: 429a cmp r2, r3
  15467. 800ce2c: f040 80f8 bne.w 800d020 <tcp_input+0x8c8>
  15468. LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: LAST_ACK %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
  15469. /* bugfix #21699: don't set pcb->state to CLOSED here or we risk leaking segments */
  15470. recv_flags |= TF_CLOSED;
  15471. 800ce30: 4b28 ldr r3, [pc, #160] ; (800ced4 <tcp_input+0x77c>)
  15472. 800ce32: 781a ldrb r2, [r3, #0]
  15473. 800ce34: f042 0210 orr.w r2, r2, #16
  15474. 800ce38: 701a strb r2, [r3, #0]
  15475. 800ce3a: e0f1 b.n 800d020 <tcp_input+0x8c8>
  15476. if (recv_flags & TF_RESET) {
  15477. /* TF_RESET means that the connection was reset by the other
  15478. end. We then call the error callback to inform the
  15479. application that the connection is dead before we
  15480. deallocate the PCB. */
  15481. TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_RST);
  15482. 800ce3c: f8d4 3088 ldr.w r3, [r4, #136] ; 0x88
  15483. 800ce40: b19b cbz r3, 800ce6a <tcp_input+0x712>
  15484. 800ce42: 6920 ldr r0, [r4, #16]
  15485. 800ce44: f06f 010a mvn.w r1, #10
  15486. 800ce48: e00e b.n 800ce68 <tcp_input+0x710>
  15487. tcp_pcb_remove(&tcp_active_pcbs, pcb);
  15488. memp_free(MEMP_TCP_PCB, pcb);
  15489. } else if (recv_flags & TF_CLOSED) {
  15490. 800ce4a: f003 0310 and.w r3, r3, #16
  15491. 800ce4e: b2db uxtb r3, r3
  15492. 800ce50: b1a3 cbz r3, 800ce7c <tcp_input+0x724>
  15493. /* The connection has been closed and we will deallocate the
  15494. PCB. */
  15495. if (!(pcb->flags & TF_RXCLOSED)) {
  15496. 800ce52: 7fa3 ldrb r3, [r4, #30]
  15497. 800ce54: f003 0310 and.w r3, r3, #16
  15498. 800ce58: b2db uxtb r3, r3
  15499. 800ce5a: b933 cbnz r3, 800ce6a <tcp_input+0x712>
  15500. /* Connection closed although the application has only shut down the
  15501. tx side: call the PCB's err callback and indicate the closure to
  15502. ensure the application doesn't continue using the PCB. */
  15503. TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_CLSD);
  15504. 800ce5c: f8d4 3088 ldr.w r3, [r4, #136] ; 0x88
  15505. 800ce60: b11b cbz r3, 800ce6a <tcp_input+0x712>
  15506. 800ce62: 6920 ldr r0, [r4, #16]
  15507. 800ce64: f06f 010b mvn.w r1, #11
  15508. 800ce68: 4798 blx r3
  15509. }
  15510. tcp_pcb_remove(&tcp_active_pcbs, pcb);
  15511. 800ce6a: 4621 mov r1, r4
  15512. 800ce6c: 481c ldr r0, [pc, #112] ; (800cee0 <tcp_input+0x788>)
  15513. 800ce6e: f7fe ff91 bl 800bd94 <tcp_pcb_remove>
  15514. memp_free(MEMP_TCP_PCB, pcb);
  15515. 800ce72: 2002 movs r0, #2
  15516. 800ce74: 4621 mov r1, r4
  15517. 800ce76: f7fe fa2d bl 800b2d4 <memp_free>
  15518. 800ce7a: e06a b.n 800cf52 <tcp_input+0x7fa>
  15519. } else {
  15520. err = ERR_OK;
  15521. /* If the application has registered a "sent" function to be
  15522. called when new send buffer space is available, we call it
  15523. now. */
  15524. if (pcb->acked > 0) {
  15525. 800ce7c: f8b4 2064 ldrh.w r2, [r4, #100] ; 0x64
  15526. 800ce80: b91a cbnz r2, 800ce8a <tcp_input+0x732>
  15527. if (err == ERR_ABRT) {
  15528. goto aborted;
  15529. }
  15530. }
  15531. if (recv_data != NULL) {
  15532. 800ce82: 4b1b ldr r3, [pc, #108] ; (800cef0 <tcp_input+0x798>)
  15533. 800ce84: 681a ldr r2, [r3, #0]
  15534. 800ce86: b94a cbnz r2, 800ce9c <tcp_input+0x744>
  15535. 800ce88: e040 b.n 800cf0c <tcp_input+0x7b4>
  15536. err = ERR_OK;
  15537. /* If the application has registered a "sent" function to be
  15538. called when new send buffer space is available, we call it
  15539. now. */
  15540. if (pcb->acked > 0) {
  15541. TCP_EVENT_SENT(pcb, pcb->acked, err);
  15542. 800ce8a: 6fa3 ldr r3, [r4, #120] ; 0x78
  15543. 800ce8c: 2b00 cmp r3, #0
  15544. 800ce8e: d0f8 beq.n 800ce82 <tcp_input+0x72a>
  15545. 800ce90: 6920 ldr r0, [r4, #16]
  15546. 800ce92: 4621 mov r1, r4
  15547. 800ce94: 4798 blx r3
  15548. if (err == ERR_ABRT) {
  15549. 800ce96: 300a adds r0, #10
  15550. 800ce98: d1f3 bne.n 800ce82 <tcp_input+0x72a>
  15551. 800ce9a: e05a b.n 800cf52 <tcp_input+0x7fa>
  15552. }
  15553. }
  15554. if (recv_data != NULL) {
  15555. LWIP_ASSERT("pcb->refused_data == NULL", pcb->refused_data == NULL);
  15556. if (pcb->flags & TF_RXCLOSED) {
  15557. 800ce9c: 7fa3 ldrb r3, [r4, #30]
  15558. 800ce9e: f003 0310 and.w r3, r3, #16
  15559. 800cea2: b2db uxtb r3, r3
  15560. 800cea4: b133 cbz r3, 800ceb4 <tcp_input+0x75c>
  15561. /* received data although already closed -> abort (send RST) to
  15562. notify the remote host that not all data has been processed */
  15563. pbuf_free(recv_data);
  15564. 800cea6: 4610 mov r0, r2
  15565. 800cea8: f7fe fb0c bl 800b4c4 <pbuf_free>
  15566. tcp_abort(pcb);
  15567. 800ceac: 4620 mov r0, r4
  15568. 800ceae: f7fe ffe9 bl 800be84 <tcp_abort>
  15569. goto aborted;
  15570. 800ceb2: e04e b.n 800cf52 <tcp_input+0x7fa>
  15571. }
  15572. /* Notify application that data has been received. */
  15573. TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err);
  15574. 800ceb4: 6fe5 ldr r5, [r4, #124] ; 0x7c
  15575. 800ceb6: b1ed cbz r5, 800cef4 <tcp_input+0x79c>
  15576. 800ceb8: 6920 ldr r0, [r4, #16]
  15577. 800ceba: 4621 mov r1, r4
  15578. 800cebc: 47a8 blx r5
  15579. 800cebe: e01e b.n 800cefe <tcp_input+0x7a6>
  15580. 800cec0: 20006b80 .word 0x20006b80
  15581. 800cec4: 20006b88 .word 0x20006b88
  15582. 800cec8: 20006b84 .word 0x20006b84
  15583. 800cecc: 2000835c .word 0x2000835c
  15584. 800ced0: 20008364 .word 0x20008364
  15585. 800ced4: 20006b91 .word 0x20006b91
  15586. 800ced8: 20006b90 .word 0x20006b90
  15587. 800cedc: 20006b8c .word 0x20006b8c
  15588. 800cee0: 2000833c .word 0x2000833c
  15589. 800cee4: 20008348 .word 0x20008348
  15590. 800cee8: 20008338 .word 0x20008338
  15591. 800ceec: 20008350 .word 0x20008350
  15592. 800cef0: 20006b94 .word 0x20006b94
  15593. 800cef4: 4628 mov r0, r5
  15594. 800cef6: 4621 mov r1, r4
  15595. 800cef8: 462b mov r3, r5
  15596. 800cefa: f7ff f909 bl 800c110 <tcp_recv_null>
  15597. if (err == ERR_ABRT) {
  15598. 800cefe: b243 sxtb r3, r0
  15599. 800cf00: 330a adds r3, #10
  15600. 800cf02: d026 beq.n 800cf52 <tcp_input+0x7fa>
  15601. goto aborted;
  15602. }
  15603. /* If the upper layer can't receive this data, store it */
  15604. if (err != ERR_OK) {
  15605. 800cf04: b110 cbz r0, 800cf0c <tcp_input+0x7b4>
  15606. pcb->refused_data = recv_data;
  15607. 800cf06: 4b4b ldr r3, [pc, #300] ; (800d034 <tcp_input+0x8dc>)
  15608. 800cf08: 681b ldr r3, [r3, #0]
  15609. 800cf0a: 6763 str r3, [r4, #116] ; 0x74
  15610. }
  15611. }
  15612. /* If a FIN segment was received, we call the callback
  15613. function with a NULL buffer to indicate EOF. */
  15614. if (recv_flags & TF_GOT_FIN) {
  15615. 800cf0c: 4b4a ldr r3, [pc, #296] ; (800d038 <tcp_input+0x8e0>)
  15616. 800cf0e: 781b ldrb r3, [r3, #0]
  15617. 800cf10: f003 0320 and.w r3, r3, #32
  15618. 800cf14: b2db uxtb r3, r3
  15619. 800cf16: b1b3 cbz r3, 800cf46 <tcp_input+0x7ee>
  15620. if (pcb->refused_data != NULL) {
  15621. 800cf18: 6f63 ldr r3, [r4, #116] ; 0x74
  15622. 800cf1a: b123 cbz r3, 800cf26 <tcp_input+0x7ce>
  15623. /* Delay this if we have refused data. */
  15624. pcb->refused_data->flags |= PBUF_FLAG_TCP_FIN;
  15625. 800cf1c: 7b5a ldrb r2, [r3, #13]
  15626. 800cf1e: f042 0220 orr.w r2, r2, #32
  15627. 800cf22: 735a strb r2, [r3, #13]
  15628. 800cf24: e00f b.n 800cf46 <tcp_input+0x7ee>
  15629. } else {
  15630. /* correct rcv_wnd as the application won't call tcp_recved()
  15631. for the FIN's seqno */
  15632. if (pcb->rcv_wnd != TCP_WND) {
  15633. 800cf26: 8da3 ldrh r3, [r4, #44] ; 0x2c
  15634. 800cf28: f241 62d0 movw r2, #5840 ; 0x16d0
  15635. 800cf2c: 4293 cmp r3, r2
  15636. 800cf2e: d001 beq.n 800cf34 <tcp_input+0x7dc>
  15637. pcb->rcv_wnd++;
  15638. 800cf30: 3301 adds r3, #1
  15639. 800cf32: 85a3 strh r3, [r4, #44] ; 0x2c
  15640. }
  15641. TCP_EVENT_CLOSED(pcb, err);
  15642. 800cf34: 6fe5 ldr r5, [r4, #124] ; 0x7c
  15643. 800cf36: b135 cbz r5, 800cf46 <tcp_input+0x7ee>
  15644. 800cf38: 2200 movs r2, #0
  15645. 800cf3a: 6920 ldr r0, [r4, #16]
  15646. 800cf3c: 4621 mov r1, r4
  15647. 800cf3e: 4613 mov r3, r2
  15648. 800cf40: 47a8 blx r5
  15649. if (err == ERR_ABRT) {
  15650. 800cf42: 300a adds r0, #10
  15651. 800cf44: d005 beq.n 800cf52 <tcp_input+0x7fa>
  15652. goto aborted;
  15653. }
  15654. }
  15655. }
  15656. tcp_input_pcb = NULL;
  15657. 800cf46: 4b3d ldr r3, [pc, #244] ; (800d03c <tcp_input+0x8e4>)
  15658. 800cf48: 2200 movs r2, #0
  15659. /* Try to send something out. */
  15660. tcp_output(pcb);
  15661. 800cf4a: 4620 mov r0, r4
  15662. goto aborted;
  15663. }
  15664. }
  15665. }
  15666. tcp_input_pcb = NULL;
  15667. 800cf4c: 601a str r2, [r3, #0]
  15668. /* Try to send something out. */
  15669. tcp_output(pcb);
  15670. 800cf4e: f000 fb71 bl 800d634 <tcp_output>
  15671. }
  15672. }
  15673. /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()).
  15674. Below this line, 'pcb' may not be dereferenced! */
  15675. aborted:
  15676. tcp_input_pcb = NULL;
  15677. 800cf52: 4b3a ldr r3, [pc, #232] ; (800d03c <tcp_input+0x8e4>)
  15678. recv_data = NULL;
  15679. /* give up our reference to inseg.p */
  15680. if (inseg.p != NULL)
  15681. 800cf54: 4d3a ldr r5, [pc, #232] ; (800d040 <tcp_input+0x8e8>)
  15682. }
  15683. }
  15684. /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()).
  15685. Below this line, 'pcb' may not be dereferenced! */
  15686. aborted:
  15687. tcp_input_pcb = NULL;
  15688. 800cf56: 2400 movs r4, #0
  15689. 800cf58: 601c str r4, [r3, #0]
  15690. recv_data = NULL;
  15691. /* give up our reference to inseg.p */
  15692. if (inseg.p != NULL)
  15693. 800cf5a: 6868 ldr r0, [r5, #4]
  15694. }
  15695. /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()).
  15696. Below this line, 'pcb' may not be dereferenced! */
  15697. aborted:
  15698. tcp_input_pcb = NULL;
  15699. recv_data = NULL;
  15700. 800cf5c: 4b35 ldr r3, [pc, #212] ; (800d034 <tcp_input+0x8dc>)
  15701. 800cf5e: 601c str r4, [r3, #0]
  15702. /* give up our reference to inseg.p */
  15703. if (inseg.p != NULL)
  15704. 800cf60: b310 cbz r0, 800cfa8 <tcp_input+0x850>
  15705. {
  15706. pbuf_free(inseg.p);
  15707. 800cf62: f7fe faaf bl 800b4c4 <pbuf_free>
  15708. inseg.p = NULL;
  15709. 800cf66: 606c str r4, [r5, #4]
  15710. 800cf68: e01e b.n 800cfa8 <tcp_input+0x850>
  15711. /* If no matching PCB was found, send a TCP RST (reset) to the
  15712. sender. */
  15713. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
  15714. if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
  15715. TCP_STATS_INC(tcp.proterr);
  15716. 800cf6a: 4b36 ldr r3, [pc, #216] ; (800d044 <tcp_input+0x8ec>)
  15717. 800cf6c: f8b3 20a0 ldrh.w r2, [r3, #160] ; 0xa0
  15718. 800cf70: 3201 adds r2, #1
  15719. 800cf72: f8a3 20a0 strh.w r2, [r3, #160] ; 0xa0
  15720. TCP_STATS_INC(tcp.drop);
  15721. 800cf76: f8b3 2096 ldrh.w r2, [r3, #150] ; 0x96
  15722. 800cf7a: 3201 adds r2, #1
  15723. 800cf7c: f8a3 2096 strh.w r2, [r3, #150] ; 0x96
  15724. tcp_rst(ackno, seqno + tcplen,
  15725. ip_current_dest_addr(), ip_current_src_addr(),
  15726. tcphdr->dest, tcphdr->src);
  15727. 800cf80: 4b31 ldr r3, [pc, #196] ; (800d048 <tcp_input+0x8f0>)
  15728. sender. */
  15729. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
  15730. if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
  15731. TCP_STATS_INC(tcp.proterr);
  15732. TCP_STATS_INC(tcp.drop);
  15733. tcp_rst(ackno, seqno + tcplen,
  15734. 800cf82: 4a32 ldr r2, [pc, #200] ; (800d04c <tcp_input+0x8f4>)
  15735. ip_current_dest_addr(), ip_current_src_addr(),
  15736. tcphdr->dest, tcphdr->src);
  15737. 800cf84: 681b ldr r3, [r3, #0]
  15738. sender. */
  15739. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
  15740. if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
  15741. TCP_STATS_INC(tcp.proterr);
  15742. TCP_STATS_INC(tcp.drop);
  15743. tcp_rst(ackno, seqno + tcplen,
  15744. 800cf86: 8811 ldrh r1, [r2, #0]
  15745. 800cf88: 8858 ldrh r0, [r3, #2]
  15746. 800cf8a: 4a31 ldr r2, [pc, #196] ; (800d050 <tcp_input+0x8f8>)
  15747. 800cf8c: 6812 ldr r2, [r2, #0]
  15748. 800cf8e: 9000 str r0, [sp, #0]
  15749. 800cf90: 881b ldrh r3, [r3, #0]
  15750. 800cf92: 9301 str r3, [sp, #4]
  15751. 800cf94: 4b2f ldr r3, [pc, #188] ; (800d054 <tcp_input+0x8fc>)
  15752. 800cf96: 1889 adds r1, r1, r2
  15753. 800cf98: 6818 ldr r0, [r3, #0]
  15754. 800cf9a: 4a2f ldr r2, [pc, #188] ; (800d058 <tcp_input+0x900>)
  15755. 800cf9c: 4b2f ldr r3, [pc, #188] ; (800d05c <tcp_input+0x904>)
  15756. 800cf9e: f000 fc85 bl 800d8ac <tcp_rst>
  15757. ip_current_dest_addr(), ip_current_src_addr(),
  15758. tcphdr->dest, tcphdr->src);
  15759. }
  15760. pbuf_free(p);
  15761. 800cfa2: 4630 mov r0, r6
  15762. 800cfa4: f7fe fa8e bl 800b4c4 <pbuf_free>
  15763. return;
  15764. dropped:
  15765. TCP_STATS_INC(tcp.drop);
  15766. snmp_inc_tcpinerrs();
  15767. pbuf_free(p);
  15768. }
  15769. 800cfa8: b003 add sp, #12
  15770. 800cfaa: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  15771. tcphdr->dest, tcphdr->src);
  15772. }
  15773. pbuf_free(p);
  15774. }
  15775. LWIP_ASSERT("tcp_input: tcp_pcbs_sane()", tcp_pcbs_sane());
  15776. 800cfae: f7fe bedf b.w 800bd70 <tcp_pcbs_sane>
  15777. PERF_STOP("tcp_input");
  15778. return;
  15779. dropped:
  15780. TCP_STATS_INC(tcp.drop);
  15781. 800cfb2: 4b24 ldr r3, [pc, #144] ; (800d044 <tcp_input+0x8ec>)
  15782. 800cfb4: f8b3 2096 ldrh.w r2, [r3, #150] ; 0x96
  15783. 800cfb8: 3201 adds r2, #1
  15784. 800cfba: f8a3 2096 strh.w r2, [r3, #150] ; 0x96
  15785. snmp_inc_tcpinerrs();
  15786. pbuf_free(p);
  15787. 800cfbe: 4630 mov r0, r6
  15788. }
  15789. 800cfc0: b003 add sp, #12
  15790. 800cfc2: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  15791. PERF_STOP("tcp_input");
  15792. return;
  15793. dropped:
  15794. TCP_STATS_INC(tcp.drop);
  15795. snmp_inc_tcpinerrs();
  15796. pbuf_free(p);
  15797. 800cfc6: f7fe ba7d b.w 800b4c4 <pbuf_free>
  15798. tcp_debug_print_state(pcb->state);
  15799. #endif /* TCP_DEBUG */
  15800. #endif /* TCP_INPUT_DEBUG */
  15801. /* Set up a tcp_seg structure. */
  15802. inseg.next = NULL;
  15803. 800cfca: 4b1d ldr r3, [pc, #116] ; (800d040 <tcp_input+0x8e8>)
  15804. 800cfcc: 2100 movs r1, #0
  15805. 800cfce: 6019 str r1, [r3, #0]
  15806. inseg.len = p->tot_len;
  15807. 800cfd0: f8a3 9008 strh.w r9, [r3, #8]
  15808. inseg.p = p;
  15809. 800cfd4: 605e str r6, [r3, #4]
  15810. inseg.tcphdr = tcphdr;
  15811. 800cfd6: 60df str r7, [r3, #12]
  15812. recv_data = NULL;
  15813. 800cfd8: 4b16 ldr r3, [pc, #88] ; (800d034 <tcp_input+0x8dc>)
  15814. recv_flags = 0;
  15815. if (flags & TCP_PSH) {
  15816. 800cfda: f002 0208 and.w r2, r2, #8
  15817. inseg.next = NULL;
  15818. inseg.len = p->tot_len;
  15819. inseg.p = p;
  15820. inseg.tcphdr = tcphdr;
  15821. recv_data = NULL;
  15822. 800cfde: 6019 str r1, [r3, #0]
  15823. recv_flags = 0;
  15824. 800cfe0: 4b15 ldr r3, [pc, #84] ; (800d038 <tcp_input+0x8e0>)
  15825. if (flags & TCP_PSH) {
  15826. 800cfe2: b2d2 uxtb r2, r2
  15827. inseg.len = p->tot_len;
  15828. inseg.p = p;
  15829. inseg.tcphdr = tcphdr;
  15830. recv_data = NULL;
  15831. recv_flags = 0;
  15832. 800cfe4: 7019 strb r1, [r3, #0]
  15833. if (flags & TCP_PSH) {
  15834. 800cfe6: 2a00 cmp r2, #0
  15835. 800cfe8: f47f ad38 bne.w 800ca5c <tcp_input+0x304>
  15836. 800cfec: e53a b.n 800ca64 <tcp_input+0x30c>
  15837. }
  15838. if (pcb == NULL) {
  15839. /* If it did not go to an active connection, we check the connections
  15840. in the TIME-WAIT state. */
  15841. for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
  15842. 800cfee: 4b1c ldr r3, [pc, #112] ; (800d060 <tcp_input+0x908>)
  15843. 800cff0: 681b ldr r3, [r3, #0]
  15844. 800cff2: e48c b.n 800c90e <tcp_input+0x1b6>
  15845. #endif /* SO_REUSE */
  15846. if (lpcb != NULL) {
  15847. /* Move this PCB to the front of the list so that subsequent
  15848. lookups will be faster (we exploit locality in TCP segment
  15849. arrivals). */
  15850. if (prev != NULL) {
  15851. 800cff4: 2b00 cmp r3, #0
  15852. 800cff6: f47f aca3 bne.w 800c940 <tcp_input+0x1e8>
  15853. 800cffa: e4a6 b.n 800c94a <tcp_input+0x1f2>
  15854. } else {
  15855. /* If no matching PCB was found, send a TCP RST (reset) to the
  15856. sender. */
  15857. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
  15858. if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
  15859. 800cffc: 89b8 ldrh r0, [r7, #12]
  15860. 800cffe: f7fd f8f9 bl 800a1f4 <lwip_ntohs>
  15861. 800d002: f000 0004 and.w r0, r0, #4
  15862. 800d006: b280 uxth r0, r0
  15863. 800d008: 2800 cmp r0, #0
  15864. 800d00a: d1ca bne.n 800cfa2 <tcp_input+0x84a>
  15865. 800d00c: e7ad b.n 800cf6a <tcp_input+0x812>
  15866. }
  15867. if (acceptable) {
  15868. LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: Connection RESET\n"));
  15869. LWIP_ASSERT("tcp_input: pcb->state != CLOSED", pcb->state != CLOSED);
  15870. recv_flags |= TF_RESET;
  15871. 800d00e: 4b0a ldr r3, [pc, #40] ; (800d038 <tcp_input+0x8e0>)
  15872. 800d010: 781a ldrb r2, [r3, #0]
  15873. 800d012: f042 0208 orr.w r2, r2, #8
  15874. 800d016: 701a strb r2, [r3, #0]
  15875. pcb->flags &= ~TF_ACK_DELAY;
  15876. 800d018: 7fa3 ldrb r3, [r4, #30]
  15877. 800d01a: f023 0301 bic.w r3, r3, #1
  15878. 800d01e: 77a3 strb r3, [r4, #30]
  15879. tcp_input_pcb = pcb;
  15880. err = tcp_process(pcb);
  15881. /* A return value of ERR_ABRT means that tcp_abort() was called
  15882. and that the pcb has been freed. If so, we don't do anything. */
  15883. if (err != ERR_ABRT) {
  15884. if (recv_flags & TF_RESET) {
  15885. 800d020: 4b05 ldr r3, [pc, #20] ; (800d038 <tcp_input+0x8e0>)
  15886. 800d022: 781b ldrb r3, [r3, #0]
  15887. 800d024: f003 0208 and.w r2, r3, #8
  15888. 800d028: b2d2 uxtb r2, r2
  15889. 800d02a: 2a00 cmp r2, #0
  15890. 800d02c: f47f af06 bne.w 800ce3c <tcp_input+0x6e4>
  15891. 800d030: e70b b.n 800ce4a <tcp_input+0x6f2>
  15892. 800d032: bf00 nop
  15893. 800d034: 20006b94 .word 0x20006b94
  15894. 800d038: 20006b91 .word 0x20006b91
  15895. 800d03c: 20008354 .word 0x20008354
  15896. 800d040: 20006b9c .word 0x20006b9c
  15897. 800d044: 20008220 .word 0x20008220
  15898. 800d048: 20006b80 .word 0x20006b80
  15899. 800d04c: 20006b88 .word 0x20006b88
  15900. 800d050: 20006b84 .word 0x20006b84
  15901. 800d054: 20006b8c .word 0x20006b8c
  15902. 800d058: 20008364 .word 0x20008364
  15903. 800d05c: 2000835c .word 0x2000835c
  15904. 800d060: 20008350 .word 0x20008350
  15905. 0800d064 <tcp_pbuf_prealloc>:
  15906. #if TCP_OVERSIZE
  15907. static struct pbuf *
  15908. tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
  15909. u16_t *oversize, struct tcp_pcb *pcb, u8_t apiflags,
  15910. u8_t first_seg)
  15911. {
  15912. 800d064: b570 push {r4, r5, r6, lr}
  15913. LWIP_UNUSED_ARG(apiflags);
  15914. LWIP_UNUSED_ARG(first_seg);
  15915. /* always create MSS-sized pbufs */
  15916. alloc = max_length;
  15917. #else /* LWIP_NETIF_TX_SINGLE_PBUF */
  15918. if (length < max_length) {
  15919. 800d066: 4291 cmp r1, r2
  15920. #if TCP_OVERSIZE
  15921. static struct pbuf *
  15922. tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
  15923. u16_t *oversize, struct tcp_pcb *pcb, u8_t apiflags,
  15924. u8_t first_seg)
  15925. {
  15926. 800d068: 460c mov r4, r1
  15927. 800d06a: 461e mov r6, r3
  15928. 800d06c: 9d04 ldr r5, [sp, #16]
  15929. LWIP_UNUSED_ARG(apiflags);
  15930. LWIP_UNUSED_ARG(first_seg);
  15931. /* always create MSS-sized pbufs */
  15932. alloc = max_length;
  15933. #else /* LWIP_NETIF_TX_SINGLE_PBUF */
  15934. if (length < max_length) {
  15935. 800d06e: d21a bcs.n 800d0a6 <tcp_pbuf_prealloc+0x42>
  15936. *
  15937. * Did the user set TCP_WRITE_FLAG_MORE?
  15938. *
  15939. * Will the Nagle algorithm defer transmission of this segment?
  15940. */
  15941. if ((apiflags & TCP_WRITE_FLAG_MORE) ||
  15942. 800d070: f89d 3014 ldrb.w r3, [sp, #20]
  15943. 800d074: f003 0302 and.w r3, r3, #2
  15944. 800d078: b2db uxtb r3, r3
  15945. 800d07a: b95b cbnz r3, 800d094 <tcp_pbuf_prealloc+0x30>
  15946. (!(pcb->flags & TF_NODELAY) &&
  15947. 800d07c: 7fab ldrb r3, [r5, #30]
  15948. *
  15949. * Did the user set TCP_WRITE_FLAG_MORE?
  15950. *
  15951. * Will the Nagle algorithm defer transmission of this segment?
  15952. */
  15953. if ((apiflags & TCP_WRITE_FLAG_MORE) ||
  15954. 800d07e: f003 0340 and.w r3, r3, #64 ; 0x40
  15955. 800d082: b2db uxtb r3, r3
  15956. 800d084: b97b cbnz r3, 800d0a6 <tcp_pbuf_prealloc+0x42>
  15957. (!(pcb->flags & TF_NODELAY) &&
  15958. 800d086: f89d 3018 ldrb.w r3, [sp, #24]
  15959. 800d08a: b11b cbz r3, 800d094 <tcp_pbuf_prealloc+0x30>
  15960. (!first_seg ||
  15961. 800d08c: 6ee9 ldr r1, [r5, #108] ; 0x6c
  15962. 800d08e: b909 cbnz r1, 800d094 <tcp_pbuf_prealloc+0x30>
  15963. pcb->unsent != NULL ||
  15964. 800d090: 6f2b ldr r3, [r5, #112] ; 0x70
  15965. 800d092: b143 cbz r3, 800d0a6 <tcp_pbuf_prealloc+0x42>
  15966. pcb->unacked != NULL))) {
  15967. alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(length + TCP_OVERSIZE));
  15968. 800d094: f204 51b7 addw r1, r4, #1463 ; 0x5b7
  15969. 800d098: f021 0103 bic.w r1, r1, #3
  15970. 800d09c: 4291 cmp r1, r2
  15971. 800d09e: bfa8 it ge
  15972. 800d0a0: 4611 movge r1, r2
  15973. 800d0a2: b289 uxth r1, r1
  15974. 800d0a4: e000 b.n 800d0a8 <tcp_pbuf_prealloc+0x44>
  15975. * Will the Nagle algorithm defer transmission of this segment?
  15976. */
  15977. if ((apiflags & TCP_WRITE_FLAG_MORE) ||
  15978. (!(pcb->flags & TF_NODELAY) &&
  15979. (!first_seg ||
  15980. pcb->unsent != NULL ||
  15981. 800d0a6: 4621 mov r1, r4
  15982. pcb->unacked != NULL))) {
  15983. alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(length + TCP_OVERSIZE));
  15984. }
  15985. }
  15986. #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  15987. p = pbuf_alloc(layer, alloc, PBUF_RAM);
  15988. 800d0a8: 2200 movs r2, #0
  15989. 800d0aa: f7fe fa5c bl 800b566 <pbuf_alloc>
  15990. if (p == NULL) {
  15991. 800d0ae: b120 cbz r0, 800d0ba <tcp_pbuf_prealloc+0x56>
  15992. return NULL;
  15993. }
  15994. LWIP_ASSERT("need unchained pbuf", p->next == NULL);
  15995. *oversize = p->len - length;
  15996. 800d0b0: 8943 ldrh r3, [r0, #10]
  15997. 800d0b2: 1b1b subs r3, r3, r4
  15998. 800d0b4: 8033 strh r3, [r6, #0]
  15999. /* trim p->len to the currently used size */
  16000. p->len = p->tot_len = length;
  16001. 800d0b6: 8104 strh r4, [r0, #8]
  16002. 800d0b8: 8144 strh r4, [r0, #10]
  16003. return p;
  16004. }
  16005. 800d0ba: bd70 pop {r4, r5, r6, pc}
  16006. 0800d0bc <tcp_create_segment>:
  16007. * The TCP header is filled in except ackno and wnd.
  16008. * p is freed on failure.
  16009. */
  16010. static struct tcp_seg *
  16011. tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags)
  16012. {
  16013. 800d0bc: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
  16014. 800d0c0: f89d 6020 ldrb.w r6, [sp, #32]
  16015. struct tcp_seg *seg;
  16016. u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags);
  16017. 800d0c4: f006 0702 and.w r7, r6, #2
  16018. 800d0c8: f016 0f01 tst.w r6, #1
  16019. 800d0cc: b2ff uxtb r7, r7
  16020. * The TCP header is filled in except ackno and wnd.
  16021. * p is freed on failure.
  16022. */
  16023. static struct tcp_seg *
  16024. tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags)
  16025. {
  16026. 800d0ce: 4680 mov r8, r0
  16027. 800d0d0: 469a mov sl, r3
  16028. struct tcp_seg *seg;
  16029. u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags);
  16030. 800d0d2: bf0c ite eq
  16031. 800d0d4: 2300 moveq r3, #0
  16032. 800d0d6: 2304 movne r3, #4
  16033. 800d0d8: 2f00 cmp r7, #0
  16034. 800d0da: bf14 ite ne
  16035. 800d0dc: 270c movne r7, #12
  16036. 800d0de: 2700 moveq r7, #0
  16037. if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) {
  16038. 800d0e0: 2004 movs r0, #4
  16039. * The TCP header is filled in except ackno and wnd.
  16040. * p is freed on failure.
  16041. */
  16042. static struct tcp_seg *
  16043. tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags)
  16044. {
  16045. 800d0e2: 460d mov r5, r1
  16046. 800d0e4: 4691 mov r9, r2
  16047. struct tcp_seg *seg;
  16048. u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags);
  16049. 800d0e6: 18ff adds r7, r7, r3
  16050. if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) {
  16051. 800d0e8: f7fe f8ca bl 800b280 <memp_malloc>
  16052. 800d0ec: 4604 mov r4, r0
  16053. 800d0ee: b918 cbnz r0, 800d0f8 <tcp_create_segment+0x3c>
  16054. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no memory.\n"));
  16055. pbuf_free(p);
  16056. 800d0f0: 4628 mov r0, r5
  16057. 800d0f2: f7fe f9e7 bl 800b4c4 <pbuf_free>
  16058. return NULL;
  16059. 800d0f6: e036 b.n 800d166 <tcp_create_segment+0xaa>
  16060. }
  16061. seg->flags = optflags;
  16062. 800d0f8: 7286 strb r6, [r0, #10]
  16063. seg->next = NULL;
  16064. seg->p = p;
  16065. seg->len = p->tot_len - optlen;
  16066. 800d0fa: 892b ldrh r3, [r5, #8]
  16067. pbuf_free(p);
  16068. return NULL;
  16069. }
  16070. seg->flags = optflags;
  16071. seg->next = NULL;
  16072. seg->p = p;
  16073. 800d0fc: 6045 str r5, [r0, #4]
  16074. seg->len = p->tot_len - optlen;
  16075. 800d0fe: 1bdb subs r3, r3, r7
  16076. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no memory.\n"));
  16077. pbuf_free(p);
  16078. return NULL;
  16079. }
  16080. seg->flags = optflags;
  16081. seg->next = NULL;
  16082. 800d100: 2600 movs r6, #0
  16083. 800d102: 6006 str r6, [r0, #0]
  16084. seg->p = p;
  16085. seg->len = p->tot_len - optlen;
  16086. 800d104: 8103 strh r3, [r0, #8]
  16087. LWIP_ASSERT("invalid optflags passed: TF_SEG_DATA_CHECKSUMMED",
  16088. (optflags & TF_SEG_DATA_CHECKSUMMED) == 0);
  16089. #endif /* TCP_CHECKSUM_ON_COPY */
  16090. /* build TCP header */
  16091. if (pbuf_header(p, TCP_HLEN)) {
  16092. 800d106: 2114 movs r1, #20
  16093. 800d108: 4628 mov r0, r5
  16094. 800d10a: f7fe f9b0 bl 800b46e <pbuf_header>
  16095. 800d10e: 4605 mov r5, r0
  16096. 800d110: b150 cbz r0, 800d128 <tcp_create_segment+0x6c>
  16097. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
  16098. TCP_STATS_INC(tcp.err);
  16099. 800d112: 4b16 ldr r3, [pc, #88] ; (800d16c <tcp_create_segment+0xb0>)
  16100. 800d114: f8b3 20a4 ldrh.w r2, [r3, #164] ; 0xa4
  16101. tcp_seg_free(seg);
  16102. 800d118: 4620 mov r0, r4
  16103. #endif /* TCP_CHECKSUM_ON_COPY */
  16104. /* build TCP header */
  16105. if (pbuf_header(p, TCP_HLEN)) {
  16106. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
  16107. TCP_STATS_INC(tcp.err);
  16108. 800d11a: 3201 adds r2, #1
  16109. 800d11c: f8a3 20a4 strh.w r2, [r3, #164] ; 0xa4
  16110. tcp_seg_free(seg);
  16111. return NULL;
  16112. 800d120: 4634 mov r4, r6
  16113. /* build TCP header */
  16114. if (pbuf_header(p, TCP_HLEN)) {
  16115. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
  16116. TCP_STATS_INC(tcp.err);
  16117. tcp_seg_free(seg);
  16118. 800d122: f7fe fc78 bl 800ba16 <tcp_seg_free>
  16119. return NULL;
  16120. 800d126: e01e b.n 800d166 <tcp_create_segment+0xaa>
  16121. }
  16122. seg->tcphdr = (struct tcp_hdr *)seg->p->payload;
  16123. 800d128: 6863 ldr r3, [r4, #4]
  16124. seg->tcphdr->src = htons(pcb->local_port);
  16125. 800d12a: f8b8 001a ldrh.w r0, [r8, #26]
  16126. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
  16127. TCP_STATS_INC(tcp.err);
  16128. tcp_seg_free(seg);
  16129. return NULL;
  16130. }
  16131. seg->tcphdr = (struct tcp_hdr *)seg->p->payload;
  16132. 800d12e: 685e ldr r6, [r3, #4]
  16133. 800d130: 60e6 str r6, [r4, #12]
  16134. seg->tcphdr->src = htons(pcb->local_port);
  16135. 800d132: f7fd f85a bl 800a1ea <lwip_htons>
  16136. 800d136: 8030 strh r0, [r6, #0]
  16137. seg->tcphdr->dest = htons(pcb->remote_port);
  16138. 800d138: f8b8 001c ldrh.w r0, [r8, #28]
  16139. 800d13c: 68e6 ldr r6, [r4, #12]
  16140. 800d13e: f7fd f854 bl 800a1ea <lwip_htons>
  16141. 800d142: 8070 strh r0, [r6, #2]
  16142. seg->tcphdr->seqno = htonl(seqno);
  16143. 800d144: 4650 mov r0, sl
  16144. 800d146: 68e6 ldr r6, [r4, #12]
  16145. 800d148: f7fd f859 bl 800a1fe <lwip_htonl>
  16146. /* ackno is set in tcp_output */
  16147. TCPH_HDRLEN_FLAGS_SET(seg->tcphdr, (5 + optlen / 4), flags);
  16148. 800d14c: 02bf lsls r7, r7, #10
  16149. return NULL;
  16150. }
  16151. seg->tcphdr = (struct tcp_hdr *)seg->p->payload;
  16152. seg->tcphdr->src = htons(pcb->local_port);
  16153. seg->tcphdr->dest = htons(pcb->remote_port);
  16154. seg->tcphdr->seqno = htonl(seqno);
  16155. 800d14e: 6070 str r0, [r6, #4]
  16156. /* ackno is set in tcp_output */
  16157. TCPH_HDRLEN_FLAGS_SET(seg->tcphdr, (5 + optlen / 4), flags);
  16158. 800d150: f507 40a0 add.w r0, r7, #20480 ; 0x5000
  16159. 800d154: ea40 0009 orr.w r0, r0, r9
  16160. 800d158: 68e6 ldr r6, [r4, #12]
  16161. 800d15a: f7fd f846 bl 800a1ea <lwip_htons>
  16162. 800d15e: 81b0 strh r0, [r6, #12]
  16163. /* wnd and chksum are set in tcp_output */
  16164. seg->tcphdr->urgp = 0;
  16165. 800d160: 68e3 ldr r3, [r4, #12]
  16166. 800d162: 749d strb r5, [r3, #18]
  16167. 800d164: 74dd strb r5, [r3, #19]
  16168. return seg;
  16169. }
  16170. 800d166: 4620 mov r0, r4
  16171. 800d168: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  16172. 800d16c: 20008220 .word 0x20008220
  16173. 0800d170 <tcp_output_alloc_header.constprop.0>:
  16174. static struct pbuf *
  16175. tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
  16176. u32_t seqno_be /* already in network byte order */)
  16177. {
  16178. struct tcp_hdr *tcphdr;
  16179. struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
  16180. 800d170: 3114 adds r1, #20
  16181. * @param datalen length of tcp data to reserve in pbuf
  16182. * @param seqno_be seqno in network byte order (big-endian)
  16183. * @return pbuf with p->payload being the tcp_hdr
  16184. */
  16185. static struct pbuf *
  16186. tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
  16187. 800d172: b5f8 push {r3, r4, r5, r6, r7, lr}
  16188. u32_t seqno_be /* already in network byte order */)
  16189. {
  16190. struct tcp_hdr *tcphdr;
  16191. struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
  16192. 800d174: b289 uxth r1, r1
  16193. * @param datalen length of tcp data to reserve in pbuf
  16194. * @param seqno_be seqno in network byte order (big-endian)
  16195. * @return pbuf with p->payload being the tcp_hdr
  16196. */
  16197. static struct pbuf *
  16198. tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
  16199. 800d176: 4605 mov r5, r0
  16200. 800d178: 4617 mov r7, r2
  16201. u32_t seqno_be /* already in network byte order */)
  16202. {
  16203. struct tcp_hdr *tcphdr;
  16204. struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
  16205. 800d17a: 2001 movs r0, #1
  16206. 800d17c: 2200 movs r2, #0
  16207. 800d17e: f7fe f9f2 bl 800b566 <pbuf_alloc>
  16208. if (p != NULL) {
  16209. 800d182: 4606 mov r6, r0
  16210. 800d184: b1f8 cbz r0, 800d1c6 <tcp_output_alloc_header.constprop.0+0x56>
  16211. LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
  16212. (p->len >= TCP_HLEN + optlen));
  16213. tcphdr = (struct tcp_hdr *)p->payload;
  16214. 800d186: 6844 ldr r4, [r0, #4]
  16215. tcphdr->src = htons(pcb->local_port);
  16216. 800d188: 8b68 ldrh r0, [r5, #26]
  16217. 800d18a: f7fd f82e bl 800a1ea <lwip_htons>
  16218. 800d18e: 8020 strh r0, [r4, #0]
  16219. tcphdr->dest = htons(pcb->remote_port);
  16220. 800d190: 8ba8 ldrh r0, [r5, #28]
  16221. 800d192: f7fd f82a bl 800a1ea <lwip_htons>
  16222. tcphdr->seqno = seqno_be;
  16223. 800d196: 6067 str r7, [r4, #4]
  16224. if (p != NULL) {
  16225. LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
  16226. (p->len >= TCP_HLEN + optlen));
  16227. tcphdr = (struct tcp_hdr *)p->payload;
  16228. tcphdr->src = htons(pcb->local_port);
  16229. tcphdr->dest = htons(pcb->remote_port);
  16230. 800d198: 8060 strh r0, [r4, #2]
  16231. tcphdr->seqno = seqno_be;
  16232. tcphdr->ackno = htonl(pcb->rcv_nxt);
  16233. 800d19a: 6aa8 ldr r0, [r5, #40] ; 0x28
  16234. 800d19c: f7fd f82f bl 800a1fe <lwip_htonl>
  16235. 800d1a0: 60a0 str r0, [r4, #8]
  16236. TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), TCP_ACK);
  16237. 800d1a2: f245 0010 movw r0, #20496 ; 0x5010
  16238. 800d1a6: f7fd f820 bl 800a1ea <lwip_htons>
  16239. 800d1aa: 81a0 strh r0, [r4, #12]
  16240. tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  16241. 800d1ac: 8de8 ldrh r0, [r5, #46] ; 0x2e
  16242. 800d1ae: f7fd f81c bl 800a1ea <lwip_htons>
  16243. tcphdr->chksum = 0;
  16244. 800d1b2: 2300 movs r3, #0
  16245. tcphdr->src = htons(pcb->local_port);
  16246. tcphdr->dest = htons(pcb->remote_port);
  16247. tcphdr->seqno = seqno_be;
  16248. tcphdr->ackno = htonl(pcb->rcv_nxt);
  16249. TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), TCP_ACK);
  16250. tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  16251. 800d1b4: 81e0 strh r0, [r4, #14]
  16252. tcphdr->chksum = 0;
  16253. 800d1b6: 7423 strb r3, [r4, #16]
  16254. 800d1b8: 7463 strb r3, [r4, #17]
  16255. tcphdr->urgp = 0;
  16256. 800d1ba: 74a3 strb r3, [r4, #18]
  16257. 800d1bc: 74e3 strb r3, [r4, #19]
  16258. /* If we're sending a packet, update the announced right window edge */
  16259. pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
  16260. 800d1be: 8dea ldrh r2, [r5, #46] ; 0x2e
  16261. 800d1c0: 6aab ldr r3, [r5, #40] ; 0x28
  16262. 800d1c2: 18d3 adds r3, r2, r3
  16263. 800d1c4: 632b str r3, [r5, #48] ; 0x30
  16264. }
  16265. return p;
  16266. }
  16267. 800d1c6: 4630 mov r0, r6
  16268. 800d1c8: bdf8 pop {r3, r4, r5, r6, r7, pc}
  16269. 800d1ca: 0000 movs r0, r0
  16270. 0800d1cc <tcp_write>:
  16271. * - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will be set on last segment sent,
  16272. * @return ERR_OK if enqueued, another err_t on error
  16273. */
  16274. err_t
  16275. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  16276. {
  16277. 800d1cc: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  16278. 800d1d0: b08f sub sp, #60 ; 0x3c
  16279. 800d1d2: 4691 mov r9, r2
  16280. 800d1d4: 9307 str r3, [sp, #28]
  16281. u16_t pos = 0; /* position in 'arg' data */
  16282. u16_t queuelen;
  16283. u8_t optlen = 0;
  16284. u8_t optflags = 0;
  16285. #if TCP_OVERSIZE
  16286. u16_t oversize = 0;
  16287. 800d1d6: 2300 movs r3, #0
  16288. 800d1d8: f8ad 3036 strh.w r3, [sp, #54] ; 0x36
  16289. * - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will be set on last segment sent,
  16290. * @return ERR_OK if enqueued, another err_t on error
  16291. */
  16292. err_t
  16293. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  16294. {
  16295. 800d1dc: 4604 mov r4, r0
  16296. u8_t concat_chksum_swapped = 0;
  16297. u16_t concat_chksummed = 0;
  16298. #endif /* TCP_CHECKSUM_ON_COPY */
  16299. err_t err;
  16300. /* don't allocate segments bigger than half the maximum window we ever received */
  16301. u16_t mss_local = LWIP_MIN(pcb->mss, pcb->snd_wnd_max/2);
  16302. 800d1de: f8b0 2062 ldrh.w r2, [r0, #98] ; 0x62
  16303. 800d1e2: 8ec3 ldrh r3, [r0, #54] ; 0x36
  16304. apiflags |= TCP_WRITE_FLAG_COPY;
  16305. #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  16306. LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n",
  16307. (void *)pcb, arg, len, (u16_t)apiflags));
  16308. LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)",
  16309. 800d1e4: 9106 str r1, [sp, #24]
  16310. 800d1e6: 2900 cmp r1, #0
  16311. 800d1e8: f000 8176 beq.w 800d4d8 <tcp_write+0x30c>
  16312. 800d1ec: 7e01 ldrb r1, [r0, #24]
  16313. 800d1ee: 2907 cmp r1, #7
  16314. 800d1f0: f200 8174 bhi.w 800d4dc <tcp_write+0x310>
  16315. 800d1f4: f990 1018 ldrsb.w r1, [r0, #24]
  16316. 800d1f8: f04f 5064 mov.w r0, #956301312 ; 0x39000000
  16317. 800d1fc: 4088 lsls r0, r1
  16318. 800d1fe: f140 816d bpl.w 800d4dc <tcp_write+0x310>
  16319. (pcb->state != CLOSE_WAIT) &&
  16320. (pcb->state != SYN_SENT) &&
  16321. (pcb->state != SYN_RCVD)) {
  16322. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_STATE | LWIP_DBG_LEVEL_SEVERE, ("tcp_write() called in invalid state\n"));
  16323. return ERR_CONN;
  16324. } else if (len == 0) {
  16325. 800d202: f1b9 0f00 cmp.w r9, #0
  16326. 800d206: d013 beq.n 800d230 <tcp_write+0x64>
  16327. return ERR_OK;
  16328. }
  16329. /* fail on too much data */
  16330. if (len > pcb->snd_buf) {
  16331. 800d208: f8b4 1066 ldrh.w r1, [r4, #102] ; 0x66
  16332. 800d20c: 4549 cmp r1, r9
  16333. 800d20e: d200 bcs.n 800d212 <tcp_write+0x46>
  16334. 800d210: e009 b.n 800d226 <tcp_write+0x5a>
  16335. LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_write: queuelen: %"U16_F"\n", (u16_t)pcb->snd_queuelen));
  16336. /* If total number of pbufs on the unsent/unacked queues exceeds the
  16337. * configured maximum, return an error */
  16338. /* check for configured max queuelen and possible overflow */
  16339. if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
  16340. 800d212: f8b4 1068 ldrh.w r1, [r4, #104] ; 0x68
  16341. 800d216: 2947 cmp r1, #71 ; 0x47
  16342. 800d218: d90a bls.n 800d230 <tcp_write+0x64>
  16343. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too long queue %"U16_F" (max %"U16_F")\n",
  16344. pcb->snd_queuelen, TCP_SND_QUEUELEN));
  16345. TCP_STATS_INC(tcp.memerr);
  16346. 800d21a: 4b94 ldr r3, [pc, #592] ; (800d46c <tcp_write+0x2a0>)
  16347. 800d21c: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
  16348. 800d220: 3201 adds r2, #1
  16349. 800d222: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
  16350. pcb->flags |= TF_NAGLEMEMERR;
  16351. 800d226: 7fa3 ldrb r3, [r4, #30]
  16352. 800d228: f063 037f orn r3, r3, #127 ; 0x7f
  16353. 800d22c: 77a3 strb r3, [r4, #30]
  16354. 800d22e: e159 b.n 800d4e4 <tcp_write+0x318>
  16355. u8_t concat_chksum_swapped = 0;
  16356. u16_t concat_chksummed = 0;
  16357. #endif /* TCP_CHECKSUM_ON_COPY */
  16358. err_t err;
  16359. /* don't allocate segments bigger than half the maximum window we ever received */
  16360. u16_t mss_local = LWIP_MIN(pcb->mss, pcb->snd_wnd_max/2);
  16361. 800d230: 0852 lsrs r2, r2, #1
  16362. *
  16363. * pos records progress as data is segmented.
  16364. */
  16365. /* Find the tail of the unsent queue. */
  16366. if (pcb->unsent != NULL) {
  16367. 800d232: 6ee6 ldr r6, [r4, #108] ; 0x6c
  16368. err = tcp_write_checks(pcb, len);
  16369. if (err != ERR_OK) {
  16370. return err;
  16371. }
  16372. queuelen = pcb->snd_queuelen;
  16373. 800d234: f8b4 b068 ldrh.w fp, [r4, #104] ; 0x68
  16374. u8_t concat_chksum_swapped = 0;
  16375. u16_t concat_chksummed = 0;
  16376. #endif /* TCP_CHECKSUM_ON_COPY */
  16377. err_t err;
  16378. /* don't allocate segments bigger than half the maximum window we ever received */
  16379. u16_t mss_local = LWIP_MIN(pcb->mss, pcb->snd_wnd_max/2);
  16380. 800d238: 429a cmp r2, r3
  16381. 800d23a: bf28 it cs
  16382. 800d23c: 461a movcs r2, r3
  16383. 800d23e: 920a str r2, [sp, #40] ; 0x28
  16384. *
  16385. * pos records progress as data is segmented.
  16386. */
  16387. /* Find the tail of the unsent queue. */
  16388. if (pcb->unsent != NULL) {
  16389. 800d240: b90e cbnz r6, 800d246 <tcp_write+0x7a>
  16390. 800d242: e066 b.n 800d312 <tcp_write+0x146>
  16391. u16_t space;
  16392. u16_t unsent_optlen;
  16393. /* @todo: this could be sped up by keeping last_unsent in the pcb */
  16394. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  16395. last_unsent = last_unsent->next);
  16396. 800d244: 461e mov r6, r3
  16397. if (pcb->unsent != NULL) {
  16398. u16_t space;
  16399. u16_t unsent_optlen;
  16400. /* @todo: this could be sped up by keeping last_unsent in the pcb */
  16401. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  16402. 800d246: 6833 ldr r3, [r6, #0]
  16403. 800d248: 2b00 cmp r3, #0
  16404. 800d24a: d1fb bne.n 800d244 <tcp_write+0x78>
  16405. last_unsent = last_unsent->next);
  16406. /* Usable space at the end of the last unsent segment */
  16407. unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags);
  16408. 800d24c: 7ab3 ldrb r3, [r6, #10]
  16409. space = mss_local - (last_unsent->len + unsent_optlen);
  16410. 800d24e: 8937 ldrh r7, [r6, #8]
  16411. /* @todo: this could be sped up by keeping last_unsent in the pcb */
  16412. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  16413. last_unsent = last_unsent->next);
  16414. /* Usable space at the end of the last unsent segment */
  16415. unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags);
  16416. 800d250: 980a ldr r0, [sp, #40] ; 0x28
  16417. #if TCP_OVERSIZE_DBGCHECK
  16418. /* check that pcb->unsent_oversize matches last_unsent->unsent_oversize */
  16419. LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)",
  16420. pcb->unsent_oversize == last_unsent->oversize_left);
  16421. #endif /* TCP_OVERSIZE_DBGCHECK */
  16422. oversize = pcb->unsent_oversize;
  16423. 800d252: f8b4 506a ldrh.w r5, [r4, #106] ; 0x6a
  16424. /* @todo: this could be sped up by keeping last_unsent in the pcb */
  16425. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  16426. last_unsent = last_unsent->next);
  16427. /* Usable space at the end of the last unsent segment */
  16428. unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags);
  16429. 800d256: f013 0f01 tst.w r3, #1
  16430. 800d25a: f003 0302 and.w r3, r3, #2
  16431. 800d25e: bf0c ite eq
  16432. 800d260: 2100 moveq r1, #0
  16433. 800d262: 2104 movne r1, #4
  16434. 800d264: b2db uxtb r3, r3
  16435. 800d266: 1bc2 subs r2, r0, r7
  16436. 800d268: 2b00 cmp r3, #0
  16437. 800d26a: bf14 ite ne
  16438. 800d26c: 230c movne r3, #12
  16439. 800d26e: 2300 moveq r3, #0
  16440. space = mss_local - (last_unsent->len + unsent_optlen);
  16441. 800d270: 1a52 subs r2, r2, r1
  16442. 800d272: 1ad2 subs r2, r2, r3
  16443. 800d274: b292 uxth r2, r2
  16444. /* check that pcb->unsent_oversize matches last_unsent->unsent_oversize */
  16445. LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)",
  16446. pcb->unsent_oversize == last_unsent->oversize_left);
  16447. #endif /* TCP_OVERSIZE_DBGCHECK */
  16448. oversize = pcb->unsent_oversize;
  16449. if (oversize > 0) {
  16450. 800d276: b91d cbnz r5, 800d280 <tcp_write+0xb4>
  16451. #if TCP_OVERSIZE_DBGCHECK
  16452. /* check that pcb->unsent_oversize matches last_unsent->unsent_oversize */
  16453. LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)",
  16454. pcb->unsent_oversize == last_unsent->oversize_left);
  16455. #endif /* TCP_OVERSIZE_DBGCHECK */
  16456. oversize = pcb->unsent_oversize;
  16457. 800d278: f8ad 5036 strh.w r5, [sp, #54] ; 0x36
  16458. */
  16459. err_t
  16460. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  16461. {
  16462. struct pbuf *concat_p = NULL;
  16463. struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
  16464. 800d27c: 462b mov r3, r5
  16465. 800d27e: e00a b.n 800d296 <tcp_write+0xca>
  16466. #endif /* TCP_OVERSIZE_DBGCHECK */
  16467. oversize = pcb->unsent_oversize;
  16468. if (oversize > 0) {
  16469. LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
  16470. seg = last_unsent;
  16471. oversize_used = oversize < len ? oversize : len;
  16472. 800d280: 45a9 cmp r9, r5
  16473. 800d282: bf34 ite cc
  16474. 800d284: 464b movcc r3, r9
  16475. 800d286: 462b movcs r3, r5
  16476. pos += oversize_used;
  16477. oversize -= oversize_used;
  16478. 800d288: 1aed subs r5, r5, r3
  16479. space -= oversize_used;
  16480. 800d28a: 1ad2 subs r2, r2, r3
  16481. if (oversize > 0) {
  16482. LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
  16483. seg = last_unsent;
  16484. oversize_used = oversize < len ? oversize : len;
  16485. pos += oversize_used;
  16486. oversize -= oversize_used;
  16487. 800d28c: f8ad 5036 strh.w r5, [sp, #54] ; 0x36
  16488. space -= oversize_used;
  16489. 800d290: b292 uxth r2, r2
  16490. oversize = pcb->unsent_oversize;
  16491. if (oversize > 0) {
  16492. LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
  16493. seg = last_unsent;
  16494. oversize_used = oversize < len ? oversize : len;
  16495. pos += oversize_used;
  16496. 800d292: 461d mov r5, r3
  16497. oversize -= oversize_used;
  16498. space -= oversize_used;
  16499. 800d294: 4633 mov r3, r6
  16500. *
  16501. * We don't extend segments containing SYN/FIN flags or options
  16502. * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
  16503. * the end.
  16504. */
  16505. if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
  16506. 800d296: 454d cmp r5, r9
  16507. 800d298: d23f bcs.n 800d31a <tcp_write+0x14e>
  16508. 800d29a: 2a00 cmp r2, #0
  16509. 800d29c: d03d beq.n 800d31a <tcp_write+0x14e>
  16510. 800d29e: 2f00 cmp r7, #0
  16511. 800d2a0: d03e beq.n 800d320 <tcp_write+0x154>
  16512. seg = last_unsent;
  16513. /* Create a pbuf with a copy or reference to seglen bytes. We
  16514. * can use PBUF_RAW here since the data appears in the middle of
  16515. * a segment. A header will never be prepended. */
  16516. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16517. 800d2a2: 9907 ldr r1, [sp, #28]
  16518. * We don't extend segments containing SYN/FIN flags or options
  16519. * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
  16520. * the end.
  16521. */
  16522. if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
  16523. u16_t seglen = space < len - pos ? space : len - pos;
  16524. 800d2a4: ebc5 0a09 rsb sl, r5, r9
  16525. 800d2a8: 4592 cmp sl, r2
  16526. 800d2aa: bfa8 it ge
  16527. 800d2ac: 4692 movge sl, r2
  16528. seg = last_unsent;
  16529. /* Create a pbuf with a copy or reference to seglen bytes. We
  16530. * can use PBUF_RAW here since the data appears in the middle of
  16531. * a segment. A header will never be prepended. */
  16532. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16533. 800d2ae: 07cb lsls r3, r1, #31
  16534. * We don't extend segments containing SYN/FIN flags or options
  16535. * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
  16536. * the end.
  16537. */
  16538. if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
  16539. u16_t seglen = space < len - pos ? space : len - pos;
  16540. 800d2b0: fa1f f88a uxth.w r8, sl
  16541. seg = last_unsent;
  16542. /* Create a pbuf with a copy or reference to seglen bytes. We
  16543. * can use PBUF_RAW here since the data appears in the middle of
  16544. * a segment. A header will never be prepended. */
  16545. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16546. 800d2b4: d514 bpl.n 800d2e0 <tcp_write+0x114>
  16547. /* Data is copied */
  16548. if ((concat_p = tcp_pbuf_prealloc(PBUF_RAW, seglen, space, &oversize, pcb, apiflags, 1)) == NULL) {
  16549. 800d2b6: 2301 movs r3, #1
  16550. 800d2b8: 9101 str r1, [sp, #4]
  16551. 800d2ba: 9302 str r3, [sp, #8]
  16552. 800d2bc: 9400 str r4, [sp, #0]
  16553. 800d2be: 2003 movs r0, #3
  16554. 800d2c0: 4641 mov r1, r8
  16555. 800d2c2: f10d 0336 add.w r3, sp, #54 ; 0x36
  16556. 800d2c6: f7ff fecd bl 800d064 <tcp_pbuf_prealloc>
  16557. 800d2ca: 4607 mov r7, r0
  16558. 800d2cc: 2800 cmp r0, #0
  16559. 800d2ce: f000 80eb beq.w 800d4a8 <tcp_write+0x2dc>
  16560. goto memerr;
  16561. }
  16562. #if TCP_OVERSIZE_DBGCHECK
  16563. last_unsent->oversize_left += oversize;
  16564. #endif /* TCP_OVERSIZE_DBGCHECK */
  16565. TCP_DATA_COPY2(concat_p->payload, (u8_t*)arg + pos, seglen, &concat_chksum, &concat_chksum_swapped);
  16566. 800d2d2: 9a06 ldr r2, [sp, #24]
  16567. 800d2d4: 6840 ldr r0, [r0, #4]
  16568. 800d2d6: 1951 adds r1, r2, r5
  16569. 800d2d8: 4642 mov r2, r8
  16570. 800d2da: f7fc f893 bl 8009404 <memcpy>
  16571. 800d2de: e00b b.n 800d2f8 <tcp_write+0x12c>
  16572. #if TCP_CHECKSUM_ON_COPY
  16573. concat_chksummed += seglen;
  16574. #endif /* TCP_CHECKSUM_ON_COPY */
  16575. } else {
  16576. /* Data is not copied */
  16577. if ((concat_p = pbuf_alloc(PBUF_RAW, seglen, PBUF_ROM)) == NULL) {
  16578. 800d2e0: 2003 movs r0, #3
  16579. 800d2e2: 4641 mov r1, r8
  16580. 800d2e4: 2201 movs r2, #1
  16581. 800d2e6: f7fe f93e bl 800b566 <pbuf_alloc>
  16582. 800d2ea: 4607 mov r7, r0
  16583. 800d2ec: 2800 cmp r0, #0
  16584. 800d2ee: f000 80db beq.w 800d4a8 <tcp_write+0x2dc>
  16585. tcp_seg_add_chksum(~inet_chksum((u8_t*)arg + pos, seglen), seglen,
  16586. &concat_chksum, &concat_chksum_swapped);
  16587. concat_chksummed += seglen;
  16588. #endif /* TCP_CHECKSUM_ON_COPY */
  16589. /* reference the non-volatile payload data */
  16590. concat_p->payload = (u8_t*)arg + pos;
  16591. 800d2f2: 9806 ldr r0, [sp, #24]
  16592. 800d2f4: 1943 adds r3, r0, r5
  16593. 800d2f6: 607b str r3, [r7, #4]
  16594. }
  16595. pos += seglen;
  16596. queuelen += pbuf_clen(concat_p);
  16597. 800d2f8: 4638 mov r0, r7
  16598. 800d2fa: f7fe f9bb bl 800b674 <pbuf_clen>
  16599. #endif /* TCP_CHECKSUM_ON_COPY */
  16600. /* reference the non-volatile payload data */
  16601. concat_p->payload = (u8_t*)arg + pos;
  16602. }
  16603. pos += seglen;
  16604. 800d2fe: 44a8 add r8, r5
  16605. 800d300: fa1f f888 uxth.w r8, r8
  16606. queuelen += pbuf_clen(concat_p);
  16607. 800d304: 4458 add r0, fp
  16608. 800d306: 46aa mov sl, r5
  16609. 800d308: fa1f fb80 uxth.w fp, r0
  16610. #endif /* TCP_CHECKSUM_ON_COPY */
  16611. /* reference the non-volatile payload data */
  16612. concat_p->payload = (u8_t*)arg + pos;
  16613. }
  16614. pos += seglen;
  16615. 800d30c: 4645 mov r5, r8
  16616. queuelen += pbuf_clen(concat_p);
  16617. 800d30e: 4633 mov r3, r6
  16618. 800d310: e007 b.n 800d322 <tcp_write+0x156>
  16619. u16_t queuelen;
  16620. u8_t optlen = 0;
  16621. u8_t optflags = 0;
  16622. #if TCP_OVERSIZE
  16623. u16_t oversize = 0;
  16624. u16_t oversize_used = 0;
  16625. 800d312: 46b2 mov sl, r6
  16626. err_t
  16627. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  16628. {
  16629. struct pbuf *concat_p = NULL;
  16630. struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
  16631. u16_t pos = 0; /* position in 'arg' data */
  16632. 800d314: 4635 mov r5, r6
  16633. */
  16634. err_t
  16635. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  16636. {
  16637. struct pbuf *concat_p = NULL;
  16638. struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
  16639. 800d316: 4633 mov r3, r6
  16640. 800d318: e000 b.n 800d31c <tcp_write+0x150>
  16641. *
  16642. * We don't extend segments containing SYN/FIN flags or options
  16643. * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
  16644. * the end.
  16645. */
  16646. if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
  16647. 800d31a: 46aa mov sl, r5
  16648. * @return ERR_OK if enqueued, another err_t on error
  16649. */
  16650. err_t
  16651. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  16652. {
  16653. struct pbuf *concat_p = NULL;
  16654. 800d31c: 2700 movs r7, #0
  16655. 800d31e: e000 b.n 800d322 <tcp_write+0x156>
  16656. *
  16657. * We don't extend segments containing SYN/FIN flags or options
  16658. * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
  16659. * the end.
  16660. */
  16661. if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
  16662. 800d320: 46aa mov sl, r5
  16663. #if TCP_CHECKSUM_ON_COPY
  16664. u16_t chksum = 0;
  16665. u8_t chksum_swapped = 0;
  16666. #endif /* TCP_CHECKSUM_ON_COPY */
  16667. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16668. 800d322: 9907 ldr r1, [sp, #28]
  16669. seg->chksum_swapped = chksum_swapped;
  16670. seg->flags |= TF_SEG_DATA_CHECKSUMMED;
  16671. #endif /* TCP_CHECKSUM_ON_COPY */
  16672. /* first segment of to-be-queued data? */
  16673. if (queue == NULL) {
  16674. 800d324: f04f 0800 mov.w r8, #0
  16675. #if TCP_CHECKSUM_ON_COPY
  16676. u16_t chksum = 0;
  16677. u8_t chksum_swapped = 0;
  16678. #endif /* TCP_CHECKSUM_ON_COPY */
  16679. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16680. 800d328: f001 0101 and.w r1, r1, #1
  16681. seg->chksum_swapped = chksum_swapped;
  16682. seg->flags |= TF_SEG_DATA_CHECKSUMMED;
  16683. #endif /* TCP_CHECKSUM_ON_COPY */
  16684. /* first segment of to-be-queued data? */
  16685. if (queue == NULL) {
  16686. 800d32c: f8cd 802c str.w r8, [sp, #44] ; 0x2c
  16687. #if TCP_CHECKSUM_ON_COPY
  16688. u16_t chksum = 0;
  16689. u8_t chksum_swapped = 0;
  16690. #endif /* TCP_CHECKSUM_ON_COPY */
  16691. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16692. 800d330: 9108 str r1, [sp, #32]
  16693. 800d332: e068 b.n 800d406 <tcp_write+0x23a>
  16694. * The new segments are chained together in the local 'queue'
  16695. * variable, ready to be appended to pcb->unsent.
  16696. */
  16697. while (pos < len) {
  16698. struct pbuf *p;
  16699. u16_t left = len - pos;
  16700. 800d334: ebc5 0309 rsb r3, r5, r9
  16701. u16_t max_len = mss_local - optlen;
  16702. u16_t seglen = left > max_len ? max_len : left;
  16703. 800d338: 9a0a ldr r2, [sp, #40] ; 0x28
  16704. 800d33a: b29b uxth r3, r3
  16705. 800d33c: 4293 cmp r3, r2
  16706. 800d33e: bf38 it cc
  16707. 800d340: 461a movcc r2, r3
  16708. #if TCP_CHECKSUM_ON_COPY
  16709. u16_t chksum = 0;
  16710. u8_t chksum_swapped = 0;
  16711. #endif /* TCP_CHECKSUM_ON_COPY */
  16712. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16713. 800d342: 9b08 ldr r3, [sp, #32]
  16714. */
  16715. while (pos < len) {
  16716. struct pbuf *p;
  16717. u16_t left = len - pos;
  16718. u16_t max_len = mss_local - optlen;
  16719. u16_t seglen = left > max_len ? max_len : left;
  16720. 800d344: 9209 str r2, [sp, #36] ; 0x24
  16721. #if TCP_CHECKSUM_ON_COPY
  16722. u16_t chksum = 0;
  16723. u8_t chksum_swapped = 0;
  16724. #endif /* TCP_CHECKSUM_ON_COPY */
  16725. if (apiflags & TCP_WRITE_FLAG_COPY) {
  16726. 800d346: b1db cbz r3, 800d380 <tcp_write+0x1b4>
  16727. /* If copy is set, memory should be allocated and data copied
  16728. * into pbuf */
  16729. if ((p = tcp_pbuf_prealloc(PBUF_TRANSPORT, seglen + optlen, mss_local, &oversize, pcb, apiflags, queue == NULL)) == NULL) {
  16730. 800d348: f1d8 0301 rsbs r3, r8, #1
  16731. 800d34c: 9807 ldr r0, [sp, #28]
  16732. 800d34e: 9400 str r4, [sp, #0]
  16733. 800d350: bf38 it cc
  16734. 800d352: 2300 movcc r3, #0
  16735. 800d354: 9001 str r0, [sp, #4]
  16736. 800d356: 9302 str r3, [sp, #8]
  16737. 800d358: 4611 mov r1, r2
  16738. 800d35a: 2000 movs r0, #0
  16739. 800d35c: 9a0a ldr r2, [sp, #40] ; 0x28
  16740. 800d35e: f10d 0336 add.w r3, sp, #54 ; 0x36
  16741. 800d362: f7ff fe7f bl 800d064 <tcp_pbuf_prealloc>
  16742. 800d366: 4684 mov ip, r0
  16743. 800d368: 2800 cmp r0, #0
  16744. 800d36a: f000 80a0 beq.w 800d4ae <tcp_write+0x2e2>
  16745. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write : could not allocate memory for pbuf copy size %"U16_F"\n", seglen));
  16746. goto memerr;
  16747. }
  16748. LWIP_ASSERT("tcp_write: check that first pbuf can hold the complete seglen",
  16749. (p->len >= seglen));
  16750. TCP_DATA_COPY2((char *)p->payload + optlen, (u8_t*)arg + pos, seglen, &chksum, &chksum_swapped);
  16751. 800d36e: 9a06 ldr r2, [sp, #24]
  16752. 800d370: 6840 ldr r0, [r0, #4]
  16753. 800d372: f8cd c014 str.w ip, [sp, #20]
  16754. 800d376: 1951 adds r1, r2, r5
  16755. 800d378: 9a09 ldr r2, [sp, #36] ; 0x24
  16756. 800d37a: f7fc f843 bl 8009404 <memcpy>
  16757. 800d37e: e019 b.n 800d3b4 <tcp_write+0x1e8>
  16758. */
  16759. struct pbuf *p2;
  16760. #if TCP_OVERSIZE
  16761. LWIP_ASSERT("oversize == 0", oversize == 0);
  16762. #endif /* TCP_OVERSIZE */
  16763. if ((p2 = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_ROM)) == NULL) {
  16764. 800d380: 9808 ldr r0, [sp, #32]
  16765. 800d382: 9909 ldr r1, [sp, #36] ; 0x24
  16766. 800d384: 2201 movs r2, #1
  16767. 800d386: f7fe f8ee bl 800b566 <pbuf_alloc>
  16768. 800d38a: 4603 mov r3, r0
  16769. 800d38c: 2800 cmp r0, #0
  16770. 800d38e: f000 808e beq.w 800d4ae <tcp_write+0x2e2>
  16771. #if TCP_CHECKSUM_ON_COPY
  16772. /* calculate the checksum of nocopy-data */
  16773. chksum = ~inet_chksum((u8_t*)arg + pos, seglen);
  16774. #endif /* TCP_CHECKSUM_ON_COPY */
  16775. /* reference the non-volatile payload data */
  16776. p2->payload = (u8_t*)arg + pos;
  16777. 800d392: 9806 ldr r0, [sp, #24]
  16778. 800d394: 1942 adds r2, r0, r5
  16779. /* Second, allocate a pbuf for the headers. */
  16780. if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
  16781. 800d396: 9808 ldr r0, [sp, #32]
  16782. #if TCP_CHECKSUM_ON_COPY
  16783. /* calculate the checksum of nocopy-data */
  16784. chksum = ~inet_chksum((u8_t*)arg + pos, seglen);
  16785. #endif /* TCP_CHECKSUM_ON_COPY */
  16786. /* reference the non-volatile payload data */
  16787. p2->payload = (u8_t*)arg + pos;
  16788. 800d398: 605a str r2, [r3, #4]
  16789. /* Second, allocate a pbuf for the headers. */
  16790. if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
  16791. 800d39a: 4601 mov r1, r0
  16792. 800d39c: 4602 mov r2, r0
  16793. 800d39e: 9305 str r3, [sp, #20]
  16794. 800d3a0: f7fe f8e1 bl 800b566 <pbuf_alloc>
  16795. 800d3a4: 9b05 ldr r3, [sp, #20]
  16796. 800d3a6: b908 cbnz r0, 800d3ac <tcp_write+0x1e0>
  16797. /* If allocation fails, we have to deallocate the data pbuf as
  16798. * well. */
  16799. pbuf_free(p2);
  16800. 800d3a8: 4618 mov r0, r3
  16801. 800d3aa: e013 b.n 800d3d4 <tcp_write+0x208>
  16802. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: could not allocate memory for header pbuf\n"));
  16803. goto memerr;
  16804. }
  16805. /* Concatenate the headers and data pbufs together. */
  16806. pbuf_cat(p/*header*/, p2/*data*/);
  16807. 800d3ac: 4619 mov r1, r3
  16808. 800d3ae: 9005 str r0, [sp, #20]
  16809. 800d3b0: f7fe f96e bl 800b690 <pbuf_cat>
  16810. 800d3b4: f8dd c014 ldr.w ip, [sp, #20]
  16811. }
  16812. queuelen += pbuf_clen(p);
  16813. 800d3b8: 4660 mov r0, ip
  16814. 800d3ba: f8cd c014 str.w ip, [sp, #20]
  16815. 800d3be: f7fe f959 bl 800b674 <pbuf_clen>
  16816. 800d3c2: 4458 add r0, fp
  16817. 800d3c4: fa1f fb80 uxth.w fp, r0
  16818. /* Now that there are more segments queued, we check again if the
  16819. * length of the queue exceeds the configured maximum or
  16820. * overflows. */
  16821. if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
  16822. 800d3c8: f1bb 0f48 cmp.w fp, #72 ; 0x48
  16823. 800d3cc: f8dd c014 ldr.w ip, [sp, #20]
  16824. 800d3d0: d903 bls.n 800d3da <tcp_write+0x20e>
  16825. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: queue too long %"U16_F" (%"U16_F")\n", queuelen, TCP_SND_QUEUELEN));
  16826. pbuf_free(p);
  16827. 800d3d2: 4660 mov r0, ip
  16828. 800d3d4: f7fe f876 bl 800b4c4 <pbuf_free>
  16829. goto memerr;
  16830. 800d3d8: e069 b.n 800d4ae <tcp_write+0x2e2>
  16831. }
  16832. if ((seg = tcp_create_segment(pcb, p, 0, pcb->snd_lbb + pos, optflags)) == NULL) {
  16833. 800d3da: 6de3 ldr r3, [r4, #92] ; 0x5c
  16834. 800d3dc: 2200 movs r2, #0
  16835. 800d3de: 18eb adds r3, r5, r3
  16836. 800d3e0: 9200 str r2, [sp, #0]
  16837. 800d3e2: 4620 mov r0, r4
  16838. 800d3e4: 4661 mov r1, ip
  16839. 800d3e6: f7ff fe69 bl 800d0bc <tcp_create_segment>
  16840. 800d3ea: 4603 mov r3, r0
  16841. 800d3ec: 2800 cmp r0, #0
  16842. 800d3ee: d05e beq.n 800d4ae <tcp_write+0x2e2>
  16843. seg->chksum_swapped = chksum_swapped;
  16844. seg->flags |= TF_SEG_DATA_CHECKSUMMED;
  16845. #endif /* TCP_CHECKSUM_ON_COPY */
  16846. /* first segment of to-be-queued data? */
  16847. if (queue == NULL) {
  16848. 800d3f0: f1b8 0f00 cmp.w r8, #0
  16849. 800d3f4: d002 beq.n 800d3fc <tcp_write+0x230>
  16850. queue = seg;
  16851. } else {
  16852. /* Attach the segment to the end of the queued segments */
  16853. LWIP_ASSERT("prev_seg != NULL", prev_seg != NULL);
  16854. prev_seg->next = seg;
  16855. 800d3f6: 990b ldr r1, [sp, #44] ; 0x2c
  16856. 800d3f8: 6008 str r0, [r1, #0]
  16857. 800d3fa: e000 b.n 800d3fe <tcp_write+0x232>
  16858. seg->chksum_swapped = chksum_swapped;
  16859. seg->flags |= TF_SEG_DATA_CHECKSUMMED;
  16860. #endif /* TCP_CHECKSUM_ON_COPY */
  16861. /* first segment of to-be-queued data? */
  16862. if (queue == NULL) {
  16863. 800d3fc: 4680 mov r8, r0
  16864. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE, ("tcp_write: queueing %"U32_F":%"U32_F"\n",
  16865. ntohl(seg->tcphdr->seqno),
  16866. ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg)));
  16867. pos += seglen;
  16868. 800d3fe: 9a09 ldr r2, [sp, #36] ; 0x24
  16869. 800d400: 930b str r3, [sp, #44] ; 0x2c
  16870. 800d402: 1955 adds r5, r2, r5
  16871. 800d404: b2ad uxth r5, r5
  16872. * Phase 3: Create new segments.
  16873. *
  16874. * The new segments are chained together in the local 'queue'
  16875. * variable, ready to be appended to pcb->unsent.
  16876. */
  16877. while (pos < len) {
  16878. 800d406: 454d cmp r5, r9
  16879. 800d408: d394 bcc.n 800d334 <tcp_write+0x168>
  16880. /*
  16881. * Phase 1: If data has been added to the preallocated tail of
  16882. * last_unsent, we update the length fields of the pbuf chain.
  16883. */
  16884. #if TCP_OVERSIZE
  16885. if (oversize_used > 0) {
  16886. 800d40a: f1ba 0f00 cmp.w sl, #0
  16887. 800d40e: d019 beq.n 800d444 <tcp_write+0x278>
  16888. struct pbuf *p;
  16889. /* Bump tot_len of whole chain, len of tail */
  16890. for (p = last_unsent->p; p; p = p->next) {
  16891. 800d410: 6875 ldr r5, [r6, #4]
  16892. 800d412: e011 b.n 800d438 <tcp_write+0x26c>
  16893. p->tot_len += oversize_used;
  16894. 800d414: 892a ldrh r2, [r5, #8]
  16895. 800d416: 4452 add r2, sl
  16896. 800d418: 812a strh r2, [r5, #8]
  16897. if (p->next == NULL) {
  16898. 800d41a: 682a ldr r2, [r5, #0]
  16899. 800d41c: b95a cbnz r2, 800d436 <tcp_write+0x26a>
  16900. TCP_DATA_COPY((char *)p->payload + p->len, arg, oversize_used, last_unsent);
  16901. 800d41e: 686a ldr r2, [r5, #4]
  16902. 800d420: 8968 ldrh r0, [r5, #10]
  16903. 800d422: 9906 ldr r1, [sp, #24]
  16904. 800d424: 9305 str r3, [sp, #20]
  16905. 800d426: 1810 adds r0, r2, r0
  16906. 800d428: 4652 mov r2, sl
  16907. 800d42a: f7fb ffeb bl 8009404 <memcpy>
  16908. p->len += oversize_used;
  16909. 800d42e: 896a ldrh r2, [r5, #10]
  16910. 800d430: 9b05 ldr r3, [sp, #20]
  16911. 800d432: 4452 add r2, sl
  16912. 800d434: 816a strh r2, [r5, #10]
  16913. */
  16914. #if TCP_OVERSIZE
  16915. if (oversize_used > 0) {
  16916. struct pbuf *p;
  16917. /* Bump tot_len of whole chain, len of tail */
  16918. for (p = last_unsent->p; p; p = p->next) {
  16919. 800d436: 682d ldr r5, [r5, #0]
  16920. 800d438: 2d00 cmp r5, #0
  16921. 800d43a: d1eb bne.n 800d414 <tcp_write+0x248>
  16922. if (p->next == NULL) {
  16923. TCP_DATA_COPY((char *)p->payload + p->len, arg, oversize_used, last_unsent);
  16924. p->len += oversize_used;
  16925. }
  16926. }
  16927. last_unsent->len += oversize_used;
  16928. 800d43c: 8932 ldrh r2, [r6, #8]
  16929. 800d43e: 4492 add sl, r2
  16930. 800d440: f8a6 a008 strh.w sl, [r6, #8]
  16931. LWIP_ASSERT("last_unsent->oversize_left >= oversize_used",
  16932. last_unsent->oversize_left >= oversize_used);
  16933. last_unsent->oversize_left -= oversize_used;
  16934. #endif /* TCP_OVERSIZE_DBGCHECK */
  16935. }
  16936. pcb->unsent_oversize = oversize;
  16937. 800d444: f8bd 2036 ldrh.w r2, [sp, #54] ; 0x36
  16938. 800d448: f8a4 206a strh.w r2, [r4, #106] ; 0x6a
  16939. #endif /* TCP_OVERSIZE */
  16940. /*
  16941. * Phase 2: concat_p can be concatenated onto last_unsent->p
  16942. */
  16943. if (concat_p != NULL) {
  16944. 800d44c: b157 cbz r7, 800d464 <tcp_write+0x298>
  16945. LWIP_ASSERT("tcp_write: cannot concatenate when pcb->unsent is empty",
  16946. (last_unsent != NULL));
  16947. pbuf_cat(last_unsent->p, concat_p);
  16948. 800d44e: 6870 ldr r0, [r6, #4]
  16949. 800d450: 9305 str r3, [sp, #20]
  16950. 800d452: 4639 mov r1, r7
  16951. 800d454: f7fe f91c bl 800b690 <pbuf_cat>
  16952. last_unsent->len += concat_p->tot_len;
  16953. 800d458: 8939 ldrh r1, [r7, #8]
  16954. 800d45a: 8932 ldrh r2, [r6, #8]
  16955. 800d45c: 9b05 ldr r3, [sp, #20]
  16956. 800d45e: 188a adds r2, r1, r2
  16957. 800d460: 8132 strh r2, [r6, #8]
  16958. 800d462: e005 b.n 800d470 <tcp_write+0x2a4>
  16959. /*
  16960. * Phase 3: Append queue to pcb->unsent. Queue may be NULL, but that
  16961. * is harmless
  16962. */
  16963. if (last_unsent == NULL) {
  16964. 800d464: b926 cbnz r6, 800d470 <tcp_write+0x2a4>
  16965. pcb->unsent = queue;
  16966. 800d466: f8c4 806c str.w r8, [r4, #108] ; 0x6c
  16967. 800d46a: e003 b.n 800d474 <tcp_write+0x2a8>
  16968. 800d46c: 20008220 .word 0x20008220
  16969. } else {
  16970. last_unsent->next = queue;
  16971. 800d470: f8c6 8000 str.w r8, [r6]
  16972. }
  16973. /*
  16974. * Finally update the pcb state.
  16975. */
  16976. pcb->snd_lbb += len;
  16977. 800d474: 6de2 ldr r2, [r4, #92] ; 0x5c
  16978. pcb->snd_buf -= len;
  16979. pcb->snd_queuelen = queuelen;
  16980. 800d476: f8a4 b068 strh.w fp, [r4, #104] ; 0x68
  16981. }
  16982. /*
  16983. * Finally update the pcb state.
  16984. */
  16985. pcb->snd_lbb += len;
  16986. 800d47a: 444a add r2, r9
  16987. 800d47c: 65e2 str r2, [r4, #92] ; 0x5c
  16988. pcb->snd_buf -= len;
  16989. 800d47e: f8b4 2066 ldrh.w r2, [r4, #102] ; 0x66
  16990. 800d482: ebc9 0902 rsb r9, r9, r2
  16991. 800d486: f8a4 9066 strh.w r9, [r4, #102] ; 0x66
  16992. LWIP_ASSERT("tcp_write: valid queue length",
  16993. pcb->unacked != NULL || pcb->unsent != NULL);
  16994. }
  16995. /* Set the PSH flag in the last segment that we enqueued. */
  16996. if (seg != NULL && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE)==0)) {
  16997. 800d48a: b363 cbz r3, 800d4e6 <tcp_write+0x31a>
  16998. 800d48c: 68dc ldr r4, [r3, #12]
  16999. 800d48e: b33c cbz r4, 800d4e0 <tcp_write+0x314>
  17000. 800d490: 9b07 ldr r3, [sp, #28]
  17001. 800d492: f003 0502 and.w r5, r3, #2
  17002. 800d496: b2ed uxtb r5, r5
  17003. 800d498: bb15 cbnz r5, 800d4e0 <tcp_write+0x314>
  17004. TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
  17005. 800d49a: 2008 movs r0, #8
  17006. 800d49c: 89a6 ldrh r6, [r4, #12]
  17007. 800d49e: f7fc fea4 bl 800a1ea <lwip_htons>
  17008. 800d4a2: 4330 orrs r0, r6
  17009. 800d4a4: 81a0 strh r0, [r4, #12]
  17010. 800d4a6: e01b b.n 800d4e0 <tcp_write+0x314>
  17011. */
  17012. err_t
  17013. tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
  17014. {
  17015. struct pbuf *concat_p = NULL;
  17016. struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
  17017. 800d4a8: f04f 0800 mov.w r8, #0
  17018. 800d4ac: 4647 mov r7, r8
  17019. TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
  17020. }
  17021. return ERR_OK;
  17022. memerr:
  17023. pcb->flags |= TF_NAGLEMEMERR;
  17024. 800d4ae: 7fa3 ldrb r3, [r4, #30]
  17025. 800d4b0: f063 037f orn r3, r3, #127 ; 0x7f
  17026. 800d4b4: 77a3 strb r3, [r4, #30]
  17027. TCP_STATS_INC(tcp.memerr);
  17028. 800d4b6: 4b0e ldr r3, [pc, #56] ; (800d4f0 <tcp_write+0x324>)
  17029. 800d4b8: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
  17030. 800d4bc: 3201 adds r2, #1
  17031. 800d4be: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
  17032. if (concat_p != NULL) {
  17033. 800d4c2: b117 cbz r7, 800d4ca <tcp_write+0x2fe>
  17034. pbuf_free(concat_p);
  17035. 800d4c4: 4638 mov r0, r7
  17036. 800d4c6: f7fd fffd bl 800b4c4 <pbuf_free>
  17037. }
  17038. if (queue != NULL) {
  17039. 800d4ca: f1b8 0f00 cmp.w r8, #0
  17040. 800d4ce: d009 beq.n 800d4e4 <tcp_write+0x318>
  17041. tcp_segs_free(queue);
  17042. 800d4d0: 4640 mov r0, r8
  17043. 800d4d2: f7fe fab0 bl 800ba36 <tcp_segs_free>
  17044. 800d4d6: e005 b.n 800d4e4 <tcp_write+0x318>
  17045. apiflags |= TCP_WRITE_FLAG_COPY;
  17046. #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  17047. LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n",
  17048. (void *)pcb, arg, len, (u16_t)apiflags));
  17049. LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)",
  17050. 800d4d8: 23f2 movs r3, #242 ; 0xf2
  17051. 800d4da: e004 b.n 800d4e6 <tcp_write+0x31a>
  17052. if ((pcb->state != ESTABLISHED) &&
  17053. (pcb->state != CLOSE_WAIT) &&
  17054. (pcb->state != SYN_SENT) &&
  17055. (pcb->state != SYN_RCVD)) {
  17056. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_STATE | LWIP_DBG_LEVEL_SEVERE, ("tcp_write() called in invalid state\n"));
  17057. return ERR_CONN;
  17058. 800d4dc: 23f3 movs r3, #243 ; 0xf3
  17059. 800d4de: e002 b.n 800d4e6 <tcp_write+0x31a>
  17060. /* Set the PSH flag in the last segment that we enqueued. */
  17061. if (seg != NULL && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE)==0)) {
  17062. TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
  17063. }
  17064. return ERR_OK;
  17065. 800d4e0: 2300 movs r3, #0
  17066. 800d4e2: e000 b.n 800d4e6 <tcp_write+0x31a>
  17067. if (pcb->snd_queuelen != 0) {
  17068. LWIP_ASSERT("tcp_write: valid queue length", pcb->unacked != NULL ||
  17069. pcb->unsent != NULL);
  17070. }
  17071. LWIP_DEBUGF(TCP_QLEN_DEBUG | LWIP_DBG_STATE, ("tcp_write: %"S16_F" (with mem err)\n", pcb->snd_queuelen));
  17072. return ERR_MEM;
  17073. 800d4e4: 23ff movs r3, #255 ; 0xff
  17074. 800d4e6: b258 sxtb r0, r3
  17075. }
  17076. 800d4e8: b00f add sp, #60 ; 0x3c
  17077. 800d4ea: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  17078. 800d4ee: bf00 nop
  17079. 800d4f0: 20008220 .word 0x20008220
  17080. 0800d4f4 <tcp_enqueue_flags>:
  17081. LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)",
  17082. (flags & (TCP_SYN | TCP_FIN)) != 0);
  17083. /* check for configured max queuelen and possible overflow */
  17084. if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
  17085. 800d4f4: f8b0 3068 ldrh.w r3, [r0, #104] ; 0x68
  17086. 800d4f8: 2b47 cmp r3, #71 ; 0x47
  17087. * @param optdata pointer to TCP options, or NULL.
  17088. * @param optlen length of TCP options in bytes.
  17089. */
  17090. err_t
  17091. tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)
  17092. {
  17093. 800d4fa: b573 push {r0, r1, r4, r5, r6, lr}
  17094. 800d4fc: 4604 mov r4, r0
  17095. 800d4fe: 460d mov r5, r1
  17096. LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)",
  17097. (flags & (TCP_SYN | TCP_FIN)) != 0);
  17098. /* check for configured max queuelen and possible overflow */
  17099. if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
  17100. 800d500: d90a bls.n 800d518 <tcp_enqueue_flags+0x24>
  17101. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue_flags: too long queue %"U16_F" (max %"U16_F")\n",
  17102. pcb->snd_queuelen, TCP_SND_QUEUELEN));
  17103. TCP_STATS_INC(tcp.memerr);
  17104. 800d502: 4b29 ldr r3, [pc, #164] ; (800d5a8 <tcp_enqueue_flags+0xb4>)
  17105. 800d504: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
  17106. 800d508: 3201 adds r2, #1
  17107. 800d50a: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
  17108. pcb->flags |= TF_NAGLEMEMERR;
  17109. 800d50e: 7f83 ldrb r3, [r0, #30]
  17110. 800d510: f063 037f orn r3, r3, #127 ; 0x7f
  17111. 800d514: 7783 strb r3, [r0, #30]
  17112. 800d516: e00b b.n 800d530 <tcp_enqueue_flags+0x3c>
  17113. /* tcp_enqueue_flags is always called with either SYN or FIN in flags.
  17114. * We need one available snd_buf byte to do that.
  17115. * This means we can't send FIN while snd_buf==0. A better fix would be to
  17116. * not include SYN and FIN sequence numbers in the snd_buf count. */
  17117. if (pcb->snd_buf == 0) {
  17118. 800d518: f8b0 3066 ldrh.w r3, [r0, #102] ; 0x66
  17119. err_t
  17120. tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)
  17121. {
  17122. struct pbuf *p;
  17123. struct tcp_seg *seg;
  17124. u8_t optflags = 0;
  17125. 800d51c: f3c1 0640 ubfx r6, r1, #1, #1
  17126. #if LWIP_TCP_TIMESTAMPS
  17127. if ((pcb->flags & TF_TIMESTAMP)) {
  17128. optflags |= TF_SEG_OPTS_TS;
  17129. }
  17130. #endif /* LWIP_TCP_TIMESTAMPS */
  17131. optlen = LWIP_TCP_OPT_LENGTH(optflags);
  17132. 800d520: 00b1 lsls r1, r6, #2
  17133. /* tcp_enqueue_flags is always called with either SYN or FIN in flags.
  17134. * We need one available snd_buf byte to do that.
  17135. * This means we can't send FIN while snd_buf==0. A better fix would be to
  17136. * not include SYN and FIN sequence numbers in the snd_buf count. */
  17137. if (pcb->snd_buf == 0) {
  17138. 800d522: b93b cbnz r3, 800d534 <tcp_enqueue_flags+0x40>
  17139. LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue_flags: no send buffer available\n"));
  17140. TCP_STATS_INC(tcp.memerr);
  17141. 800d524: 4b20 ldr r3, [pc, #128] ; (800d5a8 <tcp_enqueue_flags+0xb4>)
  17142. 800d526: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
  17143. 800d52a: 3201 adds r2, #1
  17144. 800d52c: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
  17145. return ERR_MEM;
  17146. 800d530: 20ff movs r0, #255 ; 0xff
  17147. 800d532: e037 b.n 800d5a4 <tcp_enqueue_flags+0xb0>
  17148. }
  17149. /* Allocate pbuf with room for TCP header + options */
  17150. if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
  17151. 800d534: 2000 movs r0, #0
  17152. 800d536: 4602 mov r2, r0
  17153. 800d538: f7fe f815 bl 800b566 <pbuf_alloc>
  17154. 800d53c: 4601 mov r1, r0
  17155. 800d53e: b900 cbnz r0, 800d542 <tcp_enqueue_flags+0x4e>
  17156. 800d540: e006 b.n 800d550 <tcp_enqueue_flags+0x5c>
  17157. }
  17158. LWIP_ASSERT("tcp_enqueue_flags: check that first pbuf can hold optlen",
  17159. (p->len >= optlen));
  17160. /* Allocate memory for tcp_seg, and fill in fields. */
  17161. if ((seg = tcp_create_segment(pcb, p, flags, pcb->snd_lbb, optflags)) == NULL) {
  17162. 800d542: 9600 str r6, [sp, #0]
  17163. 800d544: 4620 mov r0, r4
  17164. 800d546: 462a mov r2, r5
  17165. 800d548: 6de3 ldr r3, [r4, #92] ; 0x5c
  17166. 800d54a: f7ff fdb7 bl 800d0bc <tcp_create_segment>
  17167. 800d54e: b920 cbnz r0, 800d55a <tcp_enqueue_flags+0x66>
  17168. pcb->flags |= TF_NAGLEMEMERR;
  17169. 800d550: 7fa3 ldrb r3, [r4, #30]
  17170. 800d552: f063 037f orn r3, r3, #127 ; 0x7f
  17171. 800d556: 77a3 strb r3, [r4, #30]
  17172. 800d558: e7e4 b.n 800d524 <tcp_enqueue_flags+0x30>
  17173. ntohl(seg->tcphdr->seqno),
  17174. ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg),
  17175. (u16_t)flags));
  17176. /* Now append seg to pcb->unsent queue */
  17177. if (pcb->unsent == NULL) {
  17178. 800d55a: 6ee3 ldr r3, [r4, #108] ; 0x6c
  17179. 800d55c: b913 cbnz r3, 800d564 <tcp_enqueue_flags+0x70>
  17180. pcb->unsent = seg;
  17181. 800d55e: 66e0 str r0, [r4, #108] ; 0x6c
  17182. 800d560: e004 b.n 800d56c <tcp_enqueue_flags+0x78>
  17183. } else {
  17184. struct tcp_seg *useg;
  17185. for (useg = pcb->unsent; useg->next != NULL; useg = useg->next);
  17186. 800d562: 4613 mov r3, r2
  17187. 800d564: 681a ldr r2, [r3, #0]
  17188. 800d566: 2a00 cmp r2, #0
  17189. 800d568: d1fb bne.n 800d562 <tcp_enqueue_flags+0x6e>
  17190. useg->next = seg;
  17191. 800d56a: 6018 str r0, [r3, #0]
  17192. }
  17193. #if TCP_OVERSIZE
  17194. /* The new unsent tail has no space */
  17195. pcb->unsent_oversize = 0;
  17196. 800d56c: 2300 movs r3, #0
  17197. #endif /* TCP_OVERSIZE */
  17198. /* SYN and FIN bump the sequence number */
  17199. if ((flags & TCP_SYN) || (flags & TCP_FIN)) {
  17200. 800d56e: 07a9 lsls r1, r5, #30
  17201. for (useg = pcb->unsent; useg->next != NULL; useg = useg->next);
  17202. useg->next = seg;
  17203. }
  17204. #if TCP_OVERSIZE
  17205. /* The new unsent tail has no space */
  17206. pcb->unsent_oversize = 0;
  17207. 800d570: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
  17208. #endif /* TCP_OVERSIZE */
  17209. /* SYN and FIN bump the sequence number */
  17210. if ((flags & TCP_SYN) || (flags & TCP_FIN)) {
  17211. 800d574: d007 beq.n 800d586 <tcp_enqueue_flags+0x92>
  17212. pcb->snd_lbb++;
  17213. 800d576: 6de3 ldr r3, [r4, #92] ; 0x5c
  17214. 800d578: 3301 adds r3, #1
  17215. 800d57a: 65e3 str r3, [r4, #92] ; 0x5c
  17216. /* optlen does not influence snd_buf */
  17217. pcb->snd_buf--;
  17218. 800d57c: f8b4 3066 ldrh.w r3, [r4, #102] ; 0x66
  17219. 800d580: 3b01 subs r3, #1
  17220. 800d582: f8a4 3066 strh.w r3, [r4, #102] ; 0x66
  17221. }
  17222. if (flags & TCP_FIN) {
  17223. 800d586: 07ea lsls r2, r5, #31
  17224. 800d588: d503 bpl.n 800d592 <tcp_enqueue_flags+0x9e>
  17225. pcb->flags |= TF_FIN;
  17226. 800d58a: 7fa3 ldrb r3, [r4, #30]
  17227. 800d58c: f043 0320 orr.w r3, r3, #32
  17228. 800d590: 77a3 strb r3, [r4, #30]
  17229. }
  17230. /* update number of segments on the queues */
  17231. pcb->snd_queuelen += pbuf_clen(seg->p);
  17232. 800d592: 6840 ldr r0, [r0, #4]
  17233. 800d594: f8b4 5068 ldrh.w r5, [r4, #104] ; 0x68
  17234. 800d598: f7fe f86c bl 800b674 <pbuf_clen>
  17235. 800d59c: 1940 adds r0, r0, r5
  17236. 800d59e: f8a4 0068 strh.w r0, [r4, #104] ; 0x68
  17237. if (pcb->snd_queuelen != 0) {
  17238. LWIP_ASSERT("tcp_enqueue_flags: invalid queue length",
  17239. pcb->unacked != NULL || pcb->unsent != NULL);
  17240. }
  17241. return ERR_OK;
  17242. 800d5a2: 2000 movs r0, #0
  17243. }
  17244. 800d5a4: b240 sxtb r0, r0
  17245. 800d5a6: bd7c pop {r2, r3, r4, r5, r6, pc}
  17246. 800d5a8: 20008220 .word 0x20008220
  17247. 0800d5ac <tcp_send_fin>:
  17248. * @param pcb the tcp_pcb over which to send a segment
  17249. * @return ERR_OK if sent, another err_t otherwise
  17250. */
  17251. err_t
  17252. tcp_send_fin(struct tcp_pcb *pcb)
  17253. {
  17254. 800d5ac: b5f8 push {r3, r4, r5, r6, r7, lr}
  17255. /* first, try to add the fin to the last unsent segment */
  17256. if (pcb->unsent != NULL) {
  17257. 800d5ae: 6ec4 ldr r4, [r0, #108] ; 0x6c
  17258. * @param pcb the tcp_pcb over which to send a segment
  17259. * @return ERR_OK if sent, another err_t otherwise
  17260. */
  17261. err_t
  17262. tcp_send_fin(struct tcp_pcb *pcb)
  17263. {
  17264. 800d5b0: 4605 mov r5, r0
  17265. /* first, try to add the fin to the last unsent segment */
  17266. if (pcb->unsent != NULL) {
  17267. 800d5b2: b90c cbnz r4, 800d5b8 <tcp_send_fin+0xc>
  17268. 800d5b4: e00a b.n 800d5cc <tcp_send_fin+0x20>
  17269. struct tcp_seg *last_unsent;
  17270. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  17271. last_unsent = last_unsent->next);
  17272. 800d5b6: 461c mov r4, r3
  17273. tcp_send_fin(struct tcp_pcb *pcb)
  17274. {
  17275. /* first, try to add the fin to the last unsent segment */
  17276. if (pcb->unsent != NULL) {
  17277. struct tcp_seg *last_unsent;
  17278. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  17279. 800d5b8: 6823 ldr r3, [r4, #0]
  17280. 800d5ba: 2b00 cmp r3, #0
  17281. 800d5bc: d1fb bne.n 800d5b6 <tcp_send_fin+0xa>
  17282. last_unsent = last_unsent->next);
  17283. if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) {
  17284. 800d5be: 68e3 ldr r3, [r4, #12]
  17285. 800d5c0: 8998 ldrh r0, [r3, #12]
  17286. 800d5c2: f7fc fe17 bl 800a1f4 <lwip_ntohs>
  17287. 800d5c6: f010 0607 ands.w r6, r0, #7
  17288. 800d5ca: d005 beq.n 800d5d8 <tcp_send_fin+0x2c>
  17289. pcb->flags |= TF_FIN;
  17290. return ERR_OK;
  17291. }
  17292. }
  17293. /* no data, no length, flags, copy=1, no optdata */
  17294. return tcp_enqueue_flags(pcb, TCP_FIN);
  17295. 800d5cc: 4628 mov r0, r5
  17296. 800d5ce: 2101 movs r1, #1
  17297. }
  17298. 800d5d0: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr}
  17299. pcb->flags |= TF_FIN;
  17300. return ERR_OK;
  17301. }
  17302. }
  17303. /* no data, no length, flags, copy=1, no optdata */
  17304. return tcp_enqueue_flags(pcb, TCP_FIN);
  17305. 800d5d4: f7ff bf8e b.w 800d4f4 <tcp_enqueue_flags>
  17306. for (last_unsent = pcb->unsent; last_unsent->next != NULL;
  17307. last_unsent = last_unsent->next);
  17308. if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) {
  17309. /* no SYN/FIN/RST flag in the header, we can add the FIN flag */
  17310. TCPH_SET_FLAG(last_unsent->tcphdr, TCP_FIN);
  17311. 800d5d8: 68e4 ldr r4, [r4, #12]
  17312. 800d5da: 2001 movs r0, #1
  17313. 800d5dc: 89a7 ldrh r7, [r4, #12]
  17314. 800d5de: f7fc fe04 bl 800a1ea <lwip_htons>
  17315. 800d5e2: 4338 orrs r0, r7
  17316. 800d5e4: 81a0 strh r0, [r4, #12]
  17317. pcb->flags |= TF_FIN;
  17318. 800d5e6: 7fab ldrb r3, [r5, #30]
  17319. 800d5e8: f043 0320 orr.w r3, r3, #32
  17320. 800d5ec: 77ab strb r3, [r5, #30]
  17321. return ERR_OK;
  17322. }
  17323. }
  17324. /* no data, no length, flags, copy=1, no optdata */
  17325. return tcp_enqueue_flags(pcb, TCP_FIN);
  17326. }
  17327. 800d5ee: 4630 mov r0, r6
  17328. 800d5f0: bdf8 pop {r3, r4, r5, r6, r7, pc}
  17329. 0800d5f2 <tcp_send_empty_ack>:
  17330. *
  17331. * @param pcb Protocol control block for the TCP connection to send the ACK
  17332. */
  17333. err_t
  17334. tcp_send_empty_ack(struct tcp_pcb *pcb)
  17335. {
  17336. 800d5f2: b537 push {r0, r1, r2, r4, r5, lr}
  17337. 800d5f4: 4604 mov r4, r0
  17338. if (pcb->flags & TF_TIMESTAMP) {
  17339. optlen = LWIP_TCP_OPT_LENGTH(TF_SEG_OPTS_TS);
  17340. }
  17341. #endif
  17342. p = tcp_output_alloc_header(pcb, optlen, 0, htonl(pcb->snd_nxt));
  17343. 800d5f6: 6d00 ldr r0, [r0, #80] ; 0x50
  17344. 800d5f8: f7fc fe01 bl 800a1fe <lwip_htonl>
  17345. 800d5fc: 2100 movs r1, #0
  17346. 800d5fe: 4602 mov r2, r0
  17347. 800d600: 4620 mov r0, r4
  17348. 800d602: f7ff fdb5 bl 800d170 <tcp_output_alloc_header.constprop.0>
  17349. if (p == NULL) {
  17350. 800d606: 4605 mov r5, r0
  17351. 800d608: b188 cbz r0, 800d62e <tcp_send_empty_ack+0x3c>
  17352. }
  17353. tcphdr = (struct tcp_hdr *)p->payload;
  17354. LWIP_DEBUGF(TCP_OUTPUT_DEBUG,
  17355. ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
  17356. /* remove ACK flags from the PCB, as we send an empty ACK now */
  17357. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  17358. 800d60a: 7fa3 ldrb r3, [r4, #30]
  17359. #endif
  17360. #if LWIP_NETIF_HWADDRHINT
  17361. ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17362. IP_PROTO_TCP, &(pcb->addr_hint));
  17363. #else /* LWIP_NETIF_HWADDRHINT*/
  17364. ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17365. 800d60c: 7a62 ldrb r2, [r4, #9]
  17366. }
  17367. tcphdr = (struct tcp_hdr *)p->payload;
  17368. LWIP_DEBUGF(TCP_OUTPUT_DEBUG,
  17369. ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
  17370. /* remove ACK flags from the PCB, as we send an empty ACK now */
  17371. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  17372. 800d60e: f023 0303 bic.w r3, r3, #3
  17373. #endif
  17374. #if LWIP_NETIF_HWADDRHINT
  17375. ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17376. IP_PROTO_TCP, &(pcb->addr_hint));
  17377. #else /* LWIP_NETIF_HWADDRHINT*/
  17378. ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17379. 800d612: 9200 str r2, [sp, #0]
  17380. 800d614: 2206 movs r2, #6
  17381. }
  17382. tcphdr = (struct tcp_hdr *)p->payload;
  17383. LWIP_DEBUGF(TCP_OUTPUT_DEBUG,
  17384. ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
  17385. /* remove ACK flags from the PCB, as we send an empty ACK now */
  17386. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  17387. 800d616: 77a3 strb r3, [r4, #30]
  17388. #endif
  17389. #if LWIP_NETIF_HWADDRHINT
  17390. ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17391. IP_PROTO_TCP, &(pcb->addr_hint));
  17392. #else /* LWIP_NETIF_HWADDRHINT*/
  17393. ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17394. 800d618: 9201 str r2, [sp, #4]
  17395. 800d61a: 7aa3 ldrb r3, [r4, #10]
  17396. 800d61c: 4621 mov r1, r4
  17397. 800d61e: 1d22 adds r2, r4, #4
  17398. 800d620: f001 f8d4 bl 800e7cc <ip_output>
  17399. IP_PROTO_TCP);
  17400. #endif /* LWIP_NETIF_HWADDRHINT*/
  17401. pbuf_free(p);
  17402. 800d624: 4628 mov r0, r5
  17403. 800d626: f7fd ff4d bl 800b4c4 <pbuf_free>
  17404. return ERR_OK;
  17405. 800d62a: 2000 movs r0, #0
  17406. 800d62c: e000 b.n 800d630 <tcp_send_empty_ack+0x3e>
  17407. #endif
  17408. p = tcp_output_alloc_header(pcb, optlen, 0, htonl(pcb->snd_nxt));
  17409. if (p == NULL) {
  17410. LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: (ACK) could not allocate pbuf\n"));
  17411. return ERR_BUF;
  17412. 800d62e: 20fe movs r0, #254 ; 0xfe
  17413. IP_PROTO_TCP);
  17414. #endif /* LWIP_NETIF_HWADDRHINT*/
  17415. pbuf_free(p);
  17416. return ERR_OK;
  17417. }
  17418. 800d630: b240 sxtb r0, r0
  17419. 800d632: bd3e pop {r1, r2, r3, r4, r5, pc}
  17420. 0800d634 <tcp_output>:
  17421. * @return ERR_OK if data has been sent or nothing to send
  17422. * another err_t on error
  17423. */
  17424. err_t
  17425. tcp_output(struct tcp_pcb *pcb)
  17426. {
  17427. 800d634: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  17428. /* First, check if we are invoked by the TCP input processing
  17429. code. If so, we do not output anything. Instead, we rely on the
  17430. input processing code to call us when input processing is done
  17431. with. */
  17432. if (tcp_input_pcb == pcb) {
  17433. 800d638: 4b99 ldr r3, [pc, #612] ; (800d8a0 <tcp_output+0x26c>)
  17434. 800d63a: 681b ldr r3, [r3, #0]
  17435. 800d63c: 4283 cmp r3, r0
  17436. * @return ERR_OK if data has been sent or nothing to send
  17437. * another err_t on error
  17438. */
  17439. err_t
  17440. tcp_output(struct tcp_pcb *pcb)
  17441. {
  17442. 800d63e: b085 sub sp, #20
  17443. 800d640: 4604 mov r4, r0
  17444. /* First, check if we are invoked by the TCP input processing
  17445. code. If so, we do not output anything. Instead, we rely on the
  17446. input processing code to call us when input processing is done
  17447. with. */
  17448. if (tcp_input_pcb == pcb) {
  17449. 800d642: f000 8128 beq.w 800d896 <tcp_output+0x262>
  17450. return ERR_OK;
  17451. }
  17452. wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
  17453. 800d646: f8b0 304c ldrh.w r3, [r0, #76] ; 0x4c
  17454. 800d64a: f8b0 8060 ldrh.w r8, [r0, #96] ; 0x60
  17455. seg = pcb->unsent;
  17456. 800d64e: 6ec5 ldr r5, [r0, #108] ; 0x6c
  17457. with. */
  17458. if (tcp_input_pcb == pcb) {
  17459. return ERR_OK;
  17460. }
  17461. wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
  17462. 800d650: 4598 cmp r8, r3
  17463. 800d652: bf28 it cs
  17464. 800d654: 4698 movcs r8, r3
  17465. * because the ->unsent queue is empty or because the window does
  17466. * not allow it), construct an empty ACK segment and send it.
  17467. *
  17468. * If data is to be sent, we will just piggyback the ACK (see below).
  17469. */
  17470. if (pcb->flags & TF_ACK_NOW &&
  17471. 800d656: 7f83 ldrb r3, [r0, #30]
  17472. 800d658: f003 0302 and.w r3, r3, #2
  17473. 800d65c: b2db uxtb r3, r3
  17474. 800d65e: b183 cbz r3, 800d682 <tcp_output+0x4e>
  17475. 800d660: b92d cbnz r5, 800d66e <tcp_output+0x3a>
  17476. (seg == NULL ||
  17477. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
  17478. return tcp_send_empty_ack(pcb);
  17479. 800d662: 4620 mov r0, r4
  17480. }
  17481. #endif /* TCP_OVERSIZE */
  17482. pcb->flags &= ~TF_NAGLEMEMERR;
  17483. return ERR_OK;
  17484. }
  17485. 800d664: b005 add sp, #20
  17486. 800d666: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  17487. * If data is to be sent, we will just piggyback the ACK (see below).
  17488. */
  17489. if (pcb->flags & TF_ACK_NOW &&
  17490. (seg == NULL ||
  17491. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
  17492. return tcp_send_empty_ack(pcb);
  17493. 800d66a: f7ff bfc2 b.w 800d5f2 <tcp_send_empty_ack>
  17494. *
  17495. * If data is to be sent, we will just piggyback the ACK (see below).
  17496. */
  17497. if (pcb->flags & TF_ACK_NOW &&
  17498. (seg == NULL ||
  17499. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
  17500. 800d66e: 68eb ldr r3, [r5, #12]
  17501. 800d670: 6858 ldr r0, [r3, #4]
  17502. 800d672: f7fc fdc6 bl 800a202 <lwip_ntohl>
  17503. 800d676: 892a ldrh r2, [r5, #8]
  17504. 800d678: 6ca3 ldr r3, [r4, #72] ; 0x48
  17505. 800d67a: 1ad3 subs r3, r2, r3
  17506. 800d67c: 1818 adds r0, r3, r0
  17507. * not allow it), construct an empty ACK segment and send it.
  17508. *
  17509. * If data is to be sent, we will just piggyback the ACK (see below).
  17510. */
  17511. if (pcb->flags & TF_ACK_NOW &&
  17512. (seg == NULL ||
  17513. 800d67e: 4540 cmp r0, r8
  17514. 800d680: d8ef bhi.n 800d662 <tcp_output+0x2e>
  17515. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
  17516. return tcp_send_empty_ack(pcb);
  17517. }
  17518. /* useg should point to last segment on unacked queue */
  17519. useg = pcb->unacked;
  17520. 800d682: 6f26 ldr r6, [r4, #112] ; 0x70
  17521. if (useg != NULL) {
  17522. 800d684: b90e cbnz r6, 800d68a <tcp_output+0x56>
  17523. 800d686: e0e5 b.n 800d854 <tcp_output+0x220>
  17524. for (; useg->next != NULL; useg = useg->next);
  17525. 800d688: 461e mov r6, r3
  17526. 800d68a: 6833 ldr r3, [r6, #0]
  17527. 800d68c: 2b00 cmp r3, #0
  17528. 800d68e: d1fb bne.n 800d688 <tcp_output+0x54>
  17529. 800d690: e0e0 b.n 800d854 <tcp_output+0x220>
  17530. }
  17531. #endif /* TCP_CWND_DEBUG */
  17532. /* data available and window allows it to be sent? */
  17533. while (seg != NULL &&
  17534. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
  17535. LWIP_ASSERT("RST not expected here!",
  17536. 800d692: 68eb ldr r3, [r5, #12]
  17537. 800d694: 8998 ldrh r0, [r3, #12]
  17538. 800d696: f7fc fdad bl 800a1f4 <lwip_ntohs>
  17539. * - if tcp_write had a memory error before (prevent delayed ACK timeout) or
  17540. * - if FIN was already enqueued for this PCB (SYN is always alone in a segment -
  17541. * either seg->next != NULL or pcb->unacked == NULL;
  17542. * RST is no sent using tcp_write/tcp_output.
  17543. */
  17544. if((tcp_do_output_nagle(pcb) == 0) &&
  17545. 800d69a: 6f23 ldr r3, [r4, #112] ; 0x70
  17546. 800d69c: b19b cbz r3, 800d6c6 <tcp_output+0x92>
  17547. 800d69e: 7fa2 ldrb r2, [r4, #30]
  17548. 800d6a0: f012 0f44 tst.w r2, #68 ; 0x44
  17549. 800d6a4: d10f bne.n 800d6c6 <tcp_output+0x92>
  17550. 800d6a6: 6ee3 ldr r3, [r4, #108] ; 0x6c
  17551. 800d6a8: b12b cbz r3, 800d6b6 <tcp_output+0x82>
  17552. 800d6aa: 6819 ldr r1, [r3, #0]
  17553. 800d6ac: b959 cbnz r1, 800d6c6 <tcp_output+0x92>
  17554. 800d6ae: 8919 ldrh r1, [r3, #8]
  17555. 800d6b0: 8ee3 ldrh r3, [r4, #54] ; 0x36
  17556. 800d6b2: 4299 cmp r1, r3
  17557. 800d6b4: d207 bcs.n 800d6c6 <tcp_output+0x92>
  17558. 800d6b6: f8b4 3066 ldrh.w r3, [r4, #102] ; 0x66
  17559. 800d6ba: b123 cbz r3, 800d6c6 <tcp_output+0x92>
  17560. 800d6bc: f8b4 3068 ldrh.w r3, [r4, #104] ; 0x68
  17561. 800d6c0: 2b47 cmp r3, #71 ; 0x47
  17562. 800d6c2: f240 80e3 bls.w 800d88c <tcp_output+0x258>
  17563. pcb->lastack,
  17564. ntohl(seg->tcphdr->seqno), pcb->lastack, i));
  17565. ++i;
  17566. #endif /* TCP_CWND_DEBUG */
  17567. pcb->unsent = seg->next;
  17568. 800d6c6: 682b ldr r3, [r5, #0]
  17569. 800d6c8: 66e3 str r3, [r4, #108] ; 0x6c
  17570. if (pcb->state != SYN_SENT) {
  17571. 800d6ca: 7e23 ldrb r3, [r4, #24]
  17572. 800d6cc: 2b02 cmp r3, #2
  17573. 800d6ce: d00f beq.n 800d6f0 <tcp_output+0xbc>
  17574. TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
  17575. 800d6d0: f8d5 b00c ldr.w fp, [r5, #12]
  17576. 800d6d4: f8bb 300c ldrh.w r3, [fp, #12]
  17577. 800d6d8: 2010 movs r0, #16
  17578. 800d6da: 9303 str r3, [sp, #12]
  17579. 800d6dc: f7fc fd85 bl 800a1ea <lwip_htons>
  17580. 800d6e0: 9b03 ldr r3, [sp, #12]
  17581. 800d6e2: 4318 orrs r0, r3
  17582. 800d6e4: f8ab 000c strh.w r0, [fp, #12]
  17583. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  17584. 800d6e8: 7fa3 ldrb r3, [r4, #30]
  17585. 800d6ea: f023 0303 bic.w r3, r3, #3
  17586. 800d6ee: 77a3 strb r3, [r4, #30]
  17587. /** @bug Exclude retransmitted segments from this count. */
  17588. snmp_inc_tcpoutsegs();
  17589. /* The TCP header has already been constructed, but the ackno and
  17590. wnd fields remain. */
  17591. seg->tcphdr->ackno = htonl(pcb->rcv_nxt);
  17592. 800d6f0: 6aa0 ldr r0, [r4, #40] ; 0x28
  17593. 800d6f2: f8d5 b00c ldr.w fp, [r5, #12]
  17594. 800d6f6: f7fc fd82 bl 800a1fe <lwip_htonl>
  17595. 800d6fa: f8cb 0008 str.w r0, [fp, #8]
  17596. /* advertise our receive window size in this TCP segment */
  17597. seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  17598. 800d6fe: 8de0 ldrh r0, [r4, #46] ; 0x2e
  17599. 800d700: f8d5 b00c ldr.w fp, [r5, #12]
  17600. 800d704: f7fc fd71 bl 800a1ea <lwip_htons>
  17601. 800d708: f8ab 000e strh.w r0, [fp, #14]
  17602. pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
  17603. 800d70c: 8de2 ldrh r2, [r4, #46] ; 0x2e
  17604. 800d70e: 6aa3 ldr r3, [r4, #40] ; 0x28
  17605. /* Add any requested options. NB MSS option is only set on SYN
  17606. packets, so ignore it here */
  17607. opts = (u32_t *)(void *)(seg->tcphdr + 1);
  17608. 800d710: f8d5 b00c ldr.w fp, [r5, #12]
  17609. seg->tcphdr->ackno = htonl(pcb->rcv_nxt);
  17610. /* advertise our receive window size in this TCP segment */
  17611. seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);
  17612. pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
  17613. 800d714: 18d3 adds r3, r2, r3
  17614. 800d716: 6323 str r3, [r4, #48] ; 0x30
  17615. /* Add any requested options. NB MSS option is only set on SYN
  17616. packets, so ignore it here */
  17617. opts = (u32_t *)(void *)(seg->tcphdr + 1);
  17618. if (seg->flags & TF_SEG_OPTS_MSS) {
  17619. 800d718: 7aab ldrb r3, [r5, #10]
  17620. 800d71a: 07d8 lsls r0, r3, #31
  17621. 800d71c: d50a bpl.n 800d734 <tcp_output+0x100>
  17622. u16_t mss;
  17623. #if TCP_CALCULATE_EFF_SEND_MSS
  17624. mss = tcp_eff_send_mss(TCP_MSS, &pcb->remote_ip);
  17625. 800d71e: 4639 mov r1, r7
  17626. 800d720: f240 50b4 movw r0, #1460 ; 0x5b4
  17627. 800d724: f7fe fb14 bl 800bd50 <tcp_eff_send_mss>
  17628. #else /* TCP_CALCULATE_EFF_SEND_MSS */
  17629. mss = TCP_MSS;
  17630. #endif /* TCP_CALCULATE_EFF_SEND_MSS */
  17631. *opts = TCP_BUILD_MSS_OPTION(mss);
  17632. 800d728: f040 7001 orr.w r0, r0, #33816576 ; 0x2040000
  17633. 800d72c: f7fc fd67 bl 800a1fe <lwip_htonl>
  17634. 800d730: f8cb 0014 str.w r0, [fp, #20]
  17635. }
  17636. #endif
  17637. /* Set retransmission timer running if it is not currently enabled
  17638. This must be set before checking the route. */
  17639. if (pcb->rtime == -1) {
  17640. 800d734: f9b4 3034 ldrsh.w r3, [r4, #52] ; 0x34
  17641. 800d738: 3301 adds r3, #1
  17642. 800d73a: d101 bne.n 800d740 <tcp_output+0x10c>
  17643. pcb->rtime = 0;
  17644. 800d73c: 2300 movs r3, #0
  17645. 800d73e: 86a3 strh r3, [r4, #52] ; 0x34
  17646. }
  17647. /* If we don't have a local IP address, we get one by
  17648. calling ip_route(). */
  17649. if (ip_addr_isany(&(pcb->local_ip))) {
  17650. 800d740: 6823 ldr r3, [r4, #0]
  17651. 800d742: b92b cbnz r3, 800d750 <tcp_output+0x11c>
  17652. netif = ip_route(&(pcb->remote_ip));
  17653. 800d744: 4638 mov r0, r7
  17654. 800d746: f000 febd bl 800e4c4 <ip_route>
  17655. if (netif == NULL) {
  17656. 800d74a: b338 cbz r0, 800d79c <tcp_output+0x168>
  17657. return;
  17658. }
  17659. ip_addr_copy(pcb->local_ip, netif->ip_addr);
  17660. 800d74c: 6843 ldr r3, [r0, #4]
  17661. 800d74e: 6023 str r3, [r4, #0]
  17662. }
  17663. if (pcb->rttest == 0) {
  17664. 800d750: 6ba3 ldr r3, [r4, #56] ; 0x38
  17665. 800d752: b93b cbnz r3, 800d764 <tcp_output+0x130>
  17666. pcb->rttest = tcp_ticks;
  17667. 800d754: f8da 3000 ldr.w r3, [sl]
  17668. 800d758: 63a3 str r3, [r4, #56] ; 0x38
  17669. pcb->rtseq = ntohl(seg->tcphdr->seqno);
  17670. 800d75a: 68eb ldr r3, [r5, #12]
  17671. 800d75c: 6858 ldr r0, [r3, #4]
  17672. 800d75e: f7fc fd50 bl 800a202 <lwip_ntohl>
  17673. 800d762: 63e0 str r0, [r4, #60] ; 0x3c
  17674. }
  17675. LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n",
  17676. htonl(seg->tcphdr->seqno), htonl(seg->tcphdr->seqno) +
  17677. seg->len));
  17678. len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload);
  17679. 800d764: 6868 ldr r0, [r5, #4]
  17680. 800d766: 68eb ldr r3, [r5, #12]
  17681. 800d768: 6842 ldr r2, [r0, #4]
  17682. seg->p->len -= len;
  17683. 800d76a: 8941 ldrh r1, [r0, #10]
  17684. seg->p->tot_len -= len;
  17685. seg->p->payload = seg->tcphdr;
  17686. 800d76c: 6043 str r3, [r0, #4]
  17687. }
  17688. LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n",
  17689. htonl(seg->tcphdr->seqno), htonl(seg->tcphdr->seqno) +
  17690. seg->len));
  17691. len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload);
  17692. 800d76e: 1a9a subs r2, r3, r2
  17693. seg->p->len -= len;
  17694. 800d770: 1a89 subs r1, r1, r2
  17695. 800d772: 8141 strh r1, [r0, #10]
  17696. seg->p->tot_len -= len;
  17697. 800d774: 8901 ldrh r1, [r0, #8]
  17698. 800d776: 1a8a subs r2, r1, r2
  17699. 800d778: 8102 strh r2, [r0, #8]
  17700. seg->p->payload = seg->tcphdr;
  17701. seg->tcphdr->chksum = 0;
  17702. 800d77a: 2200 movs r2, #0
  17703. 800d77c: 741a strb r2, [r3, #16]
  17704. 800d77e: 745a strb r2, [r3, #17]
  17705. seg->tcphdr->chksum = inet_chksum_pseudo(seg->p, &(pcb->local_ip),
  17706. &(pcb->remote_ip),
  17707. IP_PROTO_TCP, seg->p->tot_len);
  17708. #endif /* TCP_CHECKSUM_ON_COPY */
  17709. #endif /* CHECKSUM_GEN_TCP */
  17710. TCP_STATS_INC(tcp.xmit);
  17711. 800d780: f8b9 3090 ldrh.w r3, [r9, #144] ; 0x90
  17712. 800d784: 3301 adds r3, #1
  17713. 800d786: f8a9 3090 strh.w r3, [r9, #144] ; 0x90
  17714. #if LWIP_NETIF_HWADDRHINT
  17715. ip_output_hinted(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17716. IP_PROTO_TCP, &(pcb->addr_hint));
  17717. #else /* LWIP_NETIF_HWADDRHINT*/
  17718. ip_output(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
  17719. 800d78a: 7a62 ldrb r2, [r4, #9]
  17720. 800d78c: 7aa3 ldrb r3, [r4, #10]
  17721. 800d78e: 9200 str r2, [sp, #0]
  17722. 800d790: 2206 movs r2, #6
  17723. 800d792: 9201 str r2, [sp, #4]
  17724. 800d794: 4621 mov r1, r4
  17725. 800d796: 463a mov r2, r7
  17726. 800d798: f001 f818 bl 800e7cc <ip_output>
  17727. TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
  17728. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  17729. }
  17730. tcp_output_segment(seg, pcb);
  17731. snd_nxt = ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
  17732. 800d79c: 68eb ldr r3, [r5, #12]
  17733. 800d79e: 6858 ldr r0, [r3, #4]
  17734. 800d7a0: f7fc fd2f bl 800a202 <lwip_ntohl>
  17735. 800d7a4: 68ea ldr r2, [r5, #12]
  17736. 800d7a6: 8929 ldrh r1, [r5, #8]
  17737. 800d7a8: 4683 mov fp, r0
  17738. 800d7aa: 8990 ldrh r0, [r2, #12]
  17739. 800d7ac: 9103 str r1, [sp, #12]
  17740. 800d7ae: f7fc fd21 bl 800a1f4 <lwip_ntohs>
  17741. 800d7b2: 9903 ldr r1, [sp, #12]
  17742. if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) {
  17743. 800d7b4: 6d22 ldr r2, [r4, #80] ; 0x50
  17744. TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
  17745. pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
  17746. }
  17747. tcp_output_segment(seg, pcb);
  17748. snd_nxt = ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
  17749. 800d7b6: f010 0003 ands.w r0, r0, #3
  17750. 800d7ba: bf18 it ne
  17751. 800d7bc: 2001 movne r0, #1
  17752. 800d7be: 180b adds r3, r1, r0
  17753. 800d7c0: 445b add r3, fp
  17754. if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) {
  17755. 800d7c2: 1ad2 subs r2, r2, r3
  17756. 800d7c4: 2a00 cmp r2, #0
  17757. pcb->snd_nxt = snd_nxt;
  17758. 800d7c6: bfb8 it lt
  17759. 800d7c8: 6523 strlt r3, [r4, #80] ; 0x50
  17760. }
  17761. /* put segment on unacknowledged list if length > 0 */
  17762. if (TCP_TCPLEN(seg) > 0) {
  17763. 800d7ca: 68eb ldr r3, [r5, #12]
  17764. 800d7cc: f8b5 b008 ldrh.w fp, [r5, #8]
  17765. 800d7d0: 8998 ldrh r0, [r3, #12]
  17766. 800d7d2: f7fc fd0f bl 800a1f4 <lwip_ntohs>
  17767. 800d7d6: f010 0003 ands.w r0, r0, #3
  17768. 800d7da: bf18 it ne
  17769. 800d7dc: 2001 movne r0, #1
  17770. 800d7de: 4458 add r0, fp
  17771. 800d7e0: 2800 cmp r0, #0
  17772. 800d7e2: d032 beq.n 800d84a <tcp_output+0x216>
  17773. seg->next = NULL;
  17774. 800d7e4: 2300 movs r3, #0
  17775. 800d7e6: 602b str r3, [r5, #0]
  17776. /* unacked list is empty? */
  17777. if (pcb->unacked == NULL) {
  17778. 800d7e8: 6f23 ldr r3, [r4, #112] ; 0x70
  17779. 800d7ea: b90b cbnz r3, 800d7f0 <tcp_output+0x1bc>
  17780. pcb->unacked = seg;
  17781. 800d7ec: 6725 str r5, [r4, #112] ; 0x70
  17782. 800d7ee: e02a b.n 800d846 <tcp_output+0x212>
  17783. /* unacked list is not empty? */
  17784. } else {
  17785. /* In the case of fast retransmit, the packet should not go to the tail
  17786. * of the unacked queue, but rather somewhere before it. We need to check for
  17787. * this case. -STJ Jul 27, 2004 */
  17788. if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
  17789. 800d7f0: 68eb ldr r3, [r5, #12]
  17790. 800d7f2: 6858 ldr r0, [r3, #4]
  17791. 800d7f4: f7fc fd05 bl 800a202 <lwip_ntohl>
  17792. 800d7f8: 68f3 ldr r3, [r6, #12]
  17793. 800d7fa: 4683 mov fp, r0
  17794. 800d7fc: 6858 ldr r0, [r3, #4]
  17795. 800d7fe: f7fc fd00 bl 800a202 <lwip_ntohl>
  17796. 800d802: ebc0 000b rsb r0, r0, fp
  17797. 800d806: 2800 cmp r0, #0
  17798. 800d808: da1c bge.n 800d844 <tcp_output+0x210>
  17799. /* add segment to before tail of unacked list, keeping the list sorted */
  17800. struct tcp_seg **cur_seg = &(pcb->unacked);
  17801. 800d80a: f104 0b70 add.w fp, r4, #112 ; 0x70
  17802. while (*cur_seg &&
  17803. 800d80e: e001 b.n 800d814 <tcp_output+0x1e0>
  17804. TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
  17805. cur_seg = &((*cur_seg)->next );
  17806. 800d810: f8db b000 ldr.w fp, [fp]
  17807. * of the unacked queue, but rather somewhere before it. We need to check for
  17808. * this case. -STJ Jul 27, 2004 */
  17809. if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
  17810. /* add segment to before tail of unacked list, keeping the list sorted */
  17811. struct tcp_seg **cur_seg = &(pcb->unacked);
  17812. while (*cur_seg &&
  17813. 800d814: f8db 3000 ldr.w r3, [fp]
  17814. 800d818: b92b cbnz r3, 800d826 <tcp_output+0x1f2>
  17815. TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
  17816. cur_seg = &((*cur_seg)->next );
  17817. }
  17818. seg->next = (*cur_seg);
  17819. 800d81a: f8db 3000 ldr.w r3, [fp]
  17820. 800d81e: 602b str r3, [r5, #0]
  17821. (*cur_seg) = seg;
  17822. 800d820: f8cb 5000 str.w r5, [fp]
  17823. 800d824: e014 b.n 800d850 <tcp_output+0x21c>
  17824. * this case. -STJ Jul 27, 2004 */
  17825. if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
  17826. /* add segment to before tail of unacked list, keeping the list sorted */
  17827. struct tcp_seg **cur_seg = &(pcb->unacked);
  17828. while (*cur_seg &&
  17829. TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
  17830. 800d826: 68db ldr r3, [r3, #12]
  17831. 800d828: 6858 ldr r0, [r3, #4]
  17832. 800d82a: f7fc fcea bl 800a202 <lwip_ntohl>
  17833. 800d82e: 68eb ldr r3, [r5, #12]
  17834. 800d830: 4602 mov r2, r0
  17835. 800d832: 6858 ldr r0, [r3, #4]
  17836. 800d834: 9203 str r2, [sp, #12]
  17837. 800d836: f7fc fce4 bl 800a202 <lwip_ntohl>
  17838. 800d83a: 9a03 ldr r2, [sp, #12]
  17839. 800d83c: 1a10 subs r0, r2, r0
  17840. * of the unacked queue, but rather somewhere before it. We need to check for
  17841. * this case. -STJ Jul 27, 2004 */
  17842. if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
  17843. /* add segment to before tail of unacked list, keeping the list sorted */
  17844. struct tcp_seg **cur_seg = &(pcb->unacked);
  17845. while (*cur_seg &&
  17846. 800d83e: 2800 cmp r0, #0
  17847. 800d840: dbe6 blt.n 800d810 <tcp_output+0x1dc>
  17848. 800d842: e7ea b.n 800d81a <tcp_output+0x1e6>
  17849. }
  17850. seg->next = (*cur_seg);
  17851. (*cur_seg) = seg;
  17852. } else {
  17853. /* add segment to tail of unacked list */
  17854. useg->next = seg;
  17855. 800d844: 6035 str r5, [r6, #0]
  17856. 800d846: 462e mov r6, r5
  17857. 800d848: e002 b.n 800d850 <tcp_output+0x21c>
  17858. useg = useg->next;
  17859. }
  17860. }
  17861. /* do not queue empty segments on the unacked list */
  17862. } else {
  17863. tcp_seg_free(seg);
  17864. 800d84a: 4628 mov r0, r5
  17865. 800d84c: f7fe f8e3 bl 800ba16 <tcp_seg_free>
  17866. }
  17867. seg = pcb->unsent;
  17868. 800d850: 6ee5 ldr r5, [r4, #108] ; 0x6c
  17869. 800d852: e004 b.n 800d85e <tcp_output+0x22a>
  17870. seg->tcphdr->chksum = inet_chksum_pseudo(seg->p, &(pcb->local_ip),
  17871. &(pcb->remote_ip),
  17872. IP_PROTO_TCP, seg->p->tot_len);
  17873. #endif /* TCP_CHECKSUM_ON_COPY */
  17874. #endif /* CHECKSUM_GEN_TCP */
  17875. TCP_STATS_INC(tcp.xmit);
  17876. 800d854: f8df 904c ldr.w r9, [pc, #76] ; 800d8a4 <tcp_output+0x270>
  17877. }
  17878. ip_addr_copy(pcb->local_ip, netif->ip_addr);
  17879. }
  17880. if (pcb->rttest == 0) {
  17881. pcb->rttest = tcp_ticks;
  17882. 800d858: f8df a04c ldr.w sl, [pc, #76] ; 800d8a8 <tcp_output+0x274>
  17883. packets, so ignore it here */
  17884. opts = (u32_t *)(void *)(seg->tcphdr + 1);
  17885. if (seg->flags & TF_SEG_OPTS_MSS) {
  17886. u16_t mss;
  17887. #if TCP_CALCULATE_EFF_SEND_MSS
  17888. mss = tcp_eff_send_mss(TCP_MSS, &pcb->remote_ip);
  17889. 800d85c: 1d27 adds r7, r4, #4
  17890. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
  17891. ntohl(seg->tcphdr->seqno), pcb->lastack));
  17892. }
  17893. #endif /* TCP_CWND_DEBUG */
  17894. /* data available and window allows it to be sent? */
  17895. while (seg != NULL &&
  17896. 800d85e: b915 cbnz r5, 800d866 <tcp_output+0x232>
  17897. tcp_seg_free(seg);
  17898. }
  17899. seg = pcb->unsent;
  17900. }
  17901. #if TCP_OVERSIZE
  17902. if (pcb->unsent == NULL) {
  17903. 800d860: 6ee3 ldr r3, [r4, #108] ; 0x6c
  17904. 800d862: b973 cbnz r3, 800d882 <tcp_output+0x24e>
  17905. 800d864: e00b b.n 800d87e <tcp_output+0x24a>
  17906. ntohl(seg->tcphdr->seqno), pcb->lastack));
  17907. }
  17908. #endif /* TCP_CWND_DEBUG */
  17909. /* data available and window allows it to be sent? */
  17910. while (seg != NULL &&
  17911. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
  17912. 800d866: 68eb ldr r3, [r5, #12]
  17913. 800d868: 6858 ldr r0, [r3, #4]
  17914. 800d86a: f7fc fcca bl 800a202 <lwip_ntohl>
  17915. 800d86e: 892a ldrh r2, [r5, #8]
  17916. 800d870: 6ca3 ldr r3, [r4, #72] ; 0x48
  17917. 800d872: 1ad3 subs r3, r2, r3
  17918. 800d874: 1818 adds r0, r3, r0
  17919. ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
  17920. ntohl(seg->tcphdr->seqno), pcb->lastack));
  17921. }
  17922. #endif /* TCP_CWND_DEBUG */
  17923. /* data available and window allows it to be sent? */
  17924. while (seg != NULL &&
  17925. 800d876: 4540 cmp r0, r8
  17926. 800d878: f67f af0b bls.w 800d692 <tcp_output+0x5e>
  17927. 800d87c: e7f0 b.n 800d860 <tcp_output+0x22c>
  17928. seg = pcb->unsent;
  17929. }
  17930. #if TCP_OVERSIZE
  17931. if (pcb->unsent == NULL) {
  17932. /* last unsent has been removed, reset unsent_oversize */
  17933. pcb->unsent_oversize = 0;
  17934. 800d87e: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
  17935. }
  17936. #endif /* TCP_OVERSIZE */
  17937. pcb->flags &= ~TF_NAGLEMEMERR;
  17938. 800d882: 7fa3 ldrb r3, [r4, #30]
  17939. 800d884: f003 037f and.w r3, r3, #127 ; 0x7f
  17940. 800d888: 77a3 strb r3, [r4, #30]
  17941. return ERR_OK;
  17942. 800d88a: e004 b.n 800d896 <tcp_output+0x262>
  17943. * - if tcp_write had a memory error before (prevent delayed ACK timeout) or
  17944. * - if FIN was already enqueued for this PCB (SYN is always alone in a segment -
  17945. * either seg->next != NULL or pcb->unacked == NULL;
  17946. * RST is no sent using tcp_write/tcp_output.
  17947. */
  17948. if((tcp_do_output_nagle(pcb) == 0) &&
  17949. 800d88c: f012 0fa0 tst.w r2, #160 ; 0xa0
  17950. 800d890: f47f af19 bne.w 800d6c6 <tcp_output+0x92>
  17951. 800d894: e7e4 b.n 800d860 <tcp_output+0x22c>
  17952. }
  17953. #endif /* TCP_OVERSIZE */
  17954. pcb->flags &= ~TF_NAGLEMEMERR;
  17955. return ERR_OK;
  17956. }
  17957. 800d896: 2000 movs r0, #0
  17958. 800d898: b005 add sp, #20
  17959. 800d89a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  17960. 800d89e: bf00 nop
  17961. 800d8a0: 20008354 .word 0x20008354
  17962. 800d8a4: 20008220 .word 0x20008220
  17963. 800d8a8: 20008340 .word 0x20008340
  17964. 0800d8ac <tcp_rst>:
  17965. */
  17966. void
  17967. tcp_rst(u32_t seqno, u32_t ackno,
  17968. ip_addr_t *local_ip, ip_addr_t *remote_ip,
  17969. u16_t local_port, u16_t remote_port)
  17970. {
  17971. 800d8ac: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  17972. 800d8b0: 4681 mov r9, r0
  17973. 800d8b2: 460d mov r5, r1
  17974. 800d8b4: 4690 mov r8, r2
  17975. struct pbuf *p;
  17976. struct tcp_hdr *tcphdr;
  17977. p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
  17978. 800d8b6: 2001 movs r0, #1
  17979. 800d8b8: 2114 movs r1, #20
  17980. 800d8ba: 2200 movs r2, #0
  17981. */
  17982. void
  17983. tcp_rst(u32_t seqno, u32_t ackno,
  17984. ip_addr_t *local_ip, ip_addr_t *remote_ip,
  17985. u16_t local_port, u16_t remote_port)
  17986. {
  17987. 800d8bc: 461f mov r7, r3
  17988. 800d8be: f8bd b030 ldrh.w fp, [sp, #48] ; 0x30
  17989. 800d8c2: f8bd a034 ldrh.w sl, [sp, #52] ; 0x34
  17990. struct pbuf *p;
  17991. struct tcp_hdr *tcphdr;
  17992. p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
  17993. 800d8c6: f7fd fe4e bl 800b566 <pbuf_alloc>
  17994. if (p == NULL) {
  17995. 800d8ca: 4606 mov r6, r0
  17996. 800d8cc: 2800 cmp r0, #0
  17997. 800d8ce: d034 beq.n 800d93a <tcp_rst+0x8e>
  17998. return;
  17999. }
  18000. LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
  18001. (p->len >= sizeof(struct tcp_hdr)));
  18002. tcphdr = (struct tcp_hdr *)p->payload;
  18003. 800d8d0: 6844 ldr r4, [r0, #4]
  18004. tcphdr->src = htons(local_port);
  18005. 800d8d2: 4658 mov r0, fp
  18006. 800d8d4: f7fc fc89 bl 800a1ea <lwip_htons>
  18007. 800d8d8: 8020 strh r0, [r4, #0]
  18008. tcphdr->dest = htons(remote_port);
  18009. 800d8da: 4650 mov r0, sl
  18010. 800d8dc: f7fc fc85 bl 800a1ea <lwip_htons>
  18011. 800d8e0: 8060 strh r0, [r4, #2]
  18012. tcphdr->seqno = htonl(seqno);
  18013. 800d8e2: 4648 mov r0, r9
  18014. 800d8e4: f7fc fc8b bl 800a1fe <lwip_htonl>
  18015. 800d8e8: 6060 str r0, [r4, #4]
  18016. tcphdr->ackno = htonl(ackno);
  18017. 800d8ea: 4628 mov r0, r5
  18018. 800d8ec: f7fc fc87 bl 800a1fe <lwip_htonl>
  18019. 800d8f0: 60a0 str r0, [r4, #8]
  18020. TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
  18021. 800d8f2: f245 0014 movw r0, #20500 ; 0x5014
  18022. 800d8f6: f7fc fc78 bl 800a1ea <lwip_htons>
  18023. tcphdr->wnd = PP_HTONS(TCP_WND);
  18024. 800d8fa: 2316 movs r3, #22
  18025. tcphdr = (struct tcp_hdr *)p->payload;
  18026. tcphdr->src = htons(local_port);
  18027. tcphdr->dest = htons(remote_port);
  18028. tcphdr->seqno = htonl(seqno);
  18029. tcphdr->ackno = htonl(ackno);
  18030. TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
  18031. 800d8fc: 81a0 strh r0, [r4, #12]
  18032. tcphdr->wnd = PP_HTONS(TCP_WND);
  18033. 800d8fe: 73a3 strb r3, [r4, #14]
  18034. 800d900: 2500 movs r5, #0
  18035. #if CHECKSUM_GEN_TCP
  18036. tcphdr->chksum = inet_chksum_pseudo(p, local_ip, remote_ip,
  18037. IP_PROTO_TCP, p->tot_len);
  18038. #endif
  18039. TCP_STATS_INC(tcp.xmit);
  18040. 800d902: 480f ldr r0, [pc, #60] ; (800d940 <tcp_rst+0x94>)
  18041. tcphdr->dest = htons(remote_port);
  18042. tcphdr->seqno = htonl(seqno);
  18043. tcphdr->ackno = htonl(ackno);
  18044. TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
  18045. tcphdr->wnd = PP_HTONS(TCP_WND);
  18046. tcphdr->chksum = 0;
  18047. 800d904: 7425 strb r5, [r4, #16]
  18048. tcphdr->src = htons(local_port);
  18049. tcphdr->dest = htons(remote_port);
  18050. tcphdr->seqno = htonl(seqno);
  18051. tcphdr->ackno = htonl(ackno);
  18052. TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
  18053. tcphdr->wnd = PP_HTONS(TCP_WND);
  18054. 800d906: f06f 032f mvn.w r3, #47 ; 0x2f
  18055. 800d90a: 73e3 strb r3, [r4, #15]
  18056. tcphdr->chksum = 0;
  18057. 800d90c: 7465 strb r5, [r4, #17]
  18058. tcphdr->urgp = 0;
  18059. 800d90e: 74a5 strb r5, [r4, #18]
  18060. 800d910: 74e5 strb r5, [r4, #19]
  18061. #if CHECKSUM_GEN_TCP
  18062. tcphdr->chksum = inet_chksum_pseudo(p, local_ip, remote_ip,
  18063. IP_PROTO_TCP, p->tot_len);
  18064. #endif
  18065. TCP_STATS_INC(tcp.xmit);
  18066. 800d912: f8b0 3090 ldrh.w r3, [r0, #144] ; 0x90
  18067. 800d916: 3301 adds r3, #1
  18068. 800d918: f8a0 3090 strh.w r3, [r0, #144] ; 0x90
  18069. snmp_inc_tcpoutrsts();
  18070. /* Send output with hardcoded TTL since we have no access to the pcb */
  18071. ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP);
  18072. 800d91c: 2306 movs r3, #6
  18073. 800d91e: 9301 str r3, [sp, #4]
  18074. 800d920: 9500 str r5, [sp, #0]
  18075. 800d922: 4630 mov r0, r6
  18076. 800d924: 4641 mov r1, r8
  18077. 800d926: 463a mov r2, r7
  18078. 800d928: 23ff movs r3, #255 ; 0xff
  18079. 800d92a: f000 ff4f bl 800e7cc <ip_output>
  18080. pbuf_free(p);
  18081. 800d92e: 4630 mov r0, r6
  18082. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
  18083. }
  18084. 800d930: b003 add sp, #12
  18085. 800d932: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  18086. #endif
  18087. TCP_STATS_INC(tcp.xmit);
  18088. snmp_inc_tcpoutrsts();
  18089. /* Send output with hardcoded TTL since we have no access to the pcb */
  18090. ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP);
  18091. pbuf_free(p);
  18092. 800d936: f7fd bdc5 b.w 800b4c4 <pbuf_free>
  18093. LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
  18094. }
  18095. 800d93a: b003 add sp, #12
  18096. 800d93c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  18097. 800d940: 20008220 .word 0x20008220
  18098. 0800d944 <tcp_rexmit_rto>:
  18099. void
  18100. tcp_rexmit_rto(struct tcp_pcb *pcb)
  18101. {
  18102. struct tcp_seg *seg;
  18103. if (pcb->unacked == NULL) {
  18104. 800d944: 6f02 ldr r2, [r0, #112] ; 0x70
  18105. *
  18106. * @param pcb the tcp_pcb for which to re-enqueue all unacked segments
  18107. */
  18108. void
  18109. tcp_rexmit_rto(struct tcp_pcb *pcb)
  18110. {
  18111. 800d946: b510 push {r4, lr}
  18112. struct tcp_seg *seg;
  18113. if (pcb->unacked == NULL) {
  18114. 800d948: b19a cbz r2, 800d972 <tcp_rexmit_rto+0x2e>
  18115. 800d94a: 4611 mov r1, r2
  18116. 800d94c: e000 b.n 800d950 <tcp_rexmit_rto+0xc>
  18117. return;
  18118. }
  18119. /* Move all unacked segments to the head of the unsent queue */
  18120. for (seg = pcb->unacked; seg->next != NULL; seg = seg->next);
  18121. 800d94e: 4619 mov r1, r3
  18122. 800d950: 680b ldr r3, [r1, #0]
  18123. 800d952: 2b00 cmp r3, #0
  18124. 800d954: d1fb bne.n 800d94e <tcp_rexmit_rto+0xa>
  18125. /* concatenate unsent queue after unacked queue */
  18126. seg->next = pcb->unsent;
  18127. 800d956: 6ec4 ldr r4, [r0, #108] ; 0x6c
  18128. 800d958: 600c str r4, [r1, #0]
  18129. /* unsent queue is the concatenated queue (of unacked, unsent) */
  18130. pcb->unsent = pcb->unacked;
  18131. 800d95a: 66c2 str r2, [r0, #108] ; 0x6c
  18132. /* unacked queue is now empty */
  18133. pcb->unacked = NULL;
  18134. /* last unsent hasn't changed, no need to reset unsent_oversize */
  18135. /* increment number of retransmissions */
  18136. ++pcb->nrtx;
  18137. 800d95c: f890 2046 ldrb.w r2, [r0, #70] ; 0x46
  18138. /* concatenate unsent queue after unacked queue */
  18139. seg->next = pcb->unsent;
  18140. /* unsent queue is the concatenated queue (of unacked, unsent) */
  18141. pcb->unsent = pcb->unacked;
  18142. /* unacked queue is now empty */
  18143. pcb->unacked = NULL;
  18144. 800d960: 6703 str r3, [r0, #112] ; 0x70
  18145. /* last unsent hasn't changed, no need to reset unsent_oversize */
  18146. /* increment number of retransmissions */
  18147. ++pcb->nrtx;
  18148. 800d962: 3201 adds r2, #1
  18149. 800d964: f880 2046 strb.w r2, [r0, #70] ; 0x46
  18150. /* Don't take any RTT measurements after retransmitting. */
  18151. pcb->rttest = 0;
  18152. 800d968: 6383 str r3, [r0, #56] ; 0x38
  18153. /* Do the actual retransmission */
  18154. tcp_output(pcb);
  18155. }
  18156. 800d96a: e8bd 4010 ldmia.w sp!, {r4, lr}
  18157. /* Don't take any RTT measurements after retransmitting. */
  18158. pcb->rttest = 0;
  18159. /* Do the actual retransmission */
  18160. tcp_output(pcb);
  18161. 800d96e: f7ff be61 b.w 800d634 <tcp_output>
  18162. 800d972: bd10 pop {r4, pc}
  18163. 0800d974 <tcp_rexmit>:
  18164. *
  18165. * @param pcb the tcp_pcb for which to retransmit the first unacked segment
  18166. */
  18167. void
  18168. tcp_rexmit(struct tcp_pcb *pcb)
  18169. {
  18170. 800d974: b5f8 push {r3, r4, r5, r6, r7, lr}
  18171. struct tcp_seg *seg;
  18172. struct tcp_seg **cur_seg;
  18173. if (pcb->unacked == NULL) {
  18174. 800d976: 6f05 ldr r5, [r0, #112] ; 0x70
  18175. *
  18176. * @param pcb the tcp_pcb for which to retransmit the first unacked segment
  18177. */
  18178. void
  18179. tcp_rexmit(struct tcp_pcb *pcb)
  18180. {
  18181. 800d978: 4604 mov r4, r0
  18182. struct tcp_seg *seg;
  18183. struct tcp_seg **cur_seg;
  18184. if (pcb->unacked == NULL) {
  18185. 800d97a: b31d cbz r5, 800d9c4 <tcp_rexmit+0x50>
  18186. }
  18187. /* Move the first unacked segment to the unsent queue */
  18188. /* Keep the unsent queue sorted. */
  18189. seg = pcb->unacked;
  18190. pcb->unacked = seg->next;
  18191. 800d97c: 682b ldr r3, [r5, #0]
  18192. cur_seg = &(pcb->unsent);
  18193. 800d97e: f100 066c add.w r6, r0, #108 ; 0x6c
  18194. }
  18195. /* Move the first unacked segment to the unsent queue */
  18196. /* Keep the unsent queue sorted. */
  18197. seg = pcb->unacked;
  18198. pcb->unacked = seg->next;
  18199. 800d982: 6703 str r3, [r0, #112] ; 0x70
  18200. cur_seg = &(pcb->unsent);
  18201. while (*cur_seg &&
  18202. 800d984: e000 b.n 800d988 <tcp_rexmit+0x14>
  18203. TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
  18204. cur_seg = &((*cur_seg)->next );
  18205. 800d986: 6836 ldr r6, [r6, #0]
  18206. /* Keep the unsent queue sorted. */
  18207. seg = pcb->unacked;
  18208. pcb->unacked = seg->next;
  18209. cur_seg = &(pcb->unsent);
  18210. while (*cur_seg &&
  18211. 800d988: 6833 ldr r3, [r6, #0]
  18212. 800d98a: b92b cbnz r3, 800d998 <tcp_rexmit+0x24>
  18213. TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
  18214. cur_seg = &((*cur_seg)->next );
  18215. }
  18216. seg->next = *cur_seg;
  18217. 800d98c: 6833 ldr r3, [r6, #0]
  18218. 800d98e: 602b str r3, [r5, #0]
  18219. *cur_seg = seg;
  18220. 800d990: 6035 str r5, [r6, #0]
  18221. #if TCP_OVERSIZE
  18222. if (seg->next == NULL) {
  18223. 800d992: 682b ldr r3, [r5, #0]
  18224. 800d994: b97b cbnz r3, 800d9b6 <tcp_rexmit+0x42>
  18225. 800d996: e00c b.n 800d9b2 <tcp_rexmit+0x3e>
  18226. seg = pcb->unacked;
  18227. pcb->unacked = seg->next;
  18228. cur_seg = &(pcb->unsent);
  18229. while (*cur_seg &&
  18230. TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
  18231. 800d998: 68db ldr r3, [r3, #12]
  18232. 800d99a: 6858 ldr r0, [r3, #4]
  18233. 800d99c: f7fc fc31 bl 800a202 <lwip_ntohl>
  18234. 800d9a0: 68eb ldr r3, [r5, #12]
  18235. 800d9a2: 4607 mov r7, r0
  18236. 800d9a4: 6858 ldr r0, [r3, #4]
  18237. 800d9a6: f7fc fc2c bl 800a202 <lwip_ntohl>
  18238. 800d9aa: 1a38 subs r0, r7, r0
  18239. /* Keep the unsent queue sorted. */
  18240. seg = pcb->unacked;
  18241. pcb->unacked = seg->next;
  18242. cur_seg = &(pcb->unsent);
  18243. while (*cur_seg &&
  18244. 800d9ac: 2800 cmp r0, #0
  18245. 800d9ae: dbea blt.n 800d986 <tcp_rexmit+0x12>
  18246. 800d9b0: e7ec b.n 800d98c <tcp_rexmit+0x18>
  18247. seg->next = *cur_seg;
  18248. *cur_seg = seg;
  18249. #if TCP_OVERSIZE
  18250. if (seg->next == NULL) {
  18251. /* the retransmitted segment is last in unsent, so reset unsent_oversize */
  18252. pcb->unsent_oversize = 0;
  18253. 800d9b2: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
  18254. }
  18255. #endif /* TCP_OVERSIZE */
  18256. ++pcb->nrtx;
  18257. 800d9b6: f894 3046 ldrb.w r3, [r4, #70] ; 0x46
  18258. 800d9ba: 3301 adds r3, #1
  18259. 800d9bc: f884 3046 strb.w r3, [r4, #70] ; 0x46
  18260. /* Don't take any rtt measurements after retransmitting. */
  18261. pcb->rttest = 0;
  18262. 800d9c0: 2300 movs r3, #0
  18263. 800d9c2: 63a3 str r3, [r4, #56] ; 0x38
  18264. 800d9c4: bdf8 pop {r3, r4, r5, r6, r7, pc}
  18265. 0800d9c6 <tcp_rexmit_fast>:
  18266. * @param pcb the tcp_pcb for which to retransmit the first unacked segment
  18267. */
  18268. void
  18269. tcp_rexmit_fast(struct tcp_pcb *pcb)
  18270. {
  18271. if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) {
  18272. 800d9c6: 6f03 ldr r3, [r0, #112] ; 0x70
  18273. *
  18274. * @param pcb the tcp_pcb for which to retransmit the first unacked segment
  18275. */
  18276. void
  18277. tcp_rexmit_fast(struct tcp_pcb *pcb)
  18278. {
  18279. 800d9c8: b510 push {r4, lr}
  18280. 800d9ca: 4604 mov r4, r0
  18281. if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) {
  18282. 800d9cc: b333 cbz r3, 800da1c <tcp_rexmit_fast+0x56>
  18283. 800d9ce: 7f83 ldrb r3, [r0, #30]
  18284. 800d9d0: f003 0304 and.w r3, r3, #4
  18285. 800d9d4: b2db uxtb r3, r3
  18286. 800d9d6: bb0b cbnz r3, 800da1c <tcp_rexmit_fast+0x56>
  18287. LWIP_DEBUGF(TCP_FR_DEBUG,
  18288. ("tcp_receive: dupacks %"U16_F" (%"U32_F
  18289. "), fast retransmit %"U32_F"\n",
  18290. (u16_t)pcb->dupacks, pcb->lastack,
  18291. ntohl(pcb->unacked->tcphdr->seqno)));
  18292. tcp_rexmit(pcb);
  18293. 800d9d8: f7ff ffcc bl 800d974 <tcp_rexmit>
  18294. /* Set ssthresh to half of the minimum of the current
  18295. * cwnd and the advertised window */
  18296. if (pcb->cwnd > pcb->snd_wnd) {
  18297. 800d9dc: f8b4 304c ldrh.w r3, [r4, #76] ; 0x4c
  18298. 800d9e0: f8b4 2060 ldrh.w r2, [r4, #96] ; 0x60
  18299. 800d9e4: 4293 cmp r3, r2
  18300. 800d9e6: d903 bls.n 800d9f0 <tcp_rexmit_fast+0x2a>
  18301. pcb->ssthresh = pcb->snd_wnd / 2;
  18302. 800d9e8: 0852 lsrs r2, r2, #1
  18303. 800d9ea: f8a4 204e strh.w r2, [r4, #78] ; 0x4e
  18304. 800d9ee: e002 b.n 800d9f6 <tcp_rexmit_fast+0x30>
  18305. } else {
  18306. pcb->ssthresh = pcb->cwnd / 2;
  18307. 800d9f0: 085b lsrs r3, r3, #1
  18308. 800d9f2: f8a4 304e strh.w r3, [r4, #78] ; 0x4e
  18309. }
  18310. /* The minimum value for ssthresh should be 2 MSS */
  18311. if (pcb->ssthresh < 2*pcb->mss) {
  18312. 800d9f6: 8ee3 ldrh r3, [r4, #54] ; 0x36
  18313. 800d9f8: f8b4 104e ldrh.w r1, [r4, #78] ; 0x4e
  18314. 800d9fc: 005a lsls r2, r3, #1
  18315. 800d9fe: 4291 cmp r1, r2
  18316. LWIP_DEBUGF(TCP_FR_DEBUG,
  18317. ("tcp_receive: The minimum value for ssthresh %"U16_F
  18318. " should be min 2 mss %"U16_F"...\n",
  18319. pcb->ssthresh, 2*pcb->mss));
  18320. pcb->ssthresh = 2*pcb->mss;
  18321. 800da00: bfb8 it lt
  18322. 800da02: f8a4 204e strhlt.w r2, [r4, #78] ; 0x4e
  18323. }
  18324. pcb->cwnd = pcb->ssthresh + 3 * pcb->mss;
  18325. 800da06: f8b4 204e ldrh.w r2, [r4, #78] ; 0x4e
  18326. 800da0a: 2103 movs r1, #3
  18327. 800da0c: fb01 2303 mla r3, r1, r3, r2
  18328. 800da10: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
  18329. pcb->flags |= TF_INFR;
  18330. 800da14: 7fa3 ldrb r3, [r4, #30]
  18331. 800da16: f043 0304 orr.w r3, r3, #4
  18332. 800da1a: 77a3 strb r3, [r4, #30]
  18333. 800da1c: bd10 pop {r4, pc}
  18334. 800da1e: 0000 movs r0, r0
  18335. 0800da20 <tcp_keepalive>:
  18336. *
  18337. * @param pcb the tcp_pcb for which to send a keepalive packet
  18338. */
  18339. void
  18340. tcp_keepalive(struct tcp_pcb *pcb)
  18341. {
  18342. 800da20: b537 push {r0, r1, r2, r4, r5, lr}
  18343. 800da22: 4604 mov r4, r0
  18344. ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip)));
  18345. LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
  18346. tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
  18347. p = tcp_output_alloc_header(pcb, 0, 0, htonl(pcb->snd_nxt - 1));
  18348. 800da24: 6d00 ldr r0, [r0, #80] ; 0x50
  18349. 800da26: 3801 subs r0, #1
  18350. 800da28: f7fc fbe9 bl 800a1fe <lwip_htonl>
  18351. 800da2c: 2100 movs r1, #0
  18352. 800da2e: 4602 mov r2, r0
  18353. 800da30: 4620 mov r0, r4
  18354. 800da32: f7ff fb9d bl 800d170 <tcp_output_alloc_header.constprop.0>
  18355. if(p == NULL) {
  18356. 800da36: 4605 mov r5, r0
  18357. 800da38: b1a8 cbz r0, 800da66 <tcp_keepalive+0x46>
  18358. #if CHECKSUM_GEN_TCP
  18359. tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
  18360. IP_PROTO_TCP, p->tot_len);
  18361. #endif
  18362. TCP_STATS_INC(tcp.xmit);
  18363. 800da3a: 4b0c ldr r3, [pc, #48] ; (800da6c <tcp_keepalive+0x4c>)
  18364. 800da3c: f8b3 2090 ldrh.w r2, [r3, #144] ; 0x90
  18365. 800da40: 3201 adds r2, #1
  18366. 800da42: f8a3 2090 strh.w r2, [r3, #144] ; 0x90
  18367. /* Send output to IP */
  18368. #if LWIP_NETIF_HWADDRHINT
  18369. ip_output_hinted(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP,
  18370. &(pcb->addr_hint));
  18371. #else /* LWIP_NETIF_HWADDRHINT*/
  18372. ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
  18373. 800da46: f04f 0e06 mov.w lr, #6
  18374. 800da4a: 2200 movs r2, #0
  18375. 800da4c: e88d 4004 stmia.w sp, {r2, lr}
  18376. 800da50: 7aa3 ldrb r3, [r4, #10]
  18377. 800da52: 4621 mov r1, r4
  18378. 800da54: 1d22 adds r2, r4, #4
  18379. 800da56: f000 feb9 bl 800e7cc <ip_output>
  18380. #endif /* LWIP_NETIF_HWADDRHINT*/
  18381. pbuf_free(p);
  18382. 800da5a: 4628 mov r0, r5
  18383. LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F".\n",
  18384. pcb->snd_nxt - 1, pcb->rcv_nxt));
  18385. }
  18386. 800da5c: b003 add sp, #12
  18387. 800da5e: e8bd 4030 ldmia.w sp!, {r4, r5, lr}
  18388. &(pcb->addr_hint));
  18389. #else /* LWIP_NETIF_HWADDRHINT*/
  18390. ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
  18391. #endif /* LWIP_NETIF_HWADDRHINT*/
  18392. pbuf_free(p);
  18393. 800da62: f7fd bd2f b.w 800b4c4 <pbuf_free>
  18394. LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F".\n",
  18395. pcb->snd_nxt - 1, pcb->rcv_nxt));
  18396. }
  18397. 800da66: b003 add sp, #12
  18398. 800da68: bd30 pop {r4, r5, pc}
  18399. 800da6a: bf00 nop
  18400. 800da6c: 20008220 .word 0x20008220
  18401. 0800da70 <tcp_zero_window_probe>:
  18402. *
  18403. * @param pcb the tcp_pcb for which to send a zero-window probe packet
  18404. */
  18405. void
  18406. tcp_zero_window_probe(struct tcp_pcb *pcb)
  18407. {
  18408. 800da70: e92d 41f3 stmdb sp!, {r0, r1, r4, r5, r6, r7, r8, lr}
  18409. LWIP_DEBUGF(TCP_DEBUG,
  18410. ("tcp_zero_window_probe: tcp_ticks %"U32_F
  18411. " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
  18412. tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
  18413. seg = pcb->unacked;
  18414. 800da74: 6f04 ldr r4, [r0, #112] ; 0x70
  18415. *
  18416. * @param pcb the tcp_pcb for which to send a zero-window probe packet
  18417. */
  18418. void
  18419. tcp_zero_window_probe(struct tcp_pcb *pcb)
  18420. {
  18421. 800da76: 4605 mov r5, r0
  18422. " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
  18423. tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
  18424. seg = pcb->unacked;
  18425. if(seg == NULL) {
  18426. 800da78: b914 cbnz r4, 800da80 <tcp_zero_window_probe+0x10>
  18427. seg = pcb->unsent;
  18428. 800da7a: 6ec4 ldr r4, [r0, #108] ; 0x6c
  18429. }
  18430. if(seg == NULL) {
  18431. 800da7c: 2c00 cmp r4, #0
  18432. 800da7e: d048 beq.n 800db12 <tcp_zero_window_probe+0xa2>
  18433. return;
  18434. }
  18435. is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0);
  18436. 800da80: 68e3 ldr r3, [r4, #12]
  18437. 800da82: 8998 ldrh r0, [r3, #12]
  18438. 800da84: f7fc fbb6 bl 800a1f4 <lwip_ntohs>
  18439. 800da88: f010 0001 ands.w r0, r0, #1
  18440. 800da8c: d005 beq.n 800da9a <tcp_zero_window_probe+0x2a>
  18441. 800da8e: 8921 ldrh r1, [r4, #8]
  18442. 800da90: f1d1 0101 rsbs r1, r1, #1
  18443. 800da94: bf38 it cc
  18444. 800da96: 2100 movcc r1, #0
  18445. 800da98: e000 b.n 800da9c <tcp_zero_window_probe+0x2c>
  18446. 800da9a: 4601 mov r1, r0
  18447. /* we want to send one seqno: either FIN or data (no options) */
  18448. len = is_fin ? 0 : 1;
  18449. p = tcp_output_alloc_header(pcb, 0, len, seg->tcphdr->seqno);
  18450. 800da9c: 68e3 ldr r3, [r4, #12]
  18451. }
  18452. if(seg == NULL) {
  18453. return;
  18454. }
  18455. is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0);
  18456. 800da9e: fa5f f881 uxtb.w r8, r1
  18457. /* we want to send one seqno: either FIN or data (no options) */
  18458. len = is_fin ? 0 : 1;
  18459. p = tcp_output_alloc_header(pcb, 0, len, seg->tcphdr->seqno);
  18460. 800daa2: 4628 mov r0, r5
  18461. 800daa4: f081 0101 eor.w r1, r1, #1
  18462. 800daa8: 685a ldr r2, [r3, #4]
  18463. 800daaa: f7ff fb61 bl 800d170 <tcp_output_alloc_header.constprop.0>
  18464. if(p == NULL) {
  18465. 800daae: 4606 mov r6, r0
  18466. 800dab0: 2800 cmp r0, #0
  18467. 800dab2: d02e beq.n 800db12 <tcp_zero_window_probe+0xa2>
  18468. LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: no memory for pbuf\n"));
  18469. return;
  18470. }
  18471. tcphdr = (struct tcp_hdr *)p->payload;
  18472. 800dab4: 6847 ldr r7, [r0, #4]
  18473. if (is_fin) {
  18474. 800dab6: f1b8 0f00 cmp.w r8, #0
  18475. 800daba: d009 beq.n 800dad0 <tcp_zero_window_probe+0x60>
  18476. /* FIN segment, no data */
  18477. TCPH_FLAGS_SET(tcphdr, TCP_ACK | TCP_FIN);
  18478. 800dabc: 89bc ldrh r4, [r7, #12]
  18479. 800dabe: 2011 movs r0, #17
  18480. 800dac0: f7fc fb93 bl 800a1ea <lwip_htons>
  18481. 800dac4: f424 547c bic.w r4, r4, #16128 ; 0x3f00
  18482. 800dac8: b2a4 uxth r4, r4
  18483. 800daca: 4320 orrs r0, r4
  18484. 800dacc: 81b8 strh r0, [r7, #12]
  18485. 800dace: e009 b.n 800dae4 <tcp_zero_window_probe+0x74>
  18486. /* Data segment, copy in one byte from the head of the unacked queue */
  18487. char *d = ((char *)p->payload + TCP_HLEN);
  18488. /* Depending on whether the segment has already been sent (unacked) or not
  18489. (unsent), seg->p->payload points to the IP header or TCP header.
  18490. Ensure we copy the first TCP data byte: */
  18491. pbuf_copy_partial(seg->p, d, 1, seg->p->tot_len - seg->len);
  18492. 800dad0: 6860 ldr r0, [r4, #4]
  18493. 800dad2: 8923 ldrh r3, [r4, #8]
  18494. 800dad4: 8902 ldrh r2, [r0, #8]
  18495. 800dad6: 1ad3 subs r3, r2, r3
  18496. 800dad8: f107 0114 add.w r1, r7, #20
  18497. 800dadc: 2201 movs r2, #1
  18498. 800dade: b29b uxth r3, r3
  18499. 800dae0: f7fd fe3a bl 800b758 <pbuf_copy_partial>
  18500. #if CHECKSUM_GEN_TCP
  18501. tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
  18502. IP_PROTO_TCP, p->tot_len);
  18503. #endif
  18504. TCP_STATS_INC(tcp.xmit);
  18505. 800dae4: 4b0c ldr r3, [pc, #48] ; (800db18 <tcp_zero_window_probe+0xa8>)
  18506. 800dae6: f8b3 2090 ldrh.w r2, [r3, #144] ; 0x90
  18507. 800daea: 3201 adds r2, #1
  18508. 800daec: f8a3 2090 strh.w r2, [r3, #144] ; 0x90
  18509. /* Send output to IP */
  18510. #if LWIP_NETIF_HWADDRHINT
  18511. ip_output_hinted(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP,
  18512. &(pcb->addr_hint));
  18513. #else /* LWIP_NETIF_HWADDRHINT*/
  18514. ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
  18515. 800daf0: f04f 0c06 mov.w ip, #6
  18516. 800daf4: 2200 movs r2, #0
  18517. 800daf6: e88d 1004 stmia.w sp, {r2, ip}
  18518. 800dafa: 7aab ldrb r3, [r5, #10]
  18519. 800dafc: 4630 mov r0, r6
  18520. 800dafe: 4629 mov r1, r5
  18521. 800db00: 1d2a adds r2, r5, #4
  18522. 800db02: f000 fe63 bl 800e7cc <ip_output>
  18523. #endif /* LWIP_NETIF_HWADDRHINT*/
  18524. pbuf_free(p);
  18525. 800db06: 4630 mov r0, r6
  18526. LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F
  18527. " ackno %"U32_F".\n",
  18528. pcb->snd_nxt - 1, pcb->rcv_nxt));
  18529. }
  18530. 800db08: b002 add sp, #8
  18531. 800db0a: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
  18532. &(pcb->addr_hint));
  18533. #else /* LWIP_NETIF_HWADDRHINT*/
  18534. ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
  18535. #endif /* LWIP_NETIF_HWADDRHINT*/
  18536. pbuf_free(p);
  18537. 800db0e: f7fd bcd9 b.w 800b4c4 <pbuf_free>
  18538. LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F
  18539. " ackno %"U32_F".\n",
  18540. pcb->snd_nxt - 1, pcb->rcv_nxt));
  18541. }
  18542. 800db12: b002 add sp, #8
  18543. 800db14: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  18544. 800db18: 20008220 .word 0x20008220
  18545. 0800db1c <sys_timeout>:
  18546. sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name)
  18547. #else /* LWIP_DEBUG_TIMERNAMES */
  18548. void
  18549. sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
  18550. #endif /* LWIP_DEBUG_TIMERNAMES */
  18551. {
  18552. 800db1c: b570 push {r4, r5, r6, lr}
  18553. 800db1e: 4604 mov r4, r0
  18554. struct sys_timeo *timeout, *t;
  18555. timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
  18556. 800db20: 2007 movs r0, #7
  18557. sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name)
  18558. #else /* LWIP_DEBUG_TIMERNAMES */
  18559. void
  18560. sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
  18561. #endif /* LWIP_DEBUG_TIMERNAMES */
  18562. {
  18563. 800db22: 460d mov r5, r1
  18564. 800db24: 4616 mov r6, r2
  18565. struct sys_timeo *timeout, *t;
  18566. timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
  18567. 800db26: f7fd fbab bl 800b280 <memp_malloc>
  18568. if (timeout == NULL) {
  18569. 800db2a: 4603 mov r3, r0
  18570. 800db2c: b308 cbz r0, 800db72 <sys_timeout+0x56>
  18571. timeout->handler_name = handler_name;
  18572. LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
  18573. (void *)timeout, msecs, handler_name, (void *)arg));
  18574. #endif /* LWIP_DEBUG_TIMERNAMES */
  18575. if (next_timeout == NULL) {
  18576. 800db2e: 4911 ldr r1, [pc, #68] ; (800db74 <sys_timeout+0x58>)
  18577. timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
  18578. if (timeout == NULL) {
  18579. LWIP_ASSERT("sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout != NULL);
  18580. return;
  18581. }
  18582. timeout->next = NULL;
  18583. 800db30: 2200 movs r2, #0
  18584. timeout->h = handler;
  18585. timeout->arg = arg;
  18586. timeout->time = msecs;
  18587. 800db32: e880 0074 stmia.w r0, {r2, r4, r5, r6}
  18588. timeout->handler_name = handler_name;
  18589. LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
  18590. (void *)timeout, msecs, handler_name, (void *)arg));
  18591. #endif /* LWIP_DEBUG_TIMERNAMES */
  18592. if (next_timeout == NULL) {
  18593. 800db36: 680a ldr r2, [r1, #0]
  18594. 800db38: b902 cbnz r2, 800db3c <sys_timeout+0x20>
  18595. 800db3a: e005 b.n 800db48 <sys_timeout+0x2c>
  18596. next_timeout = timeout;
  18597. return;
  18598. }
  18599. if (next_timeout->time > msecs) {
  18600. 800db3c: 6850 ldr r0, [r2, #4]
  18601. 800db3e: 42a0 cmp r0, r4
  18602. 800db40: d90c bls.n 800db5c <sys_timeout+0x40>
  18603. next_timeout->time -= msecs;
  18604. 800db42: 1b04 subs r4, r0, r4
  18605. 800db44: 6054 str r4, [r2, #4]
  18606. timeout->next = next_timeout;
  18607. 800db46: 601a str r2, [r3, #0]
  18608. next_timeout = timeout;
  18609. 800db48: 600b str r3, [r1, #0]
  18610. 800db4a: bd70 pop {r4, r5, r6, pc}
  18611. } else {
  18612. for(t = next_timeout; t != NULL; t = t->next) {
  18613. timeout->time -= t->time;
  18614. if (t->next == NULL || t->next->time > timeout->time) {
  18615. 800db4c: 684c ldr r4, [r1, #4]
  18616. 800db4e: 4284 cmp r4, r0
  18617. 800db50: d80c bhi.n 800db6c <sys_timeout+0x50>
  18618. 800db52: 460a mov r2, r1
  18619. 800db54: e002 b.n 800db5c <sys_timeout+0x40>
  18620. if (t->next != NULL) {
  18621. t->next->time -= timeout->time;
  18622. }
  18623. timeout->next = t->next;
  18624. 800db56: 6019 str r1, [r3, #0]
  18625. t->next = timeout;
  18626. 800db58: 6013 str r3, [r2, #0]
  18627. break;
  18628. 800db5a: bd70 pop {r4, r5, r6, pc}
  18629. next_timeout->time -= msecs;
  18630. timeout->next = next_timeout;
  18631. next_timeout = timeout;
  18632. } else {
  18633. for(t = next_timeout; t != NULL; t = t->next) {
  18634. timeout->time -= t->time;
  18635. 800db5c: 6851 ldr r1, [r2, #4]
  18636. 800db5e: 6858 ldr r0, [r3, #4]
  18637. 800db60: 1a40 subs r0, r0, r1
  18638. if (t->next == NULL || t->next->time > timeout->time) {
  18639. 800db62: 6811 ldr r1, [r2, #0]
  18640. next_timeout->time -= msecs;
  18641. timeout->next = next_timeout;
  18642. next_timeout = timeout;
  18643. } else {
  18644. for(t = next_timeout; t != NULL; t = t->next) {
  18645. timeout->time -= t->time;
  18646. 800db64: 6058 str r0, [r3, #4]
  18647. if (t->next == NULL || t->next->time > timeout->time) {
  18648. 800db66: 2900 cmp r1, #0
  18649. 800db68: d1f0 bne.n 800db4c <sys_timeout+0x30>
  18650. 800db6a: e7f4 b.n 800db56 <sys_timeout+0x3a>
  18651. if (t->next != NULL) {
  18652. t->next->time -= timeout->time;
  18653. 800db6c: 1a20 subs r0, r4, r0
  18654. 800db6e: 6048 str r0, [r1, #4]
  18655. 800db70: e7f1 b.n 800db56 <sys_timeout+0x3a>
  18656. 800db72: bd70 pop {r4, r5, r6, pc}
  18657. 800db74: 20006bb4 .word 0x20006bb4
  18658. 0800db78 <sys_timeouts_init>:
  18659. }
  18660. #endif /* LWIP_DNS */
  18661. /** Initialize this module */
  18662. void sys_timeouts_init(void)
  18663. {
  18664. 800db78: b508 push {r3, lr}
  18665. #if IP_REASSEMBLY
  18666. sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
  18667. 800db7a: f44f 707a mov.w r0, #1000 ; 0x3e8
  18668. 800db7e: 490d ldr r1, [pc, #52] ; (800dbb4 <sys_timeouts_init+0x3c>)
  18669. 800db80: 2200 movs r2, #0
  18670. 800db82: f7ff ffcb bl 800db1c <sys_timeout>
  18671. #endif /* IP_REASSEMBLY */
  18672. #if LWIP_ARP
  18673. sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  18674. 800db86: f241 3088 movw r0, #5000 ; 0x1388
  18675. 800db8a: 490b ldr r1, [pc, #44] ; (800dbb8 <sys_timeouts_init+0x40>)
  18676. 800db8c: 2200 movs r2, #0
  18677. 800db8e: f7ff ffc5 bl 800db1c <sys_timeout>
  18678. #endif /* LWIP_ARP */
  18679. #if LWIP_DHCP
  18680. sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
  18681. 800db92: f64e 2060 movw r0, #60000 ; 0xea60
  18682. 800db96: 4909 ldr r1, [pc, #36] ; (800dbbc <sys_timeouts_init+0x44>)
  18683. 800db98: 2200 movs r2, #0
  18684. 800db9a: f7ff ffbf bl 800db1c <sys_timeout>
  18685. sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
  18686. 800db9e: f44f 70fa mov.w r0, #500 ; 0x1f4
  18687. 800dba2: 4907 ldr r1, [pc, #28] ; (800dbc0 <sys_timeouts_init+0x48>)
  18688. 800dba4: 2200 movs r2, #0
  18689. 800dba6: f7ff ffb9 bl 800db1c <sys_timeout>
  18690. sys_timeout(DNS_TMR_INTERVAL, dns_timer, NULL);
  18691. #endif /* LWIP_DNS */
  18692. #if NO_SYS
  18693. /* Initialise timestamp for sys_check_timeouts */
  18694. timeouts_last_time = sys_now();
  18695. 800dbaa: f003 fa09 bl 8010fc0 <sys_now>
  18696. 800dbae: 4b05 ldr r3, [pc, #20] ; (800dbc4 <sys_timeouts_init+0x4c>)
  18697. 800dbb0: 6018 str r0, [r3, #0]
  18698. 800dbb2: bd08 pop {r3, pc}
  18699. 800dbb4: 0800dc1d .word 0x0800dc1d
  18700. 800dbb8: 0800dc01 .word 0x0800dc01
  18701. 800dbbc: 0800dbe5 .word 0x0800dbe5
  18702. 800dbc0: 0800dbc9 .word 0x0800dbc9
  18703. 800dbc4: 20006bb0 .word 0x20006bb0
  18704. 0800dbc8 <dhcp_timer_fine>:
  18705. *
  18706. * @param arg unused argument
  18707. */
  18708. static void
  18709. dhcp_timer_fine(void *arg)
  18710. {
  18711. 800dbc8: b508 push {r3, lr}
  18712. LWIP_UNUSED_ARG(arg);
  18713. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_fine_tmr()\n"));
  18714. dhcp_fine_tmr();
  18715. 800dbca: f7fd f8e9 bl 800ada0 <dhcp_fine_tmr>
  18716. sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
  18717. 800dbce: 4904 ldr r1, [pc, #16] ; (800dbe0 <dhcp_timer_fine+0x18>)
  18718. 800dbd0: f44f 70fa mov.w r0, #500 ; 0x1f4
  18719. 800dbd4: 2200 movs r2, #0
  18720. }
  18721. 800dbd6: e8bd 4008 ldmia.w sp!, {r3, lr}
  18722. dhcp_timer_fine(void *arg)
  18723. {
  18724. LWIP_UNUSED_ARG(arg);
  18725. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_fine_tmr()\n"));
  18726. dhcp_fine_tmr();
  18727. sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
  18728. 800dbda: f7ff bf9f b.w 800db1c <sys_timeout>
  18729. 800dbde: bf00 nop
  18730. 800dbe0: 0800dbc9 .word 0x0800dbc9
  18731. 0800dbe4 <dhcp_timer_coarse>:
  18732. *
  18733. * @param arg unused argument
  18734. */
  18735. static void
  18736. dhcp_timer_coarse(void *arg)
  18737. {
  18738. 800dbe4: b508 push {r3, lr}
  18739. LWIP_UNUSED_ARG(arg);
  18740. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_coarse_tmr()\n"));
  18741. dhcp_coarse_tmr();
  18742. 800dbe6: f7fd f859 bl 800ac9c <dhcp_coarse_tmr>
  18743. sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
  18744. 800dbea: 4904 ldr r1, [pc, #16] ; (800dbfc <dhcp_timer_coarse+0x18>)
  18745. 800dbec: f64e 2060 movw r0, #60000 ; 0xea60
  18746. 800dbf0: 2200 movs r2, #0
  18747. }
  18748. 800dbf2: e8bd 4008 ldmia.w sp!, {r3, lr}
  18749. dhcp_timer_coarse(void *arg)
  18750. {
  18751. LWIP_UNUSED_ARG(arg);
  18752. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_coarse_tmr()\n"));
  18753. dhcp_coarse_tmr();
  18754. sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
  18755. 800dbf6: f7ff bf91 b.w 800db1c <sys_timeout>
  18756. 800dbfa: bf00 nop
  18757. 800dbfc: 0800dbe5 .word 0x0800dbe5
  18758. 0800dc00 <arp_timer>:
  18759. *
  18760. * @param arg unused argument
  18761. */
  18762. static void
  18763. arp_timer(void *arg)
  18764. {
  18765. 800dc00: b508 push {r3, lr}
  18766. LWIP_UNUSED_ARG(arg);
  18767. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n"));
  18768. etharp_tmr();
  18769. 800dc02: f001 f961 bl 800eec8 <etharp_tmr>
  18770. sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  18771. 800dc06: 4904 ldr r1, [pc, #16] ; (800dc18 <arp_timer+0x18>)
  18772. 800dc08: f241 3088 movw r0, #5000 ; 0x1388
  18773. 800dc0c: 2200 movs r2, #0
  18774. }
  18775. 800dc0e: e8bd 4008 ldmia.w sp!, {r3, lr}
  18776. arp_timer(void *arg)
  18777. {
  18778. LWIP_UNUSED_ARG(arg);
  18779. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n"));
  18780. etharp_tmr();
  18781. sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  18782. 800dc12: f7ff bf83 b.w 800db1c <sys_timeout>
  18783. 800dc16: bf00 nop
  18784. 800dc18: 0800dc01 .word 0x0800dc01
  18785. 0800dc1c <ip_reass_timer>:
  18786. *
  18787. * @param arg unused argument
  18788. */
  18789. static void
  18790. ip_reass_timer(void *arg)
  18791. {
  18792. 800dc1c: b508 push {r3, lr}
  18793. LWIP_UNUSED_ARG(arg);
  18794. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: ip_reass_tmr()\n"));
  18795. ip_reass_tmr();
  18796. 800dc1e: f000 fe83 bl 800e928 <ip_reass_tmr>
  18797. sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
  18798. 800dc22: 4904 ldr r1, [pc, #16] ; (800dc34 <ip_reass_timer+0x18>)
  18799. 800dc24: f44f 707a mov.w r0, #1000 ; 0x3e8
  18800. 800dc28: 2200 movs r2, #0
  18801. }
  18802. 800dc2a: e8bd 4008 ldmia.w sp!, {r3, lr}
  18803. ip_reass_timer(void *arg)
  18804. {
  18805. LWIP_UNUSED_ARG(arg);
  18806. LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: ip_reass_tmr()\n"));
  18807. ip_reass_tmr();
  18808. sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
  18809. 800dc2e: f7ff bf75 b.w 800db1c <sys_timeout>
  18810. 800dc32: bf00 nop
  18811. 800dc34: 0800dc1d .word 0x0800dc1d
  18812. 0800dc38 <tcp_timer_needed>:
  18813. */
  18814. void
  18815. tcp_timer_needed(void)
  18816. {
  18817. /* timer is off but needed again? */
  18818. if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
  18819. 800dc38: 4b08 ldr r3, [pc, #32] ; (800dc5c <tcp_timer_needed+0x24>)
  18820. 800dc3a: 681b ldr r3, [r3, #0]
  18821. 800dc3c: b96b cbnz r3, 800dc5a <tcp_timer_needed+0x22>
  18822. 800dc3e: 4b08 ldr r3, [pc, #32] ; (800dc60 <tcp_timer_needed+0x28>)
  18823. 800dc40: 681b ldr r3, [r3, #0]
  18824. 800dc42: b913 cbnz r3, 800dc4a <tcp_timer_needed+0x12>
  18825. 800dc44: 4b07 ldr r3, [pc, #28] ; (800dc64 <tcp_timer_needed+0x2c>)
  18826. 800dc46: 681b ldr r3, [r3, #0]
  18827. 800dc48: b13b cbz r3, 800dc5a <tcp_timer_needed+0x22>
  18828. /* enable and start timer */
  18829. tcpip_tcp_timer_active = 1;
  18830. 800dc4a: 4b04 ldr r3, [pc, #16] ; (800dc5c <tcp_timer_needed+0x24>)
  18831. sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  18832. 800dc4c: 4906 ldr r1, [pc, #24] ; (800dc68 <tcp_timer_needed+0x30>)
  18833. tcp_timer_needed(void)
  18834. {
  18835. /* timer is off but needed again? */
  18836. if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
  18837. /* enable and start timer */
  18838. tcpip_tcp_timer_active = 1;
  18839. 800dc4e: 2201 movs r2, #1
  18840. 800dc50: 601a str r2, [r3, #0]
  18841. sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  18842. 800dc52: 20fa movs r0, #250 ; 0xfa
  18843. 800dc54: 2200 movs r2, #0
  18844. 800dc56: f7ff bf61 b.w 800db1c <sys_timeout>
  18845. 800dc5a: 4770 bx lr
  18846. 800dc5c: 20006bac .word 0x20006bac
  18847. 800dc60: 2000833c .word 0x2000833c
  18848. 800dc64: 20008350 .word 0x20008350
  18849. 800dc68: 0800dc6d .word 0x0800dc6d
  18850. 0800dc6c <tcpip_tcp_timer>:
  18851. *
  18852. * @param arg unused argument
  18853. */
  18854. static void
  18855. tcpip_tcp_timer(void *arg)
  18856. {
  18857. 800dc6c: b508 push {r3, lr}
  18858. LWIP_UNUSED_ARG(arg);
  18859. /* call TCP timer handler */
  18860. tcp_tmr();
  18861. 800dc6e: f7fe facd bl 800c20c <tcp_tmr>
  18862. /* timer still needed? */
  18863. if (tcp_active_pcbs || tcp_tw_pcbs) {
  18864. 800dc72: 4b08 ldr r3, [pc, #32] ; (800dc94 <tcpip_tcp_timer+0x28>)
  18865. 800dc74: 681b ldr r3, [r3, #0]
  18866. 800dc76: b913 cbnz r3, 800dc7e <tcpip_tcp_timer+0x12>
  18867. 800dc78: 4b07 ldr r3, [pc, #28] ; (800dc98 <tcpip_tcp_timer+0x2c>)
  18868. 800dc7a: 681b ldr r3, [r3, #0]
  18869. 800dc7c: b133 cbz r3, 800dc8c <tcpip_tcp_timer+0x20>
  18870. /* restart timer */
  18871. sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  18872. 800dc7e: 4907 ldr r1, [pc, #28] ; (800dc9c <tcpip_tcp_timer+0x30>)
  18873. 800dc80: 20fa movs r0, #250 ; 0xfa
  18874. 800dc82: 2200 movs r2, #0
  18875. } else {
  18876. /* disable timer */
  18877. tcpip_tcp_timer_active = 0;
  18878. }
  18879. }
  18880. 800dc84: e8bd 4008 ldmia.w sp!, {r3, lr}
  18881. /* call TCP timer handler */
  18882. tcp_tmr();
  18883. /* timer still needed? */
  18884. if (tcp_active_pcbs || tcp_tw_pcbs) {
  18885. /* restart timer */
  18886. sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  18887. 800dc88: f7ff bf48 b.w 800db1c <sys_timeout>
  18888. } else {
  18889. /* disable timer */
  18890. tcpip_tcp_timer_active = 0;
  18891. 800dc8c: 4a04 ldr r2, [pc, #16] ; (800dca0 <tcpip_tcp_timer+0x34>)
  18892. 800dc8e: 6013 str r3, [r2, #0]
  18893. 800dc90: bd08 pop {r3, pc}
  18894. 800dc92: bf00 nop
  18895. 800dc94: 2000833c .word 0x2000833c
  18896. 800dc98: 20008350 .word 0x20008350
  18897. 800dc9c: 0800dc6d .word 0x0800dc6d
  18898. 800dca0: 20006bac .word 0x20006bac
  18899. 0800dca4 <sys_check_timeouts>:
  18900. *
  18901. * Must be called periodically from your main loop.
  18902. */
  18903. void
  18904. sys_check_timeouts(void)
  18905. {
  18906. 800dca4: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
  18907. if (next_timeout) {
  18908. 800dca8: 4e10 ldr r6, [pc, #64] ; (800dcec <sys_check_timeouts+0x48>)
  18909. 800dcaa: 6833 ldr r3, [r6, #0]
  18910. 800dcac: b1db cbz r3, 800dce6 <sys_check_timeouts+0x42>
  18911. sys_timeout_handler handler;
  18912. void *arg;
  18913. u8_t had_one;
  18914. u32_t now;
  18915. now = sys_now();
  18916. 800dcae: f003 f987 bl 8010fc0 <sys_now>
  18917. /* this cares for wraparounds */
  18918. diff = now - timeouts_last_time;
  18919. 800dcb2: 4b0f ldr r3, [pc, #60] ; (800dcf0 <sys_check_timeouts+0x4c>)
  18920. 800dcb4: 681c ldr r4, [r3, #0]
  18921. sys_timeout_handler handler;
  18922. void *arg;
  18923. u8_t had_one;
  18924. u32_t now;
  18925. now = sys_now();
  18926. 800dcb6: 4605 mov r5, r0
  18927. /* this cares for wraparounds */
  18928. diff = now - timeouts_last_time;
  18929. 800dcb8: 1b04 subs r4, r0, r4
  18930. had_one = 0;
  18931. tmptimeout = next_timeout;
  18932. if (tmptimeout && (tmptimeout->time <= diff)) {
  18933. /* timeout has expired */
  18934. had_one = 1;
  18935. timeouts_last_time = now;
  18936. 800dcba: 4698 mov r8, r3
  18937. {
  18938. #if PBUF_POOL_FREE_OOSEQ
  18939. PBUF_CHECK_FREE_OOSEQ();
  18940. #endif /* PBUF_POOL_FREE_OOSEQ */
  18941. had_one = 0;
  18942. tmptimeout = next_timeout;
  18943. 800dcbc: 6831 ldr r1, [r6, #0]
  18944. if (tmptimeout && (tmptimeout->time <= diff)) {
  18945. 800dcbe: b191 cbz r1, 800dce6 <sys_check_timeouts+0x42>
  18946. 800dcc0: 684b ldr r3, [r1, #4]
  18947. 800dcc2: 42a3 cmp r3, r4
  18948. 800dcc4: d80f bhi.n 800dce6 <sys_check_timeouts+0x42>
  18949. /* timeout has expired */
  18950. had_one = 1;
  18951. timeouts_last_time = now;
  18952. diff -= tmptimeout->time;
  18953. 800dcc6: 1ae4 subs r4, r4, r3
  18954. next_timeout = tmptimeout->next;
  18955. handler = tmptimeout->h;
  18956. 800dcc8: 688f ldr r7, [r1, #8]
  18957. if (tmptimeout && (tmptimeout->time <= diff)) {
  18958. /* timeout has expired */
  18959. had_one = 1;
  18960. timeouts_last_time = now;
  18961. diff -= tmptimeout->time;
  18962. next_timeout = tmptimeout->next;
  18963. 800dcca: 680b ldr r3, [r1, #0]
  18964. had_one = 0;
  18965. tmptimeout = next_timeout;
  18966. if (tmptimeout && (tmptimeout->time <= diff)) {
  18967. /* timeout has expired */
  18968. had_one = 1;
  18969. timeouts_last_time = now;
  18970. 800dccc: f8c8 5000 str.w r5, [r8]
  18971. if (handler != NULL) {
  18972. LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%s arg=%p\n",
  18973. tmptimeout->handler_name, arg));
  18974. }
  18975. #endif /* LWIP_DEBUG_TIMERNAMES */
  18976. memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
  18977. 800dcd0: 2007 movs r0, #7
  18978. if (tmptimeout && (tmptimeout->time <= diff)) {
  18979. /* timeout has expired */
  18980. had_one = 1;
  18981. timeouts_last_time = now;
  18982. diff -= tmptimeout->time;
  18983. next_timeout = tmptimeout->next;
  18984. 800dcd2: 6033 str r3, [r6, #0]
  18985. handler = tmptimeout->h;
  18986. arg = tmptimeout->arg;
  18987. 800dcd4: f8d1 900c ldr.w r9, [r1, #12]
  18988. if (handler != NULL) {
  18989. LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%s arg=%p\n",
  18990. tmptimeout->handler_name, arg));
  18991. }
  18992. #endif /* LWIP_DEBUG_TIMERNAMES */
  18993. memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
  18994. 800dcd8: f7fd fafc bl 800b2d4 <memp_free>
  18995. if (handler != NULL) {
  18996. 800dcdc: 2f00 cmp r7, #0
  18997. 800dcde: d0ed beq.n 800dcbc <sys_check_timeouts+0x18>
  18998. handler(arg);
  18999. 800dce0: 4648 mov r0, r9
  19000. 800dce2: 47b8 blx r7
  19001. 800dce4: e7ea b.n 800dcbc <sys_check_timeouts+0x18>
  19002. 800dce6: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
  19003. 800dcea: bf00 nop
  19004. 800dcec: 20006bb4 .word 0x20006bb4
  19005. 800dcf0: 20006bb0 .word 0x20006bb0
  19006. 0800dcf4 <udp_init>:
  19007. /**
  19008. * Initialize this module.
  19009. */
  19010. void
  19011. udp_init(void)
  19012. {
  19013. 800dcf4: 4770 bx lr
  19014. 800dcf6: 0000 movs r0, r0
  19015. 0800dcf8 <udp_input>:
  19016. u8_t local_match;
  19017. u8_t broadcast;
  19018. PERF_START;
  19019. UDP_STATS_INC(udp.recv);
  19020. 800dcf8: 4b69 ldr r3, [pc, #420] ; (800dea0 <udp_input+0x1a8>)
  19021. * @param inp network interface on which the datagram was received.
  19022. *
  19023. */
  19024. void
  19025. udp_input(struct pbuf *p, struct netif *inp)
  19026. {
  19027. 800dcfa: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  19028. u8_t local_match;
  19029. u8_t broadcast;
  19030. PERF_START;
  19031. UDP_STATS_INC(udp.recv);
  19032. 800dcfe: f8b3 207a ldrh.w r2, [r3, #122] ; 0x7a
  19033. iphdr = (struct ip_hdr *)p->payload;
  19034. 800dd02: f8d0 9004 ldr.w r9, [r0, #4]
  19035. u8_t local_match;
  19036. u8_t broadcast;
  19037. PERF_START;
  19038. UDP_STATS_INC(udp.recv);
  19039. 800dd06: 3201 adds r2, #1
  19040. 800dd08: f8a3 207a strh.w r2, [r3, #122] ; 0x7a
  19041. * @param inp network interface on which the datagram was received.
  19042. *
  19043. */
  19044. void
  19045. udp_input(struct pbuf *p, struct netif *inp)
  19046. {
  19047. 800dd0c: 460e mov r6, r1
  19048. iphdr = (struct ip_hdr *)p->payload;
  19049. /* Check minimum length (IP header + UDP header)
  19050. * and move payload pointer to UDP header */
  19051. if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
  19052. 800dd0e: f899 1000 ldrb.w r1, [r9]
  19053. 800dd12: 8903 ldrh r3, [r0, #8]
  19054. 800dd14: f001 010f and.w r1, r1, #15
  19055. 800dd18: 1c8a adds r2, r1, #2
  19056. 800dd1a: ebb3 0f82 cmp.w r3, r2, lsl #2
  19057. * @param inp network interface on which the datagram was received.
  19058. *
  19059. */
  19060. void
  19061. udp_input(struct pbuf *p, struct netif *inp)
  19062. {
  19063. 800dd1e: b085 sub sp, #20
  19064. 800dd20: 4605 mov r5, r0
  19065. iphdr = (struct ip_hdr *)p->payload;
  19066. /* Check minimum length (IP header + UDP header)
  19067. * and move payload pointer to UDP header */
  19068. if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
  19069. 800dd22: da06 bge.n 800dd32 <udp_input+0x3a>
  19070. /* drop short packets */
  19071. LWIP_DEBUGF(UDP_DEBUG,
  19072. ("udp_input: short UDP datagram (%"U16_F" bytes) discarded\n", p->tot_len));
  19073. UDP_STATS_INC(udp.lenerr);
  19074. 800dd24: 4b5e ldr r3, [pc, #376] ; (800dea0 <udp_input+0x1a8>)
  19075. 800dd26: f8b3 2082 ldrh.w r2, [r3, #130] ; 0x82
  19076. 800dd2a: 3201 adds r2, #1
  19077. 800dd2c: f8a3 2082 strh.w r2, [r3, #130] ; 0x82
  19078. 800dd30: e0a3 b.n 800de7a <udp_input+0x182>
  19079. iphdr = (struct ip_hdr *)p->payload;
  19080. /* Check minimum length (IP header + UDP header)
  19081. * and move payload pointer to UDP header */
  19082. if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
  19083. 800dd32: 0089 lsls r1, r1, #2
  19084. 800dd34: 4249 negs r1, r1
  19085. 800dd36: f7fd fb9a bl 800b46e <pbuf_header>
  19086. 800dd3a: 4683 mov fp, r0
  19087. 800dd3c: 2800 cmp r0, #0
  19088. 800dd3e: d1f1 bne.n 800dd24 <udp_input+0x2c>
  19089. }
  19090. udphdr = (struct udp_hdr *)p->payload;
  19091. /* is broadcast packet ? */
  19092. broadcast = ip_addr_isbroadcast(&current_iphdr_dest, inp);
  19093. 800dd40: f8df a168 ldr.w sl, [pc, #360] ; 800deac <udp_input+0x1b4>
  19094. snmp_inc_udpinerrors();
  19095. pbuf_free(p);
  19096. goto end;
  19097. }
  19098. udphdr = (struct udp_hdr *)p->payload;
  19099. 800dd44: 686c ldr r4, [r5, #4]
  19100. /* is broadcast packet ? */
  19101. broadcast = ip_addr_isbroadcast(&current_iphdr_dest, inp);
  19102. 800dd46: f8da 0000 ldr.w r0, [sl]
  19103. 800dd4a: 4631 mov r1, r6
  19104. 800dd4c: f000 fb19 bl 800e382 <ip4_addr_isbroadcast>
  19105. 800dd50: 4607 mov r7, r0
  19106. LWIP_DEBUGF(UDP_DEBUG, ("udp_input: received datagram of length %"U16_F"\n", p->tot_len));
  19107. /* convert src and dest ports to host byte order */
  19108. src = ntohs(udphdr->src);
  19109. 800dd52: 8820 ldrh r0, [r4, #0]
  19110. 800dd54: f7fc fa4e bl 800a1f4 <lwip_ntohs>
  19111. 800dd58: 4680 mov r8, r0
  19112. dest = ntohs(udphdr->dest);
  19113. 800dd5a: 8860 ldrh r0, [r4, #2]
  19114. 800dd5c: f7fc fa4a bl 800a1f4 <lwip_ntohs>
  19115. #if LWIP_DHCP
  19116. pcb = NULL;
  19117. /* when LWIP_DHCP is active, packets to DHCP_CLIENT_PORT may only be processed by
  19118. the dhcp module, no other UDP pcb may use the local UDP port DHCP_CLIENT_PORT */
  19119. if (dest == DHCP_CLIENT_PORT) {
  19120. 800dd60: 2844 cmp r0, #68 ; 0x44
  19121. 800dd62: d110 bne.n 800dd86 <udp_input+0x8e>
  19122. /* all packets for DHCP_CLIENT_PORT not coming from DHCP_SERVER_PORT are dropped! */
  19123. if (src == DHCP_SERVER_PORT) {
  19124. 800dd64: f1b8 0f43 cmp.w r8, #67 ; 0x43
  19125. 800dd68: d152 bne.n 800de10 <udp_input+0x118>
  19126. if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) {
  19127. 800dd6a: 6a33 ldr r3, [r6, #32]
  19128. 800dd6c: 2b00 cmp r3, #0
  19129. 800dd6e: d04f beq.n 800de10 <udp_input+0x118>
  19130. 800dd70: 685c ldr r4, [r3, #4]
  19131. 800dd72: 2c00 cmp r4, #0
  19132. 800dd74: d04c beq.n 800de10 <udp_input+0x118>
  19133. /* accept the packe if
  19134. (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY!
  19135. - inp->dhcp->pcb->remote == ANY or iphdr->src */
  19136. if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) ||
  19137. 800dd76: 6863 ldr r3, [r4, #4]
  19138. 800dd78: 2b00 cmp r3, #0
  19139. 800dd7a: d051 beq.n 800de20 <udp_input+0x128>
  19140. ip_addr_cmp(&(inp->dhcp->pcb->remote_ip), &current_iphdr_src))) {
  19141. 800dd7c: 4a49 ldr r2, [pc, #292] ; (800dea4 <udp_input+0x1ac>)
  19142. if (src == DHCP_SERVER_PORT) {
  19143. if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) {
  19144. /* accept the packe if
  19145. (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY!
  19146. - inp->dhcp->pcb->remote == ANY or iphdr->src */
  19147. if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) ||
  19148. 800dd7e: 6812 ldr r2, [r2, #0]
  19149. 800dd80: 4293 cmp r3, r2
  19150. 800dd82: d145 bne.n 800de10 <udp_input+0x118>
  19151. 800dd84: e04c b.n 800de20 <udp_input+0x128>
  19152. uncon_pcb = NULL;
  19153. /* Iterate through the UDP pcb list for a matching pcb.
  19154. * 'Perfect match' pcbs (connected to the remote port & ip address) are
  19155. * preferred. If no perfect match is found, the first unconnected pcb that
  19156. * matches the local port and ip address gets the datagram. */
  19157. for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19158. 800dd86: 4b48 ldr r3, [pc, #288] ; (800dea8 <udp_input+0x1b0>)
  19159. /* compare PCB local addr+port to UDP destination addr+port */
  19160. if (pcb->local_port == dest) {
  19161. if (
  19162. (!broadcast && ip_addr_isany(&pcb->local_ip)) ||
  19163. ip_addr_cmp(&(pcb->local_ip), &current_iphdr_dest) ||
  19164. 800dd88: f8da a000 ldr.w sl, [sl]
  19165. uncon_pcb = NULL;
  19166. /* Iterate through the UDP pcb list for a matching pcb.
  19167. * 'Perfect match' pcbs (connected to the remote port & ip address) are
  19168. * preferred. If no perfect match is found, the first unconnected pcb that
  19169. * matches the local port and ip address gets the datagram. */
  19170. for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19171. 800dd8c: f8d3 c000 ldr.w ip, [r3]
  19172. }
  19173. /* compare PCB remote addr+port to UDP source addr+port */
  19174. if ((local_match != 0) &&
  19175. (pcb->remote_port == src) &&
  19176. (ip_addr_isany(&pcb->remote_ip) ||
  19177. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src))) {
  19178. 800dd90: 4b44 ldr r3, [pc, #272] ; (800dea4 <udp_input+0x1ac>)
  19179. 800dd92: 681b ldr r3, [r3, #0]
  19180. uncon_pcb = NULL;
  19181. /* Iterate through the UDP pcb list for a matching pcb.
  19182. * 'Perfect match' pcbs (connected to the remote port & ip address) are
  19183. * preferred. If no perfect match is found, the first unconnected pcb that
  19184. * matches the local port and ip address gets the datagram. */
  19185. for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19186. 800dd94: 4664 mov r4, ip
  19187. }
  19188. /* compare PCB remote addr+port to UDP source addr+port */
  19189. if ((local_match != 0) &&
  19190. (pcb->remote_port == src) &&
  19191. (ip_addr_isany(&pcb->remote_ip) ||
  19192. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src))) {
  19193. 800dd96: 9303 str r3, [sp, #12]
  19194. }
  19195. }
  19196. } else
  19197. #endif /* LWIP_DHCP */
  19198. {
  19199. prev = NULL;
  19200. 800dd98: 4659 mov r1, fp
  19201. local_match = 0;
  19202. uncon_pcb = NULL;
  19203. 800dd9a: 465b mov r3, fp
  19204. /* Iterate through the UDP pcb list for a matching pcb.
  19205. * 'Perfect match' pcbs (connected to the remote port & ip address) are
  19206. * preferred. If no perfect match is found, the first unconnected pcb that
  19207. * matches the local port and ip address gets the datagram. */
  19208. for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19209. 800dd9c: e035 b.n 800de0a <udp_input+0x112>
  19210. ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip), pcb->local_port,
  19211. ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip),
  19212. ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip), pcb->remote_port));
  19213. /* compare PCB local addr+port to UDP destination addr+port */
  19214. if (pcb->local_port == dest) {
  19215. 800dd9e: 8a62 ldrh r2, [r4, #18]
  19216. 800dda0: 4282 cmp r2, r0
  19217. 800dda2: d130 bne.n 800de06 <udp_input+0x10e>
  19218. 800dda4: 6822 ldr r2, [r4, #0]
  19219. if (
  19220. 800dda6: b907 cbnz r7, 800ddaa <udp_input+0xb2>
  19221. (!broadcast && ip_addr_isany(&pcb->local_ip)) ||
  19222. 800dda8: b14a cbz r2, 800ddbe <udp_input+0xc6>
  19223. 800ddaa: 4552 cmp r2, sl
  19224. 800ddac: d007 beq.n 800ddbe <udp_input+0xc6>
  19225. ip_addr_cmp(&(pcb->local_ip), &current_iphdr_dest) ||
  19226. 800ddae: b357 cbz r7, 800de06 <udp_input+0x10e>
  19227. (broadcast && ip_get_option(pcb, SOF_BROADCAST) &&
  19228. (ip_addr_isany(&pcb->local_ip) ||
  19229. ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
  19230. #else /* IP_SOF_BROADCAST_RECV */
  19231. (broadcast &&
  19232. (ip_addr_isany(&pcb->local_ip) ||
  19233. 800ddb0: b12a cbz r2, 800ddbe <udp_input+0xc6>
  19234. ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
  19235. 800ddb2: ea8a 0b02 eor.w fp, sl, r2
  19236. 800ddb6: 68b2 ldr r2, [r6, #8]
  19237. (broadcast && ip_get_option(pcb, SOF_BROADCAST) &&
  19238. (ip_addr_isany(&pcb->local_ip) ||
  19239. ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
  19240. #else /* IP_SOF_BROADCAST_RECV */
  19241. (broadcast &&
  19242. (ip_addr_isany(&pcb->local_ip) ||
  19243. 800ddb8: ea1b 0f02 tst.w fp, r2
  19244. 800ddbc: d123 bne.n 800de06 <udp_input+0x10e>
  19245. ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
  19246. #endif /* IP_SOF_BROADCAST_RECV */
  19247. local_match = 1;
  19248. if ((uncon_pcb == NULL) &&
  19249. 800ddbe: 2b00 cmp r3, #0
  19250. 800ddc0: d166 bne.n 800de90 <udp_input+0x198>
  19251. ((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) {
  19252. 800ddc2: 7c23 ldrb r3, [r4, #16]
  19253. (broadcast &&
  19254. (ip_addr_isany(&pcb->local_ip) ||
  19255. ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
  19256. #endif /* IP_SOF_BROADCAST_RECV */
  19257. local_match = 1;
  19258. if ((uncon_pcb == NULL) &&
  19259. 800ddc4: f003 0304 and.w r3, r3, #4
  19260. 800ddc8: b2db uxtb r3, r3
  19261. 800ddca: 2b00 cmp r3, #0
  19262. 800ddcc: bf0c ite eq
  19263. 800ddce: 4623 moveq r3, r4
  19264. 800ddd0: 2300 movne r3, #0
  19265. 800ddd2: e05d b.n 800de90 <udp_input+0x198>
  19266. }
  19267. }
  19268. /* compare PCB remote addr+port to UDP source addr+port */
  19269. if ((local_match != 0) &&
  19270. (pcb->remote_port == src) &&
  19271. (ip_addr_isany(&pcb->remote_ip) ||
  19272. 800ddd4: f8d4 b004 ldr.w fp, [r4, #4]
  19273. 800ddd8: f1bb 0f00 cmp.w fp, #0
  19274. 800dddc: d101 bne.n 800dde2 <udp_input+0xea>
  19275. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src))) {
  19276. /* the first fully matching PCB */
  19277. if (prev != NULL) {
  19278. 800ddde: b921 cbnz r1, 800ddea <udp_input+0xf2>
  19279. 800dde0: e00a b.n 800ddf8 <udp_input+0x100>
  19280. }
  19281. }
  19282. /* compare PCB remote addr+port to UDP source addr+port */
  19283. if ((local_match != 0) &&
  19284. (pcb->remote_port == src) &&
  19285. (ip_addr_isany(&pcb->remote_ip) ||
  19286. 800dde2: 9a03 ldr r2, [sp, #12]
  19287. 800dde4: 4593 cmp fp, r2
  19288. 800dde6: d10e bne.n 800de06 <udp_input+0x10e>
  19289. 800dde8: e7f9 b.n 800ddde <udp_input+0xe6>
  19290. ip_addr_cmp(&(pcb->remote_ip), &current_iphdr_src))) {
  19291. /* the first fully matching PCB */
  19292. if (prev != NULL) {
  19293. /* move the pcb to the front of udp_pcbs so that is
  19294. found faster next time */
  19295. prev->next = pcb->next;
  19296. 800ddea: 68e3 ldr r3, [r4, #12]
  19297. 800ddec: 60cb str r3, [r1, #12]
  19298. pcb->next = udp_pcbs;
  19299. udp_pcbs = pcb;
  19300. 800ddee: 4b2e ldr r3, [pc, #184] ; (800dea8 <udp_input+0x1b0>)
  19301. /* the first fully matching PCB */
  19302. if (prev != NULL) {
  19303. /* move the pcb to the front of udp_pcbs so that is
  19304. found faster next time */
  19305. prev->next = pcb->next;
  19306. pcb->next = udp_pcbs;
  19307. 800ddf0: f8c4 c00c str.w ip, [r4, #12]
  19308. udp_pcbs = pcb;
  19309. 800ddf4: 601c str r4, [r3, #0]
  19310. 800ddf6: e013 b.n 800de20 <udp_input+0x128>
  19311. } else {
  19312. UDP_STATS_INC(udp.cachehit);
  19313. 800ddf8: 4b29 ldr r3, [pc, #164] ; (800dea0 <udp_input+0x1a8>)
  19314. 800ddfa: f8b3 208e ldrh.w r2, [r3, #142] ; 0x8e
  19315. 800ddfe: 3201 adds r2, #1
  19316. 800de00: f8a3 208e strh.w r2, [r3, #142] ; 0x8e
  19317. 800de04: e00c b.n 800de20 <udp_input+0x128>
  19318. 800de06: 4621 mov r1, r4
  19319. uncon_pcb = NULL;
  19320. /* Iterate through the UDP pcb list for a matching pcb.
  19321. * 'Perfect match' pcbs (connected to the remote port & ip address) are
  19322. * preferred. If no perfect match is found, the first unconnected pcb that
  19323. * matches the local port and ip address gets the datagram. */
  19324. for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19325. 800de08: 68e4 ldr r4, [r4, #12]
  19326. 800de0a: 2c00 cmp r4, #0
  19327. 800de0c: d1c7 bne.n 800dd9e <udp_input+0xa6>
  19328. pcb = uncon_pcb;
  19329. }
  19330. }
  19331. /* Check checksum if this is a match or if it was directed at us. */
  19332. if (pcb != NULL || ip_addr_cmp(&inp->ip_addr, &current_iphdr_dest)) {
  19333. 800de0e: b933 cbnz r3, 800de1e <udp_input+0x126>
  19334. 800de10: 4b26 ldr r3, [pc, #152] ; (800deac <udp_input+0x1b4>)
  19335. 800de12: 6872 ldr r2, [r6, #4]
  19336. 800de14: 681b ldr r3, [r3, #0]
  19337. 800de16: 429a cmp r2, r3
  19338. 800de18: d134 bne.n 800de84 <udp_input+0x18c>
  19339. 800de1a: 2400 movs r4, #0
  19340. 800de1c: e000 b.n 800de20 <udp_input+0x128>
  19341. 800de1e: 461c mov r4, r3
  19342. goto end;
  19343. }
  19344. }
  19345. #endif /* CHECKSUM_CHECK_UDP */
  19346. }
  19347. if(pbuf_header(p, -UDP_HLEN)) {
  19348. 800de20: 4628 mov r0, r5
  19349. 800de22: f06f 0107 mvn.w r1, #7
  19350. 800de26: f7fd fb22 bl 800b46e <pbuf_header>
  19351. 800de2a: b108 cbz r0, 800de30 <udp_input+0x138>
  19352. /* Can we cope with this failing? Just assert for now */
  19353. LWIP_ASSERT("pbuf_header failed\n", 0);
  19354. UDP_STATS_INC(udp.drop);
  19355. 800de2c: 4b1c ldr r3, [pc, #112] ; (800dea0 <udp_input+0x1a8>)
  19356. 800de2e: e024 b.n 800de7a <udp_input+0x182>
  19357. snmp_inc_udpinerrors();
  19358. pbuf_free(p);
  19359. goto end;
  19360. }
  19361. if (pcb != NULL) {
  19362. 800de30: b14c cbz r4, 800de46 <udp_input+0x14e>
  19363. pbuf_header(p, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
  19364. }
  19365. }
  19366. #endif /* SO_REUSE && SO_REUSE_RXTOALL */
  19367. /* callback */
  19368. if (pcb->recv != NULL) {
  19369. 800de32: 69a6 ldr r6, [r4, #24]
  19370. 800de34: b336 cbz r6, 800de84 <udp_input+0x18c>
  19371. /* now the recv function is responsible for freeing p */
  19372. pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr(), src);
  19373. 800de36: f8cd 8000 str.w r8, [sp]
  19374. 800de3a: 69e0 ldr r0, [r4, #28]
  19375. 800de3c: 4b19 ldr r3, [pc, #100] ; (800dea4 <udp_input+0x1ac>)
  19376. 800de3e: 4621 mov r1, r4
  19377. 800de40: 462a mov r2, r5
  19378. 800de42: 47b0 blx r6
  19379. 800de44: e028 b.n 800de98 <udp_input+0x1a0>
  19380. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));
  19381. #if LWIP_ICMP
  19382. /* No match was found, send ICMP destination port unreachable unless
  19383. destination address was broadcast/multicast. */
  19384. if (!broadcast &&
  19385. 800de46: b997 cbnz r7, 800de6e <udp_input+0x176>
  19386. !ip_addr_ismulticast(&current_iphdr_dest)) {
  19387. 800de48: 4b18 ldr r3, [pc, #96] ; (800deac <udp_input+0x1b4>)
  19388. 800de4a: 681b ldr r3, [r3, #0]
  19389. 800de4c: f003 03f0 and.w r3, r3, #240 ; 0xf0
  19390. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));
  19391. #if LWIP_ICMP
  19392. /* No match was found, send ICMP destination port unreachable unless
  19393. destination address was broadcast/multicast. */
  19394. if (!broadcast &&
  19395. 800de50: 2be0 cmp r3, #224 ; 0xe0
  19396. 800de52: d00c beq.n 800de6e <udp_input+0x176>
  19397. !ip_addr_ismulticast(&current_iphdr_dest)) {
  19398. /* move payload pointer back to ip header */
  19399. pbuf_header(p, (IPH_HL(iphdr) * 4) + UDP_HLEN);
  19400. 800de54: f899 1000 ldrb.w r1, [r9]
  19401. 800de58: f001 010f and.w r1, r1, #15
  19402. 800de5c: 3102 adds r1, #2
  19403. 800de5e: 0089 lsls r1, r1, #2
  19404. 800de60: 4628 mov r0, r5
  19405. 800de62: f7fd fb04 bl 800b46e <pbuf_header>
  19406. LWIP_ASSERT("p->payload == iphdr", (p->payload == iphdr));
  19407. icmp_dest_unreach(p, ICMP_DUR_PORT);
  19408. 800de66: 4628 mov r0, r5
  19409. 800de68: 2103 movs r1, #3
  19410. 800de6a: f000 fa2d bl 800e2c8 <icmp_dest_unreach>
  19411. }
  19412. #endif /* LWIP_ICMP */
  19413. UDP_STATS_INC(udp.proterr);
  19414. 800de6e: 4b0c ldr r3, [pc, #48] ; (800dea0 <udp_input+0x1a8>)
  19415. 800de70: f8b3 2088 ldrh.w r2, [r3, #136] ; 0x88
  19416. 800de74: 3201 adds r2, #1
  19417. 800de76: f8a3 2088 strh.w r2, [r3, #136] ; 0x88
  19418. UDP_STATS_INC(udp.drop);
  19419. 800de7a: f8b3 207e ldrh.w r2, [r3, #126] ; 0x7e
  19420. 800de7e: 3201 adds r2, #1
  19421. 800de80: f8a3 207e strh.w r2, [r3, #126] ; 0x7e
  19422. snmp_inc_udpnoports();
  19423. pbuf_free(p);
  19424. 800de84: 4628 mov r0, r5
  19425. } else {
  19426. pbuf_free(p);
  19427. }
  19428. end:
  19429. PERF_STOP("udp_input");
  19430. }
  19431. 800de86: b005 add sp, #20
  19432. 800de88: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  19433. }
  19434. #endif /* LWIP_ICMP */
  19435. UDP_STATS_INC(udp.proterr);
  19436. UDP_STATS_INC(udp.drop);
  19437. snmp_inc_udpnoports();
  19438. pbuf_free(p);
  19439. 800de8c: f7fd bb1a b.w 800b4c4 <pbuf_free>
  19440. uncon_pcb = pcb;
  19441. }
  19442. }
  19443. }
  19444. /* compare PCB remote addr+port to UDP source addr+port */
  19445. if ((local_match != 0) &&
  19446. 800de90: 8aa2 ldrh r2, [r4, #20]
  19447. 800de92: 4542 cmp r2, r8
  19448. 800de94: d1b7 bne.n 800de06 <udp_input+0x10e>
  19449. 800de96: e79d b.n 800ddd4 <udp_input+0xdc>
  19450. } else {
  19451. pbuf_free(p);
  19452. }
  19453. end:
  19454. PERF_STOP("udp_input");
  19455. }
  19456. 800de98: b005 add sp, #20
  19457. 800de9a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  19458. 800de9e: bf00 nop
  19459. 800dea0: 20008220 .word 0x20008220
  19460. 800dea4: 2000835c .word 0x2000835c
  19461. 800dea8: 20008358 .word 0x20008358
  19462. 800deac: 20008364 .word 0x20008364
  19463. 0800deb0 <udp_bind>:
  19464. ip_addr_debug_print(UDP_DEBUG, ipaddr);
  19465. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
  19466. rebind = 0;
  19467. /* Check for double bind and rebind of the same pcb */
  19468. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19469. 800deb0: 4b23 ldr r3, [pc, #140] ; (800df40 <udp_bind+0x90>)
  19470. *
  19471. * @see udp_disconnect()
  19472. */
  19473. err_t
  19474. udp_bind(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  19475. {
  19476. 800deb2: b5f0 push {r4, r5, r6, r7, lr}
  19477. ip_addr_debug_print(UDP_DEBUG, ipaddr);
  19478. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
  19479. rebind = 0;
  19480. /* Check for double bind and rebind of the same pcb */
  19481. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19482. 800deb4: 681d ldr r5, [r3, #0]
  19483. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_bind(ipaddr = "));
  19484. ip_addr_debug_print(UDP_DEBUG, ipaddr);
  19485. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
  19486. rebind = 0;
  19487. 800deb6: 2400 movs r4, #0
  19488. /* Check for double bind and rebind of the same pcb */
  19489. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19490. 800deb8: 462b mov r3, r5
  19491. 800deba: e012 b.n 800dee2 <udp_bind+0x32>
  19492. /* is this UDP PCB already on active list? */
  19493. if (pcb == ipcb) {
  19494. 800debc: 4298 cmp r0, r3
  19495. 800debe: d00e beq.n 800dede <udp_bind+0x2e>
  19496. !ip_get_option(ipcb, SOF_REUSEADDR)) {
  19497. #else /* SO_REUSE */
  19498. /* port matches that of PCB in list and REUSEADDR not set -> reject */
  19499. else {
  19500. #endif /* SO_REUSE */
  19501. if ((ipcb->local_port == port) &&
  19502. 800dec0: 8a5e ldrh r6, [r3, #18]
  19503. 800dec2: 4296 cmp r6, r2
  19504. 800dec4: d10c bne.n 800dee0 <udp_bind+0x30>
  19505. /* IP address matches, or one is IP_ADDR_ANY? */
  19506. (ip_addr_isany(&(ipcb->local_ip)) ||
  19507. 800dec6: 681f ldr r7, [r3, #0]
  19508. 800dec8: b90f cbnz r7, 800dece <udp_bind+0x1e>
  19509. ip_addr_isany(ipaddr) ||
  19510. ip_addr_cmp(&(ipcb->local_ip), ipaddr))) {
  19511. /* other PCB already binds to this local IP and port */
  19512. LWIP_DEBUGF(UDP_DEBUG,
  19513. ("udp_bind: local port %"U16_F" already bound by another pcb\n", port));
  19514. return ERR_USE;
  19515. 800deca: 20f8 movs r0, #248 ; 0xf8
  19516. 800decc: e035 b.n 800df3a <udp_bind+0x8a>
  19517. /* port matches that of PCB in list and REUSEADDR not set -> reject */
  19518. else {
  19519. #endif /* SO_REUSE */
  19520. if ((ipcb->local_port == port) &&
  19521. /* IP address matches, or one is IP_ADDR_ANY? */
  19522. (ip_addr_isany(&(ipcb->local_ip)) ||
  19523. 800dece: 2900 cmp r1, #0
  19524. 800ded0: d0fb beq.n 800deca <udp_bind+0x1a>
  19525. ip_addr_isany(ipaddr) ||
  19526. 800ded2: 680e ldr r6, [r1, #0]
  19527. 800ded4: 2e00 cmp r6, #0
  19528. 800ded6: d0f8 beq.n 800deca <udp_bind+0x1a>
  19529. 800ded8: 42b7 cmp r7, r6
  19530. 800deda: d101 bne.n 800dee0 <udp_bind+0x30>
  19531. 800dedc: e7f5 b.n 800deca <udp_bind+0x1a>
  19532. /* is this UDP PCB already on active list? */
  19533. if (pcb == ipcb) {
  19534. /* pcb may occur at most once in active list */
  19535. LWIP_ASSERT("rebind == 0", rebind == 0);
  19536. /* pcb already in list, just rebind */
  19537. rebind = 1;
  19538. 800dede: 2401 movs r4, #1
  19539. ip_addr_debug_print(UDP_DEBUG, ipaddr);
  19540. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
  19541. rebind = 0;
  19542. /* Check for double bind and rebind of the same pcb */
  19543. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19544. 800dee0: 68db ldr r3, [r3, #12]
  19545. 800dee2: 2b00 cmp r3, #0
  19546. 800dee4: d1ea bne.n 800debc <udp_bind+0xc>
  19547. return ERR_USE;
  19548. }
  19549. }
  19550. }
  19551. ip_addr_set(&pcb->local_ip, ipaddr);
  19552. 800dee6: b101 cbz r1, 800deea <udp_bind+0x3a>
  19553. 800dee8: 6809 ldr r1, [r1, #0]
  19554. 800deea: 6001 str r1, [r0, #0]
  19555. /* no port specified? */
  19556. if (port == 0) {
  19557. 800deec: b9fa cbnz r2, 800df2e <udp_bind+0x7e>
  19558. 800deee: 4b15 ldr r3, [pc, #84] ; (800df44 <udp_bind+0x94>)
  19559. 800def0: 881a ldrh r2, [r3, #0]
  19560. 800def2: f44f 4180 mov.w r1, #16384 ; 0x4000
  19561. {
  19562. u16_t n = 0;
  19563. struct udp_pcb *pcb;
  19564. again:
  19565. if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) {
  19566. 800def6: f64f 76ff movw r6, #65535 ; 0xffff
  19567. 800defa: 42b2 cmp r2, r6
  19568. 800defc: d002 beq.n 800df04 <udp_bind+0x54>
  19569. 800defe: 3201 adds r2, #1
  19570. 800df00: b292 uxth r2, r2
  19571. 800df02: e001 b.n 800df08 <udp_bind+0x58>
  19572. udp_port = UDP_LOCAL_PORT_RANGE_START;
  19573. 800df04: f44f 4240 mov.w r2, #49152 ; 0xc000
  19574. }
  19575. /* Check all PCBs. */
  19576. for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19577. 800df08: 462b mov r3, r5
  19578. 800df0a: e00a b.n 800df22 <udp_bind+0x72>
  19579. if (pcb->local_port == udp_port) {
  19580. 800df0c: 8a5f ldrh r7, [r3, #18]
  19581. 800df0e: 4297 cmp r7, r2
  19582. 800df10: d106 bne.n 800df20 <udp_bind+0x70>
  19583. 800df12: 3901 subs r1, #1
  19584. 800df14: b289 uxth r1, r1
  19585. if (++n > (UDP_LOCAL_PORT_RANGE_END - UDP_LOCAL_PORT_RANGE_START)) {
  19586. 800df16: 2900 cmp r1, #0
  19587. 800df18: d1ef bne.n 800defa <udp_bind+0x4a>
  19588. 800df1a: 4b0a ldr r3, [pc, #40] ; (800df44 <udp_bind+0x94>)
  19589. 800df1c: 801a strh r2, [r3, #0]
  19590. 800df1e: e7d4 b.n 800deca <udp_bind+0x1a>
  19591. again:
  19592. if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) {
  19593. udp_port = UDP_LOCAL_PORT_RANGE_START;
  19594. }
  19595. /* Check all PCBs. */
  19596. for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
  19597. 800df20: 68db ldr r3, [r3, #12]
  19598. 800df22: 2b00 cmp r3, #0
  19599. 800df24: d1f2 bne.n 800df0c <udp_bind+0x5c>
  19600. 800df26: 4b07 ldr r3, [pc, #28] ; (800df44 <udp_bind+0x94>)
  19601. 800df28: 801a strh r2, [r3, #0]
  19602. ip_addr_set(&pcb->local_ip, ipaddr);
  19603. /* no port specified? */
  19604. if (port == 0) {
  19605. port = udp_new_port();
  19606. if (port == 0) {
  19607. 800df2a: 2a00 cmp r2, #0
  19608. 800df2c: d0cd beq.n 800deca <udp_bind+0x1a>
  19609. /* no more ports available in local range */
  19610. LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));
  19611. return ERR_USE;
  19612. }
  19613. }
  19614. pcb->local_port = port;
  19615. 800df2e: 8242 strh r2, [r0, #18]
  19616. snmp_insert_udpidx_tree(pcb);
  19617. /* pcb not active yet? */
  19618. if (rebind == 0) {
  19619. 800df30: b914 cbnz r4, 800df38 <udp_bind+0x88>
  19620. /* place the PCB on the active list if not already there */
  19621. pcb->next = udp_pcbs;
  19622. udp_pcbs = pcb;
  19623. 800df32: 4b03 ldr r3, [pc, #12] ; (800df40 <udp_bind+0x90>)
  19624. pcb->local_port = port;
  19625. snmp_insert_udpidx_tree(pcb);
  19626. /* pcb not active yet? */
  19627. if (rebind == 0) {
  19628. /* place the PCB on the active list if not already there */
  19629. pcb->next = udp_pcbs;
  19630. 800df34: 60c5 str r5, [r0, #12]
  19631. udp_pcbs = pcb;
  19632. 800df36: 6018 str r0, [r3, #0]
  19633. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
  19634. ("udp_bind: bound to %"U16_F".%"U16_F".%"U16_F".%"U16_F", port %"U16_F"\n",
  19635. ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
  19636. ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
  19637. pcb->local_port));
  19638. return ERR_OK;
  19639. 800df38: 2000 movs r0, #0
  19640. }
  19641. 800df3a: b240 sxtb r0, r0
  19642. 800df3c: bdf0 pop {r4, r5, r6, r7, pc}
  19643. 800df3e: bf00 nop
  19644. 800df40: 20008358 .word 0x20008358
  19645. 800df44: 20000112 .word 0x20000112
  19646. 0800df48 <udp_sendto_if>:
  19647. * @see udp_disconnect() udp_send()
  19648. */
  19649. err_t
  19650. udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
  19651. ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif)
  19652. {
  19653. 800df48: e92d 47ff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, lr}
  19654. 800df4c: 4692 mov sl, r2
  19655. return ERR_VAL;
  19656. }
  19657. #endif /* IP_SOF_BROADCAST */
  19658. /* if the PCB is not yet bound to a port, bind it here */
  19659. if (pcb->local_port == 0) {
  19660. 800df4e: 8a42 ldrh r2, [r0, #18]
  19661. * @see udp_disconnect() udp_send()
  19662. */
  19663. err_t
  19664. udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
  19665. ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif)
  19666. {
  19667. 800df50: f8dd 8030 ldr.w r8, [sp, #48] ; 0x30
  19668. 800df54: 4605 mov r5, r0
  19669. 800df56: 460e mov r6, r1
  19670. 800df58: 4699 mov r9, r3
  19671. return ERR_VAL;
  19672. }
  19673. #endif /* IP_SOF_BROADCAST */
  19674. /* if the PCB is not yet bound to a port, bind it here */
  19675. if (pcb->local_port == 0) {
  19676. 800df5a: b132 cbz r2, 800df6a <udp_sendto_if+0x22>
  19677. return err;
  19678. }
  19679. }
  19680. /* not enough space to add an UDP header to first pbuf in given p chain? */
  19681. if (pbuf_header(p, UDP_HLEN)) {
  19682. 800df5c: 4630 mov r0, r6
  19683. 800df5e: 2108 movs r1, #8
  19684. 800df60: f7fd fa85 bl 800b46e <pbuf_header>
  19685. 800df64: b940 cbnz r0, 800df78 <udp_sendto_if+0x30>
  19686. 800df66: 4634 mov r4, r6
  19687. 800df68: e013 b.n 800df92 <udp_sendto_if+0x4a>
  19688. #endif /* IP_SOF_BROADCAST */
  19689. /* if the PCB is not yet bound to a port, bind it here */
  19690. if (pcb->local_port == 0) {
  19691. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send: not yet bound to a port, binding now\n"));
  19692. err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
  19693. 800df6a: 4601 mov r1, r0
  19694. 800df6c: f7ff ffa0 bl 800deb0 <udp_bind>
  19695. if (err != ERR_OK) {
  19696. 800df70: 4607 mov r7, r0
  19697. 800df72: 2800 cmp r0, #0
  19698. 800df74: d0f2 beq.n 800df5c <udp_sendto_if+0x14>
  19699. 800df76: e048 b.n 800e00a <udp_sendto_if+0xc2>
  19700. }
  19701. /* not enough space to add an UDP header to first pbuf in given p chain? */
  19702. if (pbuf_header(p, UDP_HLEN)) {
  19703. /* allocate header in a separate new pbuf */
  19704. q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
  19705. 800df78: 2001 movs r0, #1
  19706. 800df7a: 2108 movs r1, #8
  19707. 800df7c: 2200 movs r2, #0
  19708. 800df7e: f7fd faf2 bl 800b566 <pbuf_alloc>
  19709. /* new header pbuf could not be allocated? */
  19710. if (q == NULL) {
  19711. 800df82: 4604 mov r4, r0
  19712. 800df84: 2800 cmp r0, #0
  19713. 800df86: d03d beq.n 800e004 <udp_sendto_if+0xbc>
  19714. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n"));
  19715. return ERR_MEM;
  19716. }
  19717. if (p->tot_len != 0) {
  19718. 800df88: 8933 ldrh r3, [r6, #8]
  19719. 800df8a: b113 cbz r3, 800df92 <udp_sendto_if+0x4a>
  19720. /* chain header q in front of given pbuf p (only if p contains data) */
  19721. pbuf_chain(q, p);
  19722. 800df8c: 4631 mov r1, r6
  19723. 800df8e: f7fd fb90 bl 800b6b2 <pbuf_chain>
  19724. }
  19725. LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
  19726. (q->len >= sizeof(struct udp_hdr)));
  19727. /* q now represents the packet to be sent */
  19728. udphdr = (struct udp_hdr *)q->payload;
  19729. udphdr->src = htons(pcb->local_port);
  19730. 800df92: 8a68 ldrh r0, [r5, #18]
  19731. LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));
  19732. }
  19733. LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
  19734. (q->len >= sizeof(struct udp_hdr)));
  19735. /* q now represents the packet to be sent */
  19736. udphdr = (struct udp_hdr *)q->payload;
  19737. 800df94: 6867 ldr r7, [r4, #4]
  19738. udphdr->src = htons(pcb->local_port);
  19739. 800df96: f7fc f928 bl 800a1ea <lwip_htons>
  19740. 800df9a: 8038 strh r0, [r7, #0]
  19741. udphdr->dest = htons(dst_port);
  19742. 800df9c: 4648 mov r0, r9
  19743. 800df9e: f7fc f924 bl 800a1ea <lwip_htons>
  19744. /* in UDP, 0 checksum means 'no checksum' */
  19745. udphdr->chksum = 0x0000;
  19746. 800dfa2: 2300 movs r3, #0
  19747. LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
  19748. (q->len >= sizeof(struct udp_hdr)));
  19749. /* q now represents the packet to be sent */
  19750. udphdr = (struct udp_hdr *)q->payload;
  19751. udphdr->src = htons(pcb->local_port);
  19752. udphdr->dest = htons(dst_port);
  19753. 800dfa4: 8078 strh r0, [r7, #2]
  19754. /* in UDP, 0 checksum means 'no checksum' */
  19755. udphdr->chksum = 0x0000;
  19756. 800dfa6: 71bb strb r3, [r7, #6]
  19757. 800dfa8: 71fb strb r3, [r7, #7]
  19758. }
  19759. #endif /* LWIP_IGMP */
  19760. /* PCB local address is IP_ANY_ADDR? */
  19761. if (ip_addr_isany(&pcb->local_ip)) {
  19762. 800dfaa: 682b ldr r3, [r5, #0]
  19763. 800dfac: b913 cbnz r3, 800dfb4 <udp_sendto_if+0x6c>
  19764. /* use outgoing network interface IP address as source address */
  19765. src_ip = &(netif->ip_addr);
  19766. 800dfae: f108 0904 add.w r9, r8, #4
  19767. 800dfb2: e00a b.n 800dfca <udp_sendto_if+0x82>
  19768. } else {
  19769. /* check if UDP PCB local IP address is correct
  19770. * this could be an old address if netif->ip_addr has changed */
  19771. if (!ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {
  19772. 800dfb4: f8d8 2004 ldr.w r2, [r8, #4]
  19773. 800dfb8: 4293 cmp r3, r2
  19774. 800dfba: d005 beq.n 800dfc8 <udp_sendto_if+0x80>
  19775. /* local_ip doesn't match, drop the packet */
  19776. if (q != p) {
  19777. 800dfbc: 42b4 cmp r4, r6
  19778. 800dfbe: d023 beq.n 800e008 <udp_sendto_if+0xc0>
  19779. /* free the header pbuf */
  19780. pbuf_free(q);
  19781. 800dfc0: 4620 mov r0, r4
  19782. 800dfc2: f7fd fa7f bl 800b4c4 <pbuf_free>
  19783. 800dfc6: e01f b.n 800e008 <udp_sendto_if+0xc0>
  19784. }
  19785. #endif /* LWIP_IGMP */
  19786. /* PCB local address is IP_ANY_ADDR? */
  19787. if (ip_addr_isany(&pcb->local_ip)) {
  19788. 800dfc8: 46a9 mov r9, r5
  19789. NETIF_SET_HWADDRHINT(netif, NULL);
  19790. } else
  19791. #endif /* LWIP_UDPLITE */
  19792. { /* UDP */
  19793. LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));
  19794. udphdr->len = htons(q->tot_len);
  19795. 800dfca: 8920 ldrh r0, [r4, #8]
  19796. 800dfcc: f7fc f90d bl 800a1ea <lwip_htons>
  19797. 800dfd0: 80b8 strh r0, [r7, #4]
  19798. #endif /* CHECKSUM_GEN_UDP */
  19799. LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));
  19800. LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
  19801. /* output to IP */
  19802. NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint);
  19803. err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);
  19804. 800dfd2: 7a6a ldrb r2, [r5, #9]
  19805. 800dfd4: 7aab ldrb r3, [r5, #10]
  19806. 800dfd6: 9200 str r2, [sp, #0]
  19807. 800dfd8: 2211 movs r2, #17
  19808. 800dfda: 9201 str r2, [sp, #4]
  19809. 800dfdc: f8cd 8008 str.w r8, [sp, #8]
  19810. 800dfe0: 4620 mov r0, r4
  19811. 800dfe2: 4649 mov r1, r9
  19812. 800dfe4: 4652 mov r2, sl
  19813. 800dfe6: f000 fb8b bl 800e700 <ip_output_if>
  19814. }
  19815. /* TODO: must this be increased even if error occured? */
  19816. snmp_inc_udpoutdatagrams();
  19817. /* did we chain a separate header pbuf earlier? */
  19818. if (q != p) {
  19819. 800dfea: 42b4 cmp r4, r6
  19820. #endif /* CHECKSUM_GEN_UDP */
  19821. LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));
  19822. LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
  19823. /* output to IP */
  19824. NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint);
  19825. err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);
  19826. 800dfec: 4607 mov r7, r0
  19827. }
  19828. /* TODO: must this be increased even if error occured? */
  19829. snmp_inc_udpoutdatagrams();
  19830. /* did we chain a separate header pbuf earlier? */
  19831. if (q != p) {
  19832. 800dfee: d002 beq.n 800dff6 <udp_sendto_if+0xae>
  19833. /* free the header pbuf */
  19834. pbuf_free(q);
  19835. 800dff0: 4620 mov r0, r4
  19836. 800dff2: f7fd fa67 bl 800b4c4 <pbuf_free>
  19837. q = NULL;
  19838. /* p is still referenced by the caller, and will live on */
  19839. }
  19840. UDP_STATS_INC(udp.xmit);
  19841. 800dff6: 4b07 ldr r3, [pc, #28] ; (800e014 <udp_sendto_if+0xcc>)
  19842. 800dff8: f8b3 2078 ldrh.w r2, [r3, #120] ; 0x78
  19843. 800dffc: 3201 adds r2, #1
  19844. 800dffe: f8a3 2078 strh.w r2, [r3, #120] ; 0x78
  19845. return err;
  19846. 800e002: e002 b.n 800e00a <udp_sendto_if+0xc2>
  19847. /* allocate header in a separate new pbuf */
  19848. q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
  19849. /* new header pbuf could not be allocated? */
  19850. if (q == NULL) {
  19851. LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n"));
  19852. return ERR_MEM;
  19853. 800e004: 27ff movs r7, #255 ; 0xff
  19854. 800e006: e000 b.n 800e00a <udp_sendto_if+0xc2>
  19855. /* free the header pbuf */
  19856. pbuf_free(q);
  19857. q = NULL;
  19858. /* p is still referenced by the caller, and will live on */
  19859. }
  19860. return ERR_VAL;
  19861. 800e008: 27fa movs r7, #250 ; 0xfa
  19862. /* p is still referenced by the caller, and will live on */
  19863. }
  19864. UDP_STATS_INC(udp.xmit);
  19865. return err;
  19866. }
  19867. 800e00a: b278 sxtb r0, r7
  19868. 800e00c: b004 add sp, #16
  19869. 800e00e: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  19870. 800e012: bf00 nop
  19871. 800e014: 20008220 .word 0x20008220
  19872. 0800e018 <udp_connect>:
  19873. *
  19874. * @see udp_disconnect()
  19875. */
  19876. err_t
  19877. udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  19878. {
  19879. 800e018: b570 push {r4, r5, r6, lr}
  19880. 800e01a: 4616 mov r6, r2
  19881. struct udp_pcb *ipcb;
  19882. if (pcb->local_port == 0) {
  19883. 800e01c: 8a42 ldrh r2, [r0, #18]
  19884. *
  19885. * @see udp_disconnect()
  19886. */
  19887. err_t
  19888. udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  19889. {
  19890. 800e01e: 4604 mov r4, r0
  19891. 800e020: 460d mov r5, r1
  19892. struct udp_pcb *ipcb;
  19893. if (pcb->local_port == 0) {
  19894. 800e022: b10a cbz r2, 800e028 <udp_connect+0x10>
  19895. if (err != ERR_OK) {
  19896. return err;
  19897. }
  19898. }
  19899. ip_addr_set(&pcb->remote_ip, ipaddr);
  19900. 800e024: b935 cbnz r5, 800e034 <udp_connect+0x1c>
  19901. 800e026: e006 b.n 800e036 <udp_connect+0x1e>
  19902. udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
  19903. {
  19904. struct udp_pcb *ipcb;
  19905. if (pcb->local_port == 0) {
  19906. err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
  19907. 800e028: 4601 mov r1, r0
  19908. 800e02a: f7ff ff41 bl 800deb0 <udp_bind>
  19909. if (err != ERR_OK) {
  19910. 800e02e: 2800 cmp r0, #0
  19911. 800e030: d0f8 beq.n 800e024 <udp_connect+0xc>
  19912. 800e032: e013 b.n 800e05c <udp_connect+0x44>
  19913. return err;
  19914. }
  19915. }
  19916. ip_addr_set(&pcb->remote_ip, ipaddr);
  19917. 800e034: 682d ldr r5, [r5, #0]
  19918. pcb->remote_port = port;
  19919. pcb->flags |= UDP_FLAGS_CONNECTED;
  19920. 800e036: 7c23 ldrb r3, [r4, #16]
  19921. ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
  19922. ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
  19923. pcb->local_port));
  19924. /* Insert UDP PCB into the list of active UDP PCBs. */
  19925. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19926. 800e038: 4a09 ldr r2, [pc, #36] ; (800e060 <udp_connect+0x48>)
  19927. if (err != ERR_OK) {
  19928. return err;
  19929. }
  19930. }
  19931. ip_addr_set(&pcb->remote_ip, ipaddr);
  19932. 800e03a: 6065 str r5, [r4, #4]
  19933. pcb->remote_port = port;
  19934. pcb->flags |= UDP_FLAGS_CONNECTED;
  19935. 800e03c: f043 0304 orr.w r3, r3, #4
  19936. 800e040: 7423 strb r3, [r4, #16]
  19937. ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
  19938. ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
  19939. pcb->local_port));
  19940. /* Insert UDP PCB into the list of active UDP PCBs. */
  19941. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19942. 800e042: 6813 ldr r3, [r2, #0]
  19943. return err;
  19944. }
  19945. }
  19946. ip_addr_set(&pcb->remote_ip, ipaddr);
  19947. pcb->remote_port = port;
  19948. 800e044: 82a6 strh r6, [r4, #20]
  19949. ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
  19950. ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
  19951. pcb->local_port));
  19952. /* Insert UDP PCB into the list of active UDP PCBs. */
  19953. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19954. 800e046: 4618 mov r0, r3
  19955. 800e048: e002 b.n 800e050 <udp_connect+0x38>
  19956. if (pcb == ipcb) {
  19957. 800e04a: 4284 cmp r4, r0
  19958. 800e04c: d005 beq.n 800e05a <udp_connect+0x42>
  19959. ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
  19960. ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
  19961. pcb->local_port));
  19962. /* Insert UDP PCB into the list of active UDP PCBs. */
  19963. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19964. 800e04e: 68c0 ldr r0, [r0, #12]
  19965. 800e050: 2800 cmp r0, #0
  19966. 800e052: d1fa bne.n 800e04a <udp_connect+0x32>
  19967. /* already on the list, just return */
  19968. return ERR_OK;
  19969. }
  19970. }
  19971. /* PCB not yet on the list, add PCB now */
  19972. pcb->next = udp_pcbs;
  19973. 800e054: 60e3 str r3, [r4, #12]
  19974. udp_pcbs = pcb;
  19975. 800e056: 6014 str r4, [r2, #0]
  19976. return ERR_OK;
  19977. 800e058: e000 b.n 800e05c <udp_connect+0x44>
  19978. /* Insert UDP PCB into the list of active UDP PCBs. */
  19979. for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
  19980. if (pcb == ipcb) {
  19981. /* already on the list, just return */
  19982. return ERR_OK;
  19983. 800e05a: 2000 movs r0, #0
  19984. }
  19985. /* PCB not yet on the list, add PCB now */
  19986. pcb->next = udp_pcbs;
  19987. udp_pcbs = pcb;
  19988. return ERR_OK;
  19989. }
  19990. 800e05c: b240 sxtb r0, r0
  19991. 800e05e: bd70 pop {r4, r5, r6, pc}
  19992. 800e060: 20008358 .word 0x20008358
  19993. 0800e064 <udp_recv>:
  19994. */
  19995. void
  19996. udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg)
  19997. {
  19998. /* remember recv() callback and user data */
  19999. pcb->recv = recv;
  20000. 800e064: 6181 str r1, [r0, #24]
  20001. pcb->recv_arg = recv_arg;
  20002. 800e066: 61c2 str r2, [r0, #28]
  20003. 800e068: 4770 bx lr
  20004. 800e06a: 0000 movs r0, r0
  20005. 0800e06c <udp_remove>:
  20006. {
  20007. struct udp_pcb *pcb2;
  20008. snmp_delete_udpidx_tree(pcb);
  20009. /* pcb to be removed is first in list? */
  20010. if (udp_pcbs == pcb) {
  20011. 800e06c: 4a09 ldr r2, [pc, #36] ; (800e094 <udp_remove+0x28>)
  20012. 800e06e: 6813 ldr r3, [r2, #0]
  20013. 800e070: 4283 cmp r3, r0
  20014. *
  20015. * @see udp_new()
  20016. */
  20017. void
  20018. udp_remove(struct udp_pcb *pcb)
  20019. {
  20020. 800e072: 4601 mov r1, r0
  20021. struct udp_pcb *pcb2;
  20022. snmp_delete_udpidx_tree(pcb);
  20023. /* pcb to be removed is first in list? */
  20024. if (udp_pcbs == pcb) {
  20025. 800e074: d109 bne.n 800e08a <udp_remove+0x1e>
  20026. /* make list start at 2nd pcb */
  20027. udp_pcbs = udp_pcbs->next;
  20028. 800e076: 68c3 ldr r3, [r0, #12]
  20029. 800e078: 6013 str r3, [r2, #0]
  20030. 800e07a: e008 b.n 800e08e <udp_remove+0x22>
  20031. /* pcb not 1st in list */
  20032. } else {
  20033. for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
  20034. /* find pcb in udp_pcbs list */
  20035. if (pcb2->next != NULL && pcb2->next == pcb) {
  20036. 800e07c: 68da ldr r2, [r3, #12]
  20037. 800e07e: b11a cbz r2, 800e088 <udp_remove+0x1c>
  20038. 800e080: 428a cmp r2, r1
  20039. /* remove pcb from list */
  20040. pcb2->next = pcb->next;
  20041. 800e082: bf04 itt eq
  20042. 800e084: 68ca ldreq r2, [r1, #12]
  20043. 800e086: 60da streq r2, [r3, #12]
  20044. if (udp_pcbs == pcb) {
  20045. /* make list start at 2nd pcb */
  20046. udp_pcbs = udp_pcbs->next;
  20047. /* pcb not 1st in list */
  20048. } else {
  20049. for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
  20050. 800e088: 68db ldr r3, [r3, #12]
  20051. 800e08a: 2b00 cmp r3, #0
  20052. 800e08c: d1f6 bne.n 800e07c <udp_remove+0x10>
  20053. /* remove pcb from list */
  20054. pcb2->next = pcb->next;
  20055. }
  20056. }
  20057. }
  20058. memp_free(MEMP_UDP_PCB, pcb);
  20059. 800e08e: 2001 movs r0, #1
  20060. 800e090: f7fd b920 b.w 800b2d4 <memp_free>
  20061. 800e094: 20008358 .word 0x20008358
  20062. 0800e098 <udp_new>:
  20063. *
  20064. * @see udp_remove()
  20065. */
  20066. struct udp_pcb *
  20067. udp_new(void)
  20068. {
  20069. 800e098: b510 push {r4, lr}
  20070. struct udp_pcb *pcb;
  20071. pcb = (struct udp_pcb *)memp_malloc(MEMP_UDP_PCB);
  20072. 800e09a: 2001 movs r0, #1
  20073. 800e09c: f7fd f8f0 bl 800b280 <memp_malloc>
  20074. /* could allocate UDP PCB? */
  20075. if (pcb != NULL) {
  20076. 800e0a0: 4604 mov r4, r0
  20077. 800e0a2: b128 cbz r0, 800e0b0 <udp_new+0x18>
  20078. /* UDP Lite: by initializing to all zeroes, chksum_len is set to 0
  20079. * which means checksum is generated over the whole datagram per default
  20080. * (recommended as default by RFC 3828). */
  20081. /* initialize PCB to all zeroes */
  20082. memset(pcb, 0, sizeof(struct udp_pcb));
  20083. 800e0a4: 2100 movs r1, #0
  20084. 800e0a6: 2220 movs r2, #32
  20085. 800e0a8: f7fb fa66 bl 8009578 <memset>
  20086. pcb->ttl = UDP_TTL;
  20087. 800e0ac: 23ff movs r3, #255 ; 0xff
  20088. 800e0ae: 72a3 strb r3, [r4, #10]
  20089. }
  20090. return pcb;
  20091. }
  20092. 800e0b0: 4620 mov r0, r4
  20093. 800e0b2: bd10 pop {r4, pc}
  20094. 0800e0b4 <icmp_send_response>:
  20095. * @param type Type of the ICMP header
  20096. * @param code Code of the ICMP header
  20097. */
  20098. static void
  20099. icmp_send_response(struct pbuf *p, u8_t type, u8_t code)
  20100. {
  20101. 800e0b4: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
  20102. 800e0b8: 4607 mov r7, r0
  20103. 800e0ba: b085 sub sp, #20
  20104. 800e0bc: 4689 mov r9, r1
  20105. 800e0be: 4615 mov r5, r2
  20106. /* we can use the echo header here */
  20107. struct icmp_echo_hdr *icmphdr;
  20108. ip_addr_t iphdr_src;
  20109. /* ICMP header + IP header + 8 bytes of data */
  20110. q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE,
  20111. 800e0c0: 2001 movs r0, #1
  20112. 800e0c2: 2124 movs r1, #36 ; 0x24
  20113. 800e0c4: 2200 movs r2, #0
  20114. 800e0c6: f7fd fa4e bl 800b566 <pbuf_alloc>
  20115. PBUF_RAM);
  20116. if (q == NULL) {
  20117. 800e0ca: 4606 mov r6, r0
  20118. 800e0cc: b368 cbz r0, 800e12a <icmp_send_response+0x76>
  20119. ip_addr_debug_print(ICMP_DEBUG, &(iphdr->src));
  20120. LWIP_DEBUGF(ICMP_DEBUG, (" to "));
  20121. ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
  20122. LWIP_DEBUGF(ICMP_DEBUG, ("\n"));
  20123. icmphdr = (struct icmp_echo_hdr *)q->payload;
  20124. 800e0ce: 6844 ldr r4, [r0, #4]
  20125. return;
  20126. }
  20127. LWIP_ASSERT("check that first pbuf can hold icmp message",
  20128. (q->len >= (sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE)));
  20129. iphdr = (struct ip_hdr *)p->payload;
  20130. 800e0d0: f8d7 8004 ldr.w r8, [r7, #4]
  20131. ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
  20132. LWIP_DEBUGF(ICMP_DEBUG, ("\n"));
  20133. icmphdr = (struct icmp_echo_hdr *)q->payload;
  20134. icmphdr->type = type;
  20135. icmphdr->code = code;
  20136. 800e0d4: 7065 strb r5, [r4, #1]
  20137. icmphdr->id = 0;
  20138. 800e0d6: 2500 movs r5, #0
  20139. LWIP_DEBUGF(ICMP_DEBUG, (" to "));
  20140. ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
  20141. LWIP_DEBUGF(ICMP_DEBUG, ("\n"));
  20142. icmphdr = (struct icmp_echo_hdr *)q->payload;
  20143. icmphdr->type = type;
  20144. 800e0d8: f884 9000 strb.w r9, [r4]
  20145. icmphdr->code = code;
  20146. icmphdr->id = 0;
  20147. 800e0dc: 7125 strb r5, [r4, #4]
  20148. 800e0de: 7165 strb r5, [r4, #5]
  20149. icmphdr->seqno = 0;
  20150. 800e0e0: 71a5 strb r5, [r4, #6]
  20151. 800e0e2: 71e5 strb r5, [r4, #7]
  20152. /* copy fields from original packet */
  20153. SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_echo_hdr), (u8_t *)p->payload,
  20154. 800e0e4: 6840 ldr r0, [r0, #4]
  20155. 800e0e6: 6879 ldr r1, [r7, #4]
  20156. 800e0e8: 221c movs r2, #28
  20157. 800e0ea: 3008 adds r0, #8
  20158. 800e0ec: f7fb f98a bl 8009404 <memcpy>
  20159. IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);
  20160. /* calculate checksum */
  20161. icmphdr->chksum = 0;
  20162. 800e0f0: 70a5 strb r5, [r4, #2]
  20163. 800e0f2: 70e5 strb r5, [r4, #3]
  20164. icmphdr->chksum = inet_chksum(icmphdr, q->len);
  20165. 800e0f4: 8971 ldrh r1, [r6, #10]
  20166. 800e0f6: 4620 mov r0, r4
  20167. 800e0f8: f000 f919 bl 800e32e <inet_chksum>
  20168. ICMP_STATS_INC(icmp.xmit);
  20169. 800e0fc: 4b0c ldr r3, [pc, #48] ; (800e130 <icmp_send_response+0x7c>)
  20170. SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_echo_hdr), (u8_t *)p->payload,
  20171. IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);
  20172. /* calculate checksum */
  20173. icmphdr->chksum = 0;
  20174. icmphdr->chksum = inet_chksum(icmphdr, q->len);
  20175. 800e0fe: 8060 strh r0, [r4, #2]
  20176. ICMP_STATS_INC(icmp.xmit);
  20177. 800e100: f8b3 2060 ldrh.w r2, [r3, #96] ; 0x60
  20178. 800e104: 3201 adds r2, #1
  20179. 800e106: f8a3 2060 strh.w r2, [r3, #96] ; 0x60
  20180. /* increase number of messages attempted to send */
  20181. snmp_inc_icmpoutmsgs();
  20182. /* increase number of destination unreachable messages attempted to send */
  20183. snmp_inc_icmpouttimeexcds();
  20184. ip_addr_copy(iphdr_src, iphdr->src);
  20185. 800e10a: f8d8 300c ldr.w r3, [r8, #12]
  20186. 800e10e: aa04 add r2, sp, #16
  20187. ip_output(q, NULL, &iphdr_src, ICMP_TTL, 0, IP_PROTO_ICMP);
  20188. 800e110: 4630 mov r0, r6
  20189. ICMP_STATS_INC(icmp.xmit);
  20190. /* increase number of messages attempted to send */
  20191. snmp_inc_icmpoutmsgs();
  20192. /* increase number of destination unreachable messages attempted to send */
  20193. snmp_inc_icmpouttimeexcds();
  20194. ip_addr_copy(iphdr_src, iphdr->src);
  20195. 800e112: f842 3d04 str.w r3, [r2, #-4]!
  20196. ip_output(q, NULL, &iphdr_src, ICMP_TTL, 0, IP_PROTO_ICMP);
  20197. 800e116: 2301 movs r3, #1
  20198. 800e118: 9301 str r3, [sp, #4]
  20199. 800e11a: 9500 str r5, [sp, #0]
  20200. 800e11c: 4629 mov r1, r5
  20201. 800e11e: 23ff movs r3, #255 ; 0xff
  20202. 800e120: f000 fb54 bl 800e7cc <ip_output>
  20203. pbuf_free(q);
  20204. 800e124: 4630 mov r0, r6
  20205. 800e126: f7fd f9cd bl 800b4c4 <pbuf_free>
  20206. }
  20207. 800e12a: b005 add sp, #20
  20208. 800e12c: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
  20209. 800e130: 20008220 .word 0x20008220
  20210. 0800e134 <icmp_input>:
  20211. * @param p the icmp echo request packet, p->payload pointing to the ip header
  20212. * @param inp the netif on which this packet was received
  20213. */
  20214. void
  20215. icmp_input(struct pbuf *p, struct netif *inp)
  20216. {
  20217. 800e134: e92d 47ff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, lr}
  20218. #endif /* LWIP_DEBUG */
  20219. struct icmp_echo_hdr *iecho;
  20220. struct ip_hdr *iphdr;
  20221. s16_t hlen;
  20222. ICMP_STATS_INC(icmp.recv);
  20223. 800e138: 4d60 ldr r5, [pc, #384] ; (800e2bc <icmp_input+0x188>)
  20224. snmp_inc_icmpinmsgs();
  20225. iphdr = (struct ip_hdr *)p->payload;
  20226. 800e13a: 6846 ldr r6, [r0, #4]
  20227. #endif /* LWIP_DEBUG */
  20228. struct icmp_echo_hdr *iecho;
  20229. struct ip_hdr *iphdr;
  20230. s16_t hlen;
  20231. ICMP_STATS_INC(icmp.recv);
  20232. 800e13c: f8b5 3062 ldrh.w r3, [r5, #98] ; 0x62
  20233. 800e140: 3301 adds r3, #1
  20234. 800e142: f8a5 3062 strh.w r3, [r5, #98] ; 0x62
  20235. snmp_inc_icmpinmsgs();
  20236. iphdr = (struct ip_hdr *)p->payload;
  20237. hlen = IPH_HL(iphdr) * 4;
  20238. 800e146: f896 8000 ldrb.w r8, [r6]
  20239. 800e14a: f008 080f and.w r8, r8, #15
  20240. 800e14e: ea4f 0888 mov.w r8, r8, lsl #2
  20241. if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
  20242. 800e152: f1c8 0900 rsb r9, r8, #0
  20243. * @param p the icmp echo request packet, p->payload pointing to the ip header
  20244. * @param inp the netif on which this packet was received
  20245. */
  20246. void
  20247. icmp_input(struct pbuf *p, struct netif *inp)
  20248. {
  20249. 800e156: 460f mov r7, r1
  20250. snmp_inc_icmpinmsgs();
  20251. iphdr = (struct ip_hdr *)p->payload;
  20252. hlen = IPH_HL(iphdr) * 4;
  20253. if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
  20254. 800e158: fa0f f189 sxth.w r1, r9
  20255. * @param p the icmp echo request packet, p->payload pointing to the ip header
  20256. * @param inp the netif on which this packet was received
  20257. */
  20258. void
  20259. icmp_input(struct pbuf *p, struct netif *inp)
  20260. {
  20261. 800e15c: 4604 mov r4, r0
  20262. snmp_inc_icmpinmsgs();
  20263. iphdr = (struct ip_hdr *)p->payload;
  20264. hlen = IPH_HL(iphdr) * 4;
  20265. if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
  20266. 800e15e: f7fd f986 bl 800b46e <pbuf_header>
  20267. 800e162: 2800 cmp r0, #0
  20268. 800e164: f040 8093 bne.w 800e28e <icmp_input+0x15a>
  20269. 800e168: 8923 ldrh r3, [r4, #8]
  20270. 800e16a: 2b03 cmp r3, #3
  20271. 800e16c: f240 808f bls.w 800e28e <icmp_input+0x15a>
  20272. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: short ICMP (%"U16_F" bytes) received\n", p->tot_len));
  20273. goto lenerr;
  20274. }
  20275. type = *((u8_t *)p->payload);
  20276. 800e170: 6863 ldr r3, [r4, #4]
  20277. #ifdef LWIP_DEBUG
  20278. code = *(((u8_t *)p->payload)+1);
  20279. #endif /* LWIP_DEBUG */
  20280. switch (type) {
  20281. 800e172: 781b ldrb r3, [r3, #0]
  20282. 800e174: 2b00 cmp r3, #0
  20283. 800e176: f000 8084 beq.w 800e282 <icmp_input+0x14e>
  20284. 800e17a: 2b08 cmp r3, #8
  20285. 800e17c: d177 bne.n 800e26e <icmp_input+0x13a>
  20286. #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING
  20287. {
  20288. int accepted = 1;
  20289. #if !LWIP_MULTICAST_PING
  20290. /* multicast destination address? */
  20291. if (ip_addr_ismulticast(&current_iphdr_dest)) {
  20292. 800e17e: 4b50 ldr r3, [pc, #320] ; (800e2c0 <icmp_input+0x18c>)
  20293. 800e180: f8d3 a000 ldr.w sl, [r3]
  20294. accepted = 0;
  20295. }
  20296. #endif /* LWIP_MULTICAST_PING */
  20297. #if !LWIP_BROADCAST_PING
  20298. /* broadcast destination address? */
  20299. if (ip_addr_isbroadcast(&current_iphdr_dest, inp)) {
  20300. 800e184: 4639 mov r1, r7
  20301. 800e186: 4650 mov r0, sl
  20302. 800e188: f000 f8fb bl 800e382 <ip4_addr_isbroadcast>
  20303. 800e18c: b920 cbnz r0, 800e198 <icmp_input+0x64>
  20304. #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING
  20305. {
  20306. int accepted = 1;
  20307. #if !LWIP_MULTICAST_PING
  20308. /* multicast destination address? */
  20309. if (ip_addr_ismulticast(&current_iphdr_dest)) {
  20310. 800e18e: f00a 0af0 and.w sl, sl, #240 ; 0xf0
  20311. if (ip_addr_isbroadcast(&current_iphdr_dest, inp)) {
  20312. accepted = 0;
  20313. }
  20314. #endif /* LWIP_BROADCAST_PING */
  20315. /* broadcast or multicast destination address not acceptd? */
  20316. if (!accepted) {
  20317. 800e192: f1ba 0fe0 cmp.w sl, #224 ; 0xe0
  20318. 800e196: d106 bne.n 800e1a6 <icmp_input+0x72>
  20319. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast or broadcast pings\n"));
  20320. ICMP_STATS_INC(icmp.err);
  20321. 800e198: 4b48 ldr r3, [pc, #288] ; (800e2bc <icmp_input+0x188>)
  20322. 800e19a: f8b3 2074 ldrh.w r2, [r3, #116] ; 0x74
  20323. 800e19e: 3201 adds r2, #1
  20324. 800e1a0: f8a3 2074 strh.w r2, [r3, #116] ; 0x74
  20325. 800e1a4: e06d b.n 800e282 <icmp_input+0x14e>
  20326. return;
  20327. }
  20328. }
  20329. #endif /* !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING */
  20330. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n"));
  20331. if (p->tot_len < sizeof(struct icmp_echo_hdr)) {
  20332. 800e1a6: 8923 ldrh r3, [r4, #8]
  20333. 800e1a8: 2b07 cmp r3, #7
  20334. 800e1aa: d970 bls.n 800e28e <icmp_input+0x15a>
  20335. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
  20336. goto lenerr;
  20337. }
  20338. if (inet_chksum_pbuf(p) != 0) {
  20339. 800e1ac: 4620 mov r0, r4
  20340. 800e1ae: f000 f8c4 bl 800e33a <inet_chksum_pbuf>
  20341. 800e1b2: b140 cbz r0, 800e1c6 <icmp_input+0x92>
  20342. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n"));
  20343. pbuf_free(p);
  20344. 800e1b4: 4620 mov r0, r4
  20345. 800e1b6: f7fd f985 bl 800b4c4 <pbuf_free>
  20346. ICMP_STATS_INC(icmp.chkerr);
  20347. 800e1ba: f8b5 3068 ldrh.w r3, [r5, #104] ; 0x68
  20348. 800e1be: 3301 adds r3, #1
  20349. 800e1c0: f8a5 3068 strh.w r3, [r5, #104] ; 0x68
  20350. snmp_inc_icmpinerrors();
  20351. return;
  20352. 800e1c4: e076 b.n 800e2b4 <icmp_input+0x180>
  20353. }
  20354. #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
  20355. if (pbuf_header(p, (PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
  20356. 800e1c6: 4620 mov r0, r4
  20357. 800e1c8: 2122 movs r1, #34 ; 0x22
  20358. ICMP_STATS_INC(icmp.recv);
  20359. snmp_inc_icmpinmsgs();
  20360. iphdr = (struct ip_hdr *)p->payload;
  20361. hlen = IPH_HL(iphdr) * 4;
  20362. 800e1ca: fa1f f888 uxth.w r8, r8
  20363. ICMP_STATS_INC(icmp.chkerr);
  20364. snmp_inc_icmpinerrors();
  20365. return;
  20366. }
  20367. #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
  20368. if (pbuf_header(p, (PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
  20369. 800e1ce: f7fd f94e bl 800b46e <pbuf_header>
  20370. 800e1d2: b1f8 cbz r0, 800e214 <icmp_input+0xe0>
  20371. /* p is not big enough to contain link headers
  20372. * allocate a new one and copy p into it
  20373. */
  20374. struct pbuf *r;
  20375. /* switch p->payload to ip header */
  20376. if (pbuf_header(p, hlen)) {
  20377. 800e1d4: 4620 mov r0, r4
  20378. 800e1d6: 4641 mov r1, r8
  20379. 800e1d8: f7fd f949 bl 800b46e <pbuf_header>
  20380. 800e1dc: 2800 cmp r0, #0
  20381. 800e1de: d160 bne.n 800e2a2 <icmp_input+0x16e>
  20382. LWIP_ASSERT("icmp_input: moving p->payload to ip header failed\n", 0);
  20383. goto memerr;
  20384. }
  20385. /* allocate new packet buffer with space for link headers */
  20386. r = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM);
  20387. 800e1e0: 2002 movs r0, #2
  20388. 800e1e2: 8921 ldrh r1, [r4, #8]
  20389. 800e1e4: 2200 movs r2, #0
  20390. 800e1e6: f7fd f9be bl 800b566 <pbuf_alloc>
  20391. if (r == NULL) {
  20392. 800e1ea: 4605 mov r5, r0
  20393. 800e1ec: 2800 cmp r0, #0
  20394. 800e1ee: d058 beq.n 800e2a2 <icmp_input+0x16e>
  20395. goto memerr;
  20396. }
  20397. LWIP_ASSERT("check that first pbuf can hold struct the ICMP header",
  20398. (r->len >= hlen + sizeof(struct icmp_echo_hdr)));
  20399. /* copy the whole packet including ip header */
  20400. if (pbuf_copy(r, p) != ERR_OK) {
  20401. 800e1f0: 4621 mov r1, r4
  20402. 800e1f2: f7fd fa67 bl 800b6c4 <pbuf_copy>
  20403. 800e1f6: 2800 cmp r0, #0
  20404. 800e1f8: d153 bne.n 800e2a2 <icmp_input+0x16e>
  20405. LWIP_ASSERT("icmp_input: copying to new pbuf failed\n", 0);
  20406. goto memerr;
  20407. }
  20408. iphdr = (struct ip_hdr *)r->payload;
  20409. /* switch r->payload back to icmp header */
  20410. if (pbuf_header(r, -hlen)) {
  20411. 800e1fa: 4628 mov r0, r5
  20412. 800e1fc: fa0f f189 sxth.w r1, r9
  20413. /* copy the whole packet including ip header */
  20414. if (pbuf_copy(r, p) != ERR_OK) {
  20415. LWIP_ASSERT("icmp_input: copying to new pbuf failed\n", 0);
  20416. goto memerr;
  20417. }
  20418. iphdr = (struct ip_hdr *)r->payload;
  20419. 800e200: 686e ldr r6, [r5, #4]
  20420. /* switch r->payload back to icmp header */
  20421. if (pbuf_header(r, -hlen)) {
  20422. 800e202: f7fd f934 bl 800b46e <pbuf_header>
  20423. 800e206: 2800 cmp r0, #0
  20424. 800e208: d14b bne.n 800e2a2 <icmp_input+0x16e>
  20425. LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0);
  20426. goto memerr;
  20427. }
  20428. /* free the original p */
  20429. pbuf_free(p);
  20430. 800e20a: 4620 mov r0, r4
  20431. 800e20c: f7fd f95a bl 800b4c4 <pbuf_free>
  20432. 800e210: 462c mov r4, r5
  20433. 800e212: e006 b.n 800e222 <icmp_input+0xee>
  20434. /* we now have an identical copy of p that has room for link headers */
  20435. p = r;
  20436. } else {
  20437. /* restore p->payload to point to icmp header */
  20438. if (pbuf_header(p, -(s16_t)(PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
  20439. 800e214: 4620 mov r0, r4
  20440. 800e216: f06f 0121 mvn.w r1, #33 ; 0x21
  20441. 800e21a: f7fd f928 bl 800b46e <pbuf_header>
  20442. 800e21e: 2800 cmp r0, #0
  20443. 800e220: d13f bne.n 800e2a2 <icmp_input+0x16e>
  20444. #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
  20445. /* At this point, all checks are OK. */
  20446. /* We generate an answer by switching the dest and src ip addresses,
  20447. * setting the icmp type to ECHO_RESPONSE and updating the checksum. */
  20448. iecho = (struct icmp_echo_hdr *)p->payload;
  20449. ip_addr_copy(iphdr->src, *ip_current_dest_addr());
  20450. 800e222: f8df 909c ldr.w r9, [pc, #156] ; 800e2c0 <icmp_input+0x18c>
  20451. }
  20452. #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
  20453. /* At this point, all checks are OK. */
  20454. /* We generate an answer by switching the dest and src ip addresses,
  20455. * setting the icmp type to ECHO_RESPONSE and updating the checksum. */
  20456. iecho = (struct icmp_echo_hdr *)p->payload;
  20457. 800e226: 6863 ldr r3, [r4, #4]
  20458. ip_addr_copy(iphdr->src, *ip_current_dest_addr());
  20459. 800e228: f8d9 2000 ldr.w r2, [r9]
  20460. 800e22c: 60f2 str r2, [r6, #12]
  20461. ip_addr_copy(iphdr->dest, *ip_current_src_addr());
  20462. 800e22e: 4a25 ldr r2, [pc, #148] ; (800e2c4 <icmp_input+0x190>)
  20463. 800e230: 6812 ldr r2, [r2, #0]
  20464. 800e232: 6132 str r2, [r6, #16]
  20465. ICMPH_TYPE_SET(iecho, ICMP_ER);
  20466. 800e234: 2200 movs r2, #0
  20467. 800e236: 701a strb r2, [r3, #0]
  20468. //-----------------------------------------------------------
  20469. // Добавил фикс 15.08.15.
  20470. // Фикс исправляет баг с пингом.
  20471. #ifdef CHECKSUM_BY_HARDWARE
  20472. iecho->chksum = 0;
  20473. 800e238: 709a strb r2, [r3, #2]
  20474. 800e23a: 70da strb r2, [r3, #3]
  20475. #else // CHECKSUM_GEN_ICMP
  20476. iecho->chksum = 0;
  20477. #endif // CHECKSUM_GEN_ICMP
  20478. */
  20479. /* Set the correct TTL and recalculate the header checksum. */
  20480. IPH_TTL_SET(iphdr, ICMP_TTL);
  20481. 800e23c: 25ff movs r5, #255 ; 0xff
  20482. IPH_CHKSUM_SET(iphdr, 0);
  20483. #if CHECKSUM_GEN_IP
  20484. IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  20485. #endif /* CHECKSUM_GEN_IP */
  20486. ICMP_STATS_INC(icmp.xmit);
  20487. 800e23e: 4b1f ldr r3, [pc, #124] ; (800e2bc <icmp_input+0x188>)
  20488. #else // CHECKSUM_GEN_ICMP
  20489. iecho->chksum = 0;
  20490. #endif // CHECKSUM_GEN_ICMP
  20491. */
  20492. /* Set the correct TTL and recalculate the header checksum. */
  20493. IPH_TTL_SET(iphdr, ICMP_TTL);
  20494. 800e240: 7235 strb r5, [r6, #8]
  20495. IPH_CHKSUM_SET(iphdr, 0);
  20496. 800e242: 72b2 strb r2, [r6, #10]
  20497. 800e244: 72f2 strb r2, [r6, #11]
  20498. #if CHECKSUM_GEN_IP
  20499. IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  20500. #endif /* CHECKSUM_GEN_IP */
  20501. ICMP_STATS_INC(icmp.xmit);
  20502. 800e246: f8b3 2060 ldrh.w r2, [r3, #96] ; 0x60
  20503. /* increase number of messages attempted to send */
  20504. snmp_inc_icmpoutmsgs();
  20505. /* increase number of echo replies attempted to send */
  20506. snmp_inc_icmpoutechoreps();
  20507. if(pbuf_header(p, hlen)) {
  20508. 800e24a: 4620 mov r0, r4
  20509. IPH_CHKSUM_SET(iphdr, 0);
  20510. #if CHECKSUM_GEN_IP
  20511. IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  20512. #endif /* CHECKSUM_GEN_IP */
  20513. ICMP_STATS_INC(icmp.xmit);
  20514. 800e24c: 3201 adds r2, #1
  20515. /* increase number of messages attempted to send */
  20516. snmp_inc_icmpoutmsgs();
  20517. /* increase number of echo replies attempted to send */
  20518. snmp_inc_icmpoutechoreps();
  20519. if(pbuf_header(p, hlen)) {
  20520. 800e24e: 4641 mov r1, r8
  20521. IPH_CHKSUM_SET(iphdr, 0);
  20522. #if CHECKSUM_GEN_IP
  20523. IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  20524. #endif /* CHECKSUM_GEN_IP */
  20525. ICMP_STATS_INC(icmp.xmit);
  20526. 800e250: f8a3 2060 strh.w r2, [r3, #96] ; 0x60
  20527. /* increase number of messages attempted to send */
  20528. snmp_inc_icmpoutmsgs();
  20529. /* increase number of echo replies attempted to send */
  20530. snmp_inc_icmpoutechoreps();
  20531. if(pbuf_header(p, hlen)) {
  20532. 800e254: f7fd f90b bl 800b46e <pbuf_header>
  20533. 800e258: 4602 mov r2, r0
  20534. 800e25a: b990 cbnz r0, 800e282 <icmp_input+0x14e>
  20535. LWIP_ASSERT("Can't move over header in packet", 0);
  20536. } else {
  20537. err_t ret;
  20538. /* send an ICMP packet, src addr is the dest addr of the curren packet */
  20539. ret = ip_output_if(p, ip_current_dest_addr(), IP_HDRINCL,
  20540. 800e25c: 2301 movs r3, #1
  20541. 800e25e: e88d 0089 stmia.w sp, {r0, r3, r7}
  20542. 800e262: 4620 mov r0, r4
  20543. 800e264: 4649 mov r1, r9
  20544. 800e266: 462b mov r3, r5
  20545. 800e268: f000 fa4a bl 800e700 <ip_output_if>
  20546. 800e26c: e009 b.n 800e282 <icmp_input+0x14e>
  20547. }
  20548. break;
  20549. default:
  20550. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n",
  20551. (s16_t)type, (s16_t)code));
  20552. ICMP_STATS_INC(icmp.proterr);
  20553. 800e26e: f8b5 3070 ldrh.w r3, [r5, #112] ; 0x70
  20554. 800e272: 3301 adds r3, #1
  20555. 800e274: f8a5 3070 strh.w r3, [r5, #112] ; 0x70
  20556. ICMP_STATS_INC(icmp.drop);
  20557. 800e278: f8b5 3066 ldrh.w r3, [r5, #102] ; 0x66
  20558. 800e27c: 3301 adds r3, #1
  20559. 800e27e: f8a5 3066 strh.w r3, [r5, #102] ; 0x66
  20560. }
  20561. pbuf_free(p);
  20562. 800e282: 4620 mov r0, r4
  20563. pbuf_free(p);
  20564. ICMP_STATS_INC(icmp.err);
  20565. snmp_inc_icmpinerrors();
  20566. return;
  20567. #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
  20568. }
  20569. 800e284: b004 add sp, #16
  20570. 800e286: e8bd 47f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
  20571. LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n",
  20572. (s16_t)type, (s16_t)code));
  20573. ICMP_STATS_INC(icmp.proterr);
  20574. ICMP_STATS_INC(icmp.drop);
  20575. }
  20576. pbuf_free(p);
  20577. 800e28a: f7fd b91b b.w 800b4c4 <pbuf_free>
  20578. return;
  20579. lenerr:
  20580. pbuf_free(p);
  20581. 800e28e: 4620 mov r0, r4
  20582. 800e290: f7fd f918 bl 800b4c4 <pbuf_free>
  20583. ICMP_STATS_INC(icmp.lenerr);
  20584. 800e294: 4b09 ldr r3, [pc, #36] ; (800e2bc <icmp_input+0x188>)
  20585. 800e296: f8b3 206a ldrh.w r2, [r3, #106] ; 0x6a
  20586. 800e29a: 3201 adds r2, #1
  20587. 800e29c: f8a3 206a strh.w r2, [r3, #106] ; 0x6a
  20588. snmp_inc_icmpinerrors();
  20589. return;
  20590. 800e2a0: e008 b.n 800e2b4 <icmp_input+0x180>
  20591. #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
  20592. memerr:
  20593. pbuf_free(p);
  20594. 800e2a2: 4620 mov r0, r4
  20595. 800e2a4: f7fd f90e bl 800b4c4 <pbuf_free>
  20596. ICMP_STATS_INC(icmp.err);
  20597. 800e2a8: 4b04 ldr r3, [pc, #16] ; (800e2bc <icmp_input+0x188>)
  20598. 800e2aa: f8b3 2074 ldrh.w r2, [r3, #116] ; 0x74
  20599. 800e2ae: 3201 adds r2, #1
  20600. 800e2b0: f8a3 2074 strh.w r2, [r3, #116] ; 0x74
  20601. snmp_inc_icmpinerrors();
  20602. return;
  20603. #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
  20604. }
  20605. 800e2b4: b004 add sp, #16
  20606. 800e2b6: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  20607. 800e2ba: bf00 nop
  20608. 800e2bc: 20008220 .word 0x20008220
  20609. 800e2c0: 20008364 .word 0x20008364
  20610. 800e2c4: 2000835c .word 0x2000835c
  20611. 0800e2c8 <icmp_dest_unreach>:
  20612. * p->payload pointing to the IP header
  20613. * @param t type of the 'unreachable' packet
  20614. */
  20615. void
  20616. icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)
  20617. {
  20618. 800e2c8: 460a mov r2, r1
  20619. icmp_send_response(p, ICMP_DUR, t);
  20620. 800e2ca: 2103 movs r1, #3
  20621. 800e2cc: f7ff bef2 b.w 800e0b4 <icmp_send_response>
  20622. 0800e2d0 <icmp_time_exceeded>:
  20623. * p->payload pointing to the IP header
  20624. * @param t type of the 'time exceeded' packet
  20625. */
  20626. void
  20627. icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)
  20628. {
  20629. 800e2d0: 460a mov r2, r1
  20630. icmp_send_response(p, ICMP_TE, t);
  20631. 800e2d2: 210b movs r1, #11
  20632. 800e2d4: f7ff beee b.w 800e0b4 <icmp_send_response>
  20633. 0800e2d8 <lwip_standard_chksum>:
  20634. * @return host order (!) lwip checksum (non-inverted Internet sum)
  20635. */
  20636. static u16_t
  20637. lwip_standard_chksum(void *dataptr, int len)
  20638. {
  20639. 800e2d8: b513 push {r0, r1, r4, lr}
  20640. u8_t *pb = (u8_t *)dataptr;
  20641. u16_t *ps, t = 0;
  20642. 800e2da: 2300 movs r3, #0
  20643. u32_t sum = 0;
  20644. int odd = ((mem_ptr_t)pb & 1);
  20645. /* Get aligned to u16_t */
  20646. if (odd && len > 0) {
  20647. 800e2dc: f010 0201 ands.w r2, r0, #1
  20648. static u16_t
  20649. lwip_standard_chksum(void *dataptr, int len)
  20650. {
  20651. u8_t *pb = (u8_t *)dataptr;
  20652. u16_t *ps, t = 0;
  20653. 800e2e0: f8ad 3006 strh.w r3, [sp, #6]
  20654. u32_t sum = 0;
  20655. int odd = ((mem_ptr_t)pb & 1);
  20656. /* Get aligned to u16_t */
  20657. if (odd && len > 0) {
  20658. 800e2e4: d006 beq.n 800e2f4 <lwip_standard_chksum+0x1c>
  20659. 800e2e6: 4299 cmp r1, r3
  20660. 800e2e8: dd04 ble.n 800e2f4 <lwip_standard_chksum+0x1c>
  20661. ((u8_t *)&t)[1] = *pb++;
  20662. 800e2ea: f810 3b01 ldrb.w r3, [r0], #1
  20663. len--;
  20664. 800e2ee: 3901 subs r1, #1
  20665. u32_t sum = 0;
  20666. int odd = ((mem_ptr_t)pb & 1);
  20667. /* Get aligned to u16_t */
  20668. if (odd && len > 0) {
  20669. ((u8_t *)&t)[1] = *pb++;
  20670. 800e2f0: f88d 3007 strb.w r3, [sp, #7]
  20671. static u16_t
  20672. lwip_standard_chksum(void *dataptr, int len)
  20673. {
  20674. u8_t *pb = (u8_t *)dataptr;
  20675. u16_t *ps, t = 0;
  20676. u32_t sum = 0;
  20677. 800e2f4: 2300 movs r3, #0
  20678. len--;
  20679. }
  20680. /* Add the bulk of the data */
  20681. ps = (u16_t *)(void *)pb;
  20682. while (len > 1) {
  20683. 800e2f6: e003 b.n 800e300 <lwip_standard_chksum+0x28>
  20684. sum += *ps++;
  20685. 800e2f8: f830 4b02 ldrh.w r4, [r0], #2
  20686. len -= 2;
  20687. 800e2fc: 3902 subs r1, #2
  20688. }
  20689. /* Add the bulk of the data */
  20690. ps = (u16_t *)(void *)pb;
  20691. while (len > 1) {
  20692. sum += *ps++;
  20693. 800e2fe: 191b adds r3, r3, r4
  20694. len--;
  20695. }
  20696. /* Add the bulk of the data */
  20697. ps = (u16_t *)(void *)pb;
  20698. while (len > 1) {
  20699. 800e300: 2901 cmp r1, #1
  20700. 800e302: dcf9 bgt.n 800e2f8 <lwip_standard_chksum+0x20>
  20701. len -= 2;
  20702. }
  20703. /* Consume left-over byte, if any */
  20704. if (len > 0) {
  20705. ((u8_t *)&t)[0] = *(u8_t *)ps;
  20706. 800e304: bf04 itt eq
  20707. 800e306: 7801 ldrbeq r1, [r0, #0]
  20708. 800e308: f88d 1006 strbeq.w r1, [sp, #6]
  20709. }
  20710. /* Add end bytes */
  20711. sum += t;
  20712. 800e30c: f8bd 0006 ldrh.w r0, [sp, #6]
  20713. 800e310: 181b adds r3, r3, r0
  20714. /* Fold 32-bit sum to 16 bits
  20715. calling this twice is propably faster than if statements... */
  20716. sum = FOLD_U32T(sum);
  20717. 800e312: b298 uxth r0, r3
  20718. 800e314: eb00 4313 add.w r3, r0, r3, lsr #16
  20719. sum = FOLD_U32T(sum);
  20720. 800e318: b298 uxth r0, r3
  20721. 800e31a: eb00 4013 add.w r0, r0, r3, lsr #16
  20722. /* Swap if alignment was odd */
  20723. if (odd) {
  20724. 800e31e: b122 cbz r2, 800e32a <lwip_standard_chksum+0x52>
  20725. sum = SWAP_BYTES_IN_WORD(sum);
  20726. 800e320: 0603 lsls r3, r0, #24
  20727. 800e322: f3c0 2007 ubfx r0, r0, #8, #8
  20728. 800e326: ea40 4013 orr.w r0, r0, r3, lsr #16
  20729. }
  20730. return (u16_t)sum;
  20731. }
  20732. 800e32a: b280 uxth r0, r0
  20733. 800e32c: bd1c pop {r2, r3, r4, pc}
  20734. 0800e32e <inet_chksum>:
  20735. * @return checksum (as u16_t) to be saved directly in the protocol header
  20736. */
  20737. u16_t
  20738. inet_chksum(void *dataptr, u16_t len)
  20739. {
  20740. 800e32e: b508 push {r3, lr}
  20741. return ~LWIP_CHKSUM(dataptr, len);
  20742. 800e330: f7ff ffd2 bl 800e2d8 <lwip_standard_chksum>
  20743. 800e334: 43c0 mvns r0, r0
  20744. }
  20745. 800e336: b280 uxth r0, r0
  20746. 800e338: bd08 pop {r3, pc}
  20747. 0800e33a <inet_chksum_pbuf>:
  20748. * @param p pbuf chain over that the checksum should be calculated
  20749. * @return checksum (as u16_t) to be saved directly in the protocol header
  20750. */
  20751. u16_t
  20752. inet_chksum_pbuf(struct pbuf *p)
  20753. {
  20754. 800e33a: b570 push {r4, r5, r6, lr}
  20755. u32_t acc;
  20756. struct pbuf *q;
  20757. u8_t swapped;
  20758. acc = 0;
  20759. swapped = 0;
  20760. 800e33c: 2600 movs r6, #0
  20761. * @param p pbuf chain over that the checksum should be calculated
  20762. * @return checksum (as u16_t) to be saved directly in the protocol header
  20763. */
  20764. u16_t
  20765. inet_chksum_pbuf(struct pbuf *p)
  20766. {
  20767. 800e33e: 4605 mov r5, r0
  20768. u32_t acc;
  20769. struct pbuf *q;
  20770. u8_t swapped;
  20771. acc = 0;
  20772. 800e340: 4634 mov r4, r6
  20773. swapped = 0;
  20774. for(q = p; q != NULL; q = q->next) {
  20775. 800e342: e013 b.n 800e36c <inet_chksum_pbuf+0x32>
  20776. acc += LWIP_CHKSUM(q->payload, q->len);
  20777. 800e344: 8969 ldrh r1, [r5, #10]
  20778. 800e346: 6868 ldr r0, [r5, #4]
  20779. 800e348: f7ff ffc6 bl 800e2d8 <lwip_standard_chksum>
  20780. acc = FOLD_U32T(acc);
  20781. if (q->len % 2 != 0) {
  20782. 800e34c: 896b ldrh r3, [r5, #10]
  20783. u8_t swapped;
  20784. acc = 0;
  20785. swapped = 0;
  20786. for(q = p; q != NULL; q = q->next) {
  20787. acc += LWIP_CHKSUM(q->payload, q->len);
  20788. 800e34e: 1900 adds r0, r0, r4
  20789. acc = FOLD_U32T(acc);
  20790. 800e350: b284 uxth r4, r0
  20791. if (q->len % 2 != 0) {
  20792. 800e352: 07d9 lsls r1, r3, #31
  20793. acc = 0;
  20794. swapped = 0;
  20795. for(q = p; q != NULL; q = q->next) {
  20796. acc += LWIP_CHKSUM(q->payload, q->len);
  20797. acc = FOLD_U32T(acc);
  20798. 800e354: eb04 4410 add.w r4, r4, r0, lsr #16
  20799. if (q->len % 2 != 0) {
  20800. 800e358: d507 bpl.n 800e36a <inet_chksum_pbuf+0x30>
  20801. swapped = 1 - swapped;
  20802. acc = SWAP_BYTES_IN_WORD(acc);
  20803. 800e35a: 0623 lsls r3, r4, #24
  20804. swapped = 0;
  20805. for(q = p; q != NULL; q = q->next) {
  20806. acc += LWIP_CHKSUM(q->payload, q->len);
  20807. acc = FOLD_U32T(acc);
  20808. if (q->len % 2 != 0) {
  20809. swapped = 1 - swapped;
  20810. 800e35c: f1c6 0601 rsb r6, r6, #1
  20811. acc = SWAP_BYTES_IN_WORD(acc);
  20812. 800e360: f3c4 2407 ubfx r4, r4, #8, #8
  20813. swapped = 0;
  20814. for(q = p; q != NULL; q = q->next) {
  20815. acc += LWIP_CHKSUM(q->payload, q->len);
  20816. acc = FOLD_U32T(acc);
  20817. if (q->len % 2 != 0) {
  20818. swapped = 1 - swapped;
  20819. 800e364: b2f6 uxtb r6, r6
  20820. acc = SWAP_BYTES_IN_WORD(acc);
  20821. 800e366: ea44 4413 orr.w r4, r4, r3, lsr #16
  20822. struct pbuf *q;
  20823. u8_t swapped;
  20824. acc = 0;
  20825. swapped = 0;
  20826. for(q = p; q != NULL; q = q->next) {
  20827. 800e36a: 682d ldr r5, [r5, #0]
  20828. 800e36c: 2d00 cmp r5, #0
  20829. 800e36e: d1e9 bne.n 800e344 <inet_chksum_pbuf+0xa>
  20830. swapped = 1 - swapped;
  20831. acc = SWAP_BYTES_IN_WORD(acc);
  20832. }
  20833. }
  20834. if (swapped) {
  20835. 800e370: b126 cbz r6, 800e37c <inet_chksum_pbuf+0x42>
  20836. acc = SWAP_BYTES_IN_WORD(acc);
  20837. 800e372: 0623 lsls r3, r4, #24
  20838. 800e374: f3c4 2407 ubfx r4, r4, #8, #8
  20839. 800e378: ea44 4413 orr.w r4, r4, r3, lsr #16
  20840. }
  20841. return (u16_t)~(acc & 0xffffUL);
  20842. 800e37c: 43e0 mvns r0, r4
  20843. }
  20844. 800e37e: b280 uxth r0, r0
  20845. 800e380: bd70 pop {r4, r5, r6, pc}
  20846. 0800e382 <ip4_addr_isbroadcast>:
  20847. {
  20848. ip_addr_t ipaddr;
  20849. ip4_addr_set_u32(&ipaddr, addr);
  20850. /* all ones (broadcast) or all zeroes (old skool broadcast) */
  20851. if ((~addr == IPADDR_ANY) ||
  20852. 800e382: 1e43 subs r3, r0, #1
  20853. 800e384: 3303 adds r3, #3
  20854. 800e386: d811 bhi.n 800e3ac <ip4_addr_isbroadcast+0x2a>
  20855. (addr == IPADDR_ANY)) {
  20856. return 1;
  20857. /* no broadcast support on this network interface? */
  20858. } else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) {
  20859. 800e388: f891 302d ldrb.w r3, [r1, #45] ; 0x2d
  20860. 800e38c: f003 0302 and.w r3, r3, #2
  20861. 800e390: b2db uxtb r3, r3
  20862. 800e392: b16b cbz r3, 800e3b0 <ip4_addr_isbroadcast+0x2e>
  20863. /* the given address cannot be a broadcast address
  20864. * nor can we check against any broadcast addresses */
  20865. return 0;
  20866. /* address matches network interface address exactly? => no broadcast */
  20867. } else if (addr == ip4_addr_get_u32(&netif->ip_addr)) {
  20868. 800e394: 684a ldr r2, [r1, #4]
  20869. 800e396: 4290 cmp r0, r2
  20870. 800e398: d00a beq.n 800e3b0 <ip4_addr_isbroadcast+0x2e>
  20871. return 0;
  20872. /* on the same (sub) network... */
  20873. } else if (ip_addr_netcmp(&ipaddr, &(netif->ip_addr), &(netif->netmask))
  20874. 800e39a: 688b ldr r3, [r1, #8]
  20875. 800e39c: 4042 eors r2, r0
  20876. 800e39e: 421a tst r2, r3
  20877. 800e3a0: d000 beq.n 800e3a4 <ip4_addr_isbroadcast+0x22>
  20878. 800e3a2: e005 b.n 800e3b0 <ip4_addr_isbroadcast+0x2e>
  20879. /* ...and host identifier bits are all ones? =>... */
  20880. && ((addr & ~ip4_addr_get_u32(&netif->netmask)) ==
  20881. 800e3a4: 43db mvns r3, r3
  20882. 800e3a6: 4018 ands r0, r3
  20883. 800e3a8: 4298 cmp r0, r3
  20884. 800e3aa: d101 bne.n 800e3b0 <ip4_addr_isbroadcast+0x2e>
  20885. ip4_addr_set_u32(&ipaddr, addr);
  20886. /* all ones (broadcast) or all zeroes (old skool broadcast) */
  20887. if ((~addr == IPADDR_ANY) ||
  20888. (addr == IPADDR_ANY)) {
  20889. return 1;
  20890. 800e3ac: 2001 movs r0, #1
  20891. 800e3ae: 4770 bx lr
  20892. /* no broadcast support on this network interface? */
  20893. } else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) {
  20894. /* the given address cannot be a broadcast address
  20895. * nor can we check against any broadcast addresses */
  20896. return 0;
  20897. 800e3b0: 2000 movs r0, #0
  20898. /* => network broadcast address */
  20899. return 1;
  20900. } else {
  20901. return 0;
  20902. }
  20903. }
  20904. 800e3b2: 4770 bx lr
  20905. 0800e3b4 <ipaddr_aton>:
  20906. * @param addr pointer to which to save the ip address in network order
  20907. * @return 1 if cp could be converted to addr, 0 on failure
  20908. */
  20909. int
  20910. ipaddr_aton(const char *cp, ip_addr_t *addr)
  20911. {
  20912. 800e3b4: b5f0 push {r4, r5, r6, r7, lr}
  20913. u8_t base;
  20914. char c;
  20915. u32_t parts[4];
  20916. u32_t *pp = parts;
  20917. c = *cp;
  20918. 800e3b6: 7803 ldrb r3, [r0, #0]
  20919. * @param addr pointer to which to save the ip address in network order
  20920. * @return 1 if cp could be converted to addr, 0 on failure
  20921. */
  20922. int
  20923. ipaddr_aton(const char *cp, ip_addr_t *addr)
  20924. {
  20925. 800e3b8: b085 sub sp, #20
  20926. 800e3ba: 460e mov r6, r1
  20927. u8_t base;
  20928. char c;
  20929. u32_t parts[4];
  20930. u32_t *pp = parts;
  20931. c = *cp;
  20932. 800e3bc: 2400 movs r4, #0
  20933. * @param cp IP address in ascii represenation (e.g. "127.0.0.1")
  20934. * @param addr pointer to which to save the ip address in network order
  20935. * @return 1 if cp could be converted to addr, 0 on failure
  20936. */
  20937. int
  20938. ipaddr_aton(const char *cp, ip_addr_t *addr)
  20939. 800e3be: aa00 add r2, sp, #0
  20940. 800e3c0: 18a7 adds r7, r4, r2
  20941. /*
  20942. * Collect number up to ``.''.
  20943. * Values are specified as for C:
  20944. * 0x=hex, 0=octal, 1-9=decimal.
  20945. */
  20946. if (!isdigit(c))
  20947. 800e3c2: f1a3 0230 sub.w r2, r3, #48 ; 0x30
  20948. 800e3c6: 2a09 cmp r2, #9
  20949. 800e3c8: d86d bhi.n 800e4a6 <ipaddr_aton+0xf2>
  20950. return (0);
  20951. val = 0;
  20952. base = 10;
  20953. if (c == '0') {
  20954. 800e3ca: 2b30 cmp r3, #48 ; 0x30
  20955. 800e3cc: d10b bne.n 800e3e6 <ipaddr_aton+0x32>
  20956. c = *++cp;
  20957. 800e3ce: 7843 ldrb r3, [r0, #1]
  20958. if (c == 'x' || c == 'X') {
  20959. 800e3d0: 2b78 cmp r3, #120 ; 0x78
  20960. 800e3d2: d004 beq.n 800e3de <ipaddr_aton+0x2a>
  20961. 800e3d4: 2b58 cmp r3, #88 ; 0x58
  20962. 800e3d6: d002 beq.n 800e3de <ipaddr_aton+0x2a>
  20963. if (!isdigit(c))
  20964. return (0);
  20965. val = 0;
  20966. base = 10;
  20967. if (c == '0') {
  20968. c = *++cp;
  20969. 800e3d8: 3001 adds r0, #1
  20970. if (c == 'x' || c == 'X') {
  20971. base = 16;
  20972. c = *++cp;
  20973. } else
  20974. base = 8;
  20975. 800e3da: 2508 movs r5, #8
  20976. 800e3dc: e004 b.n 800e3e8 <ipaddr_aton+0x34>
  20977. base = 10;
  20978. if (c == '0') {
  20979. c = *++cp;
  20980. if (c == 'x' || c == 'X') {
  20981. base = 16;
  20982. c = *++cp;
  20983. 800e3de: 7883 ldrb r3, [r0, #2]
  20984. val = 0;
  20985. base = 10;
  20986. if (c == '0') {
  20987. c = *++cp;
  20988. if (c == 'x' || c == 'X') {
  20989. base = 16;
  20990. 800e3e0: 2510 movs r5, #16
  20991. c = *++cp;
  20992. 800e3e2: 3002 adds r0, #2
  20993. 800e3e4: e000 b.n 800e3e8 <ipaddr_aton+0x34>
  20994. * 0x=hex, 0=octal, 1-9=decimal.
  20995. */
  20996. if (!isdigit(c))
  20997. return (0);
  20998. val = 0;
  20999. base = 10;
  21000. 800e3e6: 250a movs r5, #10
  21001. 800e3e8: 4602 mov r2, r0
  21002. if (c == '0') {
  21003. c = *++cp;
  21004. if (c == 'x' || c == 'X') {
  21005. base = 16;
  21006. 800e3ea: 2000 movs r0, #0
  21007. 800e3ec: e000 b.n 800e3f0 <ipaddr_aton+0x3c>
  21008. 800e3ee: 3201 adds r2, #1
  21009. c = *++cp;
  21010. } else
  21011. base = 8;
  21012. }
  21013. for (;;) {
  21014. if (isdigit(c)) {
  21015. 800e3f0: f1a3 0130 sub.w r1, r3, #48 ; 0x30
  21016. 800e3f4: 2909 cmp r1, #9
  21017. 800e3f6: d803 bhi.n 800e400 <ipaddr_aton+0x4c>
  21018. val = (val * base) + (int)(c - '0');
  21019. 800e3f8: fb05 3000 mla r0, r5, r0, r3
  21020. 800e3fc: 3830 subs r0, #48 ; 0x30
  21021. 800e3fe: e013 b.n 800e428 <ipaddr_aton+0x74>
  21022. c = *++cp;
  21023. } else if (base == 16 && isxdigit(c)) {
  21024. 800e400: 2d10 cmp r5, #16
  21025. 800e402: d113 bne.n 800e42c <ipaddr_aton+0x78>
  21026. 800e404: f1a3 0161 sub.w r1, r3, #97 ; 0x61
  21027. 800e408: b2c9 uxtb r1, r1
  21028. 800e40a: 2905 cmp r1, #5
  21029. 800e40c: d904 bls.n 800e418 <ipaddr_aton+0x64>
  21030. 800e40e: f1a3 0c41 sub.w ip, r3, #65 ; 0x41
  21031. 800e412: f1bc 0f05 cmp.w ip, #5
  21032. 800e416: d809 bhi.n 800e42c <ipaddr_aton+0x78>
  21033. val = (val << 4) | (int)(c + 10 - (islower(c) ? 'a' : 'A'));
  21034. 800e418: 330a adds r3, #10
  21035. 800e41a: 2919 cmp r1, #25
  21036. 800e41c: bf8c ite hi
  21037. 800e41e: 2141 movhi r1, #65 ; 0x41
  21038. 800e420: 2161 movls r1, #97 ; 0x61
  21039. 800e422: 1a5b subs r3, r3, r1
  21040. 800e424: ea43 1000 orr.w r0, r3, r0, lsl #4
  21041. c = *++cp;
  21042. 800e428: 7853 ldrb r3, [r2, #1]
  21043. 800e42a: e7e0 b.n 800e3ee <ipaddr_aton+0x3a>
  21044. } else
  21045. break;
  21046. }
  21047. if (c == '.') {
  21048. 800e42c: 2b2e cmp r3, #46 ; 0x2e
  21049. 800e42e: d107 bne.n 800e440 <ipaddr_aton+0x8c>
  21050. * Internet format:
  21051. * a.b.c.d
  21052. * a.b.c (with c treated as 16 bits)
  21053. * a.b (with b treated as 24 bits)
  21054. */
  21055. if (pp >= parts + 3) {
  21056. 800e430: 2c0c cmp r4, #12
  21057. 800e432: d038 beq.n 800e4a6 <ipaddr_aton+0xf2>
  21058. return (0);
  21059. }
  21060. *pp++ = val;
  21061. 800e434: f84d 0004 str.w r0, [sp, r4]
  21062. c = *++cp;
  21063. 800e438: 7853 ldrb r3, [r2, #1]
  21064. 800e43a: 1c50 adds r0, r2, #1
  21065. 800e43c: 3404 adds r4, #4
  21066. } else
  21067. break;
  21068. }
  21069. 800e43e: e7be b.n 800e3be <ipaddr_aton+0xa>
  21070. 800e440: 2b0d cmp r3, #13
  21071. 800e442: d803 bhi.n 800e44c <ipaddr_aton+0x98>
  21072. 800e444: 2b09 cmp r3, #9
  21073. 800e446: d203 bcs.n 800e450 <ipaddr_aton+0x9c>
  21074. 800e448: b113 cbz r3, 800e450 <ipaddr_aton+0x9c>
  21075. 800e44a: e02c b.n 800e4a6 <ipaddr_aton+0xf2>
  21076. 800e44c: 2b20 cmp r3, #32
  21077. 800e44e: d12a bne.n 800e4a6 <ipaddr_aton+0xf2>
  21078. }
  21079. /*
  21080. * Concoct the address according to
  21081. * the number of parts specified.
  21082. */
  21083. switch (pp - parts + 1) {
  21084. 800e450: 466b mov r3, sp
  21085. 800e452: 1afb subs r3, r7, r3
  21086. 800e454: 109b asrs r3, r3, #2
  21087. 800e456: 3301 adds r3, #1
  21088. 800e458: 2b04 cmp r3, #4
  21089. 800e45a: d81f bhi.n 800e49c <ipaddr_aton+0xe8>
  21090. 800e45c: e8df f003 tbb [pc, r3]
  21091. 800e460: 0a031e23 .word 0x0a031e23
  21092. 800e464: 13 .byte 0x13
  21093. 800e465: 00 .byte 0x00
  21094. case 1: /* a -- 32 bits */
  21095. break;
  21096. case 2: /* a.b -- 8.24 bits */
  21097. if (val > 0xffffffUL) {
  21098. 800e466: f1b0 7f80 cmp.w r0, #16777216 ; 0x1000000
  21099. 800e46a: d21c bcs.n 800e4a6 <ipaddr_aton+0xf2>
  21100. return (0);
  21101. }
  21102. val |= parts[0] << 24;
  21103. 800e46c: 9b00 ldr r3, [sp, #0]
  21104. 800e46e: ea40 6003 orr.w r0, r0, r3, lsl #24
  21105. break;
  21106. 800e472: e013 b.n 800e49c <ipaddr_aton+0xe8>
  21107. case 3: /* a.b.c -- 8.8.16 bits */
  21108. if (val > 0xffff) {
  21109. 800e474: f5b0 3f80 cmp.w r0, #65536 ; 0x10000
  21110. 800e478: d215 bcs.n 800e4a6 <ipaddr_aton+0xf2>
  21111. return (0);
  21112. }
  21113. val |= (parts[0] << 24) | (parts[1] << 16);
  21114. 800e47a: 9b00 ldr r3, [sp, #0]
  21115. 800e47c: 061a lsls r2, r3, #24
  21116. 800e47e: 9b01 ldr r3, [sp, #4]
  21117. 800e480: ea42 4303 orr.w r3, r2, r3, lsl #16
  21118. 800e484: e009 b.n 800e49a <ipaddr_aton+0xe6>
  21119. break;
  21120. case 4: /* a.b.c.d -- 8.8.8.8 bits */
  21121. if (val > 0xff) {
  21122. 800e486: 28ff cmp r0, #255 ; 0xff
  21123. 800e488: d80d bhi.n 800e4a6 <ipaddr_aton+0xf2>
  21124. return (0);
  21125. }
  21126. val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
  21127. 800e48a: 9b00 ldr r3, [sp, #0]
  21128. 800e48c: 061a lsls r2, r3, #24
  21129. 800e48e: 9b01 ldr r3, [sp, #4]
  21130. 800e490: ea42 4203 orr.w r2, r2, r3, lsl #16
  21131. 800e494: 9b02 ldr r3, [sp, #8]
  21132. 800e496: ea42 2303 orr.w r3, r2, r3, lsl #8
  21133. 800e49a: 4318 orrs r0, r3
  21134. break;
  21135. default:
  21136. LWIP_ASSERT("unhandled", 0);
  21137. break;
  21138. }
  21139. if (addr) {
  21140. 800e49c: b12e cbz r6, 800e4aa <ipaddr_aton+0xf6>
  21141. ip4_addr_set_u32(addr, htonl(val));
  21142. 800e49e: f7fb feae bl 800a1fe <lwip_htonl>
  21143. 800e4a2: 6030 str r0, [r6, #0]
  21144. 800e4a4: e001 b.n 800e4aa <ipaddr_aton+0xf6>
  21145. * Collect number up to ``.''.
  21146. * Values are specified as for C:
  21147. * 0x=hex, 0=octal, 1-9=decimal.
  21148. */
  21149. if (!isdigit(c))
  21150. return (0);
  21151. 800e4a6: 2000 movs r0, #0
  21152. 800e4a8: e000 b.n 800e4ac <ipaddr_aton+0xf8>
  21153. break;
  21154. }
  21155. if (addr) {
  21156. ip4_addr_set_u32(addr, htonl(val));
  21157. }
  21158. return (1);
  21159. 800e4aa: 2001 movs r0, #1
  21160. }
  21161. 800e4ac: b005 add sp, #20
  21162. 800e4ae: bdf0 pop {r4, r5, r6, r7, pc}
  21163. 0800e4b0 <ipaddr_addr>:
  21164. * @param cp IP address in ascii represenation (e.g. "127.0.0.1")
  21165. * @return ip address in network order
  21166. */
  21167. u32_t
  21168. ipaddr_addr(const char *cp)
  21169. {
  21170. 800e4b0: b507 push {r0, r1, r2, lr}
  21171. ip_addr_t val;
  21172. if (ipaddr_aton(cp, &val)) {
  21173. 800e4b2: a901 add r1, sp, #4
  21174. 800e4b4: f7ff ff7e bl 800e3b4 <ipaddr_aton>
  21175. 800e4b8: b108 cbz r0, 800e4be <ipaddr_addr+0xe>
  21176. return ip4_addr_get_u32(&val);
  21177. 800e4ba: 9801 ldr r0, [sp, #4]
  21178. 800e4bc: e001 b.n 800e4c2 <ipaddr_addr+0x12>
  21179. }
  21180. return (IPADDR_NONE);
  21181. 800e4be: f04f 30ff mov.w r0, #4294967295
  21182. }
  21183. 800e4c2: bd0e pop {r1, r2, r3, pc}
  21184. 0800e4c4 <ip_route>:
  21185. return netif;
  21186. }
  21187. #endif
  21188. /* iterate through netifs */
  21189. for (netif = netif_list; netif != NULL; netif = netif->next) {
  21190. 800e4c4: 4b10 ldr r3, [pc, #64] ; (800e508 <ip_route+0x44>)
  21191. 800e4c6: e009 b.n 800e4dc <ip_route+0x18>
  21192. /* network mask matches? */
  21193. if (netif_is_up(netif)) {
  21194. 800e4c8: f893 202d ldrb.w r2, [r3, #45] ; 0x2d
  21195. 800e4cc: 07d2 lsls r2, r2, #31
  21196. 800e4ce: d505 bpl.n 800e4dc <ip_route+0x18>
  21197. if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {
  21198. 800e4d0: 6802 ldr r2, [r0, #0]
  21199. 800e4d2: 6859 ldr r1, [r3, #4]
  21200. 800e4d4: 4051 eors r1, r2
  21201. 800e4d6: 689a ldr r2, [r3, #8]
  21202. 800e4d8: 4211 tst r1, r2
  21203. 800e4da: d012 beq.n 800e502 <ip_route+0x3e>
  21204. return netif;
  21205. }
  21206. #endif
  21207. /* iterate through netifs */
  21208. for (netif = netif_list; netif != NULL; netif = netif->next) {
  21209. 800e4dc: 681b ldr r3, [r3, #0]
  21210. 800e4de: 2b00 cmp r3, #0
  21211. 800e4e0: d1f2 bne.n 800e4c8 <ip_route+0x4>
  21212. /* return netif on which to forward IP packet */
  21213. return netif;
  21214. }
  21215. }
  21216. }
  21217. if ((netif_default == NULL) || (!netif_is_up(netif_default))) {
  21218. 800e4e2: 4a0a ldr r2, [pc, #40] ; (800e50c <ip_route+0x48>)
  21219. 800e4e4: 6812 ldr r2, [r2, #0]
  21220. 800e4e6: b12a cbz r2, 800e4f4 <ip_route+0x30>
  21221. 800e4e8: f892 102d ldrb.w r1, [r2, #45] ; 0x2d
  21222. 800e4ec: 07c9 lsls r1, r1, #31
  21223. 800e4ee: bf48 it mi
  21224. 800e4f0: 4613 movmi r3, r2
  21225. 800e4f2: d406 bmi.n 800e502 <ip_route+0x3e>
  21226. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip_route: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
  21227. ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
  21228. IP_STATS_INC(ip.rterr);
  21229. 800e4f4: 4a06 ldr r2, [pc, #24] ; (800e510 <ip_route+0x4c>)
  21230. 800e4f6: f8b2 1056 ldrh.w r1, [r2, #86] ; 0x56
  21231. 800e4fa: 3101 adds r1, #1
  21232. 800e4fc: f8a2 1056 strh.w r1, [r2, #86] ; 0x56
  21233. snmp_inc_ipoutnoroutes();
  21234. return NULL;
  21235. 800e500: e7ff b.n 800e502 <ip_route+0x3e>
  21236. }
  21237. /* no matching netif found, use default netif */
  21238. return netif_default;
  21239. }
  21240. 800e502: 4618 mov r0, r3
  21241. 800e504: 4770 bx lr
  21242. 800e506: bf00 nop
  21243. 800e508: 20008218 .word 0x20008218
  21244. 800e50c: 2000821c .word 0x2000821c
  21245. 800e510: 20008220 .word 0x20008220
  21246. 0800e514 <ip_input>:
  21247. * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't
  21248. * processed, but currently always returns ERR_OK)
  21249. */
  21250. err_t
  21251. ip_input(struct pbuf *p, struct netif *inp)
  21252. {
  21253. 800e514: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  21254. u16_t iphdr_len;
  21255. #if IP_ACCEPT_LINK_LAYER_ADDRESSING
  21256. int check_ip_src=1;
  21257. #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
  21258. IP_STATS_INC(ip.recv);
  21259. 800e518: 4d73 ldr r5, [pc, #460] ; (800e6e8 <ip_input+0x1d4>)
  21260. snmp_inc_ipinreceives();
  21261. /* identify the IP header */
  21262. iphdr = (struct ip_hdr *)p->payload;
  21263. 800e51a: 6846 ldr r6, [r0, #4]
  21264. u16_t iphdr_len;
  21265. #if IP_ACCEPT_LINK_LAYER_ADDRESSING
  21266. int check_ip_src=1;
  21267. #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
  21268. IP_STATS_INC(ip.recv);
  21269. 800e51c: f8b5 304a ldrh.w r3, [r5, #74] ; 0x4a
  21270. 800e520: 3301 adds r3, #1
  21271. 800e522: f8a5 304a strh.w r3, [r5, #74] ; 0x4a
  21272. snmp_inc_ipinreceives();
  21273. /* identify the IP header */
  21274. iphdr = (struct ip_hdr *)p->payload;
  21275. if (IPH_V(iphdr) != 4) {
  21276. 800e526: f896 8000 ldrb.w r8, [r6]
  21277. 800e52a: ea4f 1318 mov.w r3, r8, lsr #4
  21278. 800e52e: 2b04 cmp r3, #4
  21279. * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't
  21280. * processed, but currently always returns ERR_OK)
  21281. */
  21282. err_t
  21283. ip_input(struct pbuf *p, struct netif *inp)
  21284. {
  21285. 800e530: 4604 mov r4, r0
  21286. 800e532: 460f mov r7, r1
  21287. IP_STATS_INC(ip.recv);
  21288. snmp_inc_ipinreceives();
  21289. /* identify the IP header */
  21290. iphdr = (struct ip_hdr *)p->payload;
  21291. if (IPH_V(iphdr) != 4) {
  21292. 800e534: d00c beq.n 800e550 <ip_input+0x3c>
  21293. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IP packet dropped due to bad version number %"U16_F"\n", IPH_V(iphdr)));
  21294. ip_debug_print(p);
  21295. pbuf_free(p);
  21296. 800e536: f7fc ffc5 bl 800b4c4 <pbuf_free>
  21297. IP_STATS_INC(ip.err);
  21298. 800e53a: f8b5 305c ldrh.w r3, [r5, #92] ; 0x5c
  21299. 800e53e: 3301 adds r3, #1
  21300. 800e540: f8a5 305c strh.w r3, [r5, #92] ; 0x5c
  21301. IP_STATS_INC(ip.drop);
  21302. 800e544: f8b5 304e ldrh.w r3, [r5, #78] ; 0x4e
  21303. 800e548: 3301 adds r3, #1
  21304. 800e54a: f8a5 304e strh.w r3, [r5, #78] ; 0x4e
  21305. snmp_inc_ipinhdrerrors();
  21306. return ERR_OK;
  21307. 800e54e: e0c7 b.n 800e6e0 <ip_input+0x1cc>
  21308. /* obtain IP header length in number of 32-bit words */
  21309. iphdr_hlen = IPH_HL(iphdr);
  21310. /* calculate IP header length in bytes */
  21311. iphdr_hlen *= 4;
  21312. /* obtain ip length in bytes */
  21313. iphdr_len = ntohs(IPH_LEN(iphdr));
  21314. 800e550: 8870 ldrh r0, [r6, #2]
  21315. 800e552: f7fb fe4f bl 800a1f4 <lwip_ntohs>
  21316. return ERR_OK;
  21317. }
  21318. #endif
  21319. /* obtain IP header length in number of 32-bit words */
  21320. iphdr_hlen = IPH_HL(iphdr);
  21321. 800e556: f008 080f and.w r8, r8, #15
  21322. iphdr_hlen *= 4;
  21323. /* obtain ip length in bytes */
  21324. iphdr_len = ntohs(IPH_LEN(iphdr));
  21325. /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
  21326. if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
  21327. 800e55a: 8963 ldrh r3, [r4, #10]
  21328. #endif
  21329. /* obtain IP header length in number of 32-bit words */
  21330. iphdr_hlen = IPH_HL(iphdr);
  21331. /* calculate IP header length in bytes */
  21332. iphdr_hlen *= 4;
  21333. 800e55c: ea4f 0888 mov.w r8, r8, lsl #2
  21334. /* obtain ip length in bytes */
  21335. iphdr_len = ntohs(IPH_LEN(iphdr));
  21336. /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
  21337. if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
  21338. 800e560: 4543 cmp r3, r8
  21339. /* obtain IP header length in number of 32-bit words */
  21340. iphdr_hlen = IPH_HL(iphdr);
  21341. /* calculate IP header length in bytes */
  21342. iphdr_hlen *= 4;
  21343. /* obtain ip length in bytes */
  21344. iphdr_len = ntohs(IPH_LEN(iphdr));
  21345. 800e562: 4601 mov r1, r0
  21346. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
  21347. ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n",
  21348. iphdr_len, p->tot_len));
  21349. }
  21350. /* free (drop) packet pbufs */
  21351. pbuf_free(p);
  21352. 800e564: 4620 mov r0, r4
  21353. iphdr_hlen *= 4;
  21354. /* obtain ip length in bytes */
  21355. iphdr_len = ntohs(IPH_LEN(iphdr));
  21356. /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
  21357. if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
  21358. 800e566: d302 bcc.n 800e56e <ip_input+0x5a>
  21359. 800e568: 8923 ldrh r3, [r4, #8]
  21360. 800e56a: 428b cmp r3, r1
  21361. 800e56c: d208 bcs.n 800e580 <ip_input+0x6c>
  21362. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
  21363. ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n",
  21364. iphdr_len, p->tot_len));
  21365. }
  21366. /* free (drop) packet pbufs */
  21367. pbuf_free(p);
  21368. 800e56e: f7fc ffa9 bl 800b4c4 <pbuf_free>
  21369. IP_STATS_INC(ip.lenerr);
  21370. 800e572: 4b5d ldr r3, [pc, #372] ; (800e6e8 <ip_input+0x1d4>)
  21371. 800e574: f8b3 2052 ldrh.w r2, [r3, #82] ; 0x52
  21372. 800e578: 3201 adds r2, #1
  21373. 800e57a: f8a3 2052 strh.w r2, [r3, #82] ; 0x52
  21374. 800e57e: e044 b.n 800e60a <ip_input+0xf6>
  21375. }
  21376. #endif
  21377. /* Trim pbuf. This should have been done at the netif layer,
  21378. * but we'll do it anyway just to be sure that its done. */
  21379. pbuf_realloc(p, iphdr_len);
  21380. 800e580: f7fc ffcb bl 800b51a <pbuf_realloc>
  21381. /* copy IP addresses to aligned ip_addr_t */
  21382. ip_addr_copy(current_iphdr_dest, iphdr->dest);
  21383. 800e584: 6932 ldr r2, [r6, #16]
  21384. 800e586: 4b59 ldr r3, [pc, #356] ; (800e6ec <ip_input+0x1d8>)
  21385. }
  21386. #endif /* LWIP_AUTOIP */
  21387. }
  21388. if (first) {
  21389. first = 0;
  21390. netif = netif_list;
  21391. 800e588: f8df b170 ldr.w fp, [pc, #368] ; 800e6fc <ip_input+0x1e8>
  21392. /* Trim pbuf. This should have been done at the netif layer,
  21393. * but we'll do it anyway just to be sure that its done. */
  21394. pbuf_realloc(p, iphdr_len);
  21395. /* copy IP addresses to aligned ip_addr_t */
  21396. ip_addr_copy(current_iphdr_dest, iphdr->dest);
  21397. 800e58c: 601a str r2, [r3, #0]
  21398. ip_addr_copy(current_iphdr_src, iphdr->src);
  21399. 800e58e: 68f1 ldr r1, [r6, #12]
  21400. 800e590: 4a57 ldr r2, [pc, #348] ; (800e6f0 <ip_input+0x1dc>)
  21401. 800e592: 463d mov r5, r7
  21402. 800e594: 6011 str r1, [r2, #0]
  21403. #endif /* LWIP_IGMP */
  21404. {
  21405. /* start trying with inp. if that's not acceptable, start walking the
  21406. list of configured netifs.
  21407. 'first' is used as a boolean to mark whether we started walking the list */
  21408. int first = 1;
  21409. 800e596: f04f 0901 mov.w r9, #1
  21410. ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
  21411. /* interface is up and configured? */
  21412. if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
  21413. /* unicast to this interface address? */
  21414. if (ip_addr_cmp(&current_iphdr_dest, &(netif->ip_addr)) ||
  21415. 800e59a: 469a mov sl, r3
  21416. ip4_addr_get_u32(&iphdr->dest) & ip4_addr_get_u32(&netif->netmask),
  21417. ip4_addr_get_u32(&netif->ip_addr) & ip4_addr_get_u32(&netif->netmask),
  21418. ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
  21419. /* interface is up and configured? */
  21420. if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
  21421. 800e59c: f895 302d ldrb.w r3, [r5, #45] ; 0x2d
  21422. 800e5a0: 07d9 lsls r1, r3, #31
  21423. 800e5a2: d403 bmi.n 800e5ac <ip_input+0x98>
  21424. /* break out of for loop */
  21425. break;
  21426. }
  21427. #endif /* LWIP_AUTOIP */
  21428. }
  21429. if (first) {
  21430. 800e5a4: f1b9 0f00 cmp.w r9, #0
  21431. 800e5a8: d10e bne.n 800e5c8 <ip_input+0xb4>
  21432. 800e5aa: e010 b.n 800e5ce <ip_input+0xba>
  21433. ip4_addr_get_u32(&iphdr->dest) & ip4_addr_get_u32(&netif->netmask),
  21434. ip4_addr_get_u32(&netif->ip_addr) & ip4_addr_get_u32(&netif->netmask),
  21435. ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
  21436. /* interface is up and configured? */
  21437. if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
  21438. 800e5ac: 686b ldr r3, [r5, #4]
  21439. 800e5ae: 2b00 cmp r3, #0
  21440. 800e5b0: d0f8 beq.n 800e5a4 <ip_input+0x90>
  21441. /* unicast to this interface address? */
  21442. if (ip_addr_cmp(&current_iphdr_dest, &(netif->ip_addr)) ||
  21443. 800e5b2: f8da 0000 ldr.w r0, [sl]
  21444. 800e5b6: 4298 cmp r0, r3
  21445. 800e5b8: f000 808b beq.w 800e6d2 <ip_input+0x1be>
  21446. /* or broadcast on this interface network address? */
  21447. ip_addr_isbroadcast(&current_iphdr_dest, netif)) {
  21448. 800e5bc: 4629 mov r1, r5
  21449. 800e5be: f7ff fee0 bl 800e382 <ip4_addr_isbroadcast>
  21450. ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
  21451. /* interface is up and configured? */
  21452. if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
  21453. /* unicast to this interface address? */
  21454. if (ip_addr_cmp(&current_iphdr_dest, &(netif->ip_addr)) ||
  21455. 800e5c2: 2800 cmp r0, #0
  21456. 800e5c4: d0ee beq.n 800e5a4 <ip_input+0x90>
  21457. 800e5c6: e084 b.n 800e6d2 <ip_input+0x1be>
  21458. }
  21459. #endif /* LWIP_AUTOIP */
  21460. }
  21461. if (first) {
  21462. first = 0;
  21463. netif = netif_list;
  21464. 800e5c8: f8db 5000 ldr.w r5, [fp]
  21465. 800e5cc: e000 b.n 800e5d0 <ip_input+0xbc>
  21466. } else {
  21467. netif = netif->next;
  21468. 800e5ce: 682d ldr r5, [r5, #0]
  21469. }
  21470. if (netif == inp) {
  21471. 800e5d0: 42bd cmp r5, r7
  21472. netif = netif->next;
  21473. 800e5d2: bf08 it eq
  21474. 800e5d4: 682d ldreq r5, [r5, #0]
  21475. 800e5d6: f04f 0900 mov.w r9, #0
  21476. }
  21477. } while(netif != NULL);
  21478. 800e5da: 2d00 cmp r5, #0
  21479. 800e5dc: d1de bne.n 800e59c <ip_input+0x88>
  21480. 800e5de: e075 b.n 800e6cc <ip_input+0x1b8>
  21481. /* remote port is DHCP server? */
  21482. if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
  21483. struct udp_hdr *udphdr = (struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen);
  21484. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip_input: UDP packet to DHCP client port %"U16_F"\n",
  21485. ntohs(udphdr->dest)));
  21486. if (IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(udphdr->dest)) {
  21487. 800e5e0: eb06 0308 add.w r3, r6, r8
  21488. 800e5e4: 885b ldrh r3, [r3, #2]
  21489. 800e5e6: f5b3 4f88 cmp.w r3, #17408 ; 0x4400
  21490. 800e5ea: d172 bne.n 800e6d2 <ip_input+0x1be>
  21491. 800e5ec: e013 b.n 800e616 <ip_input+0x102>
  21492. /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
  21493. #if IP_ACCEPT_LINK_LAYER_ADDRESSING
  21494. /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */
  21495. if (check_ip_src && !ip_addr_isany(&current_iphdr_src))
  21496. #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
  21497. { if ((ip_addr_isbroadcast(&current_iphdr_src, inp)) ||
  21498. 800e5ee: 4639 mov r1, r7
  21499. 800e5f0: f7ff fec7 bl 800e382 <ip4_addr_isbroadcast>
  21500. 800e5f4: b928 cbnz r0, 800e602 <ip_input+0xee>
  21501. (ip_addr_ismulticast(&current_iphdr_src))) {
  21502. 800e5f6: f8d8 3000 ldr.w r3, [r8]
  21503. 800e5fa: f003 03f0 and.w r3, r3, #240 ; 0xf0
  21504. /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
  21505. #if IP_ACCEPT_LINK_LAYER_ADDRESSING
  21506. /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */
  21507. if (check_ip_src && !ip_addr_isany(&current_iphdr_src))
  21508. #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
  21509. { if ((ip_addr_isbroadcast(&current_iphdr_src, inp)) ||
  21510. 800e5fe: 2be0 cmp r3, #224 ; 0xe0
  21511. 800e600: d10a bne.n 800e618 <ip_input+0x104>
  21512. (ip_addr_ismulticast(&current_iphdr_src))) {
  21513. /* packet source is not valid */
  21514. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("ip_input: packet source is not valid.\n"));
  21515. /* free (drop) packet pbufs */
  21516. pbuf_free(p);
  21517. 800e602: 4620 mov r0, r4
  21518. 800e604: f7fc ff5e bl 800b4c4 <pbuf_free>
  21519. IP_STATS_INC(ip.drop);
  21520. 800e608: 4b37 ldr r3, [pc, #220] ; (800e6e8 <ip_input+0x1d4>)
  21521. 800e60a: f8b3 204e ldrh.w r2, [r3, #78] ; 0x4e
  21522. 800e60e: 3201 adds r2, #1
  21523. 800e610: f8a3 204e strh.w r2, [r3, #78] ; 0x4e
  21524. snmp_inc_ipinaddrerrors();
  21525. snmp_inc_ipindiscards();
  21526. return ERR_OK;
  21527. 800e614: e064 b.n 800e6e0 <ip_input+0x1cc>
  21528. /* remote port is DHCP server? */
  21529. if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
  21530. struct udp_hdr *udphdr = (struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen);
  21531. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip_input: UDP packet to DHCP client port %"U16_F"\n",
  21532. ntohs(udphdr->dest)));
  21533. if (IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(udphdr->dest)) {
  21534. 800e616: 463d mov r5, r7
  21535. return ERR_OK;
  21536. }
  21537. }
  21538. /* packet not for us? */
  21539. if (netif == NULL) {
  21540. 800e618: b91d cbnz r5, 800e622 <ip_input+0x10e>
  21541. #endif /* IP_FORWARD */
  21542. {
  21543. snmp_inc_ipinaddrerrors();
  21544. snmp_inc_ipindiscards();
  21545. }
  21546. pbuf_free(p);
  21547. 800e61a: 4620 mov r0, r4
  21548. 800e61c: f7fc ff52 bl 800b4c4 <pbuf_free>
  21549. return ERR_OK;
  21550. 800e620: e05e b.n 800e6e0 <ip_input+0x1cc>
  21551. }
  21552. /* packet consists of multiple fragments? */
  21553. if ((IPH_OFFSET(iphdr) & PP_HTONS(IP_OFFMASK | IP_MF)) != 0) {
  21554. 800e622: 88f3 ldrh r3, [r6, #6]
  21555. 800e624: f023 03c0 bic.w r3, r3, #192 ; 0xc0
  21556. 800e628: b29b uxth r3, r3
  21557. 800e62a: b133 cbz r3, 800e63a <ip_input+0x126>
  21558. #if IP_REASSEMBLY /* packet fragment reassembly code present? */
  21559. LWIP_DEBUGF(IP_DEBUG, ("IP packet is a fragment (id=0x%04"X16_F" tot_len=%"U16_F" len=%"U16_F" MF=%"U16_F" offset=%"U16_F"), calling ip_reass()\n",
  21560. ntohs(IPH_ID(iphdr)), p->tot_len, ntohs(IPH_LEN(iphdr)), !!(IPH_OFFSET(iphdr) & PP_HTONS(IP_MF)), (ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)*8));
  21561. /* reassemble the packet*/
  21562. p = ip_reass(p);
  21563. 800e62c: 4620 mov r0, r4
  21564. 800e62e: f000 f991 bl 800e954 <ip_reass>
  21565. /* packet not fully reassembled yet? */
  21566. if (p == NULL) {
  21567. 800e632: 4604 mov r4, r0
  21568. 800e634: 2800 cmp r0, #0
  21569. 800e636: d053 beq.n 800e6e0 <ip_input+0x1cc>
  21570. return ERR_OK;
  21571. }
  21572. iphdr = (struct ip_hdr *)p->payload;
  21573. 800e638: 6846 ldr r6, [r0, #4]
  21574. /* send to upper layers */
  21575. LWIP_DEBUGF(IP_DEBUG, ("ip_input: \n"));
  21576. ip_debug_print(p);
  21577. LWIP_DEBUGF(IP_DEBUG, ("ip_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));
  21578. current_netif = inp;
  21579. 800e63a: 4b2e ldr r3, [pc, #184] ; (800e6f4 <ip_input+0x1e0>)
  21580. 800e63c: 601f str r7, [r3, #0]
  21581. current_header = iphdr;
  21582. 800e63e: 4b2e ldr r3, [pc, #184] ; (800e6f8 <ip_input+0x1e4>)
  21583. #if LWIP_RAW
  21584. /* raw input did not eat the packet? */
  21585. if (raw_input(p, inp) == 0)
  21586. 800e640: 4620 mov r0, r4
  21587. 800e642: 4639 mov r1, r7
  21588. LWIP_DEBUGF(IP_DEBUG, ("ip_input: \n"));
  21589. ip_debug_print(p);
  21590. LWIP_DEBUGF(IP_DEBUG, ("ip_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));
  21591. current_netif = inp;
  21592. current_header = iphdr;
  21593. 800e644: 601e str r6, [r3, #0]
  21594. #if LWIP_RAW
  21595. /* raw input did not eat the packet? */
  21596. if (raw_input(p, inp) == 0)
  21597. 800e646: f7fd f8b9 bl 800b7bc <raw_input>
  21598. 800e64a: 2800 cmp r0, #0
  21599. 800e64c: d134 bne.n 800e6b8 <ip_input+0x1a4>
  21600. #endif /* LWIP_RAW */
  21601. {
  21602. switch (IPH_PROTO(iphdr)) {
  21603. 800e64e: 7a73 ldrb r3, [r6, #9]
  21604. 800e650: 2b06 cmp r3, #6
  21605. 800e652: d009 beq.n 800e668 <ip_input+0x154>
  21606. 800e654: 2b11 cmp r3, #17
  21607. 800e656: d002 beq.n 800e65e <ip_input+0x14a>
  21608. 800e658: 2b01 cmp r3, #1
  21609. 800e65a: d10f bne.n 800e67c <ip_input+0x168>
  21610. 800e65c: e009 b.n 800e672 <ip_input+0x15e>
  21611. case IP_PROTO_UDP:
  21612. #if LWIP_UDPLITE
  21613. case IP_PROTO_UDPLITE:
  21614. #endif /* LWIP_UDPLITE */
  21615. snmp_inc_ipindelivers();
  21616. udp_input(p, inp);
  21617. 800e65e: 4620 mov r0, r4
  21618. 800e660: 4639 mov r1, r7
  21619. 800e662: f7ff fb49 bl 800dcf8 <udp_input>
  21620. break;
  21621. 800e666: e027 b.n 800e6b8 <ip_input+0x1a4>
  21622. #endif /* LWIP_UDP */
  21623. #if LWIP_TCP
  21624. case IP_PROTO_TCP:
  21625. snmp_inc_ipindelivers();
  21626. tcp_input(p, inp);
  21627. 800e668: 4620 mov r0, r4
  21628. 800e66a: 4639 mov r1, r7
  21629. 800e66c: f7fe f874 bl 800c758 <tcp_input>
  21630. break;
  21631. 800e670: e022 b.n 800e6b8 <ip_input+0x1a4>
  21632. #endif /* LWIP_TCP */
  21633. #if LWIP_ICMP
  21634. case IP_PROTO_ICMP:
  21635. snmp_inc_ipindelivers();
  21636. icmp_input(p, inp);
  21637. 800e672: 4620 mov r0, r4
  21638. 800e674: 4639 mov r1, r7
  21639. 800e676: f7ff fd5d bl 800e134 <icmp_input>
  21640. break;
  21641. 800e67a: e01d b.n 800e6b8 <ip_input+0x1a4>
  21642. break;
  21643. #endif /* LWIP_IGMP */
  21644. default:
  21645. #if LWIP_ICMP
  21646. /* send ICMP destination protocol unreachable unless is was a broadcast */
  21647. if (!ip_addr_isbroadcast(&current_iphdr_dest, inp) &&
  21648. 800e67c: 4d1b ldr r5, [pc, #108] ; (800e6ec <ip_input+0x1d8>)
  21649. 800e67e: 4639 mov r1, r7
  21650. 800e680: 6828 ldr r0, [r5, #0]
  21651. 800e682: f7ff fe7e bl 800e382 <ip4_addr_isbroadcast>
  21652. 800e686: b948 cbnz r0, 800e69c <ip_input+0x188>
  21653. !ip_addr_ismulticast(&current_iphdr_dest)) {
  21654. 800e688: 682b ldr r3, [r5, #0]
  21655. 800e68a: f003 03f0 and.w r3, r3, #240 ; 0xf0
  21656. break;
  21657. #endif /* LWIP_IGMP */
  21658. default:
  21659. #if LWIP_ICMP
  21660. /* send ICMP destination protocol unreachable unless is was a broadcast */
  21661. if (!ip_addr_isbroadcast(&current_iphdr_dest, inp) &&
  21662. 800e68e: 2be0 cmp r3, #224 ; 0xe0
  21663. 800e690: d004 beq.n 800e69c <ip_input+0x188>
  21664. !ip_addr_ismulticast(&current_iphdr_dest)) {
  21665. p->payload = iphdr;
  21666. 800e692: 6066 str r6, [r4, #4]
  21667. icmp_dest_unreach(p, ICMP_DUR_PROTO);
  21668. 800e694: 4620 mov r0, r4
  21669. 800e696: 2102 movs r1, #2
  21670. 800e698: f7ff fe16 bl 800e2c8 <icmp_dest_unreach>
  21671. }
  21672. #endif /* LWIP_ICMP */
  21673. pbuf_free(p);
  21674. 800e69c: 4620 mov r0, r4
  21675. 800e69e: f7fc ff11 bl 800b4c4 <pbuf_free>
  21676. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Unsupported transport protocol %"U16_F"\n", IPH_PROTO(iphdr)));
  21677. IP_STATS_INC(ip.proterr);
  21678. 800e6a2: 4b11 ldr r3, [pc, #68] ; (800e6e8 <ip_input+0x1d4>)
  21679. 800e6a4: f8b3 2058 ldrh.w r2, [r3, #88] ; 0x58
  21680. 800e6a8: 3201 adds r2, #1
  21681. 800e6aa: f8a3 2058 strh.w r2, [r3, #88] ; 0x58
  21682. IP_STATS_INC(ip.drop);
  21683. 800e6ae: f8b3 204e ldrh.w r2, [r3, #78] ; 0x4e
  21684. 800e6b2: 3201 adds r2, #1
  21685. 800e6b4: f8a3 204e strh.w r2, [r3, #78] ; 0x4e
  21686. snmp_inc_ipinunknownprotos();
  21687. }
  21688. }
  21689. current_netif = NULL;
  21690. 800e6b8: 4a0e ldr r2, [pc, #56] ; (800e6f4 <ip_input+0x1e0>)
  21691. 800e6ba: 2300 movs r3, #0
  21692. 800e6bc: 6013 str r3, [r2, #0]
  21693. current_header = NULL;
  21694. 800e6be: 4a0e ldr r2, [pc, #56] ; (800e6f8 <ip_input+0x1e4>)
  21695. 800e6c0: 6013 str r3, [r2, #0]
  21696. ip_addr_set_any(&current_iphdr_src);
  21697. 800e6c2: 4a0b ldr r2, [pc, #44] ; (800e6f0 <ip_input+0x1dc>)
  21698. 800e6c4: 6013 str r3, [r2, #0]
  21699. ip_addr_set_any(&current_iphdr_dest);
  21700. 800e6c6: 4a09 ldr r2, [pc, #36] ; (800e6ec <ip_input+0x1d8>)
  21701. 800e6c8: 6013 str r3, [r2, #0]
  21702. return ERR_OK;
  21703. 800e6ca: e009 b.n 800e6e0 <ip_input+0x1cc>
  21704. *
  21705. * #define LWIP_IP_ACCEPT_UDP_PORT(dst_port) ((dst_port) == PP_NTOHS(12345))
  21706. */
  21707. if (netif == NULL) {
  21708. /* remote port is DHCP server? */
  21709. if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
  21710. 800e6cc: 7a73 ldrb r3, [r6, #9]
  21711. 800e6ce: 2b11 cmp r3, #17
  21712. 800e6d0: d086 beq.n 800e5e0 <ip_input+0xcc>
  21713. #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
  21714. /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
  21715. #if IP_ACCEPT_LINK_LAYER_ADDRESSING
  21716. /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */
  21717. if (check_ip_src && !ip_addr_isany(&current_iphdr_src))
  21718. 800e6d2: f8df 801c ldr.w r8, [pc, #28] ; 800e6f0 <ip_input+0x1dc>
  21719. 800e6d6: f8d8 0000 ldr.w r0, [r8]
  21720. 800e6da: 2800 cmp r0, #0
  21721. 800e6dc: d09c beq.n 800e618 <ip_input+0x104>
  21722. 800e6de: e786 b.n 800e5ee <ip_input+0xda>
  21723. current_header = NULL;
  21724. ip_addr_set_any(&current_iphdr_src);
  21725. ip_addr_set_any(&current_iphdr_dest);
  21726. return ERR_OK;
  21727. }
  21728. 800e6e0: 2000 movs r0, #0
  21729. 800e6e2: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
  21730. 800e6e6: bf00 nop
  21731. 800e6e8: 20008220 .word 0x20008220
  21732. 800e6ec: 20008364 .word 0x20008364
  21733. 800e6f0: 2000835c .word 0x2000835c
  21734. 800e6f4: 20008360 .word 0x20008360
  21735. 800e6f8: 20008368 .word 0x20008368
  21736. 800e6fc: 20008218 .word 0x20008218
  21737. 0800e700 <ip_output_if>:
  21738. */
  21739. err_t
  21740. ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
  21741. u8_t ttl, u8_t tos,
  21742. u8_t proto, struct netif *netif)
  21743. {
  21744. 800e700: e92d 47f3 stmdb sp!, {r0, r1, r4, r5, r6, r7, r8, r9, sl, lr}
  21745. 800e704: 9f0c ldr r7, [sp, #48] ; 0x30
  21746. 800e706: 4606 mov r6, r0
  21747. 800e708: 4689 mov r9, r1
  21748. 800e70a: 469a mov sl, r3
  21749. LWIP_ASSERT("p->ref == 1", p->ref == 1);
  21750. snmp_inc_ipoutrequests();
  21751. /* Should the IP header be generated or is it already included in p? */
  21752. if (dest != IP_HDRINCL) {
  21753. 800e70c: 4615 mov r5, r2
  21754. 800e70e: 2a00 cmp r2, #0
  21755. 800e710: d039 beq.n 800e786 <ip_output_if+0x86>
  21756. }
  21757. #endif /* CHECKSUM_GEN_IP_INLINE */
  21758. }
  21759. #endif /* IP_OPTIONS_SEND */
  21760. /* generate IP header */
  21761. if (pbuf_header(p, IP_HLEN)) {
  21762. 800e712: 2114 movs r1, #20
  21763. 800e714: f7fc feab bl 800b46e <pbuf_header>
  21764. 800e718: 4680 mov r8, r0
  21765. 800e71a: b138 cbz r0, 800e72c <ip_output_if+0x2c>
  21766. LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip_output: not enough room for IP header in pbuf\n"));
  21767. IP_STATS_INC(ip.err);
  21768. 800e71c: 4b29 ldr r3, [pc, #164] ; (800e7c4 <ip_output_if+0xc4>)
  21769. 800e71e: f8b3 205c ldrh.w r2, [r3, #92] ; 0x5c
  21770. 800e722: 3201 adds r2, #1
  21771. 800e724: f8a3 205c strh.w r2, [r3, #92] ; 0x5c
  21772. snmp_inc_ipoutdiscards();
  21773. return ERR_BUF;
  21774. 800e728: 20fe movs r0, #254 ; 0xfe
  21775. 800e72a: e047 b.n 800e7bc <ip_output_if+0xbc>
  21776. }
  21777. iphdr = (struct ip_hdr *)p->payload;
  21778. 800e72c: 6874 ldr r4, [r6, #4]
  21779. LWIP_ASSERT("check that first pbuf can hold struct ip_hdr",
  21780. (p->len >= sizeof(struct ip_hdr)));
  21781. IPH_TTL_SET(iphdr, ttl);
  21782. IPH_PROTO_SET(iphdr, proto);
  21783. 800e72e: f89d 302c ldrb.w r3, [sp, #44] ; 0x2c
  21784. iphdr = (struct ip_hdr *)p->payload;
  21785. LWIP_ASSERT("check that first pbuf can hold struct ip_hdr",
  21786. (p->len >= sizeof(struct ip_hdr)));
  21787. IPH_TTL_SET(iphdr, ttl);
  21788. 800e732: f884 a008 strb.w sl, [r4, #8]
  21789. IPH_PROTO_SET(iphdr, proto);
  21790. 800e736: 7263 strb r3, [r4, #9]
  21791. #if CHECKSUM_GEN_IP_INLINE
  21792. chk_sum += LWIP_MAKE_U16(proto, ttl);
  21793. #endif /* CHECKSUM_GEN_IP_INLINE */
  21794. /* dest cannot be NULL here */
  21795. ip_addr_copy(iphdr->dest, *dest);
  21796. 800e738: 682b ldr r3, [r5, #0]
  21797. 800e73a: 6123 str r3, [r4, #16]
  21798. #if CHECKSUM_GEN_IP_INLINE
  21799. chk_sum += ip4_addr_get_u32(&iphdr->dest) & 0xFFFF;
  21800. chk_sum += ip4_addr_get_u32(&iphdr->dest) >> 16;
  21801. #endif /* CHECKSUM_GEN_IP_INLINE */
  21802. IPH_VHL_SET(iphdr, 4, ip_hlen / 4);
  21803. 800e73c: 2345 movs r3, #69 ; 0x45
  21804. 800e73e: 7023 strb r3, [r4, #0]
  21805. IPH_TOS_SET(iphdr, tos);
  21806. 800e740: f89d 3028 ldrb.w r3, [sp, #40] ; 0x28
  21807. 800e744: 7063 strb r3, [r4, #1]
  21808. #if CHECKSUM_GEN_IP_INLINE
  21809. chk_sum += LWIP_MAKE_U16(tos, iphdr->_v_hl);
  21810. #endif /* CHECKSUM_GEN_IP_INLINE */
  21811. IPH_LEN_SET(iphdr, htons(p->tot_len));
  21812. 800e746: 8930 ldrh r0, [r6, #8]
  21813. 800e748: f7fb fd4f bl 800a1ea <lwip_htons>
  21814. #if CHECKSUM_GEN_IP_INLINE
  21815. chk_sum += iphdr->_len;
  21816. #endif /* CHECKSUM_GEN_IP_INLINE */
  21817. IPH_OFFSET_SET(iphdr, 0);
  21818. 800e74c: f884 8006 strb.w r8, [r4, #6]
  21819. 800e750: f884 8007 strb.w r8, [r4, #7]
  21820. IPH_ID_SET(iphdr, htons(ip_id));
  21821. 800e754: f8df 8070 ldr.w r8, [pc, #112] ; 800e7c8 <ip_output_if+0xc8>
  21822. IPH_VHL_SET(iphdr, 4, ip_hlen / 4);
  21823. IPH_TOS_SET(iphdr, tos);
  21824. #if CHECKSUM_GEN_IP_INLINE
  21825. chk_sum += LWIP_MAKE_U16(tos, iphdr->_v_hl);
  21826. #endif /* CHECKSUM_GEN_IP_INLINE */
  21827. IPH_LEN_SET(iphdr, htons(p->tot_len));
  21828. 800e758: 8060 strh r0, [r4, #2]
  21829. #if CHECKSUM_GEN_IP_INLINE
  21830. chk_sum += iphdr->_len;
  21831. #endif /* CHECKSUM_GEN_IP_INLINE */
  21832. IPH_OFFSET_SET(iphdr, 0);
  21833. IPH_ID_SET(iphdr, htons(ip_id));
  21834. 800e75a: f8b8 0000 ldrh.w r0, [r8]
  21835. 800e75e: f7fb fd44 bl 800a1ea <lwip_htons>
  21836. 800e762: 80a0 strh r0, [r4, #4]
  21837. #if CHECKSUM_GEN_IP_INLINE
  21838. chk_sum += iphdr->_id;
  21839. #endif /* CHECKSUM_GEN_IP_INLINE */
  21840. ++ip_id;
  21841. 800e764: f8b8 3000 ldrh.w r3, [r8]
  21842. 800e768: 3301 adds r3, #1
  21843. 800e76a: f8a8 3000 strh.w r3, [r8]
  21844. if (ip_addr_isany(src)) {
  21845. 800e76e: f1b9 0f00 cmp.w r9, #0
  21846. 800e772: d002 beq.n 800e77a <ip_output_if+0x7a>
  21847. 800e774: f8d9 3000 ldr.w r3, [r9]
  21848. 800e778: b903 cbnz r3, 800e77c <ip_output_if+0x7c>
  21849. ip_addr_copy(iphdr->src, netif->ip_addr);
  21850. 800e77a: 687b ldr r3, [r7, #4]
  21851. } else {
  21852. /* src cannot be NULL here */
  21853. ip_addr_copy(iphdr->src, *src);
  21854. 800e77c: 60e3 str r3, [r4, #12]
  21855. chk_sum = (chk_sum >> 16) + (chk_sum & 0xFFFF);
  21856. chk_sum = (chk_sum >> 16) + chk_sum;
  21857. chk_sum = ~chk_sum;
  21858. iphdr->_chksum = chk_sum; /* network order */
  21859. #else /* CHECKSUM_GEN_IP_INLINE */
  21860. IPH_CHKSUM_SET(iphdr, 0);
  21861. 800e77e: 2300 movs r3, #0
  21862. 800e780: 72a3 strb r3, [r4, #10]
  21863. 800e782: 72e3 strb r3, [r4, #11]
  21864. 800e784: e004 b.n 800e790 <ip_output_if+0x90>
  21865. #endif
  21866. #endif /* CHECKSUM_GEN_IP_INLINE */
  21867. } else {
  21868. /* IP header already included in p */
  21869. iphdr = (struct ip_hdr *)p->payload;
  21870. ip_addr_copy(dest_addr, iphdr->dest);
  21871. 800e786: 6843 ldr r3, [r0, #4]
  21872. 800e788: ad02 add r5, sp, #8
  21873. 800e78a: 691b ldr r3, [r3, #16]
  21874. 800e78c: f845 3d04 str.w r3, [r5, #-4]!
  21875. dest = &dest_addr;
  21876. }
  21877. IP_STATS_INC(ip.xmit);
  21878. 800e790: 4b0c ldr r3, [pc, #48] ; (800e7c4 <ip_output_if+0xc4>)
  21879. 800e792: f8b3 2048 ldrh.w r2, [r3, #72] ; 0x48
  21880. 800e796: 3201 adds r2, #1
  21881. 800e798: f8a3 2048 strh.w r2, [r3, #72] ; 0x48
  21882. }
  21883. #endif /* LWIP_IGMP */
  21884. #endif /* ENABLE_LOOPBACK */
  21885. #if IP_FRAG
  21886. /* don't fragment if interface has mtu set to 0 [loopif] */
  21887. if (netif->mtu && (p->tot_len > netif->mtu)) {
  21888. 800e79c: 8cbb ldrh r3, [r7, #36] ; 0x24
  21889. 800e79e: b143 cbz r3, 800e7b2 <ip_output_if+0xb2>
  21890. 800e7a0: 8932 ldrh r2, [r6, #8]
  21891. 800e7a2: 429a cmp r2, r3
  21892. 800e7a4: d905 bls.n 800e7b2 <ip_output_if+0xb2>
  21893. return ip_frag(p, netif, dest);
  21894. 800e7a6: 4630 mov r0, r6
  21895. 800e7a8: 4639 mov r1, r7
  21896. 800e7aa: 462a mov r2, r5
  21897. 800e7ac: f000 fa20 bl 800ebf0 <ip_frag>
  21898. 800e7b0: e004 b.n 800e7bc <ip_output_if+0xbc>
  21899. }
  21900. #endif /* IP_FRAG */
  21901. LWIP_DEBUGF(IP_DEBUG, ("netif->output()"));
  21902. return netif->output(netif, p, dest);
  21903. 800e7b2: 697b ldr r3, [r7, #20]
  21904. 800e7b4: 4638 mov r0, r7
  21905. 800e7b6: 4631 mov r1, r6
  21906. 800e7b8: 462a mov r2, r5
  21907. 800e7ba: 4798 blx r3
  21908. }
  21909. 800e7bc: b240 sxtb r0, r0
  21910. 800e7be: e8bd 87fc ldmia.w sp!, {r2, r3, r4, r5, r6, r7, r8, r9, sl, pc}
  21911. 800e7c2: bf00 nop
  21912. 800e7c4: 20008220 .word 0x20008220
  21913. 800e7c8: 20006bb8 .word 0x20006bb8
  21914. 0800e7cc <ip_output>:
  21915. * see ip_output_if() for more return values
  21916. */
  21917. err_t
  21918. ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
  21919. u8_t ttl, u8_t tos, u8_t proto)
  21920. {
  21921. 800e7cc: b5f0 push {r4, r5, r6, r7, lr}
  21922. 800e7ce: 4605 mov r5, r0
  21923. 800e7d0: b085 sub sp, #20
  21924. /* pbufs passed to IP must have a ref-count of 1 as their payload pointer
  21925. gets altered as the packet is passed down the stack */
  21926. LWIP_ASSERT("p->ref == 1", p->ref == 1);
  21927. if ((netif = ip_route(dest)) == NULL) {
  21928. 800e7d2: 4610 mov r0, r2
  21929. * see ip_output_if() for more return values
  21930. */
  21931. err_t
  21932. ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
  21933. u8_t ttl, u8_t tos, u8_t proto)
  21934. {
  21935. 800e7d4: 460f mov r7, r1
  21936. 800e7d6: 4614 mov r4, r2
  21937. 800e7d8: 461e mov r6, r3
  21938. /* pbufs passed to IP must have a ref-count of 1 as their payload pointer
  21939. gets altered as the packet is passed down the stack */
  21940. LWIP_ASSERT("p->ref == 1", p->ref == 1);
  21941. if ((netif = ip_route(dest)) == NULL) {
  21942. 800e7da: f7ff fe73 bl 800e4c4 <ip_route>
  21943. 800e7de: b938 cbnz r0, 800e7f0 <ip_output+0x24>
  21944. LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
  21945. ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
  21946. IP_STATS_INC(ip.rterr);
  21947. 800e7e0: 4b0b ldr r3, [pc, #44] ; (800e810 <ip_output+0x44>)
  21948. 800e7e2: f8b3 2056 ldrh.w r2, [r3, #86] ; 0x56
  21949. 800e7e6: 3201 adds r2, #1
  21950. 800e7e8: f8a3 2056 strh.w r2, [r3, #86] ; 0x56
  21951. return ERR_RTE;
  21952. 800e7ec: 20fc movs r0, #252 ; 0xfc
  21953. 800e7ee: e00c b.n 800e80a <ip_output+0x3e>
  21954. }
  21955. return ip_output_if(p, src, dest, ttl, tos, proto, netif);
  21956. 800e7f0: f89d 3028 ldrb.w r3, [sp, #40] ; 0x28
  21957. 800e7f4: 9002 str r0, [sp, #8]
  21958. 800e7f6: 9300 str r3, [sp, #0]
  21959. 800e7f8: f89d 302c ldrb.w r3, [sp, #44] ; 0x2c
  21960. 800e7fc: 4628 mov r0, r5
  21961. 800e7fe: 9301 str r3, [sp, #4]
  21962. 800e800: 4639 mov r1, r7
  21963. 800e802: 4622 mov r2, r4
  21964. 800e804: 4633 mov r3, r6
  21965. 800e806: f7ff ff7b bl 800e700 <ip_output_if>
  21966. }
  21967. 800e80a: b240 sxtb r0, r0
  21968. 800e80c: b005 add sp, #20
  21969. 800e80e: bdf0 pop {r4, r5, r6, r7, pc}
  21970. 800e810: 20008220 .word 0x20008220
  21971. 0800e814 <ipfrag_free_pbuf_custom>:
  21972. /** Free-callback function to free a 'struct pbuf_custom_ref', called by
  21973. * pbuf_free. */
  21974. static void
  21975. ipfrag_free_pbuf_custom(struct pbuf *p)
  21976. {
  21977. 800e814: b510 push {r4, lr}
  21978. 800e816: 4604 mov r4, r0
  21979. struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref*)p;
  21980. LWIP_ASSERT("pcr != NULL", pcr != NULL);
  21981. LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p);
  21982. if (pcr->original != NULL) {
  21983. 800e818: 6940 ldr r0, [r0, #20]
  21984. 800e81a: b108 cbz r0, 800e820 <ipfrag_free_pbuf_custom+0xc>
  21985. pbuf_free(pcr->original);
  21986. 800e81c: f7fc fe52 bl 800b4c4 <pbuf_free>
  21987. /** Free a struct pbuf_custom_ref */
  21988. static void
  21989. ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p)
  21990. {
  21991. LWIP_ASSERT("p != NULL", p != NULL);
  21992. memp_free(MEMP_FRAG_PBUF, p);
  21993. 800e820: 2006 movs r0, #6
  21994. 800e822: 4621 mov r1, r4
  21995. LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p);
  21996. if (pcr->original != NULL) {
  21997. pbuf_free(pcr->original);
  21998. }
  21999. ip_frag_free_pbuf_custom_ref(pcr);
  22000. }
  22001. 800e824: e8bd 4010 ldmia.w sp!, {r4, lr}
  22002. /** Free a struct pbuf_custom_ref */
  22003. static void
  22004. ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p)
  22005. {
  22006. LWIP_ASSERT("p != NULL", p != NULL);
  22007. memp_free(MEMP_FRAG_PBUF, p);
  22008. 800e828: f7fc bd54 b.w 800b2d4 <memp_free>
  22009. 0800e82c <ip_reass_free_complete_datagram>:
  22010. * @param prev the previous datagram in the linked list
  22011. * @return the number of pbufs freed
  22012. */
  22013. static int
  22014. ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
  22015. {
  22016. 800e82c: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  22017. LWIP_ASSERT("prev->next == ipr", prev->next == ipr);
  22018. }
  22019. snmp_inc_ipreasmfails();
  22020. #if LWIP_ICMP
  22021. iprh = (struct ip_reass_helper *)ipr->p->payload;
  22022. 800e830: 6846 ldr r6, [r0, #4]
  22023. * @param prev the previous datagram in the linked list
  22024. * @return the number of pbufs freed
  22025. */
  22026. static int
  22027. ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
  22028. {
  22029. 800e832: 4604 mov r4, r0
  22030. LWIP_ASSERT("prev->next == ipr", prev->next == ipr);
  22031. }
  22032. snmp_inc_ipreasmfails();
  22033. #if LWIP_ICMP
  22034. iprh = (struct ip_reass_helper *)ipr->p->payload;
  22035. 800e834: 6870 ldr r0, [r6, #4]
  22036. if (iprh->start == 0) {
  22037. 800e836: 8883 ldrh r3, [r0, #4]
  22038. * @param prev the previous datagram in the linked list
  22039. * @return the number of pbufs freed
  22040. */
  22041. static int
  22042. ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
  22043. {
  22044. 800e838: 460f mov r7, r1
  22045. }
  22046. snmp_inc_ipreasmfails();
  22047. #if LWIP_ICMP
  22048. iprh = (struct ip_reass_helper *)ipr->p->payload;
  22049. if (iprh->start == 0) {
  22050. 800e83a: b993 cbnz r3, 800e862 <ip_reass_free_complete_datagram+0x36>
  22051. /* The first fragment was received, send ICMP time exceeded. */
  22052. /* First, de-queue the first pbuf from r->p. */
  22053. p = ipr->p;
  22054. ipr->p = iprh->next_pbuf;
  22055. 800e83c: 6803 ldr r3, [r0, #0]
  22056. /* Then, copy the original header into it. */
  22057. SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
  22058. 800e83e: 2214 movs r2, #20
  22059. iprh = (struct ip_reass_helper *)ipr->p->payload;
  22060. if (iprh->start == 0) {
  22061. /* The first fragment was received, send ICMP time exceeded. */
  22062. /* First, de-queue the first pbuf from r->p. */
  22063. p = ipr->p;
  22064. ipr->p = iprh->next_pbuf;
  22065. 800e840: 6063 str r3, [r4, #4]
  22066. /* Then, copy the original header into it. */
  22067. SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
  22068. 800e842: f104 0108 add.w r1, r4, #8
  22069. 800e846: f7fa fddd bl 8009404 <memcpy>
  22070. icmp_time_exceeded(p, ICMP_TE_FRAG);
  22071. 800e84a: 4630 mov r0, r6
  22072. 800e84c: 2101 movs r1, #1
  22073. 800e84e: f7ff fd3f bl 800e2d0 <icmp_time_exceeded>
  22074. clen = pbuf_clen(p);
  22075. 800e852: 4630 mov r0, r6
  22076. 800e854: f7fc ff0e bl 800b674 <pbuf_clen>
  22077. 800e858: 4605 mov r5, r0
  22078. LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff);
  22079. pbufs_freed += clen;
  22080. pbuf_free(p);
  22081. 800e85a: 4630 mov r0, r6
  22082. 800e85c: f7fc fe32 bl 800b4c4 <pbuf_free>
  22083. 800e860: e000 b.n 800e864 <ip_reass_free_complete_datagram+0x38>
  22084. * @return the number of pbufs freed
  22085. */
  22086. static int
  22087. ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
  22088. {
  22089. u16_t pbufs_freed = 0;
  22090. 800e862: 2500 movs r5, #0
  22091. }
  22092. #endif /* LWIP_ICMP */
  22093. /* First, free all received pbufs. The individual pbufs need to be released
  22094. separately as they have not yet been chained */
  22095. p = ipr->p;
  22096. 800e864: 6866 ldr r6, [r4, #4]
  22097. while (p != NULL) {
  22098. 800e866: e00b b.n 800e880 <ip_reass_free_complete_datagram+0x54>
  22099. struct pbuf *pcur;
  22100. iprh = (struct ip_reass_helper *)p->payload;
  22101. 800e868: 6873 ldr r3, [r6, #4]
  22102. pcur = p;
  22103. /* get the next pointer before freeing */
  22104. p = iprh->next_pbuf;
  22105. clen = pbuf_clen(pcur);
  22106. 800e86a: 4630 mov r0, r6
  22107. while (p != NULL) {
  22108. struct pbuf *pcur;
  22109. iprh = (struct ip_reass_helper *)p->payload;
  22110. pcur = p;
  22111. /* get the next pointer before freeing */
  22112. p = iprh->next_pbuf;
  22113. 800e86c: f8d3 8000 ldr.w r8, [r3]
  22114. clen = pbuf_clen(pcur);
  22115. 800e870: f7fc ff00 bl 800b674 <pbuf_clen>
  22116. LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff);
  22117. pbufs_freed += clen;
  22118. 800e874: 1940 adds r0, r0, r5
  22119. 800e876: b285 uxth r5, r0
  22120. pbuf_free(pcur);
  22121. 800e878: 4630 mov r0, r6
  22122. 800e87a: f7fc fe23 bl 800b4c4 <pbuf_free>
  22123. while (p != NULL) {
  22124. struct pbuf *pcur;
  22125. iprh = (struct ip_reass_helper *)p->payload;
  22126. pcur = p;
  22127. /* get the next pointer before freeing */
  22128. p = iprh->next_pbuf;
  22129. 800e87e: 4646 mov r6, r8
  22130. #endif /* LWIP_ICMP */
  22131. /* First, free all received pbufs. The individual pbufs need to be released
  22132. separately as they have not yet been chained */
  22133. p = ipr->p;
  22134. while (p != NULL) {
  22135. 800e880: 2e00 cmp r6, #0
  22136. 800e882: d1f1 bne.n 800e868 <ip_reass_free_complete_datagram+0x3c>
  22137. static void
  22138. ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
  22139. {
  22140. /* dequeue the reass struct */
  22141. if (reassdatagrams == ipr) {
  22142. 800e884: 4b09 ldr r3, [pc, #36] ; (800e8ac <ip_reass_free_complete_datagram+0x80>)
  22143. 800e886: 681a ldr r2, [r3, #0]
  22144. 800e888: 42a2 cmp r2, r4
  22145. /* it was the first in the list */
  22146. reassdatagrams = ipr->next;
  22147. 800e88a: bf0b itete eq
  22148. 800e88c: 6822 ldreq r2, [r4, #0]
  22149. } else {
  22150. /* it wasn't the first, so it must have a valid 'prev' */
  22151. LWIP_ASSERT("sanity check linked list", prev != NULL);
  22152. prev->next = ipr->next;
  22153. 800e88e: 6823 ldrne r3, [r4, #0]
  22154. {
  22155. /* dequeue the reass struct */
  22156. if (reassdatagrams == ipr) {
  22157. /* it was the first in the list */
  22158. reassdatagrams = ipr->next;
  22159. 800e890: 601a streq r2, [r3, #0]
  22160. } else {
  22161. /* it wasn't the first, so it must have a valid 'prev' */
  22162. LWIP_ASSERT("sanity check linked list", prev != NULL);
  22163. prev->next = ipr->next;
  22164. 800e892: 603b strne r3, [r7, #0]
  22165. }
  22166. /* now we can free the ip_reass struct */
  22167. memp_free(MEMP_REASSDATA, ipr);
  22168. 800e894: 4621 mov r1, r4
  22169. 800e896: 2005 movs r0, #5
  22170. 800e898: f7fc fd1c bl 800b2d4 <memp_free>
  22171. pbuf_free(pcur);
  22172. }
  22173. /* Then, unchain the struct ip_reassdata from the list and free it. */
  22174. ip_reass_dequeue_datagram(ipr, prev);
  22175. LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= pbufs_freed);
  22176. ip_reass_pbufcount -= pbufs_freed;
  22177. 800e89c: 4b04 ldr r3, [pc, #16] ; (800e8b0 <ip_reass_free_complete_datagram+0x84>)
  22178. 800e89e: 881a ldrh r2, [r3, #0]
  22179. 800e8a0: 1b52 subs r2, r2, r5
  22180. 800e8a2: 801a strh r2, [r3, #0]
  22181. return pbufs_freed;
  22182. }
  22183. 800e8a4: 4628 mov r0, r5
  22184. 800e8a6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  22185. 800e8aa: bf00 nop
  22186. 800e8ac: 20006bbc .word 0x20006bbc
  22187. 800e8b0: 20006bc0 .word 0x20006bc0
  22188. 0800e8b4 <ip_reass_remove_oldest_datagram>:
  22189. * (used for freeing other datagrams if not enough space)
  22190. * @return the number of pbufs freed
  22191. */
  22192. static int
  22193. ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
  22194. {
  22195. 800e8b4: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  22196. * but don't free the datagram that 'fraghdr' belongs to! */
  22197. do {
  22198. oldest = NULL;
  22199. prev = NULL;
  22200. other_datagrams = 0;
  22201. r = reassdatagrams;
  22202. 800e8b8: 4f1a ldr r7, [pc, #104] ; (800e924 <ip_reass_remove_oldest_datagram+0x70>)
  22203. * (used for freeing other datagrams if not enough space)
  22204. * @return the number of pbufs freed
  22205. */
  22206. static int
  22207. ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
  22208. {
  22209. 800e8ba: 4606 mov r6, r0
  22210. 800e8bc: 4688 mov r8, r1
  22211. /* @todo Can't we simply remove the last datagram in the
  22212. * linked list behind reassdatagrams?
  22213. */
  22214. struct ip_reassdata *r, *oldest, *prev;
  22215. int pbufs_freed = 0, pbufs_freed_current;
  22216. 800e8be: 2500 movs r5, #0
  22217. /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
  22218. * but don't free the datagram that 'fraghdr' belongs to! */
  22219. do {
  22220. oldest = NULL;
  22221. prev = NULL;
  22222. other_datagrams = 0;
  22223. 800e8c0: 2400 movs r4, #0
  22224. r = reassdatagrams;
  22225. 800e8c2: 683b ldr r3, [r7, #0]
  22226. /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
  22227. * but don't free the datagram that 'fraghdr' belongs to! */
  22228. do {
  22229. oldest = NULL;
  22230. prev = NULL;
  22231. 800e8c4: 4621 mov r1, r4
  22232. int other_datagrams;
  22233. /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
  22234. * but don't free the datagram that 'fraghdr' belongs to! */
  22235. do {
  22236. oldest = NULL;
  22237. 800e8c6: 4622 mov r2, r4
  22238. prev = NULL;
  22239. other_datagrams = 0;
  22240. r = reassdatagrams;
  22241. while (r != NULL) {
  22242. 800e8c8: e01d b.n 800e906 <ip_reass_remove_oldest_datagram+0x52>
  22243. if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
  22244. 800e8ca: f8d6 c00c ldr.w ip, [r6, #12]
  22245. 800e8ce: 6958 ldr r0, [r3, #20]
  22246. 800e8d0: 4560 cmp r0, ip
  22247. 800e8d2: d109 bne.n 800e8e8 <ip_reass_remove_oldest_datagram+0x34>
  22248. 800e8d4: f8d6 c010 ldr.w ip, [r6, #16]
  22249. 800e8d8: 6998 ldr r0, [r3, #24]
  22250. 800e8da: 4560 cmp r0, ip
  22251. 800e8dc: d104 bne.n 800e8e8 <ip_reass_remove_oldest_datagram+0x34>
  22252. 800e8de: f8b3 c00c ldrh.w ip, [r3, #12]
  22253. 800e8e2: 88b0 ldrh r0, [r6, #4]
  22254. 800e8e4: 4584 cmp ip, r0
  22255. 800e8e6: d009 beq.n 800e8fc <ip_reass_remove_oldest_datagram+0x48>
  22256. /* Not the same datagram as fraghdr */
  22257. other_datagrams++;
  22258. 800e8e8: 3401 adds r4, #1
  22259. if (oldest == NULL) {
  22260. 800e8ea: b132 cbz r2, 800e8fa <ip_reass_remove_oldest_datagram+0x46>
  22261. oldest = r;
  22262. } else if (r->timer <= oldest->timer) {
  22263. 800e8ec: f893 c01f ldrb.w ip, [r3, #31]
  22264. 800e8f0: 7fd0 ldrb r0, [r2, #31]
  22265. 800e8f2: 4584 cmp ip, r0
  22266. 800e8f4: bf98 it ls
  22267. 800e8f6: 461a movls r2, r3
  22268. 800e8f8: e000 b.n 800e8fc <ip_reass_remove_oldest_datagram+0x48>
  22269. r = reassdatagrams;
  22270. while (r != NULL) {
  22271. if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
  22272. /* Not the same datagram as fraghdr */
  22273. other_datagrams++;
  22274. if (oldest == NULL) {
  22275. 800e8fa: 461a mov r2, r3
  22276. } else if (r->timer <= oldest->timer) {
  22277. /* older than the previous oldest */
  22278. oldest = r;
  22279. }
  22280. }
  22281. if (r->next != NULL) {
  22282. 800e8fc: 6818 ldr r0, [r3, #0]
  22283. 800e8fe: 2800 cmp r0, #0
  22284. 800e900: bf18 it ne
  22285. 800e902: 4619 movne r1, r3
  22286. 800e904: 4603 mov r3, r0
  22287. do {
  22288. oldest = NULL;
  22289. prev = NULL;
  22290. other_datagrams = 0;
  22291. r = reassdatagrams;
  22292. while (r != NULL) {
  22293. 800e906: 2b00 cmp r3, #0
  22294. 800e908: d1df bne.n 800e8ca <ip_reass_remove_oldest_datagram+0x16>
  22295. if (r->next != NULL) {
  22296. prev = r;
  22297. }
  22298. r = r->next;
  22299. }
  22300. if (oldest != NULL) {
  22301. 800e90a: b11a cbz r2, 800e914 <ip_reass_remove_oldest_datagram+0x60>
  22302. pbufs_freed_current = ip_reass_free_complete_datagram(oldest, prev);
  22303. 800e90c: 4610 mov r0, r2
  22304. 800e90e: f7ff ff8d bl 800e82c <ip_reass_free_complete_datagram>
  22305. pbufs_freed += pbufs_freed_current;
  22306. 800e912: 182d adds r5, r5, r0
  22307. }
  22308. } while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1));
  22309. 800e914: 4545 cmp r5, r8
  22310. 800e916: da01 bge.n 800e91c <ip_reass_remove_oldest_datagram+0x68>
  22311. 800e918: 2c01 cmp r4, #1
  22312. 800e91a: dcd1 bgt.n 800e8c0 <ip_reass_remove_oldest_datagram+0xc>
  22313. return pbufs_freed;
  22314. }
  22315. 800e91c: 4628 mov r0, r5
  22316. 800e91e: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  22317. 800e922: bf00 nop
  22318. 800e924: 20006bbc .word 0x20006bbc
  22319. 0800e928 <ip_reass_tmr>:
  22320. *
  22321. * Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
  22322. */
  22323. void
  22324. ip_reass_tmr(void)
  22325. {
  22326. 800e928: b538 push {r3, r4, r5, lr}
  22327. struct ip_reassdata *r, *prev = NULL;
  22328. r = reassdatagrams;
  22329. 800e92a: 4b09 ldr r3, [pc, #36] ; (800e950 <ip_reass_tmr+0x28>)
  22330. * Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
  22331. */
  22332. void
  22333. ip_reass_tmr(void)
  22334. {
  22335. struct ip_reassdata *r, *prev = NULL;
  22336. 800e92c: 2400 movs r4, #0
  22337. r = reassdatagrams;
  22338. 800e92e: 6818 ldr r0, [r3, #0]
  22339. while (r != NULL) {
  22340. 800e930: e00a b.n 800e948 <ip_reass_tmr+0x20>
  22341. /* Decrement the timer. Once it reaches 0,
  22342. * clean up the incomplete fragment assembly */
  22343. if (r->timer > 0) {
  22344. 800e932: 7fc3 ldrb r3, [r0, #31]
  22345. 800e934: 6805 ldr r5, [r0, #0]
  22346. 800e936: b11b cbz r3, 800e940 <ip_reass_tmr+0x18>
  22347. r->timer--;
  22348. 800e938: 3b01 subs r3, #1
  22349. 800e93a: 77c3 strb r3, [r0, #31]
  22350. LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer dec %"U16_F"\n",(u16_t)r->timer));
  22351. prev = r;
  22352. r = r->next;
  22353. 800e93c: 4604 mov r4, r0
  22354. 800e93e: e002 b.n 800e946 <ip_reass_tmr+0x1e>
  22355. LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n"));
  22356. tmp = r;
  22357. /* get the next pointer before freeing */
  22358. r = r->next;
  22359. /* free the helper struct and all enqueued pbufs */
  22360. ip_reass_free_complete_datagram(tmp, prev);
  22361. 800e940: 4621 mov r1, r4
  22362. 800e942: f7ff ff73 bl 800e82c <ip_reass_free_complete_datagram>
  22363. /* reassembly timed out */
  22364. struct ip_reassdata *tmp;
  22365. LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n"));
  22366. tmp = r;
  22367. /* get the next pointer before freeing */
  22368. r = r->next;
  22369. 800e946: 4628 mov r0, r5
  22370. ip_reass_tmr(void)
  22371. {
  22372. struct ip_reassdata *r, *prev = NULL;
  22373. r = reassdatagrams;
  22374. while (r != NULL) {
  22375. 800e948: 2800 cmp r0, #0
  22376. 800e94a: d1f2 bne.n 800e932 <ip_reass_tmr+0xa>
  22377. r = r->next;
  22378. /* free the helper struct and all enqueued pbufs */
  22379. ip_reass_free_complete_datagram(tmp, prev);
  22380. }
  22381. }
  22382. }
  22383. 800e94c: bd38 pop {r3, r4, r5, pc}
  22384. 800e94e: bf00 nop
  22385. 800e950: 20006bbc .word 0x20006bbc
  22386. 0800e954 <ip_reass>:
  22387. * @param p points to a pbuf chain of the fragment
  22388. * @return NULL if reassembly is incomplete, ? otherwise
  22389. */
  22390. struct pbuf *
  22391. ip_reass(struct pbuf *p)
  22392. {
  22393. 800e954: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  22394. struct ip_reass_helper *iprh;
  22395. u16_t offset, len;
  22396. u8_t clen;
  22397. struct ip_reassdata *ipr_prev = NULL;
  22398. IPFRAG_STATS_INC(ip_frag.recv);
  22399. 800e958: 4ba2 ldr r3, [pc, #648] ; (800ebe4 <ip_reass+0x290>)
  22400. snmp_inc_ipreasmreqds();
  22401. fraghdr = (struct ip_hdr*)p->payload;
  22402. 800e95a: 6845 ldr r5, [r0, #4]
  22403. struct ip_reass_helper *iprh;
  22404. u16_t offset, len;
  22405. u8_t clen;
  22406. struct ip_reassdata *ipr_prev = NULL;
  22407. IPFRAG_STATS_INC(ip_frag.recv);
  22408. 800e95c: 8e5a ldrh r2, [r3, #50] ; 0x32
  22409. 800e95e: 3201 adds r2, #1
  22410. 800e960: 865a strh r2, [r3, #50] ; 0x32
  22411. snmp_inc_ipreasmreqds();
  22412. fraghdr = (struct ip_hdr*)p->payload;
  22413. if ((IPH_HL(fraghdr) * 4) != IP_HLEN) {
  22414. 800e962: 782a ldrb r2, [r5, #0]
  22415. 800e964: f002 020f and.w r2, r2, #15
  22416. 800e968: 2a05 cmp r2, #5
  22417. * @param p points to a pbuf chain of the fragment
  22418. * @return NULL if reassembly is incomplete, ? otherwise
  22419. */
  22420. struct pbuf *
  22421. ip_reass(struct pbuf *p)
  22422. {
  22423. 800e96a: 4606 mov r6, r0
  22424. IPFRAG_STATS_INC(ip_frag.recv);
  22425. snmp_inc_ipreasmreqds();
  22426. fraghdr = (struct ip_hdr*)p->payload;
  22427. if ((IPH_HL(fraghdr) * 4) != IP_HLEN) {
  22428. 800e96c: d005 beq.n 800e97a <ip_reass+0x26>
  22429. LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: IP options currently not supported!\n"));
  22430. IPFRAG_STATS_INC(ip_frag.err);
  22431. 800e96e: f8b3 2044 ldrh.w r2, [r3, #68] ; 0x44
  22432. 800e972: 3201 adds r2, #1
  22433. 800e974: f8a3 2044 strh.w r2, [r3, #68] ; 0x44
  22434. goto nullreturn;
  22435. 800e978: e11d b.n 800ebb6 <ip_reass+0x262>
  22436. }
  22437. offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  22438. 800e97a: 88e8 ldrh r0, [r5, #6]
  22439. len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  22440. /* Check if we are allowed to enqueue more datagrams. */
  22441. clen = pbuf_clen(p);
  22442. if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
  22443. 800e97c: 4c9a ldr r4, [pc, #616] ; (800ebe8 <ip_reass+0x294>)
  22444. LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: IP options currently not supported!\n"));
  22445. IPFRAG_STATS_INC(ip_frag.err);
  22446. goto nullreturn;
  22447. }
  22448. offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  22449. 800e97e: f7fb fc39 bl 800a1f4 <lwip_ntohs>
  22450. 800e982: 4681 mov r9, r0
  22451. len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  22452. 800e984: 8868 ldrh r0, [r5, #2]
  22453. 800e986: f7fb fc35 bl 800a1f4 <lwip_ntohs>
  22454. 800e98a: 4682 mov sl, r0
  22455. /* Check if we are allowed to enqueue more datagrams. */
  22456. clen = pbuf_clen(p);
  22457. 800e98c: 4630 mov r0, r6
  22458. IPFRAG_STATS_INC(ip_frag.err);
  22459. goto nullreturn;
  22460. }
  22461. offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  22462. len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  22463. 800e98e: f895 b000 ldrb.w fp, [r5]
  22464. /* Check if we are allowed to enqueue more datagrams. */
  22465. clen = pbuf_clen(p);
  22466. 800e992: f7fc fe6f bl 800b674 <pbuf_clen>
  22467. if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
  22468. 800e996: 8823 ldrh r3, [r4, #0]
  22469. 800e998: 181b adds r3, r3, r0
  22470. 800e99a: 2b0a cmp r3, #10
  22471. offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  22472. len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  22473. /* Check if we are allowed to enqueue more datagrams. */
  22474. clen = pbuf_clen(p);
  22475. 800e99c: 4680 mov r8, r0
  22476. if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
  22477. 800e99e: dd09 ble.n 800e9b4 <ip_reass+0x60>
  22478. #if IP_REASS_FREE_OLDEST
  22479. if (!ip_reass_remove_oldest_datagram(fraghdr, clen) ||
  22480. 800e9a0: 4628 mov r0, r5
  22481. 800e9a2: 4641 mov r1, r8
  22482. 800e9a4: f7ff ff86 bl 800e8b4 <ip_reass_remove_oldest_datagram>
  22483. 800e9a8: b358 cbz r0, 800ea02 <ip_reass+0xae>
  22484. ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS))
  22485. 800e9aa: 8823 ldrh r3, [r4, #0]
  22486. 800e9ac: 4443 add r3, r8
  22487. /* Check if we are allowed to enqueue more datagrams. */
  22488. clen = pbuf_clen(p);
  22489. if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
  22490. #if IP_REASS_FREE_OLDEST
  22491. if (!ip_reass_remove_oldest_datagram(fraghdr, clen) ||
  22492. 800e9ae: 2b0a cmp r3, #10
  22493. 800e9b0: dd00 ble.n 800e9b4 <ip_reass+0x60>
  22494. 800e9b2: e026 b.n 800ea02 <ip_reass+0xae>
  22495. }
  22496. }
  22497. /* Look for the datagram the fragment belongs to in the current datagram queue,
  22498. * remembering the previous in the queue for later dequeueing. */
  22499. for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
  22500. 800e9b4: 4b8d ldr r3, [pc, #564] ; (800ebec <ip_reass+0x298>)
  22501. struct ip_hdr *fraghdr;
  22502. struct ip_reassdata *ipr;
  22503. struct ip_reass_helper *iprh;
  22504. u16_t offset, len;
  22505. u8_t clen;
  22506. struct ip_reassdata *ipr_prev = NULL;
  22507. 800e9b6: 2700 movs r7, #0
  22508. }
  22509. }
  22510. /* Look for the datagram the fragment belongs to in the current datagram queue,
  22511. * remembering the previous in the queue for later dequeueing. */
  22512. for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
  22513. 800e9b8: 681c ldr r4, [r3, #0]
  22514. 800e9ba: e019 b.n 800e9f0 <ip_reass+0x9c>
  22515. /* Check if the incoming fragment matches the one currently present
  22516. in the reassembly buffer. If so, we proceed with copying the
  22517. fragment into the buffer. */
  22518. if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) {
  22519. 800e9bc: 68ea ldr r2, [r5, #12]
  22520. 800e9be: 6963 ldr r3, [r4, #20]
  22521. 800e9c0: 4293 cmp r3, r2
  22522. 800e9c2: d113 bne.n 800e9ec <ip_reass+0x98>
  22523. 800e9c4: 692a ldr r2, [r5, #16]
  22524. 800e9c6: 69a3 ldr r3, [r4, #24]
  22525. 800e9c8: 4293 cmp r3, r2
  22526. 800e9ca: d10f bne.n 800e9ec <ip_reass+0x98>
  22527. 800e9cc: 89a2 ldrh r2, [r4, #12]
  22528. 800e9ce: 88ab ldrh r3, [r5, #4]
  22529. 800e9d0: 429a cmp r2, r3
  22530. 800e9d2: d10b bne.n 800e9ec <ip_reass+0x98>
  22531. LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass: matching previous fragment ID=%"X16_F"\n",
  22532. ntohs(IPH_ID(fraghdr))));
  22533. IPFRAG_STATS_INC(ip_frag.cachehit);
  22534. 800e9d4: 4b83 ldr r3, [pc, #524] ; (800ebe4 <ip_reass+0x290>)
  22535. 800e9d6: f8b3 2046 ldrh.w r2, [r3, #70] ; 0x46
  22536. 800e9da: 3201 adds r2, #1
  22537. 800e9dc: f8a3 2046 strh.w r2, [r3, #70] ; 0x46
  22538. /* Bail if unable to enqueue */
  22539. if(ipr == NULL) {
  22540. goto nullreturn;
  22541. }
  22542. } else {
  22543. if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) &&
  22544. 800e9e0: 88e8 ldrh r0, [r5, #6]
  22545. 800e9e2: f7fb fc07 bl 800a1f4 <lwip_ntohs>
  22546. 800e9e6: 04c0 lsls r0, r0, #19
  22547. 800e9e8: d12d bne.n 800ea46 <ip_reass+0xf2>
  22548. 800e9ea: e021 b.n 800ea30 <ip_reass+0xdc>
  22549. 800e9ec: 4627 mov r7, r4
  22550. }
  22551. }
  22552. /* Look for the datagram the fragment belongs to in the current datagram queue,
  22553. * remembering the previous in the queue for later dequeueing. */
  22554. for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
  22555. 800e9ee: 6824 ldr r4, [r4, #0]
  22556. 800e9f0: 2c00 cmp r4, #0
  22557. 800e9f2: d1e3 bne.n 800e9bc <ip_reass+0x68>
  22558. 800e9f4: e0e7 b.n 800ebc6 <ip_reass+0x272>
  22559. struct ip_reassdata* ipr;
  22560. /* No matching previous fragment found, allocate a new reassdata struct */
  22561. ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
  22562. if (ipr == NULL) {
  22563. #if IP_REASS_FREE_OLDEST
  22564. if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) {
  22565. 800e9f6: 4628 mov r0, r5
  22566. 800e9f8: 4641 mov r1, r8
  22567. 800e9fa: f7ff ff5b bl 800e8b4 <ip_reass_remove_oldest_datagram>
  22568. 800e9fe: 4540 cmp r0, r8
  22569. 800ea00: da04 bge.n 800ea0c <ip_reass+0xb8>
  22570. ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
  22571. }
  22572. if (ipr == NULL)
  22573. #endif /* IP_REASS_FREE_OLDEST */
  22574. {
  22575. IPFRAG_STATS_INC(ip_frag.memerr);
  22576. 800ea02: 4b78 ldr r3, [pc, #480] ; (800ebe4 <ip_reass+0x290>)
  22577. 800ea04: 8f9a ldrh r2, [r3, #60] ; 0x3c
  22578. 800ea06: 3201 adds r2, #1
  22579. 800ea08: 879a strh r2, [r3, #60] ; 0x3c
  22580. 800ea0a: e0d4 b.n 800ebb6 <ip_reass+0x262>
  22581. /* No matching previous fragment found, allocate a new reassdata struct */
  22582. ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
  22583. if (ipr == NULL) {
  22584. #if IP_REASS_FREE_OLDEST
  22585. if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) {
  22586. ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
  22587. 800ea0c: 2005 movs r0, #5
  22588. 800ea0e: f7fc fc37 bl 800b280 <memp_malloc>
  22589. }
  22590. if (ipr == NULL)
  22591. 800ea12: 4604 mov r4, r0
  22592. 800ea14: 2800 cmp r0, #0
  22593. 800ea16: d0f4 beq.n 800ea02 <ip_reass+0xae>
  22594. IPFRAG_STATS_INC(ip_frag.memerr);
  22595. LWIP_DEBUGF(IP_REASS_DEBUG,("Failed to alloc reassdata struct\n"));
  22596. return NULL;
  22597. }
  22598. }
  22599. memset(ipr, 0, sizeof(struct ip_reassdata));
  22600. 800ea18: 2220 movs r2, #32
  22601. 800ea1a: 4620 mov r0, r4
  22602. 800ea1c: 2100 movs r1, #0
  22603. 800ea1e: f7fa fdab bl 8009578 <memset>
  22604. ipr->timer = IP_REASS_MAXAGE;
  22605. 800ea22: 2303 movs r3, #3
  22606. 800ea24: 77e3 strb r3, [r4, #31]
  22607. /* enqueue the new structure to the front of the list */
  22608. ipr->next = reassdatagrams;
  22609. 800ea26: 4b71 ldr r3, [pc, #452] ; (800ebec <ip_reass+0x298>)
  22610. 800ea28: 681a ldr r2, [r3, #0]
  22611. reassdatagrams = ipr;
  22612. 800ea2a: 601c str r4, [r3, #0]
  22613. }
  22614. memset(ipr, 0, sizeof(struct ip_reassdata));
  22615. ipr->timer = IP_REASS_MAXAGE;
  22616. /* enqueue the new structure to the front of the list */
  22617. ipr->next = reassdatagrams;
  22618. 800ea2c: 6022 str r2, [r4, #0]
  22619. 800ea2e: e004 b.n 800ea3a <ip_reass+0xe6>
  22620. if(ipr == NULL) {
  22621. goto nullreturn;
  22622. }
  22623. } else {
  22624. if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) &&
  22625. ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
  22626. 800ea30: 89e0 ldrh r0, [r4, #14]
  22627. 800ea32: f7fb fbdf bl 800a1f4 <lwip_ntohs>
  22628. /* Bail if unable to enqueue */
  22629. if(ipr == NULL) {
  22630. goto nullreturn;
  22631. }
  22632. } else {
  22633. if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) &&
  22634. 800ea36: 04c0 lsls r0, r0, #19
  22635. 800ea38: d005 beq.n 800ea46 <ip_reass+0xf2>
  22636. ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
  22637. /* ipr->iphdr is not the header from the first fragment, but fraghdr is
  22638. * -> copy fraghdr into ipr->iphdr since we want to have the header
  22639. * of the first fragment (for ICMP time exceeded and later, for copying
  22640. * all options, if supported)*/
  22641. SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN);
  22642. 800ea3a: f104 0008 add.w r0, r4, #8
  22643. 800ea3e: 4629 mov r1, r5
  22644. 800ea40: 2214 movs r2, #20
  22645. 800ea42: f7fa fcdf bl 8009404 <memcpy>
  22646. }
  22647. }
  22648. /* Track the current number of pbufs current 'in-flight', in order to limit
  22649. the number of fragments that may be enqueued at any one time */
  22650. ip_reass_pbufcount += clen;
  22651. 800ea46: 4b68 ldr r3, [pc, #416] ; (800ebe8 <ip_reass+0x294>)
  22652. 800ea48: 881a ldrh r2, [r3, #0]
  22653. 800ea4a: 4490 add r8, r2
  22654. 800ea4c: f8a3 8000 strh.w r8, [r3]
  22655. /* At this point, we have either created a new entry or pointing
  22656. * to an existing one */
  22657. /* check for 'no more fragments', and update queue entry*/
  22658. if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) {
  22659. 800ea50: 88eb ldrh r3, [r5, #6]
  22660. 800ea52: f003 0320 and.w r3, r3, #32
  22661. 800ea56: b29b uxth r3, r3
  22662. 800ea58: b95b cbnz r3, 800ea72 <ip_reass+0x11e>
  22663. ipr->flags |= IP_REASS_FLAG_LASTFRAG;
  22664. 800ea5a: 7fa3 ldrb r3, [r4, #30]
  22665. IPFRAG_STATS_INC(ip_frag.err);
  22666. goto nullreturn;
  22667. }
  22668. offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  22669. len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  22670. 800ea5c: f00b 0b0f and.w fp, fp, #15
  22671. 800ea60: ebaa 0a8b sub.w sl, sl, fp, lsl #2
  22672. /* At this point, we have either created a new entry or pointing
  22673. * to an existing one */
  22674. /* check for 'no more fragments', and update queue entry*/
  22675. if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) {
  22676. ipr->flags |= IP_REASS_FLAG_LASTFRAG;
  22677. 800ea64: f043 0301 orr.w r3, r3, #1
  22678. ipr->datagram_len = offset + len;
  22679. 800ea68: eb0a 09c9 add.w r9, sl, r9, lsl #3
  22680. /* At this point, we have either created a new entry or pointing
  22681. * to an existing one */
  22682. /* check for 'no more fragments', and update queue entry*/
  22683. if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) {
  22684. ipr->flags |= IP_REASS_FLAG_LASTFRAG;
  22685. 800ea6c: 77a3 strb r3, [r4, #30]
  22686. ipr->datagram_len = offset + len;
  22687. 800ea6e: f8a4 901c strh.w r9, [r4, #28]
  22688. u16_t offset,len;
  22689. struct ip_hdr *fraghdr;
  22690. int valid = 1;
  22691. /* Extract length and fragment offset from current fragment */
  22692. fraghdr = (struct ip_hdr*)new_p->payload;
  22693. 800ea72: 6875 ldr r5, [r6, #4]
  22694. len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
  22695. 800ea74: 8868 ldrh r0, [r5, #2]
  22696. 800ea76: f7fb fbbd bl 800a1f4 <lwip_ntohs>
  22697. 800ea7a: f895 9000 ldrb.w r9, [r5]
  22698. 800ea7e: f009 090f and.w r9, r9, #15
  22699. 800ea82: eba0 0089 sub.w r0, r0, r9, lsl #2
  22700. 800ea86: fa1f f980 uxth.w r9, r0
  22701. offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
  22702. 800ea8a: 88e8 ldrh r0, [r5, #6]
  22703. 800ea8c: f7fb fbb2 bl 800a1f4 <lwip_ntohs>
  22704. 800ea90: 04c0 lsls r0, r0, #19
  22705. 800ea92: 0c01 lsrs r1, r0, #16
  22706. /* overwrite the fragment's ip header from the pbuf with our helper struct,
  22707. * and setup the embedded helper structure. */
  22708. /* make sure the struct ip_reass_helper fits into the IP header */
  22709. LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
  22710. sizeof(struct ip_reass_helper) <= IP_HLEN);
  22711. iprh = (struct ip_reass_helper*)new_p->payload;
  22712. 800ea94: 6873 ldr r3, [r6, #4]
  22713. iprh->next_pbuf = NULL;
  22714. iprh->start = offset;
  22715. iprh->end = offset + len;
  22716. 800ea96: 4489 add r9, r1
  22717. * and setup the embedded helper structure. */
  22718. /* make sure the struct ip_reass_helper fits into the IP header */
  22719. LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
  22720. sizeof(struct ip_reass_helper) <= IP_HLEN);
  22721. iprh = (struct ip_reass_helper*)new_p->payload;
  22722. iprh->next_pbuf = NULL;
  22723. 800ea98: 2200 movs r2, #0
  22724. iprh->start = offset;
  22725. iprh->end = offset + len;
  22726. 800ea9a: fa1f f989 uxth.w r9, r9
  22727. * and setup the embedded helper structure. */
  22728. /* make sure the struct ip_reass_helper fits into the IP header */
  22729. LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
  22730. sizeof(struct ip_reass_helper) <= IP_HLEN);
  22731. iprh = (struct ip_reass_helper*)new_p->payload;
  22732. iprh->next_pbuf = NULL;
  22733. 800ea9e: 701a strb r2, [r3, #0]
  22734. 800eaa0: 705a strb r2, [r3, #1]
  22735. 800eaa2: 709a strb r2, [r3, #2]
  22736. 800eaa4: 70da strb r2, [r3, #3]
  22737. iprh->start = offset;
  22738. 800eaa6: 8099 strh r1, [r3, #4]
  22739. iprh->end = offset + len;
  22740. 800eaa8: f8a3 9006 strh.w r9, [r3, #6]
  22741. /* Iterate through until we either get to the end of the list (append),
  22742. * or we find on with a larger offset (insert). */
  22743. for (q = ipr->p; q != NULL;) {
  22744. 800eaac: 6865 ldr r5, [r4, #4]
  22745. {
  22746. struct ip_reass_helper *iprh, *iprh_tmp, *iprh_prev=NULL;
  22747. struct pbuf *q;
  22748. u16_t offset,len;
  22749. struct ip_hdr *fraghdr;
  22750. int valid = 1;
  22751. 800eaae: 2001 movs r0, #1
  22752. 800eab0: e01b b.n 800eaea <ip_reass+0x196>
  22753. iprh->end = offset + len;
  22754. /* Iterate through until we either get to the end of the list (append),
  22755. * or we find on with a larger offset (insert). */
  22756. for (q = ipr->p; q != NULL;) {
  22757. iprh_tmp = (struct ip_reass_helper*)q->payload;
  22758. 800eab2: f8d5 c004 ldr.w ip, [r5, #4]
  22759. if (iprh->start < iprh_tmp->start) {
  22760. 800eab6: f8bc 8004 ldrh.w r8, [ip, #4]
  22761. 800eaba: 4541 cmp r1, r8
  22762. 800eabc: d208 bcs.n 800ead0 <ip_reass+0x17c>
  22763. /* the new pbuf should be inserted before this */
  22764. iprh->next_pbuf = q;
  22765. 800eabe: 601d str r5, [r3, #0]
  22766. if (iprh_prev != NULL) {
  22767. 800eac0: b1e2 cbz r2, 800eafc <ip_reass+0x1a8>
  22768. /* not the fragment with the lowest offset */
  22769. #if IP_REASS_CHECK_OVERLAP
  22770. if ((iprh->start < iprh_prev->end) || (iprh->end > iprh_tmp->start)) {
  22771. 800eac2: 88d5 ldrh r5, [r2, #6]
  22772. 800eac4: 428d cmp r5, r1
  22773. 800eac6: d830 bhi.n 800eb2a <ip_reass+0x1d6>
  22774. 800eac8: 45c1 cmp r9, r8
  22775. 800eaca: d82e bhi.n 800eb2a <ip_reass+0x1d6>
  22776. /* fragment overlaps with previous or following, throw away */
  22777. goto freepbuf;
  22778. }
  22779. #endif /* IP_REASS_CHECK_OVERLAP */
  22780. iprh_prev->next_pbuf = new_p;
  22781. 800eacc: 6016 str r6, [r2, #0]
  22782. 800eace: e016 b.n 800eafe <ip_reass+0x1aa>
  22783. } else {
  22784. /* fragment with the lowest offset */
  22785. ipr->p = new_p;
  22786. }
  22787. break;
  22788. } else if(iprh->start == iprh_tmp->start) {
  22789. 800ead0: d02b beq.n 800eb2a <ip_reass+0x1d6>
  22790. /* received the same datagram twice: no need to keep the datagram */
  22791. goto freepbuf;
  22792. #if IP_REASS_CHECK_OVERLAP
  22793. } else if(iprh->start < iprh_tmp->end) {
  22794. 800ead2: f8bc 5006 ldrh.w r5, [ip, #6]
  22795. 800ead6: 428d cmp r5, r1
  22796. 800ead8: d827 bhi.n 800eb2a <ip_reass+0x1d6>
  22797. /* overlap: no need to keep the new datagram */
  22798. goto freepbuf;
  22799. #endif /* IP_REASS_CHECK_OVERLAP */
  22800. } else {
  22801. /* Check if the fragments received so far have no wholes. */
  22802. if (iprh_prev != NULL) {
  22803. 800eada: b11a cbz r2, 800eae4 <ip_reass+0x190>
  22804. if (iprh_prev->end != iprh_tmp->start) {
  22805. 800eadc: 88d2 ldrh r2, [r2, #6]
  22806. /* There is a fragment missing between the current
  22807. * and the previous fragment */
  22808. valid = 0;
  22809. 800eade: 4542 cmp r2, r8
  22810. 800eae0: bf18 it ne
  22811. 800eae2: 2000 movne r0, #0
  22812. }
  22813. }
  22814. }
  22815. q = iprh_tmp->next_pbuf;
  22816. 800eae4: f8dc 5000 ldr.w r5, [ip]
  22817. 800eae8: 4662 mov r2, ip
  22818. iprh->start = offset;
  22819. iprh->end = offset + len;
  22820. /* Iterate through until we either get to the end of the list (append),
  22821. * or we find on with a larger offset (insert). */
  22822. for (q = ipr->p; q != NULL;) {
  22823. 800eaea: 2d00 cmp r5, #0
  22824. 800eaec: d1e1 bne.n 800eab2 <ip_reass+0x15e>
  22825. 800eaee: e072 b.n 800ebd6 <ip_reass+0x282>
  22826. /* this is (for now), the fragment with the highest offset:
  22827. * chain it to the last fragment */
  22828. #if IP_REASS_CHECK_OVERLAP
  22829. LWIP_ASSERT("check fragments don't overlap", iprh_prev->end <= iprh->start);
  22830. #endif /* IP_REASS_CHECK_OVERLAP */
  22831. iprh_prev->next_pbuf = new_p;
  22832. 800eaf0: 6016 str r6, [r2, #0]
  22833. if (iprh_prev->end != iprh->start) {
  22834. 800eaf2: 88d2 ldrh r2, [r2, #6]
  22835. valid = 0;
  22836. 800eaf4: 428a cmp r2, r1
  22837. 800eaf6: bf18 it ne
  22838. 800eaf8: 2000 movne r0, #0
  22839. 800eafa: e000 b.n 800eafe <ip_reass+0x1aa>
  22840. #if IP_REASS_CHECK_OVERLAP
  22841. LWIP_ASSERT("no previous fragment, this must be the first fragment!",
  22842. ipr->p == NULL);
  22843. #endif /* IP_REASS_CHECK_OVERLAP */
  22844. /* this is the first fragment we ever received for this ip datagram */
  22845. ipr->p = new_p;
  22846. 800eafc: 6066 str r6, [r4, #4]
  22847. }
  22848. }
  22849. /* At this point, the validation part begins: */
  22850. /* If we already received the last fragment */
  22851. if ((ipr->flags & IP_REASS_FLAG_LASTFRAG) != 0) {
  22852. 800eafe: 7fa2 ldrb r2, [r4, #30]
  22853. 800eb00: 07d2 lsls r2, r2, #31
  22854. 800eb02: d56b bpl.n 800ebdc <ip_reass+0x288>
  22855. /* and had no wholes so far */
  22856. if (valid) {
  22857. 800eb04: 2800 cmp r0, #0
  22858. 800eb06: d069 beq.n 800ebdc <ip_reass+0x288>
  22859. /* then check if the rest of the fragments is here */
  22860. /* Check if the queue starts with the first datagram */
  22861. if (((struct ip_reass_helper*)ipr->p->payload)->start != 0) {
  22862. 800eb08: 6862 ldr r2, [r4, #4]
  22863. 800eb0a: 6855 ldr r5, [r2, #4]
  22864. 800eb0c: 88aa ldrh r2, [r5, #4]
  22865. 800eb0e: 2a00 cmp r2, #0
  22866. 800eb10: d164 bne.n 800ebdc <ip_reass+0x288>
  22867. valid = 0;
  22868. } else {
  22869. /* and check that there are no wholes after this datagram */
  22870. iprh_prev = iprh;
  22871. q = iprh->next_pbuf;
  22872. 800eb12: 681e ldr r6, [r3, #0]
  22873. 800eb14: e006 b.n 800eb24 <ip_reass+0x1d0>
  22874. while (q != NULL) {
  22875. iprh = (struct ip_reass_helper*)q->payload;
  22876. 800eb16: 6872 ldr r2, [r6, #4]
  22877. if (iprh_prev->end != iprh->start) {
  22878. 800eb18: 88d9 ldrh r1, [r3, #6]
  22879. 800eb1a: 8893 ldrh r3, [r2, #4]
  22880. 800eb1c: 4299 cmp r1, r3
  22881. 800eb1e: d15d bne.n 800ebdc <ip_reass+0x288>
  22882. valid = 0;
  22883. break;
  22884. }
  22885. iprh_prev = iprh;
  22886. q = iprh->next_pbuf;
  22887. 800eb20: 6816 ldr r6, [r2, #0]
  22888. 800eb22: 4613 mov r3, r2
  22889. valid = 0;
  22890. } else {
  22891. /* and check that there are no wholes after this datagram */
  22892. iprh_prev = iprh;
  22893. q = iprh->next_pbuf;
  22894. while (q != NULL) {
  22895. 800eb24: 2e00 cmp r6, #0
  22896. 800eb26: d1f6 bne.n 800eb16 <ip_reass+0x1c2>
  22897. 800eb28: e007 b.n 800eb3a <ip_reass+0x1e6>
  22898. }
  22899. /* If we come here, not all fragments were received, yet! */
  22900. return 0; /* not yet valid! */
  22901. #if IP_REASS_CHECK_OVERLAP
  22902. freepbuf:
  22903. ip_reass_pbufcount -= pbuf_clen(new_p);
  22904. 800eb2a: 4c2f ldr r4, [pc, #188] ; (800ebe8 <ip_reass+0x294>)
  22905. 800eb2c: 4630 mov r0, r6
  22906. 800eb2e: 8825 ldrh r5, [r4, #0]
  22907. 800eb30: f7fc fda0 bl 800b674 <pbuf_clen>
  22908. 800eb34: 1a28 subs r0, r5, r0
  22909. 800eb36: 8020 strh r0, [r4, #0]
  22910. 800eb38: e041 b.n 800ebbe <ip_reass+0x26a>
  22911. /* find the right place to insert this pbuf */
  22912. /* @todo: trim pbufs if fragments are overlapping */
  22913. if (ip_reass_chain_frag_into_datagram_and_validate(ipr, p)) {
  22914. /* the totally last fragment (flag more fragments = 0) was received at least
  22915. * once AND all fragments are received */
  22916. ipr->datagram_len += IP_HLEN;
  22917. 800eb3a: 8ba3 ldrh r3, [r4, #28]
  22918. 800eb3c: 3314 adds r3, #20
  22919. 800eb3e: 83a3 strh r3, [r4, #28]
  22920. /* save the second pbuf before copying the header over the pointer */
  22921. r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
  22922. /* copy the original ip header back to the first pbuf */
  22923. fraghdr = (struct ip_hdr*)(ipr->p->payload);
  22924. SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
  22925. 800eb40: f104 0108 add.w r1, r4, #8
  22926. 800eb44: 2214 movs r2, #20
  22927. 800eb46: 4628 mov r0, r5
  22928. /* the totally last fragment (flag more fragments = 0) was received at least
  22929. * once AND all fragments are received */
  22930. ipr->datagram_len += IP_HLEN;
  22931. /* save the second pbuf before copying the header over the pointer */
  22932. r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
  22933. 800eb48: f8d5 8000 ldr.w r8, [r5]
  22934. /* copy the original ip header back to the first pbuf */
  22935. fraghdr = (struct ip_hdr*)(ipr->p->payload);
  22936. SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
  22937. 800eb4c: f7fa fc5a bl 8009404 <memcpy>
  22938. IPH_LEN_SET(fraghdr, htons(ipr->datagram_len));
  22939. 800eb50: 8ba0 ldrh r0, [r4, #28]
  22940. 800eb52: f7fb fb4a bl 800a1ea <lwip_htons>
  22941. IPH_OFFSET_SET(fraghdr, 0);
  22942. 800eb56: 71ae strb r6, [r5, #6]
  22943. r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
  22944. /* copy the original ip header back to the first pbuf */
  22945. fraghdr = (struct ip_hdr*)(ipr->p->payload);
  22946. SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
  22947. IPH_LEN_SET(fraghdr, htons(ipr->datagram_len));
  22948. 800eb58: 8068 strh r0, [r5, #2]
  22949. IPH_OFFSET_SET(fraghdr, 0);
  22950. 800eb5a: 71ee strb r6, [r5, #7]
  22951. IPH_CHKSUM_SET(fraghdr, 0);
  22952. 800eb5c: 72ae strb r6, [r5, #10]
  22953. 800eb5e: 72ee strb r6, [r5, #11]
  22954. /* @todo: do we need to set calculate the correct checksum? */
  22955. IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));
  22956. 800eb60: 4628 mov r0, r5
  22957. 800eb62: 2114 movs r1, #20
  22958. 800eb64: f7ff fbe3 bl 800e32e <inet_chksum>
  22959. 800eb68: 8168 strh r0, [r5, #10]
  22960. p = ipr->p;
  22961. 800eb6a: 6865 ldr r5, [r4, #4]
  22962. /* chain together the pbufs contained within the reass_data list. */
  22963. while(r != NULL) {
  22964. 800eb6c: e00c b.n 800eb88 <ip_reass+0x234>
  22965. iprh = (struct ip_reass_helper*)r->payload;
  22966. 800eb6e: f8d8 6004 ldr.w r6, [r8, #4]
  22967. /* hide the ip header for every succeding fragment */
  22968. pbuf_header(r, -IP_HLEN);
  22969. 800eb72: 4640 mov r0, r8
  22970. 800eb74: f06f 0113 mvn.w r1, #19
  22971. 800eb78: f7fc fc79 bl 800b46e <pbuf_header>
  22972. pbuf_cat(p, r);
  22973. 800eb7c: 4641 mov r1, r8
  22974. 800eb7e: 4628 mov r0, r5
  22975. 800eb80: f7fc fd86 bl 800b690 <pbuf_cat>
  22976. r = iprh->next_pbuf;
  22977. 800eb84: f8d6 8000 ldr.w r8, [r6]
  22978. IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));
  22979. p = ipr->p;
  22980. /* chain together the pbufs contained within the reass_data list. */
  22981. while(r != NULL) {
  22982. 800eb88: f1b8 0f00 cmp.w r8, #0
  22983. 800eb8c: d1ef bne.n 800eb6e <ip_reass+0x21a>
  22984. static void
  22985. ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
  22986. {
  22987. /* dequeue the reass struct */
  22988. if (reassdatagrams == ipr) {
  22989. 800eb8e: 4b17 ldr r3, [pc, #92] ; (800ebec <ip_reass+0x298>)
  22990. 800eb90: 681a ldr r2, [r3, #0]
  22991. 800eb92: 42a2 cmp r2, r4
  22992. /* it was the first in the list */
  22993. reassdatagrams = ipr->next;
  22994. 800eb94: bf0b itete eq
  22995. 800eb96: 6822 ldreq r2, [r4, #0]
  22996. } else {
  22997. /* it wasn't the first, so it must have a valid 'prev' */
  22998. LWIP_ASSERT("sanity check linked list", prev != NULL);
  22999. prev->next = ipr->next;
  23000. 800eb98: 6823 ldrne r3, [r4, #0]
  23001. {
  23002. /* dequeue the reass struct */
  23003. if (reassdatagrams == ipr) {
  23004. /* it was the first in the list */
  23005. reassdatagrams = ipr->next;
  23006. 800eb9a: 601a streq r2, [r3, #0]
  23007. } else {
  23008. /* it wasn't the first, so it must have a valid 'prev' */
  23009. LWIP_ASSERT("sanity check linked list", prev != NULL);
  23010. prev->next = ipr->next;
  23011. 800eb9c: 603b strne r3, [r7, #0]
  23012. }
  23013. /* now we can free the ip_reass struct */
  23014. memp_free(MEMP_REASSDATA, ipr);
  23015. 800eb9e: 4621 mov r1, r4
  23016. 800eba0: 2005 movs r0, #5
  23017. }
  23018. /* release the sources allocate for the fragment queue entry */
  23019. ip_reass_dequeue_datagram(ipr, ipr_prev);
  23020. /* and adjust the number of pbufs currently queued for reassembly. */
  23021. ip_reass_pbufcount -= pbuf_clen(p);
  23022. 800eba2: 4c11 ldr r4, [pc, #68] ; (800ebe8 <ip_reass+0x294>)
  23023. LWIP_ASSERT("sanity check linked list", prev != NULL);
  23024. prev->next = ipr->next;
  23025. }
  23026. /* now we can free the ip_reass struct */
  23027. memp_free(MEMP_REASSDATA, ipr);
  23028. 800eba4: f7fc fb96 bl 800b2d4 <memp_free>
  23029. }
  23030. /* release the sources allocate for the fragment queue entry */
  23031. ip_reass_dequeue_datagram(ipr, ipr_prev);
  23032. /* and adjust the number of pbufs currently queued for reassembly. */
  23033. ip_reass_pbufcount -= pbuf_clen(p);
  23034. 800eba8: 4628 mov r0, r5
  23035. 800ebaa: 8826 ldrh r6, [r4, #0]
  23036. 800ebac: f7fc fd62 bl 800b674 <pbuf_clen>
  23037. 800ebb0: 1a30 subs r0, r6, r0
  23038. 800ebb2: 8020 strh r0, [r4, #0]
  23039. /* Return the pbuf chain */
  23040. return p;
  23041. 800ebb4: e013 b.n 800ebde <ip_reass+0x28a>
  23042. LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass_pbufcount: %d out\n", ip_reass_pbufcount));
  23043. return NULL;
  23044. nullreturn:
  23045. LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: nullreturn\n"));
  23046. IPFRAG_STATS_INC(ip_frag.drop);
  23047. 800ebb6: 4b0b ldr r3, [pc, #44] ; (800ebe4 <ip_reass+0x290>)
  23048. 800ebb8: 8eda ldrh r2, [r3, #54] ; 0x36
  23049. 800ebba: 3201 adds r2, #1
  23050. 800ebbc: 86da strh r2, [r3, #54] ; 0x36
  23051. pbuf_free(p);
  23052. 800ebbe: 4630 mov r0, r6
  23053. 800ebc0: f7fc fc80 bl 800b4c4 <pbuf_free>
  23054. 800ebc4: e00a b.n 800ebdc <ip_reass+0x288>
  23055. static struct ip_reassdata*
  23056. ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen)
  23057. {
  23058. struct ip_reassdata* ipr;
  23059. /* No matching previous fragment found, allocate a new reassdata struct */
  23060. ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
  23061. 800ebc6: 2005 movs r0, #5
  23062. 800ebc8: f7fc fb5a bl 800b280 <memp_malloc>
  23063. if (ipr == NULL) {
  23064. 800ebcc: 4604 mov r4, r0
  23065. 800ebce: 2800 cmp r0, #0
  23066. 800ebd0: f47f af22 bne.w 800ea18 <ip_reass+0xc4>
  23067. 800ebd4: e70f b.n 800e9f6 <ip_reass+0xa2>
  23068. iprh_prev = iprh_tmp;
  23069. }
  23070. /* If q is NULL, then we made it to the end of the list. Determine what to do now */
  23071. if (q == NULL) {
  23072. if (iprh_prev != NULL) {
  23073. 800ebd6: 2a00 cmp r2, #0
  23074. 800ebd8: d18a bne.n 800eaf0 <ip_reass+0x19c>
  23075. 800ebda: e78f b.n 800eafc <ip_reass+0x1a8>
  23076. /* Return the pbuf chain */
  23077. return p;
  23078. }
  23079. /* the datagram is not (yet?) reassembled completely */
  23080. LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass_pbufcount: %d out\n", ip_reass_pbufcount));
  23081. return NULL;
  23082. 800ebdc: 2500 movs r5, #0
  23083. nullreturn:
  23084. LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: nullreturn\n"));
  23085. IPFRAG_STATS_INC(ip_frag.drop);
  23086. pbuf_free(p);
  23087. return NULL;
  23088. }
  23089. 800ebde: 4628 mov r0, r5
  23090. 800ebe0: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
  23091. 800ebe4: 20008220 .word 0x20008220
  23092. 800ebe8: 20006bc0 .word 0x20006bc0
  23093. 800ebec: 20006bbc .word 0x20006bbc
  23094. 0800ebf0 <ip_frag>:
  23095. *
  23096. * @return ERR_OK if sent successfully, err_t otherwise
  23097. */
  23098. err_t
  23099. ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
  23100. {
  23101. 800ebf0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  23102. struct ip_hdr *original_iphdr;
  23103. #endif
  23104. struct ip_hdr *iphdr;
  23105. u16_t nfb;
  23106. u16_t left, cop;
  23107. u16_t mtu = netif->mtu;
  23108. 800ebf4: 8c8d ldrh r5, [r1, #36] ; 0x24
  23109. *
  23110. * @return ERR_OK if sent successfully, err_t otherwise
  23111. */
  23112. err_t
  23113. ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
  23114. {
  23115. 800ebf6: b08d sub sp, #52 ; 0x34
  23116. 800ebf8: 468a mov sl, r1
  23117. /* Copy the IP header in it */
  23118. iphdr = (struct ip_hdr *)rambuf->payload;
  23119. SMEMCPY(iphdr, p->payload, IP_HLEN);
  23120. #else /* IP_FRAG_USES_STATIC_BUF */
  23121. original_iphdr = (struct ip_hdr *)p->payload;
  23122. 800ebfa: 6841 ldr r1, [r0, #4]
  23123. *
  23124. * @return ERR_OK if sent successfully, err_t otherwise
  23125. */
  23126. err_t
  23127. ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
  23128. {
  23129. 800ebfc: 920a str r2, [sp, #40] ; 0x28
  23130. /* Copy the IP header in it */
  23131. iphdr = (struct ip_hdr *)rambuf->payload;
  23132. SMEMCPY(iphdr, p->payload, IP_HLEN);
  23133. #else /* IP_FRAG_USES_STATIC_BUF */
  23134. original_iphdr = (struct ip_hdr *)p->payload;
  23135. 800ebfe: 9106 str r1, [sp, #24]
  23136. *
  23137. * @return ERR_OK if sent successfully, err_t otherwise
  23138. */
  23139. err_t
  23140. ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
  23141. {
  23142. 800ec00: 4604 mov r4, r0
  23143. original_iphdr = (struct ip_hdr *)p->payload;
  23144. iphdr = original_iphdr;
  23145. #endif /* IP_FRAG_USES_STATIC_BUF */
  23146. /* Save original offset */
  23147. tmp = ntohs(IPH_OFFSET(iphdr));
  23148. 800ec02: 88c8 ldrh r0, [r1, #6]
  23149. 800ec04: f7fb faf6 bl 800a1f4 <lwip_ntohs>
  23150. ofo = tmp & IP_OFFMASK;
  23151. 800ec08: 04c3 lsls r3, r0, #19
  23152. 800ec0a: 0cdb lsrs r3, r3, #19
  23153. omf = tmp & IP_MF;
  23154. left = p->tot_len - IP_HLEN;
  23155. nfb = (mtu - IP_HLEN) / 8;
  23156. 800ec0c: f1a5 0214 sub.w r2, r5, #20
  23157. iphdr = original_iphdr;
  23158. #endif /* IP_FRAG_USES_STATIC_BUF */
  23159. /* Save original offset */
  23160. tmp = ntohs(IPH_OFFSET(iphdr));
  23161. ofo = tmp & IP_OFFMASK;
  23162. 800ec10: 9304 str r3, [sp, #16]
  23163. omf = tmp & IP_MF;
  23164. left = p->tot_len - IP_HLEN;
  23165. nfb = (mtu - IP_HLEN) / 8;
  23166. 800ec12: 2308 movs r3, #8
  23167. 800ec14: fb92 f3f3 sdiv r3, r2, r3
  23168. 800ec18: b29b uxth r3, r3
  23169. /* Save original offset */
  23170. tmp = ntohs(IPH_OFFSET(iphdr));
  23171. ofo = tmp & IP_OFFMASK;
  23172. omf = tmp & IP_MF;
  23173. left = p->tot_len - IP_HLEN;
  23174. 800ec1a: 8926 ldrh r6, [r4, #8]
  23175. nfb = (mtu - IP_HLEN) / 8;
  23176. 800ec1c: 9307 str r3, [sp, #28]
  23177. #endif /* IP_FRAG_USES_STATIC_BUF */
  23178. /* Save original offset */
  23179. tmp = ntohs(IPH_OFFSET(iphdr));
  23180. ofo = tmp & IP_OFFMASK;
  23181. omf = tmp & IP_MF;
  23182. 800ec1e: f400 5000 and.w r0, r0, #8192 ; 0x2000
  23183. if (!last) {
  23184. tmp = tmp | IP_MF;
  23185. }
  23186. /* Fill this fragment */
  23187. cop = last ? left : nfb * 8;
  23188. 800ec22: 00db lsls r3, r3, #3
  23189. #endif /* IP_FRAG_USES_STATIC_BUF */
  23190. /* Save original offset */
  23191. tmp = ntohs(IPH_OFFSET(iphdr));
  23192. ofo = tmp & IP_OFFMASK;
  23193. omf = tmp & IP_MF;
  23194. 800ec24: b280 uxth r0, r0
  23195. left = p->tot_len - IP_HLEN;
  23196. 800ec26: 3e14 subs r6, #20
  23197. if (!last) {
  23198. tmp = tmp | IP_MF;
  23199. }
  23200. /* Fill this fragment */
  23201. cop = last ? left : nfb * 8;
  23202. 800ec28: b29b uxth r3, r3
  23203. left = p->tot_len - IP_HLEN;
  23204. nfb = (mtu - IP_HLEN) / 8;
  23205. while (left) {
  23206. last = (left <= mtu - IP_HLEN);
  23207. 800ec2a: 3d13 subs r5, #19
  23208. #endif /* IP_FRAG_USES_STATIC_BUF */
  23209. /* Save original offset */
  23210. tmp = ntohs(IPH_OFFSET(iphdr));
  23211. ofo = tmp & IP_OFFMASK;
  23212. omf = tmp & IP_MF;
  23213. 800ec2c: 9008 str r0, [sp, #32]
  23214. left = p->tot_len - IP_HLEN;
  23215. 800ec2e: b2b6 uxth r6, r6
  23216. if (!last) {
  23217. tmp = tmp | IP_MF;
  23218. }
  23219. /* Fill this fragment */
  23220. cop = last ? left : nfb * 8;
  23221. 800ec30: 9309 str r3, [sp, #36] ; 0x24
  23222. u16_t ofo, omf;
  23223. u16_t last;
  23224. u16_t poff = IP_HLEN;
  23225. u16_t tmp;
  23226. #if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF
  23227. u16_t newpbuflen = 0;
  23228. 800ec32: 2700 movs r7, #0
  23229. u16_t nfb;
  23230. u16_t left, cop;
  23231. u16_t mtu = netif->mtu;
  23232. u16_t ofo, omf;
  23233. u16_t last;
  23234. u16_t poff = IP_HLEN;
  23235. 800ec34: f04f 0914 mov.w r9, #20
  23236. left = p->tot_len - IP_HLEN;
  23237. nfb = (mtu - IP_HLEN) / 8;
  23238. while (left) {
  23239. last = (left <= mtu - IP_HLEN);
  23240. 800ec38: 950b str r5, [sp, #44] ; 0x2c
  23241. left = p->tot_len - IP_HLEN;
  23242. nfb = (mtu - IP_HLEN) / 8;
  23243. while (left) {
  23244. 800ec3a: e098 b.n 800ed6e <ip_frag+0x17e>
  23245. last = (left <= mtu - IP_HLEN);
  23246. /* Set new offset and MF flag */
  23247. tmp = omf | (IP_OFFMASK & (ofo));
  23248. 800ec3c: 9a04 ldr r2, [sp, #16]
  23249. 800ec3e: 9b08 ldr r3, [sp, #32]
  23250. if (!last) {
  23251. 800ec40: 990b ldr r1, [sp, #44] ; 0x2c
  23252. while (left) {
  23253. last = (left <= mtu - IP_HLEN);
  23254. /* Set new offset and MF flag */
  23255. tmp = omf | (IP_OFFMASK & (ofo));
  23256. 800ec42: ea4f 4bc2 mov.w fp, r2, lsl #19
  23257. 800ec46: ea43 4bdb orr.w fp, r3, fp, lsr #19
  23258. if (!last) {
  23259. 800ec4a: 42b1 cmp r1, r6
  23260. while (left) {
  23261. last = (left <= mtu - IP_HLEN);
  23262. /* Set new offset and MF flag */
  23263. tmp = omf | (IP_OFFMASK & (ofo));
  23264. 800ec4c: f8cd b014 str.w fp, [sp, #20]
  23265. if (!last) {
  23266. 800ec50: dc05 bgt.n 800ec5e <ip_frag+0x6e>
  23267. tmp = tmp | IP_MF;
  23268. 800ec52: f44b 5200 orr.w r2, fp, #8192 ; 0x2000
  23269. 800ec56: 9205 str r2, [sp, #20]
  23270. }
  23271. /* Fill this fragment */
  23272. cop = last ? left : nfb * 8;
  23273. 800ec58: f8dd b024 ldr.w fp, [sp, #36] ; 0x24
  23274. 800ec5c: e000 b.n 800ec60 <ip_frag+0x70>
  23275. while (left) {
  23276. last = (left <= mtu - IP_HLEN);
  23277. /* Set new offset and MF flag */
  23278. tmp = omf | (IP_OFFMASK & (ofo));
  23279. if (!last) {
  23280. 800ec5e: 46b3 mov fp, r6
  23281. /* When not using a static buffer, create a chain of pbufs.
  23282. * The first will be a PBUF_RAM holding the link and IP header.
  23283. * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged,
  23284. * but limited to the size of an mtu.
  23285. */
  23286. rambuf = pbuf_alloc(PBUF_LINK, IP_HLEN, PBUF_RAM);
  23287. 800ec60: 2002 movs r0, #2
  23288. 800ec62: 2114 movs r1, #20
  23289. 800ec64: 2200 movs r2, #0
  23290. 800ec66: f7fc fc7e bl 800b566 <pbuf_alloc>
  23291. if (rambuf == NULL) {
  23292. 800ec6a: 4605 mov r5, r0
  23293. 800ec6c: 2800 cmp r0, #0
  23294. 800ec6e: f000 8083 beq.w 800ed78 <ip_frag+0x188>
  23295. return ERR_MEM;
  23296. }
  23297. LWIP_ASSERT("this needs a pbuf in one piece!",
  23298. (p->len >= (IP_HLEN)));
  23299. SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN);
  23300. 800ec72: 6840 ldr r0, [r0, #4]
  23301. 800ec74: 9906 ldr r1, [sp, #24]
  23302. 800ec76: 2214 movs r2, #20
  23303. 800ec78: f7fa fbc4 bl 8009404 <memcpy>
  23304. iphdr = (struct ip_hdr *)rambuf->payload;
  23305. /* Can just adjust p directly for needed offset. */
  23306. p->payload = (u8_t *)p->payload + poff;
  23307. 800ec7c: 6863 ldr r3, [r4, #4]
  23308. return ERR_MEM;
  23309. }
  23310. LWIP_ASSERT("this needs a pbuf in one piece!",
  23311. (p->len >= (IP_HLEN)));
  23312. SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN);
  23313. iphdr = (struct ip_hdr *)rambuf->payload;
  23314. 800ec7e: f8d5 8004 ldr.w r8, [r5, #4]
  23315. /* Can just adjust p directly for needed offset. */
  23316. p->payload = (u8_t *)p->payload + poff;
  23317. 800ec82: 444b add r3, r9
  23318. 800ec84: 6063 str r3, [r4, #4]
  23319. p->len -= poff;
  23320. 800ec86: 8963 ldrh r3, [r4, #10]
  23321. 800ec88: ebc9 0903 rsb r9, r9, r3
  23322. 800ec8c: f8a4 900a strh.w r9, [r4, #10]
  23323. left_to_copy = cop;
  23324. 800ec90: 46d9 mov r9, fp
  23325. while (left_to_copy) {
  23326. 800ec92: e03c b.n 800ed0e <ip_frag+0x11e>
  23327. struct pbuf_custom_ref *pcr;
  23328. newpbuflen = (left_to_copy < p->len) ? left_to_copy : p->len;
  23329. 800ec94: 8967 ldrh r7, [r4, #10]
  23330. 800ec96: 45b9 cmp r9, r7
  23331. 800ec98: bf38 it cc
  23332. 800ec9a: 464f movcc r7, r9
  23333. 800ec9c: b2bf uxth r7, r7
  23334. /* Is this pbuf already empty? */
  23335. if (!newpbuflen) {
  23336. 800ec9e: b907 cbnz r7, 800eca2 <ip_frag+0xb2>
  23337. 800eca0: e034 b.n 800ed0c <ip_frag+0x11c>
  23338. #if !LWIP_NETIF_TX_SINGLE_PBUF
  23339. /** Allocate a new struct pbuf_custom_ref */
  23340. static struct pbuf_custom_ref*
  23341. ip_frag_alloc_pbuf_custom_ref(void)
  23342. {
  23343. return (struct pbuf_custom_ref*)memp_malloc(MEMP_FRAG_PBUF);
  23344. 800eca2: 2006 movs r0, #6
  23345. 800eca4: f7fc faec bl 800b280 <memp_malloc>
  23346. if (!newpbuflen) {
  23347. p = p->next;
  23348. continue;
  23349. }
  23350. pcr = ip_frag_alloc_pbuf_custom_ref();
  23351. if (pcr == NULL) {
  23352. 800eca8: 4684 mov ip, r0
  23353. 800ecaa: b900 cbnz r0, 800ecae <ip_frag+0xbe>
  23354. 800ecac: e012 b.n 800ecd4 <ip_frag+0xe4>
  23355. pbuf_free(rambuf);
  23356. return ERR_MEM;
  23357. }
  23358. /* Mirror this pbuf, although we might not need all of it. */
  23359. newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, p->payload, newpbuflen);
  23360. 800ecae: 6863 ldr r3, [r4, #4]
  23361. 800ecb0: f8cd c008 str.w ip, [sp, #8]
  23362. 800ecb4: e88d 0088 stmia.w sp, {r3, r7}
  23363. 800ecb8: 4639 mov r1, r7
  23364. 800ecba: 4663 mov r3, ip
  23365. 800ecbc: 2003 movs r0, #3
  23366. 800ecbe: 2202 movs r2, #2
  23367. 800ecc0: f7fc fbad bl 800b41e <pbuf_alloced_custom>
  23368. if (newpbuf == NULL) {
  23369. 800ecc4: f8dd c008 ldr.w ip, [sp, #8]
  23370. 800ecc8: 4601 mov r1, r0
  23371. 800ecca: b938 cbnz r0, 800ecdc <ip_frag+0xec>
  23372. /** Free a struct pbuf_custom_ref */
  23373. static void
  23374. ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p)
  23375. {
  23376. LWIP_ASSERT("p != NULL", p != NULL);
  23377. memp_free(MEMP_FRAG_PBUF, p);
  23378. 800eccc: 2006 movs r0, #6
  23379. 800ecce: 4661 mov r1, ip
  23380. 800ecd0: f7fc fb00 bl 800b2d4 <memp_free>
  23381. }
  23382. /* Mirror this pbuf, although we might not need all of it. */
  23383. newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, p->payload, newpbuflen);
  23384. if (newpbuf == NULL) {
  23385. ip_frag_free_pbuf_custom_ref(pcr);
  23386. pbuf_free(rambuf);
  23387. 800ecd4: 4628 mov r0, r5
  23388. 800ecd6: f7fc fbf5 bl 800b4c4 <pbuf_free>
  23389. 800ecda: e04d b.n 800ed78 <ip_frag+0x188>
  23390. return ERR_MEM;
  23391. }
  23392. pbuf_ref(p);
  23393. 800ecdc: 4620 mov r0, r4
  23394. 800ecde: 9103 str r1, [sp, #12]
  23395. 800ece0: f8cd c008 str.w ip, [sp, #8]
  23396. 800ece4: f7fc fccf bl 800b686 <pbuf_ref>
  23397. pcr->original = p;
  23398. 800ece8: f8dd c008 ldr.w ip, [sp, #8]
  23399. pcr->pc.custom_free_function = ipfrag_free_pbuf_custom;
  23400. 800ecec: 4b25 ldr r3, [pc, #148] ; (800ed84 <ip_frag+0x194>)
  23401. ip_frag_free_pbuf_custom_ref(pcr);
  23402. pbuf_free(rambuf);
  23403. return ERR_MEM;
  23404. }
  23405. pbuf_ref(p);
  23406. pcr->original = p;
  23407. 800ecee: f8cc 4014 str.w r4, [ip, #20]
  23408. /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain
  23409. * so that it is removed when pbuf_dechain is later called on rambuf.
  23410. */
  23411. pbuf_cat(rambuf, newpbuf);
  23412. left_to_copy -= newpbuflen;
  23413. 800ecf2: ebc7 0909 rsb r9, r7, r9
  23414. pbuf_free(rambuf);
  23415. return ERR_MEM;
  23416. }
  23417. pbuf_ref(p);
  23418. pcr->original = p;
  23419. pcr->pc.custom_free_function = ipfrag_free_pbuf_custom;
  23420. 800ecf6: f8cc 3010 str.w r3, [ip, #16]
  23421. /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain
  23422. * so that it is removed when pbuf_dechain is later called on rambuf.
  23423. */
  23424. pbuf_cat(rambuf, newpbuf);
  23425. 800ecfa: 4628 mov r0, r5
  23426. 800ecfc: 9903 ldr r1, [sp, #12]
  23427. left_to_copy -= newpbuflen;
  23428. 800ecfe: fa1f f989 uxth.w r9, r9
  23429. pcr->pc.custom_free_function = ipfrag_free_pbuf_custom;
  23430. /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain
  23431. * so that it is removed when pbuf_dechain is later called on rambuf.
  23432. */
  23433. pbuf_cat(rambuf, newpbuf);
  23434. 800ed02: f7fc fcc5 bl 800b690 <pbuf_cat>
  23435. left_to_copy -= newpbuflen;
  23436. if (left_to_copy) {
  23437. 800ed06: f1b9 0f00 cmp.w r9, #0
  23438. 800ed0a: d003 beq.n 800ed14 <ip_frag+0x124>
  23439. p = p->next;
  23440. 800ed0c: 6824 ldr r4, [r4, #0]
  23441. /* Can just adjust p directly for needed offset. */
  23442. p->payload = (u8_t *)p->payload + poff;
  23443. p->len -= poff;
  23444. left_to_copy = cop;
  23445. while (left_to_copy) {
  23446. 800ed0e: f1b9 0f00 cmp.w r9, #0
  23447. 800ed12: d1bf bne.n 800ec94 <ip_frag+0xa4>
  23448. poff = newpbuflen;
  23449. #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  23450. #endif /* IP_FRAG_USES_STATIC_BUF */
  23451. /* Correct header */
  23452. IPH_OFFSET_SET(iphdr, htons(tmp));
  23453. 800ed14: 9805 ldr r0, [sp, #20]
  23454. 800ed16: f7fb fa68 bl 800a1ea <lwip_htons>
  23455. 800ed1a: f8a8 0006 strh.w r0, [r8, #6]
  23456. IPH_LEN_SET(iphdr, htons(cop + IP_HLEN));
  23457. 800ed1e: f10b 0014 add.w r0, fp, #20
  23458. 800ed22: b280 uxth r0, r0
  23459. 800ed24: f7fb fa61 bl 800a1ea <lwip_htons>
  23460. IPH_CHKSUM_SET(iphdr, 0);
  23461. 800ed28: 2300 movs r3, #0
  23462. #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  23463. #endif /* IP_FRAG_USES_STATIC_BUF */
  23464. /* Correct header */
  23465. IPH_OFFSET_SET(iphdr, htons(tmp));
  23466. IPH_LEN_SET(iphdr, htons(cop + IP_HLEN));
  23467. 800ed2a: f8a8 0002 strh.w r0, [r8, #2]
  23468. IPH_CHKSUM_SET(iphdr, 0);
  23469. 800ed2e: f888 300a strb.w r3, [r8, #10]
  23470. 800ed32: f888 300b strb.w r3, [r8, #11]
  23471. IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
  23472. 800ed36: 2114 movs r1, #20
  23473. 800ed38: 4640 mov r0, r8
  23474. 800ed3a: f7ff faf8 bl 800e32e <inet_chksum>
  23475. 800ed3e: f8a8 000a strh.w r0, [r8, #10]
  23476. }
  23477. #else /* IP_FRAG_USES_STATIC_BUF */
  23478. /* No need for separate header pbuf - we allowed room for it in rambuf
  23479. * when allocated.
  23480. */
  23481. netif->output(netif, rambuf, dest);
  23482. 800ed42: 4629 mov r1, r5
  23483. 800ed44: f8da 3014 ldr.w r3, [sl, #20]
  23484. 800ed48: 9a0a ldr r2, [sp, #40] ; 0x28
  23485. 800ed4a: 4650 mov r0, sl
  23486. 800ed4c: 4798 blx r3
  23487. IPFRAG_STATS_INC(ip_frag.xmit);
  23488. 800ed4e: 4b0e ldr r3, [pc, #56] ; (800ed88 <ip_frag+0x198>)
  23489. 800ed50: 8e1a ldrh r2, [r3, #48] ; 0x30
  23490. * recreate it next time round the loop. If we're lucky the hardware
  23491. * will have already sent the packet, the free will really free, and
  23492. * there will be zero memory penalty.
  23493. */
  23494. pbuf_free(rambuf);
  23495. 800ed52: 4628 mov r0, r5
  23496. #else /* IP_FRAG_USES_STATIC_BUF */
  23497. /* No need for separate header pbuf - we allowed room for it in rambuf
  23498. * when allocated.
  23499. */
  23500. netif->output(netif, rambuf, dest);
  23501. IPFRAG_STATS_INC(ip_frag.xmit);
  23502. 800ed54: 3201 adds r2, #1
  23503. 800ed56: 861a strh r2, [r3, #48] ; 0x30
  23504. * recreate it next time round the loop. If we're lucky the hardware
  23505. * will have already sent the packet, the free will really free, and
  23506. * there will be zero memory penalty.
  23507. */
  23508. pbuf_free(rambuf);
  23509. 800ed58: f7fc fbb4 bl 800b4c4 <pbuf_free>
  23510. #endif /* IP_FRAG_USES_STATIC_BUF */
  23511. left -= cop;
  23512. ofo += nfb;
  23513. 800ed5c: 9904 ldr r1, [sp, #16]
  23514. 800ed5e: 9a07 ldr r2, [sp, #28]
  23515. 800ed60: 188b adds r3, r1, r2
  23516. * there will be zero memory penalty.
  23517. */
  23518. pbuf_free(rambuf);
  23519. #endif /* IP_FRAG_USES_STATIC_BUF */
  23520. left -= cop;
  23521. 800ed62: ebcb 0606 rsb r6, fp, r6
  23522. ofo += nfb;
  23523. 800ed66: b29b uxth r3, r3
  23524. * there will be zero memory penalty.
  23525. */
  23526. pbuf_free(rambuf);
  23527. #endif /* IP_FRAG_USES_STATIC_BUF */
  23528. left -= cop;
  23529. 800ed68: b2b6 uxth r6, r6
  23530. ofo += nfb;
  23531. 800ed6a: 9304 str r3, [sp, #16]
  23532. 800ed6c: 46b9 mov r9, r7
  23533. left = p->tot_len - IP_HLEN;
  23534. nfb = (mtu - IP_HLEN) / 8;
  23535. while (left) {
  23536. 800ed6e: 2e00 cmp r6, #0
  23537. 800ed70: f47f af64 bne.w 800ec3c <ip_frag+0x4c>
  23538. }
  23539. #if IP_FRAG_USES_STATIC_BUF
  23540. pbuf_free(rambuf);
  23541. #endif /* IP_FRAG_USES_STATIC_BUF */
  23542. snmp_inc_ipfragoks();
  23543. return ERR_OK;
  23544. 800ed74: 4630 mov r0, r6
  23545. 800ed76: e000 b.n 800ed7a <ip_frag+0x18a>
  23546. * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged,
  23547. * but limited to the size of an mtu.
  23548. */
  23549. rambuf = pbuf_alloc(PBUF_LINK, IP_HLEN, PBUF_RAM);
  23550. if (rambuf == NULL) {
  23551. return ERR_MEM;
  23552. 800ed78: 20ff movs r0, #255 ; 0xff
  23553. #if IP_FRAG_USES_STATIC_BUF
  23554. pbuf_free(rambuf);
  23555. #endif /* IP_FRAG_USES_STATIC_BUF */
  23556. snmp_inc_ipfragoks();
  23557. return ERR_OK;
  23558. }
  23559. 800ed7a: b240 sxtb r0, r0
  23560. 800ed7c: b00d add sp, #52 ; 0x34
  23561. 800ed7e: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  23562. 800ed82: bf00 nop
  23563. 800ed84: 0800e815 .word 0x0800e815
  23564. 800ed88: 20008220 .word 0x20008220
  23565. 0800ed8c <etharp_free_entry>:
  23566. #endif /* ARP_QUEUEING */
  23567. /** Clean up ARP table entries */
  23568. static void
  23569. etharp_free_entry(int i)
  23570. {
  23571. 800ed8c: b570 push {r4, r5, r6, lr}
  23572. /* remove from SNMP ARP index tree */
  23573. snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
  23574. /* and empty packet queue */
  23575. if (arp_table[i].q != NULL) {
  23576. 800ed8e: 2614 movs r6, #20
  23577. 800ed90: 4c07 ldr r4, [pc, #28] ; (800edb0 <etharp_free_entry+0x24>)
  23578. 800ed92: 4346 muls r6, r0
  23579. #endif /* ARP_QUEUEING */
  23580. /** Clean up ARP table entries */
  23581. static void
  23582. etharp_free_entry(int i)
  23583. {
  23584. 800ed94: 4605 mov r5, r0
  23585. /* remove from SNMP ARP index tree */
  23586. snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
  23587. /* and empty packet queue */
  23588. if (arp_table[i].q != NULL) {
  23589. 800ed96: 59a0 ldr r0, [r4, r6]
  23590. 800ed98: b118 cbz r0, 800eda2 <etharp_free_entry+0x16>
  23591. /* remove all queued packets */
  23592. LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_free_entry: freeing entry %"U16_F", packet queue %p.\n", (u16_t)i, (void *)(arp_table[i].q)));
  23593. free_etharp_q(arp_table[i].q);
  23594. 800ed9a: f7fc fb93 bl 800b4c4 <pbuf_free>
  23595. arp_table[i].q = NULL;
  23596. 800ed9e: 2300 movs r3, #0
  23597. 800eda0: 51a3 str r3, [r4, r6]
  23598. }
  23599. /* recycle entry for re-use */
  23600. arp_table[i].state = ETHARP_STATE_EMPTY;
  23601. 800eda2: 2314 movs r3, #20
  23602. 800eda4: fb03 4405 mla r4, r3, r5, r4
  23603. 800eda8: 2300 movs r3, #0
  23604. 800edaa: 74a3 strb r3, [r4, #18]
  23605. 800edac: 3410 adds r4, #16
  23606. 800edae: bd70 pop {r4, r5, r6, pc}
  23607. 800edb0: 20006bc4 .word 0x20006bc4
  23608. 0800edb4 <etharp_find_entry>:
  23609. * @return The ARP entry index that matched or is created, ERR_MEM if no
  23610. * entry is found or could be recycled.
  23611. */
  23612. static s8_t
  23613. etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
  23614. {
  23615. 800edb4: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  23616. s8_t empty = ARP_TABLE_SIZE;
  23617. u8_t i = 0, age_pending = 0, age_stable = 0;
  23618. /* oldest entry with packets on queue */
  23619. s8_t old_queue = ARP_TABLE_SIZE;
  23620. /* its age */
  23621. u8_t age_queue = 0;
  23622. 800edb8: 2500 movs r5, #0
  23623. {
  23624. s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
  23625. s8_t empty = ARP_TABLE_SIZE;
  23626. u8_t i = 0, age_pending = 0, age_stable = 0;
  23627. /* oldest entry with packets on queue */
  23628. s8_t old_queue = ARP_TABLE_SIZE;
  23629. 800edba: 240a movs r4, #10
  23630. 800edbc: 4a35 ldr r2, [pc, #212] ; (800ee94 <etharp_find_entry+0xe0>)
  23631. * @return The ARP entry index that matched or is created, ERR_MEM if no
  23632. * entry is found or could be recycled.
  23633. */
  23634. static s8_t
  23635. etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
  23636. {
  23637. 800edbe: 9101 str r1, [sp, #4]
  23638. 800edc0: 4606 mov r6, r0
  23639. s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
  23640. s8_t empty = ARP_TABLE_SIZE;
  23641. u8_t i = 0, age_pending = 0, age_stable = 0;
  23642. 800edc2: 46a8 mov r8, r5
  23643. 800edc4: 46aa mov sl, r5
  23644. * 4) remember the oldest pending entry with queued packets (if any)
  23645. * 5) search for a matching IP entry, either pending or stable
  23646. * until 5 matches, or all entries are searched for.
  23647. */
  23648. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  23649. 800edc6: 462b mov r3, r5
  23650. */
  23651. static s8_t
  23652. etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
  23653. {
  23654. s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
  23655. s8_t empty = ARP_TABLE_SIZE;
  23656. 800edc8: 4627 mov r7, r4
  23657. * entry is found or could be recycled.
  23658. */
  23659. static s8_t
  23660. etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
  23661. {
  23662. s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
  23663. 800edca: 46a4 mov ip, r4
  23664. 800edcc: 46a3 mov fp, r4
  23665. */
  23666. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  23667. u8_t state = arp_table[i].state;
  23668. /* no empty entry found yet and now we do find one? */
  23669. if ((empty == ARP_TABLE_SIZE) && (state == ETHARP_STATE_EMPTY)) {
  23670. 800edce: 2f0a cmp r7, #10
  23671. * 5) search for a matching IP entry, either pending or stable
  23672. * until 5 matches, or all entries are searched for.
  23673. */
  23674. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  23675. u8_t state = arp_table[i].state;
  23676. 800edd0: f892 9012 ldrb.w r9, [r2, #18]
  23677. /* no empty entry found yet and now we do find one? */
  23678. if ((empty == ARP_TABLE_SIZE) && (state == ETHARP_STATE_EMPTY)) {
  23679. 800edd4: d104 bne.n 800ede0 <etharp_find_entry+0x2c>
  23680. 800edd6: f1b9 0f00 cmp.w r9, #0
  23681. 800edda: d104 bne.n 800ede6 <etharp_find_entry+0x32>
  23682. LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_find_entry: found empty entry %"U16_F"\n", (u16_t)i));
  23683. /* remember first empty entry */
  23684. empty = i;
  23685. 800eddc: b2df uxtb r7, r3
  23686. 800edde: e023 b.n 800ee28 <etharp_find_entry+0x74>
  23687. } else if (state != ETHARP_STATE_EMPTY) {
  23688. 800ede0: f1b9 0f00 cmp.w r9, #0
  23689. 800ede4: d020 beq.n 800ee28 <etharp_find_entry+0x74>
  23690. LWIP_ASSERT("state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE",
  23691. state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE);
  23692. /* if given, does IP address match IP address in ARP entry? */
  23693. if (ipaddr && ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
  23694. 800ede6: b12e cbz r6, 800edf4 <etharp_find_entry+0x40>
  23695. 800ede8: 6830 ldr r0, [r6, #0]
  23696. 800edea: 6851 ldr r1, [r2, #4]
  23697. 800edec: 4288 cmp r0, r1
  23698. 800edee: d101 bne.n 800edf4 <etharp_find_entry+0x40>
  23699. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: found matching entry %"U16_F"\n", (u16_t)i));
  23700. /* found exact IP address match, simply bail out */
  23701. return i;
  23702. 800edf0: 4618 mov r0, r3
  23703. 800edf2: e04b b.n 800ee8c <etharp_find_entry+0xd8>
  23704. }
  23705. /* pending entry? */
  23706. if (state == ETHARP_STATE_PENDING) {
  23707. 800edf4: f1b9 0f01 cmp.w r9, #1
  23708. 800edf8: d10e bne.n 800ee18 <etharp_find_entry+0x64>
  23709. /* pending with queued packets? */
  23710. if (arp_table[i].q != NULL) {
  23711. 800edfa: 6810 ldr r0, [r2, #0]
  23712. if (arp_table[i].ctime >= age_queue) {
  23713. 800edfc: f892 9013 ldrb.w r9, [r2, #19]
  23714. return i;
  23715. }
  23716. /* pending entry? */
  23717. if (state == ETHARP_STATE_PENDING) {
  23718. /* pending with queued packets? */
  23719. if (arp_table[i].q != NULL) {
  23720. 800ee00: b120 cbz r0, 800ee0c <etharp_find_entry+0x58>
  23721. if (arp_table[i].ctime >= age_queue) {
  23722. 800ee02: 45a9 cmp r9, r5
  23723. 800ee04: d310 bcc.n 800ee28 <etharp_find_entry+0x74>
  23724. old_queue = i;
  23725. 800ee06: b2dc uxtb r4, r3
  23726. 800ee08: 464d mov r5, r9
  23727. 800ee0a: e00d b.n 800ee28 <etharp_find_entry+0x74>
  23728. age_queue = arp_table[i].ctime;
  23729. }
  23730. } else
  23731. /* pending without queued packets? */
  23732. {
  23733. if (arp_table[i].ctime >= age_pending) {
  23734. 800ee0c: 45d1 cmp r9, sl
  23735. 800ee0e: d30b bcc.n 800ee28 <etharp_find_entry+0x74>
  23736. old_pending = i;
  23737. 800ee10: fa5f fb83 uxtb.w fp, r3
  23738. 800ee14: 46ca mov sl, r9
  23739. 800ee16: e007 b.n 800ee28 <etharp_find_entry+0x74>
  23740. age_pending = arp_table[i].ctime;
  23741. }
  23742. }
  23743. /* stable entry? */
  23744. } else if (state >= ETHARP_STATE_STABLE) {
  23745. 800ee18: d906 bls.n 800ee28 <etharp_find_entry+0x74>
  23746. /* don't record old_stable for static entries since they never expire */
  23747. if (state < ETHARP_STATE_STATIC)
  23748. #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
  23749. {
  23750. /* remember entry with oldest stable entry in oldest, its age in maxtime */
  23751. if (arp_table[i].ctime >= age_stable) {
  23752. 800ee1a: f892 9013 ldrb.w r9, [r2, #19]
  23753. 800ee1e: 45c1 cmp r9, r8
  23754. old_stable = i;
  23755. 800ee20: bf24 itt cs
  23756. 800ee22: fa5f fc83 uxtbcs.w ip, r3
  23757. 800ee26: 46c8 movcs r8, r9
  23758. * 4) remember the oldest pending entry with queued packets (if any)
  23759. * 5) search for a matching IP entry, either pending or stable
  23760. * until 5 matches, or all entries are searched for.
  23761. */
  23762. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  23763. 800ee28: 3301 adds r3, #1
  23764. 800ee2a: b2db uxtb r3, r3
  23765. 800ee2c: 3214 adds r2, #20
  23766. 800ee2e: 2b0a cmp r3, #10
  23767. 800ee30: d1cd bne.n 800edce <etharp_find_entry+0x1a>
  23768. }
  23769. }
  23770. /* { we have no match } => try to create a new entry */
  23771. /* don't create new entry, only search? */
  23772. if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) ||
  23773. 800ee32: 9a01 ldr r2, [sp, #4]
  23774. 800ee34: f002 0302 and.w r3, r2, #2
  23775. 800ee38: b2db uxtb r3, r3
  23776. 800ee3a: bb33 cbnz r3, 800ee8a <etharp_find_entry+0xd6>
  23777. 800ee3c: 2f0a cmp r7, #10
  23778. 800ee3e: d102 bne.n 800ee46 <etharp_find_entry+0x92>
  23779. /* or no empty entry found and not allowed to recycle? */
  23780. ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_FLAG_TRY_HARD) == 0))) {
  23781. 800ee40: 07d3 lsls r3, r2, #31
  23782. 800ee42: d402 bmi.n 800ee4a <etharp_find_entry+0x96>
  23783. 800ee44: e021 b.n 800ee8a <etharp_find_entry+0xd6>
  23784. * { ETHARP_FLAG_TRY_HARD is set at this point }
  23785. */
  23786. /* 1) empty entry available? */
  23787. if (empty < ARP_TABLE_SIZE) {
  23788. i = empty;
  23789. 800ee46: b2fc uxtb r4, r7
  23790. 800ee48: e011 b.n 800ee6e <etharp_find_entry+0xba>
  23791. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting empty entry %"U16_F"\n", (u16_t)i));
  23792. } else {
  23793. /* 2) found recyclable stable entry? */
  23794. if (old_stable < ARP_TABLE_SIZE) {
  23795. 800ee4a: f1bc 0f0a cmp.w ip, #10
  23796. 800ee4e: d002 beq.n 800ee56 <etharp_find_entry+0xa2>
  23797. /* recycle oldest stable*/
  23798. i = old_stable;
  23799. 800ee50: fa5f f48c uxtb.w r4, ip
  23800. 800ee54: e008 b.n 800ee68 <etharp_find_entry+0xb4>
  23801. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest stable entry %"U16_F"\n", (u16_t)i));
  23802. /* no queued packets should exist on stable entries */
  23803. LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL);
  23804. /* 3) found recyclable pending entry without queued packets? */
  23805. } else if (old_pending < ARP_TABLE_SIZE) {
  23806. 800ee56: f1bb 0f0a cmp.w fp, #10
  23807. 800ee5a: d002 beq.n 800ee62 <etharp_find_entry+0xae>
  23808. /* recycle oldest pending */
  23809. i = old_pending;
  23810. 800ee5c: fa5f f48b uxtb.w r4, fp
  23811. 800ee60: e002 b.n 800ee68 <etharp_find_entry+0xb4>
  23812. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest pending entry %"U16_F" (without queue)\n", (u16_t)i));
  23813. /* 4) found recyclable pending entry with queued packets? */
  23814. } else if (old_queue < ARP_TABLE_SIZE) {
  23815. 800ee62: 2c0a cmp r4, #10
  23816. 800ee64: d011 beq.n 800ee8a <etharp_find_entry+0xd6>
  23817. /* recycle oldest pending (queued packets are free in etharp_free_entry) */
  23818. i = old_queue;
  23819. 800ee66: b2e4 uxtb r4, r4
  23820. return (s8_t)ERR_MEM;
  23821. }
  23822. /* { empty or recyclable entry found } */
  23823. LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE);
  23824. etharp_free_entry(i);
  23825. 800ee68: 4620 mov r0, r4
  23826. 800ee6a: f7ff ff8f bl 800ed8c <etharp_free_entry>
  23827. 800ee6e: 4b09 ldr r3, [pc, #36] ; (800ee94 <etharp_find_entry+0xe0>)
  23828. LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE);
  23829. LWIP_ASSERT("arp_table[i].state == ETHARP_STATE_EMPTY",
  23830. arp_table[i].state == ETHARP_STATE_EMPTY);
  23831. /* IP address given? */
  23832. if (ipaddr != NULL) {
  23833. 800ee70: b126 cbz r6, 800ee7c <etharp_find_entry+0xc8>
  23834. /* set IP address */
  23835. ip_addr_copy(arp_table[i].ipaddr, *ipaddr);
  23836. 800ee72: 2214 movs r2, #20
  23837. 800ee74: 6831 ldr r1, [r6, #0]
  23838. 800ee76: fb02 3204 mla r2, r2, r4, r3
  23839. 800ee7a: 6051 str r1, [r2, #4]
  23840. }
  23841. arp_table[i].ctime = 0;
  23842. 800ee7c: 2214 movs r2, #20
  23843. 800ee7e: fb02 3304 mla r3, r2, r4, r3
  23844. 800ee82: 2200 movs r2, #0
  23845. 800ee84: 74da strb r2, [r3, #19]
  23846. return (err_t)i;
  23847. 800ee86: 4620 mov r0, r4
  23848. 800ee88: e000 b.n 800ee8c <etharp_find_entry+0xd8>
  23849. /* don't create new entry, only search? */
  23850. if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) ||
  23851. /* or no empty entry found and not allowed to recycle? */
  23852. ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_FLAG_TRY_HARD) == 0))) {
  23853. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty entry found and not allowed to recycle\n"));
  23854. return (s8_t)ERR_MEM;
  23855. 800ee8a: 20ff movs r0, #255 ; 0xff
  23856. /* set IP address */
  23857. ip_addr_copy(arp_table[i].ipaddr, *ipaddr);
  23858. }
  23859. arp_table[i].ctime = 0;
  23860. return (err_t)i;
  23861. }
  23862. 800ee8c: b240 sxtb r0, r0
  23863. 800ee8e: e8bd 8ffe ldmia.w sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
  23864. 800ee92: bf00 nop
  23865. 800ee94: 20006bc4 .word 0x20006bc4
  23866. 0800ee98 <etharp_send_ip>:
  23867. * @params dst the destination MAC address to be copied into the ethernet header
  23868. * @return ERR_OK if the packet was sent, any other err_t on failure
  23869. */
  23870. static err_t
  23871. etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
  23872. {
  23873. 800ee98: b5f8 push {r3, r4, r5, r6, r7, lr}
  23874. struct eth_hdr *ethhdr = (struct eth_hdr *)p->payload;
  23875. 800ee9a: 684c ldr r4, [r1, #4]
  23876. * @params dst the destination MAC address to be copied into the ethernet header
  23877. * @return ERR_OK if the packet was sent, any other err_t on failure
  23878. */
  23879. static err_t
  23880. etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
  23881. {
  23882. 800ee9c: 4606 mov r6, r0
  23883. 800ee9e: 460d mov r5, r1
  23884. 800eea0: 4617 mov r7, r2
  23885. struct eth_hdr *ethhdr = (struct eth_hdr *)p->payload;
  23886. LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
  23887. (netif->hwaddr_len == ETHARP_HWADDR_LEN));
  23888. ETHADDR32_COPY(&ethhdr->dest, dst);
  23889. 800eea2: 4619 mov r1, r3
  23890. 800eea4: 2206 movs r2, #6
  23891. 800eea6: 4620 mov r0, r4
  23892. 800eea8: f7fa faac bl 8009404 <memcpy>
  23893. ETHADDR16_COPY(&ethhdr->src, src);
  23894. 800eeac: 4639 mov r1, r7
  23895. 800eeae: 1da0 adds r0, r4, #6
  23896. 800eeb0: 2206 movs r2, #6
  23897. 800eeb2: f7fa faa7 bl 8009404 <memcpy>
  23898. ethhdr->type = PP_HTONS(ETHTYPE_IP);
  23899. 800eeb6: 2308 movs r3, #8
  23900. 800eeb8: 7323 strb r3, [r4, #12]
  23901. 800eeba: 2300 movs r3, #0
  23902. 800eebc: 7363 strb r3, [r4, #13]
  23903. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_send_ip: sending packet %p\n", (void *)p));
  23904. /* send the packet */
  23905. return netif->linkoutput(netif, p);
  23906. 800eebe: 69b3 ldr r3, [r6, #24]
  23907. 800eec0: 4630 mov r0, r6
  23908. 800eec2: 4629 mov r1, r5
  23909. 800eec4: 4798 blx r3
  23910. }
  23911. 800eec6: bdf8 pop {r3, r4, r5, r6, r7, pc}
  23912. 0800eec8 <etharp_tmr>:
  23913. * This function should be called every ETHARP_TMR_INTERVAL milliseconds (5 seconds),
  23914. * in order to expire entries in the ARP table.
  23915. */
  23916. void
  23917. etharp_tmr(void)
  23918. {
  23919. 800eec8: b570 push {r4, r5, r6, lr}
  23920. 800eeca: 4c0d ldr r4, [pc, #52] ; (800ef00 <etharp_tmr+0x38>)
  23921. 800eecc: 2500 movs r5, #0
  23922. etharp_free_entry(i);
  23923. }
  23924. else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING) {
  23925. /* Reset state to stable, so that the next transmitted packet will
  23926. re-send an ARP request. */
  23927. arp_table[i].state = ETHARP_STATE_STABLE;
  23928. 800eece: 2602 movs r6, #2
  23929. LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
  23930. /* remove expired entries from the ARP table */
  23931. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  23932. u8_t state = arp_table[i].state;
  23933. if (state != ETHARP_STATE_EMPTY
  23934. 800eed0: 7ca3 ldrb r3, [r4, #18]
  23935. 800eed2: b183 cbz r3, 800eef6 <etharp_tmr+0x2e>
  23936. #if ETHARP_SUPPORT_STATIC_ENTRIES
  23937. && (state != ETHARP_STATE_STATIC)
  23938. #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
  23939. ) {
  23940. arp_table[i].ctime++;
  23941. 800eed4: 7ce2 ldrb r2, [r4, #19]
  23942. 800eed6: 3201 adds r2, #1
  23943. 800eed8: b2d2 uxtb r2, r2
  23944. if ((arp_table[i].ctime >= ARP_MAXAGE) ||
  23945. 800eeda: 2aef cmp r2, #239 ; 0xef
  23946. if (state != ETHARP_STATE_EMPTY
  23947. #if ETHARP_SUPPORT_STATIC_ENTRIES
  23948. && (state != ETHARP_STATE_STATIC)
  23949. #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
  23950. ) {
  23951. arp_table[i].ctime++;
  23952. 800eedc: 74e2 strb r2, [r4, #19]
  23953. if ((arp_table[i].ctime >= ARP_MAXAGE) ||
  23954. 800eede: d803 bhi.n 800eee8 <etharp_tmr+0x20>
  23955. 800eee0: 2b01 cmp r3, #1
  23956. 800eee2: d105 bne.n 800eef0 <etharp_tmr+0x28>
  23957. ((arp_table[i].state == ETHARP_STATE_PENDING) &&
  23958. 800eee4: 2a01 cmp r2, #1
  23959. 800eee6: d906 bls.n 800eef6 <etharp_tmr+0x2e>
  23960. (arp_table[i].ctime >= ARP_MAXPENDING))) {
  23961. /* pending or stable entry has become old! */
  23962. LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired %s entry %"U16_F".\n",
  23963. arp_table[i].state >= ETHARP_STATE_STABLE ? "stable" : "pending", (u16_t)i));
  23964. /* clean up entries that have just been expired */
  23965. etharp_free_entry(i);
  23966. 800eee8: 4628 mov r0, r5
  23967. 800eeea: f7ff ff4f bl 800ed8c <etharp_free_entry>
  23968. 800eeee: e002 b.n 800eef6 <etharp_tmr+0x2e>
  23969. }
  23970. else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING) {
  23971. 800eef0: 2b03 cmp r3, #3
  23972. /* Reset state to stable, so that the next transmitted packet will
  23973. re-send an ARP request. */
  23974. arp_table[i].state = ETHARP_STATE_STABLE;
  23975. 800eef2: bf08 it eq
  23976. 800eef4: 74a6 strbeq r6, [r4, #18]
  23977. 800eef6: 3501 adds r5, #1
  23978. 800eef8: 3414 adds r4, #20
  23979. {
  23980. u8_t i;
  23981. LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
  23982. /* remove expired entries from the ARP table */
  23983. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  23984. 800eefa: 2d0a cmp r5, #10
  23985. 800eefc: d1e8 bne.n 800eed0 <etharp_tmr+0x8>
  23986. /* resend an ARP query here? */
  23987. }
  23988. #endif /* ARP_QUEUEING */
  23989. }
  23990. }
  23991. }
  23992. 800eefe: bd70 pop {r4, r5, r6, pc}
  23993. 800ef00: 20006bc4 .word 0x20006bc4
  23994. 0800ef04 <etharp_cleanup_netif>:
  23995. * Remove all ARP table entries of the specified netif.
  23996. *
  23997. * @param netif points to a network interface
  23998. */
  23999. void etharp_cleanup_netif(struct netif *netif)
  24000. {
  24001. 800ef04: b570 push {r4, r5, r6, lr}
  24002. 800ef06: 4d08 ldr r5, [pc, #32] ; (800ef28 <etharp_cleanup_netif+0x24>)
  24003. 800ef08: 4606 mov r6, r0
  24004. 800ef0a: 2400 movs r4, #0
  24005. u8_t i;
  24006. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  24007. u8_t state = arp_table[i].state;
  24008. if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) {
  24009. 800ef0c: 7cab ldrb r3, [r5, #18]
  24010. 800ef0e: b12b cbz r3, 800ef1c <etharp_cleanup_netif+0x18>
  24011. 800ef10: 68ab ldr r3, [r5, #8]
  24012. 800ef12: 42b3 cmp r3, r6
  24013. 800ef14: d102 bne.n 800ef1c <etharp_cleanup_netif+0x18>
  24014. etharp_free_entry(i);
  24015. 800ef16: 4620 mov r0, r4
  24016. 800ef18: f7ff ff38 bl 800ed8c <etharp_free_entry>
  24017. 800ef1c: 3401 adds r4, #1
  24018. 800ef1e: 3514 adds r5, #20
  24019. */
  24020. void etharp_cleanup_netif(struct netif *netif)
  24021. {
  24022. u8_t i;
  24023. for (i = 0; i < ARP_TABLE_SIZE; ++i) {
  24024. 800ef20: 2c0a cmp r4, #10
  24025. 800ef22: d1f3 bne.n 800ef0c <etharp_cleanup_netif+0x8>
  24026. u8_t state = arp_table[i].state;
  24027. if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) {
  24028. etharp_free_entry(i);
  24029. }
  24030. }
  24031. }
  24032. 800ef24: bd70 pop {r4, r5, r6, pc}
  24033. 800ef26: bf00 nop
  24034. 800ef28: 20006bc4 .word 0x20006bc4
  24035. 0800ef2c <etharp_request>:
  24036. * ERR_MEM if the ARP packet couldn't be allocated
  24037. * any other err_t on failure
  24038. */
  24039. err_t
  24040. etharp_request(struct netif *netif, ip_addr_t *ipaddr)
  24041. {
  24042. 800ef2c: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
  24043. #endif /* LWIP_AUTOIP */
  24044. LWIP_ASSERT("netif != NULL", netif != NULL);
  24045. /* allocate a pbuf for the outgoing ARP request packet */
  24046. p = pbuf_alloc(PBUF_RAW, SIZEOF_ETHARP_PACKET, PBUF_RAM);
  24047. 800ef30: 2200 movs r2, #0
  24048. * ERR_MEM if the ARP packet couldn't be allocated
  24049. * any other err_t on failure
  24050. */
  24051. err_t
  24052. etharp_request(struct netif *netif, ip_addr_t *ipaddr)
  24053. {
  24054. 800ef32: 4606 mov r6, r0
  24055. 800ef34: 4688 mov r8, r1
  24056. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n"));
  24057. return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, &ethbroadcast,
  24058. (struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero,
  24059. 800ef36: f100 0727 add.w r7, r0, #39 ; 0x27
  24060. 800ef3a: f100 0904 add.w r9, r0, #4
  24061. #endif /* LWIP_AUTOIP */
  24062. LWIP_ASSERT("netif != NULL", netif != NULL);
  24063. /* allocate a pbuf for the outgoing ARP request packet */
  24064. p = pbuf_alloc(PBUF_RAW, SIZEOF_ETHARP_PACKET, PBUF_RAM);
  24065. 800ef3e: 212a movs r1, #42 ; 0x2a
  24066. 800ef40: 2003 movs r0, #3
  24067. 800ef42: f7fc fb10 bl 800b566 <pbuf_alloc>
  24068. /* could allocate a pbuf for an ARP request? */
  24069. if (p == NULL) {
  24070. 800ef46: 4605 mov r5, r0
  24071. 800ef48: b928 cbnz r0, 800ef56 <etharp_request+0x2a>
  24072. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
  24073. ("etharp_raw: could not allocate pbuf for ARP request.\n"));
  24074. ETHARP_STATS_INC(etharp.memerr);
  24075. 800ef4a: 4b24 ldr r3, [pc, #144] ; (800efdc <etharp_request+0xb0>)
  24076. 800ef4c: 8c9a ldrh r2, [r3, #36] ; 0x24
  24077. 800ef4e: 3201 adds r2, #1
  24078. 800ef50: 849a strh r2, [r3, #36] ; 0x24
  24079. return ERR_MEM;
  24080. 800ef52: 24ff movs r4, #255 ; 0xff
  24081. 800ef54: e03f b.n 800efd6 <etharp_request+0xaa>
  24082. }
  24083. LWIP_ASSERT("check that first pbuf can hold struct etharp_hdr",
  24084. (p->len >= SIZEOF_ETHARP_PACKET));
  24085. ethhdr = (struct eth_hdr *)p->payload;
  24086. 800ef56: 6844 ldr r4, [r0, #4]
  24087. hdr = (struct etharp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
  24088. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n"));
  24089. hdr->opcode = htons(opcode);
  24090. 800ef58: 2001 movs r0, #1
  24091. 800ef5a: f7fb f946 bl 800a1ea <lwip_htons>
  24092. * 'sender IP address' MUST be sent using link-layer broadcast instead of
  24093. * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
  24094. ethdst_hwaddr = ip_addr_islinklocal(ipsrc_addr) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
  24095. #endif /* LWIP_AUTOIP */
  24096. /* Write the ARP MAC-Addresses */
  24097. ETHADDR16_COPY(&hdr->shwaddr, hwsrc_addr);
  24098. 800ef5e: 4639 mov r1, r7
  24099. (p->len >= SIZEOF_ETHARP_PACKET));
  24100. ethhdr = (struct eth_hdr *)p->payload;
  24101. hdr = (struct etharp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
  24102. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n"));
  24103. hdr->opcode = htons(opcode);
  24104. 800ef60: 82a0 strh r0, [r4, #20]
  24105. * 'sender IP address' MUST be sent using link-layer broadcast instead of
  24106. * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
  24107. ethdst_hwaddr = ip_addr_islinklocal(ipsrc_addr) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
  24108. #endif /* LWIP_AUTOIP */
  24109. /* Write the ARP MAC-Addresses */
  24110. ETHADDR16_COPY(&hdr->shwaddr, hwsrc_addr);
  24111. 800ef62: 2206 movs r2, #6
  24112. 800ef64: f104 0016 add.w r0, r4, #22
  24113. 800ef68: f7fa fa4c bl 8009404 <memcpy>
  24114. ETHADDR16_COPY(&hdr->dhwaddr, hwdst_addr);
  24115. 800ef6c: f104 0020 add.w r0, r4, #32
  24116. 800ef70: 491b ldr r1, [pc, #108] ; (800efe0 <etharp_request+0xb4>)
  24117. 800ef72: 2206 movs r2, #6
  24118. 800ef74: f7fa fa46 bl 8009404 <memcpy>
  24119. /* Write the Ethernet MAC-Addresses */
  24120. #if LWIP_AUTOIP
  24121. ETHADDR16_COPY(&ethhdr->dest, ethdst_hwaddr);
  24122. #else /* LWIP_AUTOIP */
  24123. ETHADDR16_COPY(&ethhdr->dest, ethdst_addr);
  24124. 800ef78: 4620 mov r0, r4
  24125. 800ef7a: 491a ldr r1, [pc, #104] ; (800efe4 <etharp_request+0xb8>)
  24126. 800ef7c: 2206 movs r2, #6
  24127. 800ef7e: f7fa fa41 bl 8009404 <memcpy>
  24128. #endif /* LWIP_AUTOIP */
  24129. ETHADDR16_COPY(&ethhdr->src, ethsrc_addr);
  24130. 800ef82: 1da0 adds r0, r4, #6
  24131. 800ef84: 4639 mov r1, r7
  24132. 800ef86: 2206 movs r2, #6
  24133. 800ef88: f7fa fa3c bl 8009404 <memcpy>
  24134. /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
  24135. * structure packing. */
  24136. IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr);
  24137. 800ef8c: f104 001c add.w r0, r4, #28
  24138. 800ef90: 4649 mov r1, r9
  24139. 800ef92: 2204 movs r2, #4
  24140. 800ef94: f7fa fa36 bl 8009404 <memcpy>
  24141. IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
  24142. 800ef98: f104 0026 add.w r0, r4, #38 ; 0x26
  24143. 800ef9c: 4641 mov r1, r8
  24144. 800ef9e: 2204 movs r2, #4
  24145. 800efa0: f7fa fa30 bl 8009404 <memcpy>
  24146. hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
  24147. 800efa4: 2300 movs r3, #0
  24148. 800efa6: 2201 movs r2, #1
  24149. 800efa8: 73a3 strb r3, [r4, #14]
  24150. 800efaa: 73e2 strb r2, [r4, #15]
  24151. hdr->proto = PP_HTONS(ETHTYPE_IP);
  24152. 800efac: 7463 strb r3, [r4, #17]
  24153. 800efae: 2208 movs r2, #8
  24154. /* set hwlen and protolen */
  24155. hdr->hwlen = ETHARP_HWADDR_LEN;
  24156. 800efb0: 2306 movs r3, #6
  24157. hdr->protolen = sizeof(ip_addr_t);
  24158. 800efb2: 2104 movs r1, #4
  24159. * structure packing. */
  24160. IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr);
  24161. IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
  24162. hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
  24163. hdr->proto = PP_HTONS(ETHTYPE_IP);
  24164. 800efb4: 7422 strb r2, [r4, #16]
  24165. /* set hwlen and protolen */
  24166. hdr->hwlen = ETHARP_HWADDR_LEN;
  24167. hdr->protolen = sizeof(ip_addr_t);
  24168. 800efb6: 74e1 strb r1, [r4, #19]
  24169. ethhdr->type = PP_HTONS(ETHTYPE_ARP);
  24170. 800efb8: 7322 strb r2, [r4, #12]
  24171. IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
  24172. hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
  24173. hdr->proto = PP_HTONS(ETHTYPE_IP);
  24174. /* set hwlen and protolen */
  24175. hdr->hwlen = ETHARP_HWADDR_LEN;
  24176. 800efba: 74a3 strb r3, [r4, #18]
  24177. hdr->protolen = sizeof(ip_addr_t);
  24178. ethhdr->type = PP_HTONS(ETHTYPE_ARP);
  24179. 800efbc: 7363 strb r3, [r4, #13]
  24180. /* send ARP query */
  24181. result = netif->linkoutput(netif, p);
  24182. 800efbe: 69b3 ldr r3, [r6, #24]
  24183. 800efc0: 4630 mov r0, r6
  24184. 800efc2: 4629 mov r1, r5
  24185. 800efc4: 4798 blx r3
  24186. ETHARP_STATS_INC(etharp.xmit);
  24187. 800efc6: 4b05 ldr r3, [pc, #20] ; (800efdc <etharp_request+0xb0>)
  24188. 800efc8: 8b1a ldrh r2, [r3, #24]
  24189. hdr->hwlen = ETHARP_HWADDR_LEN;
  24190. hdr->protolen = sizeof(ip_addr_t);
  24191. ethhdr->type = PP_HTONS(ETHTYPE_ARP);
  24192. /* send ARP query */
  24193. result = netif->linkoutput(netif, p);
  24194. 800efca: 4604 mov r4, r0
  24195. ETHARP_STATS_INC(etharp.xmit);
  24196. 800efcc: 3201 adds r2, #1
  24197. /* free ARP query packet */
  24198. pbuf_free(p);
  24199. 800efce: 4628 mov r0, r5
  24200. hdr->protolen = sizeof(ip_addr_t);
  24201. ethhdr->type = PP_HTONS(ETHTYPE_ARP);
  24202. /* send ARP query */
  24203. result = netif->linkoutput(netif, p);
  24204. ETHARP_STATS_INC(etharp.xmit);
  24205. 800efd0: 831a strh r2, [r3, #24]
  24206. /* free ARP query packet */
  24207. pbuf_free(p);
  24208. 800efd2: f7fc fa77 bl 800b4c4 <pbuf_free>
  24209. {
  24210. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n"));
  24211. return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, &ethbroadcast,
  24212. (struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero,
  24213. ipaddr, ARP_REQUEST);
  24214. }
  24215. 800efd6: b260 sxtb r0, r4
  24216. 800efd8: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
  24217. 800efdc: 20008220 .word 0x20008220
  24218. 800efe0: 0801188a .word 0x0801188a
  24219. 800efe4: 08011884 .word 0x08011884
  24220. 0800efe8 <etharp_query>:
  24221. * - ERR_ARG Non-unicast address given, those will not appear in ARP cache.
  24222. *
  24223. */
  24224. err_t
  24225. etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
  24226. {
  24227. 800efe8: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  24228. 800efec: 4607 mov r7, r0
  24229. 800efee: 460e mov r6, r1
  24230. struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
  24231. err_t result = ERR_MEM;
  24232. s8_t i; /* ARP entry index */
  24233. /* non-unicast address? */
  24234. if (ip_addr_isbroadcast(ipaddr, netif) ||
  24235. 800eff0: 6808 ldr r0, [r1, #0]
  24236. 800eff2: 4639 mov r1, r7
  24237. * - ERR_ARG Non-unicast address given, those will not appear in ARP cache.
  24238. *
  24239. */
  24240. err_t
  24241. etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
  24242. {
  24243. 800eff4: 4615 mov r5, r2
  24244. struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
  24245. err_t result = ERR_MEM;
  24246. s8_t i; /* ARP entry index */
  24247. /* non-unicast address? */
  24248. if (ip_addr_isbroadcast(ipaddr, netif) ||
  24249. 800eff6: f7ff f9c4 bl 800e382 <ip4_addr_isbroadcast>
  24250. 800effa: 2800 cmp r0, #0
  24251. 800effc: d164 bne.n 800f0c8 <etharp_query+0xe0>
  24252. ip_addr_ismulticast(ipaddr) ||
  24253. 800effe: 6833 ldr r3, [r6, #0]
  24254. 800f000: f003 02f0 and.w r2, r3, #240 ; 0xf0
  24255. struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
  24256. err_t result = ERR_MEM;
  24257. s8_t i; /* ARP entry index */
  24258. /* non-unicast address? */
  24259. if (ip_addr_isbroadcast(ipaddr, netif) ||
  24260. 800f004: 2ae0 cmp r2, #224 ; 0xe0
  24261. 800f006: d05f beq.n 800f0c8 <etharp_query+0xe0>
  24262. ip_addr_ismulticast(ipaddr) ||
  24263. ip_addr_isany(ipaddr)) {
  24264. 800f008: 2b00 cmp r3, #0
  24265. 800f00a: d05d beq.n 800f0c8 <etharp_query+0xe0>
  24266. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n"));
  24267. return ERR_ARG;
  24268. }
  24269. /* find entry in ARP cache, ask to create entry if queueing packet */
  24270. i = etharp_find_entry(ipaddr, ETHARP_FLAG_TRY_HARD);
  24271. 800f00c: 2101 movs r1, #1
  24272. 800f00e: 4630 mov r0, r6
  24273. 800f010: f7ff fed0 bl 800edb4 <etharp_find_entry>
  24274. /* could not find or create entry? */
  24275. if (i < 0) {
  24276. 800f014: 1e04 subs r4, r0, #0
  24277. 800f016: da06 bge.n 800f026 <etharp_query+0x3e>
  24278. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not create ARP entry\n"));
  24279. if (q) {
  24280. 800f018: 2d00 cmp r5, #0
  24281. 800f01a: d05a beq.n 800f0d2 <etharp_query+0xea>
  24282. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: packet dropped\n"));
  24283. ETHARP_STATS_INC(etharp.memerr);
  24284. 800f01c: 4b36 ldr r3, [pc, #216] ; (800f0f8 <etharp_query+0x110>)
  24285. 800f01e: 8c9a ldrh r2, [r3, #36] ; 0x24
  24286. 800f020: 3201 adds r2, #1
  24287. 800f022: 849a strh r2, [r3, #36] ; 0x24
  24288. 800f024: e055 b.n 800f0d2 <etharp_query+0xea>
  24289. }
  24290. return (err_t)i;
  24291. }
  24292. /* mark a fresh entry as pending (we just sent a request) */
  24293. if (arp_table[i].state == ETHARP_STATE_EMPTY) {
  24294. 800f026: 4935 ldr r1, [pc, #212] ; (800f0fc <etharp_query+0x114>)
  24295. 800f028: 2214 movs r2, #20
  24296. 800f02a: fb02 1304 mla r3, r2, r4, r1
  24297. 800f02e: 3310 adds r3, #16
  24298. 800f030: 7898 ldrb r0, [r3, #2]
  24299. 800f032: b908 cbnz r0, 800f038 <etharp_query+0x50>
  24300. arp_table[i].state = ETHARP_STATE_PENDING;
  24301. 800f034: 2001 movs r0, #1
  24302. 800f036: 7098 strb r0, [r3, #2]
  24303. LWIP_ASSERT("arp_table[i].state == PENDING or STABLE",
  24304. ((arp_table[i].state == ETHARP_STATE_PENDING) ||
  24305. (arp_table[i].state >= ETHARP_STATE_STABLE)));
  24306. /* do we have a pending entry? or an implicit query request? */
  24307. if ((arp_table[i].state == ETHARP_STATE_PENDING) || (q == NULL)) {
  24308. 800f038: fb02 1204 mla r2, r2, r4, r1
  24309. 800f03c: 7c93 ldrb r3, [r2, #18]
  24310. 800f03e: 2b01 cmp r3, #1
  24311. 800f040: d000 beq.n 800f044 <etharp_query+0x5c>
  24312. 800f042: b935 cbnz r5, 800f052 <etharp_query+0x6a>
  24313. /* try to resolve it; send out ARP request */
  24314. result = etharp_request(netif, ipaddr);
  24315. 800f044: 4638 mov r0, r7
  24316. 800f046: 4631 mov r1, r6
  24317. 800f048: f7ff ff70 bl 800ef2c <etharp_request>
  24318. 800f04c: 4602 mov r2, r0
  24319. /* ARP request couldn't be sent */
  24320. /* We don't re-send arp request in etharp_tmr, but we still queue packets,
  24321. since this failure could be temporary, and the next packet calling
  24322. etharp_query again could lead to sending the queued packets. */
  24323. }
  24324. if (q == NULL) {
  24325. 800f04e: b90d cbnz r5, 800f054 <etharp_query+0x6c>
  24326. 800f050: e03c b.n 800f0cc <etharp_query+0xe4>
  24327. */
  24328. err_t
  24329. etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
  24330. {
  24331. struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
  24332. err_t result = ERR_MEM;
  24333. 800f052: 22ff movs r2, #255 ; 0xff
  24334. }
  24335. /* packet given? */
  24336. LWIP_ASSERT("q != NULL", q != NULL);
  24337. /* stable entry? */
  24338. if (arp_table[i].state >= ETHARP_STATE_STABLE) {
  24339. 800f054: 2314 movs r3, #20
  24340. 800f056: 4929 ldr r1, [pc, #164] ; (800f0fc <etharp_query+0x114>)
  24341. 800f058: 4363 muls r3, r4
  24342. 800f05a: 18c8 adds r0, r1, r3
  24343. 800f05c: 7c80 ldrb r0, [r0, #18]
  24344. 800f05e: 2801 cmp r0, #1
  24345. 800f060: d90b bls.n 800f07a <etharp_query+0x92>
  24346. /* we have a valid IP->Ethernet address mapping */
  24347. ETHARP_SET_HINT(netif, i);
  24348. 800f062: 4a27 ldr r2, [pc, #156] ; (800f100 <etharp_query+0x118>)
  24349. /* send the packet */
  24350. result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
  24351. 800f064: 18cb adds r3, r1, r3
  24352. /* packet given? */
  24353. LWIP_ASSERT("q != NULL", q != NULL);
  24354. /* stable entry? */
  24355. if (arp_table[i].state >= ETHARP_STATE_STABLE) {
  24356. /* we have a valid IP->Ethernet address mapping */
  24357. ETHARP_SET_HINT(netif, i);
  24358. 800f066: 7014 strb r4, [r2, #0]
  24359. /* send the packet */
  24360. result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
  24361. 800f068: 4638 mov r0, r7
  24362. 800f06a: 4629 mov r1, r5
  24363. 800f06c: f107 0227 add.w r2, r7, #39 ; 0x27
  24364. 800f070: 330c adds r3, #12
  24365. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q));
  24366. result = ERR_MEM;
  24367. }
  24368. }
  24369. return result;
  24370. }
  24371. 800f072: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
  24372. /* stable entry? */
  24373. if (arp_table[i].state >= ETHARP_STATE_STABLE) {
  24374. /* we have a valid IP->Ethernet address mapping */
  24375. ETHARP_SET_HINT(netif, i);
  24376. /* send the packet */
  24377. result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
  24378. 800f076: f7ff bf0f b.w 800ee98 <etharp_send_ip>
  24379. /* pending entry? (either just created or already pending */
  24380. } else if (arp_table[i].state == ETHARP_STATE_PENDING) {
  24381. 800f07a: d129 bne.n 800f0d0 <etharp_query+0xe8>
  24382. 800f07c: 462b mov r3, r5
  24383. 800f07e: e003 b.n 800f088 <etharp_query+0xa0>
  24384. * to copy the whole queue into a new PBUF_RAM (see bug #11400)
  24385. * PBUF_ROMs can be left as they are, since ROM must not get changed. */
  24386. p = q;
  24387. while (p) {
  24388. LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0));
  24389. if(p->type != PBUF_ROM) {
  24390. 800f080: 7b1a ldrb r2, [r3, #12]
  24391. 800f082: 2a01 cmp r2, #1
  24392. 800f084: d128 bne.n 800f0d8 <etharp_query+0xf0>
  24393. copy_needed = 1;
  24394. break;
  24395. }
  24396. p = p->next;
  24397. 800f086: 681b ldr r3, [r3, #0]
  24398. int copy_needed = 0;
  24399. /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but
  24400. * to copy the whole queue into a new PBUF_RAM (see bug #11400)
  24401. * PBUF_ROMs can be left as they are, since ROM must not get changed. */
  24402. p = q;
  24403. while (p) {
  24404. 800f088: 2b00 cmp r3, #0
  24405. 800f08a: d1f9 bne.n 800f080 <etharp_query+0x98>
  24406. 800f08c: e02d b.n 800f0ea <etharp_query+0x102>
  24407. }
  24408. if(copy_needed) {
  24409. /* copy the whole packet into new pbufs */
  24410. p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
  24411. if(p != NULL) {
  24412. if (pbuf_copy(p, q) != ERR_OK) {
  24413. 800f08e: 4629 mov r1, r5
  24414. 800f090: f7fc fb18 bl 800b6c4 <pbuf_copy>
  24415. 800f094: b120 cbz r0, 800f0a0 <etharp_query+0xb8>
  24416. pbuf_free(p);
  24417. 800f096: 4630 mov r0, r6
  24418. 800f098: f7fc fa14 bl 800b4c4 <pbuf_free>
  24419. 800f09c: e00e b.n 800f0bc <etharp_query+0xd4>
  24420. /* referencing the old pbuf is enough */
  24421. p = q;
  24422. pbuf_ref(p);
  24423. }
  24424. /* packet could be taken over? */
  24425. if (p != NULL) {
  24426. 800f09e: 462e mov r6, r5
  24427. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q));
  24428. result = ERR_MEM;
  24429. }
  24430. #else /* ARP_QUEUEING */
  24431. /* always queue one packet per ARP request only, freeing a previously queued packet */
  24432. if (arp_table[i].q != NULL) {
  24433. 800f0a0: 2314 movs r3, #20
  24434. 800f0a2: 4a16 ldr r2, [pc, #88] ; (800f0fc <etharp_query+0x114>)
  24435. 800f0a4: fb03 f104 mul.w r1, r3, r4
  24436. 800f0a8: 4615 mov r5, r2
  24437. 800f0aa: 5850 ldr r0, [r2, r1]
  24438. 800f0ac: 461f mov r7, r3
  24439. 800f0ae: b108 cbz r0, 800f0b4 <etharp_query+0xcc>
  24440. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: dropped previously queued packet %p for ARP entry %"S16_F"\n", (void *)q, (s16_t)i));
  24441. pbuf_free(arp_table[i].q);
  24442. 800f0b0: f7fc fa08 bl 800b4c4 <pbuf_free>
  24443. }
  24444. arp_table[i].q = p;
  24445. 800f0b4: 437c muls r4, r7
  24446. 800f0b6: 512e str r6, [r5, r4]
  24447. result = ERR_OK;
  24448. 800f0b8: 2400 movs r4, #0
  24449. 800f0ba: e00a b.n 800f0d2 <etharp_query+0xea>
  24450. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i));
  24451. #endif /* ARP_QUEUEING */
  24452. } else {
  24453. ETHARP_STATS_INC(etharp.memerr);
  24454. 800f0bc: 4b0e ldr r3, [pc, #56] ; (800f0f8 <etharp_query+0x110>)
  24455. 800f0be: 8c9a ldrh r2, [r3, #36] ; 0x24
  24456. 800f0c0: 3201 adds r2, #1
  24457. 800f0c2: 849a strh r2, [r3, #36] ; 0x24
  24458. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q));
  24459. result = ERR_MEM;
  24460. 800f0c4: 24ff movs r4, #255 ; 0xff
  24461. 800f0c6: e004 b.n 800f0d2 <etharp_query+0xea>
  24462. /* non-unicast address? */
  24463. if (ip_addr_isbroadcast(ipaddr, netif) ||
  24464. ip_addr_ismulticast(ipaddr) ||
  24465. ip_addr_isany(ipaddr)) {
  24466. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n"));
  24467. return ERR_ARG;
  24468. 800f0c8: 24f2 movs r4, #242 ; 0xf2
  24469. 800f0ca: e002 b.n 800f0d2 <etharp_query+0xea>
  24470. /* We don't re-send arp request in etharp_tmr, but we still queue packets,
  24471. since this failure could be temporary, and the next packet calling
  24472. etharp_query again could lead to sending the queued packets. */
  24473. }
  24474. if (q == NULL) {
  24475. return result;
  24476. 800f0cc: 4604 mov r4, r0
  24477. 800f0ce: e000 b.n 800f0d2 <etharp_query+0xea>
  24478. /* we have a valid IP->Ethernet address mapping */
  24479. ETHARP_SET_HINT(netif, i);
  24480. /* send the packet */
  24481. result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
  24482. /* pending entry? (either just created or already pending */
  24483. } else if (arp_table[i].state == ETHARP_STATE_PENDING) {
  24484. 800f0d0: 4614 mov r4, r2
  24485. 800f0d2: b260 sxtb r0, r4
  24486. 800f0d4: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  24487. }
  24488. p = p->next;
  24489. }
  24490. if(copy_needed) {
  24491. /* copy the whole packet into new pbufs */
  24492. p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
  24493. 800f0d8: 2003 movs r0, #3
  24494. 800f0da: 8919 ldrh r1, [r3, #8]
  24495. 800f0dc: 2200 movs r2, #0
  24496. 800f0de: f7fc fa42 bl 800b566 <pbuf_alloc>
  24497. if(p != NULL) {
  24498. 800f0e2: 4606 mov r6, r0
  24499. 800f0e4: 2800 cmp r0, #0
  24500. 800f0e6: d1d2 bne.n 800f08e <etharp_query+0xa6>
  24501. 800f0e8: e7e8 b.n 800f0bc <etharp_query+0xd4>
  24502. }
  24503. }
  24504. } else {
  24505. /* referencing the old pbuf is enough */
  24506. p = q;
  24507. pbuf_ref(p);
  24508. 800f0ea: 4628 mov r0, r5
  24509. 800f0ec: f7fc facb bl 800b686 <pbuf_ref>
  24510. }
  24511. /* packet could be taken over? */
  24512. if (p != NULL) {
  24513. 800f0f0: 2d00 cmp r5, #0
  24514. 800f0f2: d1d4 bne.n 800f09e <etharp_query+0xb6>
  24515. 800f0f4: e7e2 b.n 800f0bc <etharp_query+0xd4>
  24516. 800f0f6: bf00 nop
  24517. 800f0f8: 20008220 .word 0x20008220
  24518. 800f0fc: 20006bc4 .word 0x20006bc4
  24519. 800f100: 20006bc2 .word 0x20006bc2
  24520. 0800f104 <etharp_output_to_arp_index>:
  24521. /** Just a small helper function that sends a pbuf to an ethernet address
  24522. * in the arp_table specified by the index 'arp_idx'.
  24523. */
  24524. static err_t
  24525. etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
  24526. {
  24527. 800f104: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  24528. LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
  24529. arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
  24530. /* if arp table entry is about to expire: re-request it,
  24531. but only if its state is ETHARP_STATE_STABLE to prevent flooding the
  24532. network with ARP requests if this address is used frequently. */
  24533. if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
  24534. 800f108: 4b10 ldr r3, [pc, #64] ; (800f14c <etharp_output_to_arp_index+0x48>)
  24535. /** Just a small helper function that sends a pbuf to an ethernet address
  24536. * in the arp_table specified by the index 'arp_idx'.
  24537. */
  24538. static err_t
  24539. etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
  24540. {
  24541. 800f10a: 4615 mov r5, r2
  24542. LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
  24543. arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
  24544. /* if arp table entry is about to expire: re-request it,
  24545. but only if its state is ETHARP_STATE_STABLE to prevent flooding the
  24546. network with ARP requests if this address is used frequently. */
  24547. if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
  24548. 800f10c: 2214 movs r2, #20
  24549. /** Just a small helper function that sends a pbuf to an ethernet address
  24550. * in the arp_table specified by the index 'arp_idx'.
  24551. */
  24552. static err_t
  24553. etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
  24554. {
  24555. 800f10e: 460e mov r6, r1
  24556. LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
  24557. arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
  24558. /* if arp table entry is about to expire: re-request it,
  24559. but only if its state is ETHARP_STATE_STABLE to prevent flooding the
  24560. network with ARP requests if this address is used frequently. */
  24561. if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
  24562. 800f110: fb02 3105 mla r1, r2, r5, r3
  24563. /** Just a small helper function that sends a pbuf to an ethernet address
  24564. * in the arp_table specified by the index 'arp_idx'.
  24565. */
  24566. static err_t
  24567. etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
  24568. {
  24569. 800f114: 4607 mov r7, r0
  24570. LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
  24571. arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
  24572. /* if arp table entry is about to expire: re-request it,
  24573. but only if its state is ETHARP_STATE_STABLE to prevent flooding the
  24574. network with ARP requests if this address is used frequently. */
  24575. if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
  24576. 800f116: 7c8a ldrb r2, [r1, #18]
  24577. 800f118: 2a02 cmp r2, #2
  24578. 800f11a: f101 0410 add.w r4, r1, #16
  24579. 800f11e: d108 bne.n 800f132 <etharp_output_to_arp_index+0x2e>
  24580. 800f120: 7cca ldrb r2, [r1, #19]
  24581. 800f122: 2ae3 cmp r2, #227 ; 0xe3
  24582. 800f124: d905 bls.n 800f132 <etharp_output_to_arp_index+0x2e>
  24583. (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED)) {
  24584. if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) {
  24585. 800f126: 3104 adds r1, #4
  24586. 800f128: f7ff ff00 bl 800ef2c <etharp_request>
  24587. 800f12c: b908 cbnz r0, 800f132 <etharp_output_to_arp_index+0x2e>
  24588. arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING;
  24589. 800f12e: 2303 movs r3, #3
  24590. 800f130: 70a3 strb r3, [r4, #2]
  24591. }
  24592. }
  24593. return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
  24594. 800f132: 4b06 ldr r3, [pc, #24] ; (800f14c <etharp_output_to_arp_index+0x48>)
  24595. 800f134: 2214 movs r2, #20
  24596. 800f136: fb02 3305 mla r3, r2, r5, r3
  24597. 800f13a: 4638 mov r0, r7
  24598. 800f13c: 4631 mov r1, r6
  24599. 800f13e: f107 0227 add.w r2, r7, #39 ; 0x27
  24600. 800f142: 330c adds r3, #12
  24601. &arp_table[arp_idx].ethaddr);
  24602. }
  24603. 800f144: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
  24604. if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) {
  24605. arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING;
  24606. }
  24607. }
  24608. return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
  24609. 800f148: f7ff bea6 b.w 800ee98 <etharp_send_ip>
  24610. 800f14c: 20006bc4 .word 0x20006bc4
  24611. 0800f150 <etharp_output>:
  24612. * - ERR_RTE No route to destination (no gateway to external networks),
  24613. * or the return type of either etharp_query() or etharp_send_ip().
  24614. */
  24615. err_t
  24616. etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
  24617. {
  24618. 800f150: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
  24619. 800f152: 4604 mov r4, r0
  24620. 800f154: 460e mov r6, r1
  24621. LWIP_ASSERT("netif != NULL", netif != NULL);
  24622. LWIP_ASSERT("q != NULL", q != NULL);
  24623. LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL);
  24624. /* make room for Ethernet header - should not fail */
  24625. if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
  24626. 800f156: 4608 mov r0, r1
  24627. 800f158: 210e movs r1, #14
  24628. * - ERR_RTE No route to destination (no gateway to external networks),
  24629. * or the return type of either etharp_query() or etharp_send_ip().
  24630. */
  24631. err_t
  24632. etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
  24633. {
  24634. 800f15a: 4615 mov r5, r2
  24635. LWIP_ASSERT("netif != NULL", netif != NULL);
  24636. LWIP_ASSERT("q != NULL", q != NULL);
  24637. LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL);
  24638. /* make room for Ethernet header - should not fail */
  24639. if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
  24640. 800f15c: f7fc f987 bl 800b46e <pbuf_header>
  24641. 800f160: b128 cbz r0, 800f16e <etharp_output+0x1e>
  24642. /* bail out */
  24643. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
  24644. ("etharp_output: could not allocate room for header.\n"));
  24645. LINK_STATS_INC(link.lenerr);
  24646. 800f162: 4b38 ldr r3, [pc, #224] ; (800f244 <etharp_output+0xf4>)
  24647. 800f164: 895a ldrh r2, [r3, #10]
  24648. 800f166: 3201 adds r2, #1
  24649. 800f168: 815a strh r2, [r3, #10]
  24650. return ERR_BUF;
  24651. 800f16a: 20fe movs r0, #254 ; 0xfe
  24652. 800f16c: e068 b.n 800f240 <etharp_output+0xf0>
  24653. /* Determine on destination hardware address. Broadcasts and multicasts
  24654. * are special, other IP addresses are looked up in the ARP table. */
  24655. /* broadcast destination IP address? */
  24656. if (ip_addr_isbroadcast(ipaddr, netif)) {
  24657. 800f16e: 6828 ldr r0, [r5, #0]
  24658. 800f170: 4621 mov r1, r4
  24659. 800f172: f7ff f906 bl 800e382 <ip4_addr_isbroadcast>
  24660. 800f176: 2800 cmp r0, #0
  24661. 800f178: d159 bne.n 800f22e <etharp_output+0xde>
  24662. /* broadcast on Ethernet also */
  24663. dest = (struct eth_addr *)&ethbroadcast;
  24664. /* multicast destination IP address? */
  24665. } else if (ip_addr_ismulticast(ipaddr)) {
  24666. 800f17a: 682b ldr r3, [r5, #0]
  24667. 800f17c: f003 02f0 and.w r2, r3, #240 ; 0xf0
  24668. 800f180: 2ae0 cmp r2, #224 ; 0xe0
  24669. 800f182: d114 bne.n 800f1ae <etharp_output+0x5e>
  24670. /* Hash IP multicast address to MAC address.*/
  24671. mcastaddr.addr[0] = LL_MULTICAST_ADDR_0;
  24672. 800f184: 2301 movs r3, #1
  24673. 800f186: f88d 3000 strb.w r3, [sp]
  24674. mcastaddr.addr[1] = LL_MULTICAST_ADDR_1;
  24675. mcastaddr.addr[2] = LL_MULTICAST_ADDR_2;
  24676. 800f18a: 235e movs r3, #94 ; 0x5e
  24677. 800f18c: f88d 3002 strb.w r3, [sp, #2]
  24678. mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f;
  24679. 800f190: 786b ldrb r3, [r5, #1]
  24680. dest = (struct eth_addr *)&ethbroadcast;
  24681. /* multicast destination IP address? */
  24682. } else if (ip_addr_ismulticast(ipaddr)) {
  24683. /* Hash IP multicast address to MAC address.*/
  24684. mcastaddr.addr[0] = LL_MULTICAST_ADDR_0;
  24685. mcastaddr.addr[1] = LL_MULTICAST_ADDR_1;
  24686. 800f192: f88d 0001 strb.w r0, [sp, #1]
  24687. mcastaddr.addr[2] = LL_MULTICAST_ADDR_2;
  24688. mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f;
  24689. 800f196: f003 037f and.w r3, r3, #127 ; 0x7f
  24690. 800f19a: f88d 3003 strb.w r3, [sp, #3]
  24691. mcastaddr.addr[4] = ip4_addr3(ipaddr);
  24692. 800f19e: 78ab ldrb r3, [r5, #2]
  24693. 800f1a0: f88d 3004 strb.w r3, [sp, #4]
  24694. mcastaddr.addr[5] = ip4_addr4(ipaddr);
  24695. 800f1a4: 78eb ldrb r3, [r5, #3]
  24696. 800f1a6: f88d 3005 strb.w r3, [sp, #5]
  24697. /* destination Ethernet address is multicast */
  24698. dest = &mcastaddr;
  24699. 800f1aa: 466b mov r3, sp
  24700. 800f1ac: e040 b.n 800f230 <etharp_output+0xe0>
  24701. /* unicast destination IP address? */
  24702. } else {
  24703. s8_t i;
  24704. /* outside local network? if so, this can neither be a global broadcast nor
  24705. a subnet broadcast. */
  24706. if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
  24707. 800f1ae: 6862 ldr r2, [r4, #4]
  24708. 800f1b0: ea83 0102 eor.w r1, r3, r2
  24709. 800f1b4: 68a2 ldr r2, [r4, #8]
  24710. 800f1b6: 4211 tst r1, r2
  24711. 800f1b8: d009 beq.n 800f1ce <etharp_output+0x7e>
  24712. !ip_addr_islinklocal(ipaddr)) {
  24713. 800f1ba: b29b uxth r3, r3
  24714. /* unicast destination IP address? */
  24715. } else {
  24716. s8_t i;
  24717. /* outside local network? if so, this can neither be a global broadcast nor
  24718. a subnet broadcast. */
  24719. if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
  24720. 800f1bc: f64f 62a9 movw r2, #65193 ; 0xfea9
  24721. 800f1c0: 4293 cmp r3, r2
  24722. 800f1c2: d004 beq.n 800f1ce <etharp_output+0x7e>
  24723. router for forwarding". */
  24724. if (!ip_addr_islinklocal(&iphdr->src))
  24725. #endif /* LWIP_AUTOIP */
  24726. {
  24727. /* interface has default gateway? */
  24728. if (!ip_addr_isany(&netif->gw)) {
  24729. 800f1c4: 68e3 ldr r3, [r4, #12]
  24730. 800f1c6: f104 010c add.w r1, r4, #12
  24731. 800f1ca: b90b cbnz r3, 800f1d0 <etharp_output+0x80>
  24732. 800f1cc: e037 b.n 800f23e <etharp_output+0xee>
  24733. /* unicast destination IP address? */
  24734. } else {
  24735. s8_t i;
  24736. /* outside local network? if so, this can neither be a global broadcast nor
  24737. a subnet broadcast. */
  24738. if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
  24739. 800f1ce: 4629 mov r1, r5
  24740. if (netif->addr_hint != NULL) {
  24741. /* per-pcb cached entry was given */
  24742. u8_t etharp_cached_entry = *(netif->addr_hint);
  24743. if (etharp_cached_entry < ARP_TABLE_SIZE) {
  24744. #endif /* LWIP_NETIF_HWADDRHINT */
  24745. if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
  24746. 800f1d0: 4b1d ldr r3, [pc, #116] ; (800f248 <etharp_output+0xf8>)
  24747. 800f1d2: 781a ldrb r2, [r3, #0]
  24748. 800f1d4: 4b1d ldr r3, [pc, #116] ; (800f24c <etharp_output+0xfc>)
  24749. 800f1d6: 2014 movs r0, #20
  24750. 800f1d8: fb00 3302 mla r3, r0, r2, r3
  24751. 800f1dc: 7c98 ldrb r0, [r3, #18]
  24752. 800f1de: 2801 cmp r0, #1
  24753. 800f1e0: d908 bls.n 800f1f4 <etharp_output+0xa4>
  24754. 800f1e2: 6808 ldr r0, [r1, #0]
  24755. 800f1e4: 685b ldr r3, [r3, #4]
  24756. 800f1e6: 4298 cmp r0, r3
  24757. 800f1e8: d104 bne.n 800f1f4 <etharp_output+0xa4>
  24758. (ip_addr_cmp(dst_addr, &arp_table[etharp_cached_entry].ipaddr))) {
  24759. /* the per-pcb-cached entry is stable and the right one! */
  24760. ETHARP_STATS_INC(etharp.cachehit);
  24761. 800f1ea: 4b16 ldr r3, [pc, #88] ; (800f244 <etharp_output+0xf4>)
  24762. 800f1ec: 8dd9 ldrh r1, [r3, #46] ; 0x2e
  24763. 800f1ee: 3101 adds r1, #1
  24764. 800f1f0: 85d9 strh r1, [r3, #46] ; 0x2e
  24765. 800f1f2: e00d b.n 800f210 <etharp_output+0xc0>
  24766. if (netif->addr_hint != NULL) {
  24767. /* per-pcb cached entry was given */
  24768. u8_t etharp_cached_entry = *(netif->addr_hint);
  24769. if (etharp_cached_entry < ARP_TABLE_SIZE) {
  24770. #endif /* LWIP_NETIF_HWADDRHINT */
  24771. if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
  24772. 800f1f4: 2300 movs r3, #0
  24773. * @return
  24774. * - ERR_RTE No route to destination (no gateway to external networks),
  24775. * or the return type of either etharp_query() or etharp_send_ip().
  24776. */
  24777. err_t
  24778. etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
  24779. 800f1f6: 4f15 ldr r7, [pc, #84] ; (800f24c <etharp_output+0xfc>)
  24780. if (netif->addr_hint != NULL) {
  24781. /* per-pcb cached entry was given */
  24782. u8_t etharp_cached_entry = *(netif->addr_hint);
  24783. if (etharp_cached_entry < ARP_TABLE_SIZE) {
  24784. #endif /* LWIP_NETIF_HWADDRHINT */
  24785. if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
  24786. 800f1f8: 461a mov r2, r3
  24787. * @return
  24788. * - ERR_RTE No route to destination (no gateway to external networks),
  24789. * or the return type of either etharp_query() or etharp_send_ip().
  24790. */
  24791. err_t
  24792. etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
  24793. 800f1fa: 18f8 adds r0, r7, r3
  24794. #endif /* LWIP_NETIF_HWADDRHINT */
  24795. /* find stable entry: do this here since this is a critical path for
  24796. throughput and etharp_find_entry() is kind of slow */
  24797. for (i = 0; i < ARP_TABLE_SIZE; i++) {
  24798. if ((arp_table[i].state >= ETHARP_STATE_STABLE) &&
  24799. 800f1fc: 7c85 ldrb r5, [r0, #18]
  24800. 800f1fe: 2d01 cmp r5, #1
  24801. 800f200: d90b bls.n 800f21a <etharp_output+0xca>
  24802. 800f202: 680d ldr r5, [r1, #0]
  24803. 800f204: 6840 ldr r0, [r0, #4]
  24804. 800f206: 4285 cmp r5, r0
  24805. 800f208: d107 bne.n 800f21a <etharp_output+0xca>
  24806. (ip_addr_cmp(dst_addr, &arp_table[i].ipaddr))) {
  24807. /* found an existing, stable entry */
  24808. ETHARP_SET_HINT(netif, i);
  24809. 800f20a: 4b0f ldr r3, [pc, #60] ; (800f248 <etharp_output+0xf8>)
  24810. 800f20c: b2d2 uxtb r2, r2
  24811. 800f20e: 701a strb r2, [r3, #0]
  24812. return etharp_output_to_arp_index(netif, q, i);
  24813. 800f210: 4620 mov r0, r4
  24814. 800f212: 4631 mov r1, r6
  24815. 800f214: f7ff ff76 bl 800f104 <etharp_output_to_arp_index>
  24816. 800f218: e012 b.n 800f240 <etharp_output+0xf0>
  24817. 800f21a: 3314 adds r3, #20
  24818. }
  24819. #endif /* LWIP_NETIF_HWADDRHINT */
  24820. /* find stable entry: do this here since this is a critical path for
  24821. throughput and etharp_find_entry() is kind of slow */
  24822. for (i = 0; i < ARP_TABLE_SIZE; i++) {
  24823. 800f21c: 3201 adds r2, #1
  24824. 800f21e: 2bc8 cmp r3, #200 ; 0xc8
  24825. 800f220: b2d2 uxtb r2, r2
  24826. 800f222: d1ea bne.n 800f1fa <etharp_output+0xaa>
  24827. return etharp_output_to_arp_index(netif, q, i);
  24828. }
  24829. }
  24830. /* no stable entry found, use the (slower) query function:
  24831. queue on destination Ethernet address belonging to ipaddr */
  24832. return etharp_query(netif, dst_addr, q);
  24833. 800f224: 4620 mov r0, r4
  24834. 800f226: 4632 mov r2, r6
  24835. 800f228: f7ff fede bl 800efe8 <etharp_query>
  24836. 800f22c: e008 b.n 800f240 <etharp_output+0xf0>
  24837. * are special, other IP addresses are looked up in the ARP table. */
  24838. /* broadcast destination IP address? */
  24839. if (ip_addr_isbroadcast(ipaddr, netif)) {
  24840. /* broadcast on Ethernet also */
  24841. dest = (struct eth_addr *)&ethbroadcast;
  24842. 800f22e: 4b08 ldr r3, [pc, #32] ; (800f250 <etharp_output+0x100>)
  24843. }
  24844. /* continuation for multicast/broadcast destinations */
  24845. /* obtain source Ethernet address of the given interface */
  24846. /* send packet directly on the link */
  24847. return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
  24848. 800f230: 4620 mov r0, r4
  24849. 800f232: 4631 mov r1, r6
  24850. 800f234: f104 0227 add.w r2, r4, #39 ; 0x27
  24851. 800f238: f7ff fe2e bl 800ee98 <etharp_send_ip>
  24852. 800f23c: e000 b.n 800f240 <etharp_output+0xf0>
  24853. /* send to hardware address of default gateway IP address */
  24854. dst_addr = &(netif->gw);
  24855. /* no default gateway available */
  24856. } else {
  24857. /* no route to destination error (default gateway missing) */
  24858. return ERR_RTE;
  24859. 800f23e: 20fc movs r0, #252 ; 0xfc
  24860. /* continuation for multicast/broadcast destinations */
  24861. /* obtain source Ethernet address of the given interface */
  24862. /* send packet directly on the link */
  24863. return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
  24864. }
  24865. 800f240: b240 sxtb r0, r0
  24866. 800f242: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc}
  24867. 800f244: 20008220 .word 0x20008220
  24868. 800f248: 20006bc2 .word 0x20006bc2
  24869. 800f24c: 20006bc4 .word 0x20006bc4
  24870. 800f250: 08011884 .word 0x08011884
  24871. 0800f254 <ethernet_input>:
  24872. * @param p the recevied packet, p->payload pointing to the ethernet header
  24873. * @param netif the network interface on which the packet was received
  24874. */
  24875. err_t
  24876. ethernet_input(struct pbuf *p, struct netif *netif)
  24877. {
  24878. 800f254: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  24879. u16_t type;
  24880. #if LWIP_ARP || ETHARP_SUPPORT_VLAN
  24881. s16_t ip_hdr_offset = SIZEOF_ETH_HDR;
  24882. #endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */
  24883. if (p->len <= SIZEOF_ETH_HDR) {
  24884. 800f258: 8943 ldrh r3, [r0, #10]
  24885. 800f25a: 2b0e cmp r3, #14
  24886. * @param p the recevied packet, p->payload pointing to the ethernet header
  24887. * @param netif the network interface on which the packet was received
  24888. */
  24889. err_t
  24890. ethernet_input(struct pbuf *p, struct netif *netif)
  24891. {
  24892. 800f25c: b087 sub sp, #28
  24893. 800f25e: 4604 mov r4, r0
  24894. 800f260: 460d mov r5, r1
  24895. u16_t type;
  24896. #if LWIP_ARP || ETHARP_SUPPORT_VLAN
  24897. s16_t ip_hdr_offset = SIZEOF_ETH_HDR;
  24898. #endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */
  24899. if (p->len <= SIZEOF_ETH_HDR) {
  24900. 800f262: d800 bhi.n 800f266 <ethernet_input+0x12>
  24901. 800f264: e0f5 b.n 800f452 <ethernet_input+0x1fe>
  24902. ETHARP_STATS_INC(etharp.drop);
  24903. goto free_and_return;
  24904. }
  24905. /* points to packet payload, which starts with an Ethernet header */
  24906. ethhdr = (struct eth_hdr *)p->payload;
  24907. 800f266: 6840 ldr r0, [r0, #4]
  24908. #if LWIP_ARP_FILTER_NETIF
  24909. netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, htons(type));
  24910. #endif /* LWIP_ARP_FILTER_NETIF*/
  24911. if (ethhdr->dest.addr[0] & 1) {
  24912. 800f268: 7803 ldrb r3, [r0, #0]
  24913. (unsigned)ethhdr->dest.addr[3], (unsigned)ethhdr->dest.addr[4], (unsigned)ethhdr->dest.addr[5],
  24914. (unsigned)ethhdr->src.addr[0], (unsigned)ethhdr->src.addr[1], (unsigned)ethhdr->src.addr[2],
  24915. (unsigned)ethhdr->src.addr[3], (unsigned)ethhdr->src.addr[4], (unsigned)ethhdr->src.addr[5],
  24916. (unsigned)htons(ethhdr->type)));
  24917. type = ethhdr->type;
  24918. 800f26a: 8986 ldrh r6, [r0, #12]
  24919. #if LWIP_ARP_FILTER_NETIF
  24920. netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, htons(type));
  24921. #endif /* LWIP_ARP_FILTER_NETIF*/
  24922. if (ethhdr->dest.addr[0] & 1) {
  24923. 800f26c: 07da lsls r2, r3, #31
  24924. 800f26e: d513 bpl.n 800f298 <ethernet_input+0x44>
  24925. /* this might be a multicast or broadcast packet */
  24926. if (ethhdr->dest.addr[0] == LL_MULTICAST_ADDR_0) {
  24927. 800f270: 2b01 cmp r3, #1
  24928. 800f272: d108 bne.n 800f286 <ethernet_input+0x32>
  24929. if ((ethhdr->dest.addr[1] == LL_MULTICAST_ADDR_1) &&
  24930. 800f274: 7843 ldrb r3, [r0, #1]
  24931. 800f276: b97b cbnz r3, 800f298 <ethernet_input+0x44>
  24932. 800f278: 7883 ldrb r3, [r0, #2]
  24933. 800f27a: 2b5e cmp r3, #94 ; 0x5e
  24934. 800f27c: d10c bne.n 800f298 <ethernet_input+0x44>
  24935. (ethhdr->dest.addr[2] == LL_MULTICAST_ADDR_2)) {
  24936. /* mark the pbuf as link-layer multicast */
  24937. p->flags |= PBUF_FLAG_LLMCAST;
  24938. 800f27e: 7b63 ldrb r3, [r4, #13]
  24939. 800f280: f043 0310 orr.w r3, r3, #16
  24940. 800f284: e007 b.n 800f296 <ethernet_input+0x42>
  24941. }
  24942. } else if (eth_addr_cmp(&ethhdr->dest, &ethbroadcast)) {
  24943. 800f286: 497a ldr r1, [pc, #488] ; (800f470 <ethernet_input+0x21c>)
  24944. 800f288: 2206 movs r2, #6
  24945. 800f28a: f7fa f889 bl 80093a0 <memcmp>
  24946. 800f28e: b918 cbnz r0, 800f298 <ethernet_input+0x44>
  24947. /* mark the pbuf as link-layer broadcast */
  24948. p->flags |= PBUF_FLAG_LLBCAST;
  24949. 800f290: 7b63 ldrb r3, [r4, #13]
  24950. 800f292: f043 0308 orr.w r3, r3, #8
  24951. 800f296: 7363 strb r3, [r4, #13]
  24952. }
  24953. }
  24954. switch (type) {
  24955. 800f298: 2e08 cmp r6, #8
  24956. 800f29a: d004 beq.n 800f2a6 <ethernet_input+0x52>
  24957. 800f29c: f5b6 6fc1 cmp.w r6, #1544 ; 0x608
  24958. 800f2a0: f040 80d7 bne.w 800f452 <ethernet_input+0x1fe>
  24959. 800f2a4: e014 b.n 800f2d0 <ethernet_input+0x7c>
  24960. #if LWIP_ARP
  24961. /* IP packet? */
  24962. case PP_HTONS(ETHTYPE_IP):
  24963. if (!(netif->flags & NETIF_FLAG_ETHARP)) {
  24964. 800f2a6: f895 302d ldrb.w r3, [r5, #45] ; 0x2d
  24965. 800f2aa: f003 0320 and.w r3, r3, #32
  24966. 800f2ae: b2db uxtb r3, r3
  24967. 800f2b0: 2b00 cmp r3, #0
  24968. 800f2b2: f000 80d5 beq.w 800f460 <ethernet_input+0x20c>
  24969. #if ETHARP_TRUST_IP_MAC
  24970. /* update ARP table */
  24971. etharp_ip_input(netif, p);
  24972. #endif /* ETHARP_TRUST_IP_MAC */
  24973. /* skip Ethernet header */
  24974. if(pbuf_header(p, -ip_hdr_offset)) {
  24975. 800f2b6: 4620 mov r0, r4
  24976. 800f2b8: f06f 010d mvn.w r1, #13
  24977. 800f2bc: f7fc f8d7 bl 800b46e <pbuf_header>
  24978. 800f2c0: 2800 cmp r0, #0
  24979. 800f2c2: f040 80cd bne.w 800f460 <ethernet_input+0x20c>
  24980. LWIP_ASSERT("Can't move over header in packet", 0);
  24981. goto free_and_return;
  24982. } else {
  24983. /* pass to IP layer */
  24984. ip_input(p, netif);
  24985. 800f2c6: 4620 mov r0, r4
  24986. 800f2c8: 4629 mov r1, r5
  24987. 800f2ca: f7ff f923 bl 800e514 <ip_input>
  24988. }
  24989. break;
  24990. 800f2ce: e0ca b.n 800f466 <ethernet_input+0x212>
  24991. case PP_HTONS(ETHTYPE_ARP):
  24992. if (!(netif->flags & NETIF_FLAG_ETHARP)) {
  24993. 800f2d0: f895 302d ldrb.w r3, [r5, #45] ; 0x2d
  24994. 800f2d4: f003 0320 and.w r3, r3, #32
  24995. 800f2d8: b2db uxtb r3, r3
  24996. 800f2da: 2b00 cmp r3, #0
  24997. 800f2dc: f000 80c0 beq.w 800f460 <ethernet_input+0x20c>
  24998. LWIP_ERROR("netif != NULL", (netif != NULL), return;);
  24999. /* drop short ARP packets: we have to check for p->len instead of p->tot_len here
  25000. since a struct etharp_hdr is pointed to p->payload, so it musn't be chained! */
  25001. if (p->len < SIZEOF_ETHARP_PACKET) {
  25002. 800f2e0: 8963 ldrh r3, [r4, #10]
  25003. 800f2e2: 2b29 cmp r3, #41 ; 0x29
  25004. 800f2e4: d804 bhi.n 800f2f0 <ethernet_input+0x9c>
  25005. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING,
  25006. ("etharp_arp_input: packet dropped, too short (%"S16_F"/%"S16_F")\n", p->tot_len,
  25007. (s16_t)SIZEOF_ETHARP_PACKET));
  25008. ETHARP_STATS_INC(etharp.lenerr);
  25009. 800f2e6: 4b63 ldr r3, [pc, #396] ; (800f474 <ethernet_input+0x220>)
  25010. 800f2e8: 8c5a ldrh r2, [r3, #34] ; 0x22
  25011. 800f2ea: 3201 adds r2, #1
  25012. 800f2ec: 845a strh r2, [r3, #34] ; 0x22
  25013. 800f2ee: e0b4 b.n 800f45a <ethernet_input+0x206>
  25014. ETHARP_STATS_INC(etharp.drop);
  25015. pbuf_free(p);
  25016. return;
  25017. }
  25018. ethhdr = (struct eth_hdr *)p->payload;
  25019. 800f2f0: 6866 ldr r6, [r4, #4]
  25020. hdr = (struct etharp_hdr *)(((u8_t*)ethhdr) + SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR);
  25021. }
  25022. #endif /* ETHARP_SUPPORT_VLAN */
  25023. /* RFC 826 "Packet Reception": */
  25024. if ((hdr->hwtype != PP_HTONS(HWTYPE_ETHERNET)) ||
  25025. 800f2f2: 89f3 ldrh r3, [r6, #14]
  25026. 800f2f4: f5b3 7f80 cmp.w r3, #256 ; 0x100
  25027. 800f2f8: f040 80ab bne.w 800f452 <ethernet_input+0x1fe>
  25028. 800f2fc: 7cb3 ldrb r3, [r6, #18]
  25029. 800f2fe: 2b06 cmp r3, #6
  25030. 800f300: f040 80a7 bne.w 800f452 <ethernet_input+0x1fe>
  25031. (hdr->hwlen != ETHARP_HWADDR_LEN) ||
  25032. 800f304: 7cf7 ldrb r7, [r6, #19]
  25033. 800f306: 2f04 cmp r7, #4
  25034. 800f308: f040 80a3 bne.w 800f452 <ethernet_input+0x1fe>
  25035. (hdr->protolen != sizeof(ip_addr_t)) ||
  25036. 800f30c: 8a33 ldrh r3, [r6, #16]
  25037. 800f30e: 2b08 cmp r3, #8
  25038. 800f310: d000 beq.n 800f314 <ethernet_input+0xc0>
  25039. 800f312: e09e b.n 800f452 <ethernet_input+0x1fe>
  25040. ETHARP_STATS_INC(etharp.proterr);
  25041. ETHARP_STATS_INC(etharp.drop);
  25042. pbuf_free(p);
  25043. return;
  25044. }
  25045. ETHARP_STATS_INC(etharp.recv);
  25046. 800f314: 4b57 ldr r3, [pc, #348] ; (800f474 <ethernet_input+0x220>)
  25047. 800f316: 8b5a ldrh r2, [r3, #26]
  25048. autoip_arp_reply(netif, hdr);
  25049. #endif /* LWIP_AUTOIP */
  25050. /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
  25051. * structure packing (not using structure copy which breaks strict-aliasing rules). */
  25052. IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
  25053. 800f318: f106 0a1c add.w sl, r6, #28
  25054. ETHARP_STATS_INC(etharp.proterr);
  25055. ETHARP_STATS_INC(etharp.drop);
  25056. pbuf_free(p);
  25057. return;
  25058. }
  25059. ETHARP_STATS_INC(etharp.recv);
  25060. 800f31c: 3201 adds r2, #1
  25061. 800f31e: 835a strh r2, [r3, #26]
  25062. autoip_arp_reply(netif, hdr);
  25063. #endif /* LWIP_AUTOIP */
  25064. /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
  25065. * structure packing (not using structure copy which breaks strict-aliasing rules). */
  25066. IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
  25067. 800f320: 4651 mov r1, sl
  25068. 800f322: 463a mov r2, r7
  25069. 800f324: a804 add r0, sp, #16
  25070. 800f326: f7fa f86d bl 8009404 <memcpy>
  25071. IPADDR2_COPY(&dipaddr, &hdr->dipaddr);
  25072. 800f32a: f106 0226 add.w r2, r6, #38 ; 0x26
  25073. 800f32e: 9203 str r2, [sp, #12]
  25074. 800f330: 4611 mov r1, r2
  25075. 800f332: a805 add r0, sp, #20
  25076. 800f334: 463a mov r2, r7
  25077. 800f336: f7fa f865 bl 8009404 <memcpy>
  25078. /* this interface is not configured? */
  25079. if (ip_addr_isany(&netif->ip_addr)) {
  25080. 800f33a: 686b ldr r3, [r5, #4]
  25081. 800f33c: b12b cbz r3, 800f34a <ethernet_input+0xf6>
  25082. for_us = 0;
  25083. } else {
  25084. /* ARP packet directed to us? */
  25085. for_us = (u8_t)ip_addr_cmp(&dipaddr, &(netif->ip_addr));
  25086. 800f33e: 9a05 ldr r2, [sp, #20]
  25087. 800f340: 1ad1 subs r1, r2, r3
  25088. 800f342: 424a negs r2, r1
  25089. 800f344: 414a adcs r2, r1
  25090. 800f346: 9201 str r2, [sp, #4]
  25091. 800f348: e000 b.n 800f34c <ethernet_input+0xf8>
  25092. IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
  25093. IPADDR2_COPY(&dipaddr, &hdr->dipaddr);
  25094. /* this interface is not configured? */
  25095. if (ip_addr_isany(&netif->ip_addr)) {
  25096. for_us = 0;
  25097. 800f34a: 9301 str r3, [sp, #4]
  25098. /* ARP message directed to us?
  25099. -> add IP address in ARP cache; assume requester wants to talk to us,
  25100. can result in directly sending the queued packets for this host.
  25101. ARP message not directed to us?
  25102. -> update the source IP address in the cache, if present */
  25103. etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
  25104. 800f34c: 9b01 ldr r3, [sp, #4]
  25105. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",
  25106. ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
  25107. ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
  25108. ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  25109. /* non-unicast address? */
  25110. if (ip_addr_isany(ipaddr) ||
  25111. 800f34e: 9804 ldr r0, [sp, #16]
  25112. /* ARP message directed to us?
  25113. -> add IP address in ARP cache; assume requester wants to talk to us,
  25114. can result in directly sending the queued packets for this host.
  25115. ARP message not directed to us?
  25116. -> update the source IP address in the cache, if present */
  25117. etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
  25118. 800f350: f106 0716 add.w r7, r6, #22
  25119. 800f354: 2b00 cmp r3, #0
  25120. 800f356: bf0c ite eq
  25121. 800f358: f04f 0802 moveq.w r8, #2
  25122. 800f35c: f04f 0801 movne.w r8, #1
  25123. case PP_HTONS(ETHTYPE_ARP):
  25124. if (!(netif->flags & NETIF_FLAG_ETHARP)) {
  25125. goto free_and_return;
  25126. }
  25127. /* pass p to ARP module */
  25128. etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p);
  25129. 800f360: f105 0927 add.w r9, r5, #39 ; 0x27
  25130. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",
  25131. ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
  25132. ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
  25133. ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  25134. /* non-unicast address? */
  25135. if (ip_addr_isany(ipaddr) ||
  25136. 800f364: 2800 cmp r0, #0
  25137. 800f366: d037 beq.n 800f3d8 <ethernet_input+0x184>
  25138. ip_addr_isbroadcast(ipaddr, netif) ||
  25139. 800f368: 4629 mov r1, r5
  25140. 800f36a: f7ff f80a bl 800e382 <ip4_addr_isbroadcast>
  25141. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",
  25142. ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
  25143. ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
  25144. ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  25145. /* non-unicast address? */
  25146. if (ip_addr_isany(ipaddr) ||
  25147. 800f36e: 9002 str r0, [sp, #8]
  25148. 800f370: 2800 cmp r0, #0
  25149. 800f372: d131 bne.n 800f3d8 <ethernet_input+0x184>
  25150. ip_addr_isbroadcast(ipaddr, netif) ||
  25151. ip_addr_ismulticast(ipaddr)) {
  25152. 800f374: 9a04 ldr r2, [sp, #16]
  25153. 800f376: f002 02f0 and.w r2, r2, #240 ; 0xf0
  25154. ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
  25155. ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
  25156. ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
  25157. /* non-unicast address? */
  25158. if (ip_addr_isany(ipaddr) ||
  25159. ip_addr_isbroadcast(ipaddr, netif) ||
  25160. 800f37a: 2ae0 cmp r2, #224 ; 0xe0
  25161. 800f37c: d02c beq.n 800f3d8 <ethernet_input+0x184>
  25162. ip_addr_ismulticast(ipaddr)) {
  25163. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: will not add non-unicast IP address to ARP cache\n"));
  25164. return ERR_ARG;
  25165. }
  25166. /* find or create ARP entry */
  25167. i = etharp_find_entry(ipaddr, flags);
  25168. 800f37e: a804 add r0, sp, #16
  25169. 800f380: 4641 mov r1, r8
  25170. 800f382: f7ff fd17 bl 800edb4 <etharp_find_entry>
  25171. /* bail out if no entry could be found */
  25172. if (i < 0) {
  25173. 800f386: 2800 cmp r0, #0
  25174. 800f388: db26 blt.n 800f3d8 <ethernet_input+0x184>
  25175. arp_table[i].state = ETHARP_STATE_STATIC;
  25176. } else
  25177. #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
  25178. {
  25179. /* mark it stable */
  25180. arp_table[i].state = ETHARP_STATE_STABLE;
  25181. 800f38a: 4b3b ldr r3, [pc, #236] ; (800f478 <ethernet_input+0x224>)
  25182. 800f38c: f04f 0814 mov.w r8, #20
  25183. 800f390: fb08 f800 mul.w r8, r8, r0
  25184. 800f394: eb03 0208 add.w r2, r3, r8
  25185. 800f398: 2102 movs r1, #2
  25186. /* insert in SNMP ARP index tree */
  25187. snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
  25188. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: updating stable entry %"S16_F"\n", (s16_t)i));
  25189. /* update address */
  25190. ETHADDR32_COPY(&arp_table[i].ethaddr, ethaddr);
  25191. 800f39a: 4610 mov r0, r2
  25192. arp_table[i].state = ETHARP_STATE_STATIC;
  25193. } else
  25194. #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
  25195. {
  25196. /* mark it stable */
  25197. arp_table[i].state = ETHARP_STATE_STABLE;
  25198. 800f39c: 7491 strb r1, [r2, #18]
  25199. 800f39e: f102 0b10 add.w fp, r2, #16
  25200. }
  25201. /* record network interface */
  25202. arp_table[i].netif = netif;
  25203. 800f3a2: 6095 str r5, [r2, #8]
  25204. /* insert in SNMP ARP index tree */
  25205. snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
  25206. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: updating stable entry %"S16_F"\n", (s16_t)i));
  25207. /* update address */
  25208. ETHADDR32_COPY(&arp_table[i].ethaddr, ethaddr);
  25209. 800f3a4: 300c adds r0, #12
  25210. 800f3a6: 2206 movs r2, #6
  25211. 800f3a8: 4639 mov r1, r7
  25212. 800f3aa: 9300 str r3, [sp, #0]
  25213. 800f3ac: f7fa f82a bl 8009404 <memcpy>
  25214. /* reset time stamp */
  25215. arp_table[i].ctime = 0;
  25216. 800f3b0: 9a02 ldr r2, [sp, #8]
  25217. 800f3b2: f88b 2003 strb.w r2, [fp, #3]
  25218. /* get the packet pointer */
  25219. p = q->p;
  25220. /* now queue entry can be freed */
  25221. memp_free(MEMP_ARP_QUEUE, q);
  25222. #else /* ARP_QUEUEING */
  25223. if (arp_table[i].q != NULL) {
  25224. 800f3b6: 9b00 ldr r3, [sp, #0]
  25225. 800f3b8: f853 b008 ldr.w fp, [r3, r8]
  25226. 800f3bc: f1bb 0f00 cmp.w fp, #0
  25227. 800f3c0: d00a beq.n 800f3d8 <ethernet_input+0x184>
  25228. struct pbuf *p = arp_table[i].q;
  25229. arp_table[i].q = NULL;
  25230. 800f3c2: f843 2008 str.w r2, [r3, r8]
  25231. #endif /* ARP_QUEUEING */
  25232. /* send the queued IP packet */
  25233. etharp_send_ip(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr);
  25234. 800f3c6: 4628 mov r0, r5
  25235. 800f3c8: 4659 mov r1, fp
  25236. 800f3ca: 464a mov r2, r9
  25237. 800f3cc: 463b mov r3, r7
  25238. 800f3ce: f7ff fd63 bl 800ee98 <etharp_send_ip>
  25239. /* free the queued IP packet */
  25240. pbuf_free(p);
  25241. 800f3d2: 4658 mov r0, fp
  25242. 800f3d4: f7fc f876 bl 800b4c4 <pbuf_free>
  25243. -> update the source IP address in the cache, if present */
  25244. etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
  25245. for_us ? ETHARP_FLAG_TRY_HARD : ETHARP_FLAG_FIND_ONLY);
  25246. /* now act on the message itself */
  25247. switch (hdr->opcode) {
  25248. 800f3d8: 8ab3 ldrh r3, [r6, #20]
  25249. 800f3da: f5b3 7f80 cmp.w r3, #256 ; 0x100
  25250. 800f3de: d003 beq.n 800f3e8 <ethernet_input+0x194>
  25251. 800f3e0: f5b3 7f00 cmp.w r3, #512 ; 0x200
  25252. 800f3e4: d130 bne.n 800f448 <ethernet_input+0x1f4>
  25253. 800f3e6: e02a b.n 800f43e <ethernet_input+0x1ea>
  25254. * reply. In any case, we time-stamp any existing ARP entry,
  25255. * and possiby send out an IP packet that was queued on it. */
  25256. LWIP_DEBUGF (ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: incoming ARP request\n"));
  25257. /* ARP request for our address? */
  25258. if (for_us) {
  25259. 800f3e8: 9b01 ldr r3, [sp, #4]
  25260. 800f3ea: 2b00 cmp r3, #0
  25261. 800f3ec: d038 beq.n 800f460 <ethernet_input+0x20c>
  25262. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: replying to ARP request for our IP address\n"));
  25263. /* Re-use pbuf to send ARP reply.
  25264. Since we are re-using an existing pbuf, we can't call etharp_raw since
  25265. that would allocate a new pbuf. */
  25266. hdr->opcode = htons(ARP_REPLY);
  25267. 800f3ee: 2002 movs r0, #2
  25268. 800f3f0: f7fa fefb bl 800a1ea <lwip_htons>
  25269. 800f3f4: 82b0 strh r0, [r6, #20]
  25270. IPADDR2_COPY(&hdr->dipaddr, &hdr->sipaddr);
  25271. 800f3f6: 4651 mov r1, sl
  25272. 800f3f8: 2204 movs r2, #4
  25273. 800f3fa: 9803 ldr r0, [sp, #12]
  25274. 800f3fc: f7fa f802 bl 8009404 <memcpy>
  25275. IPADDR2_COPY(&hdr->sipaddr, &netif->ip_addr);
  25276. 800f400: 1d29 adds r1, r5, #4
  25277. 800f402: 2204 movs r2, #4
  25278. 800f404: 4650 mov r0, sl
  25279. 800f406: f7f9 fffd bl 8009404 <memcpy>
  25280. * 'sender IP address' MUST be sent using link-layer broadcast instead of
  25281. * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
  25282. ethdst_hwaddr = ip_addr_islinklocal(&netif->ip_addr) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
  25283. #endif /* LWIP_AUTOIP */
  25284. ETHADDR16_COPY(&hdr->dhwaddr, &hdr->shwaddr);
  25285. 800f40a: 4639 mov r1, r7
  25286. 800f40c: 2206 movs r2, #6
  25287. 800f40e: f106 0020 add.w r0, r6, #32
  25288. 800f412: f7f9 fff7 bl 8009404 <memcpy>
  25289. #if LWIP_AUTOIP
  25290. ETHADDR16_COPY(&ethhdr->dest, ethdst_hwaddr);
  25291. #else /* LWIP_AUTOIP */
  25292. ETHADDR16_COPY(&ethhdr->dest, &hdr->shwaddr);
  25293. 800f416: 4639 mov r1, r7
  25294. 800f418: 2206 movs r2, #6
  25295. 800f41a: 4630 mov r0, r6
  25296. 800f41c: f7f9 fff2 bl 8009404 <memcpy>
  25297. #endif /* LWIP_AUTOIP */
  25298. ETHADDR16_COPY(&hdr->shwaddr, ethaddr);
  25299. 800f420: 4649 mov r1, r9
  25300. 800f422: 2206 movs r2, #6
  25301. 800f424: 4638 mov r0, r7
  25302. 800f426: f7f9 ffed bl 8009404 <memcpy>
  25303. ETHADDR16_COPY(&ethhdr->src, ethaddr);
  25304. 800f42a: 4649 mov r1, r9
  25305. 800f42c: 1db0 adds r0, r6, #6
  25306. 800f42e: 2206 movs r2, #6
  25307. 800f430: f7f9 ffe8 bl 8009404 <memcpy>
  25308. /* hwtype, hwaddr_len, proto, protolen and the type in the ethernet header
  25309. are already correct, we tested that before */
  25310. /* return ARP reply */
  25311. netif->linkoutput(netif, p);
  25312. 800f434: 69ab ldr r3, [r5, #24]
  25313. 800f436: 4628 mov r0, r5
  25314. 800f438: 4621 mov r1, r4
  25315. 800f43a: 4798 blx r3
  25316. 800f43c: e010 b.n 800f460 <ethernet_input+0x20c>
  25317. #if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
  25318. /* DHCP wants to know about ARP replies from any host with an
  25319. * IP address also offered to us by the DHCP server. We do not
  25320. * want to take a duplicate IP address on a single network.
  25321. * @todo How should we handle redundant (fail-over) interfaces? */
  25322. dhcp_arp_reply(netif, &sipaddr);
  25323. 800f43e: 4628 mov r0, r5
  25324. 800f440: a904 add r1, sp, #16
  25325. 800f442: f7fb fba9 bl 800ab98 <dhcp_arp_reply>
  25326. 800f446: e00b b.n 800f460 <ethernet_input+0x20c>
  25327. #endif /* (LWIP_DHCP && DHCP_DOES_ARP_CHECK) */
  25328. break;
  25329. default:
  25330. LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: ARP unknown opcode type %"S16_F"\n", htons(hdr->opcode)));
  25331. ETHARP_STATS_INC(etharp.err);
  25332. 800f448: 4b0a ldr r3, [pc, #40] ; (800f474 <ethernet_input+0x220>)
  25333. 800f44a: 8d9a ldrh r2, [r3, #44] ; 0x2c
  25334. 800f44c: 3201 adds r2, #1
  25335. 800f44e: 859a strh r2, [r3, #44] ; 0x2c
  25336. 800f450: e006 b.n 800f460 <ethernet_input+0x20c>
  25337. pppoe_data_input(netif, p);
  25338. break;
  25339. #endif /* PPPOE_SUPPORT */
  25340. default:
  25341. ETHARP_STATS_INC(etharp.proterr);
  25342. 800f452: 4b08 ldr r3, [pc, #32] ; (800f474 <ethernet_input+0x220>)
  25343. 800f454: 8d1a ldrh r2, [r3, #40] ; 0x28
  25344. 800f456: 3201 adds r2, #1
  25345. 800f458: 851a strh r2, [r3, #40] ; 0x28
  25346. ETHARP_STATS_INC(etharp.drop);
  25347. 800f45a: 8bda ldrh r2, [r3, #30]
  25348. 800f45c: 3201 adds r2, #1
  25349. 800f45e: 83da strh r2, [r3, #30]
  25350. /* This means the pbuf is freed or consumed,
  25351. so the caller doesn't have to free it again */
  25352. return ERR_OK;
  25353. free_and_return:
  25354. pbuf_free(p);
  25355. 800f460: 4620 mov r0, r4
  25356. 800f462: f7fc f82f bl 800b4c4 <pbuf_free>
  25357. return ERR_OK;
  25358. }
  25359. 800f466: 2000 movs r0, #0
  25360. 800f468: b007 add sp, #28
  25361. 800f46a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  25362. 800f46e: bf00 nop
  25363. 800f470: 08011884 .word 0x08011884
  25364. 800f474: 20008220 .word 0x20008220
  25365. 800f478: 20006bc4 .word 0x20006bc4
  25366. 0800f47c <low_level_output>:
  25367. static err_t low_level_output(struct netif *netif, struct pbuf *p)
  25368. {
  25369. struct pbuf *q;
  25370. int framelength = 0;
  25371. u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
  25372. 800f47c: 4b0a ldr r3, [pc, #40] ; (800f4a8 <low_level_output+0x2c>)
  25373. 800f47e: 681b ldr r3, [r3, #0]
  25374. * to become availale since the stack doesn't retry to send a packet
  25375. * dropped because of memory failure (except for the TCP timers).
  25376. */
  25377. static err_t low_level_output(struct netif *netif, struct pbuf *p)
  25378. {
  25379. 800f480: b570 push {r4, r5, r6, lr}
  25380. struct pbuf *q;
  25381. int framelength = 0;
  25382. u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
  25383. 800f482: 689e ldr r6, [r3, #8]
  25384. /* copy frame from pbufs to driver buffers */
  25385. for(q = p; q != NULL; q = q->next)
  25386. 800f484: 460c mov r4, r1
  25387. */
  25388. static err_t low_level_output(struct netif *netif, struct pbuf *p)
  25389. {
  25390. struct pbuf *q;
  25391. int framelength = 0;
  25392. 800f486: 2500 movs r5, #0
  25393. u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
  25394. /* copy frame from pbufs to driver buffers */
  25395. for(q = p; q != NULL; q = q->next)
  25396. 800f488: e007 b.n 800f49a <low_level_output+0x1e>
  25397. {
  25398. memcpy((u8_t*)&buffer[framelength], q->payload, q->len);
  25399. 800f48a: 1970 adds r0, r6, r5
  25400. 800f48c: 6861 ldr r1, [r4, #4]
  25401. 800f48e: 8962 ldrh r2, [r4, #10]
  25402. 800f490: f7f9 ffb8 bl 8009404 <memcpy>
  25403. framelength = framelength + q->len;
  25404. 800f494: 8963 ldrh r3, [r4, #10]
  25405. struct pbuf *q;
  25406. int framelength = 0;
  25407. u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
  25408. /* copy frame from pbufs to driver buffers */
  25409. for(q = p; q != NULL; q = q->next)
  25410. 800f496: 6824 ldr r4, [r4, #0]
  25411. {
  25412. memcpy((u8_t*)&buffer[framelength], q->payload, q->len);
  25413. framelength = framelength + q->len;
  25414. 800f498: 18ed adds r5, r5, r3
  25415. struct pbuf *q;
  25416. int framelength = 0;
  25417. u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
  25418. /* copy frame from pbufs to driver buffers */
  25419. for(q = p; q != NULL; q = q->next)
  25420. 800f49a: 2c00 cmp r4, #0
  25421. 800f49c: d1f5 bne.n 800f48a <low_level_output+0xe>
  25422. /* Note: padding and CRC for transmitted frame
  25423. are automatically inserted by DMA */
  25424. /* Prepare transmit descriptors to give to DMA*/
  25425. ETH_Prepare_Transmit_Descriptors(framelength);
  25426. 800f49e: b2a8 uxth r0, r5
  25427. 800f4a0: f001 f988 bl 80107b4 <ETH_Prepare_Transmit_Descriptors>
  25428. return ERR_OK;
  25429. }
  25430. 800f4a4: 4620 mov r0, r4
  25431. 800f4a6: bd70 pop {r4, r5, r6, pc}
  25432. 800f4a8: 20008cc0 .word 0x20008cc0
  25433. 0800f4ac <ethernetif_input>:
  25434. * the appropriate input function is called.
  25435. *
  25436. * @param netif the lwip network interface structure for this ethernetif
  25437. */
  25438. err_t ethernetif_input(struct netif *netif)
  25439. {
  25440. 800f4ac: e92d 41ff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr}
  25441. 800f4b0: 4607 mov r7, r0
  25442. p = NULL;
  25443. /* get received frame */
  25444. frame = ETH_Get_Received_Frame();
  25445. 800f4b2: a801 add r0, sp, #4
  25446. 800f4b4: f001 f964 bl 8010780 <ETH_Get_Received_Frame>
  25447. /* Obtain the size of the packet and put it into the "len" variable. */
  25448. len = frame.length;
  25449. buffer = (u8 *)frame.buffer;
  25450. /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
  25451. p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  25452. 800f4b8: 2003 movs r0, #3
  25453. 800f4ba: f8bd 1004 ldrh.w r1, [sp, #4]
  25454. /* get received frame */
  25455. frame = ETH_Get_Received_Frame();
  25456. /* Obtain the size of the packet and put it into the "len" variable. */
  25457. len = frame.length;
  25458. buffer = (u8 *)frame.buffer;
  25459. 800f4be: f8dd 8008 ldr.w r8, [sp, #8]
  25460. /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
  25461. p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  25462. 800f4c2: 4602 mov r2, r0
  25463. 800f4c4: f7fc f84f bl 800b566 <pbuf_alloc>
  25464. /* copy received frame to pbuf chain */
  25465. if (p != NULL)
  25466. 800f4c8: 4605 mov r5, r0
  25467. 800f4ca: b928 cbnz r0, 800f4d8 <ethernetif_input+0x2c>
  25468. }
  25469. }
  25470. /* Release descriptors to DMA */
  25471. /* Check if frame with multiple DMA buffer segments */
  25472. if (DMA_RX_FRAME_infos->Seg_Count > 1)
  25473. 800f4cc: 4b1c ldr r3, [pc, #112] ; (800f540 <ethernetif_input+0x94>)
  25474. 800f4ce: 681b ldr r3, [r3, #0]
  25475. 800f4d0: 689a ldr r2, [r3, #8]
  25476. 800f4d2: 2a01 cmp r2, #1
  25477. 800f4d4: d80e bhi.n 800f4f4 <ethernetif_input+0x48>
  25478. 800f4d6: e012 b.n 800f4fe <ethernetif_input+0x52>
  25479. /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
  25480. p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  25481. /* copy received frame to pbuf chain */
  25482. if (p != NULL)
  25483. 800f4d8: 4604 mov r4, r0
  25484. 800f4da: 2600 movs r6, #0
  25485. {
  25486. for (q = p; q != NULL; q = q->next)
  25487. {
  25488. memcpy((u8_t*)q->payload, (u8_t*)&buffer[l], q->len);
  25489. 800f4dc: 6860 ldr r0, [r4, #4]
  25490. 800f4de: 8962 ldrh r2, [r4, #10]
  25491. 800f4e0: eb08 0106 add.w r1, r8, r6
  25492. 800f4e4: f7f9 ff8e bl 8009404 <memcpy>
  25493. l = l + q->len;
  25494. 800f4e8: 8963 ldrh r3, [r4, #10]
  25495. p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  25496. /* copy received frame to pbuf chain */
  25497. if (p != NULL)
  25498. {
  25499. for (q = p; q != NULL; q = q->next)
  25500. 800f4ea: 6824 ldr r4, [r4, #0]
  25501. {
  25502. memcpy((u8_t*)q->payload, (u8_t*)&buffer[l], q->len);
  25503. l = l + q->len;
  25504. 800f4ec: 18f6 adds r6, r6, r3
  25505. p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  25506. /* copy received frame to pbuf chain */
  25507. if (p != NULL)
  25508. {
  25509. for (q = p; q != NULL; q = q->next)
  25510. 800f4ee: 2c00 cmp r4, #0
  25511. 800f4f0: d1f4 bne.n 800f4dc <ethernetif_input+0x30>
  25512. 800f4f2: e7eb b.n 800f4cc <ethernetif_input+0x20>
  25513. /* Release descriptors to DMA */
  25514. /* Check if frame with multiple DMA buffer segments */
  25515. if (DMA_RX_FRAME_infos->Seg_Count > 1)
  25516. {
  25517. DMARxNextDesc = DMA_RX_FRAME_infos->FS_Rx_Desc;
  25518. 800f4f4: 681a ldr r2, [r3, #0]
  25519. /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
  25520. p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  25521. /* copy received frame to pbuf chain */
  25522. if (p != NULL)
  25523. 800f4f6: 2400 movs r4, #0
  25524. }
  25525. /* Set Own bit in Rx descriptors: gives the buffers back to DMA */
  25526. for (i=0; i<DMA_RX_FRAME_infos->Seg_Count; i++)
  25527. {
  25528. DMARxNextDesc->Status = ETH_DMARxDesc_OWN;
  25529. 800f4f8: f04f 4000 mov.w r0, #2147483648 ; 0x80000000
  25530. 800f4fc: e004 b.n 800f508 <ethernetif_input+0x5c>
  25531. {
  25532. DMARxNextDesc = DMA_RX_FRAME_infos->FS_Rx_Desc;
  25533. }
  25534. else
  25535. {
  25536. DMARxNextDesc = frame.descriptor;
  25537. 800f4fe: 9a03 ldr r2, [sp, #12]
  25538. 800f500: e7f9 b.n 800f4f6 <ethernetif_input+0x4a>
  25539. }
  25540. /* Set Own bit in Rx descriptors: gives the buffers back to DMA */
  25541. for (i=0; i<DMA_RX_FRAME_infos->Seg_Count; i++)
  25542. {
  25543. DMARxNextDesc->Status = ETH_DMARxDesc_OWN;
  25544. 800f502: 6010 str r0, [r2, #0]
  25545. DMARxNextDesc = (ETH_DMADESCTypeDef *)(DMARxNextDesc->Buffer2NextDescAddr);
  25546. 800f504: 68d2 ldr r2, [r2, #12]
  25547. {
  25548. DMARxNextDesc = frame.descriptor;
  25549. }
  25550. /* Set Own bit in Rx descriptors: gives the buffers back to DMA */
  25551. for (i=0; i<DMA_RX_FRAME_infos->Seg_Count; i++)
  25552. 800f506: 3401 adds r4, #1
  25553. 800f508: 6899 ldr r1, [r3, #8]
  25554. 800f50a: 428c cmp r4, r1
  25555. 800f50c: d3f9 bcc.n 800f502 <ethernetif_input+0x56>
  25556. DMARxNextDesc->Status = ETH_DMARxDesc_OWN;
  25557. DMARxNextDesc = (ETH_DMADESCTypeDef *)(DMARxNextDesc->Buffer2NextDescAddr);
  25558. }
  25559. /* Clear Segment_Count */
  25560. DMA_RX_FRAME_infos->Seg_Count =0;
  25561. 800f50e: 2200 movs r2, #0
  25562. 800f510: 609a str r2, [r3, #8]
  25563. /* When Rx Buffer unavailable flag is set: clear it and resume reception */
  25564. if ((ETH->DMASR & ETH_DMASR_RBUS) != (u32)RESET)
  25565. 800f512: 4b0c ldr r3, [pc, #48] ; (800f544 <ethernetif_input+0x98>)
  25566. 800f514: 6959 ldr r1, [r3, #20]
  25567. 800f516: 0609 lsls r1, r1, #24
  25568. 800f518: d502 bpl.n 800f520 <ethernetif_input+0x74>
  25569. {
  25570. /* Clear RBUS ETHERNET DMA flag */
  25571. ETH->DMASR = ETH_DMASR_RBUS;
  25572. 800f51a: 2180 movs r1, #128 ; 0x80
  25573. 800f51c: 6159 str r1, [r3, #20]
  25574. /* Resume DMA reception */
  25575. ETH->DMARPDR = 0;
  25576. 800f51e: 609a str r2, [r3, #8]
  25577. /* move received packet into a new pbuf */
  25578. p = low_level_input(netif);
  25579. /* no packet could be read, silently ignore this */
  25580. if (p == NULL) return ERR_MEM;
  25581. 800f520: b14d cbz r5, 800f536 <ethernetif_input+0x8a>
  25582. /* entry point to the LwIP stack */
  25583. err = netif->input(p, netif);
  25584. 800f522: 693b ldr r3, [r7, #16]
  25585. 800f524: 4628 mov r0, r5
  25586. 800f526: 4639 mov r1, r7
  25587. 800f528: 4798 blx r3
  25588. if (err != ERR_OK)
  25589. 800f52a: 4604 mov r4, r0
  25590. 800f52c: b120 cbz r0, 800f538 <ethernetif_input+0x8c>
  25591. {
  25592. LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
  25593. pbuf_free(p);
  25594. 800f52e: 4628 mov r0, r5
  25595. 800f530: f7fb ffc8 bl 800b4c4 <pbuf_free>
  25596. 800f534: e000 b.n 800f538 <ethernetif_input+0x8c>
  25597. /* move received packet into a new pbuf */
  25598. p = low_level_input(netif);
  25599. /* no packet could be read, silently ignore this */
  25600. if (p == NULL) return ERR_MEM;
  25601. 800f536: 24ff movs r4, #255 ; 0xff
  25602. LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
  25603. pbuf_free(p);
  25604. p = NULL;
  25605. }
  25606. return err;
  25607. }
  25608. 800f538: b260 sxtb r0, r4
  25609. 800f53a: b004 add sp, #16
  25610. 800f53c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  25611. 800f540: 2000ab2c .word 0x2000ab2c
  25612. 800f544: 40029000 .word 0x40029000
  25613. 0800f548 <ethernetif_init>:
  25614. #if LWIP_NETIF_HOSTNAME
  25615. /* Initialize interface hostname */
  25616. netif->hostname = "lwip";
  25617. #endif /* LWIP_NETIF_HOSTNAME */
  25618. netif->name[0] = IFNAME0;
  25619. 800f548: 2373 movs r3, #115 ; 0x73
  25620. * @return ERR_OK if the loopif is initialized
  25621. * ERR_MEM if private data couldn't be allocated
  25622. * any other err_t on error
  25623. */
  25624. err_t ethernetif_init(struct netif *netif)
  25625. {
  25626. 800f54a: b537 push {r0, r1, r2, r4, r5, lr}
  25627. #if LWIP_NETIF_HOSTNAME
  25628. /* Initialize interface hostname */
  25629. netif->hostname = "lwip";
  25630. #endif /* LWIP_NETIF_HOSTNAME */
  25631. netif->name[0] = IFNAME0;
  25632. 800f54c: f880 302e strb.w r3, [r0, #46] ; 0x2e
  25633. netif->name[1] = IFNAME1;
  25634. 800f550: 2374 movs r3, #116 ; 0x74
  25635. 800f552: f880 302f strb.w r3, [r0, #47] ; 0x2f
  25636. /* We directly use etharp_output() here to save a function call.
  25637. * You can instead declare your own function an call etharp_output()
  25638. * from it if you have to do some checks before sending (e.g. if link
  25639. * is available...) */
  25640. netif->output = etharp_output;
  25641. 800f556: 4b23 ldr r3, [pc, #140] ; (800f5e4 <ethernetif_init+0x9c>)
  25642. #ifdef CHECKSUM_BY_HARDWARE
  25643. /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
  25644. for(i=0; i<ETH_TXBUFNB; i++)
  25645. {
  25646. ETH_DMATxDescChecksumInsertionConfig(&DMATxDscrTab[i], ETH_DMATxDesc_ChecksumTCPUDPICMPFull);
  25647. 800f558: 4d23 ldr r5, [pc, #140] ; (800f5e8 <ethernetif_init+0xa0>)
  25648. netif->name[1] = IFNAME1;
  25649. /* We directly use etharp_output() here to save a function call.
  25650. * You can instead declare your own function an call etharp_output()
  25651. * from it if you have to do some checks before sending (e.g. if link
  25652. * is available...) */
  25653. netif->output = etharp_output;
  25654. 800f55a: 6143 str r3, [r0, #20]
  25655. netif->linkoutput = low_level_output;
  25656. 800f55c: 4b23 ldr r3, [pc, #140] ; (800f5ec <ethernetif_init+0xa4>)
  25657. 800f55e: 6183 str r3, [r0, #24]
  25658. uint8_t mac[6];
  25659. #ifdef CHECKSUM_BY_HARDWARE
  25660. int i;
  25661. #endif
  25662. /* set MAC hardware address length */
  25663. netif->hwaddr_len = ETHARP_HWADDR_LEN;
  25664. 800f560: 2306 movs r3, #6
  25665. * @return ERR_OK if the loopif is initialized
  25666. * ERR_MEM if private data couldn't be allocated
  25667. * any other err_t on error
  25668. */
  25669. err_t ethernetif_init(struct netif *netif)
  25670. {
  25671. 800f562: 4604 mov r4, r0
  25672. uint8_t mac[6];
  25673. #ifdef CHECKSUM_BY_HARDWARE
  25674. int i;
  25675. #endif
  25676. /* set MAC hardware address length */
  25677. netif->hwaddr_len = ETHARP_HWADDR_LEN;
  25678. 800f564: f880 3026 strb.w r3, [r0, #38] ; 0x26
  25679. /* set MAC hardware address */
  25680. SETTINGS_GetMac(mac);
  25681. 800f568: 4668 mov r0, sp
  25682. 800f56a: f000 fa8d bl 800fa88 <SETTINGS_GetMac>
  25683. netif->hwaddr[0] = mac[0];
  25684. 800f56e: f89d 3000 ldrb.w r3, [sp]
  25685. 800f572: f884 3027 strb.w r3, [r4, #39] ; 0x27
  25686. netif->hwaddr[1] = mac[1];
  25687. 800f576: f89d 3001 ldrb.w r3, [sp, #1]
  25688. 800f57a: f884 3028 strb.w r3, [r4, #40] ; 0x28
  25689. netif->hwaddr[2] = mac[2];
  25690. 800f57e: f89d 3002 ldrb.w r3, [sp, #2]
  25691. 800f582: f884 3029 strb.w r3, [r4, #41] ; 0x29
  25692. netif->hwaddr[3] = mac[3];
  25693. 800f586: f89d 3003 ldrb.w r3, [sp, #3]
  25694. 800f58a: f884 302a strb.w r3, [r4, #42] ; 0x2a
  25695. netif->hwaddr[4] = mac[4];
  25696. 800f58e: f89d 3004 ldrb.w r3, [sp, #4]
  25697. 800f592: f884 302b strb.w r3, [r4, #43] ; 0x2b
  25698. netif->hwaddr[5] = mac[5];
  25699. 800f596: f89d 3005 ldrb.w r3, [sp, #5]
  25700. /* initialize MAC address in ethernet MAC */
  25701. ETH_MACAddressConfig(ETH_MAC_Address0, netif->hwaddr);
  25702. 800f59a: f104 0127 add.w r1, r4, #39 ; 0x27
  25703. netif->hwaddr[0] = mac[0];
  25704. netif->hwaddr[1] = mac[1];
  25705. netif->hwaddr[2] = mac[2];
  25706. netif->hwaddr[3] = mac[3];
  25707. netif->hwaddr[4] = mac[4];
  25708. netif->hwaddr[5] = mac[5];
  25709. 800f59e: f884 302c strb.w r3, [r4, #44] ; 0x2c
  25710. /* initialize MAC address in ethernet MAC */
  25711. ETH_MACAddressConfig(ETH_MAC_Address0, netif->hwaddr);
  25712. 800f5a2: 2000 movs r0, #0
  25713. 800f5a4: f001 f8d4 bl 8010750 <ETH_MACAddressConfig>
  25714. /* maximum transfer unit */
  25715. netif->mtu = 1500;
  25716. 800f5a8: f240 53dc movw r3, #1500 ; 0x5dc
  25717. 800f5ac: 84a3 strh r3, [r4, #36] ; 0x24
  25718. /* device capabilities */
  25719. /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */
  25720. netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
  25721. 800f5ae: 2332 movs r3, #50 ; 0x32
  25722. 800f5b0: f884 302d strb.w r3, [r4, #45] ; 0x2d
  25723. /* Initialize Tx Descriptors list: Chain Mode */
  25724. ETH_DMATxDescChainInit(DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB);
  25725. 800f5b4: 480c ldr r0, [pc, #48] ; (800f5e8 <ethernetif_init+0xa0>)
  25726. 800f5b6: 490e ldr r1, [pc, #56] ; (800f5f0 <ethernetif_init+0xa8>)
  25727. 800f5b8: 2205 movs r2, #5
  25728. 800f5ba: f001 f9bf bl 801093c <ETH_DMATxDescChainInit>
  25729. /* Initialize Rx Descriptors list: Chain Mode */
  25730. ETH_DMARxDescChainInit(DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
  25731. 800f5be: 480d ldr r0, [pc, #52] ; (800f5f4 <ethernetif_init+0xac>)
  25732. 800f5c0: 490d ldr r1, [pc, #52] ; (800f5f8 <ethernetif_init+0xb0>)
  25733. 800f5c2: 2205 movs r2, #5
  25734. 800f5c4: f001 f950 bl 8010868 <ETH_DMARxDescChainInit>
  25735. #ifdef CHECKSUM_BY_HARDWARE
  25736. /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
  25737. for(i=0; i<ETH_TXBUFNB; i++)
  25738. 800f5c8: 2400 movs r4, #0
  25739. {
  25740. ETH_DMATxDescChecksumInsertionConfig(&DMATxDscrTab[i], ETH_DMATxDesc_ChecksumTCPUDPICMPFull);
  25741. 800f5ca: eb05 1044 add.w r0, r5, r4, lsl #5
  25742. 800f5ce: f44f 0140 mov.w r1, #12582912 ; 0xc00000
  25743. /* Initialize Rx Descriptors list: Chain Mode */
  25744. ETH_DMARxDescChainInit(DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
  25745. #ifdef CHECKSUM_BY_HARDWARE
  25746. /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
  25747. for(i=0; i<ETH_TXBUFNB; i++)
  25748. 800f5d2: 3401 adds r4, #1
  25749. {
  25750. ETH_DMATxDescChecksumInsertionConfig(&DMATxDscrTab[i], ETH_DMATxDesc_ChecksumTCPUDPICMPFull);
  25751. 800f5d4: f001 f9d4 bl 8010980 <ETH_DMATxDescChecksumInsertionConfig>
  25752. /* Initialize Rx Descriptors list: Chain Mode */
  25753. ETH_DMARxDescChainInit(DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
  25754. #ifdef CHECKSUM_BY_HARDWARE
  25755. /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
  25756. for(i=0; i<ETH_TXBUFNB; i++)
  25757. 800f5d8: 2c05 cmp r4, #5
  25758. 800f5da: d1f6 bne.n 800f5ca <ethernetif_init+0x82>
  25759. #endif
  25760. /* Note: TCP, UDP, ICMP checksum checking for received frame are enabled in DMA config */
  25761. /* Enable MAC and DMA transmission and reception */
  25762. ETH_Start();
  25763. 800f5dc: f001 fa10 bl 8010a00 <ETH_Start>
  25764. /* initialize the hardware */
  25765. low_level_init(netif);
  25766. return ERR_OK;
  25767. }
  25768. 800f5e0: 2000 movs r0, #0
  25769. 800f5e2: bd3e pop {r1, r2, r3, r4, r5, pc}
  25770. 800f5e4: 0800f151 .word 0x0800f151
  25771. 800f5e8: 20008cc4 .word 0x20008cc4
  25772. 800f5ec: 0800f47d .word 0x0800f47d
  25773. 800f5f0: 2000abd0 .word 0x2000abd0
  25774. 800f5f4: 2000ab30 .word 0x2000ab30
  25775. 800f5f8: 20008d64 .word 0x20008d64
  25776. 0800f5fc <CRC_Init>:
  25777. /**
  25778. * @brief
  25779. * @retval
  25780. */
  25781. void CRC_Init(void)
  25782. {
  25783. 800f5fc: b508 push {r3, lr}
  25784. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
  25785. 800f5fe: f44f 5080 mov.w r0, #4096 ; 0x1000
  25786. 800f602: 2101 movs r1, #1
  25787. 800f604: f7fa fcc6 bl 8009f94 <RCC_AHB1PeriphClockCmd>
  25788. CRC->CR |= CRC_CR_RESET;
  25789. 800f608: 4b02 ldr r3, [pc, #8] ; (800f614 <CRC_Init+0x18>)
  25790. 800f60a: 689a ldr r2, [r3, #8]
  25791. 800f60c: f042 0201 orr.w r2, r2, #1
  25792. 800f610: 609a str r2, [r3, #8]
  25793. 800f612: bd08 pop {r3, pc}
  25794. 800f614: 40023000 .word 0x40023000
  25795. 0800f618 <CRC_Read>:
  25796. * @retval
  25797. */
  25798. uint32_t CRC_Read(void) {
  25799. uint32_t* ptr = (uint32_t*)USER_FLASH_CRC_ADDRESS;
  25800. return *ptr;
  25801. }
  25802. 800f618: 4b01 ldr r3, [pc, #4] ; (800f620 <CRC_Read+0x8>)
  25803. 800f61a: 6818 ldr r0, [r3, #0]
  25804. 800f61c: 4770 bx lr
  25805. 800f61e: bf00 nop
  25806. 800f620: 0807fffc .word 0x0807fffc
  25807. 0800f624 <CRC_Calcucate>:
  25808. * @retval
  25809. */
  25810. uint32_t CRC_Calcucate(void) {
  25811. uint32_t res;
  25812. /* Reset CRC */
  25813. CRC->CR = ((uint8_t)0x01);
  25814. 800f624: 4a06 ldr r2, [pc, #24] ; (800f640 <CRC_Calcucate+0x1c>)
  25815. for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
  25816. 800f626: 4907 ldr r1, [pc, #28] ; (800f644 <CRC_Calcucate+0x20>)
  25817. * @retval
  25818. */
  25819. uint32_t CRC_Calcucate(void) {
  25820. uint32_t res;
  25821. /* Reset CRC */
  25822. CRC->CR = ((uint8_t)0x01);
  25823. 800f628: 2301 movs r3, #1
  25824. 800f62a: 6093 str r3, [r2, #8]
  25825. for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
  25826. 800f62c: 4b06 ldr r3, [pc, #24] ; (800f648 <CRC_Calcucate+0x24>)
  25827. CRC->DR = *ptr; // добавляем всю прошивку в CRC
  25828. 800f62e: f853 0b04 ldr.w r0, [r3], #4
  25829. */
  25830. uint32_t CRC_Calcucate(void) {
  25831. uint32_t res;
  25832. /* Reset CRC */
  25833. CRC->CR = ((uint8_t)0x01);
  25834. for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
  25835. 800f632: 428b cmp r3, r1
  25836. CRC->DR = *ptr; // добавляем всю прошивку в CRC
  25837. 800f634: 6010 str r0, [r2, #0]
  25838. */
  25839. uint32_t CRC_Calcucate(void) {
  25840. uint32_t res;
  25841. /* Reset CRC */
  25842. CRC->CR = ((uint8_t)0x01);
  25843. for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
  25844. 800f636: d1fa bne.n 800f62e <CRC_Calcucate+0xa>
  25845. CRC->DR = *ptr; // добавляем всю прошивку в CRC
  25846. res = CRC->DR;
  25847. 800f638: 4b01 ldr r3, [pc, #4] ; (800f640 <CRC_Calcucate+0x1c>)
  25848. 800f63a: 6818 ldr r0, [r3, #0]
  25849. return res;
  25850. }
  25851. 800f63c: 4770 bx lr
  25852. 800f63e: bf00 nop
  25853. 800f640: 40023000 .word 0x40023000
  25854. 800f644: 0807fffc .word 0x0807fffc
  25855. 800f648: 08020000 .word 0x08020000
  25856. 0800f64c <FLASH_If_Init>:
  25857. * @param None
  25858. * @retval None
  25859. */
  25860. void FLASH_If_Init(void)
  25861. {
  25862. FLASH_Unlock();
  25863. 800f64c: f7fa bb40 b.w 8009cd0 <FLASH_Unlock>
  25864. 0800f650 <FLASH_If_Erase>:
  25865. FlashAddress = StartSector;
  25866. /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
  25867. be done by word */
  25868. if (FlashAddress <= (uint32_t) USER_FLASH_LAST_PAGE_ADDRESS)
  25869. 800f650: 4b14 ldr r3, [pc, #80] ; (800f6a4 <FLASH_If_Erase+0x54>)
  25870. 800f652: 4298 cmp r0, r3
  25871. * @param StartSector: start of user flash area
  25872. * @retval 0: user flash area successfully erased
  25873. * 1: error occurred
  25874. */
  25875. int8_t FLASH_If_Erase(uint32_t StartSector)
  25876. {
  25877. 800f654: b510 push {r4, lr}
  25878. FlashAddress = StartSector;
  25879. /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
  25880. be done by word */
  25881. if (FlashAddress <= (uint32_t) USER_FLASH_LAST_PAGE_ADDRESS)
  25882. 800f656: d822 bhi.n 800f69e <FLASH_If_Erase+0x4e>
  25883. {
  25884. FLASH_Unlock();
  25885. GPIOE->ODR ^= WDT_PIN;
  25886. 800f658: 4c13 ldr r4, [pc, #76] ; (800f6a8 <FLASH_If_Erase+0x58>)
  25887. /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
  25888. be done by word */
  25889. if (FlashAddress <= (uint32_t) USER_FLASH_LAST_PAGE_ADDRESS)
  25890. {
  25891. FLASH_Unlock();
  25892. 800f65a: f7fa fb39 bl 8009cd0 <FLASH_Unlock>
  25893. GPIOE->ODR ^= WDT_PIN;
  25894. 800f65e: 6963 ldr r3, [r4, #20]
  25895. 800f660: f083 0301 eor.w r3, r3, #1
  25896. 800f664: 6163 str r3, [r4, #20]
  25897. FLASH_EraseSector(FLASH_Sector_5, VoltageRange_3); /* 128 Kbyte */
  25898. 800f666: 2102 movs r1, #2
  25899. 800f668: 2028 movs r0, #40 ; 0x28
  25900. 800f66a: f7fa fbab bl 8009dc4 <FLASH_EraseSector>
  25901. GPIOE->ODR ^= WDT_PIN;
  25902. 800f66e: 6963 ldr r3, [r4, #20]
  25903. 800f670: f083 0301 eor.w r3, r3, #1
  25904. 800f674: 6163 str r3, [r4, #20]
  25905. FLASH_EraseSector(FLASH_Sector_6, VoltageRange_3); /* 128 Kbyte */
  25906. 800f676: 2102 movs r1, #2
  25907. 800f678: 2030 movs r0, #48 ; 0x30
  25908. 800f67a: f7fa fba3 bl 8009dc4 <FLASH_EraseSector>
  25909. GPIOE->ODR ^= WDT_PIN;
  25910. 800f67e: 6963 ldr r3, [r4, #20]
  25911. 800f680: f083 0301 eor.w r3, r3, #1
  25912. 800f684: 6163 str r3, [r4, #20]
  25913. FLASH_EraseSector(FLASH_Sector_7, VoltageRange_3); /* 128 Kbyte */
  25914. 800f686: 2102 movs r1, #2
  25915. 800f688: 2038 movs r0, #56 ; 0x38
  25916. 800f68a: f7fa fb9b bl 8009dc4 <FLASH_EraseSector>
  25917. GPIOE->ODR ^= WDT_PIN;
  25918. 800f68e: 6963 ldr r3, [r4, #20]
  25919. 800f690: f083 0301 eor.w r3, r3, #1
  25920. 800f694: 6163 str r3, [r4, #20]
  25921. FLASH_EraseSector(FLASH_Sector_8, VoltageRange_3); /* 128 Kbyte */
  25922. GPIOE->ODR ^= WDT_PIN;
  25923. FLASH_EraseSector(FLASH_Sector_9, VoltageRange_3); /* 128 Kbyte */
  25924. GPIOE->ODR ^= WDT_PIN;
  25925. }
  25926. FLASH_Lock();
  25927. 800f696: f7fa fb29 bl 8009cec <FLASH_Lock>
  25928. else
  25929. {
  25930. return (1);
  25931. }
  25932. return (0);
  25933. 800f69a: 2000 movs r0, #0
  25934. 800f69c: bd10 pop {r4, pc}
  25935. }
  25936. FLASH_Lock();
  25937. }
  25938. else
  25939. {
  25940. return (1);
  25941. 800f69e: 2001 movs r0, #1
  25942. }
  25943. return (0);
  25944. }
  25945. 800f6a0: bd10 pop {r4, pc}
  25946. 800f6a2: bf00 nop
  25947. 800f6a4: 08060000 .word 0x08060000
  25948. 800f6a8: 40021000 .word 0x40021000
  25949. 0800f6ac <FLASH_If_Write>:
  25950. * @retval 0: Data successfully written to Flash memory
  25951. * 1: Error occurred while writing data in Flash memory
  25952. * 2: Written Data in flash memory is different from expected one
  25953. */
  25954. uint32_t FLASH_If_Write(__IO uint32_t* FlashAddress, uint32_t* Data ,uint16_t DataLength)
  25955. {
  25956. 800f6ac: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  25957. 800f6b0: 4604 mov r4, r0
  25958. 800f6b2: 4690 mov r8, r2
  25959. * @param DataLength: length of data buffer (unit is 32-bit word)
  25960. * @retval 0: Data successfully written to Flash memory
  25961. * 1: Error occurred while writing data in Flash memory
  25962. * 2: Written Data in flash memory is different from expected one
  25963. */
  25964. uint32_t FLASH_If_Write(__IO uint32_t* FlashAddress, uint32_t* Data ,uint16_t DataLength)
  25965. 800f6b4: 1f0e subs r6, r1, #4
  25966. printf("%i", delta);
  25967. if ((delta < 1460) && (DataLength != 1))
  25968. DataLength = delta / 4;
  25969. */
  25970. for (i = 0; (i < DataLength) && (*FlashAddress <= (USER_FLASH_END_ADDRESS)); i++)
  25971. 800f6b6: 2500 movs r5, #0
  25972. 800f6b8: 4f10 ldr r7, [pc, #64] ; (800f6fc <FLASH_If_Write+0x50>)
  25973. 800f6ba: e00f b.n 800f6dc <FLASH_If_Write+0x30>
  25974. {
  25975. /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
  25976. be done by word */
  25977. if (FLASH_ProgramWord(*FlashAddress, *(uint32_t*)(Data+i)) == FLASH_COMPLETE)
  25978. 800f6bc: 6820 ldr r0, [r4, #0]
  25979. 800f6be: 6871 ldr r1, [r6, #4]
  25980. 800f6c0: f7fa fb62 bl 8009d88 <FLASH_ProgramWord>
  25981. 800f6c4: 2808 cmp r0, #8
  25982. 800f6c6: d10f bne.n 800f6e8 <FLASH_If_Write+0x3c>
  25983. {
  25984. /* Check the written value */
  25985. if (*(uint32_t*)*FlashAddress != *(uint32_t*)(Data+i))
  25986. 800f6c8: 6823 ldr r3, [r4, #0]
  25987. 800f6ca: 681a ldr r2, [r3, #0]
  25988. 800f6cc: f856 3f04 ldr.w r3, [r6, #4]!
  25989. 800f6d0: 429a cmp r2, r3
  25990. 800f6d2: d10c bne.n 800f6ee <FLASH_If_Write+0x42>
  25991. {
  25992. /* Flash content doesn't match SRAM content */
  25993. return(2);
  25994. }
  25995. /* Increment FLASH destination address */
  25996. *FlashAddress += 4;
  25997. 800f6d4: 6823 ldr r3, [r4, #0]
  25998. 800f6d6: 3304 adds r3, #4
  25999. 800f6d8: 6023 str r3, [r4, #0]
  26000. printf("%i", delta);
  26001. if ((delta < 1460) && (DataLength != 1))
  26002. DataLength = delta / 4;
  26003. */
  26004. for (i = 0; (i < DataLength) && (*FlashAddress <= (USER_FLASH_END_ADDRESS)); i++)
  26005. 800f6da: 3501 adds r5, #1
  26006. 800f6dc: 4545 cmp r5, r8
  26007. 800f6de: d209 bcs.n 800f6f4 <FLASH_If_Write+0x48>
  26008. 800f6e0: 6823 ldr r3, [r4, #0]
  26009. 800f6e2: 42bb cmp r3, r7
  26010. 800f6e4: d9ea bls.n 800f6bc <FLASH_If_Write+0x10>
  26011. 800f6e6: e005 b.n 800f6f4 <FLASH_If_Write+0x48>
  26012. *FlashAddress += 4;
  26013. }
  26014. else
  26015. {
  26016. /* Error occurred while writing data in Flash memory */
  26017. return (1);
  26018. 800f6e8: 2001 movs r0, #1
  26019. 800f6ea: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  26020. {
  26021. /* Check the written value */
  26022. if (*(uint32_t*)*FlashAddress != *(uint32_t*)(Data+i))
  26023. {
  26024. /* Flash content doesn't match SRAM content */
  26025. return(2);
  26026. 800f6ee: 2002 movs r0, #2
  26027. 800f6f0: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  26028. /* Error occurred while writing data in Flash memory */
  26029. return (1);
  26030. }
  26031. }
  26032. return (0);
  26033. 800f6f4: 2000 movs r0, #0
  26034. }
  26035. 800f6f6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  26036. 800f6fa: bf00 nop
  26037. 800f6fc: 0807ffff .word 0x0807ffff
  26038. 0800f700 <IO_Init>:
  26039. /**
  26040. * @brief Инициализация дискретных входов-выходов
  26041. * @retval
  26042. */
  26043. void IO_Init(void)
  26044. {
  26045. 800f700: b507 push {r0, r1, r2, lr}
  26046. GPIO_InitTypeDef GPIO_InitStructure;
  26047. RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOE, ENABLE);
  26048. 800f702: 2010 movs r0, #16
  26049. 800f704: 2101 movs r1, #1
  26050. 800f706: f7fa fc45 bl 8009f94 <RCC_AHB1PeriphClockCmd>
  26051. /* ----------------------------- Inputs ---------------------------------- */
  26052. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
  26053. 800f70a: 2300 movs r3, #0
  26054. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
  26055. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  26056. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  26057. /* BUTTON DEFAULT - " " */
  26058. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  26059. 800f70c: a902 add r1, sp, #8
  26060. RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOE, ENABLE);
  26061. /* ----------------------------- Inputs ---------------------------------- */
  26062. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
  26063. 800f70e: f88d 3004 strb.w r3, [sp, #4]
  26064. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
  26065. 800f712: f88d 3005 strb.w r3, [sp, #5]
  26066. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  26067. 800f716: f88d 3006 strb.w r3, [sp, #6]
  26068. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  26069. 800f71a: f88d 3007 strb.w r3, [sp, #7]
  26070. /* BUTTON DEFAULT - " " */
  26071. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  26072. 800f71e: f44f 6380 mov.w r3, #1024 ; 0x400
  26073. 800f722: f841 3d08 str.w r3, [r1, #-8]!
  26074. GPIO_Init(GPIOE, &GPIO_InitStructure);
  26075. 800f726: 4802 ldr r0, [pc, #8] ; (800f730 <IO_Init+0x30>)
  26076. 800f728: 4669 mov r1, sp
  26077. 800f72a: f7fa fb81 bl 8009e30 <GPIO_Init>
  26078. }
  26079. 800f72e: bd0e pop {r1, r2, r3, pc}
  26080. 800f730: 40021000 .word 0x40021000
  26081. 0800f734 <IO_BtnDefaultPressed>:
  26082. /**
  26083. * @brief Получить состояние кнопки DEFAULT
  26084. */
  26085. bool IO_BtnDefaultPressed(void)
  26086. {
  26087. 800f734: b508 push {r3, lr}
  26088. return !GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_10); // BUTTON DEFAULT
  26089. 800f736: f44f 6180 mov.w r1, #1024 ; 0x400
  26090. 800f73a: 4804 ldr r0, [pc, #16] ; (800f74c <IO_BtnDefaultPressed+0x18>)
  26091. 800f73c: f7fa fbbd bl 8009eba <GPIO_ReadInputDataBit>
  26092. }
  26093. 800f740: f1d0 0001 rsbs r0, r0, #1
  26094. 800f744: bf38 it cc
  26095. 800f746: 2000 movcc r0, #0
  26096. 800f748: bd08 pop {r3, pc}
  26097. 800f74a: bf00 nop
  26098. 800f74c: 40021000 .word 0x40021000
  26099. 0800f750 <LED_On>:
  26100. /**
  26101. * @brief
  26102. */
  26103. void LED_On(LED_NAMES_t led)
  26104. {
  26105. API_LED_On(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
  26106. 800f750: 4a05 ldr r2, [pc, #20] ; (800f768 <LED_On+0x18>)
  26107. 800f752: f852 3030 ldr.w r3, [r2, r0, lsl #3]
  26108. 800f756: eb02 00c0 add.w r0, r2, r0, lsl #3
  26109. * 1 - для включения LED нужно сбросить уровень
  26110. * @retval
  26111. */
  26112. void API_LED_On(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
  26113. {
  26114. if (revers == 0)
  26115. 800f75a: 7981 ldrb r1, [r0, #6]
  26116. /**
  26117. * @brief
  26118. */
  26119. void LED_On(LED_NAMES_t led)
  26120. {
  26121. API_LED_On(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
  26122. 800f75c: 8882 ldrh r2, [r0, #4]
  26123. * 1 - для включения LED нужно сбросить уровень
  26124. * @retval
  26125. */
  26126. void API_LED_On(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
  26127. {
  26128. if (revers == 0)
  26129. 800f75e: b909 cbnz r1, 800f764 <LED_On+0x14>
  26130. port->BSRRL = pin;
  26131. 800f760: 831a strh r2, [r3, #24]
  26132. 800f762: 4770 bx lr
  26133. else
  26134. port->BSRRH = pin;
  26135. 800f764: 835a strh r2, [r3, #26]
  26136. 800f766: 4770 bx lr
  26137. 800f768: 2000837c .word 0x2000837c
  26138. 0800f76c <LED_Off>:
  26139. /**
  26140. * @brief
  26141. */
  26142. void LED_Off(LED_NAMES_t led)
  26143. {
  26144. API_LED_Off(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
  26145. 800f76c: 4a05 ldr r2, [pc, #20] ; (800f784 <LED_Off+0x18>)
  26146. 800f76e: f852 3030 ldr.w r3, [r2, r0, lsl #3]
  26147. 800f772: eb02 00c0 add.w r0, r2, r0, lsl #3
  26148. * 1 - для выключения LED нужно установить уровень
  26149. * @retval
  26150. */
  26151. void API_LED_Off(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
  26152. {
  26153. if (revers == 0)
  26154. 800f776: 7981 ldrb r1, [r0, #6]
  26155. /**
  26156. * @brief
  26157. */
  26158. void LED_Off(LED_NAMES_t led)
  26159. {
  26160. API_LED_Off(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
  26161. 800f778: 8882 ldrh r2, [r0, #4]
  26162. * 1 - для выключения LED нужно установить уровень
  26163. * @retval
  26164. */
  26165. void API_LED_Off(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
  26166. {
  26167. if (revers == 0)
  26168. 800f77a: b909 cbnz r1, 800f780 <LED_Off+0x14>
  26169. port->BSRRH = pin;
  26170. 800f77c: 835a strh r2, [r3, #26]
  26171. 800f77e: 4770 bx lr
  26172. else
  26173. port->BSRRL = pin;
  26174. 800f780: 831a strh r2, [r3, #24]
  26175. 800f782: 4770 bx lr
  26176. 800f784: 2000837c .word 0x2000837c
  26177. 0800f788 <LED_Init>:
  26178. /**
  26179. * @brief
  26180. * @retval
  26181. */
  26182. void LED_Init(void)
  26183. {
  26184. 800f788: b537 push {r0, r1, r2, r4, r5, lr}
  26185. GPIO_InitTypeDef GPIO_InitStructure;
  26186. RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA, ENABLE);
  26187. 800f78a: 2001 movs r0, #1
  26188. 800f78c: 4601 mov r1, r0
  26189. 800f78e: f7fa fc01 bl 8009f94 <RCC_AHB1PeriphClockCmd>
  26190. LEDS[GREEN_STATUS].GPIOx = GPIOA;
  26191. 800f792: 4b10 ldr r3, [pc, #64] ; (800f7d4 <LED_Init+0x4c>)
  26192. 800f794: 4810 ldr r0, [pc, #64] ; (800f7d8 <LED_Init+0x50>)
  26193. LEDS[GREEN_STATUS].GPIO_Pin = GPIO_Pin_3;
  26194. 800f796: 2208 movs r2, #8
  26195. LEDS[GREEN_STATUS].revers = 1;
  26196. 800f798: 2401 movs r4, #1
  26197. GPIO_InitTypeDef GPIO_InitStructure;
  26198. RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA, ENABLE);
  26199. LEDS[GREEN_STATUS].GPIOx = GPIOA;
  26200. LEDS[GREEN_STATUS].GPIO_Pin = GPIO_Pin_3;
  26201. 800f79a: 809a strh r2, [r3, #4]
  26202. LEDS[GREEN_STATUS].revers = 1;
  26203. LEDS[RED_STATUS].GPIOx = GPIOA;
  26204. LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
  26205. 800f79c: 2210 movs r2, #16
  26206. 800f79e: 819a strh r2, [r3, #12]
  26207. {
  26208. GPIO_InitTypeDef GPIO_InitStructure;
  26209. RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA, ENABLE);
  26210. LEDS[GREEN_STATUS].GPIOx = GPIOA;
  26211. 800f7a0: 6018 str r0, [r3, #0]
  26212. LEDS[GREEN_STATUS].GPIO_Pin = GPIO_Pin_3;
  26213. LEDS[GREEN_STATUS].revers = 1;
  26214. 800f7a2: 719c strb r4, [r3, #6]
  26215. LEDS[RED_STATUS].GPIOx = GPIOA;
  26216. 800f7a4: 6098 str r0, [r3, #8]
  26217. LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
  26218. LEDS[RED_STATUS].revers = 1;
  26219. 800f7a6: 739c strb r4, [r3, #14]
  26220. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
  26221. 800f7a8: 2318 movs r3, #24
  26222. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  26223. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  26224. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  26225. 800f7aa: 2500 movs r5, #0
  26226. LEDS[RED_STATUS].GPIOx = GPIOA;
  26227. LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
  26228. LEDS[RED_STATUS].revers = 1;
  26229. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
  26230. 800f7ac: 9300 str r3, [sp, #0]
  26231. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  26232. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  26233. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  26234. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  26235. GPIO_Init(GPIOA, &GPIO_InitStructure);
  26236. 800f7ae: 4669 mov r1, sp
  26237. LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
  26238. LEDS[RED_STATUS].revers = 1;
  26239. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
  26240. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  26241. 800f7b0: 2302 movs r3, #2
  26242. 800f7b2: f88d 3005 strb.w r3, [sp, #5]
  26243. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  26244. 800f7b6: f88d 4004 strb.w r4, [sp, #4]
  26245. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  26246. 800f7ba: f88d 5006 strb.w r5, [sp, #6]
  26247. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  26248. 800f7be: f88d 5007 strb.w r5, [sp, #7]
  26249. GPIO_Init(GPIOA, &GPIO_InitStructure);
  26250. 800f7c2: f7fa fb35 bl 8009e30 <GPIO_Init>
  26251. LED_Off(GREEN_STATUS);
  26252. 800f7c6: 4628 mov r0, r5
  26253. 800f7c8: f7ff ffd0 bl 800f76c <LED_Off>
  26254. LED_Off(RED_STATUS);
  26255. 800f7cc: 4620 mov r0, r4
  26256. 800f7ce: f7ff ffcd bl 800f76c <LED_Off>
  26257. }
  26258. 800f7d2: bd3e pop {r1, r2, r3, r4, r5, pc}
  26259. 800f7d4: 2000837c .word 0x2000837c
  26260. 800f7d8: 40020000 .word 0x40020000
  26261. 0800f7dc <LED_Toggle>:
  26262. /**
  26263. * @brief Изменить состояние LED
  26264. */
  26265. void LED_Toggle(LED_NAMES_t led)
  26266. {
  26267. LEDS[led].GPIOx->ODR ^= LEDS[led].GPIO_Pin;
  26268. 800f7dc: 4a04 ldr r2, [pc, #16] ; (800f7f0 <LED_Toggle+0x14>)
  26269. 800f7de: f852 3030 ldr.w r3, [r2, r0, lsl #3]
  26270. 800f7e2: eb02 02c0 add.w r2, r2, r0, lsl #3
  26271. 800f7e6: 6959 ldr r1, [r3, #20]
  26272. 800f7e8: 8892 ldrh r2, [r2, #4]
  26273. 800f7ea: 404a eors r2, r1
  26274. 800f7ec: 615a str r2, [r3, #20]
  26275. 800f7ee: 4770 bx lr
  26276. 800f7f0: 2000837c .word 0x2000837c
  26277. 0800f7f4 <LED_Blinky_Green>:
  26278. /**
  26279. * @brief Мигает зеленым, индикация режима IAPviaETH
  26280. */
  26281. void LED_Blinky_Green(void)
  26282. {
  26283. LED_Toggle(GREEN_STATUS);
  26284. 800f7f4: 2000 movs r0, #0
  26285. 800f7f6: f7ff bff1 b.w 800f7dc <LED_Toggle>
  26286. 800f7fa: 0000 movs r0, r0
  26287. 0800f7fc <SETTINGS_SetBootParamsDef>:
  26288. /**
  26289. * @brief Установить параметры обновления ПО по умолчанию
  26290. */
  26291. void SETTINGS_SetBootParamsDef(void)
  26292. {
  26293. sSettings.bootParams.loadMode = 1;
  26294. 800f7fc: 4b02 ldr r3, [pc, #8] ; (800f808 <SETTINGS_SetBootParamsDef+0xc>)
  26295. 800f7fe: 2201 movs r2, #1
  26296. 800f800: 701a strb r2, [r3, #0]
  26297. sSettings.bootParams.bootTry = 0;
  26298. 800f802: 2200 movs r2, #0
  26299. 800f804: 705a strb r2, [r3, #1]
  26300. 800f806: 4770 bx lr
  26301. 800f808: 2000838c .word 0x2000838c
  26302. 0800f80c <SETTINGS_SetWebParamsDef>:
  26303. /**
  26304. * @brief Установить параметры сетевого подключения по умолчанию
  26305. */
  26306. void SETTINGS_SetWebParamsDef(void)
  26307. {
  26308. 800f80c: b510 push {r4, lr}
  26309. strcpy(sSettings.sWebParams.ip, "192.168.1.2");
  26310. 800f80e: 4c09 ldr r4, [pc, #36] ; (800f834 <SETTINGS_SetWebParamsDef+0x28>)
  26311. 800f810: 4909 ldr r1, [pc, #36] ; (800f838 <SETTINGS_SetWebParamsDef+0x2c>)
  26312. 800f812: 4620 mov r0, r4
  26313. 800f814: f7fa f804 bl 8009820 <strcpy>
  26314. strcpy(sSettings.sWebParams.gate, "192.168.1.1");
  26315. 800f818: 4908 ldr r1, [pc, #32] ; (800f83c <SETTINGS_SetWebParamsDef+0x30>)
  26316. 800f81a: f104 000f add.w r0, r4, #15
  26317. 800f81e: f7f9 ffff bl 8009820 <strcpy>
  26318. strcpy(sSettings.sWebParams.mask, "255.255.255.0");
  26319. 800f822: f104 001e add.w r0, r4, #30
  26320. 800f826: 4906 ldr r1, [pc, #24] ; (800f840 <SETTINGS_SetWebParamsDef+0x34>)
  26321. 800f828: f7f9 fffa bl 8009820 <strcpy>
  26322. sSettings.sWebParams.dhcpEnable = 1;
  26323. 800f82c: 2201 movs r2, #1
  26324. 800f82e: f884 202d strb.w r2, [r4, #45] ; 0x2d
  26325. 800f832: bd10 pop {r4, pc}
  26326. 800f834: 2000838e .word 0x2000838e
  26327. 800f838: 08011890 .word 0x08011890
  26328. 800f83c: 0801189c .word 0x0801189c
  26329. 800f840: 080118a8 .word 0x080118a8
  26330. 0800f844 <SETTINGS_SetTempWebParamsDef>:
  26331. /**
  26332. * @brief Установить временные параметры сетевого подключения по умолчанию
  26333. */
  26334. void SETTINGS_SetTempWebParamsDef(void)
  26335. {
  26336. 800f844: b510 push {r4, lr}
  26337. strcpy(sSettings.sWebTempParams.ip, "192.168.1.2");
  26338. 800f846: 4c09 ldr r4, [pc, #36] ; (800f86c <SETTINGS_SetTempWebParamsDef+0x28>)
  26339. 800f848: 4909 ldr r1, [pc, #36] ; (800f870 <SETTINGS_SetTempWebParamsDef+0x2c>)
  26340. 800f84a: 4620 mov r0, r4
  26341. 800f84c: f7f9 ffe8 bl 8009820 <strcpy>
  26342. strcpy(sSettings.sWebTempParams.gate, "192.168.1.1");
  26343. 800f850: 4908 ldr r1, [pc, #32] ; (800f874 <SETTINGS_SetTempWebParamsDef+0x30>)
  26344. 800f852: f104 000f add.w r0, r4, #15
  26345. 800f856: f7f9 ffe3 bl 8009820 <strcpy>
  26346. strcpy(sSettings.sWebTempParams.mask, "255.255.255.0");
  26347. 800f85a: f104 001e add.w r0, r4, #30
  26348. 800f85e: 4906 ldr r1, [pc, #24] ; (800f878 <SETTINGS_SetTempWebParamsDef+0x34>)
  26349. 800f860: f7f9 ffde bl 8009820 <strcpy>
  26350. sSettings.sWebTempParams.dhcpEnable = 1;
  26351. 800f864: 2201 movs r2, #1
  26352. 800f866: f884 202d strb.w r2, [r4, #45] ; 0x2d
  26353. 800f86a: bd10 pop {r4, pc}
  26354. 800f86c: 200083bc .word 0x200083bc
  26355. 800f870: 08011890 .word 0x08011890
  26356. 800f874: 0801189c .word 0x0801189c
  26357. 800f878: 080118a8 .word 0x080118a8
  26358. 0800f87c <SETTINGS_SetSnmpDef>:
  26359. /**
  26360. * @brief Установить параметры SNMP по умолчанию
  26361. */
  26362. void SETTINGS_SetSnmpDef(void)
  26363. {
  26364. 800f87c: b570 push {r4, r5, r6, lr}
  26365. strcpy(sSettings.sSnmp.sysDescr, "");
  26366. 800f87e: 4c19 ldr r4, [pc, #100] ; (800f8e4 <SETTINGS_SetSnmpDef+0x68>)
  26367. 800f880: 4d19 ldr r5, [pc, #100] ; (800f8e8 <SETTINGS_SetSnmpDef+0x6c>)
  26368. strcpy(sSettings.sSnmp.readCommunity, "public");
  26369. 800f882: 4e1a ldr r6, [pc, #104] ; (800f8ec <SETTINGS_SetSnmpDef+0x70>)
  26370. /**
  26371. * @brief Установить параметры SNMP по умолчанию
  26372. */
  26373. void SETTINGS_SetSnmpDef(void)
  26374. {
  26375. strcpy(sSettings.sSnmp.sysDescr, "");
  26376. 800f884: 4629 mov r1, r5
  26377. 800f886: 4620 mov r0, r4
  26378. 800f888: f7f9 ffca bl 8009820 <strcpy>
  26379. strcpy(sSettings.sSnmp.readCommunity, "public");
  26380. 800f88c: 4631 mov r1, r6
  26381. 800f88e: f104 00a0 add.w r0, r4, #160 ; 0xa0
  26382. 800f892: f7f9 ffc5 bl 8009820 <strcpy>
  26383. strcpy(sSettings.sSnmp.writeCommunity, "public");
  26384. 800f896: 4631 mov r1, r6
  26385. 800f898: f104 00b4 add.w r0, r4, #180 ; 0xb4
  26386. 800f89c: f7f9 ffc0 bl 8009820 <strcpy>
  26387. strcpy(sSettings.sSnmp.sysContact, "");
  26388. 800f8a0: 4629 mov r1, r5
  26389. 800f8a2: f104 00c8 add.w r0, r4, #200 ; 0xc8
  26390. 800f8a6: f7f9 ffbb bl 8009820 <strcpy>
  26391. strcpy(sSettings.sSnmp.sysName, "BT-6701");
  26392. 800f8aa: f104 00fa add.w r0, r4, #250 ; 0xfa
  26393. 800f8ae: 4910 ldr r1, [pc, #64] ; (800f8f0 <SETTINGS_SetSnmpDef+0x74>)
  26394. 800f8b0: f7f9 ffb6 bl 8009820 <strcpy>
  26395. strcpy(sSettings.sSnmp.sysLocation, "");
  26396. 800f8b4: 4629 mov r1, r5
  26397. strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
  26398. 800f8b6: 4d0f ldr r5, [pc, #60] ; (800f8f4 <SETTINGS_SetSnmpDef+0x78>)
  26399. strcpy(sSettings.sSnmp.sysDescr, "");
  26400. strcpy(sSettings.sSnmp.readCommunity, "public");
  26401. strcpy(sSettings.sSnmp.writeCommunity, "public");
  26402. strcpy(sSettings.sSnmp.sysContact, "");
  26403. strcpy(sSettings.sSnmp.sysName, "BT-6701");
  26404. strcpy(sSettings.sSnmp.sysLocation, "");
  26405. 800f8b8: f504 7087 add.w r0, r4, #270 ; 0x10e
  26406. 800f8bc: f7f9 ffb0 bl 8009820 <strcpy>
  26407. strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
  26408. 800f8c0: 4629 mov r1, r5
  26409. 800f8c2: f504 70be add.w r0, r4, #380 ; 0x17c
  26410. 800f8c6: f7f9 ffab bl 8009820 <strcpy>
  26411. strcpy(sSettings.sSnmp.managerIP2, "0.0.0.0");
  26412. 800f8ca: 4629 mov r1, r5
  26413. 800f8cc: f504 70c8 add.w r0, r4, #400 ; 0x190
  26414. 800f8d0: f7f9 ffa6 bl 8009820 <strcpy>
  26415. strcpy(sSettings.sSnmp.managerIP3, "0.0.0.0");
  26416. 800f8d4: f504 70d2 add.w r0, r4, #420 ; 0x1a4
  26417. 800f8d8: 4629 mov r1, r5
  26418. }
  26419. 800f8da: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr}
  26420. strcpy(sSettings.sSnmp.sysContact, "");
  26421. strcpy(sSettings.sSnmp.sysName, "BT-6701");
  26422. strcpy(sSettings.sSnmp.sysLocation, "");
  26423. strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
  26424. strcpy(sSettings.sSnmp.managerIP2, "0.0.0.0");
  26425. strcpy(sSettings.sSnmp.managerIP3, "0.0.0.0");
  26426. 800f8de: f7f9 bf9f b.w 8009820 <strcpy>
  26427. 800f8e2: bf00 nop
  26428. 800f8e4: 200083ea .word 0x200083ea
  26429. 800f8e8: 0801365a .word 0x0801365a
  26430. 800f8ec: 080118b6 .word 0x080118b6
  26431. 800f8f0: 080118bd .word 0x080118bd
  26432. 800f8f4: 080118c5 .word 0x080118c5
  26433. 0800f8f8 <SETTINGS_SetInfoDef>:
  26434. /**
  26435. * @brief Установить Информацию об устройстве по умолчанию
  26436. */
  26437. void SETTINGS_SetInfoDef(void)
  26438. {
  26439. 800f8f8: b510 push {r4, lr}
  26440. strcpy(sSettings.sInfo.productionData, "09.10.2015");
  26441. 800f8fa: 4c0b ldr r4, [pc, #44] ; (800f928 <SETTINGS_SetInfoDef+0x30>)
  26442. 800f8fc: 490b ldr r1, [pc, #44] ; (800f92c <SETTINGS_SetInfoDef+0x34>)
  26443. 800f8fe: 4620 mov r0, r4
  26444. 800f900: f7f9 ff8e bl 8009820 <strcpy>
  26445. strcpy(sSettings.sInfo.mac, DEVICE_MAC);
  26446. 800f904: f104 0028 add.w r0, r4, #40 ; 0x28
  26447. 800f908: 4909 ldr r1, [pc, #36] ; (800f930 <SETTINGS_SetInfoDef+0x38>)
  26448. 800f90a: f7f9 ff89 bl 8009820 <strcpy>
  26449. strcpy(sSettings.sInfo.serialNumber, "KN-03-00003");
  26450. 800f90e: f104 003a add.w r0, r4, #58 ; 0x3a
  26451. 800f912: 4908 ldr r1, [pc, #32] ; (800f934 <SETTINGS_SetInfoDef+0x3c>)
  26452. 800f914: f7f9 ff84 bl 8009820 <strcpy>
  26453. strcpy(sSettings.sInfo.comments, "");
  26454. 800f918: 4907 ldr r1, [pc, #28] ; (800f938 <SETTINGS_SetInfoDef+0x40>)
  26455. 800f91a: f104 004a add.w r0, r4, #74 ; 0x4a
  26456. }
  26457. 800f91e: e8bd 4010 ldmia.w sp!, {r4, lr}
  26458. void SETTINGS_SetInfoDef(void)
  26459. {
  26460. strcpy(sSettings.sInfo.productionData, "09.10.2015");
  26461. strcpy(sSettings.sInfo.mac, DEVICE_MAC);
  26462. strcpy(sSettings.sInfo.serialNumber, "KN-03-00003");
  26463. strcpy(sSettings.sInfo.comments, "");
  26464. 800f922: f7f9 bf7d b.w 8009820 <strcpy>
  26465. 800f926: bf00 nop
  26466. 800f928: 200085a2 .word 0x200085a2
  26467. 800f92c: 080118cd .word 0x080118cd
  26468. 800f930: 080118d8 .word 0x080118d8
  26469. 800f934: 080118ea .word 0x080118ea
  26470. 800f938: 0801365a .word 0x0801365a
  26471. 0800f93c <SETTINGS_ReadFromFlash>:
  26472. */
  26473. void SETTINGS_ReadFromFlash(uint8_t *data, uint32_t size)
  26474. {
  26475. uint32_t baseAddress = SETTINGS_SECTOR;
  26476. for (uint32_t i = 0; i < size; i++)
  26477. 800f93c: 2300 movs r3, #0
  26478. 800f93e: e006 b.n 800f94e <SETTINGS_ReadFromFlash+0x12>
  26479. *data++ = (*(uint32_t*)baseAddress++);;
  26480. 800f940: f103 6200 add.w r2, r3, #134217728 ; 0x8000000
  26481. 800f944: f502 4280 add.w r2, r2, #16384 ; 0x4000
  26482. 800f948: 6812 ldr r2, [r2, #0]
  26483. 800f94a: 54c2 strb r2, [r0, r3]
  26484. */
  26485. void SETTINGS_ReadFromFlash(uint8_t *data, uint32_t size)
  26486. {
  26487. uint32_t baseAddress = SETTINGS_SECTOR;
  26488. for (uint32_t i = 0; i < size; i++)
  26489. 800f94c: 3301 adds r3, #1
  26490. 800f94e: 428b cmp r3, r1
  26491. 800f950: d1f6 bne.n 800f940 <SETTINGS_ReadFromFlash+0x4>
  26492. *data++ = (*(uint32_t*)baseAddress++);;
  26493. }
  26494. 800f952: 4770 bx lr
  26495. 0800f954 <SETTINGS_EraseFlashSector>:
  26496. */
  26497. void SETTINGS_EraseFlashSector(void)
  26498. {
  26499. FLASH_Status status;
  26500. if ((status = FLASH_EraseSector(FLASH_Sector_1, VoltageRange_3)) != FLASH_COMPLETE) {
  26501. 800f954: 2008 movs r0, #8
  26502. 800f956: 2102 movs r1, #2
  26503. 800f958: f7fa ba34 b.w 8009dc4 <FLASH_EraseSector>
  26504. 0800f95c <SETTINGS_GetCRC>:
  26505. /**
  26506. * @brief
  26507. * @retval
  26508. */
  26509. uint32_t SETTINGS_GetCRC(void)
  26510. {
  26511. 800f95c: b508 push {r3, lr}
  26512. CRC_ResetDR();
  26513. 800f95e: f7fa f9a1 bl 8009ca4 <CRC_ResetDR>
  26514. return CRC_CalcBlockCRC((uint32_t*)&sSettings, sizeof(sSettings)/4);
  26515. 800f962: 4803 ldr r0, [pc, #12] ; (800f970 <SETTINGS_GetCRC+0x14>)
  26516. 800f964: 21b9 movs r1, #185 ; 0xb9
  26517. }
  26518. 800f966: e8bd 4008 ldmia.w sp!, {r3, lr}
  26519. * @retval
  26520. */
  26521. uint32_t SETTINGS_GetCRC(void)
  26522. {
  26523. CRC_ResetDR();
  26524. return CRC_CalcBlockCRC((uint32_t*)&sSettings, sizeof(sSettings)/4);
  26525. 800f96a: f7fa b9a1 b.w 8009cb0 <CRC_CalcBlockCRC>
  26526. 800f96e: bf00 nop
  26527. 800f970: 2000838c .word 0x2000838c
  26528. 0800f974 <SETTINGS_WriteToFlash>:
  26529. /**
  26530. * @brief
  26531. */
  26532. void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
  26533. {
  26534. 800f974: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  26535. 800f978: 4606 mov r6, r0
  26536. 800f97a: 468a mov sl, r1
  26537. uint32_t baseAddress = SETTINGS_SECTOR;
  26538. uint32_t checkCrc = 0;
  26539. uint32_t crc = SETTINGS_GetCRC();
  26540. 800f97c: f7ff ffee bl 800f95c <SETTINGS_GetCRC>
  26541. /**
  26542. * @brief
  26543. */
  26544. void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
  26545. {
  26546. uint32_t baseAddress = SETTINGS_SECTOR;
  26547. 800f980: 4c17 ldr r4, [pc, #92] ; (800f9e0 <SETTINGS_WriteToFlash+0x6c>)
  26548. uint32_t checkCrc = 0;
  26549. uint32_t crc = SETTINGS_GetCRC();
  26550. 800f982: 4680 mov r8, r0
  26551. 800f984: 2703 movs r7, #3
  26552. FLASH_Status status;
  26553. for (uint8_t i = 0; i < 3; i++)
  26554. {
  26555. fAlarm = 0;
  26556. FLASH_Unlock();
  26557. 800f986: f7fa f9a3 bl 8009cd0 <FLASH_Unlock>
  26558. 800f98a: 4635 mov r5, r6
  26559. SETTINGS_EraseFlashSector();
  26560. 800f98c: f7ff ffe2 bl 800f954 <SETTINGS_EraseFlashSector>
  26561. }
  26562. /**
  26563. * @brief
  26564. */
  26565. void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
  26566. 800f990: eb04 0b0a add.w fp, r4, sl
  26567. fAlarm = 0;
  26568. FLASH_Unlock();
  26569. SETTINGS_EraseFlashSector();
  26570. for (uint32_t i = 0; i < size; i++)
  26571. 800f994: e00a b.n 800f9ac <SETTINGS_WriteToFlash+0x38>
  26572. if ((status = FLASH_ProgramByte(baseAddress++, *data++)) != FLASH_COMPLETE) {
  26573. 800f996: f815 1b01 ldrb.w r1, [r5], #1
  26574. 800f99a: 4620 mov r0, r4
  26575. 800f99c: f7fa f9d8 bl 8009d50 <FLASH_ProgramByte>
  26576. 800f9a0: f104 0901 add.w r9, r4, #1
  26577. 800f9a4: 2808 cmp r0, #8
  26578. 800f9a6: 462e mov r6, r5
  26579. 800f9a8: 464c mov r4, r9
  26580. 800f9aa: d102 bne.n 800f9b2 <SETTINGS_WriteToFlash+0x3e>
  26581. fAlarm = 0;
  26582. FLASH_Unlock();
  26583. SETTINGS_EraseFlashSector();
  26584. for (uint32_t i = 0; i < size; i++)
  26585. 800f9ac: 455c cmp r4, fp
  26586. 800f9ae: 462e mov r6, r5
  26587. 800f9b0: d1f1 bne.n 800f996 <SETTINGS_WriteToFlash+0x22>
  26588. if ((status = FLASH_ProgramByte(baseAddress++, *data++)) != FLASH_COMPLETE) {
  26589. DBG printf("FLASH_ProgramByte error: status = %d\r\n", status);
  26590. break;
  26591. }
  26592. if ((status = FLASH_ProgramWord((uint32_t)CRC_ADDRESS, crc)) != FLASH_COMPLETE) {
  26593. 800f9b2: 4641 mov r1, r8
  26594. 800f9b4: 480b ldr r0, [pc, #44] ; (800f9e4 <SETTINGS_WriteToFlash+0x70>)
  26595. 800f9b6: f7fa f9e7 bl 8009d88 <FLASH_ProgramWord>
  26596. DBG printf("FLASH_ProgramWord error: status = %d\r\n", status);
  26597. }
  26598. FLASH_Lock();
  26599. 800f9ba: f7fa f997 bl 8009cec <FLASH_Lock>
  26600. /* Считываем что записали */
  26601. SETTINGS_ReadFromFlash((uint8_t*)&sSettings, sizeof(sSettings));
  26602. 800f9be: 480a ldr r0, [pc, #40] ; (800f9e8 <SETTINGS_WriteToFlash+0x74>)
  26603. 800f9c0: f44f 7139 mov.w r1, #740 ; 0x2e4
  26604. 800f9c4: f7ff ffba bl 800f93c <SETTINGS_ReadFromFlash>
  26605. checkCrc = SETTINGS_GetCRC();
  26606. 800f9c8: f7ff ffc8 bl 800f95c <SETTINGS_GetCRC>
  26607. /* Проверяем CRC того что было записано */
  26608. if (checkCrc == crc)
  26609. 800f9cc: 4540 cmp r0, r8
  26610. 800f9ce: d004 beq.n 800f9da <SETTINGS_WriteToFlash+0x66>
  26611. 800f9d0: 3f01 subs r7, #1
  26612. uint32_t checkCrc = 0;
  26613. uint32_t crc = SETTINGS_GetCRC();
  26614. bool fAlarm = 0;
  26615. FLASH_Status status;
  26616. for (uint8_t i = 0; i < 3; i++)
  26617. 800f9d2: f017 07ff ands.w r7, r7, #255 ; 0xff
  26618. 800f9d6: d1d6 bne.n 800f986 <SETTINGS_WriteToFlash+0x12>
  26619. 800f9d8: e7fe b.n 800f9d8 <SETTINGS_WriteToFlash+0x64>
  26620. 800f9da: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
  26621. 800f9de: bf00 nop
  26622. 800f9e0: 08004000 .word 0x08004000
  26623. 800f9e4: 08007f9c .word 0x08007f9c
  26624. 800f9e8: 2000838c .word 0x2000838c
  26625. 0800f9ec <SETTINGS_GetCritSecCRC>:
  26626. /**
  26627. * @brief
  26628. * @retval
  26629. */
  26630. uint32_t SETTINGS_GetCritSecCRC(void)
  26631. {
  26632. 800f9ec: b508 push {r3, lr}
  26633. CRC_ResetDR();
  26634. 800f9ee: f7fa f959 bl 8009ca4 <CRC_ResetDR>
  26635. uint32_t critsec_len = (uint32_t)((uint8_t *)(&sSettings.CritSecCRC) - (uint8_t *)&sSettings) / 4;
  26636. return CRC_CalcBlockCRC((uint32_t *)&sSettings, critsec_len);
  26637. 800f9f2: 4803 ldr r0, [pc, #12] ; (800fa00 <SETTINGS_GetCritSecCRC+0x14>)
  26638. 800f9f4: 21b8 movs r1, #184 ; 0xb8
  26639. }
  26640. 800f9f6: e8bd 4008 ldmia.w sp!, {r3, lr}
  26641. */
  26642. uint32_t SETTINGS_GetCritSecCRC(void)
  26643. {
  26644. CRC_ResetDR();
  26645. uint32_t critsec_len = (uint32_t)((uint8_t *)(&sSettings.CritSecCRC) - (uint8_t *)&sSettings) / 4;
  26646. return CRC_CalcBlockCRC((uint32_t *)&sSettings, critsec_len);
  26647. 800f9fa: f7fa b959 b.w 8009cb0 <CRC_CalcBlockCRC>
  26648. 800f9fe: bf00 nop
  26649. 800fa00: 2000838c .word 0x2000838c
  26650. 0800fa04 <SETTINGS_Save>:
  26651. /**
  26652. * @brief Запись структуры настроек во flesh
  26653. */
  26654. void SETTINGS_Save(void)
  26655. {
  26656. 800fa04: b508 push {r3, lr}
  26657. /* Calc critical section CRC and store to the settings structure */
  26658. sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
  26659. 800fa06: f7ff fff1 bl 800f9ec <SETTINGS_GetCritSecCRC>
  26660. 800fa0a: 4b05 ldr r3, [pc, #20] ; (800fa20 <SETTINGS_Save+0x1c>)
  26661. SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
  26662. 800fa0c: f44f 7139 mov.w r1, #740 ; 0x2e4
  26663. * @brief Запись структуры настроек во flesh
  26664. */
  26665. void SETTINGS_Save(void)
  26666. {
  26667. /* Calc critical section CRC and store to the settings structure */
  26668. sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
  26669. 800fa10: f8c3 02e0 str.w r0, [r3, #736] ; 0x2e0
  26670. SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
  26671. 800fa14: 4618 mov r0, r3
  26672. }
  26673. 800fa16: e8bd 4008 ldmia.w sp!, {r3, lr}
  26674. void SETTINGS_Save(void)
  26675. {
  26676. /* Calc critical section CRC and store to the settings structure */
  26677. sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
  26678. SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
  26679. 800fa1a: f7ff bfab b.w 800f974 <SETTINGS_WriteToFlash>
  26680. 800fa1e: bf00 nop
  26681. 800fa20: 2000838c .word 0x2000838c
  26682. 0800fa24 <SETTINGS_SetAllDefault>:
  26683. /**
  26684. * @brief Сброс всех настроек в значения по умолчанию
  26685. */
  26686. void SETTINGS_SetAllDefault(void)
  26687. {
  26688. 800fa24: b510 push {r4, lr}
  26689. /**
  26690. * @brief Установить флаги по умолчанию
  26691. */
  26692. void SETTINGS_SetFlagsDef(void)
  26693. {
  26694. sSettings.sFlags.netsettingsChanged = false;
  26695. 800fa26: 4c09 ldr r4, [pc, #36] ; (800fa4c <SETTINGS_SetAllDefault+0x28>)
  26696. /**
  26697. * @brief Сброс всех настроек в значения по умолчанию
  26698. */
  26699. void SETTINGS_SetAllDefault(void)
  26700. {
  26701. SETTINGS_SetBootParamsDef();
  26702. 800fa28: f7ff fee8 bl 800f7fc <SETTINGS_SetBootParamsDef>
  26703. SETTINGS_SetWebParamsDef();
  26704. 800fa2c: f7ff feee bl 800f80c <SETTINGS_SetWebParamsDef>
  26705. SETTINGS_SetTempWebParamsDef();
  26706. 800fa30: f7ff ff08 bl 800f844 <SETTINGS_SetTempWebParamsDef>
  26707. SETTINGS_SetSnmpDef();
  26708. 800fa34: f7ff ff22 bl 800f87c <SETTINGS_SetSnmpDef>
  26709. SETTINGS_SetInfoDef();
  26710. 800fa38: f7ff ff5e bl 800f8f8 <SETTINGS_SetInfoDef>
  26711. /**
  26712. * @brief Установить флаги по умолчанию
  26713. */
  26714. void SETTINGS_SetFlagsDef(void)
  26715. {
  26716. sSettings.sFlags.netsettingsChanged = false;
  26717. 800fa3c: 2300 movs r3, #0
  26718. 800fa3e: f884 32ce strb.w r3, [r4, #718] ; 0x2ce
  26719. SETTINGS_SetTempWebParamsDef();
  26720. SETTINGS_SetSnmpDef();
  26721. SETTINGS_SetInfoDef();
  26722. SETTINGS_SetFlagsDef();
  26723. sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
  26724. 800fa42: f7ff ffd3 bl 800f9ec <SETTINGS_GetCritSecCRC>
  26725. 800fa46: f8c4 02e0 str.w r0, [r4, #736] ; 0x2e0
  26726. 800fa4a: bd10 pop {r4, pc}
  26727. 800fa4c: 2000838c .word 0x2000838c
  26728. 0800fa50 <SETTINGS_Load>:
  26729. /**
  26730. * @brief Загрузка структуры настроек из flesh
  26731. */
  26732. void SETTINGS_Load(void)
  26733. {
  26734. 800fa50: b510 push {r4, lr}
  26735. SETTINGS_ReadFromFlash((uint8_t*)&sSettings, sizeof(sSettings));
  26736. 800fa52: 4c0b ldr r4, [pc, #44] ; (800fa80 <SETTINGS_Load+0x30>)
  26737. 800fa54: f44f 7139 mov.w r1, #740 ; 0x2e4
  26738. 800fa58: 4620 mov r0, r4
  26739. 800fa5a: f7ff ff6f bl 800f93c <SETTINGS_ReadFromFlash>
  26740. /* Проверка CRC критической секции сектора настроек.
  26741. * Если CRC не совпадает, скорее всего настройки отсутствуют,
  26742. * прошиваем значения по умолчанию */
  26743. uint32_t crc = SETTINGS_GetCritSecCRC();
  26744. 800fa5e: f7ff ffc5 bl 800f9ec <SETTINGS_GetCritSecCRC>
  26745. if (sSettings.CritSecCRC != crc) {
  26746. 800fa62: f8d4 32e0 ldr.w r3, [r4, #736] ; 0x2e0
  26747. 800fa66: 4283 cmp r3, r0
  26748. 800fa68: d008 beq.n 800fa7c <SETTINGS_Load+0x2c>
  26749. printf("\n\rIAP: Bad critical settings sector CRC. Factory defaults restored.\n\r");
  26750. 800fa6a: 4806 ldr r0, [pc, #24] ; (800fa84 <SETTINGS_Load+0x34>)
  26751. 800fa6c: f001 fe02 bl 8011674 <tfp_printf>
  26752. SETTINGS_SetAllDefault();
  26753. 800fa70: f7ff ffd8 bl 800fa24 <SETTINGS_SetAllDefault>
  26754. SETTINGS_Save();
  26755. }
  26756. }
  26757. 800fa74: e8bd 4010 ldmia.w sp!, {r4, lr}
  26758. uint32_t crc = SETTINGS_GetCritSecCRC();
  26759. if (sSettings.CritSecCRC != crc) {
  26760. printf("\n\rIAP: Bad critical settings sector CRC. Factory defaults restored.\n\r");
  26761. SETTINGS_SetAllDefault();
  26762. SETTINGS_Save();
  26763. 800fa78: f7ff bfc4 b.w 800fa04 <SETTINGS_Save>
  26764. 800fa7c: bd10 pop {r4, pc}
  26765. 800fa7e: bf00 nop
  26766. 800fa80: 2000838c .word 0x2000838c
  26767. 800fa84: 080118f6 .word 0x080118f6
  26768. 0800fa88 <SETTINGS_GetMac>:
  26769. /**
  26770. * @brief Преобразует mac адрес строкового формата в массив uint8_t
  26771. * @param mac - буфер для вывода mac адреса
  26772. */
  26773. void SETTINGS_GetMac(uint8_t *mac)
  26774. {
  26775. 800fa88: b573 push {r0, r1, r4, r5, r6, lr}
  26776. char dummy[2];
  26777. char *macPtr = sSettings.sInfo.mac;
  26778. for (uint8_t i = 0; i < 6; i++)
  26779. {
  26780. strncpy(dummy, macPtr+i*3, 2);
  26781. 800fa8a: 4e0b ldr r6, [pc, #44] ; (800fab8 <SETTINGS_GetMac+0x30>)
  26782. /**
  26783. * @brief Преобразует mac адрес строкового формата в массив uint8_t
  26784. * @param mac - буфер для вывода mac адреса
  26785. */
  26786. void SETTINGS_GetMac(uint8_t *mac)
  26787. 800fa8c: 1e45 subs r5, r0, #1
  26788. 800fa8e: 2400 movs r4, #0
  26789. char dummy[2];
  26790. char *macPtr = sSettings.sInfo.mac;
  26791. for (uint8_t i = 0; i < 6; i++)
  26792. {
  26793. strncpy(dummy, macPtr+i*3, 2);
  26794. 800fa90: f504 710e add.w r1, r4, #568 ; 0x238
  26795. 800fa94: 1989 adds r1, r1, r6
  26796. 800fa96: 3106 adds r1, #6
  26797. 800fa98: 2202 movs r2, #2
  26798. 800fa9a: a801 add r0, sp, #4
  26799. 800fa9c: f7f9 ff74 bl 8009988 <strncpy>
  26800. mac[i] = (uint8_t)strtol(dummy, NULL, 16);
  26801. 800faa0: 2100 movs r1, #0
  26802. 800faa2: 2210 movs r2, #16
  26803. 800faa4: a801 add r0, sp, #4
  26804. 800faa6: f7fa f843 bl 8009b30 <strtol>
  26805. 800faaa: 3403 adds r4, #3
  26806. void SETTINGS_GetMac(uint8_t *mac)
  26807. {
  26808. char dummy[2];
  26809. char *macPtr = sSettings.sInfo.mac;
  26810. for (uint8_t i = 0; i < 6; i++)
  26811. 800faac: 2c12 cmp r4, #18
  26812. {
  26813. strncpy(dummy, macPtr+i*3, 2);
  26814. mac[i] = (uint8_t)strtol(dummy, NULL, 16);
  26815. 800faae: f805 0f01 strb.w r0, [r5, #1]!
  26816. void SETTINGS_GetMac(uint8_t *mac)
  26817. {
  26818. char dummy[2];
  26819. char *macPtr = sSettings.sInfo.mac;
  26820. for (uint8_t i = 0; i < 6; i++)
  26821. 800fab2: d1ed bne.n 800fa90 <SETTINGS_GetMac+0x8>
  26822. {
  26823. strncpy(dummy, macPtr+i*3, 2);
  26824. mac[i] = (uint8_t)strtol(dummy, NULL, 16);
  26825. }
  26826. }
  26827. 800fab4: bd7c pop {r2, r3, r4, r5, r6, pc}
  26828. 800fab6: bf00 nop
  26829. 800fab8: 2000838c .word 0x2000838c
  26830. 0800fabc <timer_AddFunction>:
  26831. * @brief Добавить функцию в список вызова.
  26832. * Handler будет вызываться с заданной частотой
  26833. * @retval нет
  26834. */
  26835. void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
  26836. {
  26837. 800fabc: b5f0 push {r4, r5, r6, r7, lr}
  26838. int i;
  26839. for(i = 0; i < TIMER_HANDLERS; i++)
  26840. {
  26841. /* Найдем пустой слот */
  26842. if(!Handlers[i].Handler)
  26843. 800fabe: 4e0c ldr r6, [pc, #48] ; (800faf0 <timer_AddFunction+0x34>)
  26844. */
  26845. void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
  26846. {
  26847. int i;
  26848. for(i = 0; i < TIMER_HANDLERS; i++)
  26849. 800fac0: 2300 movs r3, #0
  26850. /**
  26851. * @brief Добавить функцию в список вызова.
  26852. * Handler будет вызываться с заданной частотой
  26853. * @retval нет
  26854. */
  26855. void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
  26856. 800fac2: 270c movs r7, #12
  26857. 800fac4: fb07 f203 mul.w r2, r7, r3
  26858. int i;
  26859. for(i = 0; i < TIMER_HANDLERS; i++)
  26860. {
  26861. /* Найдем пустой слот */
  26862. if(!Handlers[i].Handler)
  26863. 800fac8: 4c09 ldr r4, [pc, #36] ; (800faf0 <timer_AddFunction+0x34>)
  26864. 800faca: 5995 ldr r5, [r2, r6]
  26865. 800facc: b95d cbnz r5, 800fae6 <timer_AddFunction+0x2a>
  26866. {
  26867. /* Обработчик, частота опроса */
  26868. Handlers[i].Run = true;
  26869. 800face: 18a3 adds r3, r4, r2
  26870. 800fad0: 2601 movs r6, #1
  26871. 800fad2: 721e strb r6, [r3, #8]
  26872. Handlers[i].Fired = false;
  26873. 800fad4: 725d strb r5, [r3, #9]
  26874. Handlers[i].Handler = Handler;
  26875. Handlers[i].Reload = Frequency;
  26876. 800fad6: 80d8 strh r0, [r3, #6]
  26877. Handlers[i].Countdown = Handlers[i].Reload;
  26878. 800fad8: 8098 strh r0, [r3, #4]
  26879. TimerCount++;
  26880. 800fada: 4b06 ldr r3, [pc, #24] ; (800faf4 <timer_AddFunction+0x38>)
  26881. if(!Handlers[i].Handler)
  26882. {
  26883. /* Обработчик, частота опроса */
  26884. Handlers[i].Run = true;
  26885. Handlers[i].Fired = false;
  26886. Handlers[i].Handler = Handler;
  26887. 800fadc: 50a1 str r1, [r4, r2]
  26888. Handlers[i].Reload = Frequency;
  26889. Handlers[i].Countdown = Handlers[i].Reload;
  26890. TimerCount++;
  26891. 800fade: 681a ldr r2, [r3, #0]
  26892. 800fae0: 1992 adds r2, r2, r6
  26893. 800fae2: 601a str r2, [r3, #0]
  26894. return;
  26895. 800fae4: bdf0 pop {r4, r5, r6, r7, pc}
  26896. */
  26897. void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
  26898. {
  26899. int i;
  26900. for(i = 0; i < TIMER_HANDLERS; i++)
  26901. 800fae6: 3301 adds r3, #1
  26902. 800fae8: 2b14 cmp r3, #20
  26903. 800faea: d1eb bne.n 800fac4 <timer_AddFunction+0x8>
  26904. 800faec: bdf0 pop {r4, r5, r6, r7, pc}
  26905. 800faee: bf00 nop
  26906. 800faf0: 20006c8c .word 0x20006c8c
  26907. 800faf4: 20006d7c .word 0x20006d7c
  26908. 0800faf8 <timer_Main>:
  26909. * @brief Функция перебора и вызова актуальных задач.
  26910. * Должна вызываться в главном цикле
  26911. * @retval нет
  26912. */
  26913. void timer_Main(void)
  26914. {
  26915. 800faf8: b570 push {r4, r5, r6, lr}
  26916. 800fafa: 4c06 ldr r4, [pc, #24] ; (800fb14 <timer_Main+0x1c>)
  26917. for(i = 0; i < TIMER_HANDLERS; i++)
  26918. {
  26919. /* Если сработало - вызовем */
  26920. if(Handlers[i].Fired)
  26921. {
  26922. Handlers[i].Fired = false;
  26923. 800fafc: 2600 movs r6, #0
  26924. /**
  26925. * @brief Функция перебора и вызова актуальных задач.
  26926. * Должна вызываться в главном цикле
  26927. * @retval нет
  26928. */
  26929. void timer_Main(void)
  26930. 800fafe: f104 05f0 add.w r5, r4, #240 ; 0xf0
  26931. int i;
  26932. for(i = 0; i < TIMER_HANDLERS; i++)
  26933. {
  26934. /* Если сработало - вызовем */
  26935. if(Handlers[i].Fired)
  26936. 800fb02: 7a63 ldrb r3, [r4, #9]
  26937. 800fb04: b113 cbz r3, 800fb0c <timer_Main+0x14>
  26938. {
  26939. Handlers[i].Fired = false;
  26940. 800fb06: 7266 strb r6, [r4, #9]
  26941. Handlers[i].Handler();
  26942. 800fb08: 6823 ldr r3, [r4, #0]
  26943. 800fb0a: 4798 blx r3
  26944. 800fb0c: 340c adds r4, #12
  26945. */
  26946. void timer_Main(void)
  26947. {
  26948. int i;
  26949. for(i = 0; i < TIMER_HANDLERS; i++)
  26950. 800fb0e: 42ac cmp r4, r5
  26951. 800fb10: d1f7 bne.n 800fb02 <timer_Main+0xa>
  26952. {
  26953. Handlers[i].Fired = false;
  26954. Handlers[i].Handler();
  26955. }
  26956. }
  26957. }
  26958. 800fb12: bd70 pop {r4, r5, r6, pc}
  26959. 800fb14: 20006c8c .word 0x20006c8c
  26960. 0800fb18 <Delay_ms>:
  26961. * @brief Задержка в миллисекундах
  26962. * @retval нет
  26963. */
  26964. void Delay_ms(uint32_t nTime)
  26965. {
  26966. TimingDelay = nTime;
  26967. 800fb18: 4b02 ldr r3, [pc, #8] ; (800fb24 <Delay_ms+0xc>)
  26968. 800fb1a: 6018 str r0, [r3, #0]
  26969. while(TimingDelay);
  26970. 800fb1c: 681a ldr r2, [r3, #0]
  26971. 800fb1e: 2a00 cmp r2, #0
  26972. 800fb20: d1fc bne.n 800fb1c <Delay_ms+0x4>
  26973. }
  26974. 800fb22: 4770 bx lr
  26975. 800fb24: 20008670 .word 0x20008670
  26976. 0800fb28 <TimingDelay_Decrement>:
  26977. * @brief Вспомогательная функция для реализации Delay_ms
  26978. * @retval нет
  26979. */
  26980. void TimingDelay_Decrement(void) {
  26981. if (TimingDelay)
  26982. 800fb28: 4b03 ldr r3, [pc, #12] ; (800fb38 <TimingDelay_Decrement+0x10>)
  26983. 800fb2a: 681a ldr r2, [r3, #0]
  26984. 800fb2c: b112 cbz r2, 800fb34 <TimingDelay_Decrement+0xc>
  26985. TimingDelay--;
  26986. 800fb2e: 681a ldr r2, [r3, #0]
  26987. 800fb30: 3a01 subs r2, #1
  26988. 800fb32: 601a str r2, [r3, #0]
  26989. 800fb34: 4770 bx lr
  26990. 800fb36: bf00 nop
  26991. 800fb38: 20008670 .word 0x20008670
  26992. 0800fb3c <SysTick_Handler>:
  26993. /**
  26994. * @brief Обработчик прерывания системного таймера
  26995. * @retval нет
  26996. */
  26997. void SysTick_Handler(void)
  26998. {
  26999. 800fb3c: b508 push {r3, lr}
  27000. int i;
  27001. Time_Update();
  27002. 800fb3e: f001 fa37 bl 8010fb0 <Time_Update>
  27003. TimingDelay_Decrement();
  27004. 800fb42: f7ff fff1 bl 800fb28 <TimingDelay_Decrement>
  27005. 800fb46: 4b0b ldr r3, [pc, #44] ; (800fb74 <SysTick_Handler+0x38>)
  27006. if(--Handlers[i].Countdown == 0)
  27007. {
  27008. Handlers[i].Countdown = Handlers[i].Reload;
  27009. /* Запишем, что сработало */
  27010. Handlers[i].Fired = true;
  27011. 800fb48: 2001 movs r0, #1
  27012. /**
  27013. * @brief Обработчик прерывания системного таймера
  27014. * @retval нет
  27015. */
  27016. void SysTick_Handler(void)
  27017. 800fb4a: f103 01f0 add.w r1, r3, #240 ; 0xf0
  27018. TimingDelay_Decrement();
  27019. for(i = 0; i < TIMER_HANDLERS; i++)
  27020. {
  27021. if(Handlers[i].Run)
  27022. 800fb4e: 781a ldrb r2, [r3, #0]
  27023. 800fb50: b15a cbz r2, 800fb6a <SysTick_Handler+0x2e>
  27024. {
  27025. if(--Handlers[i].Countdown == 0)
  27026. 800fb52: f833 2c04 ldrh.w r2, [r3, #-4]
  27027. 800fb56: 3a01 subs r2, #1
  27028. 800fb58: b292 uxth r2, r2
  27029. 800fb5a: f823 2c04 strh.w r2, [r3, #-4]
  27030. 800fb5e: b922 cbnz r2, 800fb6a <SysTick_Handler+0x2e>
  27031. {
  27032. Handlers[i].Countdown = Handlers[i].Reload;
  27033. 800fb60: f833 2c02 ldrh.w r2, [r3, #-2]
  27034. /* Запишем, что сработало */
  27035. Handlers[i].Fired = true;
  27036. 800fb64: 7058 strb r0, [r3, #1]
  27037. {
  27038. if(Handlers[i].Run)
  27039. {
  27040. if(--Handlers[i].Countdown == 0)
  27041. {
  27042. Handlers[i].Countdown = Handlers[i].Reload;
  27043. 800fb66: f823 2c04 strh.w r2, [r3, #-4]
  27044. 800fb6a: 330c adds r3, #12
  27045. Time_Update();
  27046. TimingDelay_Decrement();
  27047. for(i = 0; i < TIMER_HANDLERS; i++)
  27048. 800fb6c: 428b cmp r3, r1
  27049. 800fb6e: d1ee bne.n 800fb4e <SysTick_Handler+0x12>
  27050. /* Запишем, что сработало */
  27051. Handlers[i].Fired = true;
  27052. }
  27053. }
  27054. }
  27055. }
  27056. 800fb70: bd08 pop {r3, pc}
  27057. 800fb72: bf00 nop
  27058. 800fb74: 20006c94 .word 0x20006c94
  27059. 0800fb78 <putc_>:
  27060. #ifdef SWOTRACE
  27061. ITM_SendChar(c);
  27062. #endif
  27063. }
  27064. void putc_(void* p, char c) {
  27065. 800fb78: 4770 bx lr
  27066. 800fb7a: 0000 movs r0, r0
  27067. 0800fb7c <InitUSART>:
  27068. /**
  27069. * @brief
  27070. * @retval
  27071. */
  27072. void InitUSART( void) {
  27073. 800fb7c: b570 push {r4, r5, r6, lr}
  27074. GPIO_InitTypeDef GPIO_InitStructure;
  27075. USART_InitTypeDef USART_InitStructure;
  27076. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
  27077. 800fb7e: 2002 movs r0, #2
  27078. /**
  27079. * @brief
  27080. * @retval
  27081. */
  27082. void InitUSART( void) {
  27083. 800fb80: b086 sub sp, #24
  27084. GPIO_InitTypeDef GPIO_InitStructure;
  27085. USART_InitTypeDef USART_InitStructure;
  27086. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
  27087. 800fb82: 2101 movs r1, #1
  27088. 800fb84: f7fa fa06 bl 8009f94 <RCC_AHB1PeriphClockCmd>
  27089. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
  27090. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27091. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  27092. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27093. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  27094. GPIO_Init(GPIOB, &GPIO_InitStructure);
  27095. 800fb88: 4d26 ldr r5, [pc, #152] ; (800fc24 <InitUSART+0xa8>)
  27096. GPIO_InitTypeDef GPIO_InitStructure;
  27097. USART_InitTypeDef USART_InitStructure;
  27098. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
  27099. RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
  27100. 800fb8a: 2010 movs r0, #16
  27101. 800fb8c: 2101 movs r1, #1
  27102. 800fb8e: f7fa fa19 bl 8009fc4 <RCC_APB2PeriphClockCmd>
  27103. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
  27104. 800fb92: 23c0 movs r3, #192 ; 0xc0
  27105. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27106. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  27107. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27108. 800fb94: 2400 movs r4, #0
  27109. USART_InitTypeDef USART_InitStructure;
  27110. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
  27111. RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
  27112. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
  27113. 800fb96: 9300 str r3, [sp, #0]
  27114. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27115. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  27116. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27117. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  27118. 800fb98: 2601 movs r6, #1
  27119. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
  27120. RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
  27121. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
  27122. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27123. 800fb9a: 2302 movs r3, #2
  27124. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  27125. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27126. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  27127. GPIO_Init(GPIOB, &GPIO_InitStructure);
  27128. 800fb9c: 4628 mov r0, r5
  27129. 800fb9e: 4669 mov r1, sp
  27130. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
  27131. RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
  27132. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
  27133. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27134. 800fba0: f88d 3005 strb.w r3, [sp, #5]
  27135. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  27136. 800fba4: f88d 3004 strb.w r3, [sp, #4]
  27137. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27138. 800fba8: f88d 4006 strb.w r4, [sp, #6]
  27139. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  27140. 800fbac: f88d 6007 strb.w r6, [sp, #7]
  27141. GPIO_Init(GPIOB, &GPIO_InitStructure);
  27142. 800fbb0: f7fa f93e bl 8009e30 <GPIO_Init>
  27143. GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
  27144. 800fbb4: 4628 mov r0, r5
  27145. 800fbb6: 2106 movs r1, #6
  27146. 800fbb8: 2207 movs r2, #7
  27147. 800fbba: f7fa f988 bl 8009ece <GPIO_PinAFConfig>
  27148. GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
  27149. 800fbbe: 2107 movs r1, #7
  27150. 800fbc0: 460a mov r2, r1
  27151. 800fbc2: 4628 mov r0, r5
  27152. 800fbc4: f7fa f983 bl 8009ece <GPIO_PinAFConfig>
  27153. USART_InitStructure.USART_BaudRate = 115200;
  27154. 800fbc8: f44f 33e1 mov.w r3, #115200 ; 0x1c200
  27155. 800fbcc: 9302 str r3, [sp, #8]
  27156. USART_InitStructure.USART_WordLength = USART_WordLength_9b;
  27157. 800fbce: f44f 5380 mov.w r3, #4096 ; 0x1000
  27158. USART_InitStructure.USART_StopBits = USART_StopBits_1;
  27159. USART_InitStructure.USART_Parity = USART_Parity_Even;
  27160. USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  27161. USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
  27162. USART_Init(USER_USART, &USART_InitStructure);
  27163. 800fbd2: f5a5 4574 sub.w r5, r5, #62464 ; 0xf400
  27164. GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
  27165. GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
  27166. USART_InitStructure.USART_BaudRate = 115200;
  27167. USART_InitStructure.USART_WordLength = USART_WordLength_9b;
  27168. 800fbd6: f8ad 300c strh.w r3, [sp, #12]
  27169. USART_InitStructure.USART_StopBits = USART_StopBits_1;
  27170. USART_InitStructure.USART_Parity = USART_Parity_Even;
  27171. 800fbda: f44f 6380 mov.w r3, #1024 ; 0x400
  27172. 800fbde: f8ad 3010 strh.w r3, [sp, #16]
  27173. USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  27174. USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
  27175. USART_Init(USER_USART, &USART_InitStructure);
  27176. 800fbe2: 4628 mov r0, r5
  27177. USART_InitStructure.USART_BaudRate = 115200;
  27178. USART_InitStructure.USART_WordLength = USART_WordLength_9b;
  27179. USART_InitStructure.USART_StopBits = USART_StopBits_1;
  27180. USART_InitStructure.USART_Parity = USART_Parity_Even;
  27181. USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  27182. USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
  27183. 800fbe4: 230c movs r3, #12
  27184. USART_Init(USER_USART, &USART_InitStructure);
  27185. 800fbe6: a902 add r1, sp, #8
  27186. USART_InitStructure.USART_BaudRate = 115200;
  27187. USART_InitStructure.USART_WordLength = USART_WordLength_9b;
  27188. USART_InitStructure.USART_StopBits = USART_StopBits_1;
  27189. USART_InitStructure.USART_Parity = USART_Parity_Even;
  27190. USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  27191. USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
  27192. 800fbe8: f8ad 3012 strh.w r3, [sp, #18]
  27193. GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
  27194. GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
  27195. USART_InitStructure.USART_BaudRate = 115200;
  27196. USART_InitStructure.USART_WordLength = USART_WordLength_9b;
  27197. USART_InitStructure.USART_StopBits = USART_StopBits_1;
  27198. 800fbec: f8ad 400e strh.w r4, [sp, #14]
  27199. USART_InitStructure.USART_Parity = USART_Parity_Even;
  27200. USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  27201. 800fbf0: f8ad 4014 strh.w r4, [sp, #20]
  27202. USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
  27203. USART_Init(USER_USART, &USART_InitStructure);
  27204. 800fbf4: f7fa fa7a bl 800a0ec <USART_Init>
  27205. USART_Cmd(USER_USART, ENABLE);
  27206. 800fbf8: 4628 mov r0, r5
  27207. 800fbfa: 4631 mov r1, r6
  27208. 800fbfc: f7fa fad0 bl 800a1a0 <USART_Cmd>
  27209. USART_ITConfig(USER_USART, USART_IT_RXNE, DISABLE);
  27210. 800fc00: 4628 mov r0, r5
  27211. 800fc02: 4622 mov r2, r4
  27212. 800fc04: f240 5125 movw r1, #1317 ; 0x525
  27213. 800fc08: f7fa fad6 bl 800a1b8 <USART_ITConfig>
  27214. USART_ITConfig(USER_USART, USART_IT_TXE, DISABLE);
  27215. 800fc0c: 4628 mov r0, r5
  27216. 800fc0e: f240 7127 movw r1, #1831 ; 0x727
  27217. 800fc12: 4622 mov r2, r4
  27218. 800fc14: f7fa fad0 bl 800a1b8 <USART_ITConfig>
  27219. init_printf(NULL, putc_);
  27220. 800fc18: 4620 mov r0, r4
  27221. 800fc1a: 4903 ldr r1, [pc, #12] ; (800fc28 <InitUSART+0xac>)
  27222. 800fc1c: f001 fd20 bl 8011660 <init_printf>
  27223. }
  27224. 800fc20: b006 add sp, #24
  27225. 800fc22: bd70 pop {r4, r5, r6, pc}
  27226. 800fc24: 40020400 .word 0x40020400
  27227. 800fc28: 0800fb79 .word 0x0800fb79
  27228. 0800fc2c <WDG_Init>:
  27229. /**
  27230. * @brief
  27231. * @retval
  27232. */
  27233. void WDG_Init(void)
  27234. {
  27235. 800fc2c: b530 push {r4, r5, lr}
  27236. GPIO_InitTypeDef GPIO_InitStructure;
  27237. NVIC_InitTypeDef NVIC_InitStructure;
  27238. TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  27239. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  27240. 800fc2e: 2004 movs r0, #4
  27241. /**
  27242. * @brief
  27243. * @retval
  27244. */
  27245. void WDG_Init(void)
  27246. {
  27247. 800fc30: b087 sub sp, #28
  27248. GPIO_InitTypeDef GPIO_InitStructure;
  27249. NVIC_InitTypeDef NVIC_InitStructure;
  27250. TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  27251. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  27252. 800fc32: 2101 movs r1, #1
  27253. 800fc34: f7fa f9ae bl 8009f94 <RCC_AHB1PeriphClockCmd>
  27254. RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
  27255. 800fc38: 2080 movs r0, #128 ; 0x80
  27256. 800fc3a: 2101 movs r1, #1
  27257. 800fc3c: f7fa f9b6 bl 8009fac <RCC_APB1PeriphClockCmd>
  27258. GPIO_InitStructure.GPIO_Pin = WDT_PIN;
  27259. 800fc40: 2401 movs r4, #1
  27260. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27261. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  27262. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27263. 800fc42: 2500 movs r5, #0
  27264. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  27265. RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
  27266. GPIO_InitStructure.GPIO_Pin = WDT_PIN;
  27267. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27268. 800fc44: 2302 movs r3, #2
  27269. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  27270. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27271. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  27272. GPIO_Init(GPIOC, &GPIO_InitStructure);
  27273. 800fc46: a901 add r1, sp, #4
  27274. 800fc48: 481b ldr r0, [pc, #108] ; (800fcb8 <WDG_Init+0x8c>)
  27275. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  27276. RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
  27277. GPIO_InitStructure.GPIO_Pin = WDT_PIN;
  27278. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27279. 800fc4a: f88d 3009 strb.w r3, [sp, #9]
  27280. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  27281. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27282. 800fc4e: f88d 500a strb.w r5, [sp, #10]
  27283. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  27284. 800fc52: f88d 500b strb.w r5, [sp, #11]
  27285. TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  27286. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  27287. RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
  27288. GPIO_InitStructure.GPIO_Pin = WDT_PIN;
  27289. 800fc56: 9401 str r4, [sp, #4]
  27290. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  27291. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  27292. 800fc58: f88d 4008 strb.w r4, [sp, #8]
  27293. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27294. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  27295. GPIO_Init(GPIOC, &GPIO_InitStructure);
  27296. 800fc5c: f7fa f8e8 bl 8009e30 <GPIO_Init>
  27297. NVIC_InitStructure.NVIC_IRQChannel = TIM8_UP_TIM13_IRQn;
  27298. 800fc60: 232c movs r3, #44 ; 0x2c
  27299. 800fc62: f88d 3000 strb.w r3, [sp]
  27300. NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x6;
  27301. NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0;
  27302. NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  27303. NVIC_Init(&NVIC_InitStructure);
  27304. 800fc66: 4668 mov r0, sp
  27305. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  27306. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  27307. GPIO_Init(GPIOC, &GPIO_InitStructure);
  27308. NVIC_InitStructure.NVIC_IRQChannel = TIM8_UP_TIM13_IRQn;
  27309. NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x6;
  27310. 800fc68: 2306 movs r3, #6
  27311. 800fc6a: f88d 3001 strb.w r3, [sp, #1]
  27312. NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0;
  27313. 800fc6e: f88d 5002 strb.w r5, [sp, #2]
  27314. NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  27315. 800fc72: f88d 4003 strb.w r4, [sp, #3]
  27316. NVIC_Init(&NVIC_InitStructure);
  27317. 800fc76: f7f9 ffe1 bl 8009c3c <NVIC_Init>
  27318. __STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
  27319. {
  27320. if(IRQn < 0) {
  27321. SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
  27322. else {
  27323. NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
  27324. 800fc7a: 4b10 ldr r3, [pc, #64] ; (800fcbc <WDG_Init+0x90>)
  27325. 800fc7c: 2220 movs r2, #32
  27326. 800fc7e: f883 232c strb.w r2, [r3, #812] ; 0x32c
  27327. /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
  27328. TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
  27329. /* Configure timer period to 100ms */
  27330. TIM_TimeBaseStructure.TIM_Period = 1000;
  27331. TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  27332. 800fc82: f8ad 5014 strh.w r5, [sp, #20]
  27333. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  27334. 800fc86: f8ad 500e strh.w r5, [sp, #14]
  27335. TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
  27336. 800fc8a: 4d0d ldr r5, [pc, #52] ; (800fcc0 <WDG_Init+0x94>)
  27337. NVIC_Init(&NVIC_InitStructure);
  27338. NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 2);
  27339. /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
  27340. TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
  27341. 800fc8c: f241 736f movw r3, #5999 ; 0x176f
  27342. 800fc90: f8ad 300c strh.w r3, [sp, #12]
  27343. /* Configure timer period to 100ms */
  27344. TIM_TimeBaseStructure.TIM_Period = 1000;
  27345. TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  27346. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  27347. TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
  27348. 800fc94: 4628 mov r0, r5
  27349. NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 2);
  27350. /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
  27351. TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
  27352. /* Configure timer period to 100ms */
  27353. TIM_TimeBaseStructure.TIM_Period = 1000;
  27354. 800fc96: f44f 737a mov.w r3, #1000 ; 0x3e8
  27355. TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  27356. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  27357. TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
  27358. 800fc9a: a903 add r1, sp, #12
  27359. NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 2);
  27360. /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
  27361. TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
  27362. /* Configure timer period to 100ms */
  27363. TIM_TimeBaseStructure.TIM_Period = 1000;
  27364. 800fc9c: 9304 str r3, [sp, #16]
  27365. TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  27366. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  27367. TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
  27368. 800fc9e: f7fa f9cf bl 800a040 <TIM_TimeBaseInit>
  27369. TIM_Cmd(TIM13, ENABLE);
  27370. 800fca2: 4628 mov r0, r5
  27371. 800fca4: 4621 mov r1, r4
  27372. 800fca6: f7fa fa09 bl 800a0bc <TIM_Cmd>
  27373. TIM_ITConfig(TIM13, TIM_IT_Update, ENABLE);
  27374. 800fcaa: 4628 mov r0, r5
  27375. 800fcac: 4621 mov r1, r4
  27376. 800fcae: 4622 mov r2, r4
  27377. 800fcb0: f7fa fa10 bl 800a0d4 <TIM_ITConfig>
  27378. }
  27379. 800fcb4: b007 add sp, #28
  27380. 800fcb6: bd30 pop {r4, r5, pc}
  27381. 800fcb8: 40020800 .word 0x40020800
  27382. 800fcbc: e000e100 .word 0xe000e100
  27383. 800fcc0: 40001c00 .word 0x40001c00
  27384. 0800fcc4 <TIM8_UP_TIM13_IRQHandler>:
  27385. /**
  27386. * @brief Дергаем пином (сброс внешнего WDT)
  27387. * @retval
  27388. */
  27389. void TIM8_UP_TIM13_IRQHandler(void)
  27390. {
  27391. 800fcc4: b508 push {r3, lr}
  27392. TIM_ClearITPendingBit(TIM13, TIM_IT_Update);
  27393. 800fcc6: 4805 ldr r0, [pc, #20] ; (800fcdc <TIM8_UP_TIM13_IRQHandler+0x18>)
  27394. 800fcc8: 2101 movs r1, #1
  27395. 800fcca: f7fa fa0c bl 800a0e6 <TIM_ClearITPendingBit>
  27396. GPIOC->ODR ^= WDT_PIN;
  27397. 800fcce: 4b04 ldr r3, [pc, #16] ; (800fce0 <TIM8_UP_TIM13_IRQHandler+0x1c>)
  27398. 800fcd0: 695a ldr r2, [r3, #20]
  27399. 800fcd2: f082 0201 eor.w r2, r2, #1
  27400. 800fcd6: 615a str r2, [r3, #20]
  27401. 800fcd8: bd08 pop {r3, pc}
  27402. 800fcda: bf00 nop
  27403. 800fcdc: 40001c00 .word 0x40001c00
  27404. 800fce0: 40020800 .word 0x40020800
  27405. 0800fce4 <http_accept>:
  27406. * @param pcb: pointer to a tcp_pcb structure
  27407. * &param err: Lwip stack error code
  27408. * @retval err
  27409. */
  27410. static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
  27411. {
  27412. 800fce4: b538 push {r3, r4, r5, lr}
  27413. struct http_state *hs;
  27414. /* Allocate memory for the structure that holds the state of the connection */
  27415. hs = mem_malloc(sizeof(struct http_state));
  27416. 800fce6: 2008 movs r0, #8
  27417. * @param pcb: pointer to a tcp_pcb structure
  27418. * &param err: Lwip stack error code
  27419. * @retval err
  27420. */
  27421. static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
  27422. {
  27423. 800fce8: 460c mov r4, r1
  27424. struct http_state *hs;
  27425. /* Allocate memory for the structure that holds the state of the connection */
  27426. hs = mem_malloc(sizeof(struct http_state));
  27427. 800fcea: f7fb fa0f bl 800b10c <mem_malloc>
  27428. if (hs == NULL)
  27429. 800fcee: 4601 mov r1, r0
  27430. 800fcf0: b1a0 cbz r0, 800fd1c <http_accept+0x38>
  27431. {
  27432. return ERR_MEM;
  27433. }
  27434. /* Initialize the structure. */
  27435. hs->file = NULL;
  27436. 800fcf2: 2500 movs r5, #0
  27437. 800fcf4: 6005 str r5, [r0, #0]
  27438. hs->left = 0;
  27439. 800fcf6: 6045 str r5, [r0, #4]
  27440. /* Tell TCP that this is the structure we wish to be passed for our
  27441. callbacks. */
  27442. tcp_arg(pcb, hs);
  27443. 800fcf8: 4620 mov r0, r4
  27444. 800fcfa: f7fb fea5 bl 800ba48 <tcp_arg>
  27445. /* Tell TCP that we wish to be informed of incoming data by a call
  27446. to the http_recv() function. */
  27447. tcp_recv(pcb, http_recv);
  27448. 800fcfe: 4620 mov r0, r4
  27449. 800fd00: 4908 ldr r1, [pc, #32] ; (800fd24 <http_accept+0x40>)
  27450. 800fd02: f7fb fea3 bl 800ba4c <tcp_recv>
  27451. tcp_err(pcb, conn_err);
  27452. 800fd06: 4620 mov r0, r4
  27453. 800fd08: 4907 ldr r1, [pc, #28] ; (800fd28 <http_accept+0x44>)
  27454. 800fd0a: f7fb fea3 bl 800ba54 <tcp_err>
  27455. tcp_poll(pcb, http_poll, 10);
  27456. 800fd0e: 4620 mov r0, r4
  27457. 800fd10: 4906 ldr r1, [pc, #24] ; (800fd2c <http_accept+0x48>)
  27458. 800fd12: 220a movs r2, #10
  27459. 800fd14: f7fb fea3 bl 800ba5e <tcp_poll>
  27460. return ERR_OK;
  27461. 800fd18: 4628 mov r0, r5
  27462. 800fd1a: e000 b.n 800fd1e <http_accept+0x3a>
  27463. /* Allocate memory for the structure that holds the state of the connection */
  27464. hs = mem_malloc(sizeof(struct http_state));
  27465. if (hs == NULL)
  27466. {
  27467. return ERR_MEM;
  27468. 800fd1c: 20ff movs r0, #255 ; 0xff
  27469. tcp_err(pcb, conn_err);
  27470. tcp_poll(pcb, http_poll, 10);
  27471. return ERR_OK;
  27472. }
  27473. 800fd1e: b240 sxtb r0, r0
  27474. 800fd20: bd38 pop {r3, r4, r5, pc}
  27475. 800fd22: bf00 nop
  27476. 800fd24: 0800fe79 .word 0x0800fe79
  27477. 800fd28: 0800fd73 .word 0x0800fd73
  27478. 800fd2c: 0800fd5b .word 0x0800fd5b
  27479. 0800fd30 <send_data>:
  27480. * @param pcb: pointer to a tcp_pcb struct
  27481. * @param hs: pointer to a http_state struct
  27482. * @retval none
  27483. */
  27484. static void send_data(struct tcp_pcb *pcb, struct http_state *hs)
  27485. {
  27486. 800fd30: b538 push {r3, r4, r5, lr}
  27487. err_t err;
  27488. u16_t len;
  27489. /* We cannot send more data than space available in the send
  27490. buffer */
  27491. if (tcp_sndbuf(pcb) < hs->left)
  27492. 800fd32: 684b ldr r3, [r1, #4]
  27493. 800fd34: f8b0 5066 ldrh.w r5, [r0, #102] ; 0x66
  27494. 800fd38: 429d cmp r5, r3
  27495. {
  27496. len = tcp_sndbuf(pcb);
  27497. }
  27498. else
  27499. {
  27500. len = hs->left;
  27501. 800fd3a: bf28 it cs
  27502. 800fd3c: b29d uxthcs r5, r3
  27503. * @param pcb: pointer to a tcp_pcb struct
  27504. * @param hs: pointer to a http_state struct
  27505. * @retval none
  27506. */
  27507. static void send_data(struct tcp_pcb *pcb, struct http_state *hs)
  27508. {
  27509. 800fd3e: 460c mov r4, r1
  27510. }
  27511. else
  27512. {
  27513. len = hs->left;
  27514. }
  27515. err = tcp_write(pcb, hs->file, len, 0);
  27516. 800fd40: 462a mov r2, r5
  27517. 800fd42: 6809 ldr r1, [r1, #0]
  27518. 800fd44: 2300 movs r3, #0
  27519. 800fd46: f7fd fa41 bl 800d1cc <tcp_write>
  27520. if (err == ERR_OK)
  27521. 800fd4a: b928 cbnz r0, 800fd58 <send_data+0x28>
  27522. {
  27523. hs->file += len;
  27524. 800fd4c: 6823 ldr r3, [r4, #0]
  27525. 800fd4e: 195b adds r3, r3, r5
  27526. 800fd50: 6023 str r3, [r4, #0]
  27527. hs->left -= len;
  27528. 800fd52: 6863 ldr r3, [r4, #4]
  27529. 800fd54: 1b5d subs r5, r3, r5
  27530. 800fd56: 6065 str r5, [r4, #4]
  27531. 800fd58: bd38 pop {r3, r4, r5, pc}
  27532. 0800fd5a <http_poll>:
  27533. * @param arg: pointer to an argument to be passed to callback function
  27534. * @param pcb: pointer on tcp_pcb structure
  27535. * @retval err_t
  27536. */
  27537. static err_t http_poll(void *arg, struct tcp_pcb *pcb)
  27538. {
  27539. 800fd5a: b508 push {r3, lr}
  27540. if (arg == NULL)
  27541. 800fd5c: 4603 mov r3, r0
  27542. {
  27543. tcp_close(pcb);
  27544. 800fd5e: 4608 mov r0, r1
  27545. * @param pcb: pointer on tcp_pcb structure
  27546. * @retval err_t
  27547. */
  27548. static err_t http_poll(void *arg, struct tcp_pcb *pcb)
  27549. {
  27550. if (arg == NULL)
  27551. 800fd60: b913 cbnz r3, 800fd68 <http_poll+0xe>
  27552. {
  27553. tcp_close(pcb);
  27554. 800fd62: f7fc f9cb bl 800c0fc <tcp_close>
  27555. 800fd66: e002 b.n 800fd6e <http_poll+0x14>
  27556. }
  27557. else
  27558. {
  27559. send_data(pcb, (struct http_state *)arg);
  27560. 800fd68: 4619 mov r1, r3
  27561. 800fd6a: f7ff ffe1 bl 800fd30 <send_data>
  27562. }
  27563. return ERR_OK;
  27564. }
  27565. 800fd6e: 2000 movs r0, #0
  27566. 800fd70: bd08 pop {r3, pc}
  27567. 0800fd72 <conn_err>:
  27568. static void conn_err(void *arg, err_t err)
  27569. {
  27570. struct http_state *hs;
  27571. hs = arg;
  27572. mem_free(hs);
  27573. 800fd72: f7fb b905 b.w 800af80 <mem_free>
  27574. 800fd76: 0000 movs r0, r0
  27575. 0800fd78 <close_conn>:
  27576. * @param pcb: pointer to a tcp_pcb struct
  27577. * @param hs: pointer to a http_state struct
  27578. * @retval
  27579. */
  27580. static void close_conn(struct tcp_pcb *pcb, struct http_state *hs)
  27581. {
  27582. 800fd78: b538 push {r3, r4, r5, lr}
  27583. 800fd7a: 4604 mov r4, r0
  27584. 800fd7c: 460d mov r5, r1
  27585. tcp_arg(pcb, NULL);
  27586. 800fd7e: 2100 movs r1, #0
  27587. 800fd80: f7fb fe62 bl 800ba48 <tcp_arg>
  27588. tcp_sent(pcb, NULL);
  27589. 800fd84: 4620 mov r0, r4
  27590. 800fd86: 2100 movs r1, #0
  27591. 800fd88: f7fb fe62 bl 800ba50 <tcp_sent>
  27592. tcp_recv(pcb, NULL);
  27593. 800fd8c: 2100 movs r1, #0
  27594. 800fd8e: 4620 mov r0, r4
  27595. 800fd90: f7fb fe5c bl 800ba4c <tcp_recv>
  27596. mem_free(hs);
  27597. 800fd94: 4628 mov r0, r5
  27598. 800fd96: f7fb f8f3 bl 800af80 <mem_free>
  27599. tcp_close(pcb);
  27600. 800fd9a: 4620 mov r0, r4
  27601. 800fd9c: f7fc f9ae bl 800c0fc <tcp_close>
  27602. reqCounter++;
  27603. 800fda0: 4b02 ldr r3, [pc, #8] ; (800fdac <close_conn+0x34>)
  27604. 800fda2: 781a ldrb r2, [r3, #0]
  27605. 800fda4: 3201 adds r2, #1
  27606. 800fda6: 701a strb r2, [r3, #0]
  27607. 800fda8: bd38 pop {r3, r4, r5, pc}
  27608. 800fdaa: bf00 nop
  27609. 800fdac: 20006d82 .word 0x20006d82
  27610. 0800fdb0 <fs_open>:
  27611. * @param name : pointer to a file name
  27612. * @param file : pointer to a fs_file structure
  27613. * @retval 1 if success, 0 if fail
  27614. */
  27615. static int fs_open(char *name, struct fs_file *file)
  27616. {
  27617. 800fdb0: b570 push {r4, r5, r6, lr}
  27618. struct fsdata_file_noconst *f;
  27619. for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
  27620. 800fdb2: 4c09 ldr r4, [pc, #36] ; (800fdd8 <fs_open+0x28>)
  27621. * @param name : pointer to a file name
  27622. * @param file : pointer to a fs_file structure
  27623. * @retval 1 if success, 0 if fail
  27624. */
  27625. static int fs_open(char *name, struct fs_file *file)
  27626. {
  27627. 800fdb4: 4606 mov r6, r0
  27628. 800fdb6: 460d mov r5, r1
  27629. struct fsdata_file_noconst *f;
  27630. for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
  27631. {
  27632. if (!strcmp(name, f->name))
  27633. 800fdb8: 4630 mov r0, r6
  27634. 800fdba: 6861 ldr r1, [r4, #4]
  27635. 800fdbc: f7f9 fc42 bl 8009644 <strcmp>
  27636. 800fdc0: b928 cbnz r0, 800fdce <fs_open+0x1e>
  27637. {
  27638. file->data = f->data;
  27639. 800fdc2: 68a3 ldr r3, [r4, #8]
  27640. 800fdc4: 602b str r3, [r5, #0]
  27641. file->len = f->len;
  27642. 800fdc6: 68e3 ldr r3, [r4, #12]
  27643. return 1;
  27644. 800fdc8: 2001 movs r0, #1
  27645. for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
  27646. {
  27647. if (!strcmp(name, f->name))
  27648. {
  27649. file->data = f->data;
  27650. file->len = f->len;
  27651. 800fdca: 606b str r3, [r5, #4]
  27652. return 1;
  27653. 800fdcc: bd70 pop {r4, r5, r6, pc}
  27654. */
  27655. static int fs_open(char *name, struct fs_file *file)
  27656. {
  27657. struct fsdata_file_noconst *f;
  27658. for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
  27659. 800fdce: 6824 ldr r4, [r4, #0]
  27660. 800fdd0: 2c00 cmp r4, #0
  27661. 800fdd2: d1f1 bne.n 800fdb8 <fs_open+0x8>
  27662. file->data = f->data;
  27663. file->len = f->len;
  27664. return 1;
  27665. }
  27666. }
  27667. return 0;
  27668. 800fdd4: 4620 mov r0, r4
  27669. }
  27670. 800fdd6: bd70 pop {r4, r5, r6, pc}
  27671. 800fdd8: 08012258 .word 0x08012258
  27672. 0800fddc <IAP_HTTP_writedata>:
  27673. * @param ptr: data pointer
  27674. * @param len: data length
  27675. * @retval none
  27676. */
  27677. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27678. {
  27679. 800fddc: b5f8 push {r3, r4, r5, r6, r7, lr}
  27680. uint32_t count, i=0, j=0;
  27681. /* check if any left bytes from previous packet transfer*/
  27682. /* if it is the case do a concat with new data to create a 32-bit word */
  27683. if (LeftBytes)
  27684. 800fdde: 4b21 ldr r3, [pc, #132] ; (800fe64 <IAP_HTTP_writedata+0x88>)
  27685. 800fde0: 781a ldrb r2, [r3, #0]
  27686. * @param ptr: data pointer
  27687. * @param len: data length
  27688. * @retval none
  27689. */
  27690. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27691. {
  27692. 800fde2: 4606 mov r6, r0
  27693. 800fde4: 460c mov r4, r1
  27694. uint32_t count, i=0, j=0;
  27695. /* check if any left bytes from previous packet transfer*/
  27696. /* if it is the case do a concat with new data to create a 32-bit word */
  27697. if (LeftBytes)
  27698. 800fde6: b94a cbnz r2, 800fdfc <IAP_HTTP_writedata+0x20>
  27699. 800fde8: e01a b.n 800fe20 <IAP_HTTP_writedata+0x44>
  27700. {
  27701. while(LeftBytes<=3)
  27702. {
  27703. if(len>(j+1))
  27704. 800fdea: 3501 adds r5, #1
  27705. 800fdec: 42ac cmp r4, r5
  27706. * @brief writes received data in flash
  27707. * @param ptr: data pointer
  27708. * @param len: data length
  27709. * @retval none
  27710. */
  27711. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27712. 800fdee: bf89 itett hi
  27713. 800fdf0: 1977 addhi r7, r6, r5
  27714. {
  27715. LeftBytesTab[LeftBytes++] = *(ptr+j);
  27716. }
  27717. else
  27718. {
  27719. LeftBytesTab[LeftBytes++] = 0xFF;
  27720. 800fdf2: 54c8 strbls r0, [r1, r3]
  27721. {
  27722. while(LeftBytes<=3)
  27723. {
  27724. if(len>(j+1))
  27725. {
  27726. LeftBytesTab[LeftBytes++] = *(ptr+j);
  27727. 800fdf4: f817 7c01 ldrbhi.w r7, [r7, #-1]
  27728. 800fdf8: 54cf strbhi r7, [r1, r3]
  27729. 800fdfa: e002 b.n 800fe02 <IAP_HTTP_writedata+0x26>
  27730. 800fdfc: 491a ldr r1, [pc, #104] ; (800fe68 <IAP_HTTP_writedata+0x8c>)
  27731. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27732. {
  27733. uint32_t count, i=0, j=0;
  27734. /* check if any left bytes from previous packet transfer*/
  27735. /* if it is the case do a concat with new data to create a 32-bit word */
  27736. if (LeftBytes)
  27737. 800fdfe: 2500 movs r5, #0
  27738. {
  27739. LeftBytesTab[LeftBytes++] = *(ptr+j);
  27740. }
  27741. else
  27742. {
  27743. LeftBytesTab[LeftBytes++] = 0xFF;
  27744. 800fe00: 20ff movs r0, #255 ; 0xff
  27745. * @brief writes received data in flash
  27746. * @param ptr: data pointer
  27747. * @param len: data length
  27748. * @retval none
  27749. */
  27750. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27751. 800fe02: 1953 adds r3, r2, r5
  27752. 800fe04: b2db uxtb r3, r3
  27753. uint32_t count, i=0, j=0;
  27754. /* check if any left bytes from previous packet transfer*/
  27755. /* if it is the case do a concat with new data to create a 32-bit word */
  27756. if (LeftBytes)
  27757. {
  27758. while(LeftBytes<=3)
  27759. 800fe06: 2b03 cmp r3, #3
  27760. 800fe08: d9ef bls.n 800fdea <IAP_HTTP_writedata+0xe>
  27761. 800fe0a: 4f16 ldr r7, [pc, #88] ; (800fe64 <IAP_HTTP_writedata+0x88>)
  27762. {
  27763. LeftBytesTab[LeftBytes++] = 0xFF;
  27764. }
  27765. j++;
  27766. }
  27767. FLASH_If_Write(&FlashWriteAddress, (u32*)(LeftBytesTab),1);
  27768. 800fe0c: 4817 ldr r0, [pc, #92] ; (800fe6c <IAP_HTTP_writedata+0x90>)
  27769. 800fe0e: 4916 ldr r1, [pc, #88] ; (800fe68 <IAP_HTTP_writedata+0x8c>)
  27770. 800fe10: 703b strb r3, [r7, #0]
  27771. 800fe12: 2201 movs r2, #1
  27772. 800fe14: f7ff fc4a bl 800f6ac <FLASH_If_Write>
  27773. LeftBytes =0;
  27774. 800fe18: 2300 movs r3, #0
  27775. 800fe1a: 703b strb r3, [r7, #0]
  27776. /* update data pointer */
  27777. ptr = (char*)(ptr+j);
  27778. 800fe1c: 1976 adds r6, r6, r5
  27779. len = len -j;
  27780. 800fe1e: 1b64 subs r4, r4, r5
  27781. }
  27782. /* write received bytes into flash */
  27783. count = len/4;
  27784. 800fe20: 08a2 lsrs r2, r4, #2
  27785. /* check if remaining bytes < 4 */
  27786. i= len%4;
  27787. if (i>0)
  27788. 800fe22: f014 0103 ands.w r1, r4, #3
  27789. 800fe26: d015 beq.n 800fe54 <IAP_HTTP_writedata+0x78>
  27790. {
  27791. if (TotalReceived != size)
  27792. 800fe28: 4b11 ldr r3, [pc, #68] ; (800fe70 <IAP_HTTP_writedata+0x94>)
  27793. 800fe2a: 4812 ldr r0, [pc, #72] ; (800fe74 <IAP_HTTP_writedata+0x98>)
  27794. 800fe2c: 681b ldr r3, [r3, #0]
  27795. 800fe2e: 6800 ldr r0, [r0, #0]
  27796. 800fe30: 4298 cmp r0, r3
  27797. 800fe32: d00e beq.n 800fe52 <IAP_HTTP_writedata+0x76>
  27798. {
  27799. /* store bytes in LeftBytesTab */
  27800. LeftBytes=0;
  27801. 800fe34: 480b ldr r0, [pc, #44] ; (800fe64 <IAP_HTTP_writedata+0x88>)
  27802. for(;i>0;i--)
  27803. LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
  27804. 800fe36: 4d0c ldr r5, [pc, #48] ; (800fe68 <IAP_HTTP_writedata+0x8c>)
  27805. if (i>0)
  27806. {
  27807. if (TotalReceived != size)
  27808. {
  27809. /* store bytes in LeftBytesTab */
  27810. LeftBytes=0;
  27811. 800fe38: 2300 movs r3, #0
  27812. * @brief writes received data in flash
  27813. * @param ptr: data pointer
  27814. * @param len: data length
  27815. * @retval none
  27816. */
  27817. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27818. 800fe3a: 1a64 subs r4, r4, r1
  27819. if (i>0)
  27820. {
  27821. if (TotalReceived != size)
  27822. {
  27823. /* store bytes in LeftBytesTab */
  27824. LeftBytes=0;
  27825. 800fe3c: 7003 strb r3, [r0, #0]
  27826. * @brief writes received data in flash
  27827. * @param ptr: data pointer
  27828. * @param len: data length
  27829. * @retval none
  27830. */
  27831. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27832. 800fe3e: 1934 adds r4, r6, r4
  27833. if (TotalReceived != size)
  27834. {
  27835. /* store bytes in LeftBytesTab */
  27836. LeftBytes=0;
  27837. for(;i>0;i--)
  27838. LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
  27839. 800fe40: 5ce7 ldrb r7, [r4, r3]
  27840. * @brief writes received data in flash
  27841. * @param ptr: data pointer
  27842. * @param len: data length
  27843. * @retval none
  27844. */
  27845. void IAP_HTTP_writedata(char * ptr, uint32_t len)
  27846. 800fe42: b2d8 uxtb r0, r3
  27847. 800fe44: 3301 adds r3, #1
  27848. {
  27849. if (TotalReceived != size)
  27850. {
  27851. /* store bytes in LeftBytesTab */
  27852. LeftBytes=0;
  27853. for(;i>0;i--)
  27854. 800fe46: 428b cmp r3, r1
  27855. LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
  27856. 800fe48: 542f strb r7, [r5, r0]
  27857. {
  27858. if (TotalReceived != size)
  27859. {
  27860. /* store bytes in LeftBytesTab */
  27861. LeftBytes=0;
  27862. for(;i>0;i--)
  27863. 800fe4a: d1f9 bne.n 800fe40 <IAP_HTTP_writedata+0x64>
  27864. 800fe4c: 4905 ldr r1, [pc, #20] ; (800fe64 <IAP_HTTP_writedata+0x88>)
  27865. 800fe4e: 700b strb r3, [r1, #0]
  27866. 800fe50: e000 b.n 800fe54 <IAP_HTTP_writedata+0x78>
  27867. LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
  27868. }
  27869. else count++;
  27870. 800fe52: 3201 adds r2, #1
  27871. }
  27872. FLASH_If_Write(&FlashWriteAddress, (u32*)ptr ,count);
  27873. 800fe54: 4805 ldr r0, [pc, #20] ; (800fe6c <IAP_HTTP_writedata+0x90>)
  27874. 800fe56: 4631 mov r1, r6
  27875. 800fe58: b292 uxth r2, r2
  27876. }
  27877. 800fe5a: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr}
  27878. for(;i>0;i--)
  27879. LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
  27880. }
  27881. else count++;
  27882. }
  27883. FLASH_If_Write(&FlashWriteAddress, (u32*)ptr ,count);
  27884. 800fe5e: f7ff bc25 b.w 800f6ac <FLASH_If_Write>
  27885. 800fe62: bf00 nop
  27886. 800fe64: 20006d94 .word 0x20006d94
  27887. 800fe68: 20006d83 .word 0x20006d83
  27888. 800fe6c: 20006d90 .word 0x20006d90
  27889. 800fe70: 20006da4 .word 0x20006da4
  27890. 800fe74: 20006da0 .word 0x20006da0
  27891. 0800fe78 <http_recv>:
  27892. * @retval err
  27893. */
  27894. /* goback.cgi - возврат в основную прошивку */
  27895. /* upload.cgi - загрузка новой прошивки */
  27896. static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
  27897. {
  27898. 800fe78: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  27899. 800fe7c: b087 sub sp, #28
  27900. 800fe7e: 4617 mov r7, r2
  27901. int32_t i, len=0;
  27902. uint32_t DataOffset, FilenameOffset;
  27903. char *data, *ptr, filename[13];
  27904. struct fs_file file = {0, 0};
  27905. 800fe80: 2200 movs r2, #0
  27906. * @retval err
  27907. */
  27908. /* goback.cgi - возврат в основную прошивку */
  27909. /* upload.cgi - загрузка новой прошивки */
  27910. static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
  27911. {
  27912. 800fe82: 4604 mov r4, r0
  27913. 800fe84: 460d mov r5, r1
  27914. int32_t i, len=0;
  27915. uint32_t DataOffset, FilenameOffset;
  27916. char *data, *ptr, filename[13];
  27917. struct fs_file file = {0, 0};
  27918. 800fe86: 9200 str r2, [sp, #0]
  27919. 800fe88: 9201 str r2, [sp, #4]
  27920. hs = arg;
  27921. if (err == ERR_OK && p != NULL)
  27922. 800fe8a: 2b00 cmp r3, #0
  27923. 800fe8c: f040 820a bne.w 80102a4 <http_recv+0x42c>
  27924. {
  27925. /* Inform TCP that we have taken the data */
  27926. tcp_recved(pcb, p->tot_len);
  27927. 800fe90: 4608 mov r0, r1
  27928. hs = arg;
  27929. if (err == ERR_OK && p != NULL)
  27930. 800fe92: 2f00 cmp r7, #0
  27931. 800fe94: f000 8203 beq.w 801029e <http_recv+0x426>
  27932. {
  27933. /* Inform TCP that we have taken the data */
  27934. tcp_recved(pcb, p->tot_len);
  27935. 800fe98: 8939 ldrh r1, [r7, #8]
  27936. 800fe9a: f7fb fda1 bl 800b9e0 <tcp_recved>
  27937. if (hs->file == NULL)
  27938. 800fe9e: 6823 ldr r3, [r4, #0]
  27939. 800fea0: 2b00 cmp r3, #0
  27940. 800fea2: f040 81ec bne.w 801027e <http_recv+0x406>
  27941. {
  27942. data = p->payload;
  27943. 800fea6: 687e ldr r6, [r7, #4]
  27944. len = p->tot_len;
  27945. 800fea8: f8b7 8008 ldrh.w r8, [r7, #8]
  27946. printLen = p->tot_len;
  27947. 800feac: 4b9f ldr r3, [pc, #636] ; (801012c <http_recv+0x2b4>)
  27948. memcpy(printBuf, p->payload , printLen);
  27949. 800feae: 48a0 ldr r0, [pc, #640] ; (8010130 <http_recv+0x2b8>)
  27950. if (hs->file == NULL)
  27951. {
  27952. data = p->payload;
  27953. len = p->tot_len;
  27954. printLen = p->tot_len;
  27955. 800feb0: f8a3 8000 strh.w r8, [r3]
  27956. memcpy(printBuf, p->payload , printLen);
  27957. 800feb4: 4631 mov r1, r6
  27958. 800feb6: 4642 mov r2, r8
  27959. 800feb8: f7f9 faa4 bl 8009404 <memcpy>
  27960. //printf(printBuf);
  27961. /* process HTTP GET requests */
  27962. if (strncmp(data, "GET /", 5) == 0)
  27963. 800febc: 4630 mov r0, r6
  27964. 800febe: 499d ldr r1, [pc, #628] ; (8010134 <http_recv+0x2bc>)
  27965. 800fec0: 2205 movs r2, #5
  27966. 800fec2: f7f9 fd0b bl 80098dc <strncmp>
  27967. 800fec6: 4681 mov r9, r0
  27968. pbuf_free(p);
  27969. send_data(pcb, hs);
  27970. resetpage = 1;
  27971. tcp_sent(pcb, http_sent);
  27972. }*/
  27973. if (strncmp(data, "GET /upload.css", 15) == 0)
  27974. 800fec8: 4630 mov r0, r6
  27975. printLen = p->tot_len;
  27976. memcpy(printBuf, p->payload , printLen);
  27977. //printf(printBuf);
  27978. /* process HTTP GET requests */
  27979. if (strncmp(data, "GET /", 5) == 0)
  27980. 800feca: f1b9 0f00 cmp.w r9, #0
  27981. 800fece: d14e bne.n 800ff6e <http_recv+0xf6>
  27982. pbuf_free(p);
  27983. send_data(pcb, hs);
  27984. resetpage = 1;
  27985. tcp_sent(pcb, http_sent);
  27986. }*/
  27987. if (strncmp(data, "GET /upload.css", 15) == 0)
  27988. 800fed0: 4999 ldr r1, [pc, #612] ; (8010138 <http_recv+0x2c0>)
  27989. 800fed2: 220f movs r2, #15
  27990. 800fed4: f7f9 fd02 bl 80098dc <strncmp>
  27991. 800fed8: b908 cbnz r0, 800fede <http_recv+0x66>
  27992. {
  27993. fs_open("/upload.css", &file);
  27994. 800feda: 4898 ldr r0, [pc, #608] ; (801013c <http_recv+0x2c4>)
  27995. 800fedc: e006 b.n 800feec <http_recv+0x74>
  27996. hs->left = file.len;
  27997. pbuf_free(p);
  27998. send_data(pcb, hs);
  27999. tcp_sent(pcb, http_sent);
  28000. }
  28001. else if (strncmp(data, "GET /upload.js", 14) == 0)
  28002. 800fede: 4630 mov r0, r6
  28003. 800fee0: 4997 ldr r1, [pc, #604] ; (8010140 <http_recv+0x2c8>)
  28004. 800fee2: 220e movs r2, #14
  28005. 800fee4: f7f9 fcfa bl 80098dc <strncmp>
  28006. 800fee8: b998 cbnz r0, 800ff12 <http_recv+0x9a>
  28007. {
  28008. fs_open("/upload.js", &file);
  28009. 800feea: 4896 ldr r0, [pc, #600] ; (8010144 <http_recv+0x2cc>)
  28010. 800feec: 4669 mov r1, sp
  28011. 800feee: f7ff ff5f bl 800fdb0 <fs_open>
  28012. hs->file = file.data;
  28013. 800fef2: 9b00 ldr r3, [sp, #0]
  28014. 800fef4: 6023 str r3, [r4, #0]
  28015. hs->left = file.len;
  28016. 800fef6: 9b01 ldr r3, [sp, #4]
  28017. pbuf_free(p);
  28018. 800fef8: 4638 mov r0, r7
  28019. }
  28020. else if (strncmp(data, "GET /upload.js", 14) == 0)
  28021. {
  28022. fs_open("/upload.js", &file);
  28023. hs->file = file.data;
  28024. hs->left = file.len;
  28025. 800fefa: 6063 str r3, [r4, #4]
  28026. pbuf_free(p);
  28027. 800fefc: f7fb fae2 bl 800b4c4 <pbuf_free>
  28028. send_data(pcb, hs);
  28029. 800ff00: 4628 mov r0, r5
  28030. 800ff02: 4621 mov r1, r4
  28031. 800ff04: f7ff ff14 bl 800fd30 <send_data>
  28032. tcp_sent(pcb, http_sent);
  28033. 800ff08: 4628 mov r0, r5
  28034. 800ff0a: 498f ldr r1, [pc, #572] ; (8010148 <http_recv+0x2d0>)
  28035. 800ff0c: f7fb fda0 bl 800ba50 <tcp_sent>
  28036. 800ff10: e1c8 b.n 80102a4 <http_recv+0x42c>
  28037. }
  28038. /* Возврат в основную прошивку. Сбрасываем флаг loadmode,
  28039. сохраняем настройки и перезагружаемся */
  28040. else if (strncmp(data, "GET /goback.cgi", 15)==0)
  28041. 800ff12: 498e ldr r1, [pc, #568] ; (801014c <http_recv+0x2d4>)
  28042. 800ff14: 4630 mov r0, r6
  28043. 800ff16: 220f movs r2, #15
  28044. 800ff18: f7f9 fce0 bl 80098dc <strncmp>
  28045. 800ff1c: 4601 mov r1, r0
  28046. 800ff1e: b990 cbnz r0, 800ff46 <http_recv+0xce>
  28047. {
  28048. RTC_WriteBackupRegister(RTC_BKP_DR1, 0);
  28049. 800ff20: 2001 movs r0, #1
  28050. 800ff22: f7fa f867 bl 8009ff4 <RTC_WriteBackupRegister>
  28051. /* sSettings.bootParams.loadMode = 0;
  28052. SETTINGS_Save();*/
  28053. Delay_ms(1010);
  28054. 800ff26: f240 30f2 movw r0, #1010 ; 0x3f2
  28055. 800ff2a: f7ff fdf5 bl 800fb18 <Delay_ms>
  28056. This function acts as a special kind of Data Memory Barrier.
  28057. It completes when all explicit memory accesses before this instruction complete.
  28058. */
  28059. __attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void)
  28060. {
  28061. __ASM volatile ("dsb");
  28062. 800ff2e: f3bf 8f4f dsb sy
  28063. //static inline void NVIC_SystemReset(void)
  28064. {
  28065. __DSB(); /* Ensure all outstanding memory accesses included
  28066. buffered write are completed before reset */
  28067. SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
  28068. (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
  28069. 800ff32: 4a87 ldr r2, [pc, #540] ; (8010150 <http_recv+0x2d8>)
  28070. 800ff34: 4b87 ldr r3, [pc, #540] ; (8010154 <http_recv+0x2dc>)
  28071. 800ff36: 68d1 ldr r1, [r2, #12]
  28072. 800ff38: f401 61e0 and.w r1, r1, #1792 ; 0x700
  28073. 800ff3c: 430b orrs r3, r1
  28074. __STATIC_INLINE void NVIC_SystemReset(void)
  28075. //static inline void NVIC_SystemReset(void)
  28076. {
  28077. __DSB(); /* Ensure all outstanding memory accesses included
  28078. buffered write are completed before reset */
  28079. SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
  28080. 800ff3e: 60d3 str r3, [r2, #12]
  28081. 800ff40: f3bf 8f4f dsb sy
  28082. 800ff44: e7fe b.n 800ff44 <http_recv+0xcc>
  28083. NVIC_SystemReset();
  28084. }
  28085. else if (strncmp(data, "GET /favicon.ico", 16) == 0)
  28086. 800ff46: 4630 mov r0, r6
  28087. 800ff48: 4983 ldr r1, [pc, #524] ; (8010158 <http_recv+0x2e0>)
  28088. 800ff4a: 2210 movs r2, #16
  28089. 800ff4c: f7f9 fcc6 bl 80098dc <strncmp>
  28090. 800ff50: b940 cbnz r0, 800ff64 <http_recv+0xec>
  28091. {
  28092. fs_open("/favicon.ico", &file);
  28093. 800ff52: 4882 ldr r0, [pc, #520] ; (801015c <http_recv+0x2e4>)
  28094. 800ff54: 4669 mov r1, sp
  28095. 800ff56: f7ff ff2b bl 800fdb0 <fs_open>
  28096. hs->file = file.data;
  28097. 800ff5a: 9b00 ldr r3, [sp, #0]
  28098. 800ff5c: 6023 str r3, [r4, #0]
  28099. hs->left = file.len;
  28100. 800ff5e: 9b01 ldr r3, [sp, #4]
  28101. 800ff60: 6063 str r3, [r4, #4]
  28102. 800ff62: e7cd b.n 800ff00 <http_recv+0x88>
  28103. tcp_sent(pcb, http_sent);
  28104. }
  28105. else
  28106. {
  28107. /*send the login page (which is the index page) */
  28108. htmlpage = LoginPage;
  28109. 800ff64: 4b7e ldr r3, [pc, #504] ; (8010160 <http_recv+0x2e8>)
  28110. fs_open("/index.html", &file);
  28111. 800ff66: 487f ldr r0, [pc, #508] ; (8010164 <http_recv+0x2ec>)
  28112. tcp_sent(pcb, http_sent);
  28113. }
  28114. else
  28115. {
  28116. /*send the login page (which is the index page) */
  28117. htmlpage = LoginPage;
  28118. 800ff68: f883 9000 strb.w r9, [r3]
  28119. 800ff6c: e7be b.n 800feec <http_recv+0x74>
  28120. tcp_sent(pcb, http_sent);
  28121. }
  28122. }
  28123. #if 1
  28124. /* process POST request for file upload and incoming data packets after POST request*/
  28125. else if ((strncmp(data, "POST /upload.cgi",16) == 0) || (DataFlag >= 1))
  28126. 800ff6e: 497e ldr r1, [pc, #504] ; (8010168 <http_recv+0x2f0>)
  28127. 800ff70: 2210 movs r2, #16
  28128. 800ff72: f7f9 fcb3 bl 80098dc <strncmp>
  28129. 800ff76: b120 cbz r0, 800ff82 <http_recv+0x10a>
  28130. 800ff78: 4b7c ldr r3, [pc, #496] ; (801016c <http_recv+0x2f4>)
  28131. 800ff7a: 681b ldr r3, [r3, #0]
  28132. 800ff7c: 2b00 cmp r3, #0
  28133. 800ff7e: f000 817e beq.w 801027e <http_recv+0x406>
  28134. {
  28135. if (fEraseFlash) {
  28136. 800ff82: f8df 9210 ldr.w r9, [pc, #528] ; 8010194 <http_recv+0x31c>
  28137. 800ff86: f899 3000 ldrb.w r3, [r9]
  28138. 800ff8a: b12b cbz r3, 800ff98 <http_recv+0x120>
  28139. FLASH_If_Erase(USER_FLASH_FIRST_PAGE_ADDRESS);
  28140. 800ff8c: 4878 ldr r0, [pc, #480] ; (8010170 <http_recv+0x2f8>)
  28141. 800ff8e: f7ff fb5f bl 800f650 <FLASH_If_Erase>
  28142. fEraseFlash = false;
  28143. 800ff92: 2300 movs r3, #0
  28144. 800ff94: f889 3000 strb.w r3, [r9]
  28145. }
  28146. DataOffset = 0;
  28147. /* POST Packet received */
  28148. if (DataFlag == 0)
  28149. 800ff98: 4b74 ldr r3, [pc, #464] ; (801016c <http_recv+0x2f4>)
  28150. 800ff9a: 681b ldr r3, [r3, #0]
  28151. 800ff9c: 2b00 cmp r3, #0
  28152. 800ff9e: d15e bne.n 801005e <http_recv+0x1e6>
  28153. {
  28154. BrowserFlag = 0;
  28155. 800ffa0: 4a74 ldr r2, [pc, #464] ; (8010174 <http_recv+0x2fc>)
  28156. TotalReceived = 0;
  28157. /* parse packet for Content-length field */
  28158. size = Parse_Content_Length(data, p->tot_len);
  28159. 800ffa2: f8b7 a008 ldrh.w sl, [r7, #8]
  28160. DataOffset = 0;
  28161. /* POST Packet received */
  28162. if (DataFlag == 0)
  28163. {
  28164. BrowserFlag = 0;
  28165. 800ffa6: 6013 str r3, [r2, #0]
  28166. TotalReceived = 0;
  28167. 800ffa8: 4a73 ldr r2, [pc, #460] ; (8010178 <http_recv+0x300>)
  28168. 800ffaa: 6013 str r3, [r2, #0]
  28169. {
  28170. uint32_t i=0,size=0, S=1;
  28171. int32_t j=0;
  28172. char sizestring[6], *ptr;
  28173. ContentLengthOffset =0;
  28174. 800ffac: 4a73 ldr r2, [pc, #460] ; (801017c <http_recv+0x304>)
  28175. /* find Content-Length data in packet buffer */
  28176. for (i=0;i<len;i++)
  28177. 800ffae: 4699 mov r9, r3
  28178. {
  28179. uint32_t i=0,size=0, S=1;
  28180. int32_t j=0;
  28181. char sizestring[6], *ptr;
  28182. ContentLengthOffset =0;
  28183. 800ffb0: 6013 str r3, [r2, #0]
  28184. 800ffb2: e00d b.n 800ffd0 <http_recv+0x158>
  28185. /* find Content-Length data in packet buffer */
  28186. for (i=0;i<len;i++)
  28187. {
  28188. if (strncmp ((char*)(data+i), Content_Length, 16)==0)
  28189. 800ffb4: eb06 0009 add.w r0, r6, r9
  28190. 800ffb8: 4971 ldr r1, [pc, #452] ; (8010180 <http_recv+0x308>)
  28191. 800ffba: 2210 movs r2, #16
  28192. 800ffbc: f7f9 fc8e bl 80098dc <strncmp>
  28193. 800ffc0: b920 cbnz r0, 800ffcc <http_recv+0x154>
  28194. {
  28195. ContentLengthOffset = i+16;
  28196. 800ffc2: 4b6e ldr r3, [pc, #440] ; (801017c <http_recv+0x304>)
  28197. 800ffc4: f109 0210 add.w r2, r9, #16
  28198. 800ffc8: 601a str r2, [r3, #0]
  28199. 800ffca: e003 b.n 800ffd4 <http_recv+0x15c>
  28200. char sizestring[6], *ptr;
  28201. ContentLengthOffset =0;
  28202. /* find Content-Length data in packet buffer */
  28203. for (i=0;i<len;i++)
  28204. 800ffcc: f109 0901 add.w r9, r9, #1
  28205. 800ffd0: 45d1 cmp r9, sl
  28206. 800ffd2: d3ef bcc.n 800ffb4 <http_recv+0x13c>
  28207. ContentLengthOffset = i+16;
  28208. break;
  28209. }
  28210. }
  28211. /* read Content-Length value */
  28212. if (ContentLengthOffset)
  28213. 800ffd4: 4b69 ldr r3, [pc, #420] ; (801017c <http_recv+0x304>)
  28214. 800ffd6: 681a ldr r2, [r3, #0]
  28215. 800ffd8: 4618 mov r0, r3
  28216. 800ffda: b90a cbnz r2, 800ffe0 <http_recv+0x168>
  28217. * @param len : buffer length
  28218. * @retval size : Content_length in numeric format
  28219. */
  28220. static uint32_t Parse_Content_Length(char *data, uint32_t len)
  28221. {
  28222. uint32_t i=0,size=0, S=1;
  28223. 800ffdc: 2200 movs r2, #0
  28224. 800ffde: e023 b.n 8010028 <http_recv+0x1b0>
  28225. }
  28226. /* read Content-Length value */
  28227. if (ContentLengthOffset)
  28228. {
  28229. i=0;
  28230. ptr = (char*)(data + ContentLengthOffset);
  28231. 800ffe0: eb06 0c02 add.w ip, r6, r2
  28232. }
  28233. }
  28234. /* read Content-Length value */
  28235. if (ContentLengthOffset)
  28236. {
  28237. i=0;
  28238. 800ffe4: 2300 movs r3, #0
  28239. 800ffe6: e004 b.n 800fff2 <http_recv+0x17a>
  28240. ptr = (char*)(data + ContentLengthOffset);
  28241. while(*(ptr+i)!=0x0d)
  28242. {
  28243. sizestring[i] = *(ptr+i);
  28244. 800ffe8: f10d 0e08 add.w lr, sp, #8
  28245. 800ffec: f803 100e strb.w r1, [r3, lr]
  28246. i++;
  28247. 800fff0: 3301 adds r3, #1
  28248. /* read Content-Length value */
  28249. if (ContentLengthOffset)
  28250. {
  28251. i=0;
  28252. ptr = (char*)(data + ContentLengthOffset);
  28253. while(*(ptr+i)!=0x0d)
  28254. 800fff2: f81c 1003 ldrb.w r1, [ip, r3]
  28255. 800fff6: 290d cmp r1, #13
  28256. 800fff8: eb03 0e02 add.w lr, r3, r2
  28257. 800fffc: d1f4 bne.n 800ffe8 <http_recv+0x170>
  28258. 800fffe: f8c0 e000 str.w lr, [r0]
  28259. {
  28260. sizestring[i] = *(ptr+i);
  28261. i++;
  28262. ContentLengthOffset++;
  28263. }
  28264. if (i>0)
  28265. 8010002: 2b00 cmp r3, #0
  28266. 8010004: d0ea beq.n 800ffdc <http_recv+0x164>
  28267. {
  28268. /* transform string data into numeric format */
  28269. for(j=i-1;j>=0;j--)
  28270. 8010006: 3b01 subs r3, #1
  28271. * @param len : buffer length
  28272. * @retval size : Content_length in numeric format
  28273. */
  28274. static uint32_t Parse_Content_Length(char *data, uint32_t len)
  28275. {
  28276. uint32_t i=0,size=0, S=1;
  28277. 8010008: 2101 movs r1, #1
  28278. 801000a: 2200 movs r2, #0
  28279. {
  28280. /* transform string data into numeric format */
  28281. for(j=i-1;j>=0;j--)
  28282. {
  28283. size += (sizestring[j]-0x30)*S;
  28284. S=S*10;
  28285. 801000c: 200a movs r0, #10
  28286. 801000e: e009 b.n 8010024 <http_recv+0x1ac>
  28287. if (i>0)
  28288. {
  28289. /* transform string data into numeric format */
  28290. for(j=i-1;j>=0;j--)
  28291. {
  28292. size += (sizestring[j]-0x30)*S;
  28293. 8010010: f10d 0e08 add.w lr, sp, #8
  28294. 8010014: f813 e00e ldrb.w lr, [r3, lr]
  28295. 8010018: f1ae 0e30 sub.w lr, lr, #48 ; 0x30
  28296. 801001c: fb01 220e mla r2, r1, lr, r2
  28297. ContentLengthOffset++;
  28298. }
  28299. if (i>0)
  28300. {
  28301. /* transform string data into numeric format */
  28302. for(j=i-1;j>=0;j--)
  28303. 8010020: 3b01 subs r3, #1
  28304. {
  28305. size += (sizestring[j]-0x30)*S;
  28306. S=S*10;
  28307. 8010022: 4341 muls r1, r0
  28308. ContentLengthOffset++;
  28309. }
  28310. if (i>0)
  28311. {
  28312. /* transform string data into numeric format */
  28313. for(j=i-1;j>=0;j--)
  28314. 8010024: 2b00 cmp r3, #0
  28315. 8010026: daf3 bge.n 8010010 <http_recv+0x198>
  28316. {
  28317. BrowserFlag = 0;
  28318. TotalReceived = 0;
  28319. /* parse packet for Content-length field */
  28320. size = Parse_Content_Length(data, p->tot_len);
  28321. 8010028: 4b56 ldr r3, [pc, #344] ; (8010184 <http_recv+0x30c>)
  28322. /* parse packet for the octet-stream field */
  28323. for (i = 0; i < len; i++)
  28324. 801002a: f04f 0900 mov.w r9, #0
  28325. {
  28326. BrowserFlag = 0;
  28327. TotalReceived = 0;
  28328. /* parse packet for Content-length field */
  28329. size = Parse_Content_Length(data, p->tot_len);
  28330. 801002e: 601a str r2, [r3, #0]
  28331. /* parse packet for the octet-stream field */
  28332. for (i = 0; i < len; i++)
  28333. 8010030: e012 b.n 8010058 <http_recv+0x1e0>
  28334. {
  28335. if (strncmp ((char*)(data+i), octet_stream, 13)==0)
  28336. 8010032: eb06 0009 add.w r0, r6, r9
  28337. 8010036: 4954 ldr r1, [pc, #336] ; (8010188 <http_recv+0x310>)
  28338. 8010038: 220d movs r2, #13
  28339. 801003a: f7f9 fc4f bl 80098dc <strncmp>
  28340. 801003e: b948 cbnz r0, 8010054 <http_recv+0x1dc>
  28341. }
  28342. /* case of Mozilla Firefox v3.6 : we receive data in the POST packet*/
  28343. else
  28344. {
  28345. TotalReceived = len - (ContentLengthOffset + 4);
  28346. 8010040: 4b4e ldr r3, [pc, #312] ; (801017c <http_recv+0x304>)
  28347. 8010042: 681a ldr r2, [r3, #0]
  28348. 8010044: 4b4c ldr r3, [pc, #304] ; (8010178 <http_recv+0x300>)
  28349. 8010046: ebc2 0208 rsb r2, r2, r8
  28350. 801004a: 3a04 subs r2, #4
  28351. /* parse packet for the octet-stream field */
  28352. for (i = 0; i < len; i++)
  28353. {
  28354. if (strncmp ((char*)(data+i), octet_stream, 13)==0)
  28355. {
  28356. DataOffset = i + 16;
  28357. 801004c: f109 0a10 add.w sl, r9, #16
  28358. }
  28359. /* case of Mozilla Firefox v3.6 : we receive data in the POST packet*/
  28360. else
  28361. {
  28362. TotalReceived = len - (ContentLengthOffset + 4);
  28363. 8010050: 601a str r2, [r3, #0]
  28364. 8010052: e006 b.n 8010062 <http_recv+0x1ea>
  28365. /* parse packet for Content-length field */
  28366. size = Parse_Content_Length(data, p->tot_len);
  28367. /* parse packet for the octet-stream field */
  28368. for (i = 0; i < len; i++)
  28369. 8010054: f109 0901 add.w r9, r9, #1
  28370. 8010058: 45c1 cmp r9, r8
  28371. 801005a: dbea blt.n 8010032 <http_recv+0x1ba>
  28372. 801005c: e114 b.n 8010288 <http_recv+0x410>
  28373. if (fEraseFlash) {
  28374. FLASH_If_Erase(USER_FLASH_FIRST_PAGE_ADDRESS);
  28375. fEraseFlash = false;
  28376. }
  28377. DataOffset = 0;
  28378. 801005e: f04f 0a00 mov.w sl, #0
  28379. {
  28380. TotalReceived = len - (ContentLengthOffset + 4);
  28381. }
  28382. }
  28383. if (((DataFlag ==1)&&(BrowserFlag==1)) || ((DataFlag ==0)&&(BrowserFlag==0)))
  28384. 8010062: 4b42 ldr r3, [pc, #264] ; (801016c <http_recv+0x2f4>)
  28385. 8010064: 681a ldr r2, [r3, #0]
  28386. 8010066: 2a01 cmp r2, #1
  28387. 8010068: d103 bne.n 8010072 <http_recv+0x1fa>
  28388. 801006a: 4a42 ldr r2, [pc, #264] ; (8010174 <http_recv+0x2fc>)
  28389. 801006c: 6812 ldr r2, [r2, #0]
  28390. 801006e: 2a01 cmp r2, #1
  28391. 8010070: d008 beq.n 8010084 <http_recv+0x20c>
  28392. 8010072: 681b ldr r3, [r3, #0]
  28393. 8010074: 2b00 cmp r3, #0
  28394. 8010076: f040 80ae bne.w 80101d6 <http_recv+0x35e>
  28395. 801007a: 4b3e ldr r3, [pc, #248] ; (8010174 <http_recv+0x2fc>)
  28396. 801007c: 681b ldr r3, [r3, #0]
  28397. 801007e: 2b00 cmp r3, #0
  28398. 8010080: f040 80a9 bne.w 80101d6 <http_recv+0x35e>
  28399. {
  28400. if ((DataFlag ==0)&&(BrowserFlag==0))
  28401. 8010084: 4b39 ldr r3, [pc, #228] ; (801016c <http_recv+0x2f4>)
  28402. 8010086: 6819 ldr r1, [r3, #0]
  28403. 8010088: 461a mov r2, r3
  28404. 801008a: b919 cbnz r1, 8010094 <http_recv+0x21c>
  28405. 801008c: 4939 ldr r1, [pc, #228] ; (8010174 <http_recv+0x2fc>)
  28406. 801008e: 6809 ldr r1, [r1, #0]
  28407. 8010090: b901 cbnz r1, 8010094 <http_recv+0x21c>
  28408. 8010092: e01d b.n 80100d0 <http_recv+0x258>
  28409. {
  28410. DataFlag++;
  28411. }
  28412. else if ((DataFlag ==1)&&(BrowserFlag==1))
  28413. 8010094: 6813 ldr r3, [r2, #0]
  28414. 8010096: 2b01 cmp r3, #1
  28415. 8010098: d11d bne.n 80100d6 <http_recv+0x25e>
  28416. 801009a: 4b36 ldr r3, [pc, #216] ; (8010174 <http_recv+0x2fc>)
  28417. 801009c: 681b ldr r3, [r3, #0]
  28418. 801009e: 2b01 cmp r3, #1
  28419. 80100a0: d119 bne.n 80100d6 <http_recv+0x25e>
  28420. 80100a2: e00c b.n 80100be <http_recv+0x246>
  28421. {
  28422. /* parse packet for the octet-stream field */
  28423. for (i = 0; i < len; i++)
  28424. {
  28425. if (strncmp ((char*)(data+i), octet_stream, 13)==0)
  28426. 80100a4: eb06 0009 add.w r0, r6, r9
  28427. 80100a8: 4937 ldr r1, [pc, #220] ; (8010188 <http_recv+0x310>)
  28428. 80100aa: 220d movs r2, #13
  28429. 80100ac: f7f9 fc16 bl 80098dc <strncmp>
  28430. 80100b0: b910 cbnz r0, 80100b8 <http_recv+0x240>
  28431. {
  28432. DataOffset = i+16;
  28433. 80100b2: f109 0a10 add.w sl, r9, #16
  28434. break;
  28435. 80100b6: e006 b.n 80100c6 <http_recv+0x24e>
  28436. DataFlag++;
  28437. }
  28438. else if ((DataFlag ==1)&&(BrowserFlag==1))
  28439. {
  28440. /* parse packet for the octet-stream field */
  28441. for (i = 0; i < len; i++)
  28442. 80100b8: f109 0901 add.w r9, r9, #1
  28443. 80100bc: e001 b.n 80100c2 <http_recv+0x24a>
  28444. {
  28445. if ((DataFlag ==0)&&(BrowserFlag==0))
  28446. {
  28447. DataFlag++;
  28448. }
  28449. else if ((DataFlag ==1)&&(BrowserFlag==1))
  28450. 80100be: f04f 0900 mov.w r9, #0
  28451. {
  28452. /* parse packet for the octet-stream field */
  28453. for (i = 0; i < len; i++)
  28454. 80100c2: 45c1 cmp r9, r8
  28455. 80100c4: dbee blt.n 80100a4 <http_recv+0x22c>
  28456. {
  28457. DataOffset = i+16;
  28458. break;
  28459. }
  28460. }
  28461. TotalReceived += len;
  28462. 80100c6: 4b2c ldr r3, [pc, #176] ; (8010178 <http_recv+0x300>)
  28463. 80100c8: 681a ldr r2, [r3, #0]
  28464. 80100ca: 4442 add r2, r8
  28465. 80100cc: 601a str r2, [r3, #0]
  28466. DataFlag++;
  28467. 80100ce: 4b27 ldr r3, [pc, #156] ; (801016c <http_recv+0x2f4>)
  28468. 80100d0: 681a ldr r2, [r3, #0]
  28469. 80100d2: 3201 adds r2, #1
  28470. 80100d4: 601a str r2, [r3, #0]
  28471. }
  28472. /* parse packet for the filename field */
  28473. FilenameOffset = 0;
  28474. for (i = 0; i < len; i++)
  28475. 80100d6: f04f 0900 mov.w r9, #0
  28476. 80100da: e00b b.n 80100f4 <http_recv+0x27c>
  28477. * @param err: LwIP error code
  28478. * @retval err
  28479. */
  28480. /* goback.cgi - возврат в основную прошивку */
  28481. /* upload.cgi - загрузка новой прошивки */
  28482. static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
  28483. 80100dc: eb06 0b09 add.w fp, r6, r9
  28484. /* parse packet for the filename field */
  28485. FilenameOffset = 0;
  28486. for (i = 0; i < len; i++)
  28487. {
  28488. if (strncmp ((char*)(data+i), "filename=", 9)==0)
  28489. 80100e0: 4658 mov r0, fp
  28490. 80100e2: 492a ldr r1, [pc, #168] ; (801018c <http_recv+0x314>)
  28491. 80100e4: 2209 movs r2, #9
  28492. 80100e6: f7f9 fbf9 bl 80098dc <strncmp>
  28493. 80100ea: b908 cbnz r0, 80100f0 <http_recv+0x278>
  28494. 80100ec: 4603 mov r3, r0
  28495. 80100ee: e056 b.n 801019e <http_recv+0x326>
  28496. DataFlag++;
  28497. }
  28498. /* parse packet for the filename field */
  28499. FilenameOffset = 0;
  28500. for (i = 0; i < len; i++)
  28501. 80100f0: f109 0901 add.w r9, r9, #1
  28502. 80100f4: 45c1 cmp r9, r8
  28503. 80100f6: dbf1 blt.n 80100dc <http_recv+0x264>
  28504. filename[i] = 0x0;
  28505. }
  28506. if (i==0)
  28507. {
  28508. htmlpage = FileUploadPage;
  28509. 80100f8: 4b19 ldr r3, [pc, #100] ; (8010160 <http_recv+0x2e8>)
  28510. /* no filename, in this case reload upload page */
  28511. fs_open("/upload.html", &file);
  28512. 80100fa: 4825 ldr r0, [pc, #148] ; (8010190 <http_recv+0x318>)
  28513. filename[i] = 0x0;
  28514. }
  28515. if (i==0)
  28516. {
  28517. htmlpage = FileUploadPage;
  28518. 80100fc: 2201 movs r2, #1
  28519. /* no filename, in this case reload upload page */
  28520. fs_open("/upload.html", &file);
  28521. 80100fe: 4669 mov r1, sp
  28522. filename[i] = 0x0;
  28523. }
  28524. if (i==0)
  28525. {
  28526. htmlpage = FileUploadPage;
  28527. 8010100: 701a strb r2, [r3, #0]
  28528. /* no filename, in this case reload upload page */
  28529. fs_open("/upload.html", &file);
  28530. 8010102: f7ff fe55 bl 800fdb0 <fs_open>
  28531. hs->file = file.data;
  28532. 8010106: 9b00 ldr r3, [sp, #0]
  28533. 8010108: 6023 str r3, [r4, #0]
  28534. hs->left = file.len;
  28535. 801010a: 9b01 ldr r3, [sp, #4]
  28536. pbuf_free(p);
  28537. 801010c: 4638 mov r0, r7
  28538. {
  28539. htmlpage = FileUploadPage;
  28540. /* no filename, in this case reload upload page */
  28541. fs_open("/upload.html", &file);
  28542. hs->file = file.data;
  28543. hs->left = file.len;
  28544. 801010e: 6063 str r3, [r4, #4]
  28545. pbuf_free(p);
  28546. 8010110: f7fb f9d8 bl 800b4c4 <pbuf_free>
  28547. /* send index.html page */
  28548. send_data(pcb, hs);
  28549. 8010114: 4628 mov r0, r5
  28550. 8010116: 4621 mov r1, r4
  28551. 8010118: f7ff fe0a bl 800fd30 <send_data>
  28552. /* Tell TCP that we wish be to informed of data that has been
  28553. successfully sent by a call to the http_sent() function. */
  28554. tcp_sent(pcb, http_sent);
  28555. 801011c: 4628 mov r0, r5
  28556. 801011e: 490a ldr r1, [pc, #40] ; (8010148 <http_recv+0x2d0>)
  28557. 8010120: f7fb fc96 bl 800ba50 <tcp_sent>
  28558. DataFlag=0;
  28559. 8010124: 4b11 ldr r3, [pc, #68] ; (801016c <http_recv+0x2f4>)
  28560. 8010126: 2200 movs r2, #0
  28561. 8010128: 601a str r2, [r3, #0]
  28562. 801012a: e0bb b.n 80102a4 <http_recv+0x42c>
  28563. 801012c: 20006d80 .word 0x20006d80
  28564. 8010130: 2000869d .word 0x2000869d
  28565. 8010134: 08013564 .word 0x08013564
  28566. 8010138: 0801356a .word 0x0801356a
  28567. 801013c: 0801356e .word 0x0801356e
  28568. 8010140: 0801357a .word 0x0801357a
  28569. 8010144: 0801357e .word 0x0801357e
  28570. 8010148: 080102e5 .word 0x080102e5
  28571. 801014c: 08013589 .word 0x08013589
  28572. 8010150: e000ed00 .word 0xe000ed00
  28573. 8010154: 05fa0004 .word 0x05fa0004
  28574. 8010158: 08013599 .word 0x08013599
  28575. 801015c: 0801359d .word 0x0801359d
  28576. 8010160: 2000869c .word 0x2000869c
  28577. 8010164: 080135aa .word 0x080135aa
  28578. 8010168: 080135b6 .word 0x080135b6
  28579. 801016c: 20006d9c .word 0x20006d9c
  28580. 8010170: 08020000 .word 0x08020000
  28581. 8010174: 20006d98 .word 0x20006d98
  28582. 8010178: 20006da0 .word 0x20006da0
  28583. 801017c: 20006d88 .word 0x20006d88
  28584. 8010180: 08012231 .word 0x08012231
  28585. 8010184: 20006da4 .word 0x20006da4
  28586. 8010188: 080129a8 .word 0x080129a8
  28587. 801018c: 080135c7 .word 0x080135c7
  28588. 8010190: 080135d1 .word 0x080135d1
  28589. 8010194: 20000114 .word 0x20000114
  28590. i = 0;
  28591. if (FilenameOffset)
  28592. {
  28593. while((*(data+FilenameOffset + i)!=0x22 )&&(i<13))
  28594. {
  28595. filename[i] = *(data+FilenameOffset + i);
  28596. 8010198: a902 add r1, sp, #8
  28597. 801019a: 545a strb r2, [r3, r1]
  28598. i++;
  28599. 801019c: 3301 adds r3, #1
  28600. * @param err: LwIP error code
  28601. * @retval err
  28602. */
  28603. /* goback.cgi - возврат в основную прошивку */
  28604. /* upload.cgi - загрузка новой прошивки */
  28605. static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
  28606. 801019e: eb0b 0203 add.w r2, fp, r3
  28607. }
  28608. }
  28609. i = 0;
  28610. if (FilenameOffset)
  28611. {
  28612. while((*(data+FilenameOffset + i)!=0x22 )&&(i<13))
  28613. 80101a2: 7a92 ldrb r2, [r2, #10]
  28614. 80101a4: 2a22 cmp r2, #34 ; 0x22
  28615. 80101a6: d001 beq.n 80101ac <http_recv+0x334>
  28616. 80101a8: 2b0d cmp r3, #13
  28617. 80101aa: d1f5 bne.n 8010198 <http_recv+0x320>
  28618. {
  28619. filename[i] = *(data+FilenameOffset + i);
  28620. i++;
  28621. }
  28622. filename[i] = 0x0;
  28623. 80101ac: a906 add r1, sp, #24
  28624. 80101ae: 18ca adds r2, r1, r3
  28625. 80101b0: f04f 0900 mov.w r9, #0
  28626. 80101b4: f802 9c10 strb.w r9, [r2, #-16]
  28627. }
  28628. if (i==0)
  28629. 80101b8: 2b00 cmp r3, #0
  28630. 80101ba: d09d beq.n 80100f8 <http_recv+0x280>
  28631. return ERR_OK;
  28632. }
  28633. PRINT_USART("\n\r IAP using HTTP \n\r");
  28634. sprintf(debugMsg, "File: %s\n\r",filename);
  28635. 80101bc: aa02 add r2, sp, #8
  28636. 80101be: 493b ldr r1, [pc, #236] ; (80102ac <http_recv+0x434>)
  28637. 80101c0: 483b ldr r0, [pc, #236] ; (80102b0 <http_recv+0x438>)
  28638. 80101c2: f001 fa7d bl 80116c0 <tfp_sprintf>
  28639. PRINT_USART(debugMsg);
  28640. PRINT_USART("State: Erasing...\n\r");
  28641. TotalData =0 ;
  28642. 80101c6: 4b3b ldr r3, [pc, #236] ; (80102b4 <http_recv+0x43c>)
  28643. 80101c8: f8c3 9000 str.w r9, [r3]
  28644. /* init flash */
  28645. FLASH_If_Init();
  28646. 80101cc: f7ff fa3e bl 800f64c <FLASH_If_Init>
  28647. /* erase user flash area */
  28648. //FLASH_If_Erase(USER_FLASH_FIRST_PAGE_ADDRESS);
  28649. FlashWriteAddress = USER_FLASH_FIRST_PAGE_ADDRESS;
  28650. 80101d0: 4a39 ldr r2, [pc, #228] ; (80102b8 <http_recv+0x440>)
  28651. 80101d2: 4b3a ldr r3, [pc, #232] ; (80102bc <http_recv+0x444>)
  28652. 80101d4: e002 b.n 80101dc <http_recv+0x364>
  28653. PRINT_USART("\n\rState: Programming..\n\r");
  28654. }
  28655. /* DataFlag >1 => the packet is data only */
  28656. else
  28657. {
  28658. TotalReceived +=len;
  28659. 80101d6: 4b3a ldr r3, [pc, #232] ; (80102c0 <http_recv+0x448>)
  28660. 80101d8: 681a ldr r2, [r3, #0]
  28661. 80101da: 4442 add r2, r8
  28662. 80101dc: 601a str r2, [r3, #0]
  28663. ptr = (char*)(data + DataOffset);
  28664. len-= DataOffset;
  28665. /* update Total data received counter */
  28666. TotalData +=len;
  28667. 80101de: 4b35 ldr r3, [pc, #212] ; (80102b4 <http_recv+0x43c>)
  28668. 80101e0: 681a ldr r2, [r3, #0]
  28669. {
  28670. TotalReceived +=len;
  28671. }
  28672. ptr = (char*)(data + DataOffset);
  28673. len-= DataOffset;
  28674. 80101e2: ebca 0108 rsb r1, sl, r8
  28675. /* update Total data received counter */
  28676. TotalData +=len;
  28677. 80101e6: 188a adds r2, r1, r2
  28678. 80101e8: 601a str r2, [r3, #0]
  28679. /* check if last data packet */
  28680. if (TotalReceived == size)
  28681. 80101ea: 4b36 ldr r3, [pc, #216] ; (80102c4 <http_recv+0x44c>)
  28682. 80101ec: 4a34 ldr r2, [pc, #208] ; (80102c0 <http_recv+0x448>)
  28683. 80101ee: 681b ldr r3, [r3, #0]
  28684. 80101f0: 6812 ldr r2, [r2, #0]
  28685. 80101f2: 429a cmp r2, r3
  28686. else
  28687. {
  28688. TotalReceived +=len;
  28689. }
  28690. ptr = (char*)(data + DataOffset);
  28691. 80101f4: eb06 000a add.w r0, r6, sl
  28692. /* update Total data received counter */
  28693. TotalData +=len;
  28694. /* check if last data packet */
  28695. if (TotalReceived == size)
  28696. 80101f8: d13d bne.n 8010276 <http_recv+0x3fe>
  28697. }
  28698. len -= i;
  28699. TotalData -= i;
  28700. */
  28701. /* write data in Flash */
  28702. if (len)
  28703. 80101fa: b109 cbz r1, 8010200 <http_recv+0x388>
  28704. IAP_HTTP_writedata(ptr,len);
  28705. 80101fc: f7ff fdee bl 800fddc <IAP_HTTP_writedata>
  28706. DataFlag=0;
  28707. 8010200: 4b31 ldr r3, [pc, #196] ; (80102c8 <http_recv+0x450>)
  28708. htmlpage = UploadDonePage;
  28709. 8010202: 4e32 ldr r6, [pc, #200] ; (80102cc <http_recv+0x454>)
  28710. PRINT_USART("Tot bytes Received:\n\r");
  28711. sprintf(debugMsg, "%d bytes \n\r",TotalData);
  28712. 8010204: 4932 ldr r1, [pc, #200] ; (80102d0 <http_recv+0x458>)
  28713. 8010206: 482a ldr r0, [pc, #168] ; (80102b0 <http_recv+0x438>)
  28714. */
  28715. /* write data in Flash */
  28716. if (len)
  28717. IAP_HTTP_writedata(ptr,len);
  28718. DataFlag=0;
  28719. 8010208: 2200 movs r2, #0
  28720. 801020a: 601a str r2, [r3, #0]
  28721. htmlpage = UploadDonePage;
  28722. PRINT_USART("Tot bytes Received:\n\r");
  28723. sprintf(debugMsg, "%d bytes \n\r",TotalData);
  28724. 801020c: 4b29 ldr r3, [pc, #164] ; (80102b4 <http_recv+0x43c>)
  28725. /* write data in Flash */
  28726. if (len)
  28727. IAP_HTTP_writedata(ptr,len);
  28728. DataFlag=0;
  28729. htmlpage = UploadDonePage;
  28730. 801020e: f04f 0802 mov.w r8, #2
  28731. PRINT_USART("Tot bytes Received:\n\r");
  28732. sprintf(debugMsg, "%d bytes \n\r",TotalData);
  28733. 8010212: 681a ldr r2, [r3, #0]
  28734. /* write data in Flash */
  28735. if (len)
  28736. IAP_HTTP_writedata(ptr,len);
  28737. DataFlag=0;
  28738. htmlpage = UploadDonePage;
  28739. 8010214: f886 8000 strb.w r8, [r6]
  28740. PRINT_USART("Tot bytes Received:\n\r");
  28741. sprintf(debugMsg, "%d bytes \n\r",TotalData);
  28742. 8010218: f001 fa52 bl 80116c0 <tfp_sprintf>
  28743. PRINT_USART(debugMsg);
  28744. PRINT_USART("State: Prog Finished \n\r");
  28745. /* Проверяем CRC */
  28746. if (CRC_Read() == CRC_Calcucate()) {
  28747. 801021c: f7ff f9fc bl 800f618 <CRC_Read>
  28748. 8010220: 4681 mov r9, r0
  28749. 8010222: f7ff f9ff bl 800f624 <CRC_Calcucate>
  28750. 8010226: 4581 cmp r9, r0
  28751. 8010228: d112 bne.n 8010250 <http_recv+0x3d8>
  28752. fs_open("/success.html", &file);
  28753. 801022a: 4669 mov r1, sp
  28754. 801022c: 4829 ldr r0, [pc, #164] ; (80102d4 <http_recv+0x45c>)
  28755. 801022e: f7ff fdbf bl 800fdb0 <fs_open>
  28756. hs->file = file.data;
  28757. 8010232: 9b00 ldr r3, [sp, #0]
  28758. 8010234: 6023 str r3, [r4, #0]
  28759. hs->left = file.len;
  28760. 8010236: 9b01 ldr r3, [sp, #4]
  28761. send_data(pcb, hs);
  28762. 8010238: 4628 mov r0, r5
  28763. /* Проверяем CRC */
  28764. if (CRC_Read() == CRC_Calcucate()) {
  28765. fs_open("/success.html", &file);
  28766. hs->file = file.data;
  28767. hs->left = file.len;
  28768. 801023a: 6063 str r3, [r4, #4]
  28769. send_data(pcb, hs);
  28770. 801023c: 4621 mov r1, r4
  28771. 801023e: f7ff fd77 bl 800fd30 <send_data>
  28772. tcp_sent(pcb, http_sent);
  28773. 8010242: 4628 mov r0, r5
  28774. 8010244: 4924 ldr r1, [pc, #144] ; (80102d8 <http_recv+0x460>)
  28775. 8010246: f7fb fc03 bl 800ba50 <tcp_sent>
  28776. htmlpage = UploadDonePage;
  28777. 801024a: f886 8000 strb.w r8, [r6]
  28778. 801024e: e022 b.n 8010296 <http_recv+0x41e>
  28779. }
  28780. else
  28781. {
  28782. fs_open("/error.html", &file);
  28783. 8010250: 4669 mov r1, sp
  28784. 8010252: 4822 ldr r0, [pc, #136] ; (80102dc <http_recv+0x464>)
  28785. 8010254: f7ff fdac bl 800fdb0 <fs_open>
  28786. hs->file = file.data;
  28787. 8010258: 9b00 ldr r3, [sp, #0]
  28788. 801025a: 6023 str r3, [r4, #0]
  28789. hs->left = file.len;
  28790. 801025c: 9b01 ldr r3, [sp, #4]
  28791. send_data(pcb, hs);
  28792. 801025e: 4628 mov r0, r5
  28793. else
  28794. {
  28795. fs_open("/error.html", &file);
  28796. hs->file = file.data;
  28797. hs->left = file.len;
  28798. 8010260: 6063 str r3, [r4, #4]
  28799. send_data(pcb, hs);
  28800. 8010262: 4621 mov r1, r4
  28801. 8010264: f7ff fd64 bl 800fd30 <send_data>
  28802. tcp_sent(pcb, http_sent);
  28803. 8010268: 4628 mov r0, r5
  28804. 801026a: 491b ldr r1, [pc, #108] ; (80102d8 <http_recv+0x460>)
  28805. 801026c: f7fb fbf0 bl 800ba50 <tcp_sent>
  28806. htmlpage = UploadErrorPage;
  28807. 8010270: 2303 movs r3, #3
  28808. 8010272: 7033 strb r3, [r6, #0]
  28809. 8010274: e00f b.n 8010296 <http_recv+0x41e>
  28810. }
  28811. /* not last data packet */
  28812. else
  28813. {
  28814. /* write data in flash */
  28815. if(len)
  28816. 8010276: b171 cbz r1, 8010296 <http_recv+0x41e>
  28817. IAP_HTTP_writedata(ptr,len);
  28818. 8010278: f7ff fdb0 bl 800fddc <IAP_HTTP_writedata>
  28819. 801027c: e00b b.n 8010296 <http_recv+0x41e>
  28820. else
  28821. {
  28822. /* Bad HTTP requests */
  28823. PRINT_USART("Bad HTTP request\n\r");
  28824. pbuf_free(p);
  28825. 801027e: 4638 mov r0, r7
  28826. 8010280: f7fb f920 bl 800b4c4 <pbuf_free>
  28827. close_conn(pcb, hs);
  28828. 8010284: 4628 mov r0, r5
  28829. 8010286: e00a b.n 801029e <http_recv+0x426>
  28830. }
  28831. }
  28832. /* case of MSIE8 : we do not receive data in the POST packet*/
  28833. if (DataOffset == 0)
  28834. {
  28835. DataFlag++;
  28836. 8010288: 4b0f ldr r3, [pc, #60] ; (80102c8 <http_recv+0x450>)
  28837. 801028a: 681a ldr r2, [r3, #0]
  28838. 801028c: 3201 adds r2, #1
  28839. 801028e: 601a str r2, [r3, #0]
  28840. BrowserFlag = 1;
  28841. 8010290: 4b13 ldr r3, [pc, #76] ; (80102e0 <http_recv+0x468>)
  28842. 8010292: 2201 movs r2, #1
  28843. 8010294: 601a str r2, [r3, #0]
  28844. pbuf_free(p);
  28845. 8010296: 4638 mov r0, r7
  28846. 8010298: f7fb f914 bl 800b4c4 <pbuf_free>
  28847. 801029c: e002 b.n 80102a4 <http_recv+0x42c>
  28848. if (err == ERR_OK && p == NULL)
  28849. {
  28850. /* received empty frame */
  28851. PRINT_USART("Received empty frame\n\r");
  28852. close_conn(pcb, hs);
  28853. 801029e: 4621 mov r1, r4
  28854. 80102a0: f7ff fd6a bl 800fd78 <close_conn>
  28855. }
  28856. return ERR_OK;
  28857. }
  28858. 80102a4: 2000 movs r0, #0
  28859. 80102a6: b007 add sp, #28
  28860. 80102a8: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  28861. 80102ac: 080135de .word 0x080135de
  28862. 80102b0: 20008674 .word 0x20008674
  28863. 80102b4: 20006d8c .word 0x20006d8c
  28864. 80102b8: 08020000 .word 0x08020000
  28865. 80102bc: 20006d90 .word 0x20006d90
  28866. 80102c0: 20006da0 .word 0x20006da0
  28867. 80102c4: 20006da4 .word 0x20006da4
  28868. 80102c8: 20006d9c .word 0x20006d9c
  28869. 80102cc: 2000869c .word 0x2000869c
  28870. 80102d0: 080135e9 .word 0x080135e9
  28871. 80102d4: 080135f5 .word 0x080135f5
  28872. 80102d8: 080102e5 .word 0x080102e5
  28873. 80102dc: 08013603 .word 0x08013603
  28874. 80102e0: 20006d98 .word 0x20006d98
  28875. 080102e4 <http_sent>:
  28876. * @param pcb: pointer on tcp_pcb structure
  28877. * @param len
  28878. * @retval err : LwIP error code
  28879. */
  28880. static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
  28881. {
  28882. 80102e4: b508 push {r3, lr}
  28883. 80102e6: 4603 mov r3, r0
  28884. 80102e8: 4608 mov r0, r1
  28885. struct http_state *hs;
  28886. hs = arg;
  28887. if (hs->left > 0)
  28888. 80102ea: 685a ldr r2, [r3, #4]
  28889. send_data(pcb, hs);
  28890. 80102ec: 4619 mov r1, r3
  28891. static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
  28892. {
  28893. struct http_state *hs;
  28894. hs = arg;
  28895. if (hs->left > 0)
  28896. 80102ee: b112 cbz r2, 80102f6 <http_sent+0x12>
  28897. send_data(pcb, hs);
  28898. 80102f0: f7ff fd1e bl 800fd30 <send_data>
  28899. 80102f4: e00d b.n 8010312 <http_sent+0x2e>
  28900. else
  28901. {
  28902. close_conn(pcb, hs);
  28903. 80102f6: f7ff fd3f bl 800fd78 <close_conn>
  28904. if (htmlpage == UploadDonePage)
  28905. 80102fa: 4b07 ldr r3, [pc, #28] ; (8010318 <http_sent+0x34>)
  28906. 80102fc: 781b ldrb r3, [r3, #0]
  28907. 80102fe: 2b02 cmp r3, #2
  28908. 8010300: d102 bne.n 8010308 <http_sent+0x24>
  28909. fDoneReset = 1;
  28910. 8010302: 2201 movs r2, #1
  28911. 8010304: 4b05 ldr r3, [pc, #20] ; (801031c <http_sent+0x38>)
  28912. 8010306: e003 b.n 8010310 <http_sent+0x2c>
  28913. else if (htmlpage == UploadErrorPage)
  28914. 8010308: 2b03 cmp r3, #3
  28915. 801030a: d102 bne.n 8010312 <http_sent+0x2e>
  28916. fErrorReset = 1;
  28917. 801030c: 4b04 ldr r3, [pc, #16] ; (8010320 <http_sent+0x3c>)
  28918. 801030e: 2201 movs r2, #1
  28919. 8010310: 701a strb r2, [r3, #0]
  28920. }
  28921. return ERR_OK;
  28922. }
  28923. 8010312: 2000 movs r0, #0
  28924. 8010314: bd08 pop {r3, pc}
  28925. 8010316: bf00 nop
  28926. 8010318: 2000869c .word 0x2000869c
  28927. 801031c: 20006dbc .word 0x20006dbc
  28928. 8010320: 20006dbb .word 0x20006dbb
  28929. 08010324 <IAP_httpd_init>:
  28930. * @brief intialize HTTP webserver
  28931. * @param none
  28932. * @retval none
  28933. */
  28934. void IAP_httpd_init(void)
  28935. {
  28936. 8010324: b510 push {r4, lr}
  28937. struct tcp_pcb *pcb;
  28938. /*create new pcb*/
  28939. pcb = tcp_new();
  28940. 8010326: f7fb fe47 bl 800bfb8 <tcp_new>
  28941. /* bind HTTP traffic to pcb */
  28942. tcp_bind(pcb, IP_ADDR_ANY, 80);
  28943. 801032a: 2250 movs r2, #80 ; 0x50
  28944. */
  28945. void IAP_httpd_init(void)
  28946. {
  28947. struct tcp_pcb *pcb;
  28948. /*create new pcb*/
  28949. pcb = tcp_new();
  28950. 801032c: 4604 mov r4, r0
  28951. /* bind HTTP traffic to pcb */
  28952. tcp_bind(pcb, IP_ADDR_ANY, 80);
  28953. 801032e: 4906 ldr r1, [pc, #24] ; (8010348 <IAP_httpd_init+0x24>)
  28954. 8010330: f7fb fab6 bl 800b8a0 <tcp_bind>
  28955. /* start listening on port 80 */
  28956. pcb = tcp_listen(pcb);
  28957. 8010334: 21ff movs r1, #255 ; 0xff
  28958. 8010336: 4620 mov r0, r4
  28959. 8010338: f7fb faea bl 800b910 <tcp_listen_with_backlog>
  28960. /* define callback function for TCP connection setup */
  28961. tcp_accept(pcb, http_accept);
  28962. 801033c: 4903 ldr r1, [pc, #12] ; (801034c <IAP_httpd_init+0x28>)
  28963. }
  28964. 801033e: e8bd 4010 ldmia.w sp!, {r4, lr}
  28965. /* bind HTTP traffic to pcb */
  28966. tcp_bind(pcb, IP_ADDR_ANY, 80);
  28967. /* start listening on port 80 */
  28968. pcb = tcp_listen(pcb);
  28969. /* define callback function for TCP connection setup */
  28970. tcp_accept(pcb, http_accept);
  28971. 8010342: f7fb bb8a b.w 800ba5a <tcp_accept>
  28972. 8010346: bf00 nop
  28973. 8010348: 08011880 .word 0x08011880
  28974. 801034c: 0800fce5 .word 0x0800fce5
  28975. 08010350 <LwIP_Init>:
  28976. * @brief Initializes the lwIP stack
  28977. * @param None
  28978. * @retval None
  28979. */
  28980. void LwIP_Init(void)
  28981. {
  28982. 8010350: b510 push {r4, lr}
  28983. // mem_init();
  28984. //
  28985. // /* Initializes the memory pools defined by MEMP_NUM_x.*/
  28986. // memp_init();
  28987. if (sSettings.sWebParams.dhcpEnable)
  28988. 8010352: 4c1a ldr r4, [pc, #104] ; (80103bc <LwIP_Init+0x6c>)
  28989. * @brief Initializes the lwIP stack
  28990. * @param None
  28991. * @retval None
  28992. */
  28993. void LwIP_Init(void)
  28994. {
  28995. 8010354: b08c sub sp, #48 ; 0x30
  28996. struct ip_addr ipaddr;
  28997. struct ip_addr netmask;
  28998. struct ip_addr gw;
  28999. char str[20];
  29000. lwip_init();
  29001. 8010356: f7fa fddf bl 800af18 <lwip_init>
  29002. // mem_init();
  29003. //
  29004. // /* Initializes the memory pools defined by MEMP_NUM_x.*/
  29005. // memp_init();
  29006. if (sSettings.sWebParams.dhcpEnable)
  29007. 801035a: f894 302f ldrb.w r3, [r4, #47] ; 0x2f
  29008. 801035e: b123 cbz r3, 801036a <LwIP_Init+0x1a>
  29009. {
  29010. ipaddr.addr = 0;
  29011. 8010360: 2300 movs r3, #0
  29012. 8010362: 9304 str r3, [sp, #16]
  29013. netmask.addr = 0;
  29014. 8010364: 9305 str r3, [sp, #20]
  29015. gw.addr = 0;
  29016. 8010366: 9306 str r3, [sp, #24]
  29017. 8010368: e013 b.n 8010392 <LwIP_Init+0x42>
  29018. }
  29019. else
  29020. {
  29021. sprintf(str, " %s\n\r", sSettings.sWebTempParams.ip);
  29022. 801036a: 4915 ldr r1, [pc, #84] ; (80103c0 <LwIP_Init+0x70>)
  29023. 801036c: f104 0230 add.w r2, r4, #48 ; 0x30
  29024. 8010370: a807 add r0, sp, #28
  29025. 8010372: f001 f9a5 bl 80116c0 <tfp_sprintf>
  29026. PRINT_USART("\n\rStatic IP address \n\r");
  29027. PRINT_USART(str);
  29028. ipaddr.addr = ipaddr_addr(sSettings.sWebParams.ip);
  29029. 8010376: 1ca0 adds r0, r4, #2
  29030. 8010378: f7fe f89a bl 800e4b0 <ipaddr_addr>
  29031. 801037c: 9004 str r0, [sp, #16]
  29032. netmask.addr = ipaddr_addr(sSettings.sWebParams.mask);
  29033. 801037e: f104 0020 add.w r0, r4, #32
  29034. 8010382: f7fe f895 bl 800e4b0 <ipaddr_addr>
  29035. 8010386: 9005 str r0, [sp, #20]
  29036. gw.addr = ipaddr_addr(sSettings.sWebParams.gate);
  29037. 8010388: f104 0011 add.w r0, r4, #17
  29038. 801038c: f7fe f890 bl 800e4b0 <ipaddr_addr>
  29039. 8010390: 9006 str r0, [sp, #24]
  29040. }
  29041. netif_add(&netif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &ethernet_input);
  29042. 8010392: 2300 movs r3, #0
  29043. 8010394: 9300 str r3, [sp, #0]
  29044. 8010396: 4b0b ldr r3, [pc, #44] ; (80103c4 <LwIP_Init+0x74>)
  29045. 8010398: 480b ldr r0, [pc, #44] ; (80103c8 <LwIP_Init+0x78>)
  29046. 801039a: 9301 str r3, [sp, #4]
  29047. 801039c: 4b0b ldr r3, [pc, #44] ; (80103cc <LwIP_Init+0x7c>)
  29048. 801039e: a904 add r1, sp, #16
  29049. 80103a0: 9302 str r3, [sp, #8]
  29050. 80103a2: aa05 add r2, sp, #20
  29051. 80103a4: ab06 add r3, sp, #24
  29052. 80103a6: f7fa ffe7 bl 800b378 <netif_add>
  29053. netif_set_default(&netif);
  29054. 80103aa: 4807 ldr r0, [pc, #28] ; (80103c8 <LwIP_Init+0x78>)
  29055. 80103ac: f7fb f812 bl 800b3d4 <netif_set_default>
  29056. netif_set_up(&netif);
  29057. 80103b0: 4805 ldr r0, [pc, #20] ; (80103c8 <LwIP_Init+0x78>)
  29058. 80103b2: f7fb f815 bl 800b3e0 <netif_set_up>
  29059. }
  29060. 80103b6: b00c add sp, #48 ; 0x30
  29061. 80103b8: bd10 pop {r4, pc}
  29062. 80103ba: bf00 nop
  29063. 80103bc: 2000838c .word 0x2000838c
  29064. 80103c0: 080135e3 .word 0x080135e3
  29065. 80103c4: 0800f549 .word 0x0800f549
  29066. 80103c8: 20008c7c .word 0x20008c7c
  29067. 80103cc: 0800f255 .word 0x0800f255
  29068. 080103d0 <LwIP_Pkt_Handle>:
  29069. * @retval None
  29070. */
  29071. void LwIP_Pkt_Handle(void)
  29072. {
  29073. /* Read a received packet from the Ethernet buffers and send it to the lwIP for handling */
  29074. ethernetif_input(&netif);
  29075. 80103d0: 4801 ldr r0, [pc, #4] ; (80103d8 <LwIP_Pkt_Handle+0x8>)
  29076. 80103d2: f7ff b86b b.w 800f4ac <ethernetif_input>
  29077. 80103d6: bf00 nop
  29078. 80103d8: 20008c7c .word 0x20008c7c
  29079. 080103dc <LwIP_DHCP_Process_Handle>:
  29080. * @brief LwIP_DHCP_Process_Handle
  29081. * @param None
  29082. * @retval None
  29083. */
  29084. void LwIP_DHCP_Process_Handle()
  29085. {
  29086. 80103dc: b530 push {r4, r5, lr}
  29087. struct ip_addr ipaddr;
  29088. struct ip_addr netmask;
  29089. struct ip_addr gw;
  29090. switch (DHCP_state)
  29091. 80103de: 4d1c ldr r5, [pc, #112] ; (8010450 <LwIP_DHCP_Process_Handle+0x74>)
  29092. 80103e0: 782b ldrb r3, [r5, #0]
  29093. * @brief LwIP_DHCP_Process_Handle
  29094. * @param None
  29095. * @retval None
  29096. */
  29097. void LwIP_DHCP_Process_Handle()
  29098. {
  29099. 80103e2: b085 sub sp, #20
  29100. struct ip_addr ipaddr;
  29101. struct ip_addr netmask;
  29102. struct ip_addr gw;
  29103. switch (DHCP_state)
  29104. 80103e4: b113 cbz r3, 80103ec <LwIP_DHCP_Process_Handle+0x10>
  29105. 80103e6: 2b01 cmp r3, #1
  29106. 80103e8: d12f bne.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
  29107. 80103ea: e005 b.n 80103f8 <LwIP_DHCP_Process_Handle+0x1c>
  29108. {
  29109. case DHCP_START:
  29110. {
  29111. dhcp_start(&netif);
  29112. 80103ec: 4819 ldr r0, [pc, #100] ; (8010454 <LwIP_DHCP_Process_Handle+0x78>)
  29113. 80103ee: f7fa fd3f bl 800ae70 <dhcp_start>
  29114. DHCP_state = DHCP_WAIT_ADDRESS;
  29115. 80103f2: 2301 movs r3, #1
  29116. 80103f4: 702b strb r3, [r5, #0]
  29117. PRINT_USART("\n\rLooking for DHCP server please wait...\n\r");
  29118. }
  29119. break;
  29120. 80103f6: e028 b.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
  29121. case DHCP_WAIT_ADDRESS:
  29122. {
  29123. ipaddr = netif.ip_addr;
  29124. 80103f8: 4c16 ldr r4, [pc, #88] ; (8010454 <LwIP_DHCP_Process_Handle+0x78>)
  29125. netmask = netif.netmask;
  29126. 80103fa: 68a2 ldr r2, [r4, #8]
  29127. }
  29128. break;
  29129. case DHCP_WAIT_ADDRESS:
  29130. {
  29131. ipaddr = netif.ip_addr;
  29132. 80103fc: 6863 ldr r3, [r4, #4]
  29133. netmask = netif.netmask;
  29134. 80103fe: 9202 str r2, [sp, #8]
  29135. gw = netif.gw;
  29136. 8010400: 68e2 ldr r2, [r4, #12]
  29137. }
  29138. break;
  29139. case DHCP_WAIT_ADDRESS:
  29140. {
  29141. ipaddr = netif.ip_addr;
  29142. 8010402: 9301 str r3, [sp, #4]
  29143. netmask = netif.netmask;
  29144. gw = netif.gw;
  29145. 8010404: 9203 str r2, [sp, #12]
  29146. if (ipaddr.addr != 0)
  29147. 8010406: b12b cbz r3, 8010414 <LwIP_DHCP_Process_Handle+0x38>
  29148. {
  29149. DHCP_state = DHCP_ADDRESS_ASSIGNED;
  29150. 8010408: 2302 movs r3, #2
  29151. /* Stop DHCP */
  29152. dhcp_stop(&netif);
  29153. 801040a: 4620 mov r0, r4
  29154. netmask = netif.netmask;
  29155. gw = netif.gw;
  29156. if (ipaddr.addr != 0)
  29157. {
  29158. DHCP_state = DHCP_ADDRESS_ASSIGNED;
  29159. 801040c: 702b strb r3, [r5, #0]
  29160. /* Stop DHCP */
  29161. dhcp_stop(&netif);
  29162. 801040e: f7fa fd17 bl 800ae40 <dhcp_stop>
  29163. 8010412: e01a b.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
  29164. PRINT_USART(ipaddr_ntoa(&gw));
  29165. PRINT_USART("\n\r");
  29166. } else {
  29167. /* DHCP timeout */
  29168. if (netif.dhcp->tries > MAX_DHCP_TRIES)
  29169. 8010414: 6a23 ldr r3, [r4, #32]
  29170. 8010416: 7b5b ldrb r3, [r3, #13]
  29171. 8010418: 2b04 cmp r3, #4
  29172. 801041a: d916 bls.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
  29173. {
  29174. DHCP_state = DHCP_TIMEOUT;
  29175. 801041c: 2303 movs r3, #3
  29176. /* Stop DHCP */
  29177. dhcp_stop(&netif);
  29178. 801041e: 4620 mov r0, r4
  29179. } else {
  29180. /* DHCP timeout */
  29181. if (netif.dhcp->tries > MAX_DHCP_TRIES)
  29182. {
  29183. DHCP_state = DHCP_TIMEOUT;
  29184. 8010420: 702b strb r3, [r5, #0]
  29185. /* Stop DHCP */
  29186. dhcp_stop(&netif);
  29187. 8010422: f7fa fd0d bl 800ae40 <dhcp_stop>
  29188. // ipaddr.addr = ipaddr_addr(sSettings.sWebTempParams.ip);
  29189. // netmask.addr = ipaddr_addr(sSettings.sWebTempParams.mask);
  29190. // gw.addr = ipaddr_addr(sSettings.sWebTempParams.gate);
  29191. ipaddr.addr = ipaddr_addr("192.168.14.48");
  29192. 8010426: 480c ldr r0, [pc, #48] ; (8010458 <LwIP_DHCP_Process_Handle+0x7c>)
  29193. 8010428: f7fe f842 bl 800e4b0 <ipaddr_addr>
  29194. 801042c: 9001 str r0, [sp, #4]
  29195. netmask.addr = ipaddr_addr("255.255.255.0");
  29196. 801042e: 480b ldr r0, [pc, #44] ; (801045c <LwIP_DHCP_Process_Handle+0x80>)
  29197. 8010430: f7fe f83e bl 800e4b0 <ipaddr_addr>
  29198. 8010434: 9002 str r0, [sp, #8]
  29199. gw.addr = ipaddr_addr("192.168.14.1");
  29200. 8010436: 480a ldr r0, [pc, #40] ; (8010460 <LwIP_DHCP_Process_Handle+0x84>)
  29201. 8010438: f7fe f83a bl 800e4b0 <ipaddr_addr>
  29202. netif_set_addr(&netif, &ipaddr , &netmask, &gw);
  29203. 801043c: a901 add r1, sp, #4
  29204. // netmask.addr = ipaddr_addr(sSettings.sWebTempParams.mask);
  29205. // gw.addr = ipaddr_addr(sSettings.sWebTempParams.gate);
  29206. ipaddr.addr = ipaddr_addr("192.168.14.48");
  29207. netmask.addr = ipaddr_addr("255.255.255.0");
  29208. gw.addr = ipaddr_addr("192.168.14.1");
  29209. 801043e: 9003 str r0, [sp, #12]
  29210. netif_set_addr(&netif, &ipaddr , &netmask, &gw);
  29211. 8010440: aa02 add r2, sp, #8
  29212. 8010442: 4620 mov r0, r4
  29213. 8010444: ab03 add r3, sp, #12
  29214. 8010446: f7fa ff89 bl 800b35c <netif_set_addr>
  29215. }
  29216. }
  29217. break;
  29218. default: break;
  29219. }
  29220. }
  29221. 801044a: b005 add sp, #20
  29222. 801044c: bd30 pop {r4, r5, pc}
  29223. 801044e: bf00 nop
  29224. 8010450: 20006da8 .word 0x20006da8
  29225. 8010454: 20008c7c .word 0x20008c7c
  29226. 8010458: 08013624 .word 0x08013624
  29227. 801045c: 080118a8 .word 0x080118a8
  29228. 8010460: 08013632 .word 0x08013632
  29229. 08010464 <LwIP_Periodic_Handle>:
  29230. * @brief LwIP periodic tasks
  29231. * @param localtime the current LocalTime value
  29232. * @retval None
  29233. */
  29234. void LwIP_Periodic_Handle(__IO uint32_t localtime)
  29235. {
  29236. 8010464: b507 push {r0, r1, r2, lr}
  29237. if (sSettings.sWebParams.dhcpEnable)
  29238. 8010466: 4b08 ldr r3, [pc, #32] ; (8010488 <LwIP_Periodic_Handle+0x24>)
  29239. * @brief LwIP periodic tasks
  29240. * @param localtime the current LocalTime value
  29241. * @retval None
  29242. */
  29243. void LwIP_Periodic_Handle(__IO uint32_t localtime)
  29244. {
  29245. 8010468: 9001 str r0, [sp, #4]
  29246. if (sSettings.sWebParams.dhcpEnable)
  29247. 801046a: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
  29248. 801046e: b133 cbz r3, 801047e <LwIP_Periodic_Handle+0x1a>
  29249. {
  29250. /* Fine DHCP periodic process every 500ms */
  29251. if ((DHCP_state != DHCP_ADDRESS_ASSIGNED)&&(DHCP_state != DHCP_TIMEOUT)) {
  29252. 8010470: 4b06 ldr r3, [pc, #24] ; (801048c <LwIP_Periodic_Handle+0x28>)
  29253. 8010472: 781b ldrb r3, [r3, #0]
  29254. 8010474: 3b02 subs r3, #2
  29255. 8010476: 2b01 cmp r3, #1
  29256. 8010478: d901 bls.n 801047e <LwIP_Periodic_Handle+0x1a>
  29257. /* process DHCP state machine */
  29258. LwIP_DHCP_Process_Handle();
  29259. 801047a: f7ff ffaf bl 80103dc <LwIP_DHCP_Process_Handle>
  29260. }
  29261. }
  29262. sys_check_timeouts();
  29263. }
  29264. 801047e: b003 add sp, #12
  29265. 8010480: f85d eb04 ldr.w lr, [sp], #4
  29266. /* process DHCP state machine */
  29267. LwIP_DHCP_Process_Handle();
  29268. }
  29269. }
  29270. sys_check_timeouts();
  29271. 8010484: f7fd bc0e b.w 800dca4 <sys_check_timeouts>
  29272. 8010488: 2000838c .word 0x2000838c
  29273. 801048c: 20006da8 .word 0x20006da8
  29274. 08010490 <ETH_BSP_Config>:
  29275. * @brief ETH_BSP_Config
  29276. * @param None
  29277. * @retval None
  29278. */
  29279. void ETH_BSP_Config(void)
  29280. {
  29281. 8010490: b570 push {r4, r5, r6, lr}
  29282. {
  29283. volatile uint32_t i;
  29284. GPIO_InitTypeDef GPIO_InitStructure;
  29285. /* Enable GPIOs clocks */
  29286. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB
  29287. 8010492: 2007 movs r0, #7
  29288. * @brief ETH_BSP_Config
  29289. * @param None
  29290. * @retval None
  29291. */
  29292. void ETH_BSP_Config(void)
  29293. {
  29294. 8010494: b0b2 sub sp, #200 ; 0xc8
  29295. {
  29296. volatile uint32_t i;
  29297. GPIO_InitTypeDef GPIO_InitStructure;
  29298. /* Enable GPIOs clocks */
  29299. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB
  29300. 8010496: 2101 movs r1, #1
  29301. 8010498: f7f9 fd7c bl 8009f94 <RCC_AHB1PeriphClockCmd>
  29302. | RCC_AHB1Periph_GPIOC, ENABLE);
  29303. /* Enable SYSCFG clock */
  29304. RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  29305. 801049c: 2101 movs r1, #1
  29306. 801049e: f44f 4080 mov.w r0, #16384 ; 0x4000
  29307. 80104a2: f7f9 fd8f bl 8009fc4 <RCC_APB2PeriphClockCmd>
  29308. /* MII/RMII Media interface selection --------------------------------------*/
  29309. SYSCFG_ETH_MediaInterfaceConfig(SYSCFG_ETH_MediaInterface_RMII);
  29310. 80104a6: 2001 movs r0, #1
  29311. 80104a8: f7f9 fdc4 bl 800a034 <SYSCFG_ETH_MediaInterfaceConfig>
  29312. ETH_RST_PIN -------> PE2 - замена на PE13
  29313. */
  29314. /* Configure PA1,PA2 and PA7 */
  29315. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  29316. 80104ac: 2386 movs r3, #134 ; 0x86
  29317. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  29318. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  29319. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29320. 80104ae: 2400 movs r4, #0
  29321. */
  29322. /* Configure PA1,PA2 and PA7 */
  29323. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  29324. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  29325. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  29326. 80104b0: 2502 movs r5, #2
  29327. ETH_RST_PIN -------> PE2 - замена на PE13
  29328. */
  29329. /* Configure PA1,PA2 and PA7 */
  29330. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  29331. 80104b2: 9301 str r3, [sp, #4]
  29332. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  29333. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  29334. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29335. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
  29336. GPIO_Init(GPIOA, &GPIO_InitStructure);
  29337. 80104b4: 485c ldr r0, [pc, #368] ; (8010628 <ETH_BSP_Config+0x198>)
  29338. */
  29339. /* Configure PA1,PA2 and PA7 */
  29340. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  29341. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  29342. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  29343. 80104b6: f88d 5008 strb.w r5, [sp, #8]
  29344. */
  29345. /* Configure PA1,PA2 and PA7 */
  29346. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  29347. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  29348. 80104ba: 2303 movs r3, #3
  29349. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  29350. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29351. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
  29352. GPIO_Init(GPIOA, &GPIO_InitStructure);
  29353. 80104bc: a901 add r1, sp, #4
  29354. */
  29355. /* Configure PA1,PA2 and PA7 */
  29356. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  29357. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  29358. 80104be: f88d 3009 strb.w r3, [sp, #9]
  29359. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  29360. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29361. 80104c2: f88d 400a strb.w r4, [sp, #10]
  29362. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
  29363. 80104c6: f88d 400b strb.w r4, [sp, #11]
  29364. GPIO_Init(GPIOA, &GPIO_InitStructure);
  29365. 80104ca: f7f9 fcb1 bl 8009e30 <GPIO_Init>
  29366. GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_ETH);
  29367. 80104ce: 2101 movs r1, #1
  29368. 80104d0: 220b movs r2, #11
  29369. 80104d2: 4855 ldr r0, [pc, #340] ; (8010628 <ETH_BSP_Config+0x198>)
  29370. 80104d4: f7f9 fcfb bl 8009ece <GPIO_PinAFConfig>
  29371. GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_ETH);
  29372. 80104d8: 220b movs r2, #11
  29373. 80104da: 4853 ldr r0, [pc, #332] ; (8010628 <ETH_BSP_Config+0x198>)
  29374. 80104dc: 4629 mov r1, r5
  29375. 80104de: f7f9 fcf6 bl 8009ece <GPIO_PinAFConfig>
  29376. GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_ETH);
  29377. 80104e2: 220b movs r2, #11
  29378. 80104e4: 2107 movs r1, #7
  29379. 80104e6: 4850 ldr r0, [pc, #320] ; (8010628 <ETH_BSP_Config+0x198>)
  29380. 80104e8: f7f9 fcf1 bl 8009ece <GPIO_PinAFConfig>
  29381. /* Configure PB10,PB11,PB12 and PB13 */
  29382. GPIO_InitStructure.GPIO_Pin = /* GPIO_Pin_10 | */ GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
  29383. 80104ec: f44f 5360 mov.w r3, #14336 ; 0x3800
  29384. GPIO_Init(GPIOB, &GPIO_InitStructure);
  29385. 80104f0: 484e ldr r0, [pc, #312] ; (801062c <ETH_BSP_Config+0x19c>)
  29386. GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_ETH);
  29387. GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_ETH);
  29388. GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_ETH);
  29389. /* Configure PB10,PB11,PB12 and PB13 */
  29390. GPIO_InitStructure.GPIO_Pin = /* GPIO_Pin_10 | */ GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
  29391. 80104f2: 9301 str r3, [sp, #4]
  29392. GPIO_Init(GPIOB, &GPIO_InitStructure);
  29393. 80104f4: a901 add r1, sp, #4
  29394. 80104f6: f7f9 fc9b bl 8009e30 <GPIO_Init>
  29395. //GPIO_PinAFConfig(GPIOB, GPIO_PinSource10, GPIO_AF_ETH);
  29396. GPIO_PinAFConfig(GPIOB, GPIO_PinSource11, GPIO_AF_ETH);
  29397. 80104fa: 210b movs r1, #11
  29398. 80104fc: 460a mov r2, r1
  29399. 80104fe: 484b ldr r0, [pc, #300] ; (801062c <ETH_BSP_Config+0x19c>)
  29400. 8010500: f7f9 fce5 bl 8009ece <GPIO_PinAFConfig>
  29401. GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_ETH);
  29402. 8010504: 210c movs r1, #12
  29403. 8010506: 220b movs r2, #11
  29404. 8010508: 4848 ldr r0, [pc, #288] ; (801062c <ETH_BSP_Config+0x19c>)
  29405. 801050a: f7f9 fce0 bl 8009ece <GPIO_PinAFConfig>
  29406. GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_ETH);
  29407. 801050e: 220b movs r2, #11
  29408. 8010510: 210d movs r1, #13
  29409. 8010512: 4846 ldr r0, [pc, #280] ; (801062c <ETH_BSP_Config+0x19c>)
  29410. 8010514: f7f9 fcdb bl 8009ece <GPIO_PinAFConfig>
  29411. /* Configure PC1, PC4 and PC5 */
  29412. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5;
  29413. 8010518: 2332 movs r3, #50 ; 0x32
  29414. GPIO_Init(GPIOC, &GPIO_InitStructure);
  29415. 801051a: 4845 ldr r0, [pc, #276] ; (8010630 <ETH_BSP_Config+0x1a0>)
  29416. GPIO_PinAFConfig(GPIOB, GPIO_PinSource11, GPIO_AF_ETH);
  29417. GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_ETH);
  29418. GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_ETH);
  29419. /* Configure PC1, PC4 and PC5 */
  29420. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5;
  29421. 801051c: 9301 str r3, [sp, #4]
  29422. GPIO_Init(GPIOC, &GPIO_InitStructure);
  29423. 801051e: a901 add r1, sp, #4
  29424. 8010520: f7f9 fc86 bl 8009e30 <GPIO_Init>
  29425. GPIO_PinAFConfig(GPIOC, GPIO_PinSource1, GPIO_AF_ETH);
  29426. 8010524: 4842 ldr r0, [pc, #264] ; (8010630 <ETH_BSP_Config+0x1a0>)
  29427. 8010526: 2101 movs r1, #1
  29428. 8010528: 220b movs r2, #11
  29429. 801052a: f7f9 fcd0 bl 8009ece <GPIO_PinAFConfig>
  29430. GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
  29431. 801052e: 4840 ldr r0, [pc, #256] ; (8010630 <ETH_BSP_Config+0x1a0>)
  29432. 8010530: 2104 movs r1, #4
  29433. 8010532: 220b movs r2, #11
  29434. 8010534: f7f9 fccb bl 8009ece <GPIO_PinAFConfig>
  29435. GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
  29436. 8010538: 220b movs r2, #11
  29437. 801053a: 483d ldr r0, [pc, #244] ; (8010630 <ETH_BSP_Config+0x1a0>)
  29438. 801053c: 2105 movs r1, #5
  29439. 801053e: f7f9 fcc6 bl 8009ece <GPIO_PinAFConfig>
  29440. /* Configure the PHY RST pin */
  29441. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
  29442. 8010542: f44f 5600 mov.w r6, #8192 ; 0x2000
  29443. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  29444. 8010546: 2301 movs r3, #1
  29445. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29446. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  29447. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  29448. GPIO_Init(GPIOE, &GPIO_InitStructure);
  29449. 8010548: 483a ldr r0, [pc, #232] ; (8010634 <ETH_BSP_Config+0x1a4>)
  29450. GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
  29451. GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
  29452. /* Configure the PHY RST pin */
  29453. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
  29454. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  29455. 801054a: f88d 3008 strb.w r3, [sp, #8]
  29456. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29457. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  29458. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  29459. GPIO_Init(GPIOE, &GPIO_InitStructure);
  29460. 801054e: a901 add r1, sp, #4
  29461. /* Configure the PHY RST pin */
  29462. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
  29463. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  29464. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29465. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  29466. 8010550: f88d 300b strb.w r3, [sp, #11]
  29467. GPIO_PinAFConfig(GPIOC, GPIO_PinSource1, GPIO_AF_ETH);
  29468. GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
  29469. GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
  29470. /* Configure the PHY RST pin */
  29471. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
  29472. 8010554: 9601 str r6, [sp, #4]
  29473. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  29474. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  29475. 8010556: f88d 400a strb.w r4, [sp, #10]
  29476. GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  29477. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  29478. 801055a: f88d 5009 strb.w r5, [sp, #9]
  29479. GPIO_Init(GPIOE, &GPIO_InitStructure);
  29480. 801055e: f7f9 fc67 bl 8009e30 <GPIO_Init>
  29481. GPIO_ResetBits(GPIOE, GPIO_Pin_13);
  29482. 8010562: 4834 ldr r0, [pc, #208] ; (8010634 <ETH_BSP_Config+0x1a4>)
  29483. 8010564: 4631 mov r1, r6
  29484. 8010566: f7f9 fcb0 bl 8009eca <GPIO_ResetBits>
  29485. for (i = 0; i < 20000; i++);
  29486. 801056a: 9400 str r4, [sp, #0]
  29487. 801056c: f644 631f movw r3, #19999 ; 0x4e1f
  29488. 8010570: e002 b.n 8010578 <ETH_BSP_Config+0xe8>
  29489. 8010572: 9a00 ldr r2, [sp, #0]
  29490. 8010574: 3201 adds r2, #1
  29491. 8010576: 9200 str r2, [sp, #0]
  29492. 8010578: 9a00 ldr r2, [sp, #0]
  29493. 801057a: 429a cmp r2, r3
  29494. 801057c: d9f9 bls.n 8010572 <ETH_BSP_Config+0xe2>
  29495. GPIO_SetBits(GPIOE, GPIO_Pin_13);
  29496. 801057e: 482d ldr r0, [pc, #180] ; (8010634 <ETH_BSP_Config+0x1a4>)
  29497. 8010580: f44f 5100 mov.w r1, #8192 ; 0x2000
  29498. 8010584: f7f9 fc9f bl 8009ec6 <GPIO_SetBits>
  29499. for (i = 0; i < 20000; i++);
  29500. 8010588: 2300 movs r3, #0
  29501. 801058a: 9300 str r3, [sp, #0]
  29502. 801058c: f644 631f movw r3, #19999 ; 0x4e1f
  29503. 8010590: e002 b.n 8010598 <ETH_BSP_Config+0x108>
  29504. 8010592: 9a00 ldr r2, [sp, #0]
  29505. 8010594: 3201 adds r2, #1
  29506. 8010596: 9200 str r2, [sp, #0]
  29507. 8010598: 9a00 ldr r2, [sp, #0]
  29508. 801059a: 429a cmp r2, r3
  29509. 801059c: d9f9 bls.n 8010592 <ETH_BSP_Config+0x102>
  29510. static void ETH_MACDMA_Config(void)
  29511. {
  29512. ETH_InitTypeDef ETH_InitStructure;
  29513. /* Enable ETHERNET clock */
  29514. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_ETH_MAC | RCC_AHB1Periph_ETH_MAC_Tx |
  29515. 801059e: f04f 6060 mov.w r0, #234881024 ; 0xe000000
  29516. 80105a2: 2101 movs r1, #1
  29517. 80105a4: f7f9 fcf6 bl 8009f94 <RCC_AHB1PeriphClockCmd>
  29518. RCC_AHB1Periph_ETH_MAC_Rx, ENABLE);
  29519. /* Reset ETHERNET on AHB Bus */
  29520. ETH_DeInit();
  29521. 80105a8: f000 f858 bl 801065c <ETH_DeInit>
  29522. /* Software reset */
  29523. ETH_SoftwareReset();
  29524. 80105ac: f000 f9ec bl 8010988 <ETH_SoftwareReset>
  29525. /* Wait for software reset */
  29526. while (ETH_GetSoftwareResetStatus() == SET);
  29527. 80105b0: f000 f9f2 bl 8010998 <ETH_GetSoftwareResetStatus>
  29528. 80105b4: 2801 cmp r0, #1
  29529. 80105b6: d0fb beq.n 80105b0 <ETH_BSP_Config+0x120>
  29530. /* ETHERNET Configuration --------------------------------------------------*/
  29531. /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
  29532. ETH_StructInit(&ETH_InitStructure);
  29533. 80105b8: a803 add r0, sp, #12
  29534. 80105ba: f000 f85c bl 8010676 <ETH_StructInit>
  29535. ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29536. //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
  29537. // ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
  29538. // ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
  29539. ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
  29540. 80105be: 2300 movs r3, #0
  29541. 80105c0: 930a str r3, [sp, #40] ; 0x28
  29542. ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
  29543. ETH_InitStructure.ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;
  29544. 80105c2: 930e str r3, [sp, #56] ; 0x38
  29545. ETH_InitStructure.ETH_ReceiveAll = ETH_ReceiveAll_Disable;
  29546. 80105c4: 9311 str r3, [sp, #68] ; 0x44
  29547. ETH_InitStructure.ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Enable;
  29548. 80105c6: 9314 str r3, [sp, #80] ; 0x50
  29549. ETH_InitStructure.ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
  29550. 80105c8: 9316 str r3, [sp, #88] ; 0x58
  29551. ETH_InitStructure.ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
  29552. 80105ca: 9317 str r3, [sp, #92] ; 0x5c
  29553. ETH_InitStructure.ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
  29554. 80105cc: 9318 str r3, [sp, #96] ; 0x60
  29555. /*------------------------ DMA -----------------------------------*/
  29556. /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
  29557. the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
  29558. if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
  29559. ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
  29560. 80105ce: 9323 str r3, [sp, #140] ; 0x8c
  29561. ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29562. ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
  29563. ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
  29564. 80105d0: 9328 str r3, [sp, #160] ; 0xa0
  29565. ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
  29566. 80105d2: 9329 str r3, [sp, #164] ; 0xa4
  29567. ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
  29568. 80105d4: 2304 movs r3, #4
  29569. 80105d6: 932b str r3, [sp, #172] ; 0xac
  29570. ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29571. ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
  29572. 80105d8: f44f 3380 mov.w r3, #65536 ; 0x10000
  29573. 80105dc: 932d str r3, [sp, #180] ; 0xb4
  29574. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29575. 80105de: f44f 0380 mov.w r3, #4194304 ; 0x400000
  29576. /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
  29577. ETH_StructInit(&ETH_InitStructure);
  29578. /* Fill ETH_InitStructure parametrs */
  29579. /*------------------------ MAC -----------------------------------*/
  29580. ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29581. 80105e2: 2401 movs r4, #1
  29582. //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
  29583. // ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
  29584. // ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
  29585. ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
  29586. ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
  29587. 80105e4: f44f 7200 mov.w r2, #512 ; 0x200
  29588. /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
  29589. the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
  29590. if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
  29591. ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
  29592. ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29593. ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
  29594. 80105e8: f44f 1100 mov.w r1, #2097152 ; 0x200000
  29595. ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
  29596. ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
  29597. ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
  29598. ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29599. ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
  29600. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29601. 80105ec: 932e str r3, [sp, #184] ; 0xb8
  29602. ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29603. 80105ee: f44f 5300 mov.w r3, #8192 ; 0x2000
  29604. //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
  29605. // ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
  29606. // ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
  29607. ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
  29608. ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
  29609. 80105f2: 920d str r2, [sp, #52] ; 0x34
  29610. /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
  29611. the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
  29612. if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
  29613. ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
  29614. ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29615. ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
  29616. 80105f4: 9126 str r1, [sp, #152] ; 0x98
  29617. /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
  29618. the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
  29619. if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
  29620. ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
  29621. ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29622. 80105f6: f04f 7200 mov.w r2, #33554432 ; 0x2000000
  29623. ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
  29624. ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
  29625. ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29626. ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
  29627. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29628. ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29629. 80105fa: 932f str r3, [sp, #188] ; 0xbc
  29630. ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
  29631. /* Configure Ethernet */
  29632. EthInitStatus = ETH_Init(&ETH_InitStructure, LAN8720_PHY_ADDRESS);
  29633. 80105fc: 4621 mov r1, r4
  29634. ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
  29635. ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29636. ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
  29637. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29638. ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29639. ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
  29640. 80105fe: f44f 4380 mov.w r3, #16384 ; 0x4000
  29641. /* Configure Ethernet */
  29642. EthInitStatus = ETH_Init(&ETH_InitStructure, LAN8720_PHY_ADDRESS);
  29643. 8010602: a803 add r0, sp, #12
  29644. ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
  29645. ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29646. ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
  29647. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29648. ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29649. ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
  29650. 8010604: 9331 str r3, [sp, #196] ; 0xc4
  29651. /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
  29652. the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
  29653. if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
  29654. ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
  29655. ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29656. 8010606: 9224 str r2, [sp, #144] ; 0x90
  29657. ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
  29658. ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
  29659. ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
  29660. ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
  29661. ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29662. 8010608: 922c str r2, [sp, #176] ; 0xb0
  29663. /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
  29664. ETH_StructInit(&ETH_InitStructure);
  29665. /* Fill ETH_InitStructure parametrs */
  29666. /*------------------------ MAC -----------------------------------*/
  29667. ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29668. 801060a: 9403 str r4, [sp, #12]
  29669. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29670. ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29671. ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
  29672. /* Configure Ethernet */
  29673. EthInitStatus = ETH_Init(&ETH_InitStructure, LAN8720_PHY_ADDRESS);
  29674. 801060c: f000 fa5e bl 8010acc <ETH_Init>
  29675. 8010610: 4d09 ldr r5, [pc, #36] ; (8010638 <ETH_BSP_Config+0x1a8>)
  29676. /* Enable the Ethernet Rx Interrupt */
  29677. ETH_DMAITConfig(ETH_DMA_IT_NIS | ETH_DMA_IT_R, ENABLE);
  29678. 8010612: 4621 mov r1, r4
  29679. ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29680. ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29681. ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
  29682. /* Configure Ethernet */
  29683. EthInitStatus = ETH_Init(&ETH_InitStructure, LAN8720_PHY_ADDRESS);
  29684. 8010614: 6028 str r0, [r5, #0]
  29685. /* Enable the Ethernet Rx Interrupt */
  29686. ETH_DMAITConfig(ETH_DMA_IT_NIS | ETH_DMA_IT_R, ENABLE);
  29687. 8010616: 4809 ldr r0, [pc, #36] ; (801063c <ETH_BSP_Config+0x1ac>)
  29688. 8010618: f000 f9c6 bl 80109a8 <ETH_DMAITConfig>
  29689. //ETH_NVIC_Config();
  29690. /* Configure the Ethernet MAC/DMA */
  29691. ETH_MACDMA_Config();
  29692. if (EthInitStatus == 0) {
  29693. 801061c: 682b ldr r3, [r5, #0]
  29694. 801061e: b903 cbnz r3, 8010622 <ETH_BSP_Config+0x192>
  29695. 8010620: e7fe b.n 8010620 <ETH_BSP_Config+0x190>
  29696. // LCD_DisplayStringLine(Line5, (uint8_t*)" Ethernet Init ");
  29697. // LCD_DisplayStringLine(Line6, (uint8_t*)" failed ");
  29698. // STM_EVAL_LEDOn(LED5);
  29699. while(1);
  29700. }
  29701. }
  29702. 8010622: b032 add sp, #200 ; 0xc8
  29703. 8010624: bd70 pop {r4, r5, r6, pc}
  29704. 8010626: bf00 nop
  29705. 8010628: 40020000 .word 0x40020000
  29706. 801062c: 40020400 .word 0x40020400
  29707. 8010630: 40020800 .word 0x40020800
  29708. 8010634: 40021000 .word 0x40021000
  29709. 8010638: 20006dac .word 0x20006dac
  29710. 801063c: 00010040 .word 0x00010040
  29711. 08010640 <ETH_Delay>:
  29712. * @brief Inserts a delay time.
  29713. * @param nCount: specifies the delay time length.
  29714. * @retval None
  29715. */
  29716. static void ETH_Delay(__IO uint32_t nCount)
  29717. {
  29718. 8010640: b084 sub sp, #16
  29719. __IO uint32_t index = 0;
  29720. 8010642: 2300 movs r3, #0
  29721. * @brief Inserts a delay time.
  29722. * @param nCount: specifies the delay time length.
  29723. * @retval None
  29724. */
  29725. static void ETH_Delay(__IO uint32_t nCount)
  29726. {
  29727. 8010644: 9001 str r0, [sp, #4]
  29728. __IO uint32_t index = 0;
  29729. 8010646: 9303 str r3, [sp, #12]
  29730. for(index = nCount; index != 0; index--)
  29731. 8010648: 9b01 ldr r3, [sp, #4]
  29732. 801064a: e001 b.n 8010650 <ETH_Delay+0x10>
  29733. 801064c: 9b03 ldr r3, [sp, #12]
  29734. 801064e: 3b01 subs r3, #1
  29735. 8010650: 9303 str r3, [sp, #12]
  29736. 8010652: 9b03 ldr r3, [sp, #12]
  29737. 8010654: 2b00 cmp r3, #0
  29738. 8010656: d1f9 bne.n 801064c <ETH_Delay+0xc>
  29739. {
  29740. }
  29741. }
  29742. 8010658: b004 add sp, #16
  29743. 801065a: 4770 bx lr
  29744. 0801065c <ETH_DeInit>:
  29745. * @brief Deinitializes the ETHERNET peripheral registers to their default reset values.
  29746. * @param None
  29747. * @retval None
  29748. */
  29749. void ETH_DeInit(void)
  29750. {
  29751. 801065c: b508 push {r3, lr}
  29752. RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, ENABLE);
  29753. 801065e: 2101 movs r1, #1
  29754. 8010660: f04f 7000 mov.w r0, #33554432 ; 0x2000000
  29755. 8010664: f7f9 fcba bl 8009fdc <RCC_AHB1PeriphResetCmd>
  29756. RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, DISABLE);
  29757. 8010668: f04f 7000 mov.w r0, #33554432 ; 0x2000000
  29758. 801066c: 2100 movs r1, #0
  29759. }
  29760. 801066e: e8bd 4008 ldmia.w sp!, {r3, lr}
  29761. * @retval None
  29762. */
  29763. void ETH_DeInit(void)
  29764. {
  29765. RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, ENABLE);
  29766. RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, DISABLE);
  29767. 8010672: f7f9 bcb3 b.w 8009fdc <RCC_AHB1PeriphResetCmd>
  29768. 08010676 <ETH_StructInit>:
  29769. /* Ethernet interframe gap set to 96 bits */
  29770. ETH_InitStruct->ETH_InterFrameGap = ETH_InterFrameGap_96Bit;
  29771. /* Carrier Sense Enabled in Half-Duplex mode */
  29772. ETH_InitStruct->ETH_CarrierSense = ETH_CarrierSense_Enable;
  29773. /* PHY speed configured to 100Mbit/s */
  29774. ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
  29775. 8010676: f44f 4280 mov.w r2, #16384 ; 0x4000
  29776. 801067a: 6142 str r2, [r0, #20]
  29777. /* Receive own Frames in Half-Duplex mode enabled */
  29778. ETH_InitStruct->ETH_ReceiveOwn = ETH_ReceiveOwn_Enable;
  29779. /* MAC MII loopback disabled */
  29780. ETH_InitStruct->ETH_LoopbackMode = ETH_LoopbackMode_Disable;
  29781. /* Full-Duplex mode selected */
  29782. ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
  29783. 801067c: f44f 6200 mov.w r2, #2048 ; 0x800
  29784. 8010680: 6202 str r2, [r0, #32]
  29785. /* Receive all frames disabled */
  29786. ETH_InitStruct->ETH_ReceiveAll = ETH_ReceiveAll_Disable;
  29787. /* Source address filtering (on the optional MAC addresses) disabled */
  29788. ETH_InitStruct->ETH_SourceAddrFilter = ETH_SourceAddrFilter_Disable;
  29789. /* Do not forward control frames that do not pass the address filtering */
  29790. ETH_InitStruct->ETH_PassControlFrames = ETH_PassControlFrames_BlockAll;
  29791. 8010682: 2240 movs r2, #64 ; 0x40
  29792. 8010684: 6402 str r2, [r0, #64] ; 0x40
  29793. /* Disable reception of Broadcast frames */
  29794. ETH_InitStruct->ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Disable;
  29795. 8010686: 2220 movs r2, #32
  29796. 8010688: 6442 str r2, [r0, #68] ; 0x44
  29797. /* Initialize hash table high and low regs */
  29798. ETH_InitStruct->ETH_HashTableHigh = 0x0;
  29799. ETH_InitStruct->ETH_HashTableLow = 0x0;
  29800. /* Flow control config (flow control disabled)*/
  29801. ETH_InitStruct->ETH_PauseTime = 0x0;
  29802. ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;
  29803. 801068a: 2280 movs r2, #128 ; 0x80
  29804. {
  29805. /* ETH_InitStruct members default value */
  29806. /*------------------------ MAC Configuration ---------------------------*/
  29807. /* PHY Auto-negotiation enabled */
  29808. ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29809. 801068c: 2301 movs r3, #1
  29810. /* Initialize hash table high and low regs */
  29811. ETH_InitStruct->ETH_HashTableHigh = 0x0;
  29812. ETH_InitStruct->ETH_HashTableLow = 0x0;
  29813. /* Flow control config (flow control disabled)*/
  29814. ETH_InitStruct->ETH_PauseTime = 0x0;
  29815. ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;
  29816. 801068e: 6642 str r2, [r0, #100] ; 0x64
  29817. ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;
  29818. /*---------------------- DMA Configuration -------------------------------*/
  29819. /* Drops frames with with TCP/IP checksum errors */
  29820. ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
  29821. 8010690: f04f 6280 mov.w r2, #67108864 ; 0x4000000
  29822. {
  29823. /* ETH_InitStruct members default value */
  29824. /*------------------------ MAC Configuration ---------------------------*/
  29825. /* PHY Auto-negotiation enabled */
  29826. ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29827. 8010694: 6003 str r3, [r0, #0]
  29828. ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;
  29829. /*---------------------- DMA Configuration -------------------------------*/
  29830. /* Drops frames with with TCP/IP checksum errors */
  29831. ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
  29832. 8010696: f8c0 2080 str.w r2, [r0, #128] ; 0x80
  29833. /*------------------------ MAC Configuration ---------------------------*/
  29834. /* PHY Auto-negotiation enabled */
  29835. ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29836. /* MAC watchdog enabled: cuts-off long frame */
  29837. ETH_InitStruct->ETH_Watchdog = ETH_Watchdog_Enable;
  29838. 801069a: 2300 movs r3, #0
  29839. /*---------------------- DMA Configuration -------------------------------*/
  29840. /* Drops frames with with TCP/IP checksum errors */
  29841. ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
  29842. /* Store and forward mode enabled for receive */
  29843. ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29844. 801069c: f04f 7200 mov.w r2, #33554432 ; 0x2000000
  29845. /*------------------------ MAC Configuration ---------------------------*/
  29846. /* PHY Auto-negotiation enabled */
  29847. ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
  29848. /* MAC watchdog enabled: cuts-off long frame */
  29849. ETH_InitStruct->ETH_Watchdog = ETH_Watchdog_Enable;
  29850. 80106a0: 6043 str r3, [r0, #4]
  29851. /* MAC Jabber enabled in Half-duplex mode */
  29852. ETH_InitStruct->ETH_Jabber = ETH_Jabber_Enable;
  29853. 80106a2: 6083 str r3, [r0, #8]
  29854. /* Ethernet interframe gap set to 96 bits */
  29855. ETH_InitStruct->ETH_InterFrameGap = ETH_InterFrameGap_96Bit;
  29856. 80106a4: 60c3 str r3, [r0, #12]
  29857. /* Carrier Sense Enabled in Half-Duplex mode */
  29858. ETH_InitStruct->ETH_CarrierSense = ETH_CarrierSense_Enable;
  29859. 80106a6: 6103 str r3, [r0, #16]
  29860. /* PHY speed configured to 100Mbit/s */
  29861. ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
  29862. /* Receive own Frames in Half-Duplex mode enabled */
  29863. ETH_InitStruct->ETH_ReceiveOwn = ETH_ReceiveOwn_Enable;
  29864. 80106a8: 6183 str r3, [r0, #24]
  29865. /* MAC MII loopback disabled */
  29866. ETH_InitStruct->ETH_LoopbackMode = ETH_LoopbackMode_Disable;
  29867. 80106aa: 61c3 str r3, [r0, #28]
  29868. /* Full-Duplex mode selected */
  29869. ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
  29870. /* IPv4 and TCP/UDP/ICMP frame Checksum Offload disabled */
  29871. ETH_InitStruct->ETH_ChecksumOffload = ETH_ChecksumOffload_Disable;
  29872. 80106ac: 6243 str r3, [r0, #36] ; 0x24
  29873. /* Retry Transmission enabled for half-duplex mode */
  29874. ETH_InitStruct->ETH_RetryTransmission = ETH_RetryTransmission_Enable;
  29875. 80106ae: 6283 str r3, [r0, #40] ; 0x28
  29876. /* Automatic PAD/CRC strip disabled*/
  29877. ETH_InitStruct->ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;
  29878. 80106b0: 62c3 str r3, [r0, #44] ; 0x2c
  29879. /* half-duplex mode retransmission Backoff time_limit = 10 slot times*/
  29880. ETH_InitStruct->ETH_BackOffLimit = ETH_BackOffLimit_10;
  29881. 80106b2: 6303 str r3, [r0, #48] ; 0x30
  29882. /* half-duplex mode Deferral check disabled */
  29883. ETH_InitStruct->ETH_DeferralCheck = ETH_DeferralCheck_Disable;
  29884. 80106b4: 6343 str r3, [r0, #52] ; 0x34
  29885. /* Receive all frames disabled */
  29886. ETH_InitStruct->ETH_ReceiveAll = ETH_ReceiveAll_Disable;
  29887. 80106b6: 6383 str r3, [r0, #56] ; 0x38
  29888. /* Source address filtering (on the optional MAC addresses) disabled */
  29889. ETH_InitStruct->ETH_SourceAddrFilter = ETH_SourceAddrFilter_Disable;
  29890. 80106b8: 63c3 str r3, [r0, #60] ; 0x3c
  29891. /* Do not forward control frames that do not pass the address filtering */
  29892. ETH_InitStruct->ETH_PassControlFrames = ETH_PassControlFrames_BlockAll;
  29893. /* Disable reception of Broadcast frames */
  29894. ETH_InitStruct->ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Disable;
  29895. /* Normal Destination address filtering (not reverse addressing) */
  29896. ETH_InitStruct->ETH_DestinationAddrFilter = ETH_DestinationAddrFilter_Normal;
  29897. 80106ba: 6483 str r3, [r0, #72] ; 0x48
  29898. /* Promiscuous address filtering mode disabled */
  29899. ETH_InitStruct->ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
  29900. 80106bc: 64c3 str r3, [r0, #76] ; 0x4c
  29901. /* Perfect address filtering for multicast addresses */
  29902. ETH_InitStruct->ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
  29903. 80106be: 6503 str r3, [r0, #80] ; 0x50
  29904. /* Perfect address filtering for unicast addresses */
  29905. ETH_InitStruct->ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
  29906. 80106c0: 6543 str r3, [r0, #84] ; 0x54
  29907. /* Initialize hash table high and low regs */
  29908. ETH_InitStruct->ETH_HashTableHigh = 0x0;
  29909. 80106c2: 6583 str r3, [r0, #88] ; 0x58
  29910. ETH_InitStruct->ETH_HashTableLow = 0x0;
  29911. 80106c4: 65c3 str r3, [r0, #92] ; 0x5c
  29912. /* Flow control config (flow control disabled)*/
  29913. ETH_InitStruct->ETH_PauseTime = 0x0;
  29914. 80106c6: 6603 str r3, [r0, #96] ; 0x60
  29915. ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;
  29916. ETH_InitStruct->ETH_PauseLowThreshold = ETH_PauseLowThreshold_Minus4;
  29917. 80106c8: 6683 str r3, [r0, #104] ; 0x68
  29918. ETH_InitStruct->ETH_UnicastPauseFrameDetect = ETH_UnicastPauseFrameDetect_Disable;
  29919. 80106ca: 66c3 str r3, [r0, #108] ; 0x6c
  29920. ETH_InitStruct->ETH_ReceiveFlowControl = ETH_ReceiveFlowControl_Disable;
  29921. 80106cc: 6703 str r3, [r0, #112] ; 0x70
  29922. ETH_InitStruct->ETH_TransmitFlowControl = ETH_TransmitFlowControl_Disable;
  29923. 80106ce: 6743 str r3, [r0, #116] ; 0x74
  29924. /* VLANtag config (VLAN field not checked) */
  29925. ETH_InitStruct->ETH_VLANTagComparison = ETH_VLANTagComparison_16Bit;
  29926. 80106d0: 6783 str r3, [r0, #120] ; 0x78
  29927. ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;
  29928. 80106d2: 67c3 str r3, [r0, #124] ; 0x7c
  29929. /*---------------------- DMA Configuration -------------------------------*/
  29930. /* Drops frames with with TCP/IP checksum errors */
  29931. ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
  29932. /* Store and forward mode enabled for receive */
  29933. ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29934. 80106d4: f8c0 2084 str.w r2, [r0, #132] ; 0x84
  29935. ETH_InitStruct->ETH_ReceiveThresholdControl = ETH_ReceiveThresholdControl_64Bytes;
  29936. /* Disable Operate on second frame (transmit a second frame to FIFO without
  29937. waiting status of previous frame*/
  29938. ETH_InitStruct->ETH_SecondFrameOperate = ETH_SecondFrameOperate_Disable;
  29939. /* DMA works on 32-bit aligned start source and destinations addresses */
  29940. ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29941. 80106d8: f8c0 20a4 str.w r2, [r0, #164] ; 0xa4
  29942. /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
  29943. ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
  29944. 80106dc: f44f 3280 mov.w r2, #65536 ; 0x10000
  29945. 80106e0: f8c0 20a8 str.w r2, [r0, #168] ; 0xa8
  29946. /* DMA transfer max burst length = 32 beats = 32 x 32bits */
  29947. ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29948. 80106e4: f44f 0280 mov.w r2, #4194304 ; 0x400000
  29949. /* Store and forward mode enabled for receive */
  29950. ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29951. /* Flush received frame that created FIFO overflow */
  29952. ETH_InitStruct->ETH_FlushReceivedFrame = ETH_FlushReceivedFrame_Enable;
  29953. /* Store and forward mode enabled for transmit */
  29954. ETH_InitStruct->ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
  29955. 80106e8: f44f 1100 mov.w r1, #2097152 ; 0x200000
  29956. /* DMA works on 32-bit aligned start source and destinations addresses */
  29957. ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29958. /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
  29959. ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
  29960. /* DMA transfer max burst length = 32 beats = 32 x 32bits */
  29961. ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29962. 80106ec: f8c0 20ac str.w r2, [r0, #172] ; 0xac
  29963. ETH_InitStruct->ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29964. 80106f0: f44f 5200 mov.w r2, #8192 ; 0x2000
  29965. /* Drops frames with with TCP/IP checksum errors */
  29966. ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
  29967. /* Store and forward mode enabled for receive */
  29968. ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
  29969. /* Flush received frame that created FIFO overflow */
  29970. ETH_InitStruct->ETH_FlushReceivedFrame = ETH_FlushReceivedFrame_Enable;
  29971. 80106f4: f8c0 3088 str.w r3, [r0, #136] ; 0x88
  29972. /* Store and forward mode enabled for transmit */
  29973. ETH_InitStruct->ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
  29974. 80106f8: f8c0 108c str.w r1, [r0, #140] ; 0x8c
  29975. /* Threshold TXFIFO level set to 64 bytes (used when threshold mode is enabled) */
  29976. ETH_InitStruct->ETH_TransmitThresholdControl = ETH_TransmitThresholdControl_64Bytes;
  29977. 80106fc: f8c0 3090 str.w r3, [r0, #144] ; 0x90
  29978. /* Disable forwarding frames with errors (short frames, CRC,...)*/
  29979. ETH_InitStruct->ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
  29980. 8010700: f8c0 3094 str.w r3, [r0, #148] ; 0x94
  29981. /* Disable undersized good frames */
  29982. ETH_InitStruct->ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
  29983. 8010704: f8c0 3098 str.w r3, [r0, #152] ; 0x98
  29984. /* Threshold RXFIFO level set to 64 bytes (used when Cut-through mode is enabled) */
  29985. ETH_InitStruct->ETH_ReceiveThresholdControl = ETH_ReceiveThresholdControl_64Bytes;
  29986. 8010708: f8c0 309c str.w r3, [r0, #156] ; 0x9c
  29987. /* Disable Operate on second frame (transmit a second frame to FIFO without
  29988. waiting status of previous frame*/
  29989. ETH_InitStruct->ETH_SecondFrameOperate = ETH_SecondFrameOperate_Disable;
  29990. 801070c: f8c0 30a0 str.w r3, [r0, #160] ; 0xa0
  29991. ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
  29992. /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
  29993. ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
  29994. /* DMA transfer max burst length = 32 beats = 32 x 32bits */
  29995. ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
  29996. ETH_InitStruct->ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
  29997. 8010710: f8c0 20b0 str.w r2, [r0, #176] ; 0xb0
  29998. /* DMA Ring mode skip length = 0 */
  29999. ETH_InitStruct->ETH_DescriptorSkipLength = 0x0;
  30000. 8010714: f8c0 30b4 str.w r3, [r0, #180] ; 0xb4
  30001. /* Equal priority (round-robin) between transmit and receive DMA engines */
  30002. ETH_InitStruct->ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_1_1;
  30003. 8010718: f8c0 30b8 str.w r3, [r0, #184] ; 0xb8
  30004. 801071c: 4770 bx lr
  30005. 801071e: 0000 movs r0, r0
  30006. 08010720 <ETH_MACTransmissionCmd>:
  30007. * @param NewState: new state of the MAC transmission.
  30008. * This parameter can be: ENABLE or DISABLE.
  30009. * @retval None
  30010. */
  30011. void ETH_MACTransmissionCmd(FunctionalState NewState)
  30012. {
  30013. 8010720: 4b04 ldr r3, [pc, #16] ; (8010734 <ETH_MACTransmissionCmd+0x14>)
  30014. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30015. if (NewState != DISABLE)
  30016. {
  30017. /* Enable the MAC transmission */
  30018. ETH->MACCR |= ETH_MACCR_TE;
  30019. 8010722: 681a ldr r2, [r3, #0]
  30020. void ETH_MACTransmissionCmd(FunctionalState NewState)
  30021. {
  30022. /* Check the parameters */
  30023. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30024. if (NewState != DISABLE)
  30025. 8010724: b110 cbz r0, 801072c <ETH_MACTransmissionCmd+0xc>
  30026. {
  30027. /* Enable the MAC transmission */
  30028. ETH->MACCR |= ETH_MACCR_TE;
  30029. 8010726: f042 0208 orr.w r2, r2, #8
  30030. 801072a: e001 b.n 8010730 <ETH_MACTransmissionCmd+0x10>
  30031. }
  30032. else
  30033. {
  30034. /* Disable the MAC transmission */
  30035. ETH->MACCR &= ~ETH_MACCR_TE;
  30036. 801072c: f022 0208 bic.w r2, r2, #8
  30037. 8010730: 601a str r2, [r3, #0]
  30038. 8010732: 4770 bx lr
  30039. 8010734: 40028000 .word 0x40028000
  30040. 08010738 <ETH_MACReceptionCmd>:
  30041. * @param NewState: new state of the MAC reception.
  30042. * This parameter can be: ENABLE or DISABLE.
  30043. * @retval None
  30044. */
  30045. void ETH_MACReceptionCmd(FunctionalState NewState)
  30046. {
  30047. 8010738: 4b04 ldr r3, [pc, #16] ; (801074c <ETH_MACReceptionCmd+0x14>)
  30048. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30049. if (NewState != DISABLE)
  30050. {
  30051. /* Enable the MAC reception */
  30052. ETH->MACCR |= ETH_MACCR_RE;
  30053. 801073a: 681a ldr r2, [r3, #0]
  30054. void ETH_MACReceptionCmd(FunctionalState NewState)
  30055. {
  30056. /* Check the parameters */
  30057. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30058. if (NewState != DISABLE)
  30059. 801073c: b110 cbz r0, 8010744 <ETH_MACReceptionCmd+0xc>
  30060. {
  30061. /* Enable the MAC reception */
  30062. ETH->MACCR |= ETH_MACCR_RE;
  30063. 801073e: f042 0204 orr.w r2, r2, #4
  30064. 8010742: e001 b.n 8010748 <ETH_MACReceptionCmd+0x10>
  30065. }
  30066. else
  30067. {
  30068. /* Disable the MAC reception */
  30069. ETH->MACCR &= ~ETH_MACCR_RE;
  30070. 8010744: f022 0204 bic.w r2, r2, #4
  30071. 8010748: 601a str r2, [r3, #0]
  30072. 801074a: 4770 bx lr
  30073. 801074c: 40028000 .word 0x40028000
  30074. 08010750 <ETH_MACAddressConfig>:
  30075. uint32_t tmpreg;
  30076. /* Check the parameters */
  30077. assert_param(IS_ETH_MAC_ADDRESS0123(MacAddr));
  30078. /* Calculate the selected MAC address high register */
  30079. tmpreg = ((uint32_t)Addr[5] << 8) | (uint32_t)Addr[4];
  30080. 8010750: 790b ldrb r3, [r1, #4]
  30081. 8010752: 794a ldrb r2, [r1, #5]
  30082. 8010754: ea43 2202 orr.w r2, r3, r2, lsl #8
  30083. /* Load the selected MAC address high register */
  30084. (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) = tmpreg;
  30085. 8010758: 4b07 ldr r3, [pc, #28] ; (8010778 <ETH_MACAddressConfig+0x28>)
  30086. 801075a: 50c2 str r2, [r0, r3]
  30087. /* Calculate the selected MAC address low register */
  30088. tmpreg = ((uint32_t)Addr[3] << 24) | ((uint32_t)Addr[2] << 16) | ((uint32_t)Addr[1] << 8) | Addr[0];
  30089. 801075c: 788a ldrb r2, [r1, #2]
  30090. 801075e: 78cb ldrb r3, [r1, #3]
  30091. 8010760: 0412 lsls r2, r2, #16
  30092. 8010762: ea42 6203 orr.w r2, r2, r3, lsl #24
  30093. 8010766: 780b ldrb r3, [r1, #0]
  30094. 8010768: 431a orrs r2, r3
  30095. 801076a: 784b ldrb r3, [r1, #1]
  30096. 801076c: ea42 2203 orr.w r2, r2, r3, lsl #8
  30097. /* Load the selected MAC address low register */
  30098. (*(__IO uint32_t *) (ETH_MAC_ADDR_LBASE + MacAddr)) = tmpreg;
  30099. 8010770: 4b02 ldr r3, [pc, #8] ; (801077c <ETH_MACAddressConfig+0x2c>)
  30100. 8010772: 50c2 str r2, [r0, r3]
  30101. 8010774: 4770 bx lr
  30102. 8010776: bf00 nop
  30103. 8010778: 40028040 .word 0x40028040
  30104. 801077c: 40028044 .word 0x40028044
  30105. 08010780 <ETH_Get_Received_Frame>:
  30106. {
  30107. uint32_t framelength = 0;
  30108. FrameTypeDef frame = {0,0,0};
  30109. /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
  30110. framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
  30111. 8010780: 490a ldr r1, [pc, #40] ; (80107ac <ETH_Get_Received_Frame+0x2c>)
  30112. frame.length = framelength;
  30113. /* Get the address of the buffer start address */
  30114. /* Check if more than one segment in the frame */
  30115. if (DMA_RX_FRAME_infos->Seg_Count >1)
  30116. 8010782: 4a0b ldr r2, [pc, #44] ; (80107b0 <ETH_Get_Received_Frame+0x30>)
  30117. {
  30118. uint32_t framelength = 0;
  30119. FrameTypeDef frame = {0,0,0};
  30120. /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
  30121. framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
  30122. 8010784: 680b ldr r3, [r1, #0]
  30123. frame.length = framelength;
  30124. /* Get the address of the buffer start address */
  30125. /* Check if more than one segment in the frame */
  30126. if (DMA_RX_FRAME_infos->Seg_Count >1)
  30127. 8010786: 6812 ldr r2, [r2, #0]
  30128. /* Chained Mode */
  30129. /* Selects the next DMA Rx descriptor list for next buffer to read */
  30130. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30131. /* Return Frame */
  30132. return (frame);
  30133. 8010788: 6083 str r3, [r0, #8]
  30134. * with polling method only).
  30135. * @param none
  30136. * @retval Structure of type FrameTypeDef
  30137. */
  30138. FrameTypeDef ETH_Get_Received_Frame(void)
  30139. {
  30140. 801078a: b530 push {r4, r5, lr}
  30141. uint32_t framelength = 0;
  30142. FrameTypeDef frame = {0,0,0};
  30143. /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
  30144. framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
  30145. 801078c: 681d ldr r5, [r3, #0]
  30146. frame.length = framelength;
  30147. /* Get the address of the buffer start address */
  30148. /* Check if more than one segment in the frame */
  30149. if (DMA_RX_FRAME_infos->Seg_Count >1)
  30150. 801078e: 6894 ldr r4, [r2, #8]
  30151. {
  30152. uint32_t framelength = 0;
  30153. FrameTypeDef frame = {0,0,0};
  30154. /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
  30155. framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
  30156. 8010790: f3c5 450d ubfx r5, r5, #16, #14
  30157. 8010794: 3d04 subs r5, #4
  30158. frame.length = framelength;
  30159. /* Get the address of the buffer start address */
  30160. /* Check if more than one segment in the frame */
  30161. if (DMA_RX_FRAME_infos->Seg_Count >1)
  30162. 8010796: 2c01 cmp r4, #1
  30163. {
  30164. frame.buffer =(DMA_RX_FRAME_infos->FS_Rx_Desc)->Buffer1Addr;
  30165. 8010798: bf8a itet hi
  30166. 801079a: 6812 ldrhi r2, [r2, #0]
  30167. }
  30168. else
  30169. {
  30170. frame.buffer = DMARxDescToGet->Buffer1Addr;
  30171. 801079c: 689a ldrls r2, [r3, #8]
  30172. /* Get the address of the buffer start address */
  30173. /* Check if more than one segment in the frame */
  30174. if (DMA_RX_FRAME_infos->Seg_Count >1)
  30175. {
  30176. frame.buffer =(DMA_RX_FRAME_infos->FS_Rx_Desc)->Buffer1Addr;
  30177. 801079e: 6892 ldrhi r2, [r2, #8]
  30178. frame.descriptor = DMARxDescToGet;
  30179. /* Update the ETHERNET DMA global Rx descriptor with next Rx descriptor */
  30180. /* Chained Mode */
  30181. /* Selects the next DMA Rx descriptor list for next buffer to read */
  30182. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30183. 80107a0: 68dc ldr r4, [r3, #12]
  30184. /* Return Frame */
  30185. return (frame);
  30186. 80107a2: 6005 str r5, [r0, #0]
  30187. frame.descriptor = DMARxDescToGet;
  30188. /* Update the ETHERNET DMA global Rx descriptor with next Rx descriptor */
  30189. /* Chained Mode */
  30190. /* Selects the next DMA Rx descriptor list for next buffer to read */
  30191. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30192. 80107a4: 600c str r4, [r1, #0]
  30193. /* Return Frame */
  30194. return (frame);
  30195. 80107a6: 6042 str r2, [r0, #4]
  30196. }
  30197. 80107a8: bd30 pop {r4, r5, pc}
  30198. 80107aa: bf00 nop
  30199. 80107ac: 20008cbc .word 0x20008cbc
  30200. 80107b0: 2000ab2c .word 0x2000ab2c
  30201. 080107b4 <ETH_Prepare_Transmit_Descriptors>:
  30202. {
  30203. uint32_t buf_count =0, size=0,i=0;
  30204. __IO ETH_DMADESCTypeDef *DMATxNextDesc;
  30205. /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
  30206. if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
  30207. 80107b4: 4b29 ldr r3, [pc, #164] ; (801085c <ETH_Prepare_Transmit_Descriptors+0xa8>)
  30208. 80107b6: 681b ldr r3, [r3, #0]
  30209. 80107b8: 681a ldr r2, [r3, #0]
  30210. 80107ba: 2a00 cmp r2, #0
  30211. * @brief Prepares DMA Tx descriptors to transmit an ethernet frame
  30212. * @param FrameLength : length of the frame to send
  30213. * @retval error status
  30214. */
  30215. uint32_t ETH_Prepare_Transmit_Descriptors(u16 FrameLength)
  30216. {
  30217. 80107bc: b5f0 push {r4, r5, r6, r7, lr}
  30218. uint32_t buf_count =0, size=0,i=0;
  30219. __IO ETH_DMADESCTypeDef *DMATxNextDesc;
  30220. /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
  30221. if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
  30222. 80107be: db48 blt.n 8010852 <ETH_Prepare_Transmit_Descriptors+0x9e>
  30223. return ETH_ERROR;
  30224. }
  30225. DMATxNextDesc = DMATxDescToSet;
  30226. if (FrameLength > ETH_TX_BUF_SIZE)
  30227. 80107c0: f240 52f4 movw r2, #1524 ; 0x5f4
  30228. 80107c4: 4290 cmp r0, r2
  30229. 80107c6: d917 bls.n 80107f8 <ETH_Prepare_Transmit_Descriptors+0x44>
  30230. {
  30231. buf_count = FrameLength/ETH_TX_BUF_SIZE;
  30232. 80107c8: fbb0 f4f2 udiv r4, r0, r2
  30233. if (FrameLength%ETH_TX_BUF_SIZE) buf_count++;
  30234. 80107cc: fb02 0214 mls r2, r2, r4, r0
  30235. 80107d0: b292 uxth r2, r2
  30236. DMATxNextDesc = DMATxDescToSet;
  30237. if (FrameLength > ETH_TX_BUF_SIZE)
  30238. {
  30239. buf_count = FrameLength/ETH_TX_BUF_SIZE;
  30240. 80107d2: b2a1 uxth r1, r4
  30241. if (FrameLength%ETH_TX_BUF_SIZE) buf_count++;
  30242. 80107d4: b10a cbz r2, 80107da <ETH_Prepare_Transmit_Descriptors+0x26>
  30243. 80107d6: 3101 adds r1, #1
  30244. 80107d8: e001 b.n 80107de <ETH_Prepare_Transmit_Descriptors+0x2a>
  30245. }
  30246. else buf_count =1;
  30247. if (buf_count ==1)
  30248. 80107da: 2901 cmp r1, #1
  30249. 80107dc: d00c beq.n 80107f8 <ETH_Prepare_Transmit_Descriptors+0x44>
  30250. if (i== (buf_count-1))
  30251. {
  30252. /* Setting the last segment bit */
  30253. DMATxNextDesc->Status |= ETH_DMATxDesc_LS;
  30254. size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
  30255. 80107de: 4d20 ldr r5, [pc, #128] ; (8010860 <ETH_Prepare_Transmit_Descriptors+0xac>)
  30256. 80107e0: f200 50f4 addw r0, r0, #1524 ; 0x5f4
  30257. 80107e4: fb05 0501 mla r5, r5, r1, r0
  30258. DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
  30259. 80107e8: 04ed lsls r5, r5, #19
  30260. 80107ea: 0ced lsrs r5, r5, #19
  30261. 80107ec: 461a mov r2, r3
  30262. 80107ee: 2000 movs r0, #0
  30263. /* Setting the first segment bit */
  30264. DMATxDescToSet->Status |= ETH_DMATxDesc_FS;
  30265. }
  30266. /* Program size */
  30267. DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
  30268. 80107f0: f240 56f4 movw r6, #1524 ; 0x5f4
  30269. if (i== (buf_count-1))
  30270. 80107f4: 1e4f subs r7, r1, #1
  30271. 80107f6: e00c b.n 8010812 <ETH_Prepare_Transmit_Descriptors+0x5e>
  30272. else buf_count =1;
  30273. if (buf_count ==1)
  30274. {
  30275. /*set LAST and FIRST segment */
  30276. DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
  30277. 80107f8: 681a ldr r2, [r3, #0]
  30278. /* Set frame size */
  30279. DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
  30280. 80107fa: 04c0 lsls r0, r0, #19
  30281. else buf_count =1;
  30282. if (buf_count ==1)
  30283. {
  30284. /*set LAST and FIRST segment */
  30285. DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
  30286. 80107fc: f042 5240 orr.w r2, r2, #805306368 ; 0x30000000
  30287. /* Set frame size */
  30288. DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
  30289. 8010800: 0cc0 lsrs r0, r0, #19
  30290. else buf_count =1;
  30291. if (buf_count ==1)
  30292. {
  30293. /*set LAST and FIRST segment */
  30294. DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
  30295. 8010802: 601a str r2, [r3, #0]
  30296. /* Set frame size */
  30297. DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
  30298. 8010804: 6058 str r0, [r3, #4]
  30299. /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
  30300. DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
  30301. 8010806: 681a ldr r2, [r3, #0]
  30302. 8010808: f042 4200 orr.w r2, r2, #2147483648 ; 0x80000000
  30303. 801080c: 601a str r2, [r3, #0]
  30304. DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
  30305. 801080e: 68da ldr r2, [r3, #12]
  30306. 8010810: e014 b.n 801083c <ETH_Prepare_Transmit_Descriptors+0x88>
  30307. }
  30308. else
  30309. {
  30310. for (i=0; i< buf_count; i++)
  30311. {
  30312. if (i==0)
  30313. 8010812: b918 cbnz r0, 801081c <ETH_Prepare_Transmit_Descriptors+0x68>
  30314. {
  30315. /* Setting the first segment bit */
  30316. DMATxDescToSet->Status |= ETH_DMATxDesc_FS;
  30317. 8010814: 681c ldr r4, [r3, #0]
  30318. 8010816: f044 5480 orr.w r4, r4, #268435456 ; 0x10000000
  30319. 801081a: 601c str r4, [r3, #0]
  30320. }
  30321. /* Program size */
  30322. DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
  30323. if (i== (buf_count-1))
  30324. 801081c: 42b8 cmp r0, r7
  30325. /* Setting the first segment bit */
  30326. DMATxDescToSet->Status |= ETH_DMATxDesc_FS;
  30327. }
  30328. /* Program size */
  30329. DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
  30330. 801081e: 6056 str r6, [r2, #4]
  30331. if (i== (buf_count-1))
  30332. 8010820: d104 bne.n 801082c <ETH_Prepare_Transmit_Descriptors+0x78>
  30333. {
  30334. /* Setting the last segment bit */
  30335. DMATxNextDesc->Status |= ETH_DMATxDesc_LS;
  30336. 8010822: 6814 ldr r4, [r2, #0]
  30337. 8010824: f044 5400 orr.w r4, r4, #536870912 ; 0x20000000
  30338. 8010828: 6014 str r4, [r2, #0]
  30339. size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
  30340. DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
  30341. 801082a: 6055 str r5, [r2, #4]
  30342. }
  30343. /*give back descriptor to DMA */
  30344. DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
  30345. 801082c: 6814 ldr r4, [r2, #0]
  30346. DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
  30347. DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
  30348. }
  30349. else
  30350. {
  30351. for (i=0; i< buf_count; i++)
  30352. 801082e: 3001 adds r0, #1
  30353. size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
  30354. DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
  30355. }
  30356. /*give back descriptor to DMA */
  30357. DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
  30358. 8010830: f044 4400 orr.w r4, r4, #2147483648 ; 0x80000000
  30359. 8010834: 6014 str r4, [r2, #0]
  30360. DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
  30361. DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
  30362. }
  30363. else
  30364. {
  30365. for (i=0; i< buf_count; i++)
  30366. 8010836: 4288 cmp r0, r1
  30367. }
  30368. /*give back descriptor to DMA */
  30369. DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
  30370. DMATxNextDesc = (ETH_DMADESCTypeDef *)(DMATxNextDesc->Buffer2NextDescAddr);
  30371. 8010838: 68d2 ldr r2, [r2, #12]
  30372. DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
  30373. DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
  30374. }
  30375. else
  30376. {
  30377. for (i=0; i< buf_count; i++)
  30378. 801083a: d3ea bcc.n 8010812 <ETH_Prepare_Transmit_Descriptors+0x5e>
  30379. DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
  30380. DMATxNextDesc = (ETH_DMADESCTypeDef *)(DMATxNextDesc->Buffer2NextDescAddr);
  30381. /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
  30382. }
  30383. DMATxDescToSet = DMATxNextDesc ;
  30384. 801083c: 4b07 ldr r3, [pc, #28] ; (801085c <ETH_Prepare_Transmit_Descriptors+0xa8>)
  30385. 801083e: 601a str r2, [r3, #0]
  30386. }
  30387. /* When Tx Buffer unavailable flag is set: clear it and resume transmission */
  30388. if ((ETH->DMASR & ETH_DMASR_TBUS) != (u32)RESET)
  30389. 8010840: 4b08 ldr r3, [pc, #32] ; (8010864 <ETH_Prepare_Transmit_Descriptors+0xb0>)
  30390. 8010842: 695a ldr r2, [r3, #20]
  30391. 8010844: 0750 lsls r0, r2, #29
  30392. 8010846: d506 bpl.n 8010856 <ETH_Prepare_Transmit_Descriptors+0xa2>
  30393. {
  30394. /* Clear TBUS ETHERNET DMA flag */
  30395. ETH->DMASR = ETH_DMASR_TBUS;
  30396. 8010848: 2204 movs r2, #4
  30397. 801084a: 615a str r2, [r3, #20]
  30398. /* Resume DMA transmission*/
  30399. ETH->DMATPDR = 0;
  30400. 801084c: 2200 movs r2, #0
  30401. 801084e: 605a str r2, [r3, #4]
  30402. 8010850: e001 b.n 8010856 <ETH_Prepare_Transmit_Descriptors+0xa2>
  30403. /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
  30404. if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
  30405. {
  30406. /* Return ERROR: OWN bit set */
  30407. return ETH_ERROR;
  30408. 8010852: 2000 movs r0, #0
  30409. 8010854: bdf0 pop {r4, r5, r6, r7, pc}
  30410. /* Resume DMA transmission*/
  30411. ETH->DMATPDR = 0;
  30412. }
  30413. /* Return SUCCESS */
  30414. return ETH_SUCCESS;
  30415. 8010856: 2001 movs r0, #1
  30416. }
  30417. 8010858: bdf0 pop {r4, r5, r6, r7, pc}
  30418. 801085a: bf00 nop
  30419. 801085c: 20008cc0 .word 0x20008cc0
  30420. 8010860: fffffa0c .word 0xfffffa0c
  30421. 8010864: 40029000 .word 0x40029000
  30422. 08010868 <ETH_DMARxDescChainInit>:
  30423. {
  30424. uint32_t i = 0;
  30425. ETH_DMADESCTypeDef *DMARxDesc;
  30426. /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
  30427. DMARxDescToGet = DMARxDescTab;
  30428. 8010868: 4b11 ldr r3, [pc, #68] ; (80108b0 <ETH_DMARxDescChainInit+0x48>)
  30429. * @param RxBuff: Pointer on the first RxBuffer list
  30430. * @param RxBuffCount: Number of the used Rx desc in the list
  30431. * @retval None
  30432. */
  30433. void ETH_DMARxDescChainInit(ETH_DMADESCTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount)
  30434. {
  30435. 801086a: b5f0 push {r4, r5, r6, r7, lr}
  30436. uint32_t i = 0;
  30437. ETH_DMADESCTypeDef *DMARxDesc;
  30438. /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
  30439. DMARxDescToGet = DMARxDescTab;
  30440. 801086c: 6018 str r0, [r3, #0]
  30441. /* Fill each DMARxDesc descriptor with the right values */
  30442. for(i=0; i < RxBuffCount; i++)
  30443. 801086e: 2400 movs r4, #0
  30444. * @param DMARxDescTab: Pointer on the first Rx desc list
  30445. * @param RxBuff: Pointer on the first RxBuffer list
  30446. * @param RxBuffCount: Number of the used Rx desc in the list
  30447. * @retval None
  30448. */
  30449. void ETH_DMARxDescChainInit(ETH_DMADESCTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount)
  30450. 8010870: f100 0320 add.w r3, r0, #32
  30451. for(i=0; i < RxBuffCount; i++)
  30452. {
  30453. /* Get the pointer on the ith member of the Rx Desc list */
  30454. DMARxDesc = DMARxDescTab+i;
  30455. /* Set Own bit of the Rx descriptor Status */
  30456. DMARxDesc->Status = ETH_DMARxDesc_OWN;
  30457. 8010874: f04f 4500 mov.w r5, #2147483648 ; 0x80000000
  30458. /* Set Buffer1 size and Second Address Chained bit */
  30459. DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;
  30460. 8010878: f244 56f4 movw r6, #17908 ; 0x45f4
  30461. /* Set Buffer1 address pointer */
  30462. DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i*ETH_RX_BUF_SIZE]);
  30463. /* Initialize the next descriptor with the Next Descriptor Polling Enable */
  30464. if(i < (RxBuffCount-1))
  30465. 801087c: 1e57 subs r7, r2, #1
  30466. ETH_DMADESCTypeDef *DMARxDesc;
  30467. /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
  30468. DMARxDescToGet = DMARxDescTab;
  30469. /* Fill each DMARxDesc descriptor with the right values */
  30470. for(i=0; i < RxBuffCount; i++)
  30471. 801087e: e00f b.n 80108a0 <ETH_DMARxDescChainInit+0x38>
  30472. /* Initialize the next descriptor with the Next Descriptor Polling Enable */
  30473. if(i < (RxBuffCount-1))
  30474. {
  30475. /* Set next descriptor address register with next descriptor base address */
  30476. DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab+i+1);
  30477. 8010880: 42bc cmp r4, r7
  30478. 8010882: bf2c ite cs
  30479. 8010884: 4684 movcs ip, r0
  30480. 8010886: 469c movcc ip, r3
  30481. DMARxDesc->Status = ETH_DMARxDesc_OWN;
  30482. /* Set Buffer1 size and Second Address Chained bit */
  30483. DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;
  30484. /* Set Buffer1 address pointer */
  30485. DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i*ETH_RX_BUF_SIZE]);
  30486. 8010888: f843 1c18 str.w r1, [r3, #-24]
  30487. for(i=0; i < RxBuffCount; i++)
  30488. {
  30489. /* Get the pointer on the ith member of the Rx Desc list */
  30490. DMARxDesc = DMARxDescTab+i;
  30491. /* Set Own bit of the Rx descriptor Status */
  30492. DMARxDesc->Status = ETH_DMARxDesc_OWN;
  30493. 801088c: f843 5c20 str.w r5, [r3, #-32]
  30494. /* Set Buffer1 size and Second Address Chained bit */
  30495. DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;
  30496. 8010890: f843 6c1c str.w r6, [r3, #-28]
  30497. /* Initialize the next descriptor with the Next Descriptor Polling Enable */
  30498. if(i < (RxBuffCount-1))
  30499. {
  30500. /* Set next descriptor address register with next descriptor base address */
  30501. DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab+i+1);
  30502. 8010894: f843 cc14 str.w ip, [r3, #-20]
  30503. ETH_DMADESCTypeDef *DMARxDesc;
  30504. /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
  30505. DMARxDescToGet = DMARxDescTab;
  30506. /* Fill each DMARxDesc descriptor with the right values */
  30507. for(i=0; i < RxBuffCount; i++)
  30508. 8010898: 3401 adds r4, #1
  30509. 801089a: 3320 adds r3, #32
  30510. 801089c: f201 51f4 addw r1, r1, #1524 ; 0x5f4
  30511. 80108a0: 4294 cmp r4, r2
  30512. 80108a2: d1ed bne.n 8010880 <ETH_DMARxDescChainInit+0x18>
  30513. DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab);
  30514. }
  30515. }
  30516. /* Set Receive Descriptor List Address Register */
  30517. ETH->DMARDLAR = (uint32_t) DMARxDescTab;
  30518. 80108a4: 4b03 ldr r3, [pc, #12] ; (80108b4 <ETH_DMARxDescChainInit+0x4c>)
  30519. DMA_RX_FRAME_infos = &RX_Frame_Descriptor;
  30520. 80108a6: 4a04 ldr r2, [pc, #16] ; (80108b8 <ETH_DMARxDescChainInit+0x50>)
  30521. DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab);
  30522. }
  30523. }
  30524. /* Set Receive Descriptor List Address Register */
  30525. ETH->DMARDLAR = (uint32_t) DMARxDescTab;
  30526. 80108a8: 60d8 str r0, [r3, #12]
  30527. DMA_RX_FRAME_infos = &RX_Frame_Descriptor;
  30528. 80108aa: 4b04 ldr r3, [pc, #16] ; (80108bc <ETH_DMARxDescChainInit+0x54>)
  30529. 80108ac: 601a str r2, [r3, #0]
  30530. 80108ae: bdf0 pop {r4, r5, r6, r7, pc}
  30531. 80108b0: 20008cbc .word 0x20008cbc
  30532. 80108b4: 40029000 .word 0x40029000
  30533. 80108b8: 20008cb0 .word 0x20008cb0
  30534. 80108bc: 2000ab2c .word 0x2000ab2c
  30535. 080108c0 <ETH_CheckFrameReceived>:
  30536. * @retval Returns 1 when a frame is received, 0 if none.
  30537. */
  30538. uint32_t ETH_CheckFrameReceived(void)
  30539. {
  30540. /* check if last segment */
  30541. if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30542. 80108c0: 4b1c ldr r3, [pc, #112] ; (8010934 <ETH_CheckFrameReceived+0x74>)
  30543. 80108c2: 681b ldr r3, [r3, #0]
  30544. 80108c4: 681a ldr r2, [r3, #0]
  30545. 80108c6: 2a00 cmp r2, #0
  30546. 80108c8: db0a blt.n 80108e0 <ETH_CheckFrameReceived+0x20>
  30547. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) != (uint32_t)RESET))
  30548. 80108ca: 681a ldr r2, [r3, #0]
  30549. * @retval Returns 1 when a frame is received, 0 if none.
  30550. */
  30551. uint32_t ETH_CheckFrameReceived(void)
  30552. {
  30553. /* check if last segment */
  30554. if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30555. 80108cc: 05d1 lsls r1, r2, #23
  30556. 80108ce: d507 bpl.n 80108e0 <ETH_CheckFrameReceived+0x20>
  30557. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) != (uint32_t)RESET))
  30558. {
  30559. DMA_RX_FRAME_infos->LS_Rx_Desc = DMARxDescToGet;
  30560. 80108d0: 4a19 ldr r2, [pc, #100] ; (8010938 <ETH_CheckFrameReceived+0x78>)
  30561. 80108d2: 6812 ldr r2, [r2, #0]
  30562. 80108d4: 6053 str r3, [r2, #4]
  30563. DMA_RX_FRAME_infos->Seg_Count++;
  30564. 80108d6: 6893 ldr r3, [r2, #8]
  30565. 80108d8: 3301 adds r3, #1
  30566. 80108da: 6093 str r3, [r2, #8]
  30567. return 1;
  30568. 80108dc: 2001 movs r0, #1
  30569. 80108de: 4770 bx lr
  30570. }
  30571. /* check if first segment */
  30572. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30573. 80108e0: 681a ldr r2, [r3, #0]
  30574. 80108e2: 2a00 cmp r2, #0
  30575. 80108e4: db10 blt.n 8010908 <ETH_CheckFrameReceived+0x48>
  30576. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
  30577. 80108e6: 681a ldr r2, [r3, #0]
  30578. DMA_RX_FRAME_infos->Seg_Count++;
  30579. return 1;
  30580. }
  30581. /* check if first segment */
  30582. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30583. 80108e8: 0592 lsls r2, r2, #22
  30584. 80108ea: d50d bpl.n 8010908 <ETH_CheckFrameReceived+0x48>
  30585. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
  30586. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
  30587. 80108ec: 6818 ldr r0, [r3, #0]
  30588. return 1;
  30589. }
  30590. /* check if first segment */
  30591. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30592. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
  30593. 80108ee: f410 7080 ands.w r0, r0, #256 ; 0x100
  30594. 80108f2: d109 bne.n 8010908 <ETH_CheckFrameReceived+0x48>
  30595. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
  30596. {
  30597. DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
  30598. 80108f4: 4a10 ldr r2, [pc, #64] ; (8010938 <ETH_CheckFrameReceived+0x78>)
  30599. 80108f6: 6812 ldr r2, [r2, #0]
  30600. DMA_RX_FRAME_infos->LS_Rx_Desc = NULL;
  30601. DMA_RX_FRAME_infos->Seg_Count = 1;
  30602. 80108f8: 2101 movs r1, #1
  30603. /* check if first segment */
  30604. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30605. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
  30606. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
  30607. {
  30608. DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
  30609. 80108fa: 6013 str r3, [r2, #0]
  30610. DMA_RX_FRAME_infos->LS_Rx_Desc = NULL;
  30611. 80108fc: 6050 str r0, [r2, #4]
  30612. DMA_RX_FRAME_infos->Seg_Count = 1;
  30613. 80108fe: 6091 str r1, [r2, #8]
  30614. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30615. 8010900: 68da ldr r2, [r3, #12]
  30616. 8010902: 4b0c ldr r3, [pc, #48] ; (8010934 <ETH_CheckFrameReceived+0x74>)
  30617. 8010904: 601a str r2, [r3, #0]
  30618. 8010906: 4770 bx lr
  30619. }
  30620. /* check if intermediate segment */
  30621. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30622. 8010908: 681a ldr r2, [r3, #0]
  30623. 801090a: 2a00 cmp r2, #0
  30624. 801090c: db0f blt.n 801092e <ETH_CheckFrameReceived+0x6e>
  30625. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
  30626. 801090e: 6818 ldr r0, [r3, #0]
  30627. DMA_RX_FRAME_infos->Seg_Count = 1;
  30628. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30629. }
  30630. /* check if intermediate segment */
  30631. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30632. 8010910: f410 7000 ands.w r0, r0, #512 ; 0x200
  30633. 8010914: d10b bne.n 801092e <ETH_CheckFrameReceived+0x6e>
  30634. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
  30635. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
  30636. 8010916: 681a ldr r2, [r3, #0]
  30637. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30638. }
  30639. /* check if intermediate segment */
  30640. else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
  30641. ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
  30642. 8010918: f412 7180 ands.w r1, r2, #256 ; 0x100
  30643. 801091c: d108 bne.n 8010930 <ETH_CheckFrameReceived+0x70>
  30644. ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
  30645. {
  30646. (DMA_RX_FRAME_infos->Seg_Count) ++;
  30647. 801091e: 4a06 ldr r2, [pc, #24] ; (8010938 <ETH_CheckFrameReceived+0x78>)
  30648. 8010920: 6812 ldr r2, [r2, #0]
  30649. 8010922: 6890 ldr r0, [r2, #8]
  30650. 8010924: 3001 adds r0, #1
  30651. 8010926: 6090 str r0, [r2, #8]
  30652. DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
  30653. 8010928: 68da ldr r2, [r3, #12]
  30654. 801092a: 4b02 ldr r3, [pc, #8] ; (8010934 <ETH_CheckFrameReceived+0x74>)
  30655. 801092c: 601a str r2, [r3, #0]
  30656. }
  30657. return 0;
  30658. 801092e: 2000 movs r0, #0
  30659. }
  30660. 8010930: 4770 bx lr
  30661. 8010932: bf00 nop
  30662. 8010934: 20008cbc .word 0x20008cbc
  30663. 8010938: 2000ab2c .word 0x2000ab2c
  30664. 0801093c <ETH_DMATxDescChainInit>:
  30665. {
  30666. uint32_t i = 0;
  30667. ETH_DMADESCTypeDef *DMATxDesc;
  30668. /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
  30669. DMATxDescToSet = DMATxDescTab;
  30670. 801093c: 4b0e ldr r3, [pc, #56] ; (8010978 <ETH_DMATxDescChainInit+0x3c>)
  30671. * @param TxBuff: Pointer on the first TxBuffer list
  30672. * @param TxBuffCount: Number of the used Tx desc in the list
  30673. * @retval None
  30674. */
  30675. void ETH_DMATxDescChainInit(ETH_DMADESCTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount)
  30676. {
  30677. 801093e: b5f0 push {r4, r5, r6, r7, lr}
  30678. uint32_t i = 0;
  30679. ETH_DMADESCTypeDef *DMATxDesc;
  30680. /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
  30681. DMATxDescToSet = DMATxDescTab;
  30682. 8010940: 6018 str r0, [r3, #0]
  30683. /* Fill each DMATxDesc descriptor with the right values */
  30684. for(i=0; i < TxBuffCount; i++)
  30685. 8010942: 2400 movs r4, #0
  30686. * @param DMATxDescTab: Pointer on the first Tx desc list
  30687. * @param TxBuff: Pointer on the first TxBuffer list
  30688. * @param TxBuffCount: Number of the used Tx desc in the list
  30689. * @retval None
  30690. */
  30691. void ETH_DMATxDescChainInit(ETH_DMADESCTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount)
  30692. 8010944: f100 0320 add.w r3, r0, #32
  30693. for(i=0; i < TxBuffCount; i++)
  30694. {
  30695. /* Get the pointer on the ith member of the Tx Desc list */
  30696. DMATxDesc = DMATxDescTab + i;
  30697. /* Set Second Address Chained bit */
  30698. DMATxDesc->Status = ETH_DMATxDesc_TCH;
  30699. 8010948: f44f 1580 mov.w r5, #1048576 ; 0x100000
  30700. /* Set Buffer1 address pointer */
  30701. DMATxDesc->Buffer1Addr = (uint32_t)(&TxBuff[i*ETH_TX_BUF_SIZE]);
  30702. /* Initialize the next descriptor with the Next Descriptor Polling Enable */
  30703. if(i < (TxBuffCount-1))
  30704. 801094c: 1e56 subs r6, r2, #1
  30705. ETH_DMADESCTypeDef *DMATxDesc;
  30706. /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
  30707. DMATxDescToSet = DMATxDescTab;
  30708. /* Fill each DMATxDesc descriptor with the right values */
  30709. for(i=0; i < TxBuffCount; i++)
  30710. 801094e: e00d b.n 801096c <ETH_DMATxDescChainInit+0x30>
  30711. /* Initialize the next descriptor with the Next Descriptor Polling Enable */
  30712. if(i < (TxBuffCount-1))
  30713. {
  30714. /* Set next descriptor address register with next descriptor base address */
  30715. DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1);
  30716. 8010950: 42b4 cmp r4, r6
  30717. 8010952: bf2c ite cs
  30718. 8010954: 4607 movcs r7, r0
  30719. 8010956: 461f movcc r7, r3
  30720. DMATxDesc = DMATxDescTab + i;
  30721. /* Set Second Address Chained bit */
  30722. DMATxDesc->Status = ETH_DMATxDesc_TCH;
  30723. /* Set Buffer1 address pointer */
  30724. DMATxDesc->Buffer1Addr = (uint32_t)(&TxBuff[i*ETH_TX_BUF_SIZE]);
  30725. 8010958: f843 1c18 str.w r1, [r3, #-24]
  30726. for(i=0; i < TxBuffCount; i++)
  30727. {
  30728. /* Get the pointer on the ith member of the Tx Desc list */
  30729. DMATxDesc = DMATxDescTab + i;
  30730. /* Set Second Address Chained bit */
  30731. DMATxDesc->Status = ETH_DMATxDesc_TCH;
  30732. 801095c: f843 5c20 str.w r5, [r3, #-32]
  30733. /* Initialize the next descriptor with the Next Descriptor Polling Enable */
  30734. if(i < (TxBuffCount-1))
  30735. {
  30736. /* Set next descriptor address register with next descriptor base address */
  30737. DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1);
  30738. 8010960: f843 7c14 str.w r7, [r3, #-20]
  30739. ETH_DMADESCTypeDef *DMATxDesc;
  30740. /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
  30741. DMATxDescToSet = DMATxDescTab;
  30742. /* Fill each DMATxDesc descriptor with the right values */
  30743. for(i=0; i < TxBuffCount; i++)
  30744. 8010964: 3401 adds r4, #1
  30745. 8010966: 3320 adds r3, #32
  30746. 8010968: f201 51f4 addw r1, r1, #1524 ; 0x5f4
  30747. 801096c: 4294 cmp r4, r2
  30748. 801096e: d1ef bne.n 8010950 <ETH_DMATxDescChainInit+0x14>
  30749. DMATxDesc->Buffer2NextDescAddr = (uint32_t) DMATxDescTab;
  30750. }
  30751. }
  30752. /* Set Transmit Desciptor List Address Register */
  30753. ETH->DMATDLAR = (uint32_t) DMATxDescTab;
  30754. 8010970: 4b02 ldr r3, [pc, #8] ; (801097c <ETH_DMATxDescChainInit+0x40>)
  30755. 8010972: 6118 str r0, [r3, #16]
  30756. 8010974: bdf0 pop {r4, r5, r6, r7, pc}
  30757. 8010976: bf00 nop
  30758. 8010978: 20008cc0 .word 0x20008cc0
  30759. 801097c: 40029000 .word 0x40029000
  30760. 08010980 <ETH_DMATxDescChecksumInsertionConfig>:
  30761. {
  30762. /* Check the parameters */
  30763. assert_param(IS_ETH_DMA_TXDESC_CHECKSUM(DMATxDesc_Checksum));
  30764. /* Set the selected DMA Tx desc checksum insertion control */
  30765. DMATxDesc->Status |= DMATxDesc_Checksum;
  30766. 8010980: 6803 ldr r3, [r0, #0]
  30767. 8010982: 4319 orrs r1, r3
  30768. 8010984: 6001 str r1, [r0, #0]
  30769. 8010986: 4770 bx lr
  30770. 08010988 <ETH_SoftwareReset>:
  30771. */
  30772. void ETH_SoftwareReset(void)
  30773. {
  30774. /* Set the SWR bit: resets all MAC subsystem internal registers and logic */
  30775. /* After reset all the registers holds their respective reset values */
  30776. ETH->DMABMR |= ETH_DMABMR_SR;
  30777. 8010988: 4b02 ldr r3, [pc, #8] ; (8010994 <ETH_SoftwareReset+0xc>)
  30778. 801098a: 681a ldr r2, [r3, #0]
  30779. 801098c: f042 0201 orr.w r2, r2, #1
  30780. 8010990: 601a str r2, [r3, #0]
  30781. 8010992: 4770 bx lr
  30782. 8010994: 40029000 .word 0x40029000
  30783. 08010998 <ETH_GetSoftwareResetStatus>:
  30784. * @retval The new state of DMA Bus Mode register SR bit (SET or RESET).
  30785. */
  30786. FlagStatus ETH_GetSoftwareResetStatus(void)
  30787. {
  30788. FlagStatus bitstatus = RESET;
  30789. if((ETH->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
  30790. 8010998: 4b02 ldr r3, [pc, #8] ; (80109a4 <ETH_GetSoftwareResetStatus+0xc>)
  30791. 801099a: 6818 ldr r0, [r3, #0]
  30792. else
  30793. {
  30794. bitstatus = RESET;
  30795. }
  30796. return bitstatus;
  30797. }
  30798. 801099c: f000 0001 and.w r0, r0, #1
  30799. 80109a0: 4770 bx lr
  30800. 80109a2: bf00 nop
  30801. 80109a4: 40029000 .word 0x40029000
  30802. 080109a8 <ETH_DMAITConfig>:
  30803. * @param NewState: new state of the specified ETHERNET DMA interrupts.
  30804. * This parameter can be: ENABLE or DISABLE.
  30805. * @retval None
  30806. */
  30807. void ETH_DMAITConfig(uint32_t ETH_DMA_IT, FunctionalState NewState)
  30808. {
  30809. 80109a8: 4b04 ldr r3, [pc, #16] ; (80109bc <ETH_DMAITConfig+0x14>)
  30810. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30811. if (NewState != DISABLE)
  30812. {
  30813. /* Enable the selected ETHERNET DMA interrupts */
  30814. ETH->DMAIER |= ETH_DMA_IT;
  30815. 80109aa: 69da ldr r2, [r3, #28]
  30816. {
  30817. /* Check the parameters */
  30818. assert_param(IS_ETH_DMA_IT(ETH_DMA_IT));
  30819. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30820. if (NewState != DISABLE)
  30821. 80109ac: b109 cbz r1, 80109b2 <ETH_DMAITConfig+0xa>
  30822. {
  30823. /* Enable the selected ETHERNET DMA interrupts */
  30824. ETH->DMAIER |= ETH_DMA_IT;
  30825. 80109ae: 4310 orrs r0, r2
  30826. 80109b0: e001 b.n 80109b6 <ETH_DMAITConfig+0xe>
  30827. }
  30828. else
  30829. {
  30830. /* Disable the selected ETHERNET DMA interrupts */
  30831. ETH->DMAIER &=(~(uint32_t)ETH_DMA_IT);
  30832. 80109b2: ea22 0000 bic.w r0, r2, r0
  30833. 80109b6: 61d8 str r0, [r3, #28]
  30834. 80109b8: 4770 bx lr
  30835. 80109ba: bf00 nop
  30836. 80109bc: 40029000 .word 0x40029000
  30837. 080109c0 <ETH_FlushTransmitFIFO>:
  30838. * @retval None
  30839. */
  30840. void ETH_FlushTransmitFIFO(void)
  30841. {
  30842. /* Set the Flush Transmit FIFO bit */
  30843. ETH->DMAOMR |= ETH_DMAOMR_FTF;
  30844. 80109c0: 4b02 ldr r3, [pc, #8] ; (80109cc <ETH_FlushTransmitFIFO+0xc>)
  30845. 80109c2: 699a ldr r2, [r3, #24]
  30846. 80109c4: f442 1280 orr.w r2, r2, #1048576 ; 0x100000
  30847. 80109c8: 619a str r2, [r3, #24]
  30848. 80109ca: 4770 bx lr
  30849. 80109cc: 40029000 .word 0x40029000
  30850. 080109d0 <ETH_DMATransmissionCmd>:
  30851. * @param NewState: new state of the DMA transmission.
  30852. * This parameter can be: ENABLE or DISABLE.
  30853. * @retval None
  30854. */
  30855. void ETH_DMATransmissionCmd(FunctionalState NewState)
  30856. {
  30857. 80109d0: 4b04 ldr r3, [pc, #16] ; (80109e4 <ETH_DMATransmissionCmd+0x14>)
  30858. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30859. if (NewState != DISABLE)
  30860. {
  30861. /* Enable the DMA transmission */
  30862. ETH->DMAOMR |= ETH_DMAOMR_ST;
  30863. 80109d2: 699a ldr r2, [r3, #24]
  30864. void ETH_DMATransmissionCmd(FunctionalState NewState)
  30865. {
  30866. /* Check the parameters */
  30867. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30868. if (NewState != DISABLE)
  30869. 80109d4: b110 cbz r0, 80109dc <ETH_DMATransmissionCmd+0xc>
  30870. {
  30871. /* Enable the DMA transmission */
  30872. ETH->DMAOMR |= ETH_DMAOMR_ST;
  30873. 80109d6: f442 5200 orr.w r2, r2, #8192 ; 0x2000
  30874. 80109da: e001 b.n 80109e0 <ETH_DMATransmissionCmd+0x10>
  30875. }
  30876. else
  30877. {
  30878. /* Disable the DMA transmission */
  30879. ETH->DMAOMR &= ~ETH_DMAOMR_ST;
  30880. 80109dc: f422 5200 bic.w r2, r2, #8192 ; 0x2000
  30881. 80109e0: 619a str r2, [r3, #24]
  30882. 80109e2: 4770 bx lr
  30883. 80109e4: 40029000 .word 0x40029000
  30884. 080109e8 <ETH_DMAReceptionCmd>:
  30885. * @param NewState: new state of the DMA reception.
  30886. * This parameter can be: ENABLE or DISABLE.
  30887. * @retval None
  30888. */
  30889. void ETH_DMAReceptionCmd(FunctionalState NewState)
  30890. {
  30891. 80109e8: 4b04 ldr r3, [pc, #16] ; (80109fc <ETH_DMAReceptionCmd+0x14>)
  30892. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30893. if (NewState != DISABLE)
  30894. {
  30895. /* Enable the DMA reception */
  30896. ETH->DMAOMR |= ETH_DMAOMR_SR;
  30897. 80109ea: 699a ldr r2, [r3, #24]
  30898. void ETH_DMAReceptionCmd(FunctionalState NewState)
  30899. {
  30900. /* Check the parameters */
  30901. assert_param(IS_FUNCTIONAL_STATE(NewState));
  30902. if (NewState != DISABLE)
  30903. 80109ec: b110 cbz r0, 80109f4 <ETH_DMAReceptionCmd+0xc>
  30904. {
  30905. /* Enable the DMA reception */
  30906. ETH->DMAOMR |= ETH_DMAOMR_SR;
  30907. 80109ee: f042 0202 orr.w r2, r2, #2
  30908. 80109f2: e001 b.n 80109f8 <ETH_DMAReceptionCmd+0x10>
  30909. }
  30910. else
  30911. {
  30912. /* Disable the DMA reception */
  30913. ETH->DMAOMR &= ~ETH_DMAOMR_SR;
  30914. 80109f4: f022 0202 bic.w r2, r2, #2
  30915. 80109f8: 619a str r2, [r3, #24]
  30916. 80109fa: 4770 bx lr
  30917. 80109fc: 40029000 .word 0x40029000
  30918. 08010a00 <ETH_Start>:
  30919. * @brief Enables ENET MAC and DMA reception/transmission
  30920. * @param None
  30921. * @retval None
  30922. */
  30923. void ETH_Start(void)
  30924. {
  30925. 8010a00: b508 push {r3, lr}
  30926. /* Enable transmit state machine of the MAC for transmission on the MII */
  30927. ETH_MACTransmissionCmd(ENABLE);
  30928. 8010a02: 2001 movs r0, #1
  30929. 8010a04: f7ff fe8c bl 8010720 <ETH_MACTransmissionCmd>
  30930. /* Flush Transmit FIFO */
  30931. ETH_FlushTransmitFIFO();
  30932. 8010a08: f7ff ffda bl 80109c0 <ETH_FlushTransmitFIFO>
  30933. /* Enable receive state machine of the MAC for reception from the MII */
  30934. ETH_MACReceptionCmd(ENABLE);
  30935. 8010a0c: 2001 movs r0, #1
  30936. 8010a0e: f7ff fe93 bl 8010738 <ETH_MACReceptionCmd>
  30937. /* Start DMA transmission */
  30938. ETH_DMATransmissionCmd(ENABLE);
  30939. 8010a12: 2001 movs r0, #1
  30940. 8010a14: f7ff ffdc bl 80109d0 <ETH_DMATransmissionCmd>
  30941. /* Start DMA reception */
  30942. ETH_DMAReceptionCmd(ENABLE);
  30943. 8010a18: 2001 movs r0, #1
  30944. }
  30945. 8010a1a: e8bd 4008 ldmia.w sp!, {r3, lr}
  30946. ETH_MACReceptionCmd(ENABLE);
  30947. /* Start DMA transmission */
  30948. ETH_DMATransmissionCmd(ENABLE);
  30949. /* Start DMA reception */
  30950. ETH_DMAReceptionCmd(ENABLE);
  30951. 8010a1e: f7ff bfe3 b.w 80109e8 <ETH_DMAReceptionCmd>
  30952. 8010a22: 0000 movs r0, r0
  30953. 08010a24 <ETH_ReadPHYRegister>:
  30954. * @arg More PHY register could be read depending on the used PHY
  30955. * @retval ETH_ERROR: in case of timeout
  30956. * MAC MIIDR register value: Data read from the selected PHY register (correct read )
  30957. */
  30958. uint16_t ETH_ReadPHYRegister(uint16_t PHYAddress, uint16_t PHYReg)
  30959. {
  30960. 8010a24: b082 sub sp, #8
  30961. uint32_t tmpreg = 0;
  30962. __IO uint32_t timeout = 0;
  30963. 8010a26: 2300 movs r3, #0
  30964. 8010a28: 9301 str r3, [sp, #4]
  30965. /* Check the parameters */
  30966. assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
  30967. assert_param(IS_ETH_PHY_REG(PHYReg));
  30968. /* Get the ETHERNET MACMIIAR value */
  30969. tmpreg = ETH->MACMIIAR;
  30970. 8010a2a: 4b11 ldr r3, [pc, #68] ; (8010a70 <ETH_ReadPHYRegister+0x4c>)
  30971. 8010a2c: 691a ldr r2, [r3, #16]
  30972. /* Keep only the CSR Clock Range CR[2:0] bits value */
  30973. tmpreg &= ~MACMIIAR_CR_MASK;
  30974. /* Prepare the MII address register value */
  30975. tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
  30976. 8010a2e: 06c0 lsls r0, r0, #27
  30977. assert_param(IS_ETH_PHY_REG(PHYReg));
  30978. /* Get the ETHERNET MACMIIAR value */
  30979. tmpreg = ETH->MACMIIAR;
  30980. /* Keep only the CSR Clock Range CR[2:0] bits value */
  30981. tmpreg &= ~MACMIIAR_CR_MASK;
  30982. 8010a30: f002 021c and.w r2, r2, #28
  30983. /* Prepare the MII address register value */
  30984. tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
  30985. tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
  30986. 8010a34: 0189 lsls r1, r1, #6
  30987. /* Get the ETHERNET MACMIIAR value */
  30988. tmpreg = ETH->MACMIIAR;
  30989. /* Keep only the CSR Clock Range CR[2:0] bits value */
  30990. tmpreg &= ~MACMIIAR_CR_MASK;
  30991. /* Prepare the MII address register value */
  30992. tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
  30993. 8010a36: ea42 4210 orr.w r2, r2, r0, lsr #16
  30994. tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
  30995. 8010a3a: f401 61f8 and.w r1, r1, #1984 ; 0x7c0
  30996. tmpreg &= ~ETH_MACMIIAR_MW; /* Set the read mode */
  30997. 8010a3e: 430a orrs r2, r1
  30998. tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
  30999. 8010a40: f042 0201 orr.w r2, r2, #1
  31000. /* Write the result value into the MII Address register */
  31001. ETH->MACMIIAR = tmpreg;
  31002. 8010a44: 611a str r2, [r3, #16]
  31003. /* Check for the Busy flag */
  31004. do
  31005. {
  31006. timeout++;
  31007. tmpreg = ETH->MACMIIAR;
  31008. } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
  31009. 8010a46: 4a0b ldr r2, [pc, #44] ; (8010a74 <ETH_ReadPHYRegister+0x50>)
  31010. /* Write the result value into the MII Address register */
  31011. ETH->MACMIIAR = tmpreg;
  31012. /* Check for the Busy flag */
  31013. do
  31014. {
  31015. timeout++;
  31016. 8010a48: 9901 ldr r1, [sp, #4]
  31017. 8010a4a: 3101 adds r1, #1
  31018. 8010a4c: 9101 str r1, [sp, #4]
  31019. tmpreg = ETH->MACMIIAR;
  31020. 8010a4e: 6919 ldr r1, [r3, #16]
  31021. } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
  31022. 8010a50: 07c9 lsls r1, r1, #31
  31023. 8010a52: d502 bpl.n 8010a5a <ETH_ReadPHYRegister+0x36>
  31024. 8010a54: 9901 ldr r1, [sp, #4]
  31025. 8010a56: 4291 cmp r1, r2
  31026. 8010a58: d9f6 bls.n 8010a48 <ETH_ReadPHYRegister+0x24>
  31027. /* Return ERROR in case of timeout */
  31028. if(timeout == PHY_READ_TO)
  31029. 8010a5a: 4b07 ldr r3, [pc, #28] ; (8010a78 <ETH_ReadPHYRegister+0x54>)
  31030. 8010a5c: 9a01 ldr r2, [sp, #4]
  31031. 8010a5e: 429a cmp r2, r3
  31032. {
  31033. return (uint16_t)ETH_ERROR;
  31034. }
  31035. /* Return data register value */
  31036. return (uint16_t)(ETH->MACMIIDR);
  31037. 8010a60: bf1d ittte ne
  31038. 8010a62: 4b03 ldrne r3, [pc, #12] ; (8010a70 <ETH_ReadPHYRegister+0x4c>)
  31039. 8010a64: 6958 ldrne r0, [r3, #20]
  31040. 8010a66: b280 uxthne r0, r0
  31041. tmpreg = ETH->MACMIIAR;
  31042. } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
  31043. /* Return ERROR in case of timeout */
  31044. if(timeout == PHY_READ_TO)
  31045. {
  31046. return (uint16_t)ETH_ERROR;
  31047. 8010a68: 2000 moveq r0, #0
  31048. }
  31049. /* Return data register value */
  31050. return (uint16_t)(ETH->MACMIIDR);
  31051. }
  31052. 8010a6a: b002 add sp, #8
  31053. 8010a6c: 4770 bx lr
  31054. 8010a6e: bf00 nop
  31055. 8010a70: 40028000 .word 0x40028000
  31056. 8010a74: 0004fffe .word 0x0004fffe
  31057. 8010a78: 0004ffff .word 0x0004ffff
  31058. 08010a7c <ETH_WritePHYRegister>:
  31059. * @param PHYValue: the value to write
  31060. * @retval ETH_ERROR: in case of timeout
  31061. * ETH_SUCCESS: for correct write
  31062. */
  31063. uint32_t ETH_WritePHYRegister(uint16_t PHYAddress, uint16_t PHYReg, uint16_t PHYValue)
  31064. {
  31065. 8010a7c: b513 push {r0, r1, r4, lr}
  31066. uint32_t tmpreg = 0;
  31067. __IO uint32_t timeout = 0;
  31068. 8010a7e: 2300 movs r3, #0
  31069. 8010a80: 9301 str r3, [sp, #4]
  31070. /* Check the parameters */
  31071. assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
  31072. assert_param(IS_ETH_PHY_REG(PHYReg));
  31073. /* Get the ETHERNET MACMIIAR value */
  31074. tmpreg = ETH->MACMIIAR;
  31075. 8010a82: 4b0f ldr r3, [pc, #60] ; (8010ac0 <ETH_WritePHYRegister+0x44>)
  31076. 8010a84: 691c ldr r4, [r3, #16]
  31077. tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
  31078. tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
  31079. tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */
  31080. tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
  31081. /* Give the value to the MII data register */
  31082. ETH->MACMIIDR = PHYValue;
  31083. 8010a86: 615a str r2, [r3, #20]
  31084. assert_param(IS_ETH_PHY_REG(PHYReg));
  31085. /* Get the ETHERNET MACMIIAR value */
  31086. tmpreg = ETH->MACMIIAR;
  31087. /* Keep only the CSR Clock Range CR[2:0] bits value */
  31088. tmpreg &= ~MACMIIAR_CR_MASK;
  31089. 8010a88: f004 041c and.w r4, r4, #28
  31090. /* Prepare the MII register address value */
  31091. tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
  31092. 8010a8c: f044 0403 orr.w r4, r4, #3
  31093. 8010a90: 06c0 lsls r0, r0, #27
  31094. tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
  31095. 8010a92: 0189 lsls r1, r1, #6
  31096. 8010a94: ea44 4410 orr.w r4, r4, r0, lsr #16
  31097. 8010a98: f401 61f8 and.w r1, r1, #1984 ; 0x7c0
  31098. tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */
  31099. tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
  31100. 8010a9c: 430c orrs r4, r1
  31101. /* Check for the Busy flag */
  31102. do
  31103. {
  31104. timeout++;
  31105. tmpreg = ETH->MACMIIAR;
  31106. } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_WRITE_TO));
  31107. 8010a9e: 4a09 ldr r2, [pc, #36] ; (8010ac4 <ETH_WritePHYRegister+0x48>)
  31108. tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */
  31109. tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
  31110. /* Give the value to the MII data register */
  31111. ETH->MACMIIDR = PHYValue;
  31112. /* Write the result value into the MII Address register */
  31113. ETH->MACMIIAR = tmpreg;
  31114. 8010aa0: 611c str r4, [r3, #16]
  31115. /* Check for the Busy flag */
  31116. do
  31117. {
  31118. timeout++;
  31119. 8010aa2: 9901 ldr r1, [sp, #4]
  31120. 8010aa4: 3101 adds r1, #1
  31121. 8010aa6: 9101 str r1, [sp, #4]
  31122. tmpreg = ETH->MACMIIAR;
  31123. 8010aa8: 6919 ldr r1, [r3, #16]
  31124. } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_WRITE_TO));
  31125. 8010aaa: 07c8 lsls r0, r1, #31
  31126. 8010aac: d502 bpl.n 8010ab4 <ETH_WritePHYRegister+0x38>
  31127. 8010aae: 9901 ldr r1, [sp, #4]
  31128. 8010ab0: 4291 cmp r1, r2
  31129. 8010ab2: d9f6 bls.n 8010aa2 <ETH_WritePHYRegister+0x26>
  31130. /* Return ERROR in case of timeout */
  31131. if(timeout == PHY_WRITE_TO)
  31132. 8010ab4: 9801 ldr r0, [sp, #4]
  31133. return ETH_ERROR;
  31134. }
  31135. /* Return SUCCESS */
  31136. return ETH_SUCCESS;
  31137. }
  31138. 8010ab6: 4b04 ldr r3, [pc, #16] ; (8010ac8 <ETH_WritePHYRegister+0x4c>)
  31139. 8010ab8: 1ac0 subs r0, r0, r3
  31140. 8010aba: bf18 it ne
  31141. 8010abc: 2001 movne r0, #1
  31142. 8010abe: bd1c pop {r2, r3, r4, pc}
  31143. 8010ac0: 40028000 .word 0x40028000
  31144. 8010ac4: 0004fffe .word 0x0004fffe
  31145. 8010ac8: 0004ffff .word 0x0004ffff
  31146. 08010acc <ETH_Init>:
  31147. * @param PHYAddress: external PHY address
  31148. * @retval ETH_ERROR: Ethernet initialization failed
  31149. * ETH_SUCCESS: Ethernet successfully initialized
  31150. */
  31151. uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
  31152. {
  31153. 8010acc: b5f0 push {r4, r5, r6, r7, lr}
  31154. 8010ace: b087 sub sp, #28
  31155. uint32_t RegValue = 0, tmpreg = 0;
  31156. __IO uint32_t i = 0;
  31157. 8010ad0: 2300 movs r3, #0
  31158. assert_param(IS_ETH_DMA_DESC_SKIP_LENGTH(ETH_InitStruct->ETH_DescriptorSkipLength));
  31159. assert_param(IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(ETH_InitStruct->ETH_DMAArbitration));
  31160. /*-------------------------------- MAC Config ------------------------------*/
  31161. /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
  31162. /* Get the ETHERNET MACMIIAR value */
  31163. tmpreg = ETH->MACMIIAR;
  31164. 8010ad2: 4f90 ldr r7, [pc, #576] ; (8010d14 <ETH_Init+0x248>)
  31165. * ETH_SUCCESS: Ethernet successfully initialized
  31166. */
  31167. uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
  31168. {
  31169. uint32_t RegValue = 0, tmpreg = 0;
  31170. __IO uint32_t i = 0;
  31171. 8010ad4: 9300 str r3, [sp, #0]
  31172. * @param PHYAddress: external PHY address
  31173. * @retval ETH_ERROR: Ethernet initialization failed
  31174. * ETH_SUCCESS: Ethernet successfully initialized
  31175. */
  31176. uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
  31177. {
  31178. 8010ad6: 4604 mov r4, r0
  31179. uint32_t RegValue = 0, tmpreg = 0;
  31180. __IO uint32_t i = 0;
  31181. RCC_ClocksTypeDef rcc_clocks;
  31182. uint32_t hclk = 60000000;
  31183. __IO uint32_t timeout = 0;
  31184. 8010ad8: 9301 str r3, [sp, #4]
  31185. /* Get the ETHERNET MACMIIAR value */
  31186. tmpreg = ETH->MACMIIAR;
  31187. /* Clear CSR Clock Range CR[2:0] bits */
  31188. tmpreg &= MACMIIAR_CR_MASK;
  31189. /* Get hclk frequency value */
  31190. RCC_GetClocksFreq(&rcc_clocks);
  31191. 8010ada: a802 add r0, sp, #8
  31192. * @param PHYAddress: external PHY address
  31193. * @retval ETH_ERROR: Ethernet initialization failed
  31194. * ETH_SUCCESS: Ethernet successfully initialized
  31195. */
  31196. uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
  31197. {
  31198. 8010adc: 460e mov r6, r1
  31199. assert_param(IS_ETH_DMA_DESC_SKIP_LENGTH(ETH_InitStruct->ETH_DescriptorSkipLength));
  31200. assert_param(IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(ETH_InitStruct->ETH_DMAArbitration));
  31201. /*-------------------------------- MAC Config ------------------------------*/
  31202. /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
  31203. /* Get the ETHERNET MACMIIAR value */
  31204. tmpreg = ETH->MACMIIAR;
  31205. 8010ade: 693d ldr r5, [r7, #16]
  31206. /* Clear CSR Clock Range CR[2:0] bits */
  31207. tmpreg &= MACMIIAR_CR_MASK;
  31208. /* Get hclk frequency value */
  31209. RCC_GetClocksFreq(&rcc_clocks);
  31210. 8010ae0: f7f9 fa12 bl 8009f08 <RCC_GetClocksFreq>
  31211. hclk = rcc_clocks.HCLK_Frequency;
  31212. 8010ae4: 9b03 ldr r3, [sp, #12]
  31213. /* Set CR bits depending on hclk value */
  31214. if((hclk >= 20000000)&&(hclk < 35000000))
  31215. 8010ae6: 4a8c ldr r2, [pc, #560] ; (8010d18 <ETH_Init+0x24c>)
  31216. 8010ae8: 498c ldr r1, [pc, #560] ; (8010d1c <ETH_Init+0x250>)
  31217. 8010aea: 189a adds r2, r3, r2
  31218. 8010aec: 428a cmp r2, r1
  31219. /*-------------------------------- MAC Config ------------------------------*/
  31220. /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
  31221. /* Get the ETHERNET MACMIIAR value */
  31222. tmpreg = ETH->MACMIIAR;
  31223. /* Clear CSR Clock Range CR[2:0] bits */
  31224. tmpreg &= MACMIIAR_CR_MASK;
  31225. 8010aee: f025 051c bic.w r5, r5, #28
  31226. /* Get hclk frequency value */
  31227. RCC_GetClocksFreq(&rcc_clocks);
  31228. hclk = rcc_clocks.HCLK_Frequency;
  31229. /* Set CR bits depending on hclk value */
  31230. if((hclk >= 20000000)&&(hclk < 35000000))
  31231. 8010af2: d802 bhi.n 8010afa <ETH_Init+0x2e>
  31232. {
  31233. /* CSR Clock Range between 20-35 MHz */
  31234. tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div16;
  31235. 8010af4: f045 0508 orr.w r5, r5, #8
  31236. 8010af8: e015 b.n 8010b26 <ETH_Init+0x5a>
  31237. }
  31238. else if((hclk >= 35000000)&&(hclk < 60000000))
  31239. 8010afa: 4a89 ldr r2, [pc, #548] ; (8010d20 <ETH_Init+0x254>)
  31240. 8010afc: 4989 ldr r1, [pc, #548] ; (8010d24 <ETH_Init+0x258>)
  31241. 8010afe: 189a adds r2, r3, r2
  31242. 8010b00: 428a cmp r2, r1
  31243. 8010b02: d802 bhi.n 8010b0a <ETH_Init+0x3e>
  31244. {
  31245. /* CSR Clock Range between 35-60 MHz */
  31246. tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div26;
  31247. 8010b04: f045 050c orr.w r5, r5, #12
  31248. 8010b08: e00d b.n 8010b26 <ETH_Init+0x5a>
  31249. }
  31250. else if((hclk >= 60000000)&&(hclk < 100000000))
  31251. 8010b0a: 4a87 ldr r2, [pc, #540] ; (8010d28 <ETH_Init+0x25c>)
  31252. 8010b0c: 4987 ldr r1, [pc, #540] ; (8010d2c <ETH_Init+0x260>)
  31253. 8010b0e: 189a adds r2, r3, r2
  31254. 8010b10: 428a cmp r2, r1
  31255. 8010b12: d908 bls.n 8010b26 <ETH_Init+0x5a>
  31256. {
  31257. /* CSR Clock Range between 60-100 MHz */
  31258. tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div42;
  31259. }
  31260. else if((hclk >= 100000000)&&(hclk < 150000000))
  31261. 8010b14: 4a86 ldr r2, [pc, #536] ; (8010d30 <ETH_Init+0x264>)
  31262. 8010b16: 189a adds r2, r3, r2
  31263. 8010b18: 4b86 ldr r3, [pc, #536] ; (8010d34 <ETH_Init+0x268>)
  31264. 8010b1a: 429a cmp r2, r3
  31265. {
  31266. /* CSR Clock Range between 100-150 MHz */
  31267. tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div62;
  31268. 8010b1c: bf94 ite ls
  31269. 8010b1e: f045 0504 orrls.w r5, r5, #4
  31270. }
  31271. else /* ((hclk >= 150000000)&&(hclk <= 168000000)) */
  31272. {
  31273. /* CSR Clock Range between 150-168 MHz */
  31274. tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div102;
  31275. 8010b22: f045 0510 orrhi.w r5, r5, #16
  31276. }
  31277. /* Write to ETHERNET MAC MIIAR: Configure the ETHERNET CSR Clock Range */
  31278. ETH->MACMIIAR = (uint32_t)tmpreg;
  31279. 8010b26: 613d str r5, [r7, #16]
  31280. /*-------------------- PHY initialization and configuration ----------------*/
  31281. /* Put the PHY in reset mode */
  31282. if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_Reset)))
  31283. 8010b28: 4630 mov r0, r6
  31284. 8010b2a: 2100 movs r1, #0
  31285. 8010b2c: f44f 4200 mov.w r2, #32768 ; 0x8000
  31286. 8010b30: f7ff ffa4 bl 8010a7c <ETH_WritePHYRegister>
  31287. 8010b34: b908 cbnz r0, 8010b3a <ETH_Init+0x6e>
  31288. {
  31289. /* Return ERROR in case of write timeout */
  31290. return ETH_ERROR;
  31291. 8010b36: 2000 movs r0, #0
  31292. 8010b38: e0e9 b.n 8010d0e <ETH_Init+0x242>
  31293. }
  31294. /* Delay to assure PHY reset */
  31295. _eth_delay_(PHY_RESET_DELAY);
  31296. 8010b3a: 487f ldr r0, [pc, #508] ; (8010d38 <ETH_Init+0x26c>)
  31297. 8010b3c: f7ff fd80 bl 8010640 <ETH_Delay>
  31298. if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
  31299. 8010b40: 6821 ldr r1, [r4, #0]
  31300. 8010b42: 2900 cmp r1, #0
  31301. 8010b44: d050 beq.n 8010be8 <ETH_Init+0x11c>
  31302. {
  31303. /* We wait for linked status... */
  31304. do
  31305. {
  31306. timeout++;
  31307. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
  31308. 8010b46: 4d7d ldr r5, [pc, #500] ; (8010d3c <ETH_Init+0x270>)
  31309. if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
  31310. {
  31311. /* We wait for linked status... */
  31312. do
  31313. {
  31314. timeout++;
  31315. 8010b48: 9b01 ldr r3, [sp, #4]
  31316. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
  31317. 8010b4a: 4630 mov r0, r6
  31318. if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
  31319. {
  31320. /* We wait for linked status... */
  31321. do
  31322. {
  31323. timeout++;
  31324. 8010b4c: 3301 adds r3, #1
  31325. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
  31326. 8010b4e: 2101 movs r1, #1
  31327. if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
  31328. {
  31329. /* We wait for linked status... */
  31330. do
  31331. {
  31332. timeout++;
  31333. 8010b50: 9301 str r3, [sp, #4]
  31334. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
  31335. 8010b52: f7ff ff67 bl 8010a24 <ETH_ReadPHYRegister>
  31336. 8010b56: f000 0004 and.w r0, r0, #4
  31337. 8010b5a: b280 uxth r0, r0
  31338. 8010b5c: b910 cbnz r0, 8010b64 <ETH_Init+0x98>
  31339. 8010b5e: 9b01 ldr r3, [sp, #4]
  31340. 8010b60: 42ab cmp r3, r5
  31341. 8010b62: d9f1 bls.n 8010b48 <ETH_Init+0x7c>
  31342. /* Return ERROR in case of timeout */
  31343. if(timeout == PHY_READ_TO)
  31344. 8010b64: 9a01 ldr r2, [sp, #4]
  31345. 8010b66: 4b76 ldr r3, [pc, #472] ; (8010d40 <ETH_Init+0x274>)
  31346. 8010b68: 429a cmp r2, r3
  31347. 8010b6a: d0e4 beq.n 8010b36 <ETH_Init+0x6a>
  31348. {
  31349. return ETH_ERROR;
  31350. }
  31351. /* Reset Timeout counter */
  31352. timeout = 0;
  31353. 8010b6c: 2100 movs r1, #0
  31354. /* Enable Auto-Negotiation */
  31355. if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_AutoNegotiation)))
  31356. 8010b6e: 4630 mov r0, r6
  31357. 8010b70: f44f 5280 mov.w r2, #4096 ; 0x1000
  31358. {
  31359. return ETH_ERROR;
  31360. }
  31361. /* Reset Timeout counter */
  31362. timeout = 0;
  31363. 8010b74: 9101 str r1, [sp, #4]
  31364. /* Enable Auto-Negotiation */
  31365. if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_AutoNegotiation)))
  31366. 8010b76: f7ff ff81 bl 8010a7c <ETH_WritePHYRegister>
  31367. 8010b7a: 2800 cmp r0, #0
  31368. 8010b7c: d0db beq.n 8010b36 <ETH_Init+0x6a>
  31369. /* Wait until the auto-negotiation will be completed */
  31370. do
  31371. {
  31372. timeout++;
  31373. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
  31374. 8010b7e: 4d6f ldr r5, [pc, #444] ; (8010d3c <ETH_Init+0x270>)
  31375. }
  31376. /* Wait until the auto-negotiation will be completed */
  31377. do
  31378. {
  31379. timeout++;
  31380. 8010b80: 9b01 ldr r3, [sp, #4]
  31381. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
  31382. 8010b82: 4630 mov r0, r6
  31383. }
  31384. /* Wait until the auto-negotiation will be completed */
  31385. do
  31386. {
  31387. timeout++;
  31388. 8010b84: 3301 adds r3, #1
  31389. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
  31390. 8010b86: 2101 movs r1, #1
  31391. }
  31392. /* Wait until the auto-negotiation will be completed */
  31393. do
  31394. {
  31395. timeout++;
  31396. 8010b88: 9301 str r3, [sp, #4]
  31397. } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
  31398. 8010b8a: f7ff ff4b bl 8010a24 <ETH_ReadPHYRegister>
  31399. 8010b8e: f000 0020 and.w r0, r0, #32
  31400. 8010b92: b280 uxth r0, r0
  31401. 8010b94: b910 cbnz r0, 8010b9c <ETH_Init+0xd0>
  31402. 8010b96: 9b01 ldr r3, [sp, #4]
  31403. 8010b98: 42ab cmp r3, r5
  31404. 8010b9a: d9f1 bls.n 8010b80 <ETH_Init+0xb4>
  31405. /* Return ERROR in case of timeout */
  31406. if(timeout == PHY_READ_TO)
  31407. 8010b9c: 9a01 ldr r2, [sp, #4]
  31408. 8010b9e: 4b68 ldr r3, [pc, #416] ; (8010d40 <ETH_Init+0x274>)
  31409. 8010ba0: 429a cmp r2, r3
  31410. 8010ba2: d0c8 beq.n 8010b36 <ETH_Init+0x6a>
  31411. {
  31412. return ETH_ERROR;
  31413. }
  31414. /* Reset Timeout counter */
  31415. timeout = 0;
  31416. 8010ba4: 2500 movs r5, #0
  31417. /* Read the result of the auto-negotiation */
  31418. RegValue = ETH_ReadPHYRegister(PHYAddress, PHY_SR);
  31419. 8010ba6: 211f movs r1, #31
  31420. 8010ba8: 4630 mov r0, r6
  31421. {
  31422. return ETH_ERROR;
  31423. }
  31424. /* Reset Timeout counter */
  31425. timeout = 0;
  31426. 8010baa: 9501 str r5, [sp, #4]
  31427. /* Read the result of the auto-negotiation */
  31428. RegValue = ETH_ReadPHYRegister(PHYAddress, PHY_SR);
  31429. 8010bac: f7ff ff3a bl 8010a24 <ETH_ReadPHYRegister>
  31430. switch (RegValue & PHY_DUPLEX_SPEED_STATUS_MASK)
  31431. 8010bb0: f000 001c and.w r0, r0, #28
  31432. 8010bb4: 2808 cmp r0, #8
  31433. 8010bb6: d00b beq.n 8010bd0 <ETH_Init+0x104>
  31434. 8010bb8: d802 bhi.n 8010bc0 <ETH_Init+0xf4>
  31435. 8010bba: 2804 cmp r0, #4
  31436. 8010bbc: d123 bne.n 8010c06 <ETH_Init+0x13a>
  31437. 8010bbe: e010 b.n 8010be2 <ETH_Init+0x116>
  31438. 8010bc0: 280e cmp r0, #14
  31439. 8010bc2: d00a beq.n 8010bda <ETH_Init+0x10e>
  31440. 8010bc4: 2812 cmp r0, #18
  31441. 8010bc6: d11e bne.n 8010c06 <ETH_Init+0x13a>
  31442. {
  31443. case PHY_100BTX_FULL:
  31444. ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
  31445. 8010bc8: f44f 6300 mov.w r3, #2048 ; 0x800
  31446. 8010bcc: 6223 str r3, [r4, #32]
  31447. 8010bce: e000 b.n 8010bd2 <ETH_Init+0x106>
  31448. ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
  31449. break;
  31450. case PHY_100BTX_HALF:
  31451. ETH_InitStruct->ETH_Mode = ETH_Mode_HalfDuplex;
  31452. 8010bd0: 6225 str r5, [r4, #32]
  31453. ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
  31454. 8010bd2: f44f 4380 mov.w r3, #16384 ; 0x4000
  31455. 8010bd6: 6163 str r3, [r4, #20]
  31456. break;
  31457. 8010bd8: e015 b.n 8010c06 <ETH_Init+0x13a>
  31458. case PHY_10M_FULL:
  31459. ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
  31460. 8010bda: f44f 6300 mov.w r3, #2048 ; 0x800
  31461. 8010bde: 6223 str r3, [r4, #32]
  31462. 8010be0: e000 b.n 8010be4 <ETH_Init+0x118>
  31463. ETH_InitStruct->ETH_Speed = ETH_Speed_10M;
  31464. break;
  31465. case PHY_10M_HALF:
  31466. ETH_InitStruct->ETH_Mode = ETH_Mode_HalfDuplex;
  31467. 8010be2: 6225 str r5, [r4, #32]
  31468. ETH_InitStruct->ETH_Speed = ETH_Speed_10M;
  31469. 8010be4: 6165 str r5, [r4, #20]
  31470. break;
  31471. 8010be6: e00e b.n 8010c06 <ETH_Init+0x13a>
  31472. break;
  31473. }
  31474. }
  31475. else
  31476. {
  31477. if(!ETH_WritePHYRegister(PHYAddress, PHY_BCR, ((uint16_t)(ETH_InitStruct->ETH_Mode >> 3) |
  31478. 8010be8: 6a22 ldr r2, [r4, #32]
  31479. (uint16_t)(ETH_InitStruct->ETH_Speed >> 1))))
  31480. 8010bea: 6963 ldr r3, [r4, #20]
  31481. break;
  31482. }
  31483. }
  31484. else
  31485. {
  31486. if(!ETH_WritePHYRegister(PHYAddress, PHY_BCR, ((uint16_t)(ETH_InitStruct->ETH_Mode >> 3) |
  31487. 8010bec: 08d2 lsrs r2, r2, #3
  31488. 8010bee: ea42 0253 orr.w r2, r2, r3, lsr #1
  31489. 8010bf2: 4630 mov r0, r6
  31490. 8010bf4: b292 uxth r2, r2
  31491. 8010bf6: f7ff ff41 bl 8010a7c <ETH_WritePHYRegister>
  31492. 8010bfa: 2800 cmp r0, #0
  31493. 8010bfc: d09b beq.n 8010b36 <ETH_Init+0x6a>
  31494. {
  31495. /* Return ERROR in case of write timeout */
  31496. return ETH_ERROR;
  31497. }
  31498. /* Delay to assure PHY configuration */
  31499. _eth_delay_(PHY_CONFIG_DELAY);
  31500. 8010bfe: f06f 407f mvn.w r0, #4278190080 ; 0xff000000
  31501. 8010c02: f7ff fd1d bl 8010640 <ETH_Delay>
  31502. }
  31503. /*------------------------ ETHERNET MACCR Configuration --------------------*/
  31504. /* Get the ETHERNET MACCR value */
  31505. tmpreg = ETH->MACCR;
  31506. 8010c06: 4b43 ldr r3, [pc, #268] ; (8010d14 <ETH_Init+0x248>)
  31507. /* Clear WD, PCE, PS, TE and RE bits */
  31508. tmpreg &= MACCR_CLEAR_MASK;
  31509. 8010c08: 4a4e ldr r2, [pc, #312] ; (8010d44 <ETH_Init+0x278>)
  31510. _eth_delay_(PHY_CONFIG_DELAY);
  31511. }
  31512. /*------------------------ ETHERNET MACCR Configuration --------------------*/
  31513. /* Get the ETHERNET MACCR value */
  31514. tmpreg = ETH->MACCR;
  31515. 8010c0a: 6819 ldr r1, [r3, #0]
  31516. /* Set the IPCO bit according to ETH_ChecksumOffload value */
  31517. /* Set the DR bit according to ETH_RetryTransmission value */
  31518. /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */
  31519. /* Set the BL bit according to ETH_BackOffLimit value */
  31520. /* Set the DC bit according to ETH_DeferralCheck value */
  31521. tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog |
  31522. 8010c0c: 68a0 ldr r0, [r4, #8]
  31523. }
  31524. /*------------------------ ETHERNET MACCR Configuration --------------------*/
  31525. /* Get the ETHERNET MACCR value */
  31526. tmpreg = ETH->MACCR;
  31527. /* Clear WD, PCE, PS, TE and RE bits */
  31528. tmpreg &= MACCR_CLEAR_MASK;
  31529. 8010c0e: 400a ands r2, r1
  31530. /* Set the IPCO bit according to ETH_ChecksumOffload value */
  31531. /* Set the DR bit according to ETH_RetryTransmission value */
  31532. /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */
  31533. /* Set the BL bit according to ETH_BackOffLimit value */
  31534. /* Set the DC bit according to ETH_DeferralCheck value */
  31535. tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog |
  31536. 8010c10: 6861 ldr r1, [r4, #4]
  31537. 8010c12: 4308 orrs r0, r1
  31538. ETH_InitStruct->ETH_Jabber |
  31539. 8010c14: 68e1 ldr r1, [r4, #12]
  31540. 8010c16: 4308 orrs r0, r1
  31541. ETH_InitStruct->ETH_InterFrameGap |
  31542. 8010c18: 6921 ldr r1, [r4, #16]
  31543. 8010c1a: 4308 orrs r0, r1
  31544. ETH_InitStruct->ETH_CarrierSense |
  31545. 8010c1c: 6961 ldr r1, [r4, #20]
  31546. 8010c1e: 4308 orrs r0, r1
  31547. ETH_InitStruct->ETH_Speed |
  31548. 8010c20: 69a1 ldr r1, [r4, #24]
  31549. 8010c22: 4308 orrs r0, r1
  31550. ETH_InitStruct->ETH_ReceiveOwn |
  31551. 8010c24: 69e1 ldr r1, [r4, #28]
  31552. 8010c26: 4308 orrs r0, r1
  31553. ETH_InitStruct->ETH_LoopbackMode |
  31554. 8010c28: 6a21 ldr r1, [r4, #32]
  31555. 8010c2a: 4308 orrs r0, r1
  31556. ETH_InitStruct->ETH_Mode |
  31557. 8010c2c: 6a61 ldr r1, [r4, #36] ; 0x24
  31558. 8010c2e: 4308 orrs r0, r1
  31559. ETH_InitStruct->ETH_ChecksumOffload |
  31560. 8010c30: 6aa1 ldr r1, [r4, #40] ; 0x28
  31561. 8010c32: 4308 orrs r0, r1
  31562. ETH_InitStruct->ETH_RetryTransmission |
  31563. 8010c34: 6ae1 ldr r1, [r4, #44] ; 0x2c
  31564. 8010c36: 4308 orrs r0, r1
  31565. ETH_InitStruct->ETH_AutomaticPadCRCStrip |
  31566. 8010c38: 6b21 ldr r1, [r4, #48] ; 0x30
  31567. 8010c3a: 4308 orrs r0, r1
  31568. /* Set the IPCO bit according to ETH_ChecksumOffload value */
  31569. /* Set the DR bit according to ETH_RetryTransmission value */
  31570. /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */
  31571. /* Set the BL bit according to ETH_BackOffLimit value */
  31572. /* Set the DC bit according to ETH_DeferralCheck value */
  31573. tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog |
  31574. 8010c3c: 6b61 ldr r1, [r4, #52] ; 0x34
  31575. 8010c3e: 4301 orrs r1, r0
  31576. 8010c40: 430a orrs r2, r1
  31577. ETH_InitStruct->ETH_RetryTransmission |
  31578. ETH_InitStruct->ETH_AutomaticPadCRCStrip |
  31579. ETH_InitStruct->ETH_BackOffLimit |
  31580. ETH_InitStruct->ETH_DeferralCheck);
  31581. /* Write to ETHERNET MACCR */
  31582. ETH->MACCR = (uint32_t)tmpreg;
  31583. 8010c42: 601a str r2, [r3, #0]
  31584. /* Set the DAIF bit according to ETH_DestinationAddrFilter value */
  31585. /* Set the PR bit according to ETH_PromiscuousMode value */
  31586. /* Set the PM, HMC and HPF bits according to ETH_MulticastFramesFilter value */
  31587. /* Set the HUC and HPF bits according to ETH_UnicastFramesFilter value */
  31588. /* Write to ETHERNET MACFFR */
  31589. ETH->MACFFR = (uint32_t)(ETH_InitStruct->ETH_ReceiveAll |
  31590. 8010c44: 6ba2 ldr r2, [r4, #56] ; 0x38
  31591. 8010c46: 6be1 ldr r1, [r4, #60] ; 0x3c
  31592. 8010c48: 4311 orrs r1, r2
  31593. ETH_InitStruct->ETH_SourceAddrFilter |
  31594. 8010c4a: 6c22 ldr r2, [r4, #64] ; 0x40
  31595. 8010c4c: 4311 orrs r1, r2
  31596. ETH_InitStruct->ETH_PassControlFrames |
  31597. 8010c4e: 6c62 ldr r2, [r4, #68] ; 0x44
  31598. 8010c50: 4311 orrs r1, r2
  31599. ETH_InitStruct->ETH_BroadcastFramesReception |
  31600. 8010c52: 6ca2 ldr r2, [r4, #72] ; 0x48
  31601. 8010c54: 4311 orrs r1, r2
  31602. ETH_InitStruct->ETH_DestinationAddrFilter |
  31603. 8010c56: 6ce2 ldr r2, [r4, #76] ; 0x4c
  31604. 8010c58: 4311 orrs r1, r2
  31605. ETH_InitStruct->ETH_PromiscuousMode |
  31606. 8010c5a: 6d22 ldr r2, [r4, #80] ; 0x50
  31607. 8010c5c: 4311 orrs r1, r2
  31608. /* Set the DAIF bit according to ETH_DestinationAddrFilter value */
  31609. /* Set the PR bit according to ETH_PromiscuousMode value */
  31610. /* Set the PM, HMC and HPF bits according to ETH_MulticastFramesFilter value */
  31611. /* Set the HUC and HPF bits according to ETH_UnicastFramesFilter value */
  31612. /* Write to ETHERNET MACFFR */
  31613. ETH->MACFFR = (uint32_t)(ETH_InitStruct->ETH_ReceiveAll |
  31614. 8010c5e: 6d62 ldr r2, [r4, #84] ; 0x54
  31615. 8010c60: 430a orrs r2, r1
  31616. 8010c62: 605a str r2, [r3, #4]
  31617. ETH_InitStruct->ETH_PromiscuousMode |
  31618. ETH_InitStruct->ETH_MulticastFramesFilter |
  31619. ETH_InitStruct->ETH_UnicastFramesFilter);
  31620. /*--------------- ETHERNET MACHTHR and MACHTLR Configuration ---------------*/
  31621. /* Write to ETHERNET MACHTHR */
  31622. ETH->MACHTHR = (uint32_t)ETH_InitStruct->ETH_HashTableHigh;
  31623. 8010c64: 6da2 ldr r2, [r4, #88] ; 0x58
  31624. 8010c66: 609a str r2, [r3, #8]
  31625. /* Write to ETHERNET MACHTLR */
  31626. ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
  31627. 8010c68: 6de2 ldr r2, [r4, #92] ; 0x5c
  31628. 8010c6a: 60da str r2, [r3, #12]
  31629. /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
  31630. /* Set the PLT bit according to ETH_PauseLowThreshold value */
  31631. /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
  31632. /* Set the RFE bit according to ETH_ReceiveFlowControl value */
  31633. /* Set the TFE bit according to ETH_TransmitFlowControl value */
  31634. tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) |
  31635. 8010c6c: 6e62 ldr r2, [r4, #100] ; 0x64
  31636. 8010c6e: 6ea1 ldr r1, [r4, #104] ; 0x68
  31637. ETH->MACHTHR = (uint32_t)ETH_InitStruct->ETH_HashTableHigh;
  31638. /* Write to ETHERNET MACHTLR */
  31639. ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
  31640. /*----------------------- ETHERNET MACFCR Configuration --------------------*/
  31641. /* Get the ETHERNET MACFCR value */
  31642. tmpreg = ETH->MACFCR;
  31643. 8010c70: 6998 ldr r0, [r3, #24]
  31644. /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
  31645. /* Set the PLT bit according to ETH_PauseLowThreshold value */
  31646. /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
  31647. /* Set the RFE bit according to ETH_ReceiveFlowControl value */
  31648. /* Set the TFE bit according to ETH_TransmitFlowControl value */
  31649. tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) |
  31650. 8010c72: 4311 orrs r1, r2
  31651. ETH_InitStruct->ETH_ZeroQuantaPause |
  31652. 8010c74: 6ee2 ldr r2, [r4, #108] ; 0x6c
  31653. 8010c76: 4311 orrs r1, r2
  31654. ETH_InitStruct->ETH_PauseLowThreshold |
  31655. 8010c78: 6f22 ldr r2, [r4, #112] ; 0x70
  31656. 8010c7a: 4311 orrs r1, r2
  31657. ETH_InitStruct->ETH_UnicastPauseFrameDetect |
  31658. 8010c7c: 6f62 ldr r2, [r4, #116] ; 0x74
  31659. 8010c7e: 4311 orrs r1, r2
  31660. ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
  31661. /*----------------------- ETHERNET MACFCR Configuration --------------------*/
  31662. /* Get the ETHERNET MACFCR value */
  31663. tmpreg = ETH->MACFCR;
  31664. /* Clear xx bits */
  31665. tmpreg &= MACFCR_CLEAR_MASK;
  31666. 8010c80: f64f 7241 movw r2, #65345 ; 0xff41
  31667. 8010c84: 4002 ands r2, r0
  31668. /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
  31669. /* Set the PLT bit according to ETH_PauseLowThreshold value */
  31670. /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
  31671. /* Set the RFE bit according to ETH_ReceiveFlowControl value */
  31672. /* Set the TFE bit according to ETH_TransmitFlowControl value */
  31673. tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) |
  31674. 8010c86: 430a orrs r2, r1
  31675. 8010c88: 6e21 ldr r1, [r4, #96] ; 0x60
  31676. 8010c8a: ea42 4101 orr.w r1, r2, r1, lsl #16
  31677. ETH_InitStruct->ETH_PauseLowThreshold |
  31678. ETH_InitStruct->ETH_UnicastPauseFrameDetect |
  31679. ETH_InitStruct->ETH_ReceiveFlowControl |
  31680. ETH_InitStruct->ETH_TransmitFlowControl);
  31681. /* Write to ETHERNET MACFCR */
  31682. ETH->MACFCR = (uint32_t)tmpreg;
  31683. 8010c8e: 6199 str r1, [r3, #24]
  31684. /*----------------------- ETHERNET MACVLANTR Configuration -----------------*/
  31685. /* Set the ETV bit according to ETH_VLANTagComparison value */
  31686. /* Set the VL bit according to ETH_VLANTagIdentifier value */
  31687. ETH->MACVLANTR = (uint32_t)(ETH_InitStruct->ETH_VLANTagComparison |
  31688. 8010c90: 6fe1 ldr r1, [r4, #124] ; 0x7c
  31689. 8010c92: 6fa2 ldr r2, [r4, #120] ; 0x78
  31690. 8010c94: 430a orrs r2, r1
  31691. 8010c96: 61da str r2, [r3, #28]
  31692. ETH_InitStruct->ETH_VLANTagIdentifier);
  31693. /*-------------------------------- DMA Config ------------------------------*/
  31694. /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
  31695. /* Get the ETHERNET DMAOMR value */
  31696. tmpreg = ETH->DMAOMR;
  31697. 8010c98: f503 5380 add.w r3, r3, #4096 ; 0x1000
  31698. /* Clear xx bits */
  31699. tmpreg &= DMAOMR_CLEAR_MASK;
  31700. 8010c9c: 4a2a ldr r2, [pc, #168] ; (8010d48 <ETH_Init+0x27c>)
  31701. ETH_InitStruct->ETH_VLANTagIdentifier);
  31702. /*-------------------------------- DMA Config ------------------------------*/
  31703. /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
  31704. /* Get the ETHERNET DMAOMR value */
  31705. tmpreg = ETH->DMAOMR;
  31706. 8010c9e: 6999 ldr r1, [r3, #24]
  31707. /* Set the TTC bit according to ETH_TransmitThresholdControl value */
  31708. /* Set the FEF bit according to ETH_ForwardErrorFrames value */
  31709. /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
  31710. /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
  31711. /* Set the OSF bit according to ETH_SecondFrameOperate value */
  31712. tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame |
  31713. 8010ca0: f8d4 0084 ldr.w r0, [r4, #132] ; 0x84
  31714. /*-------------------------------- DMA Config ------------------------------*/
  31715. /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
  31716. /* Get the ETHERNET DMAOMR value */
  31717. tmpreg = ETH->DMAOMR;
  31718. /* Clear xx bits */
  31719. tmpreg &= DMAOMR_CLEAR_MASK;
  31720. 8010ca4: 400a ands r2, r1
  31721. /* Set the TTC bit according to ETH_TransmitThresholdControl value */
  31722. /* Set the FEF bit according to ETH_ForwardErrorFrames value */
  31723. /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
  31724. /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
  31725. /* Set the OSF bit according to ETH_SecondFrameOperate value */
  31726. tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame |
  31727. 8010ca6: f8d4 1080 ldr.w r1, [r4, #128] ; 0x80
  31728. 8010caa: 4308 orrs r0, r1
  31729. ETH_InitStruct->ETH_ReceiveStoreForward |
  31730. 8010cac: f8d4 1088 ldr.w r1, [r4, #136] ; 0x88
  31731. 8010cb0: 4308 orrs r0, r1
  31732. ETH_InitStruct->ETH_FlushReceivedFrame |
  31733. 8010cb2: f8d4 108c ldr.w r1, [r4, #140] ; 0x8c
  31734. 8010cb6: 4308 orrs r0, r1
  31735. ETH_InitStruct->ETH_TransmitStoreForward |
  31736. 8010cb8: f8d4 1090 ldr.w r1, [r4, #144] ; 0x90
  31737. 8010cbc: 4308 orrs r0, r1
  31738. ETH_InitStruct->ETH_TransmitThresholdControl |
  31739. 8010cbe: f8d4 1094 ldr.w r1, [r4, #148] ; 0x94
  31740. 8010cc2: 4308 orrs r0, r1
  31741. ETH_InitStruct->ETH_ForwardErrorFrames |
  31742. 8010cc4: f8d4 1098 ldr.w r1, [r4, #152] ; 0x98
  31743. 8010cc8: 4308 orrs r0, r1
  31744. ETH_InitStruct->ETH_ForwardUndersizedGoodFrames |
  31745. 8010cca: f8d4 109c ldr.w r1, [r4, #156] ; 0x9c
  31746. 8010cce: 4308 orrs r0, r1
  31747. /* Set the TTC bit according to ETH_TransmitThresholdControl value */
  31748. /* Set the FEF bit according to ETH_ForwardErrorFrames value */
  31749. /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
  31750. /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
  31751. /* Set the OSF bit according to ETH_SecondFrameOperate value */
  31752. tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame |
  31753. 8010cd0: f8d4 10a0 ldr.w r1, [r4, #160] ; 0xa0
  31754. 8010cd4: 4301 orrs r1, r0
  31755. 8010cd6: 430a orrs r2, r1
  31756. ETH_InitStruct->ETH_ForwardErrorFrames |
  31757. ETH_InitStruct->ETH_ForwardUndersizedGoodFrames |
  31758. ETH_InitStruct->ETH_ReceiveThresholdControl |
  31759. ETH_InitStruct->ETH_SecondFrameOperate);
  31760. /* Write to ETHERNET DMAOMR */
  31761. ETH->DMAOMR = (uint32_t)tmpreg;
  31762. 8010cd8: 619a str r2, [r3, #24]
  31763. /* Set the FB bit according to ETH_FixedBurst value */
  31764. /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
  31765. /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
  31766. /* Set the DSL bit according to ETH_DesciptorSkipLength value */
  31767. /* Set the PR and DA bits according to ETH_DMAArbitration value */
  31768. ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats |
  31769. 8010cda: f8d4 20a8 ldr.w r2, [r4, #168] ; 0xa8
  31770. 8010cde: f8d4 10a4 ldr.w r1, [r4, #164] ; 0xa4
  31771. 8010ce2: 4311 orrs r1, r2
  31772. ETH_InitStruct->ETH_FixedBurst |
  31773. ETH_InitStruct->ETH_RxDMABurstLength | /* !! if 4xPBL is selected for Tx or Rx it is applied for the other */
  31774. 8010ce4: f8d4 20ac ldr.w r2, [r4, #172] ; 0xac
  31775. /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
  31776. /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
  31777. /* Set the DSL bit according to ETH_DesciptorSkipLength value */
  31778. /* Set the PR and DA bits according to ETH_DMAArbitration value */
  31779. ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats |
  31780. ETH_InitStruct->ETH_FixedBurst |
  31781. 8010ce8: f441 0100 orr.w r1, r1, #8388608 ; 0x800000
  31782. ETH_InitStruct->ETH_RxDMABurstLength | /* !! if 4xPBL is selected for Tx or Rx it is applied for the other */
  31783. 8010cec: 4311 orrs r1, r2
  31784. ETH_InitStruct->ETH_TxDMABurstLength |
  31785. 8010cee: f8d4 20b0 ldr.w r2, [r4, #176] ; 0xb0
  31786. 8010cf2: 4311 orrs r1, r2
  31787. (ETH_InitStruct->ETH_DescriptorSkipLength << 2) |
  31788. 8010cf4: f8d4 20b8 ldr.w r2, [r4, #184] ; 0xb8
  31789. 8010cf8: 430a orrs r2, r1
  31790. 8010cfa: f8d4 10b4 ldr.w r1, [r4, #180] ; 0xb4
  31791. /* Set the FB bit according to ETH_FixedBurst value */
  31792. /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
  31793. /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
  31794. /* Set the DSL bit according to ETH_DesciptorSkipLength value */
  31795. /* Set the PR and DA bits according to ETH_DMAArbitration value */
  31796. ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats |
  31797. 8010cfe: ea42 0281 orr.w r2, r2, r1, lsl #2
  31798. 8010d02: 601a str r2, [r3, #0]
  31799. ETH_InitStruct->ETH_DMAArbitration |
  31800. ETH_DMABMR_USP); /* Enable use of separate PBL for Rx and Tx */
  31801. #ifdef USE_ENHANCED_DMA_DESCRIPTORS
  31802. /* Enable the Enhanced DMA descriptors */
  31803. ETH->DMABMR |= ETH_DMABMR_EDE;
  31804. 8010d04: 681a ldr r2, [r3, #0]
  31805. 8010d06: f042 0280 orr.w r2, r2, #128 ; 0x80
  31806. 8010d0a: 601a str r2, [r3, #0]
  31807. #endif /* USE_ENHANCED_DMA_DESCRIPTORS */
  31808. /* Return Ethernet configuration success */
  31809. return ETH_SUCCESS;
  31810. 8010d0c: 2001 movs r0, #1
  31811. }
  31812. 8010d0e: b007 add sp, #28
  31813. 8010d10: bdf0 pop {r4, r5, r6, r7, pc}
  31814. 8010d12: bf00 nop
  31815. 8010d14: 40028000 .word 0x40028000
  31816. 8010d18: feced300 .word 0xfeced300
  31817. 8010d1c: 00e4e1bf .word 0x00e4e1bf
  31818. 8010d20: fde9f140 .word 0xfde9f140
  31819. 8010d24: 017d783f .word 0x017d783f
  31820. 8010d28: fc6c7900 .word 0xfc6c7900
  31821. 8010d2c: 026259ff .word 0x026259ff
  31822. 8010d30: fa0a1f00 .word 0xfa0a1f00
  31823. 8010d34: 02faf07f .word 0x02faf07f
  31824. 8010d38: 000fffff .word 0x000fffff
  31825. 8010d3c: 0004fffe .word 0x0004fffe
  31826. 8010d40: 0004ffff .word 0x0004ffff
  31827. 8010d44: ff20810f .word 0xff20810f
  31828. 8010d48: f8de3f23 .word 0xf8de3f23
  31829. 08010d4c <NVIC_SystemReset>:
  31830. 8010d4c: f3bf 8f4f dsb sy
  31831. (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
  31832. 8010d50: 4a04 ldr r2, [pc, #16] ; (8010d64 <NVIC_SystemReset+0x18>)
  31833. 8010d52: 4b05 ldr r3, [pc, #20] ; (8010d68 <NVIC_SystemReset+0x1c>)
  31834. 8010d54: 68d1 ldr r1, [r2, #12]
  31835. 8010d56: f401 61e0 and.w r1, r1, #1792 ; 0x700
  31836. 8010d5a: 430b orrs r3, r1
  31837. __STATIC_INLINE void NVIC_SystemReset(void)
  31838. //static inline void NVIC_SystemReset(void)
  31839. {
  31840. __DSB(); /* Ensure all outstanding memory accesses included
  31841. buffered write are completed before reset */
  31842. SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
  31843. 8010d5c: 60d3 str r3, [r2, #12]
  31844. 8010d5e: f3bf 8f4f dsb sy
  31845. 8010d62: e7fe b.n 8010d62 <NVIC_SystemReset+0x16>
  31846. 8010d64: e000ed00 .word 0xe000ed00
  31847. 8010d68: 05fa0004 .word 0x05fa0004
  31848. 08010d6c <UpdateTimeout_Handler>:
  31849. void UpdateTimeout_Handler(void)
  31850. {
  31851. static char lcdbuf[32] = {0};
  31852. static uint8_t time = UPDATE_TIMEOUT;
  31853. if ((fUpload) || (fInvalidFw)) return;
  31854. 8010d6c: 4b07 ldr r3, [pc, #28] ; (8010d8c <UpdateTimeout_Handler+0x20>)
  31855. 8010d6e: 781b ldrb r3, [r3, #0]
  31856. 8010d70: b953 cbnz r3, 8010d88 <UpdateTimeout_Handler+0x1c>
  31857. 8010d72: 4b07 ldr r3, [pc, #28] ; (8010d90 <UpdateTimeout_Handler+0x24>)
  31858. 8010d74: 781b ldrb r3, [r3, #0]
  31859. 8010d76: b93b cbnz r3, 8010d88 <UpdateTimeout_Handler+0x1c>
  31860. if (time == 0) {
  31861. 8010d78: 4b06 ldr r3, [pc, #24] ; (8010d94 <UpdateTimeout_Handler+0x28>)
  31862. 8010d7a: 781a ldrb r2, [r3, #0]
  31863. 8010d7c: b912 cbnz r2, 8010d84 <UpdateTimeout_Handler+0x18>
  31864. UpdateTimeoutFlag = true;
  31865. 8010d7e: 2201 movs r2, #1
  31866. 8010d80: 4b05 ldr r3, [pc, #20] ; (8010d98 <UpdateTimeout_Handler+0x2c>)
  31867. 8010d82: e000 b.n 8010d86 <UpdateTimeout_Handler+0x1a>
  31868. }
  31869. else {
  31870. time--;
  31871. 8010d84: 3a01 subs r2, #1
  31872. 8010d86: 701a strb r2, [r3, #0]
  31873. 8010d88: 4770 bx lr
  31874. 8010d8a: bf00 nop
  31875. 8010d8c: 20006db0 .word 0x20006db0
  31876. 8010d90: 20006dc4 .word 0x20006dc4
  31877. 8010d94: 20000115 .word 0x20000115
  31878. 8010d98: 20006db9 .word 0x20006db9
  31879. 08010d9c <main>:
  31880. extern SETTINGS_t sSettings;
  31881. void UpdateTimeout_Handler(void);
  31882. void main(void)
  31883. {
  31884. 8010d9c: b570 push {r4, r5, r6, lr}
  31885. uint8_t bootTry;
  31886. uint8_t loadMode;
  31887. WDG_Init();
  31888. 8010d9e: f7fe ff45 bl 800fc2c <WDG_Init>
  31889. IO_Init();
  31890. 8010da2: f7fe fcad bl 800f700 <IO_Init>
  31891. InitUSART();
  31892. 8010da6: f7fe fee9 bl 800fb7c <InitUSART>
  31893. /* Enable PWR peripheral clock */
  31894. RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
  31895. 8010daa: 2101 movs r1, #1
  31896. 8010dac: f04f 5080 mov.w r0, #268435456 ; 0x10000000
  31897. 8010db0: f7f9 f8fc bl 8009fac <RCC_APB1PeriphClockCmd>
  31898. /* Allow access to BKP Domain */
  31899. PWR_BackupAccessCmd(ENABLE);
  31900. 8010db4: 2001 movs r0, #1
  31901. 8010db6: f7f9 f8a1 bl 8009efc <PWR_BackupAccessCmd>
  31902. /* Включаем тактирование модуля CRC */
  31903. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
  31904. 8010dba: 2101 movs r1, #1
  31905. 8010dbc: f44f 5080 mov.w r0, #4096 ; 0x1000
  31906. 8010dc0: f7f9 f8e8 bl 8009f94 <RCC_AHB1PeriphClockCmd>
  31907. /* Проверка флага, определяющего состояние устройства. */
  31908. /* Флаг установлен - работает Bootloader */
  31909. /* Флаг сброшен - запускается основная программа */
  31910. SETTINGS_Load();
  31911. 8010dc4: f7fe fe44 bl 800fa50 <SETTINGS_Load>
  31912. /* Проверка флага bootTry. Если флаг установлен, значит произошел сбой в
  31913. основной прошивке. Нужно загружать bootloader и ждать обновления ПО */
  31914. /* TODO remove if tested */
  31915. //bootTry = sSettings.bootParams.bootTry;
  31916. loadMode = RTC_ReadBackupRegister(RTC_BKP_DR1);
  31917. 8010dc8: 2001 movs r0, #1
  31918. 8010dca: f7f9 f923 bl 800a014 <RTC_ReadBackupRegister>
  31919. 8010dce: b2c5 uxtb r5, r0
  31920. bootTry = RTC_ReadBackupRegister(RTC_BKP_DR2);
  31921. 8010dd0: 2002 movs r0, #2
  31922. 8010dd2: f7f9 f91f bl 800a014 <RTC_ReadBackupRegister>
  31923. 8010dd6: b2c4 uxtb r4, r0
  31924. printf("loadMode: %d\r\nbootTry: %d\r\n", loadMode, bootTry);
  31925. 8010dd8: 4629 mov r1, r5
  31926. 8010dda: 485f ldr r0, [pc, #380] ; (8010f58 <main+0x1bc>)
  31927. 8010ddc: 4622 mov r2, r4
  31928. 8010dde: f000 fc49 bl 8011674 <tfp_printf>
  31929. if (bootTry > 1)
  31930. 8010de2: 2c01 cmp r4, #1
  31931. 8010de4: d91a bls.n 8010e1c <main+0x80>
  31932. {
  31933. bootTry--;
  31934. 8010de6: 1e61 subs r1, r4, #1
  31935. RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
  31936. 8010de8: 2002 movs r0, #2
  31937. 8010dea: b2c9 uxtb r1, r1
  31938. 8010dec: f7f9 f902 bl 8009ff4 <RTC_WriteBackupRegister>
  31939. /* Check if valid stack address (RAM address) then jump to user application */
  31940. if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
  31941. 8010df0: 4a5a ldr r2, [pc, #360] ; (8010f5c <main+0x1c0>)
  31942. 8010df2: 4b5b ldr r3, [pc, #364] ; (8010f60 <main+0x1c4>)
  31943. 8010df4: 6811 ldr r1, [r2, #0]
  31944. 8010df6: 400b ands r3, r1
  31945. 8010df8: f1b3 5f00 cmp.w r3, #536870912 ; 0x20000000
  31946. 8010dfc: d10a bne.n 8010e14 <main+0x78>
  31947. {
  31948. JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
  31949. 8010dfe: 4b59 ldr r3, [pc, #356] ; (8010f64 <main+0x1c8>)
  31950. 8010e00: 4959 ldr r1, [pc, #356] ; (8010f68 <main+0x1cc>)
  31951. 8010e02: 681b ldr r3, [r3, #0]
  31952. 8010e04: 600b str r3, [r1, #0]
  31953. Jump_To_App = (pFunction) JumpAdd;
  31954. 8010e06: 4959 ldr r1, [pc, #356] ; (8010f6c <main+0x1d0>)
  31955. __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
  31956. 8010e08: 6812 ldr r2, [r2, #0]
  31957. /* Check if valid stack address (RAM address) then jump to user application */
  31958. if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
  31959. {
  31960. JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
  31961. Jump_To_App = (pFunction) JumpAdd;
  31962. 8010e0a: 600b str r3, [r1, #0]
  31963. \param [in] topOfMainStack Main Stack Pointer value to set
  31964. */
  31965. __attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
  31966. {
  31967. __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp");
  31968. 8010e0c: f382 8808 msr MSP, r2
  31969. __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
  31970. Jump_To_App();
  31971. 8010e10: 4798 blx r3
  31972. 8010e12: e00f b.n 8010e34 <main+0x98>
  31973. }
  31974. else {
  31975. /* Флеш пустая, нечего загружать, висим в аварийном режиме */
  31976. fInvalidFw = 1;
  31977. 8010e14: 4b56 ldr r3, [pc, #344] ; (8010f70 <main+0x1d4>)
  31978. 8010e16: 2201 movs r2, #1
  31979. 8010e18: 701a strb r2, [r3, #0]
  31980. 8010e1a: e00b b.n 8010e34 <main+0x98>
  31981. PRINT_USART("\n\rFW empty. Started bootloader\n\r");
  31982. }
  31983. }
  31984. else if (bootTry == 1)
  31985. 8010e1c: d10a bne.n 8010e34 <main+0x98>
  31986. {
  31987. fBootFailed = 1;
  31988. 8010e1e: 4b55 ldr r3, [pc, #340] ; (8010f74 <main+0x1d8>)
  31989. PRINT_USART("\n\rFW boot failed. Started bootloader\n\r");
  31990. bootTry = 0;
  31991. loadMode = 1;
  31992. RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
  31993. 8010e20: 2002 movs r0, #2
  31994. 8010e22: 2100 movs r1, #0
  31995. PRINT_USART("\n\rFW empty. Started bootloader\n\r");
  31996. }
  31997. }
  31998. else if (bootTry == 1)
  31999. {
  32000. fBootFailed = 1;
  32001. 8010e24: 701c strb r4, [r3, #0]
  32002. PRINT_USART("\n\rFW boot failed. Started bootloader\n\r");
  32003. bootTry = 0;
  32004. loadMode = 1;
  32005. RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
  32006. 8010e26: f7f9 f8e5 bl 8009ff4 <RTC_WriteBackupRegister>
  32007. RTC_WriteBackupRegister(RTC_BKP_DR1, loadMode);
  32008. 8010e2a: 4620 mov r0, r4
  32009. 8010e2c: 4621 mov r1, r4
  32010. 8010e2e: f7f9 f8e1 bl 8009ff4 <RTC_WriteBackupRegister>
  32011. 8010e32: e018 b.n 8010e66 <main+0xca>
  32012. }
  32013. /* Флаг не установлен прыгаем на основную программу */
  32014. if (loadMode == 0)
  32015. 8010e34: b9bd cbnz r5, 8010e66 <main+0xca>
  32016. {
  32017. printf("Run main FW\n\r");
  32018. 8010e36: 4850 ldr r0, [pc, #320] ; (8010f78 <main+0x1dc>)
  32019. 8010e38: f000 fc1c bl 8011674 <tfp_printf>
  32020. //printf("*(__IO uint32_t*)(USER_FLASH_FIRST_PAGE_ADDRESS + 4) = 0x%X\n\r", *(__IO uint32_t*)(USER_FLASH_FIRST_PAGE_ADDRESS + 4));
  32021. /* Set bootTry flag every time to ensure that
  32022. * IAP will starts again if FW is corrupted */
  32023. bootTry = BOOT_TRY;
  32024. RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
  32025. 8010e3c: 2106 movs r1, #6
  32026. 8010e3e: 2002 movs r0, #2
  32027. 8010e40: f7f9 f8d8 bl 8009ff4 <RTC_WriteBackupRegister>
  32028. /* Check if valid stack address (RAM address) then jump to user application */
  32029. if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
  32030. 8010e44: 4a45 ldr r2, [pc, #276] ; (8010f5c <main+0x1c0>)
  32031. 8010e46: 4b46 ldr r3, [pc, #280] ; (8010f60 <main+0x1c4>)
  32032. 8010e48: 6811 ldr r1, [r2, #0]
  32033. 8010e4a: 400b ands r3, r1
  32034. 8010e4c: f1b3 5f00 cmp.w r3, #536870912 ; 0x20000000
  32035. 8010e50: d109 bne.n 8010e66 <main+0xca>
  32036. {
  32037. /* Jump to user application */
  32038. JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
  32039. 8010e52: 4b44 ldr r3, [pc, #272] ; (8010f64 <main+0x1c8>)
  32040. 8010e54: 4944 ldr r1, [pc, #272] ; (8010f68 <main+0x1cc>)
  32041. 8010e56: 681b ldr r3, [r3, #0]
  32042. 8010e58: 600b str r3, [r1, #0]
  32043. Jump_To_App = (pFunction) JumpAdd;
  32044. 8010e5a: 4944 ldr r1, [pc, #272] ; (8010f6c <main+0x1d0>)
  32045. /* Initialize user application's Stack Pointer */
  32046. __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
  32047. 8010e5c: 6812 ldr r2, [r2, #0]
  32048. /* Check if valid stack address (RAM address) then jump to user application */
  32049. if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
  32050. {
  32051. /* Jump to user application */
  32052. JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
  32053. Jump_To_App = (pFunction) JumpAdd;
  32054. 8010e5e: 600b str r3, [r1, #0]
  32055. 8010e60: f382 8808 msr MSP, r2
  32056. /* Initialize user application's Stack Pointer */
  32057. __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
  32058. Jump_To_App();
  32059. 8010e64: 4798 blx r3
  32060. */
  32061. __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
  32062. {
  32063. if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
  32064. SysTick->LOAD = ticks - 1; /* set reload register */
  32065. 8010e66: 4b45 ldr r3, [pc, #276] ; (8010f7c <main+0x1e0>)
  32066. 8010e68: 4a45 ldr r2, [pc, #276] ; (8010f80 <main+0x1e4>)
  32067. 8010e6a: 605a str r2, [r3, #4]
  32068. \param [in] priority Priority to set.
  32069. */
  32070. __STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
  32071. {
  32072. if(IRQn < 0) {
  32073. SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
  32074. 8010e6c: 4a45 ldr r2, [pc, #276] ; (8010f84 <main+0x1e8>)
  32075. 8010e6e: 21f0 movs r1, #240 ; 0xf0
  32076. 8010e70: f882 1023 strb.w r1, [r2, #35] ; 0x23
  32077. {
  32078. if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
  32079. SysTick->LOAD = ticks - 1; /* set reload register */
  32080. NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
  32081. SysTick->VAL = 0; /* Load the SysTick Counter Value */
  32082. 8010e74: 2200 movs r2, #0
  32083. 8010e76: 609a str r2, [r3, #8]
  32084. SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  32085. 8010e78: 2207 movs r2, #7
  32086. 8010e7a: 601a str r2, [r3, #0]
  32087. }
  32088. /* Загружается Bootloader... */
  32089. SysTick_Config(120000);
  32090. LED_Init();
  32091. 8010e7c: f7fe fc84 bl 800f788 <LED_Init>
  32092. PRINT_USART("\n\rBootloader starting... \n\r");
  32093. LED_On(RED_STATUS);
  32094. 8010e80: 2001 movs r0, #1
  32095. 8010e82: f7fe fc65 bl 800f750 <LED_On>
  32096. ETH_BSP_Config();
  32097. 8010e86: f7ff fb03 bl 8010490 <ETH_BSP_Config>
  32098. LwIP_Init();
  32099. 8010e8a: f7ff fa61 bl 8010350 <LwIP_Init>
  32100. IAP_httpd_init();
  32101. 8010e8e: f7ff fa49 bl 8010324 <IAP_httpd_init>
  32102. CRC_Init();
  32103. 8010e92: f7fe fbb3 bl 800f5fc <CRC_Init>
  32104. //Если нажата DEF начинаем обновление с sd
  32105. if (IO_BtnDefaultPressed())
  32106. 8010e96: f7fe fc4d bl 800f734 <IO_BtnDefaultPressed>
  32107. 8010e9a: b938 cbnz r0, 8010eac <main+0x110>
  32108. {
  32109. // IAPviaETH = false;
  32110. // timer_AddFunction(500, &LED_Blinky_Yellow);
  32111. // SD_NVIC_Init();
  32112. } else {
  32113. IAPviaETH = true;
  32114. 8010e9c: 4b3a ldr r3, [pc, #232] ; (8010f88 <main+0x1ec>)
  32115. timer_AddFunction(500, &LED_Blinky_Green);
  32116. 8010e9e: 493b ldr r1, [pc, #236] ; (8010f8c <main+0x1f0>)
  32117. {
  32118. // IAPviaETH = false;
  32119. // timer_AddFunction(500, &LED_Blinky_Yellow);
  32120. // SD_NVIC_Init();
  32121. } else {
  32122. IAPviaETH = true;
  32123. 8010ea0: 2201 movs r2, #1
  32124. timer_AddFunction(500, &LED_Blinky_Green);
  32125. 8010ea2: f44f 70fa mov.w r0, #500 ; 0x1f4
  32126. {
  32127. // IAPviaETH = false;
  32128. // timer_AddFunction(500, &LED_Blinky_Yellow);
  32129. // SD_NVIC_Init();
  32130. } else {
  32131. IAPviaETH = true;
  32132. 8010ea6: 701a strb r2, [r3, #0]
  32133. timer_AddFunction(500, &LED_Blinky_Green);
  32134. 8010ea8: f7fe fe08 bl 800fabc <timer_AddFunction>
  32135. }
  32136. /* Check if valid stack address (RAM address) */
  32137. if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000) {
  32138. 8010eac: 4b2b ldr r3, [pc, #172] ; (8010f5c <main+0x1c0>)
  32139. 8010eae: 681a ldr r2, [r3, #0]
  32140. 8010eb0: 4b2b ldr r3, [pc, #172] ; (8010f60 <main+0x1c4>)
  32141. 8010eb2: 4013 ands r3, r2
  32142. 8010eb4: f1b3 5f00 cmp.w r3, #536870912 ; 0x20000000
  32143. 8010eb8: d105 bne.n 8010ec6 <main+0x12a>
  32144. timer_AddFunction(1000, &UpdateTimeout_Handler);
  32145. 8010eba: f44f 707a mov.w r0, #1000 ; 0x3e8
  32146. 8010ebe: 4934 ldr r1, [pc, #208] ; (8010f90 <main+0x1f4>)
  32147. 8010ec0: f7fe fdfc bl 800fabc <timer_AddFunction>
  32148. 8010ec4: e002 b.n 8010ecc <main+0x130>
  32149. }
  32150. else {
  32151. /* Флеш пустая, нечего загружать, висим в аварийном режиме */
  32152. fInvalidFw = 1;
  32153. 8010ec6: 4b2a ldr r3, [pc, #168] ; (8010f70 <main+0x1d4>)
  32154. 8010ec8: 2201 movs r2, #1
  32155. 8010eca: 701a strb r2, [r3, #0]
  32156. while (1)
  32157. {
  32158. timer_Main();
  32159. if (IAPviaETH) { // Обновление по ETH
  32160. 8010ecc: 4c2e ldr r4, [pc, #184] ; (8010f88 <main+0x1ec>)
  32161. {
  32162. /* process received ethernet packet */
  32163. LwIP_Pkt_Handle();
  32164. }
  32165. /* handle periodic timers for LwIP */
  32166. LwIP_Periodic_Handle(LocalTime);
  32167. 8010ece: 4d31 ldr r5, [pc, #196] ; (8010f94 <main+0x1f8>)
  32168. if (fDoneReset)
  32169. 8010ed0: 4e31 ldr r6, [pc, #196] ; (8010f98 <main+0x1fc>)
  32170. }
  32171. while (1)
  32172. {
  32173. timer_Main();
  32174. 8010ed2: f7fe fe11 bl 800faf8 <timer_Main>
  32175. if (IAPviaETH) { // Обновление по ETH
  32176. 8010ed6: 7823 ldrb r3, [r4, #0]
  32177. 8010ed8: b333 cbz r3, 8010f28 <main+0x18c>
  32178. /* check if any packet received */
  32179. if (ETH_CheckFrameReceived())
  32180. 8010eda: f7ff fcf1 bl 80108c0 <ETH_CheckFrameReceived>
  32181. 8010ede: b108 cbz r0, 8010ee4 <main+0x148>
  32182. {
  32183. /* process received ethernet packet */
  32184. LwIP_Pkt_Handle();
  32185. 8010ee0: f7ff fa76 bl 80103d0 <LwIP_Pkt_Handle>
  32186. }
  32187. /* handle periodic timers for LwIP */
  32188. LwIP_Periodic_Handle(LocalTime);
  32189. 8010ee4: 6828 ldr r0, [r5, #0]
  32190. 8010ee6: f7ff fabd bl 8010464 <LwIP_Periodic_Handle>
  32191. if (fDoneReset)
  32192. 8010eea: 7833 ldrb r3, [r6, #0]
  32193. 8010eec: b18b cbz r3, 8010f12 <main+0x176>
  32194. {
  32195. resetCounter++;
  32196. 8010eee: 4a2b ldr r2, [pc, #172] ; (8010f9c <main+0x200>)
  32197. 8010ef0: 6813 ldr r3, [r2, #0]
  32198. 8010ef2: 3301 adds r3, #1
  32199. 8010ef4: 6013 str r3, [r2, #0]
  32200. if (resetCounter > 100000)
  32201. 8010ef6: 4a2a ldr r2, [pc, #168] ; (8010fa0 <main+0x204>)
  32202. 8010ef8: 4293 cmp r3, r2
  32203. 8010efa: d90a bls.n 8010f12 <main+0x176>
  32204. {
  32205. loadMode = 0;
  32206. bootTry = BOOT_TRY;
  32207. RTC_WriteBackupRegister(RTC_BKP_DR1, loadMode);
  32208. 8010efc: 2001 movs r0, #1
  32209. 8010efe: 2100 movs r1, #0
  32210. 8010f00: f7f9 f878 bl 8009ff4 <RTC_WriteBackupRegister>
  32211. RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
  32212. 8010f04: 2002 movs r0, #2
  32213. 8010f06: 2106 movs r1, #6
  32214. 8010f08: f7f9 f874 bl 8009ff4 <RTC_WriteBackupRegister>
  32215. /* Set FW update flag */
  32216. RTC_WriteBackupRegister(RTC_BKP_DR3, 1);
  32217. 8010f0c: 2003 movs r0, #3
  32218. 8010f0e: 2101 movs r1, #1
  32219. 8010f10: e01e b.n 8010f50 <main+0x1b4>
  32220. NVIC_SystemReset();
  32221. }
  32222. }
  32223. if (fErrorReset)
  32224. 8010f12: 4b24 ldr r3, [pc, #144] ; (8010fa4 <main+0x208>)
  32225. 8010f14: 781b ldrb r3, [r3, #0]
  32226. 8010f16: b13b cbz r3, 8010f28 <main+0x18c>
  32227. {
  32228. resetCounter++;
  32229. 8010f18: 4a20 ldr r2, [pc, #128] ; (8010f9c <main+0x200>)
  32230. 8010f1a: 6813 ldr r3, [r2, #0]
  32231. 8010f1c: 3301 adds r3, #1
  32232. 8010f1e: 6013 str r3, [r2, #0]
  32233. if (resetCounter > 100000) {
  32234. 8010f20: 4a1f ldr r2, [pc, #124] ; (8010fa0 <main+0x204>)
  32235. 8010f22: 4293 cmp r3, r2
  32236. 8010f24: d900 bls.n 8010f28 <main+0x18c>
  32237. 8010f26: e015 b.n 8010f54 <main+0x1b8>
  32238. }
  32239. }
  32240. }
  32241. //Если нажата DEF переходим в основную прошивку
  32242. if (IO_BtnDefaultPressed() || UpdateTimeoutFlag)
  32243. 8010f28: f7fe fc04 bl 800f734 <IO_BtnDefaultPressed>
  32244. 8010f2c: b918 cbnz r0, 8010f36 <main+0x19a>
  32245. 8010f2e: 4b1e ldr r3, [pc, #120] ; (8010fa8 <main+0x20c>)
  32246. 8010f30: 781b ldrb r3, [r3, #0]
  32247. 8010f32: 2b00 cmp r3, #0
  32248. 8010f34: d0cd beq.n 8010ed2 <main+0x136>
  32249. {
  32250. if (!fUpload && ((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) != 0xFFFFFFFF)) {
  32251. 8010f36: 4b1d ldr r3, [pc, #116] ; (8010fac <main+0x210>)
  32252. 8010f38: 7819 ldrb r1, [r3, #0]
  32253. 8010f3a: 2900 cmp r1, #0
  32254. 8010f3c: d1c9 bne.n 8010ed2 <main+0x136>
  32255. 8010f3e: 4b07 ldr r3, [pc, #28] ; (8010f5c <main+0x1c0>)
  32256. 8010f40: 681b ldr r3, [r3, #0]
  32257. 8010f42: 3301 adds r3, #1
  32258. 8010f44: d0c5 beq.n 8010ed2 <main+0x136>
  32259. PRINT_USART("\n\rUpdate timeout... Return to main FW\n\r");
  32260. loadMode = 0;
  32261. bootTry = BOOT_TRY;
  32262. RTC_WriteBackupRegister(RTC_BKP_DR1, loadMode);
  32263. 8010f46: 2001 movs r0, #1
  32264. 8010f48: f7f9 f854 bl 8009ff4 <RTC_WriteBackupRegister>
  32265. RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
  32266. 8010f4c: 2002 movs r0, #2
  32267. 8010f4e: 2106 movs r1, #6
  32268. 8010f50: f7f9 f850 bl 8009ff4 <RTC_WriteBackupRegister>
  32269. NVIC_SystemReset();
  32270. 8010f54: f7ff fefa bl 8010d4c <NVIC_SystemReset>
  32271. 8010f58: 0801363f .word 0x0801363f
  32272. 8010f5c: 08020000 .word 0x08020000
  32273. 8010f60: 2ffe0000 .word 0x2ffe0000
  32274. 8010f64: 08020004 .word 0x08020004
  32275. 8010f68: 2000c998 .word 0x2000c998
  32276. 8010f6c: 2000c994 .word 0x2000c994
  32277. 8010f70: 20006dc4 .word 0x20006dc4
  32278. 8010f74: 20006dba .word 0x20006dba
  32279. 8010f78: 0801365b .word 0x0801365b
  32280. 8010f7c: e000e010 .word 0xe000e010
  32281. 8010f80: 0001d4bf .word 0x0001d4bf
  32282. 8010f84: e000ed00 .word 0xe000ed00
  32283. 8010f88: 20006db8 .word 0x20006db8
  32284. 8010f8c: 0800f7f5 .word 0x0800f7f5
  32285. 8010f90: 08010d6d .word 0x08010d6d
  32286. 8010f94: 20006db4 .word 0x20006db4
  32287. 8010f98: 20006dbc .word 0x20006dbc
  32288. 8010f9c: 20006dc0 .word 0x20006dc0
  32289. 8010fa0: 000186a0 .word 0x000186a0
  32290. 8010fa4: 20006dbb .word 0x20006dbb
  32291. 8010fa8: 20006db9 .word 0x20006db9
  32292. 8010fac: 20006db0 .word 0x20006db0
  32293. 08010fb0 <Time_Update>:
  32294. * @param None
  32295. * @retval None
  32296. */
  32297. void Time_Update(void)
  32298. {
  32299. LocalTime += SYSTEMTICK_PERIOD_MS;
  32300. 8010fb0: 4b02 ldr r3, [pc, #8] ; (8010fbc <Time_Update+0xc>)
  32301. 8010fb2: 681a ldr r2, [r3, #0]
  32302. 8010fb4: 3201 adds r2, #1
  32303. 8010fb6: 601a str r2, [r3, #0]
  32304. 8010fb8: 4770 bx lr
  32305. 8010fba: bf00 nop
  32306. 8010fbc: 20006db4 .word 0x20006db4
  32307. 08010fc0 <sys_now>:
  32308. /**
  32309. * @brief
  32310. */
  32311. u32_t sys_now(void) {
  32312. return LocalTime;
  32313. 8010fc0: 4b01 ldr r3, [pc, #4] ; (8010fc8 <sys_now+0x8>)
  32314. 8010fc2: 6818 ldr r0, [r3, #0]
  32315. }
  32316. 8010fc4: 4770 bx lr
  32317. 8010fc6: bf00 nop
  32318. 8010fc8: 20006db4 .word 0x20006db4
  32319. 08010fcc <NMI_Handler>:
  32320. * @brief This function handles NMI exception.
  32321. * @param None
  32322. * @retval None
  32323. */
  32324. void NMI_Handler(void)
  32325. {
  32326. 8010fcc: 4770 bx lr
  32327. 08010fce <HardFault_Handler>:
  32328. * @brief This function handles Hard Fault exception.
  32329. * @param None
  32330. * @retval None
  32331. */
  32332. void HardFault_Handler(void)
  32333. {
  32334. 8010fce: e7fe b.n 8010fce <HardFault_Handler>
  32335. 08010fd0 <MemManage_Handler>:
  32336. * @brief This function handles Memory Manage exception.
  32337. * @param None
  32338. * @retval None
  32339. */
  32340. void MemManage_Handler(void)
  32341. {
  32342. 8010fd0: e7fe b.n 8010fd0 <MemManage_Handler>
  32343. 08010fd2 <BusFault_Handler>:
  32344. * @brief This function handles Bus Fault exception.
  32345. * @param None
  32346. * @retval None
  32347. */
  32348. void BusFault_Handler(void)
  32349. {
  32350. 8010fd2: e7fe b.n 8010fd2 <BusFault_Handler>
  32351. 08010fd4 <UsageFault_Handler>:
  32352. * @brief This function handles Usage Fault exception.
  32353. * @param None
  32354. * @retval None
  32355. */
  32356. void UsageFault_Handler(void)
  32357. {
  32358. 8010fd4: e7fe b.n 8010fd4 <UsageFault_Handler>
  32359. 08010fd6 <DebugMon_Handler>:
  32360. * @brief This function handles Debug Monitor exception.
  32361. * @param None
  32362. * @retval None
  32363. */
  32364. void DebugMon_Handler(void)
  32365. {
  32366. 8010fd6: 4770 bx lr
  32367. 08010fd8 <ulli2a>:
  32368. #ifdef PRINTF_LONG_LONG_SUPPORT
  32369. static void _TFP_GCC_NO_INLINE_ ulli2a(
  32370. unsigned long long int num, struct param *p)
  32371. {
  32372. 8010fd8: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
  32373. int n = 0;
  32374. unsigned long long int d = 1;
  32375. char *bf = p->bf;
  32376. while (num / d >= p->base)
  32377. 8010fdc: 68d3 ldr r3, [r2, #12]
  32378. static void _TFP_GCC_NO_INLINE_ ulli2a(
  32379. unsigned long long int num, struct param *p)
  32380. {
  32381. int n = 0;
  32382. unsigned long long int d = 1;
  32383. char *bf = p->bf;
  32384. 8010fde: f8d2 b010 ldr.w fp, [r2, #16]
  32385. #ifdef PRINTF_LONG_LONG_SUPPORT
  32386. static void _TFP_GCC_NO_INLINE_ ulli2a(
  32387. unsigned long long int num, struct param *p)
  32388. {
  32389. 8010fe2: 4681 mov r9, r0
  32390. 8010fe4: 468a mov sl, r1
  32391. 8010fe6: 4690 mov r8, r2
  32392. int n = 0;
  32393. unsigned long long int d = 1;
  32394. char *bf = p->bf;
  32395. while (num / d >= p->base)
  32396. 8010fe8: 461e mov r6, r3
  32397. 8010fea: 2700 movs r7, #0
  32398. #ifdef PRINTF_LONG_LONG_SUPPORT
  32399. static void _TFP_GCC_NO_INLINE_ ulli2a(
  32400. unsigned long long int num, struct param *p)
  32401. {
  32402. int n = 0;
  32403. unsigned long long int d = 1;
  32404. 8010fec: 2401 movs r4, #1
  32405. 8010fee: 2500 movs r5, #0
  32406. char *bf = p->bf;
  32407. while (num / d >= p->base)
  32408. 8010ff0: e006 b.n 8011000 <ulli2a+0x28>
  32409. d *= p->base;
  32410. 8010ff2: fb04 f307 mul.w r3, r4, r7
  32411. 8010ff6: fb06 3305 mla r3, r6, r5, r3
  32412. 8010ffa: fba4 4506 umull r4, r5, r4, r6
  32413. 8010ffe: 195d adds r5, r3, r5
  32414. unsigned long long int num, struct param *p)
  32415. {
  32416. int n = 0;
  32417. unsigned long long int d = 1;
  32418. char *bf = p->bf;
  32419. while (num / d >= p->base)
  32420. 8011000: 4648 mov r0, r9
  32421. 8011002: 4651 mov r1, sl
  32422. 8011004: 4622 mov r2, r4
  32423. 8011006: 462b mov r3, r5
  32424. 8011008: f7f7 fcd8 bl 80089bc <__aeabi_uldivmod>
  32425. 801100c: 42b9 cmp r1, r7
  32426. 801100e: bf08 it eq
  32427. 8011010: 42b0 cmpeq r0, r6
  32428. 8011012: d2ee bcs.n 8010ff2 <ulli2a+0x1a>
  32429. 8011014: 2600 movs r6, #0
  32430. 8011016: e02d b.n 8011074 <ulli2a+0x9c>
  32431. d *= p->base;
  32432. while (d != 0) {
  32433. int dgt = num / d;
  32434. 8011018: 4622 mov r2, r4
  32435. 801101a: 462b mov r3, r5
  32436. 801101c: 4648 mov r0, r9
  32437. 801101e: 4651 mov r1, sl
  32438. 8011020: f7f7 fccc bl 80089bc <__aeabi_uldivmod>
  32439. num %= d;
  32440. 8011024: 4651 mov r1, sl
  32441. 8011026: 4622 mov r2, r4
  32442. 8011028: 462b mov r3, r5
  32443. unsigned long long int d = 1;
  32444. char *bf = p->bf;
  32445. while (num / d >= p->base)
  32446. d *= p->base;
  32447. while (d != 0) {
  32448. int dgt = num / d;
  32449. 801102a: 4607 mov r7, r0
  32450. num %= d;
  32451. 801102c: 4648 mov r0, r9
  32452. 801102e: f7f7 fcc5 bl 80089bc <__aeabi_uldivmod>
  32453. d /= p->base;
  32454. 8011032: 4620 mov r0, r4
  32455. 8011034: 4629 mov r1, r5
  32456. char *bf = p->bf;
  32457. while (num / d >= p->base)
  32458. d *= p->base;
  32459. while (d != 0) {
  32460. int dgt = num / d;
  32461. num %= d;
  32462. 8011036: 4691 mov r9, r2
  32463. 8011038: 469a mov sl, r3
  32464. d /= p->base;
  32465. 801103a: f8d8 200c ldr.w r2, [r8, #12]
  32466. 801103e: 2300 movs r3, #0
  32467. 8011040: f7f7 fcbc bl 80089bc <__aeabi_uldivmod>
  32468. 8011044: 4604 mov r4, r0
  32469. 8011046: 460d mov r5, r1
  32470. if (n || dgt > 0 || d == 0) {
  32471. 8011048: b926 cbnz r6, 8011054 <ulli2a+0x7c>
  32472. 801104a: 2f00 cmp r7, #0
  32473. 801104c: dc02 bgt.n 8011054 <ulli2a+0x7c>
  32474. 801104e: ea54 0305 orrs.w r3, r4, r5
  32475. 8011052: d1e1 bne.n 8011018 <ulli2a+0x40>
  32476. *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
  32477. 8011054: 2f09 cmp r7, #9
  32478. 8011056: b2fa uxtb r2, r7
  32479. 8011058: dd07 ble.n 801106a <ulli2a+0x92>
  32480. 801105a: f898 3000 ldrb.w r3, [r8]
  32481. 801105e: f013 0f04 tst.w r3, #4
  32482. 8011062: bf0c ite eq
  32483. 8011064: 2357 moveq r3, #87 ; 0x57
  32484. 8011066: 2337 movne r3, #55 ; 0x37
  32485. 8011068: e000 b.n 801106c <ulli2a+0x94>
  32486. 801106a: 2330 movs r3, #48 ; 0x30
  32487. 801106c: 189b adds r3, r3, r2
  32488. 801106e: f80b 3b01 strb.w r3, [fp], #1
  32489. ++n;
  32490. 8011072: 3601 adds r6, #1
  32491. int n = 0;
  32492. unsigned long long int d = 1;
  32493. char *bf = p->bf;
  32494. while (num / d >= p->base)
  32495. d *= p->base;
  32496. while (d != 0) {
  32497. 8011074: ea54 0305 orrs.w r3, r4, r5
  32498. 8011078: d1ce bne.n 8011018 <ulli2a+0x40>
  32499. if (n || dgt > 0 || d == 0) {
  32500. *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
  32501. ++n;
  32502. }
  32503. }
  32504. *bf = 0;
  32505. 801107a: 2300 movs r3, #0
  32506. 801107c: f88b 3000 strb.w r3, [fp]
  32507. 8011080: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
  32508. 08011084 <uli2a>:
  32509. }
  32510. #endif
  32511. #ifdef PRINTF_LONG_SUPPORT
  32512. static void uli2a(unsigned long int num, struct param *p)
  32513. {
  32514. 8011084: b570 push {r4, r5, r6, lr}
  32515. int n = 0;
  32516. unsigned long int d = 1;
  32517. char *bf = p->bf;
  32518. while (num / d >= p->base)
  32519. 8011086: 68ca ldr r2, [r1, #12]
  32520. #ifdef PRINTF_LONG_SUPPORT
  32521. static void uli2a(unsigned long int num, struct param *p)
  32522. {
  32523. int n = 0;
  32524. unsigned long int d = 1;
  32525. char *bf = p->bf;
  32526. 8011088: 690c ldr r4, [r1, #16]
  32527. #ifdef PRINTF_LONG_SUPPORT
  32528. static void uli2a(unsigned long int num, struct param *p)
  32529. {
  32530. int n = 0;
  32531. unsigned long int d = 1;
  32532. 801108a: 2301 movs r3, #1
  32533. char *bf = p->bf;
  32534. while (num / d >= p->base)
  32535. 801108c: e000 b.n 8011090 <uli2a+0xc>
  32536. d *= p->base;
  32537. 801108e: 4353 muls r3, r2
  32538. static void uli2a(unsigned long int num, struct param *p)
  32539. {
  32540. int n = 0;
  32541. unsigned long int d = 1;
  32542. char *bf = p->bf;
  32543. while (num / d >= p->base)
  32544. 8011090: fbb0 f5f3 udiv r5, r0, r3
  32545. 8011094: 4295 cmp r5, r2
  32546. 8011096: d2fa bcs.n 801108e <uli2a+0xa>
  32547. 8011098: 2500 movs r5, #0
  32548. 801109a: e01a b.n 80110d2 <uli2a+0x4e>
  32549. d *= p->base;
  32550. while (d != 0) {
  32551. int dgt = num / d;
  32552. num %= d;
  32553. d /= p->base;
  32554. 801109c: 68ce ldr r6, [r1, #12]
  32555. unsigned long int d = 1;
  32556. char *bf = p->bf;
  32557. while (num / d >= p->base)
  32558. d *= p->base;
  32559. while (d != 0) {
  32560. int dgt = num / d;
  32561. 801109e: fbb0 f2f3 udiv r2, r0, r3
  32562. num %= d;
  32563. 80110a2: fb03 0012 mls r0, r3, r2, r0
  32564. d /= p->base;
  32565. 80110a6: fbb3 f3f6 udiv r3, r3, r6
  32566. if (n || dgt > 0 || d == 0) {
  32567. 80110aa: b91d cbnz r5, 80110b4 <uli2a+0x30>
  32568. 80110ac: 2a00 cmp r2, #0
  32569. 80110ae: dc01 bgt.n 80110b4 <uli2a+0x30>
  32570. 80110b0: 2b00 cmp r3, #0
  32571. 80110b2: d1f3 bne.n 801109c <uli2a+0x18>
  32572. *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
  32573. 80110b4: 2a09 cmp r2, #9
  32574. 80110b6: b2d6 uxtb r6, r2
  32575. 80110b8: dd06 ble.n 80110c8 <uli2a+0x44>
  32576. 80110ba: 780a ldrb r2, [r1, #0]
  32577. 80110bc: f012 0f04 tst.w r2, #4
  32578. 80110c0: bf0c ite eq
  32579. 80110c2: 2257 moveq r2, #87 ; 0x57
  32580. 80110c4: 2237 movne r2, #55 ; 0x37
  32581. 80110c6: e000 b.n 80110ca <uli2a+0x46>
  32582. 80110c8: 2230 movs r2, #48 ; 0x30
  32583. 80110ca: 1992 adds r2, r2, r6
  32584. 80110cc: f804 2b01 strb.w r2, [r4], #1
  32585. ++n;
  32586. 80110d0: 3501 adds r5, #1
  32587. int n = 0;
  32588. unsigned long int d = 1;
  32589. char *bf = p->bf;
  32590. while (num / d >= p->base)
  32591. d *= p->base;
  32592. while (d != 0) {
  32593. 80110d2: 2b00 cmp r3, #0
  32594. 80110d4: d1e2 bne.n 801109c <uli2a+0x18>
  32595. if (n || dgt > 0 || d == 0) {
  32596. *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
  32597. ++n;
  32598. }
  32599. }
  32600. *bf = 0;
  32601. 80110d6: 7023 strb r3, [r4, #0]
  32602. 80110d8: bd70 pop {r4, r5, r6, pc}
  32603. 080110da <ui2a>:
  32604. uli2a(num, p);
  32605. }
  32606. #endif
  32607. static void ui2a(unsigned int num, struct param *p)
  32608. {
  32609. 80110da: b570 push {r4, r5, r6, lr}
  32610. int n = 0;
  32611. unsigned int d = 1;
  32612. char *bf = p->bf;
  32613. while (num / d >= p->base)
  32614. 80110dc: 68ca ldr r2, [r1, #12]
  32615. static void ui2a(unsigned int num, struct param *p)
  32616. {
  32617. int n = 0;
  32618. unsigned int d = 1;
  32619. char *bf = p->bf;
  32620. 80110de: 690c ldr r4, [r1, #16]
  32621. #endif
  32622. static void ui2a(unsigned int num, struct param *p)
  32623. {
  32624. int n = 0;
  32625. unsigned int d = 1;
  32626. 80110e0: 2301 movs r3, #1
  32627. char *bf = p->bf;
  32628. while (num / d >= p->base)
  32629. 80110e2: e000 b.n 80110e6 <ui2a+0xc>
  32630. d *= p->base;
  32631. 80110e4: 4353 muls r3, r2
  32632. static void ui2a(unsigned int num, struct param *p)
  32633. {
  32634. int n = 0;
  32635. unsigned int d = 1;
  32636. char *bf = p->bf;
  32637. while (num / d >= p->base)
  32638. 80110e6: fbb0 f5f3 udiv r5, r0, r3
  32639. 80110ea: 4295 cmp r5, r2
  32640. 80110ec: d2fa bcs.n 80110e4 <ui2a+0xa>
  32641. 80110ee: 2500 movs r5, #0
  32642. 80110f0: e01a b.n 8011128 <ui2a+0x4e>
  32643. d *= p->base;
  32644. while (d != 0) {
  32645. int dgt = num / d;
  32646. num %= d;
  32647. d /= p->base;
  32648. 80110f2: 68ce ldr r6, [r1, #12]
  32649. unsigned int d = 1;
  32650. char *bf = p->bf;
  32651. while (num / d >= p->base)
  32652. d *= p->base;
  32653. while (d != 0) {
  32654. int dgt = num / d;
  32655. 80110f4: fbb0 f2f3 udiv r2, r0, r3
  32656. num %= d;
  32657. 80110f8: fb03 0012 mls r0, r3, r2, r0
  32658. d /= p->base;
  32659. 80110fc: fbb3 f3f6 udiv r3, r3, r6
  32660. if (n || dgt > 0 || d == 0) {
  32661. 8011100: b91d cbnz r5, 801110a <ui2a+0x30>
  32662. 8011102: 2a00 cmp r2, #0
  32663. 8011104: dc01 bgt.n 801110a <ui2a+0x30>
  32664. 8011106: 2b00 cmp r3, #0
  32665. 8011108: d1f3 bne.n 80110f2 <ui2a+0x18>
  32666. *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
  32667. 801110a: 2a09 cmp r2, #9
  32668. 801110c: b2d6 uxtb r6, r2
  32669. 801110e: dd06 ble.n 801111e <ui2a+0x44>
  32670. 8011110: 780a ldrb r2, [r1, #0]
  32671. 8011112: f012 0f04 tst.w r2, #4
  32672. 8011116: bf0c ite eq
  32673. 8011118: 2257 moveq r2, #87 ; 0x57
  32674. 801111a: 2237 movne r2, #55 ; 0x37
  32675. 801111c: e000 b.n 8011120 <ui2a+0x46>
  32676. 801111e: 2230 movs r2, #48 ; 0x30
  32677. 8011120: 1992 adds r2, r2, r6
  32678. 8011122: f804 2b01 strb.w r2, [r4], #1
  32679. ++n;
  32680. 8011126: 3501 adds r5, #1
  32681. int n = 0;
  32682. unsigned int d = 1;
  32683. char *bf = p->bf;
  32684. while (num / d >= p->base)
  32685. d *= p->base;
  32686. while (d != 0) {
  32687. 8011128: 2b00 cmp r3, #0
  32688. 801112a: d1e2 bne.n 80110f2 <ui2a+0x18>
  32689. if (n || dgt > 0 || d == 0) {
  32690. *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
  32691. ++n;
  32692. }
  32693. }
  32694. *bf = 0;
  32695. 801112c: 7023 strb r3, [r4, #0]
  32696. 801112e: bd70 pop {r4, r5, r6, pc}
  32697. 08011130 <putchw>:
  32698. }
  32699. static void putchw(void *putp, putcf putf, struct param *p)
  32700. {
  32701. 8011130: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
  32702. char ch;
  32703. int n = p->width;
  32704. char *bf = p->bf;
  32705. 8011134: 6913 ldr r3, [r2, #16]
  32706. }
  32707. static void putchw(void *putp, putcf putf, struct param *p)
  32708. {
  32709. char ch;
  32710. int n = p->width;
  32711. 8011136: 6854 ldr r4, [r2, #4]
  32712. }
  32713. static void putchw(void *putp, putcf putf, struct param *p)
  32714. {
  32715. 8011138: 4606 mov r6, r0
  32716. 801113a: 460f mov r7, r1
  32717. 801113c: 4615 mov r5, r2
  32718. char ch;
  32719. int n = p->width;
  32720. char *bf = p->bf;
  32721. /* Number of filling characters */
  32722. while (*bf++ && n > 0)
  32723. 801113e: e000 b.n 8011142 <putchw+0x12>
  32724. n--;
  32725. 8011140: 3c01 subs r4, #1
  32726. char ch;
  32727. int n = p->width;
  32728. char *bf = p->bf;
  32729. /* Number of filling characters */
  32730. while (*bf++ && n > 0)
  32731. 8011142: f813 2b01 ldrb.w r2, [r3], #1
  32732. 8011146: b912 cbnz r2, 801114e <putchw+0x1e>
  32733. n--;
  32734. if (p->sign)
  32735. 8011148: 7a2b ldrb r3, [r5, #8]
  32736. 801114a: b91b cbnz r3, 8011154 <putchw+0x24>
  32737. 801114c: e003 b.n 8011156 <putchw+0x26>
  32738. char ch;
  32739. int n = p->width;
  32740. char *bf = p->bf;
  32741. /* Number of filling characters */
  32742. while (*bf++ && n > 0)
  32743. 801114e: 2c00 cmp r4, #0
  32744. 8011150: dcf6 bgt.n 8011140 <putchw+0x10>
  32745. 8011152: e7f9 b.n 8011148 <putchw+0x18>
  32746. n--;
  32747. if (p->sign)
  32748. n--;
  32749. 8011154: 3c01 subs r4, #1
  32750. if (p->alt && p->base == 16)
  32751. 8011156: 782b ldrb r3, [r5, #0]
  32752. 8011158: 0799 lsls r1, r3, #30
  32753. 801115a: d507 bpl.n 801116c <putchw+0x3c>
  32754. 801115c: 68eb ldr r3, [r5, #12]
  32755. 801115e: 2b10 cmp r3, #16
  32756. 8011160: d101 bne.n 8011166 <putchw+0x36>
  32757. n -= 2;
  32758. 8011162: 3c02 subs r4, #2
  32759. 8011164: e002 b.n 801116c <putchw+0x3c>
  32760. else if (p->alt && p->base == 8)
  32761. 8011166: 2b08 cmp r3, #8
  32762. n--;
  32763. 8011168: bf08 it eq
  32764. 801116a: 3c01 subeq r4, #1
  32765. /* Fill with space to align to the right, before alternate or sign */
  32766. if (!p->lz && !p->align_left) {
  32767. 801116c: 782b ldrb r3, [r5, #0]
  32768. 801116e: f013 0f09 tst.w r3, #9
  32769. 8011172: d10d bne.n 8011190 <putchw+0x60>
  32770. 8011174: 46a0 mov r8, r4
  32771. 8011176: e004 b.n 8011182 <putchw+0x52>
  32772. while (n-- > 0)
  32773. putf(putp, ' ');
  32774. 8011178: 4630 mov r0, r6
  32775. 801117a: 2120 movs r1, #32
  32776. 801117c: 47b8 blx r7
  32777. 801117e: f108 38ff add.w r8, r8, #4294967295
  32778. else if (p->alt && p->base == 8)
  32779. n--;
  32780. /* Fill with space to align to the right, before alternate or sign */
  32781. if (!p->lz && !p->align_left) {
  32782. while (n-- > 0)
  32783. 8011182: f1b8 0f00 cmp.w r8, #0
  32784. 8011186: dcf7 bgt.n 8011178 <putchw+0x48>
  32785. return neg ? -fvalue : fvalue;
  32786. }
  32787. static void putchw(void *putp, putcf putf, struct param *p)
  32788. 8011188: 1e63 subs r3, r4, #1
  32789. 801118a: ea24 74e4 bic.w r4, r4, r4, asr #31
  32790. 801118e: 1b1c subs r4, r3, r4
  32791. while (n-- > 0)
  32792. putf(putp, ' ');
  32793. }
  32794. /* print sign */
  32795. if (p->sign)
  32796. 8011190: 7a29 ldrb r1, [r5, #8]
  32797. 8011192: b109 cbz r1, 8011198 <putchw+0x68>
  32798. putf(putp, p->sign);
  32799. 8011194: 4630 mov r0, r6
  32800. 8011196: 47b8 blx r7
  32801. /* Alternate */
  32802. if (p->alt && p->base == 16) {
  32803. 8011198: 782b ldrb r3, [r5, #0]
  32804. 801119a: 079a lsls r2, r3, #30
  32805. 801119c: d512 bpl.n 80111c4 <putchw+0x94>
  32806. 801119e: 68eb ldr r3, [r5, #12]
  32807. 80111a0: 2b10 cmp r3, #16
  32808. 80111a2: d10a bne.n 80111ba <putchw+0x8a>
  32809. putf(putp, '0');
  32810. 80111a4: 2130 movs r1, #48 ; 0x30
  32811. 80111a6: 4630 mov r0, r6
  32812. 80111a8: 47b8 blx r7
  32813. putf(putp, (p->uc ? 'X' : 'x'));
  32814. 80111aa: 782b ldrb r3, [r5, #0]
  32815. 80111ac: f013 0f04 tst.w r3, #4
  32816. 80111b0: 4630 mov r0, r6
  32817. 80111b2: bf0c ite eq
  32818. 80111b4: 2178 moveq r1, #120 ; 0x78
  32819. 80111b6: 2158 movne r1, #88 ; 0x58
  32820. 80111b8: e003 b.n 80111c2 <putchw+0x92>
  32821. } else if (p->alt && p->base == 8) {
  32822. 80111ba: 2b08 cmp r3, #8
  32823. 80111bc: d102 bne.n 80111c4 <putchw+0x94>
  32824. putf(putp, '0');
  32825. 80111be: 4630 mov r0, r6
  32826. 80111c0: 2130 movs r1, #48 ; 0x30
  32827. 80111c2: 47b8 blx r7
  32828. }
  32829. /* Fill with zeros, after alternate or sign */
  32830. if (p->lz) {
  32831. 80111c4: 782b ldrb r3, [r5, #0]
  32832. 80111c6: 07db lsls r3, r3, #31
  32833. 80111c8: d50d bpl.n 80111e6 <putchw+0xb6>
  32834. 80111ca: 46a0 mov r8, r4
  32835. 80111cc: e004 b.n 80111d8 <putchw+0xa8>
  32836. while (n-- > 0)
  32837. putf(putp, '0');
  32838. 80111ce: 4630 mov r0, r6
  32839. 80111d0: 2130 movs r1, #48 ; 0x30
  32840. 80111d2: 47b8 blx r7
  32841. 80111d4: f108 38ff add.w r8, r8, #4294967295
  32842. putf(putp, '0');
  32843. }
  32844. /* Fill with zeros, after alternate or sign */
  32845. if (p->lz) {
  32846. while (n-- > 0)
  32847. 80111d8: f1b8 0f00 cmp.w r8, #0
  32848. 80111dc: dcf7 bgt.n 80111ce <putchw+0x9e>
  32849. return neg ? -fvalue : fvalue;
  32850. }
  32851. static void putchw(void *putp, putcf putf, struct param *p)
  32852. 80111de: 1e63 subs r3, r4, #1
  32853. 80111e0: ea24 74e4 bic.w r4, r4, r4, asr #31
  32854. 80111e4: 1b1c subs r4, r3, r4
  32855. while (n-- > 0)
  32856. putf(putp, '0');
  32857. }
  32858. /* Put actual buffer */
  32859. bf = p->bf;
  32860. 80111e6: f8d5 8010 ldr.w r8, [r5, #16]
  32861. while ((ch = *bf++))
  32862. 80111ea: e001 b.n 80111f0 <putchw+0xc0>
  32863. putf(putp, ch);
  32864. 80111ec: 4630 mov r0, r6
  32865. 80111ee: 47b8 blx r7
  32866. putf(putp, '0');
  32867. }
  32868. /* Put actual buffer */
  32869. bf = p->bf;
  32870. while ((ch = *bf++))
  32871. 80111f0: f818 1b01 ldrb.w r1, [r8], #1
  32872. 80111f4: 2900 cmp r1, #0
  32873. 80111f6: d1f9 bne.n 80111ec <putchw+0xbc>
  32874. putf(putp, ch);
  32875. /* Fill with space to align to the left, after string */
  32876. if (!p->lz && p->align_left) {
  32877. 80111f8: 782b ldrb r3, [r5, #0]
  32878. 80111fa: f003 0309 and.w r3, r3, #9
  32879. 80111fe: 2b08 cmp r3, #8
  32880. 8011200: d106 bne.n 8011210 <putchw+0xe0>
  32881. 8011202: e003 b.n 801120c <putchw+0xdc>
  32882. while (n-- > 0)
  32883. putf(putp, ' ');
  32884. 8011204: 4630 mov r0, r6
  32885. 8011206: 2120 movs r1, #32
  32886. 8011208: 47b8 blx r7
  32887. 801120a: 3c01 subs r4, #1
  32888. while ((ch = *bf++))
  32889. putf(putp, ch);
  32890. /* Fill with space to align to the left, after string */
  32891. if (!p->lz && p->align_left) {
  32892. while (n-- > 0)
  32893. 801120c: 2c00 cmp r4, #0
  32894. 801120e: dcf9 bgt.n 8011204 <putchw+0xd4>
  32895. 8011210: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
  32896. 08011214 <_vsprintf_putcf>:
  32897. };
  32898. static void _vsprintf_putcf(void *p, char c)
  32899. {
  32900. struct _vsprintf_putcf_data *data = (struct _vsprintf_putcf_data*)p;
  32901. data->dest[data->num_chars++] = c;
  32902. 8011214: e890 000c ldmia.w r0, {r2, r3}
  32903. 8011218: 54d1 strb r1, [r2, r3]
  32904. 801121a: 3301 adds r3, #1
  32905. 801121c: 6043 str r3, [r0, #4]
  32906. 801121e: 4770 bx lr
  32907. 08011220 <tfp_format>:
  32908. putf(putp, ' ');
  32909. }
  32910. }
  32911. void tfp_format(void *putp, putcf putf, const char *fmt, va_list va)
  32912. {
  32913. 8011220: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  32914. 8011224: b09b sub sp, #108 ; 0x6c
  32915. 8011226: 4617 mov r7, r2
  32916. char bf[23]; /* long = 64b on some architectures */
  32917. #else
  32918. char bf[12]; /* int = 32b on some architectures */
  32919. #endif
  32920. char ch;
  32921. p.bf = bf;
  32922. 8011228: aa04 add r2, sp, #16
  32923. putf(putp, ' ');
  32924. }
  32925. }
  32926. void tfp_format(void *putp, putcf putf, const char *fmt, va_list va)
  32927. {
  32928. 801122a: 4605 mov r5, r0
  32929. 801122c: 460e mov r6, r1
  32930. 801122e: 461c mov r4, r3
  32931. char bf[23]; /* long = 64b on some architectures */
  32932. #else
  32933. char bf[12]; /* int = 32b on some architectures */
  32934. #endif
  32935. char ch;
  32936. p.bf = bf;
  32937. 8011230: 920e str r2, [sp, #56] ; 0x38
  32938. while ((ch = *(fmt++))) {
  32939. 8011232: e208 b.n 8011646 <tfp_format+0x426>
  32940. if (ch != '%') {
  32941. 8011234: 2925 cmp r1, #37 ; 0x25
  32942. 8011236: d000 beq.n 801123a <tfp_format+0x1a>
  32943. 8011238: e13a b.n 80114b0 <tfp_format+0x290>
  32944. #endif
  32945. /* Init parameter struct */
  32946. p.lz = 0;
  32947. p.alt = 0;
  32948. p.width = 0;
  32949. p.align_left = 0;
  32950. 801123a: f89d 2028 ldrb.w r2, [sp, #40] ; 0x28
  32951. char lng = 0; /* 1 for long, 2 for long long */
  32952. #endif
  32953. /* Init parameter struct */
  32954. p.lz = 0;
  32955. p.alt = 0;
  32956. p.width = 0;
  32957. 801123e: 2300 movs r3, #0
  32958. p.align_left = 0;
  32959. 8011240: f002 02fc and.w r2, r2, #252 ; 0xfc
  32960. 8011244: f363 02c3 bfi r2, r3, #3, #1
  32961. 8011248: f88d 2028 strb.w r2, [sp, #40] ; 0x28
  32962. p.sign = 0;
  32963. p.prec = 2;
  32964. 801124c: 2102 movs r1, #2
  32965. } else {
  32966. #ifdef PRINTF_LONG_SUPPORT
  32967. char lng = 0; /* 1 for long, 2 for long long */
  32968. #endif
  32969. /* Init parameter struct */
  32970. p.lz = 0;
  32971. 801124e: b2d2 uxtb r2, r2
  32972. 8011250: f002 0c01 and.w ip, r2, #1
  32973. 8011254: f3c2 0040 ubfx r0, r2, #1, #1
  32974. p.alt = 0;
  32975. p.width = 0;
  32976. 8011258: 930b str r3, [sp, #44] ; 0x2c
  32977. p.align_left = 0;
  32978. p.sign = 0;
  32979. 801125a: f88d 3030 strb.w r3, [sp, #48] ; 0x30
  32980. p.prec = 2;
  32981. 801125e: f88d 103c strb.w r1, [sp, #60] ; 0x3c
  32982. 8011262: f3c2 02c0 ubfx r2, r2, #3, #1
  32983. /* Flags */
  32984. while ((ch = *(fmt++))) {
  32985. 8011266: e012 b.n 801128e <tfp_format+0x6e>
  32986. switch (ch) {
  32987. 8011268: 292d cmp r1, #45 ; 0x2d
  32988. 801126a: d00f beq.n 801128c <tfp_format+0x6c>
  32989. 801126c: d804 bhi.n 8011278 <tfp_format+0x58>
  32990. 801126e: 2923 cmp r1, #35 ; 0x23
  32991. 8011270: d008 beq.n 8011284 <tfp_format+0x64>
  32992. 8011272: 292b cmp r1, #43 ; 0x2b
  32993. 8011274: d10f bne.n 8011296 <tfp_format+0x76>
  32994. 8011276: e007 b.n 8011288 <tfp_format+0x68>
  32995. 8011278: 2930 cmp r1, #48 ; 0x30
  32996. 801127a: d000 beq.n 801127e <tfp_format+0x5e>
  32997. 801127c: e00b b.n 8011296 <tfp_format+0x76>
  32998. case '-':
  32999. p.align_left = 1;
  33000. continue;
  33001. case '0':
  33002. p.lz = 1;
  33003. 801127e: f04f 0c01 mov.w ip, #1
  33004. continue;
  33005. 8011282: e004 b.n 801128e <tfp_format+0x6e>
  33006. case '#':
  33007. p.alt = 1;
  33008. 8011284: 2001 movs r0, #1
  33009. continue;
  33010. 8011286: e002 b.n 801128e <tfp_format+0x6e>
  33011. case '+':
  33012. p.sign = 1;
  33013. 8011288: 2301 movs r3, #1
  33014. continue;
  33015. 801128a: e000 b.n 801128e <tfp_format+0x6e>
  33016. /* Flags */
  33017. while ((ch = *(fmt++))) {
  33018. switch (ch) {
  33019. case '-':
  33020. p.align_left = 1;
  33021. 801128c: 2201 movs r2, #1
  33022. p.align_left = 0;
  33023. p.sign = 0;
  33024. p.prec = 2;
  33025. /* Flags */
  33026. while ((ch = *(fmt++))) {
  33027. 801128e: f817 1b01 ldrb.w r1, [r7], #1
  33028. 8011292: 2900 cmp r1, #0
  33029. 8011294: d1e8 bne.n 8011268 <tfp_format+0x48>
  33030. 8011296: f89d 8028 ldrb.w r8, [sp, #40] ; 0x28
  33031. 801129a: f88d 3030 strb.w r3, [sp, #48] ; 0x30
  33032. 801129e: f36c 0800 bfi r8, ip, #0, #1
  33033. 80112a2: 46c4 mov ip, r8
  33034. 80112a4: f360 0c41 bfi ip, r0, #1, #1
  33035. 80112a8: 4660 mov r0, ip
  33036. }
  33037. break;
  33038. }
  33039. /* Width */
  33040. if (ch >= '0' && ch <= '9') {
  33041. 80112aa: f1a1 0330 sub.w r3, r1, #48 ; 0x30
  33042. 80112ae: f362 00c3 bfi r0, r2, #3, #1
  33043. 80112b2: 2b09 cmp r3, #9
  33044. 80112b4: f88d 0028 strb.w r0, [sp, #40] ; 0x28
  33045. 80112b8: d81d bhi.n 80112f6 <tfp_format+0xd6>
  33046. 80112ba: e004 b.n 80112c6 <tfp_format+0xa6>
  33047. unsigned int num = 0;
  33048. int digit;
  33049. while ((digit = a2d(ch)) >= 0) {
  33050. if (digit > base)
  33051. break;
  33052. num = num * base + digit;
  33053. 80112bc: fb00 3202 mla r2, r0, r2, r3
  33054. ch = *p++;
  33055. 80112c0: f817 1b01 ldrb.w r1, [r7], #1
  33056. 80112c4: e001 b.n 80112ca <tfp_format+0xaa>
  33057. }
  33058. break;
  33059. }
  33060. /* Width */
  33061. if (ch >= '0' && ch <= '9') {
  33062. 80112c6: 2200 movs r2, #0
  33063. unsigned int num = 0;
  33064. int digit;
  33065. while ((digit = a2d(ch)) >= 0) {
  33066. if (digit > base)
  33067. break;
  33068. num = num * base + digit;
  33069. 80112c8: 200a movs r0, #10
  33070. ui2a(num, p);
  33071. }
  33072. static int a2d(char ch)
  33073. {
  33074. if (ch >= '0' && ch <= '9')
  33075. 80112ca: f1a1 0330 sub.w r3, r1, #48 ; 0x30
  33076. 80112ce: fa5f fc83 uxtb.w ip, r3
  33077. 80112d2: f1bc 0f09 cmp.w ip, #9
  33078. 80112d6: d9f1 bls.n 80112bc <tfp_format+0x9c>
  33079. return ch - '0';
  33080. else if (ch >= 'a' && ch <= 'f')
  33081. 80112d8: f1a1 0361 sub.w r3, r1, #97 ; 0x61
  33082. 80112dc: 2b05 cmp r3, #5
  33083. 80112de: d802 bhi.n 80112e6 <tfp_format+0xc6>
  33084. return ch - 'a' + 10;
  33085. 80112e0: f1a1 0357 sub.w r3, r1, #87 ; 0x57
  33086. 80112e4: e1b5 b.n 8011652 <tfp_format+0x432>
  33087. else if (ch >= 'A' && ch <= 'F')
  33088. 80112e6: f1a1 0341 sub.w r3, r1, #65 ; 0x41
  33089. 80112ea: 2b05 cmp r3, #5
  33090. 80112ec: d802 bhi.n 80112f4 <tfp_format+0xd4>
  33091. return ch - 'A' + 10;
  33092. 80112ee: f1a1 0337 sub.w r3, r1, #55 ; 0x37
  33093. 80112f2: e1ae b.n 8011652 <tfp_format+0x432>
  33094. break;
  33095. num = num * base + digit;
  33096. ch = *p++;
  33097. }
  33098. *src = p;
  33099. *nump = num;
  33100. 80112f4: 920b str r2, [sp, #44] ; 0x2c
  33101. }
  33102. /* We accept 'x.y' format but don't support it completely:
  33103. * we ignore the 'y' digit => this ignores 0-fill
  33104. * size and makes it == width (ie. 'x') */
  33105. if (ch == '.') {
  33106. 80112f6: 292e cmp r1, #46 ; 0x2e
  33107. 80112f8: d10e bne.n 8011318 <tfp_format+0xf8>
  33108. //p.lz = 1; /* zero-padding */
  33109. /* ignore actual 0-fill size: */
  33110. ch = *(fmt++);
  33111. if (ch >= '0' && ch <= '9')
  33112. 80112fa: 783a ldrb r2, [r7, #0]
  33113. 80112fc: 3a30 subs r2, #48 ; 0x30
  33114. 80112fe: b2d2 uxtb r2, r2
  33115. * we ignore the 'y' digit => this ignores 0-fill
  33116. * size and makes it == width (ie. 'x') */
  33117. if (ch == '.') {
  33118. //p.lz = 1; /* zero-padding */
  33119. /* ignore actual 0-fill size: */
  33120. ch = *(fmt++);
  33121. 8011300: 1c7b adds r3, r7, #1
  33122. if (ch >= '0' && ch <= '9')
  33123. 8011302: 2a09 cmp r2, #9
  33124. p.prec = ch - '0';
  33125. 8011304: bf98 it ls
  33126. 8011306: f88d 203c strbls.w r2, [sp, #60] ; 0x3c
  33127. do
  33128. {
  33129. ch = *(fmt++);
  33130. 801130a: f813 1b01 ldrb.w r1, [r3], #1
  33131. } while (ch >= '0' && ch <= '9');
  33132. 801130e: f1a1 0230 sub.w r2, r1, #48 ; 0x30
  33133. 8011312: 2a09 cmp r2, #9
  33134. ch = *(fmt++);
  33135. if (ch >= '0' && ch <= '9')
  33136. p.prec = ch - '0';
  33137. do
  33138. {
  33139. ch = *(fmt++);
  33140. 8011314: 461f mov r7, r3
  33141. } while (ch >= '0' && ch <= '9');
  33142. 8011316: d9f8 bls.n 801130a <tfp_format+0xea>
  33143. }
  33144. #ifdef PRINTF_SIZE_T_SUPPORT
  33145. # ifdef PRINTF_LONG_SUPPORT
  33146. if (ch == 'z') {
  33147. 8011318: 297a cmp r1, #122 ; 0x7a
  33148. 801131a: d102 bne.n 8011322 <tfp_format+0x102>
  33149. ch = *(fmt++);
  33150. 801131c: f817 1b01 ldrb.w r1, [r7], #1
  33151. 8011320: e005 b.n 801132e <tfp_format+0x10e>
  33152. } else
  33153. # endif
  33154. #endif
  33155. #ifdef PRINTF_LONG_SUPPORT
  33156. if (ch == 'l') {
  33157. 8011322: 296c cmp r1, #108 ; 0x6c
  33158. 8011324: d109 bne.n 801133a <tfp_format+0x11a>
  33159. ch = *(fmt++);
  33160. 8011326: 7839 ldrb r1, [r7, #0]
  33161. lng = 1;
  33162. #ifdef PRINTF_LONG_LONG_SUPPORT
  33163. if (ch == 'l') {
  33164. 8011328: 296c cmp r1, #108 ; 0x6c
  33165. 801132a: d002 beq.n 8011332 <tfp_format+0x112>
  33166. # endif
  33167. #endif
  33168. #ifdef PRINTF_LONG_SUPPORT
  33169. if (ch == 'l') {
  33170. ch = *(fmt++);
  33171. 801132c: 3701 adds r7, #1
  33172. lng = 1;
  33173. 801132e: 2301 movs r3, #1
  33174. 8011330: e004 b.n 801133c <tfp_format+0x11c>
  33175. #ifdef PRINTF_LONG_LONG_SUPPORT
  33176. if (ch == 'l') {
  33177. ch = *(fmt++);
  33178. 8011332: 7879 ldrb r1, [r7, #1]
  33179. lng = 2;
  33180. 8011334: 2302 movs r3, #2
  33181. if (ch == 'l') {
  33182. ch = *(fmt++);
  33183. lng = 1;
  33184. #ifdef PRINTF_LONG_LONG_SUPPORT
  33185. if (ch == 'l') {
  33186. ch = *(fmt++);
  33187. 8011336: 3702 adds r7, #2
  33188. 8011338: e000 b.n 801133c <tfp_format+0x11c>
  33189. while ((ch = *(fmt++))) {
  33190. if (ch != '%') {
  33191. putf(putp, ch);
  33192. } else {
  33193. #ifdef PRINTF_LONG_SUPPORT
  33194. char lng = 0; /* 1 for long, 2 for long long */
  33195. 801133a: 2300 movs r3, #0
  33196. lng = 2;
  33197. }
  33198. #endif
  33199. }
  33200. #endif
  33201. switch (ch) {
  33202. 801133c: 2969 cmp r1, #105 ; 0x69
  33203. 801133e: d036 beq.n 80113ae <tfp_format+0x18e>
  33204. 8011340: d816 bhi.n 8011370 <tfp_format+0x150>
  33205. 8011342: 2963 cmp r1, #99 ; 0x63
  33206. 8011344: f000 80a1 beq.w 801148a <tfp_format+0x26a>
  33207. 8011348: d80c bhi.n 8011364 <tfp_format+0x144>
  33208. 801134a: 2946 cmp r1, #70 ; 0x46
  33209. 801134c: f000 80b3 beq.w 80114b6 <tfp_format+0x296>
  33210. 8011350: d806 bhi.n 8011360 <tfp_format+0x140>
  33211. 8011352: 2900 cmp r1, #0
  33212. 8011354: f000 8181 beq.w 801165a <tfp_format+0x43a>
  33213. 8011358: 2925 cmp r1, #37 ; 0x25
  33214. 801135a: f040 8174 bne.w 8011646 <tfp_format+0x426>
  33215. 801135e: e0a7 b.n 80114b0 <tfp_format+0x290>
  33216. 8011360: 2958 cmp r1, #88 ; 0x58
  33217. 8011362: e012 b.n 801138a <tfp_format+0x16a>
  33218. 8011364: 2964 cmp r1, #100 ; 0x64
  33219. 8011366: d022 beq.n 80113ae <tfp_format+0x18e>
  33220. 8011368: 2966 cmp r1, #102 ; 0x66
  33221. 801136a: f040 816c bne.w 8011646 <tfp_format+0x426>
  33222. 801136e: e0a2 b.n 80114b6 <tfp_format+0x296>
  33223. 8011370: 2973 cmp r1, #115 ; 0x73
  33224. 8011372: f000 8090 beq.w 8011496 <tfp_format+0x276>
  33225. 8011376: d805 bhi.n 8011384 <tfp_format+0x164>
  33226. 8011378: 296f cmp r1, #111 ; 0x6f
  33227. 801137a: d078 beq.n 801146e <tfp_format+0x24e>
  33228. 801137c: 2970 cmp r1, #112 ; 0x70
  33229. 801137e: f040 8162 bne.w 8011646 <tfp_format+0x426>
  33230. 8011382: e040 b.n 8011406 <tfp_format+0x1e6>
  33231. 8011384: 2975 cmp r1, #117 ; 0x75
  33232. 8011386: d003 beq.n 8011390 <tfp_format+0x170>
  33233. 8011388: 2978 cmp r1, #120 ; 0x78
  33234. 801138a: f040 815c bne.w 8011646 <tfp_format+0x426>
  33235. 801138e: e041 b.n 8011414 <tfp_format+0x1f4>
  33236. case 0:
  33237. goto abort;
  33238. case 'u':
  33239. p.base = 10;
  33240. 8011390: 220a movs r2, #10
  33241. #ifdef PRINTF_LONG_SUPPORT
  33242. #ifdef PRINTF_LONG_LONG_SUPPORT
  33243. if (2 == lng)
  33244. 8011392: 2b02 cmp r3, #2
  33245. #endif
  33246. switch (ch) {
  33247. case 0:
  33248. goto abort;
  33249. case 'u':
  33250. p.base = 10;
  33251. 8011394: 920d str r2, [sp, #52] ; 0x34
  33252. #ifdef PRINTF_LONG_SUPPORT
  33253. #ifdef PRINTF_LONG_LONG_SUPPORT
  33254. if (2 == lng)
  33255. 8011396: d107 bne.n 80113a8 <tfp_format+0x188>
  33256. ulli2a(va_arg(va, unsigned long long int), &p);
  33257. 8011398: 3407 adds r4, #7
  33258. 801139a: f024 0307 bic.w r3, r4, #7
  33259. 801139e: f103 0408 add.w r4, r3, #8
  33260. 80113a2: e9d3 0100 ldrd r0, r1, [r3]
  33261. 80113a6: e017 b.n 80113d8 <tfp_format+0x1b8>
  33262. else
  33263. #endif
  33264. if (1 == lng)
  33265. uli2a(va_arg(va, unsigned long int), &p);
  33266. 80113a8: 6820 ldr r0, [r4, #0]
  33267. 80113aa: a90a add r1, sp, #40 ; 0x28
  33268. 80113ac: e04f b.n 801144e <tfp_format+0x22e>
  33269. ui2a(va_arg(va, unsigned int), &p);
  33270. putchw(putp, putf, &p);
  33271. break;
  33272. case 'd':
  33273. case 'i':
  33274. p.base = 10;
  33275. 80113ae: 220a movs r2, #10
  33276. #ifdef PRINTF_LONG_SUPPORT
  33277. #ifdef PRINTF_LONG_LONG_SUPPORT
  33278. if (2 == lng)
  33279. 80113b0: 2b02 cmp r3, #2
  33280. ui2a(va_arg(va, unsigned int), &p);
  33281. putchw(putp, putf, &p);
  33282. break;
  33283. case 'd':
  33284. case 'i':
  33285. p.base = 10;
  33286. 80113b2: 920d str r2, [sp, #52] ; 0x34
  33287. #ifdef PRINTF_LONG_SUPPORT
  33288. #ifdef PRINTF_LONG_LONG_SUPPORT
  33289. if (2 == lng)
  33290. 80113b4: d112 bne.n 80113dc <tfp_format+0x1bc>
  33291. lli2a(va_arg(va, long long int), &p);
  33292. 80113b6: 3407 adds r4, #7
  33293. 80113b8: f024 0307 bic.w r3, r4, #7
  33294. 80113bc: e9d3 0100 ldrd r0, r1, [r3]
  33295. 80113c0: f103 0408 add.w r4, r3, #8
  33296. *bf = 0;
  33297. }
  33298. static void lli2a(long long int num, struct param *p)
  33299. {
  33300. if (num < 0) {
  33301. 80113c4: 2800 cmp r0, #0
  33302. 80113c6: f171 0300 sbcs.w r3, r1, #0
  33303. 80113ca: da05 bge.n 80113d8 <tfp_format+0x1b8>
  33304. num = -num;
  33305. p->sign = '-';
  33306. 80113cc: 232d movs r3, #45 ; 0x2d
  33307. }
  33308. static void lli2a(long long int num, struct param *p)
  33309. {
  33310. if (num < 0) {
  33311. num = -num;
  33312. 80113ce: 4240 negs r0, r0
  33313. 80113d0: eb61 0141 sbc.w r1, r1, r1, lsl #1
  33314. p->sign = '-';
  33315. 80113d4: f88d 3030 strb.w r3, [sp, #48] ; 0x30
  33316. }
  33317. ulli2a(num, p);
  33318. 80113d8: aa0a add r2, sp, #40 ; 0x28
  33319. 80113da: e033 b.n 8011444 <tfp_format+0x224>
  33320. #ifdef PRINTF_LONG_LONG_SUPPORT
  33321. if (2 == lng)
  33322. lli2a(va_arg(va, long long int), &p);
  33323. else
  33324. #endif
  33325. if (1 == lng)
  33326. 80113dc: 2b01 cmp r3, #1
  33327. li2a(va_arg(va, long int), &p);
  33328. 80113de: 6820 ldr r0, [r4, #0]
  33329. 80113e0: f104 0804 add.w r8, r4, #4
  33330. #ifdef PRINTF_LONG_LONG_SUPPORT
  33331. if (2 == lng)
  33332. lli2a(va_arg(va, long long int), &p);
  33333. else
  33334. #endif
  33335. if (1 == lng)
  33336. 80113e4: d107 bne.n 80113f6 <tfp_format+0x1d6>
  33337. *bf = 0;
  33338. }
  33339. static void li2a(long num, struct param *p)
  33340. {
  33341. if (num < 0) {
  33342. 80113e6: 2800 cmp r0, #0
  33343. 80113e8: da03 bge.n 80113f2 <tfp_format+0x1d2>
  33344. num = -num;
  33345. p->sign = '-';
  33346. 80113ea: 232d movs r3, #45 ; 0x2d
  33347. }
  33348. static void li2a(long num, struct param *p)
  33349. {
  33350. if (num < 0) {
  33351. num = -num;
  33352. 80113ec: 4240 negs r0, r0
  33353. p->sign = '-';
  33354. 80113ee: f88d 3030 strb.w r3, [sp, #48] ; 0x30
  33355. }
  33356. uli2a(num, p);
  33357. 80113f2: a90a add r1, sp, #40 ; 0x28
  33358. 80113f4: e02f b.n 8011456 <tfp_format+0x236>
  33359. *bf = 0;
  33360. }
  33361. static void i2a(int num, struct param *p)
  33362. {
  33363. if (num < 0) {
  33364. 80113f6: 2800 cmp r0, #0
  33365. 80113f8: da03 bge.n 8011402 <tfp_format+0x1e2>
  33366. num = -num;
  33367. p->sign = '-';
  33368. 80113fa: 232d movs r3, #45 ; 0x2d
  33369. }
  33370. static void i2a(int num, struct param *p)
  33371. {
  33372. if (num < 0) {
  33373. num = -num;
  33374. 80113fc: 4240 negs r0, r0
  33375. p->sign = '-';
  33376. 80113fe: f88d 3030 strb.w r3, [sp, #48] ; 0x30
  33377. }
  33378. ui2a(num, p);
  33379. 8011402: a90a add r1, sp, #40 ; 0x28
  33380. 8011404: e02a b.n 801145c <tfp_format+0x23c>
  33381. i2a(va_arg(va, int), &p);
  33382. putchw(putp, putf, &p);
  33383. break;
  33384. #ifdef SIZEOF_POINTER
  33385. case 'p':
  33386. p.alt = 1;
  33387. 8011406: f89d 3028 ldrb.w r3, [sp, #40] ; 0x28
  33388. 801140a: f043 0302 orr.w r3, r3, #2
  33389. 801140e: f88d 3028 strb.w r3, [sp, #40] ; 0x28
  33390. # if defined(SIZEOF_INT) && SIZEOF_POINTER <= SIZEOF_INT
  33391. lng = 0;
  33392. 8011412: 2300 movs r3, #0
  33393. lng = 2;
  33394. # endif
  33395. #endif
  33396. case 'x':
  33397. case 'X':
  33398. p.base = 16;
  33399. 8011414: 2210 movs r2, #16
  33400. p.uc = (ch == 'X')?1:0;
  33401. 8011416: f1b1 0e58 subs.w lr, r1, #88 ; 0x58
  33402. 801141a: f1de 0100 rsbs r1, lr, #0
  33403. 801141e: f89d 0028 ldrb.w r0, [sp, #40] ; 0x28
  33404. lng = 2;
  33405. # endif
  33406. #endif
  33407. case 'x':
  33408. case 'X':
  33409. p.base = 16;
  33410. 8011422: 920d str r2, [sp, #52] ; 0x34
  33411. p.uc = (ch == 'X')?1:0;
  33412. 8011424: eb51 010e adcs.w r1, r1, lr
  33413. 8011428: aa1a add r2, sp, #104 ; 0x68
  33414. 801142a: f361 0082 bfi r0, r1, #2, #1
  33415. #ifdef PRINTF_LONG_SUPPORT
  33416. #ifdef PRINTF_LONG_LONG_SUPPORT
  33417. if (2 == lng)
  33418. 801142e: 2b02 cmp r3, #2
  33419. # endif
  33420. #endif
  33421. case 'x':
  33422. case 'X':
  33423. p.base = 16;
  33424. p.uc = (ch == 'X')?1:0;
  33425. 8011430: f802 0d40 strb.w r0, [r2, #-64]!
  33426. #ifdef PRINTF_LONG_SUPPORT
  33427. #ifdef PRINTF_LONG_LONG_SUPPORT
  33428. if (2 == lng)
  33429. 8011434: d109 bne.n 801144a <tfp_format+0x22a>
  33430. ulli2a(va_arg(va, unsigned long long int), &p);
  33431. 8011436: 3407 adds r4, #7
  33432. 8011438: f024 0307 bic.w r3, r4, #7
  33433. 801143c: e9d3 0100 ldrd r0, r1, [r3]
  33434. 8011440: f103 0408 add.w r4, r3, #8
  33435. 8011444: f7ff fdc8 bl 8010fd8 <ulli2a>
  33436. 8011448: e00b b.n 8011462 <tfp_format+0x242>
  33437. else
  33438. #endif
  33439. if (1 == lng)
  33440. uli2a(va_arg(va, unsigned long int), &p);
  33441. 801144a: 6820 ldr r0, [r4, #0]
  33442. 801144c: 4611 mov r1, r2
  33443. #ifdef PRINTF_LONG_LONG_SUPPORT
  33444. if (2 == lng)
  33445. ulli2a(va_arg(va, unsigned long long int), &p);
  33446. else
  33447. #endif
  33448. if (1 == lng)
  33449. 801144e: 2b01 cmp r3, #1
  33450. 8011450: f104 0804 add.w r8, r4, #4
  33451. 8011454: d102 bne.n 801145c <tfp_format+0x23c>
  33452. uli2a(va_arg(va, unsigned long int), &p);
  33453. 8011456: f7ff fe15 bl 8011084 <uli2a>
  33454. 801145a: e001 b.n 8011460 <tfp_format+0x240>
  33455. else
  33456. #endif
  33457. ui2a(va_arg(va, unsigned int), &p);
  33458. 801145c: f7ff fe3d bl 80110da <ui2a>
  33459. 8011460: 4644 mov r4, r8
  33460. putchw(putp, putf, &p);
  33461. 8011462: 4628 mov r0, r5
  33462. 8011464: 4631 mov r1, r6
  33463. 8011466: aa0a add r2, sp, #40 ; 0x28
  33464. 8011468: f7ff fe62 bl 8011130 <putchw>
  33465. break;
  33466. 801146c: e0eb b.n 8011646 <tfp_format+0x426>
  33467. case 'o':
  33468. p.base = 8;
  33469. 801146e: 2308 movs r3, #8
  33470. ui2a(va_arg(va, unsigned int), &p);
  33471. 8011470: 6820 ldr r0, [r4, #0]
  33472. #endif
  33473. ui2a(va_arg(va, unsigned int), &p);
  33474. putchw(putp, putf, &p);
  33475. break;
  33476. case 'o':
  33477. p.base = 8;
  33478. 8011472: 930d str r3, [sp, #52] ; 0x34
  33479. ui2a(va_arg(va, unsigned int), &p);
  33480. 8011474: a90a add r1, sp, #40 ; 0x28
  33481. 8011476: f7ff fe30 bl 80110da <ui2a>
  33482. putchw(putp, putf, &p);
  33483. 801147a: 4628 mov r0, r5
  33484. 801147c: 4631 mov r1, r6
  33485. 801147e: aa0a add r2, sp, #40 ; 0x28
  33486. ui2a(va_arg(va, unsigned int), &p);
  33487. putchw(putp, putf, &p);
  33488. break;
  33489. case 'o':
  33490. p.base = 8;
  33491. ui2a(va_arg(va, unsigned int), &p);
  33492. 8011480: f104 0804 add.w r8, r4, #4
  33493. putchw(putp, putf, &p);
  33494. 8011484: f7ff fe54 bl 8011130 <putchw>
  33495. 8011488: e010 b.n 80114ac <tfp_format+0x28c>
  33496. break;
  33497. case 'c':
  33498. putf(putp, (char)(va_arg(va, int)));
  33499. 801148a: 4628 mov r0, r5
  33500. 801148c: 7821 ldrb r1, [r4, #0]
  33501. 801148e: f104 0804 add.w r8, r4, #4
  33502. 8011492: 47b0 blx r6
  33503. 8011494: e00a b.n 80114ac <tfp_format+0x28c>
  33504. break;
  33505. case 's':
  33506. p.bf = va_arg(va, char *);
  33507. 8011496: 6823 ldr r3, [r4, #0]
  33508. putchw(putp, putf, &p);
  33509. 8011498: aa0a add r2, sp, #40 ; 0x28
  33510. 801149a: 4628 mov r0, r5
  33511. 801149c: 4631 mov r1, r6
  33512. break;
  33513. case 'c':
  33514. putf(putp, (char)(va_arg(va, int)));
  33515. break;
  33516. case 's':
  33517. p.bf = va_arg(va, char *);
  33518. 801149e: 930e str r3, [sp, #56] ; 0x38
  33519. putchw(putp, putf, &p);
  33520. 80114a0: f7ff fe46 bl 8011130 <putchw>
  33521. p.bf = bf;
  33522. 80114a4: aa04 add r2, sp, #16
  33523. break;
  33524. case 'c':
  33525. putf(putp, (char)(va_arg(va, int)));
  33526. break;
  33527. case 's':
  33528. p.bf = va_arg(va, char *);
  33529. 80114a6: f104 0804 add.w r8, r4, #4
  33530. putchw(putp, putf, &p);
  33531. p.bf = bf;
  33532. 80114aa: 920e str r2, [sp, #56] ; 0x38
  33533. break;
  33534. case 'c':
  33535. putf(putp, (char)(va_arg(va, int)));
  33536. break;
  33537. case 's':
  33538. p.bf = va_arg(va, char *);
  33539. 80114ac: 4644 mov r4, r8
  33540. putchw(putp, putf, &p);
  33541. p.bf = bf;
  33542. break;
  33543. 80114ae: e0ca b.n 8011646 <tfp_format+0x426>
  33544. case '%':
  33545. putf(putp, ch);
  33546. 80114b0: 4628 mov r0, r5
  33547. 80114b2: 47b0 blx r6
  33548. break;
  33549. 80114b4: e0c7 b.n 8011646 <tfp_format+0x426>
  33550. case 'f':
  33551. case 'F':
  33552. fval = va_arg(va, double);
  33553. 80114b6: 3407 adds r4, #7
  33554. 80114b8: f024 0307 bic.w r3, r4, #7
  33555. 80114bc: f103 0408 add.w r4, r3, #8
  33556. 80114c0: e893 0404 ldmia.w r3, {r2, sl}
  33557. 80114c4: 9200 str r2, [sp, #0]
  33558. sign = 0;
  33559. if (fval < 0)
  33560. 80114c6: 4610 mov r0, r2
  33561. 80114c8: 4651 mov r1, sl
  33562. 80114ca: 2200 movs r2, #0
  33563. 80114cc: 2300 movs r3, #0
  33564. 80114ce: f7f7 fa25 bl 800891c <__aeabi_dcmplt>
  33565. 80114d2: b138 cbz r0, 80114e4 <tfp_format+0x2c4>
  33566. {
  33567. sign = 1;
  33568. p.width--;
  33569. 80114d4: 9b0b ldr r3, [sp, #44] ; 0x2c
  33570. 80114d6: 3b01 subs r3, #1
  33571. 80114d8: 930b str r3, [sp, #44] ; 0x2c
  33572. fval = - fval;
  33573. 80114da: f10a 4a00 add.w sl, sl, #2147483648 ; 0x80000000
  33574. case 'F':
  33575. fval = va_arg(va, double);
  33576. sign = 0;
  33577. if (fval < 0)
  33578. {
  33579. sign = 1;
  33580. 80114de: f04f 0b01 mov.w fp, #1
  33581. 80114e2: e009 b.n 80114f8 <tfp_format+0x2d8>
  33582. p.width--;
  33583. fval = - fval;
  33584. }
  33585. else if (p.sign) {
  33586. 80114e4: f89d 3030 ldrb.w r3, [sp, #48] ; 0x30
  33587. 80114e8: b12b cbz r3, 80114f6 <tfp_format+0x2d6>
  33588. sign = 2;
  33589. p.width--;
  33590. 80114ea: 9b0b ldr r3, [sp, #44] ; 0x2c
  33591. 80114ec: 3b01 subs r3, #1
  33592. 80114ee: 930b str r3, [sp, #44] ; 0x2c
  33593. sign = 1;
  33594. p.width--;
  33595. fval = - fval;
  33596. }
  33597. else if (p.sign) {
  33598. sign = 2;
  33599. 80114f0: f04f 0b02 mov.w fp, #2
  33600. 80114f4: e000 b.n 80114f8 <tfp_format+0x2d8>
  33601. putf(putp, ch);
  33602. break;
  33603. case 'f':
  33604. case 'F':
  33605. fval = va_arg(va, double);
  33606. sign = 0;
  33607. 80114f6: 469b mov fp, r3
  33608. else if (p.sign) {
  33609. sign = 2;
  33610. p.width--;
  33611. }
  33612. fpart = (int)fval;
  33613. 80114f8: 4651 mov r1, sl
  33614. 80114fa: 9800 ldr r0, [sp, #0]
  33615. 80114fc: f7f7 fa36 bl 800896c <__aeabi_d2iz>
  33616. fiter = 0;
  33617. 8011500: 2200 movs r2, #0
  33618. else if (p.sign) {
  33619. sign = 2;
  33620. p.width--;
  33621. }
  33622. fpart = (int)fval;
  33623. 8011502: 9001 str r0, [sp, #4]
  33624. 8011504: 4680 mov r8, r0
  33625. fiter = 0;
  33626. while (fpart != 0)
  33627. {
  33628. temp_buffer[fiter++] = fpart % 10;
  33629. 8011506: 210a movs r1, #10
  33630. }
  33631. fpart = (int)fval;
  33632. fiter = 0;
  33633. while (fpart != 0)
  33634. 8011508: e008 b.n 801151c <tfp_format+0x2fc>
  33635. {
  33636. temp_buffer[fiter++] = fpart % 10;
  33637. 801150a: fb98 f0f1 sdiv r0, r8, r1
  33638. 801150e: ab10 add r3, sp, #64 ; 0x40
  33639. 8011510: fb01 8810 mls r8, r1, r0, r8
  33640. 8011514: f843 8022 str.w r8, [r3, r2, lsl #2]
  33641. 8011518: 3201 adds r2, #1
  33642. fpart = fpart / 10;
  33643. 801151a: 4680 mov r8, r0
  33644. }
  33645. fpart = (int)fval;
  33646. fiter = 0;
  33647. while (fpart != 0)
  33648. 801151c: f1b8 0f00 cmp.w r8, #0
  33649. 8011520: d1f3 bne.n 801150a <tfp_format+0x2ea>
  33650. temp_buffer[fiter++] = fpart % 10;
  33651. fpart = fpart / 10;
  33652. }
  33653. fiter--;
  33654. if (fiter == -1)
  33655. 8011522: f102 39ff add.w r9, r2, #4294967295
  33656. 8011526: b912 cbnz r2, 801152e <tfp_format+0x30e>
  33657. p.width--;
  33658. 8011528: 9a0b ldr r2, [sp, #44] ; 0x2c
  33659. 801152a: 3a01 subs r2, #1
  33660. 801152c: 920b str r2, [sp, #44] ; 0x2c
  33661. /* Leading zeros */
  33662. if (p.lz) {
  33663. 801152e: f89d 2028 ldrb.w r2, [sp, #40] ; 0x28
  33664. 8011532: 07d0 lsls r0, r2, #31
  33665. 8011534: d51b bpl.n 801156e <tfp_format+0x34e>
  33666. if (sign == 1)
  33667. 8011536: f1bb 0f01 cmp.w fp, #1
  33668. 801153a: d102 bne.n 8011542 <tfp_format+0x322>
  33669. putf(putp, '-');
  33670. 801153c: 4628 mov r0, r5
  33671. 801153e: 212d movs r1, #45 ; 0x2d
  33672. 8011540: e007 b.n 8011552 <tfp_format+0x332>
  33673. else if (sign == 2)
  33674. 8011542: f1bb 0f02 cmp.w fp, #2
  33675. 8011546: d105 bne.n 8011554 <tfp_format+0x334>
  33676. putf(putp, '+');
  33677. 8011548: 4628 mov r0, r5
  33678. 801154a: 212b movs r1, #43 ; 0x2b
  33679. 801154c: e001 b.n 8011552 <tfp_format+0x332>
  33680. while (p.width-- > p.prec + fiter + 2)
  33681. {
  33682. putf(putp, '0');
  33683. 801154e: 4628 mov r0, r5
  33684. 8011550: 2130 movs r1, #48 ; 0x30
  33685. 8011552: 47b0 blx r6
  33686. if (sign == 1)
  33687. putf(putp, '-');
  33688. else if (sign == 2)
  33689. putf(putp, '+');
  33690. while (p.width-- > p.prec + fiter + 2)
  33691. 8011554: f89d 203c ldrb.w r2, [sp, #60] ; 0x3c
  33692. 8011558: 9b0b ldr r3, [sp, #44] ; 0x2c
  33693. 801155a: 444a add r2, r9
  33694. 801155c: 3202 adds r2, #2
  33695. 801155e: 1e59 subs r1, r3, #1
  33696. 8011560: 4293 cmp r3, r2
  33697. 8011562: 910b str r1, [sp, #44] ; 0x2c
  33698. 8011564: dcf3 bgt.n 801154e <tfp_format+0x32e>
  33699. 8011566: e017 b.n 8011598 <tfp_format+0x378>
  33700. else
  33701. {
  33702. while (p.width-- > p.prec + fiter + 2)
  33703. {
  33704. putf(putp, ' ');
  33705. 8011568: 4628 mov r0, r5
  33706. 801156a: 2120 movs r1, #32
  33707. 801156c: 47b0 blx r6
  33708. }
  33709. }
  33710. else
  33711. {
  33712. while (p.width-- > p.prec + fiter + 2)
  33713. 801156e: f89d 103c ldrb.w r1, [sp, #60] ; 0x3c
  33714. 8011572: 9a0b ldr r2, [sp, #44] ; 0x2c
  33715. 8011574: 4449 add r1, r9
  33716. 8011576: 3102 adds r1, #2
  33717. 8011578: 1e50 subs r0, r2, #1
  33718. 801157a: 428a cmp r2, r1
  33719. 801157c: 900b str r0, [sp, #44] ; 0x2c
  33720. 801157e: dcf3 bgt.n 8011568 <tfp_format+0x348>
  33721. {
  33722. putf(putp, ' ');
  33723. }
  33724. if (sign == 1)
  33725. 8011580: f1bb 0f01 cmp.w fp, #1
  33726. 8011584: d102 bne.n 801158c <tfp_format+0x36c>
  33727. putf(putp, '-');
  33728. 8011586: 4628 mov r0, r5
  33729. 8011588: 212d movs r1, #45 ; 0x2d
  33730. 801158a: e004 b.n 8011596 <tfp_format+0x376>
  33731. else if (sign == 2)
  33732. 801158c: f1bb 0f02 cmp.w fp, #2
  33733. 8011590: d102 bne.n 8011598 <tfp_format+0x378>
  33734. putf(putp, '+');
  33735. 8011592: 4628 mov r0, r5
  33736. 8011594: 212b movs r1, #43 ; 0x2b
  33737. 8011596: 47b0 blx r6
  33738. }
  33739. if (fiter == -1)
  33740. 8011598: f1b9 3fff cmp.w r9, #4294967295
  33741. 801159c: d102 bne.n 80115a4 <tfp_format+0x384>
  33742. putf(putp, '0');
  33743. 801159e: 4628 mov r0, r5
  33744. 80115a0: 2130 movs r1, #48 ; 0x30
  33745. 80115a2: e007 b.n 80115b4 <tfp_format+0x394>
  33746. while (fiter > -1)
  33747. {
  33748. putf(putp, '0' + (temp_buffer[fiter--]));
  33749. 80115a4: ab10 add r3, sp, #64 ; 0x40
  33750. 80115a6: 4628 mov r0, r5
  33751. 80115a8: f853 1029 ldr.w r1, [r3, r9, lsl #2]
  33752. 80115ac: 3130 adds r1, #48 ; 0x30
  33753. 80115ae: f109 39ff add.w r9, r9, #4294967295
  33754. 80115b2: b2c9 uxtb r1, r1
  33755. 80115b4: 47b0 blx r6
  33756. }
  33757. if (fiter == -1)
  33758. putf(putp, '0');
  33759. while (fiter > -1)
  33760. 80115b6: f1b9 3fff cmp.w r9, #4294967295
  33761. 80115ba: d1f3 bne.n 80115a4 <tfp_format+0x384>
  33762. {
  33763. putf(putp, '0' + (temp_buffer[fiter--]));
  33764. }
  33765. putf(putp, '.');
  33766. 80115bc: 4628 mov r0, r5
  33767. 80115be: 212e movs r1, #46 ; 0x2e
  33768. 80115c0: 47b0 blx r6
  33769. ffactor = 1;
  33770. 80115c2: f04f 0901 mov.w r9, #1
  33771. while (p.prec-- > 0)
  33772. 80115c6: e01d b.n 8011604 <tfp_format+0x3e4>
  33773. {
  33774. ffactor *= 10;
  33775. 80115c8: 230a movs r3, #10
  33776. fpart = (int)((fval - (int)fval)*ffactor);
  33777. 80115ca: 9801 ldr r0, [sp, #4]
  33778. putf(putp, '.');
  33779. ffactor = 1;
  33780. while (p.prec-- > 0)
  33781. {
  33782. ffactor *= 10;
  33783. 80115cc: fb03 f909 mul.w r9, r3, r9
  33784. fpart = (int)((fval - (int)fval)*ffactor);
  33785. 80115d0: f7f6 fecc bl 800836c <__aeabi_i2d>
  33786. 80115d4: 4602 mov r2, r0
  33787. 80115d6: 460b mov r3, r1
  33788. 80115d8: 9800 ldr r0, [sp, #0]
  33789. 80115da: 4651 mov r1, sl
  33790. 80115dc: f7f6 fd78 bl 80080d0 <__aeabi_dsub>
  33791. 80115e0: e9cd 0102 strd r0, r1, [sp, #8]
  33792. 80115e4: 4648 mov r0, r9
  33793. 80115e6: f7f6 fec1 bl 800836c <__aeabi_i2d>
  33794. 80115ea: 4602 mov r2, r0
  33795. 80115ec: 460b mov r3, r1
  33796. 80115ee: e9dd 0102 ldrd r0, r1, [sp, #8]
  33797. 80115f2: f7f6 ff21 bl 8008438 <__aeabi_dmul>
  33798. 80115f6: f7f7 f9b9 bl 800896c <__aeabi_d2iz>
  33799. if (fpart == 0)
  33800. 80115fa: 4680 mov r8, r0
  33801. 80115fc: b910 cbnz r0, 8011604 <tfp_format+0x3e4>
  33802. putf(putp, '0');
  33803. 80115fe: 4628 mov r0, r5
  33804. 8011600: 2130 movs r1, #48 ; 0x30
  33805. 8011602: 47b0 blx r6
  33806. putf(putp, '0' + (temp_buffer[fiter--]));
  33807. }
  33808. putf(putp, '.');
  33809. ffactor = 1;
  33810. while (p.prec-- > 0)
  33811. 8011604: f89d 303c ldrb.w r3, [sp, #60] ; 0x3c
  33812. 8011608: 1e5a subs r2, r3, #1
  33813. 801160a: f88d 203c strb.w r2, [sp, #60] ; 0x3c
  33814. 801160e: 2b00 cmp r3, #0
  33815. 8011610: d1da bne.n 80115c8 <tfp_format+0x3a8>
  33816. putf(putp, '0');
  33817. }
  33818. fiter = 0;
  33819. while (fpart != 0)
  33820. {
  33821. temp_buffer[fiter++] = fpart % 10;
  33822. 8011612: 220a movs r2, #10
  33823. 8011614: e008 b.n 8011628 <tfp_format+0x408>
  33824. 8011616: fb98 f1f2 sdiv r1, r8, r2
  33825. 801161a: a810 add r0, sp, #64 ; 0x40
  33826. 801161c: fb02 8811 mls r8, r2, r1, r8
  33827. 8011620: f840 8023 str.w r8, [r0, r3, lsl #2]
  33828. 8011624: 3301 adds r3, #1
  33829. fpart = fpart / 10;
  33830. 8011626: 4688 mov r8, r1
  33831. fpart = (int)((fval - (int)fval)*ffactor);
  33832. if (fpart == 0)
  33833. putf(putp, '0');
  33834. }
  33835. fiter = 0;
  33836. while (fpart != 0)
  33837. 8011628: f1b8 0f00 cmp.w r8, #0
  33838. 801162c: d1f3 bne.n 8011616 <tfp_format+0x3f6>
  33839. 801162e: 4698 mov r8, r3
  33840. temp_buffer[fiter++] = fpart % 10;
  33841. fpart = fpart / 10;
  33842. }
  33843. fiter--;
  33844. while (fiter > -1)
  33845. 8011630: e006 b.n 8011640 <tfp_format+0x420>
  33846. {
  33847. putf(putp, '0' + (temp_buffer[fiter--]));
  33848. 8011632: ab10 add r3, sp, #64 ; 0x40
  33849. 8011634: 4628 mov r0, r5
  33850. 8011636: f853 1028 ldr.w r1, [r3, r8, lsl #2]
  33851. 801163a: 3130 adds r1, #48 ; 0x30
  33852. 801163c: b2c9 uxtb r1, r1
  33853. 801163e: 47b0 blx r6
  33854. temp_buffer[fiter++] = fpart % 10;
  33855. fpart = fpart / 10;
  33856. }
  33857. fiter--;
  33858. while (fiter > -1)
  33859. 8011640: f118 38ff adds.w r8, r8, #4294967295
  33860. 8011644: d2f5 bcs.n 8011632 <tfp_format+0x412>
  33861. char bf[12]; /* int = 32b on some architectures */
  33862. #endif
  33863. char ch;
  33864. p.bf = bf;
  33865. while ((ch = *(fmt++))) {
  33866. 8011646: f817 1b01 ldrb.w r1, [r7], #1
  33867. 801164a: 2900 cmp r1, #0
  33868. 801164c: f47f adf2 bne.w 8011234 <tfp_format+0x14>
  33869. 8011650: e003 b.n 801165a <tfp_format+0x43a>
  33870. {
  33871. const char *p = *src;
  33872. unsigned int num = 0;
  33873. int digit;
  33874. while ((digit = a2d(ch)) >= 0) {
  33875. if (digit > base)
  33876. 8011652: 2b0a cmp r3, #10
  33877. 8011654: f77f ae32 ble.w 80112bc <tfp_format+0x9c>
  33878. 8011658: e64c b.n 80112f4 <tfp_format+0xd4>
  33879. break;
  33880. }
  33881. }
  33882. }
  33883. abort:;
  33884. }
  33885. 801165a: b01b add sp, #108 ; 0x6c
  33886. 801165c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  33887. 08011660 <init_printf>:
  33888. static putcf stdout_putf;
  33889. static void *stdout_putp;
  33890. void init_printf(void *putp, putcf putf)
  33891. {
  33892. stdout_putf = putf;
  33893. 8011660: 4b02 ldr r3, [pc, #8] ; (801166c <init_printf+0xc>)
  33894. 8011662: 6019 str r1, [r3, #0]
  33895. stdout_putp = putp;
  33896. 8011664: 4b02 ldr r3, [pc, #8] ; (8011670 <init_printf+0x10>)
  33897. 8011666: 6018 str r0, [r3, #0]
  33898. 8011668: 4770 bx lr
  33899. 801166a: bf00 nop
  33900. 801166c: 20006dc8 .word 0x20006dc8
  33901. 8011670: 20006dcc .word 0x20006dcc
  33902. 08011674 <tfp_printf>:
  33903. }
  33904. void tfp_printf(char *fmt, ...)
  33905. {
  33906. 8011674: b40f push {r0, r1, r2, r3}
  33907. 8011676: b507 push {r0, r1, r2, lr}
  33908. va_list va;
  33909. va_start(va, fmt);
  33910. tfp_format(stdout_putp, stdout_putf, fmt, va);
  33911. 8011678: 4906 ldr r1, [pc, #24] ; (8011694 <tfp_printf+0x20>)
  33912. stdout_putf = putf;
  33913. stdout_putp = putp;
  33914. }
  33915. void tfp_printf(char *fmt, ...)
  33916. {
  33917. 801167a: ab04 add r3, sp, #16
  33918. va_list va;
  33919. va_start(va, fmt);
  33920. tfp_format(stdout_putp, stdout_putf, fmt, va);
  33921. 801167c: 6808 ldr r0, [r1, #0]
  33922. 801167e: 4906 ldr r1, [pc, #24] ; (8011698 <tfp_printf+0x24>)
  33923. stdout_putf = putf;
  33924. stdout_putp = putp;
  33925. }
  33926. void tfp_printf(char *fmt, ...)
  33927. {
  33928. 8011680: f853 2b04 ldr.w r2, [r3], #4
  33929. va_list va;
  33930. va_start(va, fmt);
  33931. tfp_format(stdout_putp, stdout_putf, fmt, va);
  33932. 8011684: 6809 ldr r1, [r1, #0]
  33933. }
  33934. void tfp_printf(char *fmt, ...)
  33935. {
  33936. va_list va;
  33937. va_start(va, fmt);
  33938. 8011686: 9301 str r3, [sp, #4]
  33939. tfp_format(stdout_putp, stdout_putf, fmt, va);
  33940. 8011688: f7ff fdca bl 8011220 <tfp_format>
  33941. va_end(va);
  33942. }
  33943. 801168c: e8bd 400e ldmia.w sp!, {r1, r2, r3, lr}
  33944. 8011690: b004 add sp, #16
  33945. 8011692: 4770 bx lr
  33946. 8011694: 20006dcc .word 0x20006dcc
  33947. 8011698: 20006dc8 .word 0x20006dc8
  33948. 0801169c <tfp_vsprintf>:
  33949. struct _vsprintf_putcf_data *data = (struct _vsprintf_putcf_data*)p;
  33950. data->dest[data->num_chars++] = c;
  33951. }
  33952. int tfp_vsprintf(char *str, const char *format, va_list ap)
  33953. {
  33954. 801169c: b537 push {r0, r1, r2, r4, r5, lr}
  33955. 801169e: 460d mov r5, r1
  33956. 80116a0: 4613 mov r3, r2
  33957. struct _vsprintf_putcf_data data;
  33958. data.dest = str;
  33959. 80116a2: 9000 str r0, [sp, #0]
  33960. data.num_chars = 0;
  33961. 80116a4: 2400 movs r4, #0
  33962. tfp_format(&data, _vsprintf_putcf, format, ap);
  33963. 80116a6: 4668 mov r0, sp
  33964. 80116a8: 462a mov r2, r5
  33965. 80116aa: 4904 ldr r1, [pc, #16] ; (80116bc <tfp_vsprintf+0x20>)
  33966. int tfp_vsprintf(char *str, const char *format, va_list ap)
  33967. {
  33968. struct _vsprintf_putcf_data data;
  33969. data.dest = str;
  33970. data.num_chars = 0;
  33971. 80116ac: 9401 str r4, [sp, #4]
  33972. tfp_format(&data, _vsprintf_putcf, format, ap);
  33973. 80116ae: f7ff fdb7 bl 8011220 <tfp_format>
  33974. data.dest[data.num_chars] = '\0';
  33975. 80116b2: e89d 000c ldmia.w sp, {r2, r3}
  33976. 80116b6: 54d4 strb r4, [r2, r3]
  33977. return data.num_chars;
  33978. }
  33979. 80116b8: 9801 ldr r0, [sp, #4]
  33980. 80116ba: bd3e pop {r1, r2, r3, r4, r5, pc}
  33981. 80116bc: 08011215 .word 0x08011215
  33982. 080116c0 <tfp_sprintf>:
  33983. int tfp_sprintf(char *str, const char *format, ...)
  33984. {
  33985. 80116c0: b40e push {r1, r2, r3}
  33986. 80116c2: b503 push {r0, r1, lr}
  33987. 80116c4: aa03 add r2, sp, #12
  33988. 80116c6: f852 1b04 ldr.w r1, [r2], #4
  33989. va_list ap;
  33990. int retval;
  33991. va_start(ap, format);
  33992. 80116ca: 9201 str r2, [sp, #4]
  33993. retval = tfp_vsprintf(str, format, ap);
  33994. 80116cc: f7ff ffe6 bl 801169c <tfp_vsprintf>
  33995. va_end(ap);
  33996. return retval;
  33997. }
  33998. 80116d0: e8bd 400c ldmia.w sp!, {r2, r3, lr}
  33999. 80116d4: b003 add sp, #12
  34000. 80116d6: 4770 bx lr
  34001. 080116d8 <Reset_Handler>:
  34002. .weak Reset_Handler
  34003. .type Reset_Handler, %function
  34004. Reset_Handler:
  34005. /* Copy the data segment initializers from flash to SRAM */
  34006. movs r1, #0
  34007. 80116d8: 2100 movs r1, #0
  34008. b LoopCopyDataInit
  34009. 80116da: f000 b804 b.w 80116e6 <LoopCopyDataInit>
  34010. 080116de <CopyDataInit>:
  34011. CopyDataInit:
  34012. ldr r3, =_sidata
  34013. 80116de: 4b0d ldr r3, [pc, #52] ; (8011714 <LoopFillZerobss+0x16>)
  34014. ldr r3, [r3, r1]
  34015. 80116e0: 585b ldr r3, [r3, r1]
  34016. str r3, [r0, r1]
  34017. 80116e2: 5043 str r3, [r0, r1]
  34018. adds r1, r1, #4
  34019. 80116e4: 3104 adds r1, #4
  34020. 080116e6 <LoopCopyDataInit>:
  34021. LoopCopyDataInit:
  34022. ldr r0, =_sdata
  34023. 80116e6: 480c ldr r0, [pc, #48] ; (8011718 <LoopFillZerobss+0x1a>)
  34024. ldr r3, =_edata
  34025. 80116e8: 4b0c ldr r3, [pc, #48] ; (801171c <LoopFillZerobss+0x1e>)
  34026. adds r2, r0, r1
  34027. 80116ea: 1842 adds r2, r0, r1
  34028. cmp r2, r3
  34029. 80116ec: 429a cmp r2, r3
  34030. bcc CopyDataInit
  34031. 80116ee: f4ff aff6 bcc.w 80116de <CopyDataInit>
  34032. ldr r2, =_sbss
  34033. 80116f2: 4a0b ldr r2, [pc, #44] ; (8011720 <LoopFillZerobss+0x22>)
  34034. b LoopFillZerobss
  34035. 80116f4: f000 b803 b.w 80116fe <LoopFillZerobss>
  34036. 080116f8 <FillZerobss>:
  34037. /* Zero fill the bss segment. */
  34038. FillZerobss:
  34039. movs r3, #0
  34040. 80116f8: 2300 movs r3, #0
  34041. str r3, [r2], #4
  34042. 80116fa: f842 3b04 str.w r3, [r2], #4
  34043. 080116fe <LoopFillZerobss>:
  34044. LoopFillZerobss:
  34045. ldr r3, = _ebss
  34046. 80116fe: 4b09 ldr r3, [pc, #36] ; (8011724 <LoopFillZerobss+0x26>)
  34047. cmp r2, r3
  34048. 8011700: 429a cmp r2, r3
  34049. bcc FillZerobss
  34050. 8011702: f4ff aff9 bcc.w 80116f8 <FillZerobss>
  34051. /* Call the clock system intitialization function.*/
  34052. bl SystemInit
  34053. 8011706: f7f8 fa21 bl 8009b4c <SystemInit>
  34054. /* Call static constructors */
  34055. bl __libc_init_array
  34056. 801170a: f7f7 fe1d bl 8009348 <__libc_init_array>
  34057. /* Call the application's entry point.*/
  34058. bl main
  34059. 801170e: f7ff fb45 bl 8010d9c <main>
  34060. bx lr
  34061. 8011712: 4770 bx lr
  34062. /* Copy the data segment initializers from flash to SRAM */
  34063. movs r1, #0
  34064. b LoopCopyDataInit
  34065. CopyDataInit:
  34066. ldr r3, =_sidata
  34067. 8011714: 08013698 .word 0x08013698
  34068. ldr r3, [r3, r1]
  34069. str r3, [r0, r1]
  34070. adds r1, r1, #4
  34071. LoopCopyDataInit:
  34072. ldr r0, =_sdata
  34073. 8011718: 20000000 .word 0x20000000
  34074. ldr r3, =_edata
  34075. 801171c: 20000118 .word 0x20000118
  34076. adds r2, r0, r1
  34077. cmp r2, r3
  34078. bcc CopyDataInit
  34079. ldr r2, =_sbss
  34080. 8011720: 20000118 .word 0x20000118
  34081. FillZerobss:
  34082. movs r3, #0
  34083. str r3, [r2], #4
  34084. LoopFillZerobss:
  34085. ldr r3, = _ebss
  34086. 8011724: 2000c99c .word 0x2000c99c
  34087. 08011728 <ADC_IRQHandler>:
  34088. * @retval None
  34089. */
  34090. .section .text.Default_Handler,"ax",%progbits
  34091. Default_Handler:
  34092. Infinite_Loop:
  34093. b Infinite_Loop
  34094. 8011728: f7ff bffe b.w 8011728 <ADC_IRQHandler>
  34095. 0801172c <_ctype_>:
  34096. 801172c: 2000 2020 2020 2020 2020 2828 2828 2028 . (((((
  34097. 801173c: 2020 2020 2020 2020 2020 2020 2020 2020
  34098. 801174c: 8820 1010 1010 1010 1010 1010 1010 1010 ...............
  34099. 801175c: 0410 0404 0404 0404 0404 1004 1010 1010 ................
  34100. 801176c: 1010 4141 4141 4141 0101 0101 0101 0101 ..AAAAAA........
  34101. 801177c: 0101 0101 0101 0101 0101 0101 1010 1010 ................
  34102. 801178c: 1010 4242 4242 4242 0202 0202 0202 0202 ..BBBBBB........
  34103. 801179c: 0202 0202 0202 0202 0202 0202 1010 1010 ................
  34104. 80117ac: 0020 0000 0000 0000 0000 0000 0000 0000 ...............
  34105. 80117bc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34106. 80117cc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34107. 80117dc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34108. 80117ec: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34109. 80117fc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34110. 801180c: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34111. 801181c: 0000 0000 0000 0000 0000 0000 0000 0000 ................
  34112. 801182c: 0000 0000 ....
  34113. 08011830 <memp_num>:
  34114. 8011830: 0004 0006 000a 0005 0019 0005 000f 000a ................
  34115. 8011840: 0032 000f 2...
  34116. 08011844 <memp_sizes>:
  34117. 8011844: 001c 0020 0094 001c 0010 0020 0018 0010 .. ....... .....
  34118. 8011854: 0010 0614 ....
  34119. 08011858 <tcp_pcb_lists>:
  34120. 8011858: 8344 2000 834c 2000 833c 2000 8350 2000 D.. L.. <.. P..
  34121. 08011868 <tcp_backoff>:
  34122. 8011868: 0201 0403 0605 0707 0707 0707 0307 .............
  34123. 08011875 <tcp_persist_backoff>:
  34124. 8011875: 0603 180c 6030 ff78 ....0`x
  34125. 0801187c <ip_addr_broadcast>:
  34126. 801187c: ffff ffff ....
  34127. 08011880 <ip_addr_any>:
  34128. 8011880: 0000 0000 ....
  34129. 08011884 <ethbroadcast>:
  34130. 8011884: ffff ffff ffff ......
  34131. 0801188a <ethzero>:
  34132. 801188a: 0000 0000 0000 3931 2e32 3631 2e38 2e31 ......192.168.1.
  34133. 801189a: 0032 3931 2e32 3631 2e38 2e31 0031 3532 2.192.168.1.1.25
  34134. 80118aa: 2e35 3532 2e35 3532 2e35 0030 7570 6c62 5.255.255.0.publ
  34135. 80118ba: 6369 4200 2d54 3736 3130 3000 302e 302e ic.BT-6701.0.0.0
  34136. 80118ca: 302e 3000 2e39 3031 322e 3130 0035 4345 .0.09.10.2015.EC
  34137. 80118da: 342d 2d43 4434 302d 2d30 3030 302d 0041 -4C-4D-00-00-0A.
  34138. 80118ea: 4e4b 302d 2d33 3030 3030 0033 0d0a 4149 KN-03-00003...IA
  34139. 80118fa: 3a50 4220 6461 6320 6972 6974 6163 206c P: Bad critical
  34140. 801190a: 6573 7474 6e69 7367 7320 6365 6f74 2072 settings sector
  34141. 801191a: 5243 2e43 4620 6361 6f74 7972 6420 6665 CRC. Factory def
  34142. 801192a: 7561 746c 2073 6572 7473 726f 6465 0a2e aults restored..
  34143. 801193a: 000d ..
  34144. 0801193c <data__upload_css>:
  34145. 801193c: 752f 6c70 616f 2e64 7363 0073 5448 5054 /upload.css.HTTP
  34146. 801194c: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
  34147. 801195c: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
  34148. 801196c: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
  34149. 801197c: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
  34150. 801198c: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
  34151. 801199c: 6e65 2d74 7974 6570 203a 6574 7478 632f ent-type: text/c
  34152. 80119ac: 7373 0a0d 6f43 746e 6e65 2d74 6e45 6f63 ss..Content-Enco
  34153. 80119bc: 6964 676e 203a 7a67 7069 0a0d 0a0d 8b1f ding: gzip......
  34154. 80119cc: 0008 0000 0000 0b04 58b5 6f5b 38a4 fe16 .........X[o.8..
  34155. 80119dc: ac2b 96a2 2d3a a9a0 54aa 012a 6b75 4667 +...:-...T*.ukgF
  34156. 80119ec: d23d bb48 3b6f 514f 0c1e f018 6c06 4d84 =.H.o;OQ.....l.M
  34157. 80119fc: d2a5 ff0c 8f7d e06f a2aa 912a ab46 44ee ....}.o...*.F..D
  34158. 8011a0c: f8e4 f9f6 f39c 8b9d 7ebf 87f9 5947 a0d7 .........~..GY..
  34159. 8011a1c: fc9a 61c4 b9c6 dfb7 5184 f6b8 f2fe fdfe ...a.....Q......
  34160. 8011a2c: 7fc7 7fbc 0c91 8e53 afe1 8892 b090 d3af ......S.........
  34161. 8011a3c: ef5c d7cb 7e2f f2ca a1b7 5d41 6849 8d1c \.../~....A]Ih..
  34162. 8011a4c: fc5f 971a e698 80be d5ff a2d0 273c 84b4 _...........<'..
  34163. 8011a5c: b081 3520 b3fe 19ad fdca a290 8a7d 3f3a .. 5........}.:?
  34164. 8011a6c: d5ec 41df 8701 bcfb e14f 1da7 c65a 2089 ...A....O...Z..
  34165. 8011a7c: c68c ae1d 2091 3c7b 64de a7ac 6722 d4af ..... {<.d.."g..
  34166. 8011a8c: 530f 0741 0f81 0022 25b0 018d c099 48dd .SA..."..%.....H
  34167. 8011a9c: d29a 3b9c aca4 71cb 0707 a256 87a9 5182 ...;...q..V....Q
  34168. 8011aac: 1411 21a8 5bf5 11cc 01e5 1dc7 9229 15e0 ...!.[......)...
  34169. 8011abc: 2fa7 0444 276a b70e 500e dffe 8b9e 1578 ./D.j'...P....x.
  34170. 8011acc: 9f45 a092 17e1 5246 bd94 1d94 c9a0 8c83 E.....FR........
  34171. 8011adc: acd5 6f8b 3c7e f8fc f7f5 d255 1a10 9854 ...o~<....U...T.
  34172. 8011aec: 9594 7788 a8eb 8c3d 2b4a ce66 b366 5119 ...w..=.J+f.f..Q
  34173. 8011afc: 4827 6356 711f 6392 c73f 9102 fb9a 2905 'HVc.q.c?......)
  34174. 8011b0c: d433 dbca cfca c3be c17e 5c18 afc8 8230 3.......~..\..0.
  34175. 8011b1c: f85b 3c95 f5ac 441b dfa8 da60 a0fb 9f38 [..<...D..`...8.
  34176. 8011b2c: 4ce3 e0ad 037d 7f6a 721b dbc2 bd1a 69c5 .L..}.j..r.....i
  34177. 8011b3c: b2cd 1197 39f5 7e61 e886 711e edbf d958 .....9a~...q..X.
  34178. 8011b4c: ce61 3dfd ca9c 99a6 d684 e284 2d40 f648 a..=........@-H.
  34179. 8011b5c: 4258 b543 68d1 388a a396 a37a 3298 f9f1 XBC..h.8..z..2..
  34180. 8011b6c: 0329 762d e6ac b7cf 16d3 5194 989c 471b ).-v.......Q...G
  34181. 8011b7c: 53e3 f245 d31c 5f67 06e0 08b0 347c 446f .SE...g_....|4oD
  34182. 8011b8c: 99c3 44e2 d607 5168 f607 511b e08c 7b46 ...D..hQ...Q..F{
  34183. 8011b9c: 4e50 315c 3380 5eb0 0848 4460 a694 93dd PN\1.3.^H.`D....
  34184. 8011bac: a220 cfc6 b2c6 ca41 6084 bc4d 0f6a 0e5e .....A..`M.j.^.
  34185. 8011bbc: 389f 531f b59f 6b42 038a 5a4e b36a 1abf .8.S..Bk..NZj...
  34186. 8011bcc: 447b 98d1 5417 b8cb ab78 4c71 7804 364f {D...T..x.qL.xO6
  34187. 8011bdc: 2b56 0423 8807 b8d7 4119 2f9d 3183 145a V+#......A./.1Z.
  34188. 8011bec: c945 3a8c 29be f00a f061 e53e 4182 688e E..:.)..a.>..A.h
  34189. 8011bfc: bb89 e0d0 7296 b223 5157 b6a2 d223 4742 .....r#.WQ..#.BG
  34190. 8011c0c: 8cd3 9a6c 5ac7 bf4c 7987 5ac7 e0e9 6081 ..l..ZL..y.Z...`
  34191. 8011c1c: 5965 6763 3f43 3cbc ecc3 6ae5 0e17 312c eYcgC?.<...j..,1
  34192. 8011c2c: 0d58 c80c d081 0186 c5d2 87e3 d3e8 4968 X.............hI
  34193. 8011c3c: 78a6 a4a1 edbb 44a7 8379 e635 8745 e490 .x.....Dy.5.E...
  34194. 8011c4c: ac14 838d 0b70 82ba c09d ca22 4114 56b8 ....p....."..A.V
  34195. 8011c5c: 7d92 dca9 ee25 87c0 076f c969 66a2 b1af .}..%...o.i..f..
  34196. 8011c6c: 8df6 3b51 8db8 2b14 78dc 9277 5528 4c37 ..Q;...+.xw.(U7L
  34197. 8011c7c: 5b27 a65a 10ec 3800 3819 eba4 8f81 d580 '[Z....8.8......
  34198. 8011c8c: c00f f64b 7e53 8d2c 8b2d 16c7 2528 0e49 ..K.S~,.-...(%I.
  34199. 8011c9c: 868e 4466 17a8 cc6c 1018 25f1 81cd d824 ..fD..l....%..$.
  34200. 8011cac: a8e7 8f69 4582 28c3 ff03 b0cc 7d3f b325 ..i..E.(....?}%.
  34201. 8011cbc: 00d2 98fd 70f6 ea79 da13 c2f6 4071 035c .....py.....q@\.
  34202. 8011ccc: e73d 6d33 5460 638b 2b42 3f88 d122 663e =.3m`T.cB+.?".>f
  34203. 8011cdc: d2fe 656e d19d ed78 781d 3ead 8661 27bd ..ne..x..x.>a..'
  34204. 8011cec: a49c b635 0327 e14f 1d28 150d 649d d518 ..5.'.O.(....d..
  34205. 8011cfc: 37a6 64d8 f408 c014 f127 e2d6 5a6f acfc .7.d....'...oZ..
  34206. 8011d0c: 6b31 4411 2c07 248e d860 8886 c1e7 031a 1k.D.,.$`.......
  34207. 8011d1c: 2db5 c046 0cd6 7ac7 927d 1df5 d887 32d7 .-F....z}......2
  34208. 8011d2c: 82a2 96af 413e 4218 2e80 f67f 639d e127 ....>A.B.....c'.
  34209. 8011d3c: 1660 b8e5 7d40 462d 5507 e156 05ec 77ec `...@}-F.UV....w
  34210. 8011d4c: a284 1043 66c6 8e10 7579 5f80 0874 6867 ..C..f..yu._t.gh
  34211. 8011d5c: c179 8e9c f39c df69 b8a4 8e7b 7b63 4263 y.....i...{.c{cB
  34212. 8011d6c: ee29 de02 4c42 8a37 36bc 821b f1d5 eb6c )...BL7..6....l.
  34213. 8011d7c: cacf 9ccb 1c95 98d4 8b55 fa77 5e7b a53e ........U.w.{^>.
  34214. 8011d8c: c733 d254 0be9 eb82 d5dc 41b4 df30 0b54 3.T........A0.T.
  34215. 8011d9c: c802 1916 17ae 7b2e 4169 338e 41d6 6672 .......{iA.3.Arf
  34216. 8011dac: c974 544d 51f4 8387 4d6f 4025 81b8 e120 t.MT.Q..oM%@.. .
  34217. 8011dbc: f785 5632 e178 7e0e 9627 de1c 3dba 2624 ..2Vx..~'....=$&
  34218. 8011dcc: cb71 ceb8 4d59 8f72 1a93 c842 a428 d957 q...YMr...B.(.W.
  34219. 8011ddc: 2fe0 a929 09ea 5d33 e1a6 b51a c71c 431c ./)...3].......C
  34220. 8011dec: 8136 33cc e29a 7062 3252 7564 4038 669f 6..3..bpR2du8@.f
  34221. 8011dfc: 87f3 d2ca 6be1 7527 0dd6 24af 5517 78fc .....k'u...$.U.x
  34222. 8011e0c: cf3f 238b 194f 2c30 c87b 539d d33e 7339 ?..#O.0,{..S>.9s
  34223. 8011e1c: 23f2 236f 9863 f39e afbd 9a87 1170 24e8 .#o#c.......p..$
  34224. 8011e2c: b4a3 47a0 a83c 4c6a b421 f982 141e 2627 ...G<.jL!.....'&
  34225. 8011e3c: 98f5 e4d2 8e97 1aa0 d082 a054 c2a8 2664 ..........T...d&
  34226. 8011e4c: 2f75 6641 9990 e44d d9b8 eddd 0fb6 568f u/Af..M........V
  34227. 8011e5c: e181 0efd 0a74 c9f9 a7a9 a28e b399 9cf3 ....t...........
  34228. 8011e6c: 6cd3 5309 4514 e162 ebc9 5dd8 86a5 0e94 .l.S.Eb....]....
  34229. 8011e7c: d740 7310 042b 0a09 22b4 b40d 9f85 4cae @..s+....".....L
  34230. 8011e8c: e7d1 97c8 c2ff f6d5 2dd6 e6f0 6590 bf62 .........-...eb.
  34231. 8011e9c: fc53 78e9 9064 c5ce 4a1e e8c1 a4c0 6644 S..xd....J....Df
  34232. 8011eac: 2898 54e9 1529 2859 04d1 7230 b0a2 7804 .(.T).Y(..0r...x
  34233. 8011ebc: 8c12 2612 441d c1bc 5016 026f 6331 b754 ...&.D...Po.1cT.
  34234. 8011ecc: fa15 c46c a2df 1b5b 9d3d f520 8f7f 408d ..l...[.=. ....@
  34235. 8011edc: 9938 0aba f596 503c 45d1 e087 f973 27e4 8.....<P.E..s..'
  34236. 8011eec: 7c50 42d8 8556 f010 a82c 4cd8 d4a6 b805 P|.BV...,..L....
  34237. 8011efc: b666 6d52 5140 f583 619e a0cd b712 4831 f.Rm@Q...a....1H
  34238. 8011f0c: d3d9 5bc9 6892 4eee 70ab a93b 0376 9546 ...[.h.N.p;.v.F.
  34239. 8011f1c: 79ee afba 9ee1 b8aa 3334 366f 1d9b 774a .y......43o6..Jw
  34240. 8011f2c: 8396 5632 1cf7 7e54 8954 9026 91fc 6b88 ..2V..T~T.&....k
  34241. 8011f3c: 985c 6f68 9990 a97b d202 ec04 8369 8a13 \.ho..{.....i...
  34242. 8011f4c: 9b82 9a25 eb99 0907 facc 65b7 f5ad 4d5a ..%........e..ZM
  34243. 8011f5c: c52a f545 2ccb c592 4abc 13ae 8f7b 5f0a *.E..,...J..{.._
  34244. 8011f6c: 3abb cadc 6462 5525 7c73 ebbe e16b c423 .:..bd%Us|..k.#.
  34245. 8011f7c: 13ab 81cd b5e4 0222 aa43 4280 3201 c4af ......".C..B.2..
  34246. 8011f8c: 5a75 353e 1950 c0d7 a3db a99c 0c5b 67d6 uZ>5P.......[..g
  34247. 8011f9c: 2055 484b 7668 441a db49 86cb 5187 c0e0 U KHhv.DI....Q..
  34248. 8011fac: 11a5 a29b e87a a063 9197 8005 f8ca 36ba ....z.c........6
  34249. 8011fbc: 905a e0f2 784c 3826 bc8b 714e 6a7e a563 Z...Lx&8..Nq~jc.
  34250. 8011fcc: d0cf 75a6 0c55 993b 06df 59fd c9e4 1652 ...uU.;....Y..R.
  34251. 8011fdc: ae68 854a ef00 96a1 1ae3 d1b1 3408 d018 h.J..........4..
  34252. 8011fec: 4079 889d 65f3 deca 6f6f 04a7 04e7 e322 y@...e..oo....".
  34253. 8011ffc: 533f 5260 5b7f 87f6 5bf7 540d e817 62a1 ?S`R.[...[.T...b
  34254. 801200c: 029e 6a6b d8f1 cc91 a69f 7728 1ba6 3389 ..kj......(w...3
  34255. 801201c: 7f5d 2d4e 6e8a 3c41 1151 d89a c5b6 491a ].N-.nA<Q......I
  34256. 801202c: bdf3 7c83 43a5 0aad 32a6 da76 0199 0a2b ...|.C...2v...+.
  34257. 801203c: 9148 0071 a7be 3af1 9c58 dd4f cd15 64dd H.q....:X.O....d
  34258. 801204c: d2a2 9cc3 7584 e7d1 1cb6 8bb6 b191 3cfd .....u.........<
  34259. 801205c: 1fe2 d7d3 9bee 4e4b 182b 95c1 c5c6 8e51 ......KN+.....Q.
  34260. 801206c: 369d 32f5 0db2 fdb2 0ccd 127f 6ba9 a47c .6.2.........k|.
  34261. 801207c: 319f 9688 afc1 3df1 5b46 97eb ea66 b7fa .1.....=F[..f...
  34262. 801208c: c3ed ddc3 f831 2723 20b5 d726 6a5d e6ca ....1.#'. &.]j..
  34263. 801209c: 73c1 d3f4 d2d8 e76d 6bc1 cd0b 1dfd cd2d .s....m..k....-.
  34264. 80120ac: d13c a56d de51 5e2c e942 9e8c 369f 2e0f <.m.Q.,^B....6..
  34265. 80120bc: 74e1 af46 d52e 2f48 d9b0 12aa 2c9e bea0 .tF...H/.....,..
  34266. 80120cc: ff04 779d 6c55 e3b7 fb16 d37b 9234 6677 ...wUl....{.4.wf
  34267. 80120dc: dbd9 37bc 63ed 699b 7d42 1890 6fae bee9 ...7.c.iB}...o..
  34268. 80120ec: 3aff f2bb edc7 0ee6 a768 b7f2 b22d bbf2 .:......h...-...
  34269. 80120fc: b14d da41 2f41 1e3e dcb8 93d2 b5ec 079d M.A.A/>.........
  34270. 801210c: 2701 d916 8737 8977 11f5 d9d8 26e3 675a .'..7.w......&Zg
  34271. 801211c: b027 b651 5c7e 58eb df6a 8e3c 6569 62ee '.Q.~\.Xj.<.ie.b
  34272. 801212c: d685 0ee6 89de e71b 9bb7 1686 39ae 398f .............9.9
  34273. 801213c: 7a9e 9a72 2e7e 5f72 6664 5c57 2e96 9be0 .zr.~.r_dfW\....
  34274. 801214c: 9c97 9c03 16c7 3a10 6783 9d10 ebb1 d25c .......:.g....\.
  34275. 801215c: ba37 2548 6173 cef3 c974 cdf9 ebac afbe 7.H%sa..t.......
  34276. 801216c: d927 5c7b cadf d8f8 933b b12e 1ae8 9001 '.{\....;.......
  34277. 801217c: 07aa f316 13d7 313c 6f4e f614 c0bd 323e ......<1No....>2
  34278. 801218c: 37e8 40e0 5856 3803 7a9b 54f0 7f29 2e7a .7.@VX.8.z.T).z.
  34279. 801219c: c82e 4a01 dd08 c83e 13a2 51ea 3b5d 37aa ...J..>....Q];.7
  34280. 80121ac: 535d ab39 33ef bbde ccad 6dc3 13f2 f46a ]S9..3.....m..j.
  34281. 80121bc: 1f1c 31e0 e578 3dbc 385f bed6 ab52 ef93 ...1x..=_8..R...
  34282. 80121cc: f5e0 6a78 656a 38fb d715 7bab fb48 d0b6 ..xjje.8...{H...
  34283. 80121dc: 6f82 e3d3 14de ca11 f0ef 8e42 c956 03ef .o........B.V...
  34284. 80121ec: 977d 7683 4c9d 6e6f 75aa 67fd 7383 3c82 }..v.Lon.u.g.s.<
  34285. 80121fc: eb46 8f37 1d67 d4c6 3443 3ef7 e837 2810 F.7.g...C4.>7..(
  34286. 801220c: 78d5 eef1 a1fe dc3d b60e 7667 3b35 369e .x....=...gv5;.6
  34287. 801221c: f0c7 6850 e64b 53c8 806f ffe3 6300 b80c ..PhK..So....c..
  34288. 801222c: 3acc 0018 4300 .:...
  34289. 08012231 <Content_Length>:
  34290. 8012231: 6f43 746e 6e65 2d74 654c 676e 6874 203a Content-Length:
  34291. 8012241: 0000 9400 ...
  34292. 08012244 <file__index_html>:
  34293. 8012244: 2994 0801 226c 0801 2278 0801 071a 0000 .)..l"..x"......
  34294. 8012254: 0001 0000 ....
  34295. 08012258 <file__upload_js>:
  34296. 8012258: 3610 0801 314d 0801 3159 0801 03f7 0000 .6..M1..Y1......
  34297. 8012268: 0001 0000 ....
  34298. 0801226c <data__index_html>:
  34299. 801226c: 692f 646e 7865 682e 6d74 006c 5448 5054 /index.html.HTTP
  34300. 801227c: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
  34301. 801228c: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
  34302. 801229c: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
  34303. 80122ac: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
  34304. 80122bc: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
  34305. 80122cc: 6e65 2d74 7974 6570 203a 6574 7478 682f ent-type: text/h
  34306. 80122dc: 6d74 0d6c 0d0a 3c0a 4421 434f 5954 4550 tml....<!DOCTYPE
  34307. 80122ec: 6820 6d74 3e6c 683c 6d74 206c 616c 676e html><html lang
  34308. 80122fc: 223d 3e22 683c 6165 3e64 6d3c 7465 2061 =""><head><meta
  34309. 801230c: 6863 7261 6573 3d74 7522 6674 382d 3e22 charset="utf-8">
  34310. 801231c: 6d3c 7465 2061 7468 7074 652d 7571 7669 <meta http-equiv
  34311. 801232c: 223d 2d58 4155 432d 6d6f 6170 6974 6c62 ="X-UA-Compatibl
  34312. 801233c: 2265 6320 6e6f 6574 746e 223d 4549 653d e" content="IE=e
  34313. 801234c: 6764 2265 3c3e 656d 6174 6e20 6d61 3d65 dge"><meta name=
  34314. 801235c: 7622 6569 7077 726f 2274 6320 6e6f 6574 "viewport" conte
  34315. 801236c: 746e 223d 6977 7464 3d68 6564 6976 6563 nt="width=device
  34316. 801237c: 772d 6469 6874 692c 696e 6974 6c61 732d -width,initial-s
  34317. 801238c: 6163 656c 313d 6d2c 7861 6d69 6d75 732d cale=1,maximum-s
  34318. 801239c: 6163 656c 313d 752c 6573 2d72 6373 6c61 cale=1,user-scal
  34319. 80123ac: 6261 656c 303d 3e22 6c3c 6e69 206b 6572 able=0"><link re
  34320. 80123bc: 3d6c 7322 7974 656c 6873 6565 2274 6820 l="stylesheet" h
  34321. 80123cc: 6572 3d66 7522 6c70 616f 2e64 7363 2273 ref="upload.css"
  34322. 80123dc: 3c3e 6974 6c74 3e65 9ed0 b1d0 bdd0 bed0 ><title>........
  34323. 80123ec: b2d0 bbd0 b5d0 bdd0 b8d0 b5d0 d020 d1bf ............ ...
  34324. 80123fc: d080 d1be d088 d0b8 d0b2 d0ba 3cb8 742f .............</t
  34325. 801240c: 7469 656c 3c3e 682f 6165 3e64 623c 646f itle></head><bod
  34326. 801241c: 3e79 6e3c 7661 6320 616c 7373 223d 616e y><nav class="na
  34327. 801242c: 6276 7261 3e22 2f3c 616e 3e76 643c 7669 vbar"></nav><div
  34328. 801243c: 6920 3d64 6322 756f 746e 772d 6172 2270 id="count-wrap"
  34329. 801244c: 3c3e 6964 2076 6469 223d 6f63 6e75 6474 ><div id="countd
  34330. 801245c: 776f 226e 3c3e 3e70 9ad0 bed0 bdd0 82d1 own"><p>........
  34331. 801246c: 80d1 bed0 bbd0 bbd0 b5d0 80d1 d020 d1b1 ............ ...
  34332. 801247c: d083 d0b4 d1b5 2082 bfd0 b5d0 80d1 b5d0 ....... ........
  34333. 801248c: b7d0 b0d0 b3d0 80d1 83d1 b6d0 b5d0 bdd0 ................
  34334. 801249c: d120 d087 d1b5 d080 d0b5 20b7 733c 6170 .......... <spa
  34335. 80124ac: 206e 6469 223d 6f63 6e75 2d74 756e 626d n id="count-numb
  34336. 80124bc: 7265 3e22 3c35 732f 6170 3e6e d120 d081 er">5</span> ...
  34337. 80124cc: d0b5 d1ba d083 d0bd 2eb4 2f3c 3e70 2f3c ..........</p></
  34338. 80124dc: 6964 3e76 2f3c 6964 3e76 643c 7669 6320 div></div><div c
  34339. 80124ec: 616c 7373 223d 7277 7061 6570 2272 3c3e lass="wrapper"><
  34340. 80124fc: 3168 d03e d09e d0b1 d0bd d0be d0b2 d0bb h1>.............
  34341. 801250c: d0b5 d0bd d0b8 20b5 bfd0 80d1 bed0 88d1 ....... ........
  34342. 801251c: b8d0 b2d0 bad0 b8d0 2f3c 3168 3c3e 6f66 ........</h1><fo
  34343. 801252c: 6d72 6120 7463 6f69 3d6e 2f22 7075 6f6c rm action="/uplo
  34344. 801253c: 6461 632e 6967 2022 656d 6874 646f 223d ad.cgi" method="
  34345. 801254c: 6f70 7473 2022 6e65 7463 7079 3d65 6d22 post" enctype="m
  34346. 801255c: 6c75 6974 6170 7472 662f 726f 2d6d 6164 ultipart/form-da
  34347. 801256c: 6174 2022 6e6f 7573 6d62 7469 223d 6572 ta" onsubmit="re
  34348. 801257c: 7574 6e72 5620 6c61 6469 7461 2865 6874 turn Validate(th
  34349. 801258c: 7369 2229 3c3e 6964 2076 6c63 7361 3d73 is)"><div class=
  34350. 801259c: 7522 6c70 616f 2d64 6f66 6d72 3e22 643c "upload-form"><d
  34351. 80125ac: 7669 6320 616c 7373 223d 7567 6469 2265 iv class="guide"
  34352. 80125bc: 3c3e 3e70 94d0 bbd0 8fd1 d020 d0be d0b1 ><p>...... .....
  34353. 80125cc: d0bd d0be d0b2 d0bb d0b5 d0bd d1b8 208f ...............
  34354. 80125dc: bfd0 80d1 bed0 88d1 b8d0 b2d0 bad0 b8d0 ................
  34355. 80125ec: d020 d0bd d0b5 d0be d1b1 d085 d0be d0b4 ...............
  34356. 80125fc: d0b8 d0bc 3abe 2f3c 3e70 6f3c 3e6c 6c3c .....:</p><ol><l
  34357. 801260c: 3e69 a1d0 bad0 bed0 bfd0 b8d0 80d1 bed0 i>..............
  34358. 801261c: b2d0 b0d0 82d1 8cd1 d020 d0bd 20b0 bad0 ........ .... ..
  34359. 801262c: bed0 bcd0 bfd0 8cd1 8ed1 82d1 b5d0 80d1 ................
  34360. 801263c: d020 d0b8 d0bb 20b8 b2d0 bdd0 b5d0 88d1 ...... ........
  34361. 801264c: bdd0 b8d0 b9d0 d020 d0bd d1be d081 d1b8 ...... .........
  34362. 801265c: d082 d0b5 d1bb 2c8c d120 d084 d0b0 d0b9 ......., .......
  34363. 801266c: 20bb bfd0 80d1 bed0 88d1 b8d0 b2d0 bad0 . ..............
  34364. 801267c: b8d0 d120 2081 80d1 b0d0 81d1 88d1 b8d0 .. .. ..........
  34365. 801268c: 80d1 b5d0 bdd0 b8d0 b5d0 bcd0 2a20 622e ............ *.b
  34366. 801269c: 6e69 2f3c 696c 3c3e 696c d03e d0a3 d0ba in</li><li>.....
  34367. 80126ac: d0b0 d0b7 d1b0 d182 208c bfd0 83d1 82d1 ......... ......
  34368. 80126bc: 8cd1 d020 20ba 84d1 b0d0 b9d0 bbd0 83d1 .. .. ..........
  34369. 80126cc: d020 d1bf d080 d1be d088 d0b8 d0b2 d0ba ...............
  34370. 80126dc: 3cb8 6c2f 3e69 6c3c 3e69 9dd0 b0d0 b6d0 .</li><li>......
  34371. 80126ec: b0d0 82d1 8cd1 d020 d0ba d0bd d0be d0bf ...... .........
  34372. 80126fc: d1ba 2083 d022 d097 d0b0 d1b3 d180 d083 ... "...........
  34373. 801270c: d0b7 d1b8 d182 228c 2f3c 696c 3c3e 6f2f ......."</li></o
  34374. 801271c: 3e6c 703c d03e d094 d1bb 208f b2d0 bed0 l><p>...... ....
  34375. 801272c: b7d0 b2d0 80d1 b0d0 82d1 b0d0 d020 20b2 ............ ..
  34376. 801273c: bed0 81d1 bdd0 bed0 b2d0 bdd0 bed0 b9d0 ................
  34377. 801274c: d020 d0b8 d1bd d082 d1b5 d180 d084 d0b5 ...............
  34378. 801275c: d1b9 2081 bad0 bed0 bdd0 82d1 80d1 bed0 ... ............
  34379. 801276c: bbd0 bbd0 b5d0 80d1 b0d0 d020 d0bd d0b0 .......... .....
  34380. 801277c: d0b6 d0bc d1b8 d082 20b5 d022 d19e d082 ......... ".....
  34381. 801278c: d0bc d0b5 d0bd d1b8 d182 228c 2f3c 3e70 ..........."</p>
  34382. 801279c: 2f3c 6964 3e76 643c 7669 6320 616c 7373 </div><div class
  34383. 80127ac: 223d 7075 6f6c 6461 772d 6172 7070 7265 ="upload-wrapper
  34384. 80127bc: 3e22 693c 706e 7475 6920 3d64 7522 6c70 "><input id="upl
  34385. 80127cc: 616f 4664 6c69 2265 7020 616c 6563 6f68 oadFile" placeho
  34386. 80127dc: 646c 7265 223d a4d0 b0d0 b9d0 bbd0 2022 lder="........"
  34387. 80127ec: 6964 6173 6c62 6465 223d 6964 6173 6c62 disabled="disabl
  34388. 80127fc: 6465 2022 6c63 7361 3d73 6622 6c69 2d65 ed" class="file-
  34389. 801280c: 616e 656d 3e22 643c 7669 6320 616c 7373 name"><div class
  34390. 801281c: 223d 6966 656c 7055 6f6c 6461 6220 6e74 ="fileUpload btn
  34391. 801282c: 6220 6e74 702d 6972 616d 7972 3e22 733c btn-primary"><s
  34392. 801283c: 6170 3e6e 92d0 8bd1 b1d0 bed0 80d1 2f3c pan>..........</
  34393. 801284c: 7073 6e61 203e 693c 706e 7475 6920 3d64 span> <input id=
  34394. 801285c: 7522 6c70 616f 4264 6e74 2022 7974 6570 "uploadBtn" type
  34395. 801286c: 223d 6966 656c 2022 6c63 7361 3d73 7522 ="file" class="u
  34396. 801287c: 6c70 616f 2264 6e20 6d61 3d65 6422 7461 pload" name="dat
  34397. 801288c: 6661 6c69 2265 3c3e 642f 7669 3c3e 642f afile"></div></d
  34398. 801289c: 7669 3c3e 642f 7669 3c3e 6e69 7570 2074 iv></div><input
  34399. 80128ac: 6c63 7361 3d73 6222 6e74 6220 6e74 702d class="btn btn-p
  34400. 80128bc: 6972 616d 7972 2022 7974 6570 223d 7573 rimary" type="su
  34401. 80128cc: 6d62 7469 2022 6176 756c 3d65 d022 d097 bmit" value="...
  34402. 80128dc: d0b0 d1b3 d180 d083 d0b7 d1b8 d182 228c ..............."
  34403. 80128ec: 203e 693c 706e 7475 6320 616c 7373 223d > <input class="
  34404. 80128fc: 7462 206e 7462 2d6e 6164 676e 7265 2022 btn btn-danger"
  34405. 801290c: 7974 6570 223d 7562 7474 6e6f 2022 6176 type="button" va
  34406. 801291c: 756c 3d65 d022 d19e d082 d0bc d0b5 d0bd lue="...........
  34407. 801292c: d1b8 d182 228c 6920 3d64 6722 626f 6361 ....." id="gobac
  34408. 801293c: 226b 3c3e 662f 726f 3e6d 733c 7263 7069 k"></form><scrip
  34409. 801294c: 2074 7974 6570 223d 6574 7478 6a2f 7661 t type="text/jav
  34410. 801295c: 7361 7263 7069 2274 7320 6372 223d 7075 ascript" src="up
  34411. 801296c: 6f6c 6461 6a2e 2273 3c3e 732f 7263 7069 load.js"></scrip
  34412. 801297c: 3e74 2f3c 6964 3e76 2f3c 6f62 7964 3c3e t></div></body><
  34413. 801298c: 682f 6d74 3e6c 0000 /html>..
  34414. 08012994 <file__error_html>:
  34415. 8012994: 0000 0000 29b6 0801 29c2 0801 03bd 0000 .....)...)......
  34416. 80129a4: 0001 0000 ....
  34417. 080129a8 <octet_stream>:
  34418. 80129a8: 636f 6574 2d74 7473 6572 6d61 000d octet-stream..
  34419. 080129b6 <data__error_html>:
  34420. 80129b6: 652f 7272 726f 682e 6d74 006c 5448 5054 /error.html.HTTP
  34421. 80129c6: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
  34422. 80129d6: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
  34423. 80129e6: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
  34424. 80129f6: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
  34425. 8012a06: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
  34426. 8012a16: 6e65 2d74 7974 6570 203a 6574 7478 682f ent-type: text/h
  34427. 8012a26: 6d74 0d6c 0d0a 3c0a 4421 434f 5954 4550 tml....<!DOCTYPE
  34428. 8012a36: 6820 6d74 3e6c 683c 6d74 206c 616c 676e html><html lang
  34429. 8012a46: 223d 3e22 683c 6165 3e64 6d3c 7465 2061 =""><head><meta
  34430. 8012a56: 6863 7261 6573 3d74 7522 6674 382d 3e22 charset="utf-8">
  34431. 8012a66: 6d3c 7465 2061 7468 7074 652d 7571 7669 <meta http-equiv
  34432. 8012a76: 223d 2d58 4155 432d 6d6f 6170 6974 6c62 ="X-UA-Compatibl
  34433. 8012a86: 2265 6320 6e6f 6574 746e 223d 4549 653d e" content="IE=e
  34434. 8012a96: 6764 2265 3c3e 656d 6174 6e20 6d61 3d65 dge"><meta name=
  34435. 8012aa6: 7622 6569 7077 726f 2274 6320 6e6f 6574 "viewport" conte
  34436. 8012ab6: 746e 223d 6977 7464 3d68 6564 6976 6563 nt="width=device
  34437. 8012ac6: 772d 6469 6874 692c 696e 6974 6c61 732d -width,initial-s
  34438. 8012ad6: 6163 656c 313d 6d2c 7861 6d69 6d75 732d cale=1,maximum-s
  34439. 8012ae6: 6163 656c 313d 752c 6573 2d72 6373 6c61 cale=1,user-scal
  34440. 8012af6: 6261 656c 303d 3e22 6c3c 6e69 206b 6572 able=0"><link re
  34441. 8012b06: 3d6c 7322 7974 656c 6873 6565 2274 6820 l="stylesheet" h
  34442. 8012b16: 6572 3d66 7522 6c70 616f 2e64 7363 2273 ref="upload.css"
  34443. 8012b26: 3c3e 6974 6c74 3e65 9ed0 88d1 b8d0 b1d0 ><title>........
  34444. 8012b36: bad0 b0d0 d020 d0be d0b1 d0bd d0be d0b2 .... ...........
  34445. 8012b46: d0bb d0b5 d0bd d1b8 3c8f 742f 7469 656c .........</title
  34446. 8012b56: 3c3e 682f 6165 3e64 623c 646f 3e79 6e3c ></head><body><n
  34447. 8012b66: 7661 6320 616c 7373 223d 616e 6276 7261 av class="navbar
  34448. 8012b76: 3e22 2f3c 616e 3e76 643c 7669 6320 616c "></nav><div cla
  34449. 8012b86: 7373 223d 7277 7061 6570 2272 3c3e 3168 ss="wrapper"><h1
  34450. 8012b96: d03e d09e d0b1 d0bd d0be d0b2 d0bb d0b5 >...............
  34451. 8012ba6: d0bd d0b8 20b5 bfd0 80d1 bed0 88d1 b8d0 ..... ..........
  34452. 8012bb6: b2d0 bad0 b8d0 2f3c 3168 3c3e 6964 2076 ......</h1><div
  34453. 8012bc6: 6c63 7361 3d73 7522 6c70 616f 2d64 6f66 class="upload-fo
  34454. 8012bd6: 6d72 3e22 643c 7669 6320 616c 7373 223d rm"><div class="
  34455. 8012be6: 7567 6469 2265 7320 7974 656c 223d 6574 guide" style="te
  34456. 8012bf6: 7478 612d 696c 6e67 633a 6e65 6574 2272 xt-align:center"
  34457. 8012c06: 3c3e 2070 7473 6c79 3d65 6322 6c6f 726f ><p style="color
  34458. 8012c16: 233a 3964 3335 6634 3e22 623c d03e d19f :#d9534f"><b>...
  34459. 8012c26: d080 20b8 bed0 b1d0 bdd0 bed0 b2d0 bbd0 ... ............
  34460. 8012c36: b5d0 bdd0 b8d0 b8d0 d020 d1bf d080 d0be ........ .......
  34461. 8012c46: d1b3 d080 d0b0 d0bc d0bc d0bd d0be d0b3 ................
  34462. 8012c56: 20be bed0 b1d0 b5d0 81d1 bfd0 b5d0 87d1 . ..............
  34463. 8012c66: b5d0 bdd0 b8d0 8fd1 d020 d0b2 d0be d0b7 ........ .......
  34464. 8012c76: d0bd d0b8 d0ba d0bb 20b0 bed0 88d1 b8d0 ......... ......
  34465. 8012c86: b1d0 bad0 b0d0 3c2e 622f 3c3e 7262 d03e .......</b><br>.
  34466. 8012c96: d09f d0be d0b6 d0b0 d1bb d083 d1b9 d181 ................
  34467. 8012ca6: d082 2cb0 d020 d0bf d0be d1bf d080 d0be ..., ...........
  34468. 8012cb6: d1b1 d083 d1b9 d082 20b5 b5d0 89d1 91d1 ......... ......
  34469. 8012cc6: d120 d080 d0b0 20b7 87d1 b5d0 80d1 b5d0 ...... ........
  34470. 8012cd6: b7d0 3c20 7073 6e61 6920 3d64 6322 756f .. <span id="cou
  34471. 8012ce6: 746e 6e2d 6d75 6562 2272 353e 2f3c 7073 nt-number">5</sp
  34472. 8012cf6: 6e61 203e 81d1 b5d0 bad0 83d1 bdd0 b4d0 an> ............
  34473. 8012d06: 2f3c 3e70 2f3c 6964 3e76 2f3c 6964 3e76 </p></div></div>
  34474. 8012d16: 733c 7263 7069 2074 7974 6570 223d 6574 <script type="te
  34475. 8012d26: 7478 6a2f 7661 7361 7263 7069 2274 7320 xt/javascript" s
  34476. 8012d36: 6372 223d 7075 6f6c 6461 6a2e 2273 3c3e rc="upload.js"><
  34477. 8012d46: 732f 7263 7069 3e74 733c 7263 7069 3e74 /script><script>
  34478. 8012d56: 6f63 6e75 6474 776f 286e 3b29 2f3c 6373 countdown();</sc
  34479. 8012d66: 6972 7470 3c3e 642f 7669 3c3e 622f 646f ript></div></bod
  34480. 8012d76: 3e79 2f3c 7468 6c6d 2f3e y></html>
  34481. 08012d7f <data__success_html>:
  34482. 8012d7f: 732f 6375 6563 7373 682e 6d74 006c 0000 /success.html...
  34483. 8012d8f: 5448 5054 312f 302e 3220 3030 4f20 0d4b HTTP/1.0 200 OK.
  34484. 8012d9f: 530a 7265 6576 3a72 6c20 4977 2f50 2e31 .Server: lwIP/1.
  34485. 8012daf: 2e33 2031 6828 7474 3a70 2f2f 6173 6176 3.1 (http://sava
  34486. 8012dbf: 6e6e 6861 6e2e 6e6f 6e67 2e75 726f 2f67 nnah.nongnu.org/
  34487. 8012dcf: 7270 6a6f 6365 7374 6c2f 6977 2970 0a0d projects/lwip)..
  34488. 8012ddf: 6f43 746e 6e65 2d74 7974 6570 203a 6574 Content-type: te
  34489. 8012def: 7478 682f 6d74 0d6c 0d0a 3c0a 4421 434f xt/html....<!DOC
  34490. 8012dff: 5954 4550 6820 6d74 3e6c 683c 6d74 206c TYPE html><html
  34491. 8012e0f: 616c 676e 223d 3e22 683c 6165 3e64 6d3c lang=""><head><m
  34492. 8012e1f: 7465 2061 6863 7261 6573 3d74 7522 6674 eta charset="utf
  34493. 8012e2f: 382d 3e22 6d3c 7465 2061 7468 7074 652d -8"><meta http-e
  34494. 8012e3f: 7571 7669 223d 2d58 4155 432d 6d6f 6170 quiv="X-UA-Compa
  34495. 8012e4f: 6974 6c62 2265 6320 6e6f 6574 746e 223d tible" content="
  34496. 8012e5f: 4549 653d 6764 2265 3c3e 656d 6174 6e20 IE=edge"><meta n
  34497. 8012e6f: 6d61 3d65 7622 6569 7077 726f 2274 6320 ame="viewport" c
  34498. 8012e7f: 6e6f 6574 746e 223d 6977 7464 3d68 6564 ontent="width=de
  34499. 8012e8f: 6976 6563 772d 6469 6874 692c 696e 6974 vice-width,initi
  34500. 8012e9f: 6c61 732d 6163 656c 313d 6d2c 7861 6d69 al-scale=1,maxim
  34501. 8012eaf: 6d75 732d 6163 656c 313d 752c 6573 2d72 um-scale=1,user-
  34502. 8012ebf: 6373 6c61 6261 656c 303d 3e22 6c3c 6e69 scalable=0"><lin
  34503. 8012ecf: 206b 6572 3d6c 7322 7974 656c 6873 6565 k rel="styleshee
  34504. 8012edf: 2274 6820 6572 3d66 7522 6c70 616f 2e64 t" href="upload.
  34505. 8012eef: 7363 2273 3c3e 6974 6c74 3e65 a3d0 81d1 css"><title>....
  34506. 8012eff: bfd0 b5d0 88d1 bdd0 bed0 b5d0 d020 d0be ............ ...
  34507. 8012f0f: d0b1 d0bd d0be d0b2 d0bb d0b5 d0bd d0b8 ................
  34508. 8012f1f: 3cb5 742f 7469 656c 3c3e 682f 6165 3e64 .</title></head>
  34509. 8012f2f: 623c 646f 3e79 6e3c 7661 6320 616c 7373 <body><nav class
  34510. 8012f3f: 223d 616e 6276 7261 3e22 2f3c 616e 3e76 ="navbar"></nav>
  34511. 8012f4f: 643c 7669 6320 616c 7373 223d 7277 7061 <div class="wrap
  34512. 8012f5f: 6570 2272 3c3e 3168 d03e d09e d0b1 d0bd per"><h1>.......
  34513. 8012f6f: d0be d0b2 d0bb d0b5 d0bd d0b8 20b5 bfd0 ............. ..
  34514. 8012f7f: 80d1 bed0 88d1 b8d0 b2d0 bad0 b8d0 2f3c ..............</
  34515. 8012f8f: 3168 3c3e 6964 2076 6c63 7361 3d73 7522 h1><div class="u
  34516. 8012f9f: 6c70 616f 2d64 6f66 6d72 3e22 643c 7669 pload-form"><div
  34517. 8012faf: 6320 616c 7373 223d 7567 6469 2265 7320 class="guide" s
  34518. 8012fbf: 7974 656c 223d 6574 7478 612d 696c 6e67 tyle="text-align
  34519. 8012fcf: 633a 6e65 6574 2272 3c3e 2070 7473 6c79 :center"><p styl
  34520. 8012fdf: 3d65 6322 6c6f 726f 233a 3333 4343 3030 e="color:#33CC00
  34521. 8012fef: 3e22 623c d03e d09e d0b1 d0bd d0be d0b2 "><b>...........
  34522. 8012fff: d0bb d0b5 d0bd d0b8 20b5 bfd0 80d1 bed0 ......... ......
  34523. 801300f: b3d0 80d1 b0d0 bcd0 bcd0 bdd0 bed0 b3d0 ................
  34524. 801301f: bed0 d020 d0be d0b1 d1b5 d081 d0bf d1b5 .. .............
  34525. 801302f: d087 d0b5 d0bd d1b8 208f 83d1 81d1 bfd0 ......... ......
  34526. 801303f: b5d0 88d1 bdd0 bed0 d020 d0b7 d0b0 d0b2 ........ .......
  34527. 801304f: d1b5 d180 d088 d0b5 d0bd 2ebe 2f3c 3e62 ............</b>
  34528. 801305f: 623c 3e72 9ad0 bed0 bdd0 82d1 80d1 bed0 <br>............
  34529. 801306f: bbd0 bbd0 b5d0 80d1 d020 d1b1 d083 d0b4 ........ .......
  34530. 801307f: d1b5 2082 bfd0 b5d0 80d1 b5d0 b7d0 b0d0 ... ............
  34531. 801308f: b3d0 80d1 83d1 b6d0 b5d0 bdd0 d120 d087 ............ ...
  34532. 801309f: d1b5 d080 d0b5 20b7 733c 6170 206e 6469 ....... <span id
  34533. 80130af: 223d 6f63 6e75 2d74 756e 626d 7265 3e22 ="count-number">
  34534. 80130bf: 3c35 732f 6170 3e6e d120 d081 d0b5 d1ba 5</span> .......
  34535. 80130cf: d083 d0bd 3cb4 702f 3c3e 642f 7669 3c3e .....</p></div><
  34536. 80130df: 642f 7669 3c3e 6373 6972 7470 7420 7079 /div><script typ
  34537. 80130ef: 3d65 7422 7865 2f74 616a 6176 6373 6972 e="text/javascri
  34538. 80130ff: 7470 2022 7273 3d63 7522 6c70 616f 2e64 pt" src="upload.
  34539. 801310f: 736a 3e22 2f3c 6373 6972 7470 3c3e 6373 js"></script><sc
  34540. 801311f: 6972 7470 633e 756f 746e 6f64 6e77 2928 ript>countdown()
  34541. 801312f: 3c3b 732f 7263 7069 3e74 2f3c 6964 3e76 ;</script></div>
  34542. 801313f: 2f3c 6f62 7964 3c3e 682f 6d74 3e6c </body></html>
  34543. 0801314d <data__upload_js>:
  34544. 801314d: 752f 6c70 616f 2e64 736a 0000 5448 5054 /upload.js..HTTP
  34545. 801315d: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
  34546. 801316d: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
  34547. 801317d: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
  34548. 801318d: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
  34549. 801319d: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
  34550. 80131ad: 6e65 2d74 7974 6570 203a 7061 6c70 6369 ent-type: applic
  34551. 80131bd: 7461 6f69 2f6e 2d78 616a 6176 6373 6972 ation/x-javascri
  34552. 80131cd: 7470 0a0d 6f43 746e 6e65 2d74 6e45 6f63 pt..Content-Enco
  34553. 80131dd: 6964 676e 203a 7a67 7069 0a0d 0a0d 8b1f ding: gzip......
  34554. 80131ed: 0008 0000 0000 0b04 54b5 6ae1 46dc 7e10 .........T.j.F.~
  34555. 80131fd: bd95 1825 cb09 99ea 2812 b756 2ea6 6269 ..%......(V...ib
  34556. 801320d: db88 8e10 3012 aca6 a356 adbb bb75 6957 .....0..V...u.Wi
  34557. 801321d: ee75 0e61 73e2 0b4a 140d 02fa d3fd 3007 u.a..sJ........0
  34558. 801322d: 6ea1 24ec 67be 7dd8 cea3 749e 1c8e 9f9a .n.$.g.}...t....
  34559. 801323d: 21fd ed21 eccc f37c 37cd d793 184a 15a9 .!!...|..7..J...
  34560. 801324d: 17b9 f0f0 04b4 9753 648a d45a 5063 1e26 ......S..dZ.cP&.
  34561. 801325d: 7982 8050 dcff ed9b e867 cf31 fed7 d742 .yP.....g.1...B.
  34562. 801326d: 64ca 44fa e105 94e9 8497 fbb3 0549 5f66 .d.D........I.f_
  34563. 801327d: 2819 bca7 d608 688e 6f6e 66dd 6f8c 046c .(.....hno.f.ol.
  34564. 801328d: 5227 5861 685c 7dc1 78e2 4254 e8ce 3427 'RaX\h.}.xTB..'4
  34565. 801329d: f88c fd17 0d8d b5be 7d15 3f2c 255d 52dd .........},?]%.R
  34566. 80132ad: 38f5 9285 b186 0a54 47ca 8383 8cc7 7c47 .8....T..G....G|
  34567. 80132bd: 6d1e a7c3 801d fd88 87ab befb 0f2a 8d2f .m..........*./.
  34568. 80132cd: d244 a0e0 9d43 7172 8b1c a4a1 6888 4837 D...C.rq.....h7H
  34569. 80132dd: d099 972a 38e5 f6a0 f70f 711b f6e7 bd95 ..*..8.....q....
  34570. 80132ed: cf74 a5ed f1bd bfbf 85b8 125d b3f7 e25d t.........]...].
  34571. 80132fd: 15c7 973e 75a4 71b8 6ee7 5ee1 33ba 3bf7 ..>..u.q.n.^.3.;
  34572. 801330d: 111e 3874 37b3 8976 ff56 26be 0af6 406f ..t8.7v.V..&..o@
  34573. 801331d: f77f bddc dbc0 ddae 2ed9 2996 e618 fb41 ...........)..A.
  34574. 801332d: fb6b 930a b85c 0f85 d85c 3e77 7f9f 1a62 k...\...\.w>..b.
  34575. 801333d: a4ee d7ac d28f 35dd cf59 1e0e 323f f266 .......5Y...?2f.
  34576. 801334d: 7e14 a1ac bb32 8d3f 118b 32fe 2705 aee4 .~..2.?....2.'..
  34577. 801335d: a769 fa6b 3b12 853b df67 3fa6 3080 3d01 i.k..;;.g..?.0.=
  34578. 801336d: a290 95d4 4dce 63ec 8306 8827 75a5 f58f .....M.c..'..u..
  34579. 801337d: 5404 1f40 183e 88d0 bd47 7bfe 0543 0b2a .T@.>...G..{C.*.
  34580. 801338d: 7f42 33b4 32d5 bc23 d280 a204 f3c3 bc77 B..3.2#.......w.
  34581. 801339d: 1990 e037 ce99 1975 d8ac bc66 9da3 6f6a ..7...u...f...jo
  34582. 80133ad: e036 6fc3 18f8 2a02 a4d5 2b36 fa12 f889 6..o...*..6+....
  34583. 80133bd: 8d3c 500b 3343 c44a 66e6 a7d3 a58c e287 <..PC3J..f......
  34584. 80133cd: 0228 dbd6 644e d01e 165c 6d80 62ca 9b33 (...Nd..\..m.b3.
  34585. 80133dd: 7840 478a ff7d 8fe7 36ab 6c38 d5f5 a340 @x.G}....68l..@.
  34586. 80133ed: cff6 2ba6 bec4 4821 85fb b6bd dd6f f139 ...+..!H....o.9.
  34587. 80133fd: fadc bed6 93c1 f8d7 20dc 9f08 c225 1e44 ......... ..%.D.
  34588. 801340d: be72 f5be 7fb0 2b14 eac4 e7d3 7d8c 628f r......+.....}.b
  34589. 801341d: d996 98d7 17cf 9e10 4c62 ba3f b417 422a ........bL?...*B
  34590. 801342d: 8a11 5782 b795 ffb1 dd3c 24a4 1593 0b4f ...W....<..$..O.
  34591. 801343d: 68c8 9692 8fc0 78e7 0f71 443e 57fd 9483 .h.....xq.>D.W..
  34592. 801344d: cdd0 431c 6856 4751 f617 8a2d 6fe8 8b2f ...CVhQG..-..o/.
  34593. 801345d: ac88 72d4 7ee6 1145 c4ae 1689 e294 9795 ...r.~E.........
  34594. 801346d: 3bd9 e054 58ba 417b 6230 9189 78ff 121d .;T..X{A0b...x..
  34595. 801347d: e514 a572 af30 05ea 758a 1781 917b f4a2 ..r.0....u..{...
  34596. 801348d: cbdc 721d 3988 56ef 0089 908e de9e 7cf6 ...r.9.V.......|
  34597. 801349d: 70de ebdb 3dcf 4647 418e 26d7 9db9 ad4f .p...=GF.A.&..O.
  34598. 80134ad: bac6 60ae a7ac 3ac0 2f03 e00a a0e5 0e71 ...`...:./....q.
  34599. 80134bd: a0da 6a30 183f 896e adb5 8313 a1db d89d ..0j?.n.........
  34600. 80134cd: 80ce b8e2 c6e0 5e40 c19b 293f 04f9 af19 ......@^..?)....
  34601. 80134dd: accc 1880 9d59 7c14 68c6 ab8a 98e4 9efa ....Y..|.h......
  34602. 80134ed: eedc 8fa4 dd3a 047a 8861 e30b b833 ce1f ....:.z.a...3...
  34603. 80134fd: ed57 4bbf a300 7bfb e24f 2a54 749a aa9b W..K...{O.T*.t..
  34604. 801350d: 2895 38a4 96ee 59ca 2e07 de8d c157 57ff .(.8...Y....W..W
  34605. 801351d: 88e4 9eaa 9a14 7b67 6146 08b1 c46c f0d5 ......g{Fa..l...
  34606. 801352d: 134e 9b6e c1f4 6f12 bd03 31a2 d512 035d N.n....o...1..].
  34607. 801353d: 2333 3559 b533 ff56 f93c 5417 58c3 1a63 3#Y53.V.<..T.Xc.
  34608. 801354d: 0006 4400 ...
  34609. 08013550 <file__success_html>:
  34610. 8013550: 2244 0801 2d7f 0801 2d8f 0801 03be 0000 D"...-...-......
  34611. 8013560: 0001 0000 4547 2054 002f 4547 2054 752f ....GET /.GET /u
  34612. 8013570: 6c70 616f 2e64 7363 0073 4547 2054 752f pload.css.GET /u
  34613. 8013580: 6c70 616f 2e64 736a 4700 5445 2f20 6f67 pload.js.GET /go
  34614. 8013590: 6162 6b63 632e 6967 4700 5445 2f20 6166 back.cgi.GET /fa
  34615. 80135a0: 6976 6f63 2e6e 6369 006f 692f 646e 7865 vicon.ico./index
  34616. 80135b0: 682e 6d74 006c 4f50 5453 2f20 7075 6f6c .html.POST /uplo
  34617. 80135c0: 6461 632e 6967 6600 6c69 6e65 6d61 3d65 ad.cgi.filename=
  34618. 80135d0: 2f00 7075 6f6c 6461 682e 6d74 006c 6946 ./upload.html.Fi
  34619. 80135e0: 656c 203a 7325 0d0a 2500 2064 7962 6574 le: %s...%d byte
  34620. 80135f0: 2073 0d0a 2f00 7573 6363 7365 2e73 7468 s .../success.ht
  34621. 8013600: 6c6d 2f00 7265 6f72 2e72 7468 6c6d 0000 ml./error.html..
  34622. 08013610 <file__upload_css>:
  34623. 8013610: 3550 0801 193c 0801 1948 0801 08e9 0000 P5..<...H.......
  34624. 8013620: 0001 0000 3931 2e32 3631 2e38 3431 342e ....192.168.14.4
  34625. 8013630: 0038 3931 2e32 3631 2e38 3431 312e 6c00 8.192.168.14.1.l
  34626. 8013640: 616f 4d64 646f 3a65 2520 0d64 620a 6f6f oadMode: %d..boo
  34627. 8013650: 5474 7972 203a 6425 0a0d 5200 6e75 6d20 tTry: %d...Run m
  34628. 8013660: 6961 206e 5746 0d0a 0000 0000 0043 0000 ain FW......C...
  34629. 08013670 <_init>:
  34630. 8013670: b5f8 push {r3, r4, r5, r6, r7, lr}
  34631. 8013672: bf00 nop
  34632. 8013674: bcf8 pop {r3, r4, r5, r6, r7}
  34633. 8013676: bc08 pop {r3}
  34634. 8013678: 469e mov lr, r3
  34635. 801367a: 4770 bx lr
  34636. 0801367c <_fini>:
  34637. 801367c: b5f8 push {r3, r4, r5, r6, r7, lr}
  34638. 801367e: bf00 nop
  34639. 8013680: bcf8 pop {r3, r4, r5, r6, r7}
  34640. 8013682: bc08 pop {r3}
  34641. 8013684: 469e mov lr, r3
  34642. 8013686: 4770 bx lr