| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874 |
- ../build/iap/iap/iap.elf: file format elf32-littlearm
- Sections:
- Idx Name Size VMA LMA File off Algn
- 0 .isr_vector 00000188 08000000 08000000 00008000 2**0
- CONTENTS, ALLOC, LOAD, READONLY, DATA
- 1 .text 0000b688 08008000 08008000 00010000 2**3
- CONTENTS, ALLOC, LOAD, READONLY, CODE
- 2 .ARM 00000008 08013688 08013688 0001b688 2**2
- CONTENTS, ALLOC, LOAD, READONLY, DATA
- 3 .init_array 00000004 08013690 08013690 0001b690 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 4 .fini_array 00000004 08013694 08013694 0001b694 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 5 .data 00000118 20000000 08013698 00020000 2**2
- CONTENTS, ALLOC, LOAD, DATA
- 6 .bss 0000c884 20000118 080137b0 00020118 2**2
- ALLOC
- 7 ._user_heap_stack 00000900 2000c99c 08020034 00020118 2**0
- ALLOC
- 8 .settings 00004000 08004000 08004000 0000c000 2**0
- CONTENTS, ALLOC, LOAD, DATA
- 9 .ARM.attributes 0000002f 00000000 00000000 00020118 2**0
- CONTENTS, READONLY
- 10 .debug_info 00024c72 00000000 00000000 00020147 2**0
- CONTENTS, READONLY, DEBUGGING
- 11 .debug_abbrev 00007158 00000000 00000000 00044db9 2**0
- CONTENTS, READONLY, DEBUGGING
- 12 .debug_loc 00011f69 00000000 00000000 0004bf11 2**0
- CONTENTS, READONLY, DEBUGGING
- 13 .debug_aranges 000019c8 00000000 00000000 0005de80 2**3
- CONTENTS, READONLY, DEBUGGING
- 14 .debug_ranges 00001d78 00000000 00000000 0005f848 2**3
- CONTENTS, READONLY, DEBUGGING
- 15 .debug_macro 0001760b 00000000 00000000 000615c0 2**0
- CONTENTS, READONLY, DEBUGGING
- 16 .debug_line 00013254 00000000 00000000 00078bcb 2**0
- CONTENTS, READONLY, DEBUGGING
- 17 .debug_str 00071516 00000000 00000000 0008be1f 2**0
- CONTENTS, READONLY, DEBUGGING
- 18 .comment 00000030 00000000 00000000 000fd335 2**0
- CONTENTS, READONLY
- 19 .debug_frame 00003ec8 00000000 00000000 000fd368 2**2
- CONTENTS, READONLY, DEBUGGING
- Disassembly of section .text:
- 08008000 <deregister_tm_clones>:
- 8008000: b508 push {r3, lr}
- 8008002: f240 1018 movw r0, #280 ; 0x118
- 8008006: 4b07 ldr r3, [pc, #28] ; (8008024 <deregister_tm_clones+0x24>)
- 8008008: f2c2 0000 movt r0, #8192 ; 0x2000
- 800800c: 1a1b subs r3, r3, r0
- 800800e: 2b06 cmp r3, #6
- 8008010: d800 bhi.n 8008014 <deregister_tm_clones+0x14>
- 8008012: bd08 pop {r3, pc}
- 8008014: f240 0300 movw r3, #0
- 8008018: f2c0 0300 movt r3, #0
- 800801c: 2b00 cmp r3, #0
- 800801e: d0f8 beq.n 8008012 <deregister_tm_clones+0x12>
- 8008020: 4798 blx r3
- 8008022: e7f6 b.n 8008012 <deregister_tm_clones+0x12>
- 8008024: 2000011b .word 0x2000011b
- 08008028 <register_tm_clones>:
- 8008028: b508 push {r3, lr}
- 800802a: f240 1018 movw r0, #280 ; 0x118
- 800802e: f240 1318 movw r3, #280 ; 0x118
- 8008032: f2c2 0000 movt r0, #8192 ; 0x2000
- 8008036: f2c2 0300 movt r3, #8192 ; 0x2000
- 800803a: 1a1b subs r3, r3, r0
- 800803c: 109b asrs r3, r3, #2
- 800803e: eb03 73d3 add.w r3, r3, r3, lsr #31
- 8008042: 1059 asrs r1, r3, #1
- 8008044: d100 bne.n 8008048 <register_tm_clones+0x20>
- 8008046: bd08 pop {r3, pc}
- 8008048: f240 0200 movw r2, #0
- 800804c: f2c0 0200 movt r2, #0
- 8008050: 2a00 cmp r2, #0
- 8008052: d0f8 beq.n 8008046 <register_tm_clones+0x1e>
- 8008054: 4790 blx r2
- 8008056: e7f6 b.n 8008046 <register_tm_clones+0x1e>
- 08008058 <__do_global_dtors_aux>:
- 8008058: b510 push {r4, lr}
- 800805a: f240 1418 movw r4, #280 ; 0x118
- 800805e: f2c2 0400 movt r4, #8192 ; 0x2000
- 8008062: 7823 ldrb r3, [r4, #0]
- 8008064: b973 cbnz r3, 8008084 <__do_global_dtors_aux+0x2c>
- 8008066: f7ff ffcb bl 8008000 <deregister_tm_clones>
- 800806a: f240 0300 movw r3, #0
- 800806e: f2c0 0300 movt r3, #0
- 8008072: b12b cbz r3, 8008080 <__do_global_dtors_aux+0x28>
- 8008074: f243 6070 movw r0, #13936 ; 0x3670
- 8008078: f6c0 0001 movt r0, #2049 ; 0x801
- 800807c: f3af 8000 nop.w
- 8008080: 2301 movs r3, #1
- 8008082: 7023 strb r3, [r4, #0]
- 8008084: bd10 pop {r4, pc}
- 8008086: bf00 nop
- 08008088 <frame_dummy>:
- 8008088: b508 push {r3, lr}
- 800808a: f240 0300 movw r3, #0
- 800808e: f2c0 0300 movt r3, #0
- 8008092: b14b cbz r3, 80080a8 <frame_dummy+0x20>
- 8008094: f243 6070 movw r0, #13936 ; 0x3670
- 8008098: f240 111c movw r1, #284 ; 0x11c
- 800809c: f6c0 0001 movt r0, #2049 ; 0x801
- 80080a0: f2c2 0100 movt r1, #8192 ; 0x2000
- 80080a4: f3af 8000 nop.w
- 80080a8: f240 1018 movw r0, #280 ; 0x118
- 80080ac: f2c2 0000 movt r0, #8192 ; 0x2000
- 80080b0: 6803 ldr r3, [r0, #0]
- 80080b2: b12b cbz r3, 80080c0 <frame_dummy+0x38>
- 80080b4: f240 0300 movw r3, #0
- 80080b8: f2c0 0300 movt r3, #0
- 80080bc: b103 cbz r3, 80080c0 <frame_dummy+0x38>
- 80080be: 4798 blx r3
- 80080c0: e8bd 4008 ldmia.w sp!, {r3, lr}
- 80080c4: f7ff bfb0 b.w 8008028 <register_tm_clones>
- 080080c8 <__aeabi_drsub>:
- 80080c8: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
- 80080cc: e002 b.n 80080d4 <__adddf3>
- 80080ce: bf00 nop
- 080080d0 <__aeabi_dsub>:
- 80080d0: f083 4300 eor.w r3, r3, #2147483648 ; 0x80000000
- 080080d4 <__adddf3>:
- 80080d4: b530 push {r4, r5, lr}
- 80080d6: ea4f 0441 mov.w r4, r1, lsl #1
- 80080da: ea4f 0543 mov.w r5, r3, lsl #1
- 80080de: ea94 0f05 teq r4, r5
- 80080e2: bf08 it eq
- 80080e4: ea90 0f02 teqeq r0, r2
- 80080e8: bf1f itttt ne
- 80080ea: ea54 0c00 orrsne.w ip, r4, r0
- 80080ee: ea55 0c02 orrsne.w ip, r5, r2
- 80080f2: ea7f 5c64 mvnsne.w ip, r4, asr #21
- 80080f6: ea7f 5c65 mvnsne.w ip, r5, asr #21
- 80080fa: f000 80e2 beq.w 80082c2 <__adddf3+0x1ee>
- 80080fe: ea4f 5454 mov.w r4, r4, lsr #21
- 8008102: ebd4 5555 rsbs r5, r4, r5, lsr #21
- 8008106: bfb8 it lt
- 8008108: 426d neglt r5, r5
- 800810a: dd0c ble.n 8008126 <__adddf3+0x52>
- 800810c: 442c add r4, r5
- 800810e: ea80 0202 eor.w r2, r0, r2
- 8008112: ea81 0303 eor.w r3, r1, r3
- 8008116: ea82 0000 eor.w r0, r2, r0
- 800811a: ea83 0101 eor.w r1, r3, r1
- 800811e: ea80 0202 eor.w r2, r0, r2
- 8008122: ea81 0303 eor.w r3, r1, r3
- 8008126: 2d36 cmp r5, #54 ; 0x36
- 8008128: bf88 it hi
- 800812a: bd30 pophi {r4, r5, pc}
- 800812c: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
- 8008130: ea4f 3101 mov.w r1, r1, lsl #12
- 8008134: f44f 1c80 mov.w ip, #1048576 ; 0x100000
- 8008138: ea4c 3111 orr.w r1, ip, r1, lsr #12
- 800813c: d002 beq.n 8008144 <__adddf3+0x70>
- 800813e: 4240 negs r0, r0
- 8008140: eb61 0141 sbc.w r1, r1, r1, lsl #1
- 8008144: f013 4f00 tst.w r3, #2147483648 ; 0x80000000
- 8008148: ea4f 3303 mov.w r3, r3, lsl #12
- 800814c: ea4c 3313 orr.w r3, ip, r3, lsr #12
- 8008150: d002 beq.n 8008158 <__adddf3+0x84>
- 8008152: 4252 negs r2, r2
- 8008154: eb63 0343 sbc.w r3, r3, r3, lsl #1
- 8008158: ea94 0f05 teq r4, r5
- 800815c: f000 80a7 beq.w 80082ae <__adddf3+0x1da>
- 8008160: f1a4 0401 sub.w r4, r4, #1
- 8008164: f1d5 0e20 rsbs lr, r5, #32
- 8008168: db0d blt.n 8008186 <__adddf3+0xb2>
- 800816a: fa02 fc0e lsl.w ip, r2, lr
- 800816e: fa22 f205 lsr.w r2, r2, r5
- 8008172: 1880 adds r0, r0, r2
- 8008174: f141 0100 adc.w r1, r1, #0
- 8008178: fa03 f20e lsl.w r2, r3, lr
- 800817c: 1880 adds r0, r0, r2
- 800817e: fa43 f305 asr.w r3, r3, r5
- 8008182: 4159 adcs r1, r3
- 8008184: e00e b.n 80081a4 <__adddf3+0xd0>
- 8008186: f1a5 0520 sub.w r5, r5, #32
- 800818a: f10e 0e20 add.w lr, lr, #32
- 800818e: 2a01 cmp r2, #1
- 8008190: fa03 fc0e lsl.w ip, r3, lr
- 8008194: bf28 it cs
- 8008196: f04c 0c02 orrcs.w ip, ip, #2
- 800819a: fa43 f305 asr.w r3, r3, r5
- 800819e: 18c0 adds r0, r0, r3
- 80081a0: eb51 71e3 adcs.w r1, r1, r3, asr #31
- 80081a4: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
- 80081a8: d507 bpl.n 80081ba <__adddf3+0xe6>
- 80081aa: f04f 0e00 mov.w lr, #0
- 80081ae: f1dc 0c00 rsbs ip, ip, #0
- 80081b2: eb7e 0000 sbcs.w r0, lr, r0
- 80081b6: eb6e 0101 sbc.w r1, lr, r1
- 80081ba: f5b1 1f80 cmp.w r1, #1048576 ; 0x100000
- 80081be: d31b bcc.n 80081f8 <__adddf3+0x124>
- 80081c0: f5b1 1f00 cmp.w r1, #2097152 ; 0x200000
- 80081c4: d30c bcc.n 80081e0 <__adddf3+0x10c>
- 80081c6: 0849 lsrs r1, r1, #1
- 80081c8: ea5f 0030 movs.w r0, r0, rrx
- 80081cc: ea4f 0c3c mov.w ip, ip, rrx
- 80081d0: f104 0401 add.w r4, r4, #1
- 80081d4: ea4f 5244 mov.w r2, r4, lsl #21
- 80081d8: f512 0f80 cmn.w r2, #4194304 ; 0x400000
- 80081dc: f080 809a bcs.w 8008314 <__adddf3+0x240>
- 80081e0: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
- 80081e4: bf08 it eq
- 80081e6: ea5f 0c50 movseq.w ip, r0, lsr #1
- 80081ea: f150 0000 adcs.w r0, r0, #0
- 80081ee: eb41 5104 adc.w r1, r1, r4, lsl #20
- 80081f2: ea41 0105 orr.w r1, r1, r5
- 80081f6: bd30 pop {r4, r5, pc}
- 80081f8: ea5f 0c4c movs.w ip, ip, lsl #1
- 80081fc: 4140 adcs r0, r0
- 80081fe: eb41 0101 adc.w r1, r1, r1
- 8008202: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 8008206: f1a4 0401 sub.w r4, r4, #1
- 800820a: d1e9 bne.n 80081e0 <__adddf3+0x10c>
- 800820c: f091 0f00 teq r1, #0
- 8008210: bf04 itt eq
- 8008212: 4601 moveq r1, r0
- 8008214: 2000 moveq r0, #0
- 8008216: fab1 f381 clz r3, r1
- 800821a: bf08 it eq
- 800821c: 3320 addeq r3, #32
- 800821e: f1a3 030b sub.w r3, r3, #11
- 8008222: f1b3 0220 subs.w r2, r3, #32
- 8008226: da0c bge.n 8008242 <__adddf3+0x16e>
- 8008228: 320c adds r2, #12
- 800822a: dd08 ble.n 800823e <__adddf3+0x16a>
- 800822c: f102 0c14 add.w ip, r2, #20
- 8008230: f1c2 020c rsb r2, r2, #12
- 8008234: fa01 f00c lsl.w r0, r1, ip
- 8008238: fa21 f102 lsr.w r1, r1, r2
- 800823c: e00c b.n 8008258 <__adddf3+0x184>
- 800823e: f102 0214 add.w r2, r2, #20
- 8008242: bfd8 it le
- 8008244: f1c2 0c20 rsble ip, r2, #32
- 8008248: fa01 f102 lsl.w r1, r1, r2
- 800824c: fa20 fc0c lsr.w ip, r0, ip
- 8008250: bfdc itt le
- 8008252: ea41 010c orrle.w r1, r1, ip
- 8008256: 4090 lslle r0, r2
- 8008258: 1ae4 subs r4, r4, r3
- 800825a: bfa2 ittt ge
- 800825c: eb01 5104 addge.w r1, r1, r4, lsl #20
- 8008260: 4329 orrge r1, r5
- 8008262: bd30 popge {r4, r5, pc}
- 8008264: ea6f 0404 mvn.w r4, r4
- 8008268: 3c1f subs r4, #31
- 800826a: da1c bge.n 80082a6 <__adddf3+0x1d2>
- 800826c: 340c adds r4, #12
- 800826e: dc0e bgt.n 800828e <__adddf3+0x1ba>
- 8008270: f104 0414 add.w r4, r4, #20
- 8008274: f1c4 0220 rsb r2, r4, #32
- 8008278: fa20 f004 lsr.w r0, r0, r4
- 800827c: fa01 f302 lsl.w r3, r1, r2
- 8008280: ea40 0003 orr.w r0, r0, r3
- 8008284: fa21 f304 lsr.w r3, r1, r4
- 8008288: ea45 0103 orr.w r1, r5, r3
- 800828c: bd30 pop {r4, r5, pc}
- 800828e: f1c4 040c rsb r4, r4, #12
- 8008292: f1c4 0220 rsb r2, r4, #32
- 8008296: fa20 f002 lsr.w r0, r0, r2
- 800829a: fa01 f304 lsl.w r3, r1, r4
- 800829e: ea40 0003 orr.w r0, r0, r3
- 80082a2: 4629 mov r1, r5
- 80082a4: bd30 pop {r4, r5, pc}
- 80082a6: fa21 f004 lsr.w r0, r1, r4
- 80082aa: 4629 mov r1, r5
- 80082ac: bd30 pop {r4, r5, pc}
- 80082ae: f094 0f00 teq r4, #0
- 80082b2: f483 1380 eor.w r3, r3, #1048576 ; 0x100000
- 80082b6: bf06 itte eq
- 80082b8: f481 1180 eoreq.w r1, r1, #1048576 ; 0x100000
- 80082bc: 3401 addeq r4, #1
- 80082be: 3d01 subne r5, #1
- 80082c0: e74e b.n 8008160 <__adddf3+0x8c>
- 80082c2: ea7f 5c64 mvns.w ip, r4, asr #21
- 80082c6: bf18 it ne
- 80082c8: ea7f 5c65 mvnsne.w ip, r5, asr #21
- 80082cc: d029 beq.n 8008322 <__adddf3+0x24e>
- 80082ce: ea94 0f05 teq r4, r5
- 80082d2: bf08 it eq
- 80082d4: ea90 0f02 teqeq r0, r2
- 80082d8: d005 beq.n 80082e6 <__adddf3+0x212>
- 80082da: ea54 0c00 orrs.w ip, r4, r0
- 80082de: bf04 itt eq
- 80082e0: 4619 moveq r1, r3
- 80082e2: 4610 moveq r0, r2
- 80082e4: bd30 pop {r4, r5, pc}
- 80082e6: ea91 0f03 teq r1, r3
- 80082ea: bf1e ittt ne
- 80082ec: 2100 movne r1, #0
- 80082ee: 2000 movne r0, #0
- 80082f0: bd30 popne {r4, r5, pc}
- 80082f2: ea5f 5c54 movs.w ip, r4, lsr #21
- 80082f6: d105 bne.n 8008304 <__adddf3+0x230>
- 80082f8: 0040 lsls r0, r0, #1
- 80082fa: 4149 adcs r1, r1
- 80082fc: bf28 it cs
- 80082fe: f041 4100 orrcs.w r1, r1, #2147483648 ; 0x80000000
- 8008302: bd30 pop {r4, r5, pc}
- 8008304: f514 0480 adds.w r4, r4, #4194304 ; 0x400000
- 8008308: bf3c itt cc
- 800830a: f501 1180 addcc.w r1, r1, #1048576 ; 0x100000
- 800830e: bd30 popcc {r4, r5, pc}
- 8008310: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
- 8008314: f045 41fe orr.w r1, r5, #2130706432 ; 0x7f000000
- 8008318: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
- 800831c: f04f 0000 mov.w r0, #0
- 8008320: bd30 pop {r4, r5, pc}
- 8008322: ea7f 5c64 mvns.w ip, r4, asr #21
- 8008326: bf1a itte ne
- 8008328: 4619 movne r1, r3
- 800832a: 4610 movne r0, r2
- 800832c: ea7f 5c65 mvnseq.w ip, r5, asr #21
- 8008330: bf1c itt ne
- 8008332: 460b movne r3, r1
- 8008334: 4602 movne r2, r0
- 8008336: ea50 3401 orrs.w r4, r0, r1, lsl #12
- 800833a: bf06 itte eq
- 800833c: ea52 3503 orrseq.w r5, r2, r3, lsl #12
- 8008340: ea91 0f03 teqeq r1, r3
- 8008344: f441 2100 orrne.w r1, r1, #524288 ; 0x80000
- 8008348: bd30 pop {r4, r5, pc}
- 800834a: bf00 nop
- 0800834c <__aeabi_ui2d>:
- 800834c: f090 0f00 teq r0, #0
- 8008350: bf04 itt eq
- 8008352: 2100 moveq r1, #0
- 8008354: 4770 bxeq lr
- 8008356: b530 push {r4, r5, lr}
- 8008358: f44f 6480 mov.w r4, #1024 ; 0x400
- 800835c: f104 0432 add.w r4, r4, #50 ; 0x32
- 8008360: f04f 0500 mov.w r5, #0
- 8008364: f04f 0100 mov.w r1, #0
- 8008368: e750 b.n 800820c <__adddf3+0x138>
- 800836a: bf00 nop
- 0800836c <__aeabi_i2d>:
- 800836c: f090 0f00 teq r0, #0
- 8008370: bf04 itt eq
- 8008372: 2100 moveq r1, #0
- 8008374: 4770 bxeq lr
- 8008376: b530 push {r4, r5, lr}
- 8008378: f44f 6480 mov.w r4, #1024 ; 0x400
- 800837c: f104 0432 add.w r4, r4, #50 ; 0x32
- 8008380: f010 4500 ands.w r5, r0, #2147483648 ; 0x80000000
- 8008384: bf48 it mi
- 8008386: 4240 negmi r0, r0
- 8008388: f04f 0100 mov.w r1, #0
- 800838c: e73e b.n 800820c <__adddf3+0x138>
- 800838e: bf00 nop
- 08008390 <__aeabi_f2d>:
- 8008390: 0042 lsls r2, r0, #1
- 8008392: ea4f 01e2 mov.w r1, r2, asr #3
- 8008396: ea4f 0131 mov.w r1, r1, rrx
- 800839a: ea4f 7002 mov.w r0, r2, lsl #28
- 800839e: bf1f itttt ne
- 80083a0: f012 437f andsne.w r3, r2, #4278190080 ; 0xff000000
- 80083a4: f093 4f7f teqne r3, #4278190080 ; 0xff000000
- 80083a8: f081 5160 eorne.w r1, r1, #939524096 ; 0x38000000
- 80083ac: 4770 bxne lr
- 80083ae: f092 0f00 teq r2, #0
- 80083b2: bf14 ite ne
- 80083b4: f093 4f7f teqne r3, #4278190080 ; 0xff000000
- 80083b8: 4770 bxeq lr
- 80083ba: b530 push {r4, r5, lr}
- 80083bc: f44f 7460 mov.w r4, #896 ; 0x380
- 80083c0: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
- 80083c4: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
- 80083c8: e720 b.n 800820c <__adddf3+0x138>
- 80083ca: bf00 nop
- 080083cc <__aeabi_ul2d>:
- 80083cc: ea50 0201 orrs.w r2, r0, r1
- 80083d0: bf08 it eq
- 80083d2: 4770 bxeq lr
- 80083d4: b530 push {r4, r5, lr}
- 80083d6: f04f 0500 mov.w r5, #0
- 80083da: e00a b.n 80083f2 <__aeabi_l2d+0x16>
- 080083dc <__aeabi_l2d>:
- 80083dc: ea50 0201 orrs.w r2, r0, r1
- 80083e0: bf08 it eq
- 80083e2: 4770 bxeq lr
- 80083e4: b530 push {r4, r5, lr}
- 80083e6: f011 4500 ands.w r5, r1, #2147483648 ; 0x80000000
- 80083ea: d502 bpl.n 80083f2 <__aeabi_l2d+0x16>
- 80083ec: 4240 negs r0, r0
- 80083ee: eb61 0141 sbc.w r1, r1, r1, lsl #1
- 80083f2: f44f 6480 mov.w r4, #1024 ; 0x400
- 80083f6: f104 0432 add.w r4, r4, #50 ; 0x32
- 80083fa: ea5f 5c91 movs.w ip, r1, lsr #22
- 80083fe: f43f aedc beq.w 80081ba <__adddf3+0xe6>
- 8008402: f04f 0203 mov.w r2, #3
- 8008406: ea5f 0cdc movs.w ip, ip, lsr #3
- 800840a: bf18 it ne
- 800840c: 3203 addne r2, #3
- 800840e: ea5f 0cdc movs.w ip, ip, lsr #3
- 8008412: bf18 it ne
- 8008414: 3203 addne r2, #3
- 8008416: eb02 02dc add.w r2, r2, ip, lsr #3
- 800841a: f1c2 0320 rsb r3, r2, #32
- 800841e: fa00 fc03 lsl.w ip, r0, r3
- 8008422: fa20 f002 lsr.w r0, r0, r2
- 8008426: fa01 fe03 lsl.w lr, r1, r3
- 800842a: ea40 000e orr.w r0, r0, lr
- 800842e: fa21 f102 lsr.w r1, r1, r2
- 8008432: 4414 add r4, r2
- 8008434: e6c1 b.n 80081ba <__adddf3+0xe6>
- 8008436: bf00 nop
- 08008438 <__aeabi_dmul>:
- 8008438: b570 push {r4, r5, r6, lr}
- 800843a: f04f 0cff mov.w ip, #255 ; 0xff
- 800843e: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
- 8008442: ea1c 5411 ands.w r4, ip, r1, lsr #20
- 8008446: bf1d ittte ne
- 8008448: ea1c 5513 andsne.w r5, ip, r3, lsr #20
- 800844c: ea94 0f0c teqne r4, ip
- 8008450: ea95 0f0c teqne r5, ip
- 8008454: f000 f8de bleq 8008614 <__aeabi_dmul+0x1dc>
- 8008458: 442c add r4, r5
- 800845a: ea81 0603 eor.w r6, r1, r3
- 800845e: ea21 514c bic.w r1, r1, ip, lsl #21
- 8008462: ea23 534c bic.w r3, r3, ip, lsl #21
- 8008466: ea50 3501 orrs.w r5, r0, r1, lsl #12
- 800846a: bf18 it ne
- 800846c: ea52 3503 orrsne.w r5, r2, r3, lsl #12
- 8008470: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
- 8008474: f443 1380 orr.w r3, r3, #1048576 ; 0x100000
- 8008478: d038 beq.n 80084ec <__aeabi_dmul+0xb4>
- 800847a: fba0 ce02 umull ip, lr, r0, r2
- 800847e: f04f 0500 mov.w r5, #0
- 8008482: fbe1 e502 umlal lr, r5, r1, r2
- 8008486: f006 4200 and.w r2, r6, #2147483648 ; 0x80000000
- 800848a: fbe0 e503 umlal lr, r5, r0, r3
- 800848e: f04f 0600 mov.w r6, #0
- 8008492: fbe1 5603 umlal r5, r6, r1, r3
- 8008496: f09c 0f00 teq ip, #0
- 800849a: bf18 it ne
- 800849c: f04e 0e01 orrne.w lr, lr, #1
- 80084a0: f1a4 04ff sub.w r4, r4, #255 ; 0xff
- 80084a4: f5b6 7f00 cmp.w r6, #512 ; 0x200
- 80084a8: f564 7440 sbc.w r4, r4, #768 ; 0x300
- 80084ac: d204 bcs.n 80084b8 <__aeabi_dmul+0x80>
- 80084ae: ea5f 0e4e movs.w lr, lr, lsl #1
- 80084b2: 416d adcs r5, r5
- 80084b4: eb46 0606 adc.w r6, r6, r6
- 80084b8: ea42 21c6 orr.w r1, r2, r6, lsl #11
- 80084bc: ea41 5155 orr.w r1, r1, r5, lsr #21
- 80084c0: ea4f 20c5 mov.w r0, r5, lsl #11
- 80084c4: ea40 505e orr.w r0, r0, lr, lsr #21
- 80084c8: ea4f 2ece mov.w lr, lr, lsl #11
- 80084cc: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
- 80084d0: bf88 it hi
- 80084d2: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
- 80084d6: d81e bhi.n 8008516 <__aeabi_dmul+0xde>
- 80084d8: f1be 4f00 cmp.w lr, #2147483648 ; 0x80000000
- 80084dc: bf08 it eq
- 80084de: ea5f 0e50 movseq.w lr, r0, lsr #1
- 80084e2: f150 0000 adcs.w r0, r0, #0
- 80084e6: eb41 5104 adc.w r1, r1, r4, lsl #20
- 80084ea: bd70 pop {r4, r5, r6, pc}
- 80084ec: f006 4600 and.w r6, r6, #2147483648 ; 0x80000000
- 80084f0: ea46 0101 orr.w r1, r6, r1
- 80084f4: ea40 0002 orr.w r0, r0, r2
- 80084f8: ea81 0103 eor.w r1, r1, r3
- 80084fc: ebb4 045c subs.w r4, r4, ip, lsr #1
- 8008500: bfc2 ittt gt
- 8008502: ebd4 050c rsbsgt r5, r4, ip
- 8008506: ea41 5104 orrgt.w r1, r1, r4, lsl #20
- 800850a: bd70 popgt {r4, r5, r6, pc}
- 800850c: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
- 8008510: f04f 0e00 mov.w lr, #0
- 8008514: 3c01 subs r4, #1
- 8008516: f300 80ab bgt.w 8008670 <__aeabi_dmul+0x238>
- 800851a: f114 0f36 cmn.w r4, #54 ; 0x36
- 800851e: bfde ittt le
- 8008520: 2000 movle r0, #0
- 8008522: f001 4100 andle.w r1, r1, #2147483648 ; 0x80000000
- 8008526: bd70 pople {r4, r5, r6, pc}
- 8008528: f1c4 0400 rsb r4, r4, #0
- 800852c: 3c20 subs r4, #32
- 800852e: da35 bge.n 800859c <__aeabi_dmul+0x164>
- 8008530: 340c adds r4, #12
- 8008532: dc1b bgt.n 800856c <__aeabi_dmul+0x134>
- 8008534: f104 0414 add.w r4, r4, #20
- 8008538: f1c4 0520 rsb r5, r4, #32
- 800853c: fa00 f305 lsl.w r3, r0, r5
- 8008540: fa20 f004 lsr.w r0, r0, r4
- 8008544: fa01 f205 lsl.w r2, r1, r5
- 8008548: ea40 0002 orr.w r0, r0, r2
- 800854c: f001 4200 and.w r2, r1, #2147483648 ; 0x80000000
- 8008550: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
- 8008554: eb10 70d3 adds.w r0, r0, r3, lsr #31
- 8008558: fa21 f604 lsr.w r6, r1, r4
- 800855c: eb42 0106 adc.w r1, r2, r6
- 8008560: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
- 8008564: bf08 it eq
- 8008566: ea20 70d3 biceq.w r0, r0, r3, lsr #31
- 800856a: bd70 pop {r4, r5, r6, pc}
- 800856c: f1c4 040c rsb r4, r4, #12
- 8008570: f1c4 0520 rsb r5, r4, #32
- 8008574: fa00 f304 lsl.w r3, r0, r4
- 8008578: fa20 f005 lsr.w r0, r0, r5
- 800857c: fa01 f204 lsl.w r2, r1, r4
- 8008580: ea40 0002 orr.w r0, r0, r2
- 8008584: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8008588: eb10 70d3 adds.w r0, r0, r3, lsr #31
- 800858c: f141 0100 adc.w r1, r1, #0
- 8008590: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
- 8008594: bf08 it eq
- 8008596: ea20 70d3 biceq.w r0, r0, r3, lsr #31
- 800859a: bd70 pop {r4, r5, r6, pc}
- 800859c: f1c4 0520 rsb r5, r4, #32
- 80085a0: fa00 f205 lsl.w r2, r0, r5
- 80085a4: ea4e 0e02 orr.w lr, lr, r2
- 80085a8: fa20 f304 lsr.w r3, r0, r4
- 80085ac: fa01 f205 lsl.w r2, r1, r5
- 80085b0: ea43 0302 orr.w r3, r3, r2
- 80085b4: fa21 f004 lsr.w r0, r1, r4
- 80085b8: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 80085bc: fa21 f204 lsr.w r2, r1, r4
- 80085c0: ea20 0002 bic.w r0, r0, r2
- 80085c4: eb00 70d3 add.w r0, r0, r3, lsr #31
- 80085c8: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
- 80085cc: bf08 it eq
- 80085ce: ea20 70d3 biceq.w r0, r0, r3, lsr #31
- 80085d2: bd70 pop {r4, r5, r6, pc}
- 80085d4: f094 0f00 teq r4, #0
- 80085d8: d10f bne.n 80085fa <__aeabi_dmul+0x1c2>
- 80085da: f001 4600 and.w r6, r1, #2147483648 ; 0x80000000
- 80085de: 0040 lsls r0, r0, #1
- 80085e0: eb41 0101 adc.w r1, r1, r1
- 80085e4: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 80085e8: bf08 it eq
- 80085ea: 3c01 subeq r4, #1
- 80085ec: d0f7 beq.n 80085de <__aeabi_dmul+0x1a6>
- 80085ee: ea41 0106 orr.w r1, r1, r6
- 80085f2: f095 0f00 teq r5, #0
- 80085f6: bf18 it ne
- 80085f8: 4770 bxne lr
- 80085fa: f003 4600 and.w r6, r3, #2147483648 ; 0x80000000
- 80085fe: 0052 lsls r2, r2, #1
- 8008600: eb43 0303 adc.w r3, r3, r3
- 8008604: f413 1f80 tst.w r3, #1048576 ; 0x100000
- 8008608: bf08 it eq
- 800860a: 3d01 subeq r5, #1
- 800860c: d0f7 beq.n 80085fe <__aeabi_dmul+0x1c6>
- 800860e: ea43 0306 orr.w r3, r3, r6
- 8008612: 4770 bx lr
- 8008614: ea94 0f0c teq r4, ip
- 8008618: ea0c 5513 and.w r5, ip, r3, lsr #20
- 800861c: bf18 it ne
- 800861e: ea95 0f0c teqne r5, ip
- 8008622: d00c beq.n 800863e <__aeabi_dmul+0x206>
- 8008624: ea50 0641 orrs.w r6, r0, r1, lsl #1
- 8008628: bf18 it ne
- 800862a: ea52 0643 orrsne.w r6, r2, r3, lsl #1
- 800862e: d1d1 bne.n 80085d4 <__aeabi_dmul+0x19c>
- 8008630: ea81 0103 eor.w r1, r1, r3
- 8008634: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8008638: f04f 0000 mov.w r0, #0
- 800863c: bd70 pop {r4, r5, r6, pc}
- 800863e: ea50 0641 orrs.w r6, r0, r1, lsl #1
- 8008642: bf06 itte eq
- 8008644: 4610 moveq r0, r2
- 8008646: 4619 moveq r1, r3
- 8008648: ea52 0643 orrsne.w r6, r2, r3, lsl #1
- 800864c: d019 beq.n 8008682 <__aeabi_dmul+0x24a>
- 800864e: ea94 0f0c teq r4, ip
- 8008652: d102 bne.n 800865a <__aeabi_dmul+0x222>
- 8008654: ea50 3601 orrs.w r6, r0, r1, lsl #12
- 8008658: d113 bne.n 8008682 <__aeabi_dmul+0x24a>
- 800865a: ea95 0f0c teq r5, ip
- 800865e: d105 bne.n 800866c <__aeabi_dmul+0x234>
- 8008660: ea52 3603 orrs.w r6, r2, r3, lsl #12
- 8008664: bf1c itt ne
- 8008666: 4610 movne r0, r2
- 8008668: 4619 movne r1, r3
- 800866a: d10a bne.n 8008682 <__aeabi_dmul+0x24a>
- 800866c: ea81 0103 eor.w r1, r1, r3
- 8008670: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
- 8008674: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
- 8008678: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
- 800867c: f04f 0000 mov.w r0, #0
- 8008680: bd70 pop {r4, r5, r6, pc}
- 8008682: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
- 8008686: f441 0178 orr.w r1, r1, #16252928 ; 0xf80000
- 800868a: bd70 pop {r4, r5, r6, pc}
- 0800868c <__aeabi_ddiv>:
- 800868c: b570 push {r4, r5, r6, lr}
- 800868e: f04f 0cff mov.w ip, #255 ; 0xff
- 8008692: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
- 8008696: ea1c 5411 ands.w r4, ip, r1, lsr #20
- 800869a: bf1d ittte ne
- 800869c: ea1c 5513 andsne.w r5, ip, r3, lsr #20
- 80086a0: ea94 0f0c teqne r4, ip
- 80086a4: ea95 0f0c teqne r5, ip
- 80086a8: f000 f8a7 bleq 80087fa <__aeabi_ddiv+0x16e>
- 80086ac: eba4 0405 sub.w r4, r4, r5
- 80086b0: ea81 0e03 eor.w lr, r1, r3
- 80086b4: ea52 3503 orrs.w r5, r2, r3, lsl #12
- 80086b8: ea4f 3101 mov.w r1, r1, lsl #12
- 80086bc: f000 8088 beq.w 80087d0 <__aeabi_ddiv+0x144>
- 80086c0: ea4f 3303 mov.w r3, r3, lsl #12
- 80086c4: f04f 5580 mov.w r5, #268435456 ; 0x10000000
- 80086c8: ea45 1313 orr.w r3, r5, r3, lsr #4
- 80086cc: ea43 6312 orr.w r3, r3, r2, lsr #24
- 80086d0: ea4f 2202 mov.w r2, r2, lsl #8
- 80086d4: ea45 1511 orr.w r5, r5, r1, lsr #4
- 80086d8: ea45 6510 orr.w r5, r5, r0, lsr #24
- 80086dc: ea4f 2600 mov.w r6, r0, lsl #8
- 80086e0: f00e 4100 and.w r1, lr, #2147483648 ; 0x80000000
- 80086e4: 429d cmp r5, r3
- 80086e6: bf08 it eq
- 80086e8: 4296 cmpeq r6, r2
- 80086ea: f144 04fd adc.w r4, r4, #253 ; 0xfd
- 80086ee: f504 7440 add.w r4, r4, #768 ; 0x300
- 80086f2: d202 bcs.n 80086fa <__aeabi_ddiv+0x6e>
- 80086f4: 085b lsrs r3, r3, #1
- 80086f6: ea4f 0232 mov.w r2, r2, rrx
- 80086fa: 1ab6 subs r6, r6, r2
- 80086fc: eb65 0503 sbc.w r5, r5, r3
- 8008700: 085b lsrs r3, r3, #1
- 8008702: ea4f 0232 mov.w r2, r2, rrx
- 8008706: f44f 1080 mov.w r0, #1048576 ; 0x100000
- 800870a: f44f 2c00 mov.w ip, #524288 ; 0x80000
- 800870e: ebb6 0e02 subs.w lr, r6, r2
- 8008712: eb75 0e03 sbcs.w lr, r5, r3
- 8008716: bf22 ittt cs
- 8008718: 1ab6 subcs r6, r6, r2
- 800871a: 4675 movcs r5, lr
- 800871c: ea40 000c orrcs.w r0, r0, ip
- 8008720: 085b lsrs r3, r3, #1
- 8008722: ea4f 0232 mov.w r2, r2, rrx
- 8008726: ebb6 0e02 subs.w lr, r6, r2
- 800872a: eb75 0e03 sbcs.w lr, r5, r3
- 800872e: bf22 ittt cs
- 8008730: 1ab6 subcs r6, r6, r2
- 8008732: 4675 movcs r5, lr
- 8008734: ea40 005c orrcs.w r0, r0, ip, lsr #1
- 8008738: 085b lsrs r3, r3, #1
- 800873a: ea4f 0232 mov.w r2, r2, rrx
- 800873e: ebb6 0e02 subs.w lr, r6, r2
- 8008742: eb75 0e03 sbcs.w lr, r5, r3
- 8008746: bf22 ittt cs
- 8008748: 1ab6 subcs r6, r6, r2
- 800874a: 4675 movcs r5, lr
- 800874c: ea40 009c orrcs.w r0, r0, ip, lsr #2
- 8008750: 085b lsrs r3, r3, #1
- 8008752: ea4f 0232 mov.w r2, r2, rrx
- 8008756: ebb6 0e02 subs.w lr, r6, r2
- 800875a: eb75 0e03 sbcs.w lr, r5, r3
- 800875e: bf22 ittt cs
- 8008760: 1ab6 subcs r6, r6, r2
- 8008762: 4675 movcs r5, lr
- 8008764: ea40 00dc orrcs.w r0, r0, ip, lsr #3
- 8008768: ea55 0e06 orrs.w lr, r5, r6
- 800876c: d018 beq.n 80087a0 <__aeabi_ddiv+0x114>
- 800876e: ea4f 1505 mov.w r5, r5, lsl #4
- 8008772: ea45 7516 orr.w r5, r5, r6, lsr #28
- 8008776: ea4f 1606 mov.w r6, r6, lsl #4
- 800877a: ea4f 03c3 mov.w r3, r3, lsl #3
- 800877e: ea43 7352 orr.w r3, r3, r2, lsr #29
- 8008782: ea4f 02c2 mov.w r2, r2, lsl #3
- 8008786: ea5f 1c1c movs.w ip, ip, lsr #4
- 800878a: d1c0 bne.n 800870e <__aeabi_ddiv+0x82>
- 800878c: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 8008790: d10b bne.n 80087aa <__aeabi_ddiv+0x11e>
- 8008792: ea41 0100 orr.w r1, r1, r0
- 8008796: f04f 0000 mov.w r0, #0
- 800879a: f04f 4c00 mov.w ip, #2147483648 ; 0x80000000
- 800879e: e7b6 b.n 800870e <__aeabi_ddiv+0x82>
- 80087a0: f411 1f80 tst.w r1, #1048576 ; 0x100000
- 80087a4: bf04 itt eq
- 80087a6: 4301 orreq r1, r0
- 80087a8: 2000 moveq r0, #0
- 80087aa: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
- 80087ae: bf88 it hi
- 80087b0: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
- 80087b4: f63f aeaf bhi.w 8008516 <__aeabi_dmul+0xde>
- 80087b8: ebb5 0c03 subs.w ip, r5, r3
- 80087bc: bf04 itt eq
- 80087be: ebb6 0c02 subseq.w ip, r6, r2
- 80087c2: ea5f 0c50 movseq.w ip, r0, lsr #1
- 80087c6: f150 0000 adcs.w r0, r0, #0
- 80087ca: eb41 5104 adc.w r1, r1, r4, lsl #20
- 80087ce: bd70 pop {r4, r5, r6, pc}
- 80087d0: f00e 4e00 and.w lr, lr, #2147483648 ; 0x80000000
- 80087d4: ea4e 3111 orr.w r1, lr, r1, lsr #12
- 80087d8: eb14 045c adds.w r4, r4, ip, lsr #1
- 80087dc: bfc2 ittt gt
- 80087de: ebd4 050c rsbsgt r5, r4, ip
- 80087e2: ea41 5104 orrgt.w r1, r1, r4, lsl #20
- 80087e6: bd70 popgt {r4, r5, r6, pc}
- 80087e8: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
- 80087ec: f04f 0e00 mov.w lr, #0
- 80087f0: 3c01 subs r4, #1
- 80087f2: e690 b.n 8008516 <__aeabi_dmul+0xde>
- 80087f4: ea45 0e06 orr.w lr, r5, r6
- 80087f8: e68d b.n 8008516 <__aeabi_dmul+0xde>
- 80087fa: ea0c 5513 and.w r5, ip, r3, lsr #20
- 80087fe: ea94 0f0c teq r4, ip
- 8008802: bf08 it eq
- 8008804: ea95 0f0c teqeq r5, ip
- 8008808: f43f af3b beq.w 8008682 <__aeabi_dmul+0x24a>
- 800880c: ea94 0f0c teq r4, ip
- 8008810: d10a bne.n 8008828 <__aeabi_ddiv+0x19c>
- 8008812: ea50 3401 orrs.w r4, r0, r1, lsl #12
- 8008816: f47f af34 bne.w 8008682 <__aeabi_dmul+0x24a>
- 800881a: ea95 0f0c teq r5, ip
- 800881e: f47f af25 bne.w 800866c <__aeabi_dmul+0x234>
- 8008822: 4610 mov r0, r2
- 8008824: 4619 mov r1, r3
- 8008826: e72c b.n 8008682 <__aeabi_dmul+0x24a>
- 8008828: ea95 0f0c teq r5, ip
- 800882c: d106 bne.n 800883c <__aeabi_ddiv+0x1b0>
- 800882e: ea52 3503 orrs.w r5, r2, r3, lsl #12
- 8008832: f43f aefd beq.w 8008630 <__aeabi_dmul+0x1f8>
- 8008836: 4610 mov r0, r2
- 8008838: 4619 mov r1, r3
- 800883a: e722 b.n 8008682 <__aeabi_dmul+0x24a>
- 800883c: ea50 0641 orrs.w r6, r0, r1, lsl #1
- 8008840: bf18 it ne
- 8008842: ea52 0643 orrsne.w r6, r2, r3, lsl #1
- 8008846: f47f aec5 bne.w 80085d4 <__aeabi_dmul+0x19c>
- 800884a: ea50 0441 orrs.w r4, r0, r1, lsl #1
- 800884e: f47f af0d bne.w 800866c <__aeabi_dmul+0x234>
- 8008852: ea52 0543 orrs.w r5, r2, r3, lsl #1
- 8008856: f47f aeeb bne.w 8008630 <__aeabi_dmul+0x1f8>
- 800885a: e712 b.n 8008682 <__aeabi_dmul+0x24a>
- 0800885c <__gedf2>:
- 800885c: f04f 3cff mov.w ip, #4294967295
- 8008860: e006 b.n 8008870 <__cmpdf2+0x4>
- 8008862: bf00 nop
- 08008864 <__ledf2>:
- 8008864: f04f 0c01 mov.w ip, #1
- 8008868: e002 b.n 8008870 <__cmpdf2+0x4>
- 800886a: bf00 nop
- 0800886c <__cmpdf2>:
- 800886c: f04f 0c01 mov.w ip, #1
- 8008870: f84d cd04 str.w ip, [sp, #-4]!
- 8008874: ea4f 0c41 mov.w ip, r1, lsl #1
- 8008878: ea7f 5c6c mvns.w ip, ip, asr #21
- 800887c: ea4f 0c43 mov.w ip, r3, lsl #1
- 8008880: bf18 it ne
- 8008882: ea7f 5c6c mvnsne.w ip, ip, asr #21
- 8008886: d01b beq.n 80088c0 <__cmpdf2+0x54>
- 8008888: b001 add sp, #4
- 800888a: ea50 0c41 orrs.w ip, r0, r1, lsl #1
- 800888e: bf0c ite eq
- 8008890: ea52 0c43 orrseq.w ip, r2, r3, lsl #1
- 8008894: ea91 0f03 teqne r1, r3
- 8008898: bf02 ittt eq
- 800889a: ea90 0f02 teqeq r0, r2
- 800889e: 2000 moveq r0, #0
- 80088a0: 4770 bxeq lr
- 80088a2: f110 0f00 cmn.w r0, #0
- 80088a6: ea91 0f03 teq r1, r3
- 80088aa: bf58 it pl
- 80088ac: 4299 cmppl r1, r3
- 80088ae: bf08 it eq
- 80088b0: 4290 cmpeq r0, r2
- 80088b2: bf2c ite cs
- 80088b4: 17d8 asrcs r0, r3, #31
- 80088b6: ea6f 70e3 mvncc.w r0, r3, asr #31
- 80088ba: f040 0001 orr.w r0, r0, #1
- 80088be: 4770 bx lr
- 80088c0: ea4f 0c41 mov.w ip, r1, lsl #1
- 80088c4: ea7f 5c6c mvns.w ip, ip, asr #21
- 80088c8: d102 bne.n 80088d0 <__cmpdf2+0x64>
- 80088ca: ea50 3c01 orrs.w ip, r0, r1, lsl #12
- 80088ce: d107 bne.n 80088e0 <__cmpdf2+0x74>
- 80088d0: ea4f 0c43 mov.w ip, r3, lsl #1
- 80088d4: ea7f 5c6c mvns.w ip, ip, asr #21
- 80088d8: d1d6 bne.n 8008888 <__cmpdf2+0x1c>
- 80088da: ea52 3c03 orrs.w ip, r2, r3, lsl #12
- 80088de: d0d3 beq.n 8008888 <__cmpdf2+0x1c>
- 80088e0: f85d 0b04 ldr.w r0, [sp], #4
- 80088e4: 4770 bx lr
- 80088e6: bf00 nop
- 080088e8 <__aeabi_cdrcmple>:
- 80088e8: 4684 mov ip, r0
- 80088ea: 4610 mov r0, r2
- 80088ec: 4662 mov r2, ip
- 80088ee: 468c mov ip, r1
- 80088f0: 4619 mov r1, r3
- 80088f2: 4663 mov r3, ip
- 80088f4: e000 b.n 80088f8 <__aeabi_cdcmpeq>
- 80088f6: bf00 nop
- 080088f8 <__aeabi_cdcmpeq>:
- 80088f8: b501 push {r0, lr}
- 80088fa: f7ff ffb7 bl 800886c <__cmpdf2>
- 80088fe: 2800 cmp r0, #0
- 8008900: bf48 it mi
- 8008902: f110 0f00 cmnmi.w r0, #0
- 8008906: bd01 pop {r0, pc}
- 08008908 <__aeabi_dcmpeq>:
- 8008908: f84d ed08 str.w lr, [sp, #-8]!
- 800890c: f7ff fff4 bl 80088f8 <__aeabi_cdcmpeq>
- 8008910: bf0c ite eq
- 8008912: 2001 moveq r0, #1
- 8008914: 2000 movne r0, #0
- 8008916: f85d fb08 ldr.w pc, [sp], #8
- 800891a: bf00 nop
- 0800891c <__aeabi_dcmplt>:
- 800891c: f84d ed08 str.w lr, [sp, #-8]!
- 8008920: f7ff ffea bl 80088f8 <__aeabi_cdcmpeq>
- 8008924: bf34 ite cc
- 8008926: 2001 movcc r0, #1
- 8008928: 2000 movcs r0, #0
- 800892a: f85d fb08 ldr.w pc, [sp], #8
- 800892e: bf00 nop
- 08008930 <__aeabi_dcmple>:
- 8008930: f84d ed08 str.w lr, [sp, #-8]!
- 8008934: f7ff ffe0 bl 80088f8 <__aeabi_cdcmpeq>
- 8008938: bf94 ite ls
- 800893a: 2001 movls r0, #1
- 800893c: 2000 movhi r0, #0
- 800893e: f85d fb08 ldr.w pc, [sp], #8
- 8008942: bf00 nop
- 08008944 <__aeabi_dcmpge>:
- 8008944: f84d ed08 str.w lr, [sp, #-8]!
- 8008948: f7ff ffce bl 80088e8 <__aeabi_cdrcmple>
- 800894c: bf94 ite ls
- 800894e: 2001 movls r0, #1
- 8008950: 2000 movhi r0, #0
- 8008952: f85d fb08 ldr.w pc, [sp], #8
- 8008956: bf00 nop
- 08008958 <__aeabi_dcmpgt>:
- 8008958: f84d ed08 str.w lr, [sp, #-8]!
- 800895c: f7ff ffc4 bl 80088e8 <__aeabi_cdrcmple>
- 8008960: bf34 ite cc
- 8008962: 2001 movcc r0, #1
- 8008964: 2000 movcs r0, #0
- 8008966: f85d fb08 ldr.w pc, [sp], #8
- 800896a: bf00 nop
- 0800896c <__aeabi_d2iz>:
- 800896c: ea4f 0241 mov.w r2, r1, lsl #1
- 8008970: f512 1200 adds.w r2, r2, #2097152 ; 0x200000
- 8008974: d215 bcs.n 80089a2 <__aeabi_d2iz+0x36>
- 8008976: d511 bpl.n 800899c <__aeabi_d2iz+0x30>
- 8008978: f46f 7378 mvn.w r3, #992 ; 0x3e0
- 800897c: ebb3 5262 subs.w r2, r3, r2, asr #21
- 8008980: d912 bls.n 80089a8 <__aeabi_d2iz+0x3c>
- 8008982: ea4f 23c1 mov.w r3, r1, lsl #11
- 8008986: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
- 800898a: ea43 5350 orr.w r3, r3, r0, lsr #21
- 800898e: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
- 8008992: fa23 f002 lsr.w r0, r3, r2
- 8008996: bf18 it ne
- 8008998: 4240 negne r0, r0
- 800899a: 4770 bx lr
- 800899c: f04f 0000 mov.w r0, #0
- 80089a0: 4770 bx lr
- 80089a2: ea50 3001 orrs.w r0, r0, r1, lsl #12
- 80089a6: d105 bne.n 80089b4 <__aeabi_d2iz+0x48>
- 80089a8: f011 4000 ands.w r0, r1, #2147483648 ; 0x80000000
- 80089ac: bf08 it eq
- 80089ae: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
- 80089b2: 4770 bx lr
- 80089b4: f04f 0000 mov.w r0, #0
- 80089b8: 4770 bx lr
- 80089ba: bf00 nop
- 080089bc <__aeabi_uldivmod>:
- 80089bc: b94b cbnz r3, 80089d2 <__aeabi_uldivmod+0x16>
- 80089be: b942 cbnz r2, 80089d2 <__aeabi_uldivmod+0x16>
- 80089c0: 2900 cmp r1, #0
- 80089c2: bf08 it eq
- 80089c4: 2800 cmpeq r0, #0
- 80089c6: d002 beq.n 80089ce <__aeabi_uldivmod+0x12>
- 80089c8: f04f 31ff mov.w r1, #4294967295
- 80089cc: 4608 mov r0, r1
- 80089ce: f000 b83b b.w 8008a48 <__aeabi_idiv0>
- 80089d2: b082 sub sp, #8
- 80089d4: 46ec mov ip, sp
- 80089d6: e92d 5000 stmdb sp!, {ip, lr}
- 80089da: f000 f81d bl 8008a18 <__gnu_uldivmod_helper>
- 80089de: f8dd e004 ldr.w lr, [sp, #4]
- 80089e2: b002 add sp, #8
- 80089e4: bc0c pop {r2, r3}
- 80089e6: 4770 bx lr
- 080089e8 <__gnu_ldivmod_helper>:
- 80089e8: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
- 80089ec: 4690 mov r8, r2
- 80089ee: 4699 mov r9, r3
- 80089f0: 4606 mov r6, r0
- 80089f2: 460f mov r7, r1
- 80089f4: f000 f82a bl 8008a4c <__divdi3>
- 80089f8: 9b08 ldr r3, [sp, #32]
- 80089fa: fba8 4500 umull r4, r5, r8, r0
- 80089fe: fb08 f801 mul.w r8, r8, r1
- 8008a02: fb00 8209 mla r2, r0, r9, r8
- 8008a06: 1955 adds r5, r2, r5
- 8008a08: 1b34 subs r4, r6, r4
- 8008a0a: eb67 0505 sbc.w r5, r7, r5
- 8008a0e: e9c3 4500 strd r4, r5, [r3]
- 8008a12: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
- 8008a16: bf00 nop
- 08008a18 <__gnu_uldivmod_helper>:
- 8008a18: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- 8008a1c: 4690 mov r8, r2
- 8008a1e: 4606 mov r6, r0
- 8008a20: 460f mov r7, r1
- 8008a22: 461d mov r5, r3
- 8008a24: f000 f9c8 bl 8008db8 <__udivdi3>
- 8008a28: fb00 f305 mul.w r3, r0, r5
- 8008a2c: fba0 4508 umull r4, r5, r0, r8
- 8008a30: fb08 3801 mla r8, r8, r1, r3
- 8008a34: 9b06 ldr r3, [sp, #24]
- 8008a36: 4445 add r5, r8
- 8008a38: 1b34 subs r4, r6, r4
- 8008a3a: eb67 0505 sbc.w r5, r7, r5
- 8008a3e: e9c3 4500 strd r4, r5, [r3]
- 8008a42: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 8008a46: bf00 nop
- 08008a48 <__aeabi_idiv0>:
- 8008a48: 4770 bx lr
- 8008a4a: bf00 nop
- 08008a4c <__divdi3>:
- 8008a4c: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 8008a50: 2500 movs r5, #0
- 8008a52: 2900 cmp r1, #0
- 8008a54: b085 sub sp, #20
- 8008a56: 461c mov r4, r3
- 8008a58: f2c0 8149 blt.w 8008cee <__divdi3+0x2a2>
- 8008a5c: 2c00 cmp r4, #0
- 8008a5e: f2c0 8141 blt.w 8008ce4 <__divdi3+0x298>
- 8008a62: 468c mov ip, r1
- 8008a64: 460f mov r7, r1
- 8008a66: 4682 mov sl, r0
- 8008a68: 4691 mov r9, r2
- 8008a6a: 4614 mov r4, r2
- 8008a6c: 4606 mov r6, r0
- 8008a6e: 4619 mov r1, r3
- 8008a70: 2b00 cmp r3, #0
- 8008a72: d14b bne.n 8008b0c <__divdi3+0xc0>
- 8008a74: 4562 cmp r2, ip
- 8008a76: d959 bls.n 8008b2c <__divdi3+0xe0>
- 8008a78: fab2 f382 clz r3, r2
- 8008a7c: b143 cbz r3, 8008a90 <__divdi3+0x44>
- 8008a7e: f1c3 0220 rsb r2, r3, #32
- 8008a82: fa0c f703 lsl.w r7, ip, r3
- 8008a86: fa20 f202 lsr.w r2, r0, r2
- 8008a8a: 409c lsls r4, r3
- 8008a8c: 4317 orrs r7, r2
- 8008a8e: 409e lsls r6, r3
- 8008a90: ea4f 4814 mov.w r8, r4, lsr #16
- 8008a94: 4638 mov r0, r7
- 8008a96: 4641 mov r1, r8
- 8008a98: fa1f f984 uxth.w r9, r4
- 8008a9c: f000 fb18 bl 80090d0 <__aeabi_uidiv>
- 8008aa0: 4641 mov r1, r8
- 8008aa2: 4682 mov sl, r0
- 8008aa4: 4638 mov r0, r7
- 8008aa6: f000 fc41 bl 800932c <__aeabi_uidivmod>
- 8008aaa: 0c33 lsrs r3, r6, #16
- 8008aac: fb09 f00a mul.w r0, r9, sl
- 8008ab0: ea43 4101 orr.w r1, r3, r1, lsl #16
- 8008ab4: 4288 cmp r0, r1
- 8008ab6: d90a bls.n 8008ace <__divdi3+0x82>
- 8008ab8: 1909 adds r1, r1, r4
- 8008aba: f10a 32ff add.w r2, sl, #4294967295
- 8008abe: d205 bcs.n 8008acc <__divdi3+0x80>
- 8008ac0: 4288 cmp r0, r1
- 8008ac2: bf84 itt hi
- 8008ac4: f1aa 0a02 subhi.w sl, sl, #2
- 8008ac8: 1909 addhi r1, r1, r4
- 8008aca: d800 bhi.n 8008ace <__divdi3+0x82>
- 8008acc: 4692 mov sl, r2
- 8008ace: ebc0 0b01 rsb fp, r0, r1
- 8008ad2: 4641 mov r1, r8
- 8008ad4: 4658 mov r0, fp
- 8008ad6: b2b6 uxth r6, r6
- 8008ad8: f000 fafa bl 80090d0 <__aeabi_uidiv>
- 8008adc: 4641 mov r1, r8
- 8008ade: 4607 mov r7, r0
- 8008ae0: 4658 mov r0, fp
- 8008ae2: f000 fc23 bl 800932c <__aeabi_uidivmod>
- 8008ae6: fb09 f907 mul.w r9, r9, r7
- 8008aea: ea46 4101 orr.w r1, r6, r1, lsl #16
- 8008aee: 4589 cmp r9, r1
- 8008af0: d907 bls.n 8008b02 <__divdi3+0xb6>
- 8008af2: 1e7b subs r3, r7, #1
- 8008af4: 190c adds r4, r1, r4
- 8008af6: f080 8157 bcs.w 8008da8 <__divdi3+0x35c>
- 8008afa: 3f02 subs r7, #2
- 8008afc: 45a1 cmp r9, r4
- 8008afe: f240 8153 bls.w 8008da8 <__divdi3+0x35c>
- 8008b02: ea47 400a orr.w r0, r7, sl, lsl #16
- 8008b06: f04f 0800 mov.w r8, #0
- 8008b0a: e004 b.n 8008b16 <__divdi3+0xca>
- 8008b0c: 4563 cmp r3, ip
- 8008b0e: d958 bls.n 8008bc2 <__divdi3+0x176>
- 8008b10: f04f 0800 mov.w r8, #0
- 8008b14: 4640 mov r0, r8
- 8008b16: 4602 mov r2, r0
- 8008b18: 4643 mov r3, r8
- 8008b1a: b115 cbz r5, 8008b22 <__divdi3+0xd6>
- 8008b1c: 4252 negs r2, r2
- 8008b1e: eb63 0343 sbc.w r3, r3, r3, lsl #1
- 8008b22: 4610 mov r0, r2
- 8008b24: 4619 mov r1, r3
- 8008b26: b005 add sp, #20
- 8008b28: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 8008b2c: b922 cbnz r2, 8008b38 <__divdi3+0xec>
- 8008b2e: 2001 movs r0, #1
- 8008b30: 4611 mov r1, r2
- 8008b32: f000 facd bl 80090d0 <__aeabi_uidiv>
- 8008b36: 4604 mov r4, r0
- 8008b38: fab4 f384 clz r3, r4
- 8008b3c: 2b00 cmp r3, #0
- 8008b3e: f040 80dc bne.w 8008cfa <__divdi3+0x2ae>
- 8008b42: 1b3f subs r7, r7, r4
- 8008b44: ea4f 4914 mov.w r9, r4, lsr #16
- 8008b48: fa1f fa84 uxth.w sl, r4
- 8008b4c: f04f 0801 mov.w r8, #1
- 8008b50: 4649 mov r1, r9
- 8008b52: 4638 mov r0, r7
- 8008b54: f000 fabc bl 80090d0 <__aeabi_uidiv>
- 8008b58: 4649 mov r1, r9
- 8008b5a: 4683 mov fp, r0
- 8008b5c: 4638 mov r0, r7
- 8008b5e: f000 fbe5 bl 800932c <__aeabi_uidivmod>
- 8008b62: 0c33 lsrs r3, r6, #16
- 8008b64: fb0a f00b mul.w r0, sl, fp
- 8008b68: ea43 4101 orr.w r1, r3, r1, lsl #16
- 8008b6c: 4288 cmp r0, r1
- 8008b6e: d90b bls.n 8008b88 <__divdi3+0x13c>
- 8008b70: 1909 adds r1, r1, r4
- 8008b72: f10b 33ff add.w r3, fp, #4294967295
- 8008b76: f080 8115 bcs.w 8008da4 <__divdi3+0x358>
- 8008b7a: 4288 cmp r0, r1
- 8008b7c: bf84 itt hi
- 8008b7e: f1ab 0b02 subhi.w fp, fp, #2
- 8008b82: 1909 addhi r1, r1, r4
- 8008b84: f240 810e bls.w 8008da4 <__divdi3+0x358>
- 8008b88: 1a0b subs r3, r1, r0
- 8008b8a: 4649 mov r1, r9
- 8008b8c: 4618 mov r0, r3
- 8008b8e: 9301 str r3, [sp, #4]
- 8008b90: f000 fa9e bl 80090d0 <__aeabi_uidiv>
- 8008b94: 9b01 ldr r3, [sp, #4]
- 8008b96: 4649 mov r1, r9
- 8008b98: b2b6 uxth r6, r6
- 8008b9a: 4607 mov r7, r0
- 8008b9c: 4618 mov r0, r3
- 8008b9e: f000 fbc5 bl 800932c <__aeabi_uidivmod>
- 8008ba2: fb0a fa07 mul.w sl, sl, r7
- 8008ba6: ea46 4101 orr.w r1, r6, r1, lsl #16
- 8008baa: 458a cmp sl, r1
- 8008bac: d906 bls.n 8008bbc <__divdi3+0x170>
- 8008bae: 1e7b subs r3, r7, #1
- 8008bb0: 190c adds r4, r1, r4
- 8008bb2: d202 bcs.n 8008bba <__divdi3+0x16e>
- 8008bb4: 3f02 subs r7, #2
- 8008bb6: 45a2 cmp sl, r4
- 8008bb8: d800 bhi.n 8008bbc <__divdi3+0x170>
- 8008bba: 461f mov r7, r3
- 8008bbc: ea47 400b orr.w r0, r7, fp, lsl #16
- 8008bc0: e7a9 b.n 8008b16 <__divdi3+0xca>
- 8008bc2: fab3 f483 clz r4, r3
- 8008bc6: 2c00 cmp r4, #0
- 8008bc8: f000 80e4 beq.w 8008d94 <__divdi3+0x348>
- 8008bcc: f1c4 0320 rsb r3, r4, #32
- 8008bd0: fa01 f104 lsl.w r1, r1, r4
- 8008bd4: fa22 fa03 lsr.w sl, r2, r3
- 8008bd8: fa2c fb03 lsr.w fp, ip, r3
- 8008bdc: ea4a 0a01 orr.w sl, sl, r1
- 8008be0: fa20 f803 lsr.w r8, r0, r3
- 8008be4: fa0c fc04 lsl.w ip, ip, r4
- 8008be8: 4658 mov r0, fp
- 8008bea: ea4f 471a mov.w r7, sl, lsr #16
- 8008bee: ea48 080c orr.w r8, r8, ip
- 8008bf2: 4639 mov r1, r7
- 8008bf4: fa02 f904 lsl.w r9, r2, r4
- 8008bf8: f8cd 900c str.w r9, [sp, #12]
- 8008bfc: f000 fa68 bl 80090d0 <__aeabi_uidiv>
- 8008c00: 4639 mov r1, r7
- 8008c02: 4681 mov r9, r0
- 8008c04: 4658 mov r0, fp
- 8008c06: f000 fb91 bl 800932c <__aeabi_uidivmod>
- 8008c0a: fa1f fc8a uxth.w ip, sl
- 8008c0e: ea4f 4318 mov.w r3, r8, lsr #16
- 8008c12: fb0c f009 mul.w r0, ip, r9
- 8008c16: ea43 4301 orr.w r3, r3, r1, lsl #16
- 8008c1a: 4298 cmp r0, r3
- 8008c1c: d90c bls.n 8008c38 <__divdi3+0x1ec>
- 8008c1e: eb13 030a adds.w r3, r3, sl
- 8008c22: f109 31ff add.w r1, r9, #4294967295
- 8008c26: f080 80c3 bcs.w 8008db0 <__divdi3+0x364>
- 8008c2a: 4298 cmp r0, r3
- 8008c2c: bf84 itt hi
- 8008c2e: f1a9 0902 subhi.w r9, r9, #2
- 8008c32: 4453 addhi r3, sl
- 8008c34: f240 80bc bls.w 8008db0 <__divdi3+0x364>
- 8008c38: 1a1b subs r3, r3, r0
- 8008c3a: 4639 mov r1, r7
- 8008c3c: 4618 mov r0, r3
- 8008c3e: f8cd c008 str.w ip, [sp, #8]
- 8008c42: 9301 str r3, [sp, #4]
- 8008c44: f000 fa44 bl 80090d0 <__aeabi_uidiv>
- 8008c48: 9b01 ldr r3, [sp, #4]
- 8008c4a: 4639 mov r1, r7
- 8008c4c: fa1f f888 uxth.w r8, r8
- 8008c50: 4683 mov fp, r0
- 8008c52: 4618 mov r0, r3
- 8008c54: f000 fb6a bl 800932c <__aeabi_uidivmod>
- 8008c58: f8dd c008 ldr.w ip, [sp, #8]
- 8008c5c: fb0c f30b mul.w r3, ip, fp
- 8008c60: ea48 4101 orr.w r1, r8, r1, lsl #16
- 8008c64: 428b cmp r3, r1
- 8008c66: d90c bls.n 8008c82 <__divdi3+0x236>
- 8008c68: eb11 010a adds.w r1, r1, sl
- 8008c6c: f10b 30ff add.w r0, fp, #4294967295
- 8008c70: f080 809c bcs.w 8008dac <__divdi3+0x360>
- 8008c74: 428b cmp r3, r1
- 8008c76: bf84 itt hi
- 8008c78: f1ab 0b02 subhi.w fp, fp, #2
- 8008c7c: 4451 addhi r1, sl
- 8008c7e: f240 8095 bls.w 8008dac <__divdi3+0x360>
- 8008c82: 9f03 ldr r7, [sp, #12]
- 8008c84: ea4b 4009 orr.w r0, fp, r9, lsl #16
- 8008c88: 1ac9 subs r1, r1, r3
- 8008c8a: fa1f fc80 uxth.w ip, r0
- 8008c8e: b2ba uxth r2, r7
- 8008c90: ea4f 4917 mov.w r9, r7, lsr #16
- 8008c94: 0c07 lsrs r7, r0, #16
- 8008c96: fb02 f80c mul.w r8, r2, ip
- 8008c9a: fb02 f207 mul.w r2, r2, r7
- 8008c9e: fb09 230c mla r3, r9, ip, r2
- 8008ca2: fb09 f907 mul.w r9, r9, r7
- 8008ca6: eb03 4318 add.w r3, r3, r8, lsr #16
- 8008caa: 429a cmp r2, r3
- 8008cac: bf88 it hi
- 8008cae: f509 3980 addhi.w r9, r9, #65536 ; 0x10000
- 8008cb2: eb09 4913 add.w r9, r9, r3, lsr #16
- 8008cb6: 4549 cmp r1, r9
- 8008cb8: d310 bcc.n 8008cdc <__divdi3+0x290>
- 8008cba: fa1f f888 uxth.w r8, r8
- 8008cbe: bf14 ite ne
- 8008cc0: 2200 movne r2, #0
- 8008cc2: 2201 moveq r2, #1
- 8008cc4: fa06 f404 lsl.w r4, r6, r4
- 8008cc8: eb08 4303 add.w r3, r8, r3, lsl #16
- 8008ccc: 429c cmp r4, r3
- 8008cce: bf2c ite cs
- 8008cd0: 2300 movcs r3, #0
- 8008cd2: f002 0301 andcc.w r3, r2, #1
- 8008cd6: 2b00 cmp r3, #0
- 8008cd8: f43f af15 beq.w 8008b06 <__divdi3+0xba>
- 8008cdc: 3801 subs r0, #1
- 8008cde: f04f 0800 mov.w r8, #0
- 8008ce2: e718 b.n 8008b16 <__divdi3+0xca>
- 8008ce4: 4252 negs r2, r2
- 8008ce6: eb63 0343 sbc.w r3, r3, r3, lsl #1
- 8008cea: 43ed mvns r5, r5
- 8008cec: e6b9 b.n 8008a62 <__divdi3+0x16>
- 8008cee: 4240 negs r0, r0
- 8008cf0: eb61 0141 sbc.w r1, r1, r1, lsl #1
- 8008cf4: f04f 35ff mov.w r5, #4294967295
- 8008cf8: e6b0 b.n 8008a5c <__divdi3+0x10>
- 8008cfa: 409c lsls r4, r3
- 8008cfc: f1c3 0b20 rsb fp, r3, #32
- 8008d00: fa27 f80b lsr.w r8, r7, fp
- 8008d04: fa07 f703 lsl.w r7, r7, r3
- 8008d08: ea4f 4914 mov.w r9, r4, lsr #16
- 8008d0c: 4640 mov r0, r8
- 8008d0e: 4649 mov r1, r9
- 8008d10: fa26 fb0b lsr.w fp, r6, fp
- 8008d14: 409e lsls r6, r3
- 8008d16: f000 f9db bl 80090d0 <__aeabi_uidiv>
- 8008d1a: 4649 mov r1, r9
- 8008d1c: fa1f fa84 uxth.w sl, r4
- 8008d20: ea4b 0b07 orr.w fp, fp, r7
- 8008d24: 4603 mov r3, r0
- 8008d26: 4640 mov r0, r8
- 8008d28: 9301 str r3, [sp, #4]
- 8008d2a: f000 faff bl 800932c <__aeabi_uidivmod>
- 8008d2e: 9b01 ldr r3, [sp, #4]
- 8008d30: ea4f 421b mov.w r2, fp, lsr #16
- 8008d34: fb0a f003 mul.w r0, sl, r3
- 8008d38: ea42 4101 orr.w r1, r2, r1, lsl #16
- 8008d3c: 4288 cmp r0, r1
- 8008d3e: d906 bls.n 8008d4e <__divdi3+0x302>
- 8008d40: 1e5a subs r2, r3, #1
- 8008d42: 1909 adds r1, r1, r4
- 8008d44: d236 bcs.n 8008db4 <__divdi3+0x368>
- 8008d46: 4288 cmp r0, r1
- 8008d48: d934 bls.n 8008db4 <__divdi3+0x368>
- 8008d4a: 3b02 subs r3, #2
- 8008d4c: 1909 adds r1, r1, r4
- 8008d4e: 1a0f subs r7, r1, r0
- 8008d50: 4649 mov r1, r9
- 8008d52: 4638 mov r0, r7
- 8008d54: 9301 str r3, [sp, #4]
- 8008d56: f000 f9bb bl 80090d0 <__aeabi_uidiv>
- 8008d5a: 4649 mov r1, r9
- 8008d5c: fa1f fb8b uxth.w fp, fp
- 8008d60: 4680 mov r8, r0
- 8008d62: 4638 mov r0, r7
- 8008d64: f000 fae2 bl 800932c <__aeabi_uidivmod>
- 8008d68: 9b01 ldr r3, [sp, #4]
- 8008d6a: fb0a f708 mul.w r7, sl, r8
- 8008d6e: ea4b 4101 orr.w r1, fp, r1, lsl #16
- 8008d72: 428f cmp r7, r1
- 8008d74: d90a bls.n 8008d8c <__divdi3+0x340>
- 8008d76: 1909 adds r1, r1, r4
- 8008d78: f108 32ff add.w r2, r8, #4294967295
- 8008d7c: d205 bcs.n 8008d8a <__divdi3+0x33e>
- 8008d7e: 428f cmp r7, r1
- 8008d80: bf84 itt hi
- 8008d82: f1a8 0802 subhi.w r8, r8, #2
- 8008d86: 1909 addhi r1, r1, r4
- 8008d88: d800 bhi.n 8008d8c <__divdi3+0x340>
- 8008d8a: 4690 mov r8, r2
- 8008d8c: 1bcf subs r7, r1, r7
- 8008d8e: ea48 4803 orr.w r8, r8, r3, lsl #16
- 8008d92: e6dd b.n 8008b50 <__divdi3+0x104>
- 8008d94: 2001 movs r0, #1
- 8008d96: 4563 cmp r3, ip
- 8008d98: bf28 it cs
- 8008d9a: 4552 cmpcs r2, sl
- 8008d9c: 46a0 mov r8, r4
- 8008d9e: f67f aeba bls.w 8008b16 <__divdi3+0xca>
- 8008da2: e6b5 b.n 8008b10 <__divdi3+0xc4>
- 8008da4: 469b mov fp, r3
- 8008da6: e6ef b.n 8008b88 <__divdi3+0x13c>
- 8008da8: 461f mov r7, r3
- 8008daa: e6aa b.n 8008b02 <__divdi3+0xb6>
- 8008dac: 4683 mov fp, r0
- 8008dae: e768 b.n 8008c82 <__divdi3+0x236>
- 8008db0: 4689 mov r9, r1
- 8008db2: e741 b.n 8008c38 <__divdi3+0x1ec>
- 8008db4: 4613 mov r3, r2
- 8008db6: e7ca b.n 8008d4e <__divdi3+0x302>
- 08008db8 <__udivdi3>:
- 8008db8: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 8008dbc: 4606 mov r6, r0
- 8008dbe: b083 sub sp, #12
- 8008dc0: 460d mov r5, r1
- 8008dc2: 4614 mov r4, r2
- 8008dc4: 4607 mov r7, r0
- 8008dc6: 4688 mov r8, r1
- 8008dc8: 2b00 cmp r3, #0
- 8008dca: d14a bne.n 8008e62 <__udivdi3+0xaa>
- 8008dcc: 428a cmp r2, r1
- 8008dce: d955 bls.n 8008e7c <__udivdi3+0xc4>
- 8008dd0: fab2 f382 clz r3, r2
- 8008dd4: b14b cbz r3, 8008dea <__udivdi3+0x32>
- 8008dd6: f1c3 0220 rsb r2, r3, #32
- 8008dda: fa01 f803 lsl.w r8, r1, r3
- 8008dde: fa20 f202 lsr.w r2, r0, r2
- 8008de2: 409c lsls r4, r3
- 8008de4: ea42 0808 orr.w r8, r2, r8
- 8008de8: 409f lsls r7, r3
- 8008dea: 0c25 lsrs r5, r4, #16
- 8008dec: 4640 mov r0, r8
- 8008dee: 4629 mov r1, r5
- 8008df0: fa1f fa84 uxth.w sl, r4
- 8008df4: f000 f96c bl 80090d0 <__aeabi_uidiv>
- 8008df8: 4629 mov r1, r5
- 8008dfa: 4681 mov r9, r0
- 8008dfc: 4640 mov r0, r8
- 8008dfe: f000 fa95 bl 800932c <__aeabi_uidivmod>
- 8008e02: 0c3b lsrs r3, r7, #16
- 8008e04: fb0a f009 mul.w r0, sl, r9
- 8008e08: ea43 4101 orr.w r1, r3, r1, lsl #16
- 8008e0c: 4288 cmp r0, r1
- 8008e0e: d90a bls.n 8008e26 <__udivdi3+0x6e>
- 8008e10: 1909 adds r1, r1, r4
- 8008e12: f109 32ff add.w r2, r9, #4294967295
- 8008e16: d205 bcs.n 8008e24 <__udivdi3+0x6c>
- 8008e18: 4288 cmp r0, r1
- 8008e1a: bf84 itt hi
- 8008e1c: f1a9 0902 subhi.w r9, r9, #2
- 8008e20: 1909 addhi r1, r1, r4
- 8008e22: d800 bhi.n 8008e26 <__udivdi3+0x6e>
- 8008e24: 4691 mov r9, r2
- 8008e26: ebc0 0801 rsb r8, r0, r1
- 8008e2a: 4629 mov r1, r5
- 8008e2c: 4640 mov r0, r8
- 8008e2e: b2bf uxth r7, r7
- 8008e30: f000 f94e bl 80090d0 <__aeabi_uidiv>
- 8008e34: 4629 mov r1, r5
- 8008e36: 4606 mov r6, r0
- 8008e38: 4640 mov r0, r8
- 8008e3a: f000 fa77 bl 800932c <__aeabi_uidivmod>
- 8008e3e: fb0a fa06 mul.w sl, sl, r6
- 8008e42: ea47 4101 orr.w r1, r7, r1, lsl #16
- 8008e46: 458a cmp sl, r1
- 8008e48: d907 bls.n 8008e5a <__udivdi3+0xa2>
- 8008e4a: 1e73 subs r3, r6, #1
- 8008e4c: 190c adds r4, r1, r4
- 8008e4e: f080 8122 bcs.w 8009096 <__udivdi3+0x2de>
- 8008e52: 3e02 subs r6, #2
- 8008e54: 45a2 cmp sl, r4
- 8008e56: f240 811e bls.w 8009096 <__udivdi3+0x2de>
- 8008e5a: ea46 4009 orr.w r0, r6, r9, lsl #16
- 8008e5e: 2600 movs r6, #0
- 8008e60: e058 b.n 8008f14 <__udivdi3+0x15c>
- 8008e62: 428b cmp r3, r1
- 8008e64: d854 bhi.n 8008f10 <__udivdi3+0x158>
- 8008e66: fab3 f483 clz r4, r3
- 8008e6a: 2c00 cmp r4, #0
- 8008e6c: d156 bne.n 8008f1c <__udivdi3+0x164>
- 8008e6e: 428b cmp r3, r1
- 8008e70: bf28 it cs
- 8008e72: 4282 cmpcs r2, r0
- 8008e74: d84c bhi.n 8008f10 <__udivdi3+0x158>
- 8008e76: 4626 mov r6, r4
- 8008e78: 2001 movs r0, #1
- 8008e7a: e04b b.n 8008f14 <__udivdi3+0x15c>
- 8008e7c: b922 cbnz r2, 8008e88 <__udivdi3+0xd0>
- 8008e7e: 2001 movs r0, #1
- 8008e80: 4611 mov r1, r2
- 8008e82: f000 f925 bl 80090d0 <__aeabi_uidiv>
- 8008e86: 4604 mov r4, r0
- 8008e88: fab4 f384 clz r3, r4
- 8008e8c: 2b00 cmp r3, #0
- 8008e8e: f040 80b9 bne.w 8009004 <__udivdi3+0x24c>
- 8008e92: 1b2d subs r5, r5, r4
- 8008e94: ea4f 4814 mov.w r8, r4, lsr #16
- 8008e98: fa1f fa84 uxth.w sl, r4
- 8008e9c: 2601 movs r6, #1
- 8008e9e: 4641 mov r1, r8
- 8008ea0: 4628 mov r0, r5
- 8008ea2: f000 f915 bl 80090d0 <__aeabi_uidiv>
- 8008ea6: 4641 mov r1, r8
- 8008ea8: 4681 mov r9, r0
- 8008eaa: 4628 mov r0, r5
- 8008eac: f000 fa3e bl 800932c <__aeabi_uidivmod>
- 8008eb0: 0c3b lsrs r3, r7, #16
- 8008eb2: fb0a f009 mul.w r0, sl, r9
- 8008eb6: ea43 4101 orr.w r1, r3, r1, lsl #16
- 8008eba: 4288 cmp r0, r1
- 8008ebc: d90b bls.n 8008ed6 <__udivdi3+0x11e>
- 8008ebe: 1909 adds r1, r1, r4
- 8008ec0: f109 33ff add.w r3, r9, #4294967295
- 8008ec4: f080 80e9 bcs.w 800909a <__udivdi3+0x2e2>
- 8008ec8: 4288 cmp r0, r1
- 8008eca: bf84 itt hi
- 8008ecc: f1a9 0902 subhi.w r9, r9, #2
- 8008ed0: 1909 addhi r1, r1, r4
- 8008ed2: f240 80e2 bls.w 800909a <__udivdi3+0x2e2>
- 8008ed6: ebc0 0b01 rsb fp, r0, r1
- 8008eda: 4641 mov r1, r8
- 8008edc: 4658 mov r0, fp
- 8008ede: b2bf uxth r7, r7
- 8008ee0: f000 f8f6 bl 80090d0 <__aeabi_uidiv>
- 8008ee4: 4641 mov r1, r8
- 8008ee6: 4605 mov r5, r0
- 8008ee8: 4658 mov r0, fp
- 8008eea: f000 fa1f bl 800932c <__aeabi_uidivmod>
- 8008eee: fb0a fa05 mul.w sl, sl, r5
- 8008ef2: ea47 4101 orr.w r1, r7, r1, lsl #16
- 8008ef6: 458a cmp sl, r1
- 8008ef8: d907 bls.n 8008f0a <__udivdi3+0x152>
- 8008efa: 1e6b subs r3, r5, #1
- 8008efc: 190c adds r4, r1, r4
- 8008efe: f080 80ce bcs.w 800909e <__udivdi3+0x2e6>
- 8008f02: 3d02 subs r5, #2
- 8008f04: 45a2 cmp sl, r4
- 8008f06: f240 80ca bls.w 800909e <__udivdi3+0x2e6>
- 8008f0a: ea45 4009 orr.w r0, r5, r9, lsl #16
- 8008f0e: e001 b.n 8008f14 <__udivdi3+0x15c>
- 8008f10: 2600 movs r6, #0
- 8008f12: 4630 mov r0, r6
- 8008f14: 4631 mov r1, r6
- 8008f16: b003 add sp, #12
- 8008f18: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 8008f1c: f1c4 0120 rsb r1, r4, #32
- 8008f20: fa03 f304 lsl.w r3, r3, r4
- 8008f24: fa22 f801 lsr.w r8, r2, r1
- 8008f28: fa25 f701 lsr.w r7, r5, r1
- 8008f2c: ea48 0803 orr.w r8, r8, r3
- 8008f30: fa20 f101 lsr.w r1, r0, r1
- 8008f34: fa05 f504 lsl.w r5, r5, r4
- 8008f38: 4638 mov r0, r7
- 8008f3a: ea4f 4918 mov.w r9, r8, lsr #16
- 8008f3e: 430d orrs r5, r1
- 8008f40: 4649 mov r1, r9
- 8008f42: fa02 f204 lsl.w r2, r2, r4
- 8008f46: 9201 str r2, [sp, #4]
- 8008f48: f000 f8c2 bl 80090d0 <__aeabi_uidiv>
- 8008f4c: 4649 mov r1, r9
- 8008f4e: 4682 mov sl, r0
- 8008f50: 4638 mov r0, r7
- 8008f52: f000 f9eb bl 800932c <__aeabi_uidivmod>
- 8008f56: fa1f f288 uxth.w r2, r8
- 8008f5a: 0c2f lsrs r7, r5, #16
- 8008f5c: fb02 f00a mul.w r0, r2, sl
- 8008f60: ea47 4701 orr.w r7, r7, r1, lsl #16
- 8008f64: 42b8 cmp r0, r7
- 8008f66: d906 bls.n 8008f76 <__udivdi3+0x1be>
- 8008f68: eb17 0708 adds.w r7, r7, r8
- 8008f6c: f10a 31ff add.w r1, sl, #4294967295
- 8008f70: f0c0 809f bcc.w 80090b2 <__udivdi3+0x2fa>
- 8008f74: 468a mov sl, r1
- 8008f76: 1a3f subs r7, r7, r0
- 8008f78: 4649 mov r1, r9
- 8008f7a: 4638 mov r0, r7
- 8008f7c: 9200 str r2, [sp, #0]
- 8008f7e: f000 f8a7 bl 80090d0 <__aeabi_uidiv>
- 8008f82: 4649 mov r1, r9
- 8008f84: b2ad uxth r5, r5
- 8008f86: 4683 mov fp, r0
- 8008f88: 4638 mov r0, r7
- 8008f8a: f000 f9cf bl 800932c <__aeabi_uidivmod>
- 8008f8e: 9a00 ldr r2, [sp, #0]
- 8008f90: fb02 f70b mul.w r7, r2, fp
- 8008f94: ea45 4101 orr.w r1, r5, r1, lsl #16
- 8008f98: 428f cmp r7, r1
- 8008f9a: d905 bls.n 8008fa8 <__udivdi3+0x1f0>
- 8008f9c: eb11 0108 adds.w r1, r1, r8
- 8008fa0: f10b 32ff add.w r2, fp, #4294967295
- 8008fa4: d37d bcc.n 80090a2 <__udivdi3+0x2ea>
- 8008fa6: 4693 mov fp, r2
- 8008fa8: 9b01 ldr r3, [sp, #4]
- 8008faa: ea4b 400a orr.w r0, fp, sl, lsl #16
- 8008fae: 1bc9 subs r1, r1, r7
- 8008fb0: ea4f 4c10 mov.w ip, r0, lsr #16
- 8008fb4: b29d uxth r5, r3
- 8008fb6: ea4f 4a13 mov.w sl, r3, lsr #16
- 8008fba: b283 uxth r3, r0
- 8008fbc: fb05 f203 mul.w r2, r5, r3
- 8008fc0: fb05 f50c mul.w r5, r5, ip
- 8008fc4: fb0a 5303 mla r3, sl, r3, r5
- 8008fc8: fb0a fa0c mul.w sl, sl, ip
- 8008fcc: eb03 4312 add.w r3, r3, r2, lsr #16
- 8008fd0: 429d cmp r5, r3
- 8008fd2: bf88 it hi
- 8008fd4: f50a 3a80 addhi.w sl, sl, #65536 ; 0x10000
- 8008fd8: eb0a 4a13 add.w sl, sl, r3, lsr #16
- 8008fdc: 4551 cmp r1, sl
- 8008fde: d30e bcc.n 8008ffe <__udivdi3+0x246>
- 8008fe0: b292 uxth r2, r2
- 8008fe2: bf14 ite ne
- 8008fe4: 2100 movne r1, #0
- 8008fe6: 2101 moveq r1, #1
- 8008fe8: fa06 f604 lsl.w r6, r6, r4
- 8008fec: eb02 4303 add.w r3, r2, r3, lsl #16
- 8008ff0: 429e cmp r6, r3
- 8008ff2: bf2c ite cs
- 8008ff4: 2600 movcs r6, #0
- 8008ff6: f001 0601 andcc.w r6, r1, #1
- 8008ffa: 2e00 cmp r6, #0
- 8008ffc: d08a beq.n 8008f14 <__udivdi3+0x15c>
- 8008ffe: 3801 subs r0, #1
- 8009000: 2600 movs r6, #0
- 8009002: e787 b.n 8008f14 <__udivdi3+0x15c>
- 8009004: 409c lsls r4, r3
- 8009006: f1c3 0220 rsb r2, r3, #32
- 800900a: fa25 fa02 lsr.w sl, r5, r2
- 800900e: fa26 f902 lsr.w r9, r6, r2
- 8009012: ea4f 4814 mov.w r8, r4, lsr #16
- 8009016: 4650 mov r0, sl
- 8009018: 4641 mov r1, r8
- 800901a: fa05 f503 lsl.w r5, r5, r3
- 800901e: fa06 f703 lsl.w r7, r6, r3
- 8009022: f000 f855 bl 80090d0 <__aeabi_uidiv>
- 8009026: 4641 mov r1, r8
- 8009028: ea49 0905 orr.w r9, r9, r5
- 800902c: 4683 mov fp, r0
- 800902e: 4650 mov r0, sl
- 8009030: f000 f97c bl 800932c <__aeabi_uidivmod>
- 8009034: fa1f fa84 uxth.w sl, r4
- 8009038: ea4f 4319 mov.w r3, r9, lsr #16
- 800903c: fb0a f00b mul.w r0, sl, fp
- 8009040: ea43 4101 orr.w r1, r3, r1, lsl #16
- 8009044: 4288 cmp r0, r1
- 8009046: d909 bls.n 800905c <__udivdi3+0x2a4>
- 8009048: 1909 adds r1, r1, r4
- 800904a: f10b 33ff add.w r3, fp, #4294967295
- 800904e: d238 bcs.n 80090c2 <__udivdi3+0x30a>
- 8009050: 4288 cmp r0, r1
- 8009052: bf84 itt hi
- 8009054: f1ab 0b02 subhi.w fp, fp, #2
- 8009058: 1909 addhi r1, r1, r4
- 800905a: d932 bls.n 80090c2 <__udivdi3+0x30a>
- 800905c: 1a0d subs r5, r1, r0
- 800905e: 4641 mov r1, r8
- 8009060: 4628 mov r0, r5
- 8009062: fa1f f989 uxth.w r9, r9
- 8009066: f000 f833 bl 80090d0 <__aeabi_uidiv>
- 800906a: 4641 mov r1, r8
- 800906c: 4606 mov r6, r0
- 800906e: 4628 mov r0, r5
- 8009070: f000 f95c bl 800932c <__aeabi_uidivmod>
- 8009074: fb0a f506 mul.w r5, sl, r6
- 8009078: ea49 4101 orr.w r1, r9, r1, lsl #16
- 800907c: 428d cmp r5, r1
- 800907e: d906 bls.n 800908e <__udivdi3+0x2d6>
- 8009080: 1e73 subs r3, r6, #1
- 8009082: 1909 adds r1, r1, r4
- 8009084: d21f bcs.n 80090c6 <__udivdi3+0x30e>
- 8009086: 428d cmp r5, r1
- 8009088: d91d bls.n 80090c6 <__udivdi3+0x30e>
- 800908a: 3e02 subs r6, #2
- 800908c: 1909 adds r1, r1, r4
- 800908e: 1b4d subs r5, r1, r5
- 8009090: ea46 460b orr.w r6, r6, fp, lsl #16
- 8009094: e703 b.n 8008e9e <__udivdi3+0xe6>
- 8009096: 461e mov r6, r3
- 8009098: e6df b.n 8008e5a <__udivdi3+0xa2>
- 800909a: 4699 mov r9, r3
- 800909c: e71b b.n 8008ed6 <__udivdi3+0x11e>
- 800909e: 461d mov r5, r3
- 80090a0: e733 b.n 8008f0a <__udivdi3+0x152>
- 80090a2: 428f cmp r7, r1
- 80090a4: bf84 itt hi
- 80090a6: f1ab 0b02 subhi.w fp, fp, #2
- 80090aa: 4441 addhi r1, r8
- 80090ac: f63f af7c bhi.w 8008fa8 <__udivdi3+0x1f0>
- 80090b0: e779 b.n 8008fa6 <__udivdi3+0x1ee>
- 80090b2: 42b8 cmp r0, r7
- 80090b4: bf84 itt hi
- 80090b6: f1aa 0a02 subhi.w sl, sl, #2
- 80090ba: 4447 addhi r7, r8
- 80090bc: f63f af5b bhi.w 8008f76 <__udivdi3+0x1be>
- 80090c0: e758 b.n 8008f74 <__udivdi3+0x1bc>
- 80090c2: 469b mov fp, r3
- 80090c4: e7ca b.n 800905c <__udivdi3+0x2a4>
- 80090c6: 461e mov r6, r3
- 80090c8: e7e1 b.n 800908e <__udivdi3+0x2d6>
- 80090ca: bf00 nop
- 80090cc: 0000 movs r0, r0
- 80090ce: 0000 movs r0, r0
- 080090d0 <__aeabi_uidiv>:
- 80090d0: 1e4a subs r2, r1, #1
- 80090d2: bf08 it eq
- 80090d4: 4770 bxeq lr
- 80090d6: f0c0 8124 bcc.w 8009322 <__aeabi_uidiv+0x252>
- 80090da: 4288 cmp r0, r1
- 80090dc: f240 8116 bls.w 800930c <__aeabi_uidiv+0x23c>
- 80090e0: 4211 tst r1, r2
- 80090e2: f000 8117 beq.w 8009314 <__aeabi_uidiv+0x244>
- 80090e6: fab0 f380 clz r3, r0
- 80090ea: fab1 f281 clz r2, r1
- 80090ee: eba2 0303 sub.w r3, r2, r3
- 80090f2: f1c3 031f rsb r3, r3, #31
- 80090f6: a204 add r2, pc, #16 ; (adr r2, 8009108 <__aeabi_uidiv+0x38>)
- 80090f8: eb02 1303 add.w r3, r2, r3, lsl #4
- 80090fc: f04f 0200 mov.w r2, #0
- 8009100: 469f mov pc, r3
- 8009102: bf00 nop
- 8009104: f3af 8000 nop.w
- 8009108: ebb0 7fc1 cmp.w r0, r1, lsl #31
- 800910c: bf00 nop
- 800910e: eb42 0202 adc.w r2, r2, r2
- 8009112: bf28 it cs
- 8009114: eba0 70c1 subcs.w r0, r0, r1, lsl #31
- 8009118: ebb0 7f81 cmp.w r0, r1, lsl #30
- 800911c: bf00 nop
- 800911e: eb42 0202 adc.w r2, r2, r2
- 8009122: bf28 it cs
- 8009124: eba0 7081 subcs.w r0, r0, r1, lsl #30
- 8009128: ebb0 7f41 cmp.w r0, r1, lsl #29
- 800912c: bf00 nop
- 800912e: eb42 0202 adc.w r2, r2, r2
- 8009132: bf28 it cs
- 8009134: eba0 7041 subcs.w r0, r0, r1, lsl #29
- 8009138: ebb0 7f01 cmp.w r0, r1, lsl #28
- 800913c: bf00 nop
- 800913e: eb42 0202 adc.w r2, r2, r2
- 8009142: bf28 it cs
- 8009144: eba0 7001 subcs.w r0, r0, r1, lsl #28
- 8009148: ebb0 6fc1 cmp.w r0, r1, lsl #27
- 800914c: bf00 nop
- 800914e: eb42 0202 adc.w r2, r2, r2
- 8009152: bf28 it cs
- 8009154: eba0 60c1 subcs.w r0, r0, r1, lsl #27
- 8009158: ebb0 6f81 cmp.w r0, r1, lsl #26
- 800915c: bf00 nop
- 800915e: eb42 0202 adc.w r2, r2, r2
- 8009162: bf28 it cs
- 8009164: eba0 6081 subcs.w r0, r0, r1, lsl #26
- 8009168: ebb0 6f41 cmp.w r0, r1, lsl #25
- 800916c: bf00 nop
- 800916e: eb42 0202 adc.w r2, r2, r2
- 8009172: bf28 it cs
- 8009174: eba0 6041 subcs.w r0, r0, r1, lsl #25
- 8009178: ebb0 6f01 cmp.w r0, r1, lsl #24
- 800917c: bf00 nop
- 800917e: eb42 0202 adc.w r2, r2, r2
- 8009182: bf28 it cs
- 8009184: eba0 6001 subcs.w r0, r0, r1, lsl #24
- 8009188: ebb0 5fc1 cmp.w r0, r1, lsl #23
- 800918c: bf00 nop
- 800918e: eb42 0202 adc.w r2, r2, r2
- 8009192: bf28 it cs
- 8009194: eba0 50c1 subcs.w r0, r0, r1, lsl #23
- 8009198: ebb0 5f81 cmp.w r0, r1, lsl #22
- 800919c: bf00 nop
- 800919e: eb42 0202 adc.w r2, r2, r2
- 80091a2: bf28 it cs
- 80091a4: eba0 5081 subcs.w r0, r0, r1, lsl #22
- 80091a8: ebb0 5f41 cmp.w r0, r1, lsl #21
- 80091ac: bf00 nop
- 80091ae: eb42 0202 adc.w r2, r2, r2
- 80091b2: bf28 it cs
- 80091b4: eba0 5041 subcs.w r0, r0, r1, lsl #21
- 80091b8: ebb0 5f01 cmp.w r0, r1, lsl #20
- 80091bc: bf00 nop
- 80091be: eb42 0202 adc.w r2, r2, r2
- 80091c2: bf28 it cs
- 80091c4: eba0 5001 subcs.w r0, r0, r1, lsl #20
- 80091c8: ebb0 4fc1 cmp.w r0, r1, lsl #19
- 80091cc: bf00 nop
- 80091ce: eb42 0202 adc.w r2, r2, r2
- 80091d2: bf28 it cs
- 80091d4: eba0 40c1 subcs.w r0, r0, r1, lsl #19
- 80091d8: ebb0 4f81 cmp.w r0, r1, lsl #18
- 80091dc: bf00 nop
- 80091de: eb42 0202 adc.w r2, r2, r2
- 80091e2: bf28 it cs
- 80091e4: eba0 4081 subcs.w r0, r0, r1, lsl #18
- 80091e8: ebb0 4f41 cmp.w r0, r1, lsl #17
- 80091ec: bf00 nop
- 80091ee: eb42 0202 adc.w r2, r2, r2
- 80091f2: bf28 it cs
- 80091f4: eba0 4041 subcs.w r0, r0, r1, lsl #17
- 80091f8: ebb0 4f01 cmp.w r0, r1, lsl #16
- 80091fc: bf00 nop
- 80091fe: eb42 0202 adc.w r2, r2, r2
- 8009202: bf28 it cs
- 8009204: eba0 4001 subcs.w r0, r0, r1, lsl #16
- 8009208: ebb0 3fc1 cmp.w r0, r1, lsl #15
- 800920c: bf00 nop
- 800920e: eb42 0202 adc.w r2, r2, r2
- 8009212: bf28 it cs
- 8009214: eba0 30c1 subcs.w r0, r0, r1, lsl #15
- 8009218: ebb0 3f81 cmp.w r0, r1, lsl #14
- 800921c: bf00 nop
- 800921e: eb42 0202 adc.w r2, r2, r2
- 8009222: bf28 it cs
- 8009224: eba0 3081 subcs.w r0, r0, r1, lsl #14
- 8009228: ebb0 3f41 cmp.w r0, r1, lsl #13
- 800922c: bf00 nop
- 800922e: eb42 0202 adc.w r2, r2, r2
- 8009232: bf28 it cs
- 8009234: eba0 3041 subcs.w r0, r0, r1, lsl #13
- 8009238: ebb0 3f01 cmp.w r0, r1, lsl #12
- 800923c: bf00 nop
- 800923e: eb42 0202 adc.w r2, r2, r2
- 8009242: bf28 it cs
- 8009244: eba0 3001 subcs.w r0, r0, r1, lsl #12
- 8009248: ebb0 2fc1 cmp.w r0, r1, lsl #11
- 800924c: bf00 nop
- 800924e: eb42 0202 adc.w r2, r2, r2
- 8009252: bf28 it cs
- 8009254: eba0 20c1 subcs.w r0, r0, r1, lsl #11
- 8009258: ebb0 2f81 cmp.w r0, r1, lsl #10
- 800925c: bf00 nop
- 800925e: eb42 0202 adc.w r2, r2, r2
- 8009262: bf28 it cs
- 8009264: eba0 2081 subcs.w r0, r0, r1, lsl #10
- 8009268: ebb0 2f41 cmp.w r0, r1, lsl #9
- 800926c: bf00 nop
- 800926e: eb42 0202 adc.w r2, r2, r2
- 8009272: bf28 it cs
- 8009274: eba0 2041 subcs.w r0, r0, r1, lsl #9
- 8009278: ebb0 2f01 cmp.w r0, r1, lsl #8
- 800927c: bf00 nop
- 800927e: eb42 0202 adc.w r2, r2, r2
- 8009282: bf28 it cs
- 8009284: eba0 2001 subcs.w r0, r0, r1, lsl #8
- 8009288: ebb0 1fc1 cmp.w r0, r1, lsl #7
- 800928c: bf00 nop
- 800928e: eb42 0202 adc.w r2, r2, r2
- 8009292: bf28 it cs
- 8009294: eba0 10c1 subcs.w r0, r0, r1, lsl #7
- 8009298: ebb0 1f81 cmp.w r0, r1, lsl #6
- 800929c: bf00 nop
- 800929e: eb42 0202 adc.w r2, r2, r2
- 80092a2: bf28 it cs
- 80092a4: eba0 1081 subcs.w r0, r0, r1, lsl #6
- 80092a8: ebb0 1f41 cmp.w r0, r1, lsl #5
- 80092ac: bf00 nop
- 80092ae: eb42 0202 adc.w r2, r2, r2
- 80092b2: bf28 it cs
- 80092b4: eba0 1041 subcs.w r0, r0, r1, lsl #5
- 80092b8: ebb0 1f01 cmp.w r0, r1, lsl #4
- 80092bc: bf00 nop
- 80092be: eb42 0202 adc.w r2, r2, r2
- 80092c2: bf28 it cs
- 80092c4: eba0 1001 subcs.w r0, r0, r1, lsl #4
- 80092c8: ebb0 0fc1 cmp.w r0, r1, lsl #3
- 80092cc: bf00 nop
- 80092ce: eb42 0202 adc.w r2, r2, r2
- 80092d2: bf28 it cs
- 80092d4: eba0 00c1 subcs.w r0, r0, r1, lsl #3
- 80092d8: ebb0 0f81 cmp.w r0, r1, lsl #2
- 80092dc: bf00 nop
- 80092de: eb42 0202 adc.w r2, r2, r2
- 80092e2: bf28 it cs
- 80092e4: eba0 0081 subcs.w r0, r0, r1, lsl #2
- 80092e8: ebb0 0f41 cmp.w r0, r1, lsl #1
- 80092ec: bf00 nop
- 80092ee: eb42 0202 adc.w r2, r2, r2
- 80092f2: bf28 it cs
- 80092f4: eba0 0041 subcs.w r0, r0, r1, lsl #1
- 80092f8: ebb0 0f01 cmp.w r0, r1
- 80092fc: bf00 nop
- 80092fe: eb42 0202 adc.w r2, r2, r2
- 8009302: bf28 it cs
- 8009304: eba0 0001 subcs.w r0, r0, r1
- 8009308: 4610 mov r0, r2
- 800930a: 4770 bx lr
- 800930c: bf0c ite eq
- 800930e: 2001 moveq r0, #1
- 8009310: 2000 movne r0, #0
- 8009312: 4770 bx lr
- 8009314: fab1 f281 clz r2, r1
- 8009318: f1c2 021f rsb r2, r2, #31
- 800931c: fa20 f002 lsr.w r0, r0, r2
- 8009320: 4770 bx lr
- 8009322: b108 cbz r0, 8009328 <__aeabi_uidiv+0x258>
- 8009324: f04f 30ff mov.w r0, #4294967295
- 8009328: f7ff bb8e b.w 8008a48 <__aeabi_idiv0>
- 0800932c <__aeabi_uidivmod>:
- 800932c: 2900 cmp r1, #0
- 800932e: d0f8 beq.n 8009322 <__aeabi_uidiv+0x252>
- 8009330: e92d 4003 stmdb sp!, {r0, r1, lr}
- 8009334: f7ff fecc bl 80090d0 <__aeabi_uidiv>
- 8009338: e8bd 4006 ldmia.w sp!, {r1, r2, lr}
- 800933c: fb02 f300 mul.w r3, r2, r0
- 8009340: eba1 0103 sub.w r1, r1, r3
- 8009344: 4770 bx lr
- 8009346: bf00 nop
- 08009348 <__libc_init_array>:
- 8009348: b570 push {r4, r5, r6, lr}
- 800934a: f243 6690 movw r6, #13968 ; 0x3690
- 800934e: f243 6590 movw r5, #13968 ; 0x3690
- 8009352: f6c0 0601 movt r6, #2049 ; 0x801
- 8009356: f6c0 0501 movt r5, #2049 ; 0x801
- 800935a: 1b76 subs r6, r6, r5
- 800935c: 10b6 asrs r6, r6, #2
- 800935e: d007 beq.n 8009370 <__libc_init_array+0x28>
- 8009360: 3d04 subs r5, #4
- 8009362: 2400 movs r4, #0
- 8009364: f855 3f04 ldr.w r3, [r5, #4]!
- 8009368: 3401 adds r4, #1
- 800936a: 4798 blx r3
- 800936c: 42a6 cmp r6, r4
- 800936e: d1f9 bne.n 8009364 <__libc_init_array+0x1c>
- 8009370: f243 6694 movw r6, #13972 ; 0x3694
- 8009374: f243 6590 movw r5, #13968 ; 0x3690
- 8009378: f6c0 0601 movt r6, #2049 ; 0x801
- 800937c: f6c0 0501 movt r5, #2049 ; 0x801
- 8009380: 1b76 subs r6, r6, r5
- 8009382: f00a f975 bl 8013670 <_init>
- 8009386: 10b6 asrs r6, r6, #2
- 8009388: d008 beq.n 800939c <__libc_init_array+0x54>
- 800938a: 3d04 subs r5, #4
- 800938c: 2400 movs r4, #0
- 800938e: f855 3f04 ldr.w r3, [r5, #4]!
- 8009392: 3401 adds r4, #1
- 8009394: 4798 blx r3
- 8009396: 42a6 cmp r6, r4
- 8009398: d1f9 bne.n 800938e <__libc_init_array+0x46>
- 800939a: bd70 pop {r4, r5, r6, pc}
- 800939c: bd70 pop {r4, r5, r6, pc}
- 800939e: bf00 nop
- 080093a0 <memcmp>:
- 80093a0: 2a03 cmp r2, #3
- 80093a2: b470 push {r4, r5, r6}
- 80093a4: d922 bls.n 80093ec <memcmp+0x4c>
- 80093a6: ea41 0300 orr.w r3, r1, r0
- 80093aa: 079b lsls r3, r3, #30
- 80093ac: d013 beq.n 80093d6 <memcmp+0x36>
- 80093ae: 7805 ldrb r5, [r0, #0]
- 80093b0: 3a01 subs r2, #1
- 80093b2: 780c ldrb r4, [r1, #0]
- 80093b4: 2300 movs r3, #0
- 80093b6: 42a5 cmp r5, r4
- 80093b8: d006 beq.n 80093c8 <memcmp+0x28>
- 80093ba: e01b b.n 80093f4 <memcmp+0x54>
- 80093bc: f810 5f01 ldrb.w r5, [r0, #1]!
- 80093c0: f811 4f01 ldrb.w r4, [r1, #1]!
- 80093c4: 42a5 cmp r5, r4
- 80093c6: d115 bne.n 80093f4 <memcmp+0x54>
- 80093c8: 4293 cmp r3, r2
- 80093ca: f103 0301 add.w r3, r3, #1
- 80093ce: d1f5 bne.n 80093bc <memcmp+0x1c>
- 80093d0: 2000 movs r0, #0
- 80093d2: bc70 pop {r4, r5, r6}
- 80093d4: 4770 bx lr
- 80093d6: 460c mov r4, r1
- 80093d8: 4603 mov r3, r0
- 80093da: 3104 adds r1, #4
- 80093dc: 3004 adds r0, #4
- 80093de: 681e ldr r6, [r3, #0]
- 80093e0: 6825 ldr r5, [r4, #0]
- 80093e2: 42ae cmp r6, r5
- 80093e4: d108 bne.n 80093f8 <memcmp+0x58>
- 80093e6: 3a04 subs r2, #4
- 80093e8: 2a03 cmp r2, #3
- 80093ea: d8f4 bhi.n 80093d6 <memcmp+0x36>
- 80093ec: 2a00 cmp r2, #0
- 80093ee: d1de bne.n 80093ae <memcmp+0xe>
- 80093f0: 4610 mov r0, r2
- 80093f2: e7ee b.n 80093d2 <memcmp+0x32>
- 80093f4: 1b28 subs r0, r5, r4
- 80093f6: e7ec b.n 80093d2 <memcmp+0x32>
- 80093f8: 4621 mov r1, r4
- 80093fa: 4618 mov r0, r3
- 80093fc: 2a00 cmp r2, #0
- 80093fe: d1d6 bne.n 80093ae <memcmp+0xe>
- 8009400: e7f6 b.n 80093f0 <memcmp+0x50>
- 8009402: bf00 nop
- 08009404 <memcpy>:
- 8009404: 2a03 cmp r2, #3
- 8009406: e92d 0ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp}
- 800940a: d809 bhi.n 8009420 <memcpy+0x1c>
- 800940c: b12a cbz r2, 800941a <memcpy+0x16>
- 800940e: 2300 movs r3, #0
- 8009410: 5ccc ldrb r4, [r1, r3]
- 8009412: 54c4 strb r4, [r0, r3]
- 8009414: 3301 adds r3, #1
- 8009416: 4293 cmp r3, r2
- 8009418: d1fa bne.n 8009410 <memcpy+0xc>
- 800941a: e8bd 0ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp}
- 800941e: 4770 bx lr
- 8009420: 0783 lsls r3, r0, #30
- 8009422: 4402 add r2, r0
- 8009424: d00e beq.n 8009444 <memcpy+0x40>
- 8009426: 1c44 adds r4, r0, #1
- 8009428: 1c4d adds r5, r1, #1
- 800942a: f815 7c01 ldrb.w r7, [r5, #-1]
- 800942e: f004 0603 and.w r6, r4, #3
- 8009432: 4623 mov r3, r4
- 8009434: 3401 adds r4, #1
- 8009436: 4629 mov r1, r5
- 8009438: 3501 adds r5, #1
- 800943a: f804 7c02 strb.w r7, [r4, #-2]
- 800943e: 2e00 cmp r6, #0
- 8009440: d1f3 bne.n 800942a <memcpy+0x26>
- 8009442: e000 b.n 8009446 <memcpy+0x42>
- 8009444: 4603 mov r3, r0
- 8009446: f011 0403 ands.w r4, r1, #3
- 800944a: d06d beq.n 8009528 <memcpy+0x124>
- 800944c: 1ad7 subs r7, r2, r3
- 800944e: 1b0d subs r5, r1, r4
- 8009450: 2f03 cmp r7, #3
- 8009452: 682e ldr r6, [r5, #0]
- 8009454: dd19 ble.n 800948a <memcpy+0x86>
- 8009456: f1c4 0c04 rsb ip, r4, #4
- 800945a: ea4f 08c4 mov.w r8, r4, lsl #3
- 800945e: 1d1c adds r4, r3, #4
- 8009460: ea4f 0ccc mov.w ip, ip, lsl #3
- 8009464: f855 7f04 ldr.w r7, [r5, #4]!
- 8009468: ebc4 0902 rsb r9, r4, r2
- 800946c: 4623 mov r3, r4
- 800946e: 3104 adds r1, #4
- 8009470: 3404 adds r4, #4
- 8009472: f1b9 0f03 cmp.w r9, #3
- 8009476: fa26 fa08 lsr.w sl, r6, r8
- 800947a: fa07 fb0c lsl.w fp, r7, ip
- 800947e: 463e mov r6, r7
- 8009480: ea4b 070a orr.w r7, fp, sl
- 8009484: f844 7c08 str.w r7, [r4, #-8]
- 8009488: dcec bgt.n 8009464 <memcpy+0x60>
- 800948a: 429a cmp r2, r3
- 800948c: d9c5 bls.n 800941a <memcpy+0x16>
- 800948e: 3301 adds r3, #1
- 8009490: 3101 adds r1, #1
- 8009492: 3201 adds r2, #1
- 8009494: f811 4c01 ldrb.w r4, [r1, #-1]
- 8009498: 3301 adds r3, #1
- 800949a: 3101 adds r1, #1
- 800949c: 4293 cmp r3, r2
- 800949e: f803 4c02 strb.w r4, [r3, #-2]
- 80094a2: d1f7 bne.n 8009494 <memcpy+0x90>
- 80094a4: e7b9 b.n 800941a <memcpy+0x16>
- 80094a6: 680c ldr r4, [r1, #0]
- 80094a8: 3340 adds r3, #64 ; 0x40
- 80094aa: 3140 adds r1, #64 ; 0x40
- 80094ac: f843 4c40 str.w r4, [r3, #-64]
- 80094b0: f851 4c3c ldr.w r4, [r1, #-60]
- 80094b4: f843 4c3c str.w r4, [r3, #-60]
- 80094b8: f851 4c38 ldr.w r4, [r1, #-56]
- 80094bc: f843 4c38 str.w r4, [r3, #-56]
- 80094c0: f851 4c34 ldr.w r4, [r1, #-52]
- 80094c4: f843 4c34 str.w r4, [r3, #-52]
- 80094c8: f851 4c30 ldr.w r4, [r1, #-48]
- 80094cc: f843 4c30 str.w r4, [r3, #-48]
- 80094d0: f851 4c2c ldr.w r4, [r1, #-44]
- 80094d4: f843 4c2c str.w r4, [r3, #-44]
- 80094d8: f851 4c28 ldr.w r4, [r1, #-40]
- 80094dc: f843 4c28 str.w r4, [r3, #-40]
- 80094e0: f851 4c24 ldr.w r4, [r1, #-36]
- 80094e4: f843 4c24 str.w r4, [r3, #-36]
- 80094e8: f851 4c20 ldr.w r4, [r1, #-32]
- 80094ec: f843 4c20 str.w r4, [r3, #-32]
- 80094f0: f851 4c1c ldr.w r4, [r1, #-28]
- 80094f4: f843 4c1c str.w r4, [r3, #-28]
- 80094f8: f851 4c18 ldr.w r4, [r1, #-24]
- 80094fc: f843 4c18 str.w r4, [r3, #-24]
- 8009500: f851 4c14 ldr.w r4, [r1, #-20]
- 8009504: f843 4c14 str.w r4, [r3, #-20]
- 8009508: f851 4c10 ldr.w r4, [r1, #-16]
- 800950c: f843 4c10 str.w r4, [r3, #-16]
- 8009510: f851 4c0c ldr.w r4, [r1, #-12]
- 8009514: f843 4c0c str.w r4, [r3, #-12]
- 8009518: f851 4c08 ldr.w r4, [r1, #-8]
- 800951c: f843 4c08 str.w r4, [r3, #-8]
- 8009520: f851 4c04 ldr.w r4, [r1, #-4]
- 8009524: f843 4c04 str.w r4, [r3, #-4]
- 8009528: 1ad4 subs r4, r2, r3
- 800952a: 2c3f cmp r4, #63 ; 0x3f
- 800952c: dcbb bgt.n 80094a6 <memcpy+0xa2>
- 800952e: e011 b.n 8009554 <memcpy+0x150>
- 8009530: 680c ldr r4, [r1, #0]
- 8009532: 3310 adds r3, #16
- 8009534: 3110 adds r1, #16
- 8009536: f843 4c10 str.w r4, [r3, #-16]
- 800953a: f851 4c0c ldr.w r4, [r1, #-12]
- 800953e: f843 4c0c str.w r4, [r3, #-12]
- 8009542: f851 4c08 ldr.w r4, [r1, #-8]
- 8009546: f843 4c08 str.w r4, [r3, #-8]
- 800954a: f851 4c04 ldr.w r4, [r1, #-4]
- 800954e: f843 4c04 str.w r4, [r3, #-4]
- 8009552: 1ad4 subs r4, r2, r3
- 8009554: 2c0f cmp r4, #15
- 8009556: dceb bgt.n 8009530 <memcpy+0x12c>
- 8009558: 2c03 cmp r4, #3
- 800955a: dd96 ble.n 800948a <memcpy+0x86>
- 800955c: 1d1c adds r4, r3, #4
- 800955e: 1d0d adds r5, r1, #4
- 8009560: f855 7c04 ldr.w r7, [r5, #-4]
- 8009564: 1b16 subs r6, r2, r4
- 8009566: 4623 mov r3, r4
- 8009568: 4629 mov r1, r5
- 800956a: 3404 adds r4, #4
- 800956c: 3504 adds r5, #4
- 800956e: 2e03 cmp r6, #3
- 8009570: f844 7c08 str.w r7, [r4, #-8]
- 8009574: dcf4 bgt.n 8009560 <memcpy+0x15c>
- 8009576: e788 b.n 800948a <memcpy+0x86>
- 08009578 <memset>:
- 8009578: 2a03 cmp r2, #3
- 800957a: b2c9 uxtb r1, r1
- 800957c: b470 push {r4, r5, r6}
- 800957e: d808 bhi.n 8009592 <memset+0x1a>
- 8009580: b12a cbz r2, 800958e <memset+0x16>
- 8009582: 4603 mov r3, r0
- 8009584: 1812 adds r2, r2, r0
- 8009586: f803 1b01 strb.w r1, [r3], #1
- 800958a: 4293 cmp r3, r2
- 800958c: d1fb bne.n 8009586 <memset+0xe>
- 800958e: bc70 pop {r4, r5, r6}
- 8009590: 4770 bx lr
- 8009592: 0783 lsls r3, r0, #30
- 8009594: 4402 add r2, r0
- 8009596: d009 beq.n 80095ac <memset+0x34>
- 8009598: 1c44 adds r4, r0, #1
- 800959a: f004 0503 and.w r5, r4, #3
- 800959e: 4623 mov r3, r4
- 80095a0: f804 1c01 strb.w r1, [r4, #-1]
- 80095a4: 3401 adds r4, #1
- 80095a6: 2d00 cmp r5, #0
- 80095a8: d1f7 bne.n 800959a <memset+0x22>
- 80095aa: e000 b.n 80095ae <memset+0x36>
- 80095ac: 4603 mov r3, r0
- 80095ae: 1ad5 subs r5, r2, r3
- 80095b0: eb01 2401 add.w r4, r1, r1, lsl #8
- 80095b4: 2d3f cmp r5, #63 ; 0x3f
- 80095b6: eb04 4404 add.w r4, r4, r4, lsl #16
- 80095ba: dd2c ble.n 8009616 <memset+0x9e>
- 80095bc: 601c str r4, [r3, #0]
- 80095be: 3340 adds r3, #64 ; 0x40
- 80095c0: 1ad5 subs r5, r2, r3
- 80095c2: f843 4c3c str.w r4, [r3, #-60]
- 80095c6: 2d3f cmp r5, #63 ; 0x3f
- 80095c8: f843 4c38 str.w r4, [r3, #-56]
- 80095cc: f843 4c34 str.w r4, [r3, #-52]
- 80095d0: f843 4c30 str.w r4, [r3, #-48]
- 80095d4: f843 4c2c str.w r4, [r3, #-44]
- 80095d8: f843 4c28 str.w r4, [r3, #-40]
- 80095dc: f843 4c24 str.w r4, [r3, #-36]
- 80095e0: f843 4c20 str.w r4, [r3, #-32]
- 80095e4: f843 4c1c str.w r4, [r3, #-28]
- 80095e8: f843 4c18 str.w r4, [r3, #-24]
- 80095ec: f843 4c14 str.w r4, [r3, #-20]
- 80095f0: f843 4c10 str.w r4, [r3, #-16]
- 80095f4: f843 4c0c str.w r4, [r3, #-12]
- 80095f8: f843 4c08 str.w r4, [r3, #-8]
- 80095fc: f843 4c04 str.w r4, [r3, #-4]
- 8009600: dcdc bgt.n 80095bc <memset+0x44>
- 8009602: e008 b.n 8009616 <memset+0x9e>
- 8009604: 601c str r4, [r3, #0]
- 8009606: 3310 adds r3, #16
- 8009608: 1ad5 subs r5, r2, r3
- 800960a: f843 4c0c str.w r4, [r3, #-12]
- 800960e: f843 4c08 str.w r4, [r3, #-8]
- 8009612: f843 4c04 str.w r4, [r3, #-4]
- 8009616: 2d0f cmp r5, #15
- 8009618: dcf4 bgt.n 8009604 <memset+0x8c>
- 800961a: 2d03 cmp r5, #3
- 800961c: dd08 ble.n 8009630 <memset+0xb8>
- 800961e: 1d1d adds r5, r3, #4
- 8009620: 1b56 subs r6, r2, r5
- 8009622: f845 4c04 str.w r4, [r5, #-4]
- 8009626: 2e03 cmp r6, #3
- 8009628: 462b mov r3, r5
- 800962a: f105 0504 add.w r5, r5, #4
- 800962e: dcf7 bgt.n 8009620 <memset+0xa8>
- 8009630: 429a cmp r2, r3
- 8009632: d9ac bls.n 800958e <memset+0x16>
- 8009634: 3301 adds r3, #1
- 8009636: 3201 adds r2, #1
- 8009638: f803 1c01 strb.w r1, [r3, #-1]
- 800963c: 3301 adds r3, #1
- 800963e: 4293 cmp r3, r2
- 8009640: d1fa bne.n 8009638 <memset+0xc0>
- 8009642: e7a4 b.n 800958e <memset+0x16>
- 08009644 <strcmp>:
- 8009644: ea80 0201 eor.w r2, r0, r1
- 8009648: f012 0f03 tst.w r2, #3
- 800964c: f040 803a bne.w 80096c4 <strcmp_unaligned>
- 8009650: f010 0203 ands.w r2, r0, #3
- 8009654: f020 0003 bic.w r0, r0, #3
- 8009658: f021 0103 bic.w r1, r1, #3
- 800965c: f850 cb04 ldr.w ip, [r0], #4
- 8009660: bf08 it eq
- 8009662: f851 3b04 ldreq.w r3, [r1], #4
- 8009666: d00d beq.n 8009684 <strcmp+0x40>
- 8009668: f082 0203 eor.w r2, r2, #3
- 800966c: ea4f 02c2 mov.w r2, r2, lsl #3
- 8009670: f06f 437f mvn.w r3, #4278190080 ; 0xff000000
- 8009674: fa23 f202 lsr.w r2, r3, r2
- 8009678: f851 3b04 ldr.w r3, [r1], #4
- 800967c: ea4c 0c02 orr.w ip, ip, r2
- 8009680: ea43 0302 orr.w r3, r3, r2
- 8009684: f1ac 3201 sub.w r2, ip, #16843009 ; 0x1010101
- 8009688: 459c cmp ip, r3
- 800968a: bf01 itttt eq
- 800968c: ea22 020c biceq.w r2, r2, ip
- 8009690: f012 3f80 tsteq.w r2, #2155905152 ; 0x80808080
- 8009694: f850 cb04 ldreq.w ip, [r0], #4
- 8009698: f851 3b04 ldreq.w r3, [r1], #4
- 800969c: d0f2 beq.n 8009684 <strcmp+0x40>
- 800969e: ea4f 600c mov.w r0, ip, lsl #24
- 80096a2: ea4f 2c1c mov.w ip, ip, lsr #8
- 80096a6: 2801 cmp r0, #1
- 80096a8: bf28 it cs
- 80096aa: ebb0 6f03 cmpcs.w r0, r3, lsl #24
- 80096ae: bf08 it eq
- 80096b0: 0a1b lsreq r3, r3, #8
- 80096b2: d0f4 beq.n 800969e <strcmp+0x5a>
- 80096b4: f003 03ff and.w r3, r3, #255 ; 0xff
- 80096b8: ea4f 6010 mov.w r0, r0, lsr #24
- 80096bc: eba0 0003 sub.w r0, r0, r3
- 80096c0: 4770 bx lr
- 80096c2: bf00 nop
- 080096c4 <strcmp_unaligned>:
- 80096c4: f010 0f03 tst.w r0, #3
- 80096c8: d00a beq.n 80096e0 <strcmp_unaligned+0x1c>
- 80096ca: f810 2b01 ldrb.w r2, [r0], #1
- 80096ce: f811 3b01 ldrb.w r3, [r1], #1
- 80096d2: 2a01 cmp r2, #1
- 80096d4: bf28 it cs
- 80096d6: 429a cmpcs r2, r3
- 80096d8: d0f4 beq.n 80096c4 <strcmp_unaligned>
- 80096da: eba2 0003 sub.w r0, r2, r3
- 80096de: 4770 bx lr
- 80096e0: f84d 5d04 str.w r5, [sp, #-4]!
- 80096e4: f84d 4d04 str.w r4, [sp, #-4]!
- 80096e8: f04f 0201 mov.w r2, #1
- 80096ec: ea42 2202 orr.w r2, r2, r2, lsl #8
- 80096f0: ea42 4202 orr.w r2, r2, r2, lsl #16
- 80096f4: f001 0c03 and.w ip, r1, #3
- 80096f8: f021 0103 bic.w r1, r1, #3
- 80096fc: f850 4b04 ldr.w r4, [r0], #4
- 8009700: f851 5b04 ldr.w r5, [r1], #4
- 8009704: f1bc 0f02 cmp.w ip, #2
- 8009708: d026 beq.n 8009758 <strcmp_unaligned+0x94>
- 800970a: d84b bhi.n 80097a4 <strcmp_unaligned+0xe0>
- 800970c: f024 4c7f bic.w ip, r4, #4278190080 ; 0xff000000
- 8009710: ebbc 2f15 cmp.w ip, r5, lsr #8
- 8009714: eba4 0302 sub.w r3, r4, r2
- 8009718: ea23 0304 bic.w r3, r3, r4
- 800971c: d10d bne.n 800973a <strcmp_unaligned+0x76>
- 800971e: ea13 13c2 ands.w r3, r3, r2, lsl #7
- 8009722: bf08 it eq
- 8009724: f851 5b04 ldreq.w r5, [r1], #4
- 8009728: d10a bne.n 8009740 <strcmp_unaligned+0x7c>
- 800972a: ea8c 0c04 eor.w ip, ip, r4
- 800972e: ebbc 6f05 cmp.w ip, r5, lsl #24
- 8009732: d10c bne.n 800974e <strcmp_unaligned+0x8a>
- 8009734: f850 4b04 ldr.w r4, [r0], #4
- 8009738: e7e8 b.n 800970c <strcmp_unaligned+0x48>
- 800973a: ea4f 2515 mov.w r5, r5, lsr #8
- 800973e: e05c b.n 80097fa <strcmp_unaligned+0x136>
- 8009740: f033 437f bics.w r3, r3, #4278190080 ; 0xff000000
- 8009744: d152 bne.n 80097ec <strcmp_unaligned+0x128>
- 8009746: 780d ldrb r5, [r1, #0]
- 8009748: ea4f 6c14 mov.w ip, r4, lsr #24
- 800974c: e055 b.n 80097fa <strcmp_unaligned+0x136>
- 800974e: ea4f 6c14 mov.w ip, r4, lsr #24
- 8009752: f005 05ff and.w r5, r5, #255 ; 0xff
- 8009756: e050 b.n 80097fa <strcmp_unaligned+0x136>
- 8009758: ea4f 4c04 mov.w ip, r4, lsl #16
- 800975c: eba4 0302 sub.w r3, r4, r2
- 8009760: ea4f 4c1c mov.w ip, ip, lsr #16
- 8009764: ea23 0304 bic.w r3, r3, r4
- 8009768: ebbc 4f15 cmp.w ip, r5, lsr #16
- 800976c: d117 bne.n 800979e <strcmp_unaligned+0xda>
- 800976e: ea13 13c2 ands.w r3, r3, r2, lsl #7
- 8009772: bf08 it eq
- 8009774: f851 5b04 ldreq.w r5, [r1], #4
- 8009778: d107 bne.n 800978a <strcmp_unaligned+0xc6>
- 800977a: ea8c 0c04 eor.w ip, ip, r4
- 800977e: ebbc 4f05 cmp.w ip, r5, lsl #16
- 8009782: d108 bne.n 8009796 <strcmp_unaligned+0xd2>
- 8009784: f850 4b04 ldr.w r4, [r0], #4
- 8009788: e7e6 b.n 8009758 <strcmp_unaligned+0x94>
- 800978a: 041b lsls r3, r3, #16
- 800978c: d12e bne.n 80097ec <strcmp_unaligned+0x128>
- 800978e: 880d ldrh r5, [r1, #0]
- 8009790: ea4f 4c14 mov.w ip, r4, lsr #16
- 8009794: e031 b.n 80097fa <strcmp_unaligned+0x136>
- 8009796: ea4f 4505 mov.w r5, r5, lsl #16
- 800979a: ea4f 4c14 mov.w ip, r4, lsr #16
- 800979e: ea4f 4515 mov.w r5, r5, lsr #16
- 80097a2: e02a b.n 80097fa <strcmp_unaligned+0x136>
- 80097a4: f004 0cff and.w ip, r4, #255 ; 0xff
- 80097a8: ebbc 6f15 cmp.w ip, r5, lsr #24
- 80097ac: eba4 0302 sub.w r3, r4, r2
- 80097b0: ea23 0304 bic.w r3, r3, r4
- 80097b4: d10d bne.n 80097d2 <strcmp_unaligned+0x10e>
- 80097b6: ea13 13c2 ands.w r3, r3, r2, lsl #7
- 80097ba: bf08 it eq
- 80097bc: f851 5b04 ldreq.w r5, [r1], #4
- 80097c0: d10a bne.n 80097d8 <strcmp_unaligned+0x114>
- 80097c2: ea8c 0c04 eor.w ip, ip, r4
- 80097c6: ebbc 2f05 cmp.w ip, r5, lsl #8
- 80097ca: d10a bne.n 80097e2 <strcmp_unaligned+0x11e>
- 80097cc: f850 4b04 ldr.w r4, [r0], #4
- 80097d0: e7e8 b.n 80097a4 <strcmp_unaligned+0xe0>
- 80097d2: ea4f 6515 mov.w r5, r5, lsr #24
- 80097d6: e010 b.n 80097fa <strcmp_unaligned+0x136>
- 80097d8: f014 0fff tst.w r4, #255 ; 0xff
- 80097dc: d006 beq.n 80097ec <strcmp_unaligned+0x128>
- 80097de: f851 5b04 ldr.w r5, [r1], #4
- 80097e2: ea4f 2c14 mov.w ip, r4, lsr #8
- 80097e6: f025 457f bic.w r5, r5, #4278190080 ; 0xff000000
- 80097ea: e006 b.n 80097fa <strcmp_unaligned+0x136>
- 80097ec: f04f 0000 mov.w r0, #0
- 80097f0: f85d 4b04 ldr.w r4, [sp], #4
- 80097f4: f85d 5b04 ldr.w r5, [sp], #4
- 80097f8: 4770 bx lr
- 80097fa: f00c 02ff and.w r2, ip, #255 ; 0xff
- 80097fe: f005 00ff and.w r0, r5, #255 ; 0xff
- 8009802: 2801 cmp r0, #1
- 8009804: bf28 it cs
- 8009806: 4290 cmpcs r0, r2
- 8009808: bf04 itt eq
- 800980a: ea4f 2c1c moveq.w ip, ip, lsr #8
- 800980e: 0a2d lsreq r5, r5, #8
- 8009810: d0f3 beq.n 80097fa <strcmp_unaligned+0x136>
- 8009812: eba2 0000 sub.w r0, r2, r0
- 8009816: f85d 4b04 ldr.w r4, [sp], #4
- 800981a: f85d 5b04 ldr.w r5, [sp], #4
- 800981e: 4770 bx lr
- 08009820 <strcpy>:
- 8009820: ea80 0201 eor.w r2, r0, r1
- 8009824: 4684 mov ip, r0
- 8009826: f012 0f03 tst.w r2, #3
- 800982a: d14f bne.n 80098cc <strcpy+0xac>
- 800982c: f011 0f03 tst.w r1, #3
- 8009830: d132 bne.n 8009898 <strcpy+0x78>
- 8009832: f84d 4d04 str.w r4, [sp, #-4]!
- 8009836: f011 0f04 tst.w r1, #4
- 800983a: f851 3b04 ldr.w r3, [r1], #4
- 800983e: d00b beq.n 8009858 <strcpy+0x38>
- 8009840: f1a3 3201 sub.w r2, r3, #16843009 ; 0x1010101
- 8009844: 439a bics r2, r3
- 8009846: f012 3f80 tst.w r2, #2155905152 ; 0x80808080
- 800984a: bf04 itt eq
- 800984c: f84c 3b04 streq.w r3, [ip], #4
- 8009850: f851 3b04 ldreq.w r3, [r1], #4
- 8009854: d116 bne.n 8009884 <strcpy+0x64>
- 8009856: bf00 nop
- 8009858: f851 4b04 ldr.w r4, [r1], #4
- 800985c: f1a3 3201 sub.w r2, r3, #16843009 ; 0x1010101
- 8009860: 439a bics r2, r3
- 8009862: f012 3f80 tst.w r2, #2155905152 ; 0x80808080
- 8009866: f1a4 3201 sub.w r2, r4, #16843009 ; 0x1010101
- 800986a: d10b bne.n 8009884 <strcpy+0x64>
- 800986c: f84c 3b04 str.w r3, [ip], #4
- 8009870: 43a2 bics r2, r4
- 8009872: f012 3f80 tst.w r2, #2155905152 ; 0x80808080
- 8009876: bf04 itt eq
- 8009878: f851 3b04 ldreq.w r3, [r1], #4
- 800987c: f84c 4b04 streq.w r4, [ip], #4
- 8009880: d0ea beq.n 8009858 <strcpy+0x38>
- 8009882: 4623 mov r3, r4
- 8009884: f80c 3b01 strb.w r3, [ip], #1
- 8009888: f013 0fff tst.w r3, #255 ; 0xff
- 800988c: ea4f 2333 mov.w r3, r3, ror #8
- 8009890: d1f8 bne.n 8009884 <strcpy+0x64>
- 8009892: f85d 4b04 ldr.w r4, [sp], #4
- 8009896: 4770 bx lr
- 8009898: f011 0f01 tst.w r1, #1
- 800989c: d006 beq.n 80098ac <strcpy+0x8c>
- 800989e: f811 2b01 ldrb.w r2, [r1], #1
- 80098a2: f80c 2b01 strb.w r2, [ip], #1
- 80098a6: 2a00 cmp r2, #0
- 80098a8: bf08 it eq
- 80098aa: 4770 bxeq lr
- 80098ac: f011 0f02 tst.w r1, #2
- 80098b0: d0bf beq.n 8009832 <strcpy+0x12>
- 80098b2: f831 2b02 ldrh.w r2, [r1], #2
- 80098b6: f012 0fff tst.w r2, #255 ; 0xff
- 80098ba: bf16 itet ne
- 80098bc: f82c 2b02 strhne.w r2, [ip], #2
- 80098c0: f88c 2000 strbeq.w r2, [ip]
- 80098c4: f412 4f7f tstne.w r2, #65280 ; 0xff00
- 80098c8: d1b3 bne.n 8009832 <strcpy+0x12>
- 80098ca: 4770 bx lr
- 80098cc: f811 2b01 ldrb.w r2, [r1], #1
- 80098d0: f80c 2b01 strb.w r2, [ip], #1
- 80098d4: 2a00 cmp r2, #0
- 80098d6: d1f9 bne.n 80098cc <strcpy+0xac>
- 80098d8: 4770 bx lr
- 80098da: bf00 nop
- 080098dc <strncmp>:
- 80098dc: b470 push {r4, r5, r6}
- 80098de: 2a00 cmp r2, #0
- 80098e0: d045 beq.n 800996e <strncmp+0x92>
- 80098e2: ea41 0300 orr.w r3, r1, r0
- 80098e6: f013 0303 ands.w r3, r3, #3
- 80098ea: d129 bne.n 8009940 <strncmp+0x64>
- 80098ec: 2a03 cmp r2, #3
- 80098ee: d927 bls.n 8009940 <strncmp+0x64>
- 80098f0: 6805 ldr r5, [r0, #0]
- 80098f2: 680c ldr r4, [r1, #0]
- 80098f4: 42a5 cmp r5, r4
- 80098f6: d123 bne.n 8009940 <strncmp+0x64>
- 80098f8: 1f14 subs r4, r2, #4
- 80098fa: d03a beq.n 8009972 <strncmp+0x96>
- 80098fc: f1a5 3201 sub.w r2, r5, #16843009 ; 0x1010101
- 8009900: ea22 0505 bic.w r5, r2, r5
- 8009904: f015 3f80 tst.w r5, #2155905152 ; 0x80808080
- 8009908: d00d beq.n 8009926 <strncmp+0x4a>
- 800990a: e03a b.n 8009982 <strncmp+0xa6>
- 800990c: 685b ldr r3, [r3, #4]
- 800990e: 686a ldr r2, [r5, #4]
- 8009910: f1a3 3501 sub.w r5, r3, #16843009 ; 0x1010101
- 8009914: 4293 cmp r3, r2
- 8009916: ea25 0503 bic.w r5, r5, r3
- 800991a: d12e bne.n 800997a <strncmp+0x9e>
- 800991c: 3c04 subs r4, #4
- 800991e: d028 beq.n 8009972 <strncmp+0x96>
- 8009920: f015 3f80 tst.w r5, #2155905152 ; 0x80808080
- 8009924: d127 bne.n 8009976 <strncmp+0x9a>
- 8009926: 460d mov r5, r1
- 8009928: 4603 mov r3, r0
- 800992a: 3104 adds r1, #4
- 800992c: 3004 adds r0, #4
- 800992e: 2c03 cmp r4, #3
- 8009930: d8ec bhi.n 800990c <strncmp+0x30>
- 8009932: 1e66 subs r6, r4, #1
- 8009934: b92c cbnz r4, 8009942 <strncmp+0x66>
- 8009936: 791c ldrb r4, [r3, #4]
- 8009938: 792a ldrb r2, [r5, #4]
- 800993a: 1aa0 subs r0, r4, r2
- 800993c: bc70 pop {r4, r5, r6}
- 800993e: 4770 bx lr
- 8009940: 1e56 subs r6, r2, #1
- 8009942: 7804 ldrb r4, [r0, #0]
- 8009944: 780a ldrb r2, [r1, #0]
- 8009946: 4294 cmp r4, r2
- 8009948: d1f7 bne.n 800993a <strncmp+0x5e>
- 800994a: b1c6 cbz r6, 800997e <strncmp+0xa2>
- 800994c: b18c cbz r4, 8009972 <strncmp+0x96>
- 800994e: 3601 adds r6, #1
- 8009950: 1c8b adds r3, r1, #2
- 8009952: 1989 adds r1, r1, r6
- 8009954: e004 b.n 8009960 <strncmp+0x84>
- 8009956: 428b cmp r3, r1
- 8009958: f103 0301 add.w r3, r3, #1
- 800995c: d00b beq.n 8009976 <strncmp+0x9a>
- 800995e: b144 cbz r4, 8009972 <strncmp+0x96>
- 8009960: f813 2c01 ldrb.w r2, [r3, #-1]
- 8009964: f810 4f01 ldrb.w r4, [r0, #1]!
- 8009968: 4294 cmp r4, r2
- 800996a: d0f4 beq.n 8009956 <strncmp+0x7a>
- 800996c: e7e5 b.n 800993a <strncmp+0x5e>
- 800996e: 4610 mov r0, r2
- 8009970: e7e4 b.n 800993c <strncmp+0x60>
- 8009972: 4620 mov r0, r4
- 8009974: e7e2 b.n 800993c <strncmp+0x60>
- 8009976: 2000 movs r0, #0
- 8009978: e7e0 b.n 800993c <strncmp+0x60>
- 800997a: 1e66 subs r6, r4, #1
- 800997c: e7e1 b.n 8009942 <strncmp+0x66>
- 800997e: 4630 mov r0, r6
- 8009980: e7dc b.n 800993c <strncmp+0x60>
- 8009982: 4618 mov r0, r3
- 8009984: e7da b.n 800993c <strncmp+0x60>
- 8009986: bf00 nop
- 08009988 <strncpy>:
- 8009988: ea41 0300 orr.w r3, r1, r0
- 800998c: f013 0f03 tst.w r3, #3
- 8009990: 4603 mov r3, r0
- 8009992: b470 push {r4, r5, r6}
- 8009994: d025 beq.n 80099e2 <strncpy+0x5a>
- 8009996: b1aa cbz r2, 80099c4 <strncpy+0x3c>
- 8009998: 780c ldrb r4, [r1, #0]
- 800999a: 3a01 subs r2, #1
- 800999c: f803 4b01 strb.w r4, [r3], #1
- 80099a0: b14c cbz r4, 80099b6 <strncpy+0x2e>
- 80099a2: 461c mov r4, r3
- 80099a4: b172 cbz r2, 80099c4 <strncpy+0x3c>
- 80099a6: f811 5f01 ldrb.w r5, [r1, #1]!
- 80099aa: 3a01 subs r2, #1
- 80099ac: f804 5b01 strb.w r5, [r4], #1
- 80099b0: 4623 mov r3, r4
- 80099b2: 2d00 cmp r5, #0
- 80099b4: d1f6 bne.n 80099a4 <strncpy+0x1c>
- 80099b6: b12a cbz r2, 80099c4 <strncpy+0x3c>
- 80099b8: 189a adds r2, r3, r2
- 80099ba: 2100 movs r1, #0
- 80099bc: f803 1b01 strb.w r1, [r3], #1
- 80099c0: 4293 cmp r3, r2
- 80099c2: d1fb bne.n 80099bc <strncpy+0x34>
- 80099c4: bc70 pop {r4, r5, r6}
- 80099c6: 4770 bx lr
- 80099c8: 460e mov r6, r1
- 80099ca: f851 4b04 ldr.w r4, [r1], #4
- 80099ce: f1a4 3501 sub.w r5, r4, #16843009 ; 0x1010101
- 80099d2: ea25 0504 bic.w r5, r5, r4
- 80099d6: f015 3f80 tst.w r5, #2155905152 ; 0x80808080
- 80099da: d105 bne.n 80099e8 <strncpy+0x60>
- 80099dc: 3a04 subs r2, #4
- 80099de: f843 4b04 str.w r4, [r3], #4
- 80099e2: 2a03 cmp r2, #3
- 80099e4: d8f0 bhi.n 80099c8 <strncpy+0x40>
- 80099e6: e7d6 b.n 8009996 <strncpy+0xe>
- 80099e8: 4631 mov r1, r6
- 80099ea: e7d4 b.n 8009996 <strncpy+0xe>
- 080099ec <_strtol_r>:
- 80099ec: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 80099f0: f240 0400 movw r4, #0
- 80099f4: f2c2 0400 movt r4, #8192 ; 0x2000
- 80099f8: b085 sub sp, #20
- 80099fa: 4699 mov r9, r3
- 80099fc: 460b mov r3, r1
- 80099fe: f8d4 8000 ldr.w r8, [r4]
- 8009a02: 9102 str r1, [sp, #8]
- 8009a04: 9003 str r0, [sp, #12]
- 8009a06: 461c mov r4, r3
- 8009a08: f814 5b01 ldrb.w r5, [r4], #1
- 8009a0c: eb08 0105 add.w r1, r8, r5
- 8009a10: 4623 mov r3, r4
- 8009a12: 7849 ldrb r1, [r1, #1]
- 8009a14: f001 0108 and.w r1, r1, #8
- 8009a18: b2c9 uxtb r1, r1
- 8009a1a: 2900 cmp r1, #0
- 8009a1c: d1f3 bne.n 8009a06 <_strtol_r+0x1a>
- 8009a1e: 2d2d cmp r5, #45 ; 0x2d
- 8009a20: d07b beq.n 8009b1a <_strtol_r+0x12e>
- 8009a22: 2d2b cmp r5, #43 ; 0x2b
- 8009a24: bf05 ittet eq
- 8009a26: 4624 moveq r4, r4
- 8009a28: 460b moveq r3, r1
- 8009a2a: 460b movne r3, r1
- 8009a2c: f814 5b01 ldrbeq.w r5, [r4], #1
- 8009a30: f039 0110 bics.w r1, r9, #16
- 8009a34: d112 bne.n 8009a5c <_strtol_r+0x70>
- 8009a36: f1d9 0001 rsbs r0, r9, #1
- 8009a3a: bf38 it cc
- 8009a3c: 2000 movcc r0, #0
- 8009a3e: 2d30 cmp r5, #48 ; 0x30
- 8009a40: d004 beq.n 8009a4c <_strtol_r+0x60>
- 8009a42: b158 cbz r0, 8009a5c <_strtol_r+0x70>
- 8009a44: f04f 090a mov.w r9, #10
- 8009a48: 46cb mov fp, r9
- 8009a4a: e008 b.n 8009a5e <_strtol_r+0x72>
- 8009a4c: 7821 ldrb r1, [r4, #0]
- 8009a4e: f001 01df and.w r1, r1, #223 ; 0xdf
- 8009a52: 2958 cmp r1, #88 ; 0x58
- 8009a54: d065 beq.n 8009b22 <_strtol_r+0x136>
- 8009a56: b108 cbz r0, 8009a5c <_strtol_r+0x70>
- 8009a58: f04f 0908 mov.w r9, #8
- 8009a5c: 46cb mov fp, r9
- 8009a5e: 2b00 cmp r3, #0
- 8009a60: 4659 mov r1, fp
- 8009a62: bf0c ite eq
- 8009a64: f06f 4600 mvneq.w r6, #2147483648 ; 0x80000000
- 8009a68: f04f 4600 movne.w r6, #2147483648 ; 0x80000000
- 8009a6c: e88d 000c stmia.w sp, {r2, r3}
- 8009a70: 4630 mov r0, r6
- 8009a72: 2700 movs r7, #0
- 8009a74: f7ff fc5a bl 800932c <__aeabi_uidivmod>
- 8009a78: 4630 mov r0, r6
- 8009a7a: 468a mov sl, r1
- 8009a7c: 4659 mov r1, fp
- 8009a7e: f7ff fb27 bl 80090d0 <__aeabi_uidiv>
- 8009a82: 46bc mov ip, r7
- 8009a84: e89d 000c ldmia.w sp, {r2, r3}
- 8009a88: e016 b.n 8009ab8 <_strtol_r+0xcc>
- 8009a8a: 3d30 subs r5, #48 ; 0x30
- 8009a8c: 45a9 cmp r9, r5
- 8009a8e: dd25 ble.n 8009adc <_strtol_r+0xf0>
- 8009a90: 4584 cmp ip, r0
- 8009a92: bf94 ite ls
- 8009a94: 2100 movls r1, #0
- 8009a96: 2101 movhi r1, #1
- 8009a98: ea51 77d7 orrs.w r7, r1, r7, lsr #31
- 8009a9c: d129 bne.n 8009af2 <_strtol_r+0x106>
- 8009a9e: 4555 cmp r5, sl
- 8009aa0: bfd4 ite le
- 8009aa2: 2100 movle r1, #0
- 8009aa4: 2101 movgt r1, #1
- 8009aa6: 4584 cmp ip, r0
- 8009aa8: bf18 it ne
- 8009aaa: 2100 movne r1, #0
- 8009aac: bb09 cbnz r1, 8009af2 <_strtol_r+0x106>
- 8009aae: fb0b 5c0c mla ip, fp, ip, r5
- 8009ab2: 2701 movs r7, #1
- 8009ab4: f814 5b01 ldrb.w r5, [r4], #1
- 8009ab8: eb08 0105 add.w r1, r8, r5
- 8009abc: 7849 ldrb r1, [r1, #1]
- 8009abe: f001 0604 and.w r6, r1, #4
- 8009ac2: b2f6 uxtb r6, r6
- 8009ac4: 2e00 cmp r6, #0
- 8009ac6: d1e0 bne.n 8009a8a <_strtol_r+0x9e>
- 8009ac8: f011 0103 ands.w r1, r1, #3
- 8009acc: d006 beq.n 8009adc <_strtol_r+0xf0>
- 8009ace: 2901 cmp r1, #1
- 8009ad0: bf14 ite ne
- 8009ad2: 2157 movne r1, #87 ; 0x57
- 8009ad4: 2137 moveq r1, #55 ; 0x37
- 8009ad6: 1a6d subs r5, r5, r1
- 8009ad8: 45a9 cmp r9, r5
- 8009ada: dcd9 bgt.n 8009a90 <_strtol_r+0xa4>
- 8009adc: 1c79 adds r1, r7, #1
- 8009ade: d00b beq.n 8009af8 <_strtol_r+0x10c>
- 8009ae0: b9c3 cbnz r3, 8009b14 <_strtol_r+0x128>
- 8009ae2: 4660 mov r0, ip
- 8009ae4: b112 cbz r2, 8009aec <_strtol_r+0x100>
- 8009ae6: b997 cbnz r7, 8009b0e <_strtol_r+0x122>
- 8009ae8: 9b02 ldr r3, [sp, #8]
- 8009aea: 6013 str r3, [r2, #0]
- 8009aec: b005 add sp, #20
- 8009aee: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 8009af2: f04f 37ff mov.w r7, #4294967295
- 8009af6: e7dd b.n 8009ab4 <_strtol_r+0xc8>
- 8009af8: 9903 ldr r1, [sp, #12]
- 8009afa: 2b00 cmp r3, #0
- 8009afc: bf0c ite eq
- 8009afe: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
- 8009b02: f04f 4000 movne.w r0, #2147483648 ; 0x80000000
- 8009b06: 2322 movs r3, #34 ; 0x22
- 8009b08: 600b str r3, [r1, #0]
- 8009b0a: 2a00 cmp r2, #0
- 8009b0c: d0ee beq.n 8009aec <_strtol_r+0x100>
- 8009b0e: 3c01 subs r4, #1
- 8009b10: 9402 str r4, [sp, #8]
- 8009b12: e7e9 b.n 8009ae8 <_strtol_r+0xfc>
- 8009b14: f1cc 0c00 rsb ip, ip, #0
- 8009b18: e7e3 b.n 8009ae2 <_strtol_r+0xf6>
- 8009b1a: f814 5b01 ldrb.w r5, [r4], #1
- 8009b1e: 2301 movs r3, #1
- 8009b20: e786 b.n 8009a30 <_strtol_r+0x44>
- 8009b22: f04f 0910 mov.w r9, #16
- 8009b26: 7865 ldrb r5, [r4, #1]
- 8009b28: 46cb mov fp, r9
- 8009b2a: 3402 adds r4, #2
- 8009b2c: e797 b.n 8009a5e <_strtol_r+0x72>
- 8009b2e: bf00 nop
- 08009b30 <strtol>:
- 8009b30: b430 push {r4, r5}
- 8009b32: f240 0404 movw r4, #4
- 8009b36: f2c2 0400 movt r4, #8192 ; 0x2000
- 8009b3a: 460d mov r5, r1
- 8009b3c: 4613 mov r3, r2
- 8009b3e: 4601 mov r1, r0
- 8009b40: 462a mov r2, r5
- 8009b42: 6820 ldr r0, [r4, #0]
- 8009b44: bc30 pop {r4, r5}
- 8009b46: f7ff bf51 b.w 80099ec <_strtol_r>
- 8009b4a: bf00 nop
- 08009b4c <SystemInit>:
- SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
- #endif
- /* Reset the RCC clock configuration to the default reset state ------------*/
- /* Set HSION bit */
- RCC->CR |= (uint32_t)0x00000001;
- 8009b4c: 4b35 ldr r3, [pc, #212] ; (8009c24 <SystemInit+0xd8>)
- 8009b4e: 681a ldr r2, [r3, #0]
- 8009b50: f042 0201 orr.w r2, r2, #1
- 8009b54: 601a str r2, [r3, #0]
- /* Reset CFGR register */
- RCC->CFGR = 0x00000000;
- 8009b56: 2200 movs r2, #0
- 8009b58: 609a str r2, [r3, #8]
- /* Reset HSEON, CSSON and PLLON bits */
- RCC->CR &= (uint32_t)0xFEF6FFFF;
- 8009b5a: 6819 ldr r1, [r3, #0]
- 8009b5c: f021 7184 bic.w r1, r1, #17301504 ; 0x1080000
- 8009b60: f421 3180 bic.w r1, r1, #65536 ; 0x10000
- 8009b64: 6019 str r1, [r3, #0]
- /* Reset PLLCFGR register */
- RCC->PLLCFGR = 0x24003010;
- 8009b66: 4930 ldr r1, [pc, #192] ; (8009c28 <SystemInit+0xdc>)
- 8009b68: 6059 str r1, [r3, #4]
- /* Reset HSEBYP bit */
- RCC->CR &= (uint32_t)0xFFFBFFFF;
- 8009b6a: 6819 ldr r1, [r3, #0]
- * SystemFrequency variable.
- * @param None
- * @retval None
- */
- void SystemInit(void)
- {
- 8009b6c: b082 sub sp, #8
- /* Reset PLLCFGR register */
- RCC->PLLCFGR = 0x24003010;
- /* Reset HSEBYP bit */
- RCC->CR &= (uint32_t)0xFFFBFFFF;
- 8009b6e: f421 2180 bic.w r1, r1, #262144 ; 0x40000
- 8009b72: 6019 str r1, [r3, #0]
- /* Disable all interrupts */
- RCC->CIR = 0x00000000;
- 8009b74: 60da str r2, [r3, #12]
- static void SetSysClock(void)
- {
- /******************************************************************************/
- /* PLL (clocked by HSE) used as System clock source */
- /******************************************************************************/
- __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
- 8009b76: 9200 str r2, [sp, #0]
- 8009b78: 9201 str r2, [sp, #4]
-
- /* Enable HSE */
- RCC->CR |= ((uint32_t)RCC_CR_HSEON);
- 8009b7a: 681a ldr r2, [r3, #0]
- 8009b7c: f442 3280 orr.w r2, r2, #65536 ; 0x10000
- 8009b80: 601a str r2, [r3, #0]
-
- /* Wait till HSE is ready and if Time out is reached exit */
- do
- {
- HSEStatus = RCC->CR & RCC_CR_HSERDY;
- 8009b82: 681a ldr r2, [r3, #0]
- 8009b84: f402 3200 and.w r2, r2, #131072 ; 0x20000
- 8009b88: 9201 str r2, [sp, #4]
- StartUpCounter++;
- 8009b8a: 9a00 ldr r2, [sp, #0]
- 8009b8c: 3201 adds r2, #1
- 8009b8e: 9200 str r2, [sp, #0]
- } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
- 8009b90: 9a01 ldr r2, [sp, #4]
- 8009b92: b91a cbnz r2, 8009b9c <SystemInit+0x50>
- 8009b94: 9a00 ldr r2, [sp, #0]
- 8009b96: f5b2 6fa0 cmp.w r2, #1280 ; 0x500
- 8009b9a: d1f2 bne.n 8009b82 <SystemInit+0x36>
- if ((RCC->CR & RCC_CR_HSERDY) != RESET)
- 8009b9c: 4b21 ldr r3, [pc, #132] ; (8009c24 <SystemInit+0xd8>)
- 8009b9e: 681b ldr r3, [r3, #0]
- 8009ba0: f413 3300 ands.w r3, r3, #131072 ; 0x20000
- {
- HSEStatus = (uint32_t)0x01;
- 8009ba4: bf18 it ne
- 8009ba6: 2301 movne r3, #1
- }
- else
- {
- HSEStatus = (uint32_t)0x00;
- 8009ba8: 9301 str r3, [sp, #4]
- }
- if (HSEStatus == (uint32_t)0x01)
- 8009baa: 9b01 ldr r3, [sp, #4]
- 8009bac: 2b01 cmp r3, #1
- 8009bae: d133 bne.n 8009c18 <SystemInit+0xcc>
- {
- /* Select regulator voltage output Scale 1 mode, System frequency up to 168 MHz */
- RCC->APB1ENR |= RCC_APB1ENR_PWREN;
- 8009bb0: 4b1c ldr r3, [pc, #112] ; (8009c24 <SystemInit+0xd8>)
- 8009bb2: 6c1a ldr r2, [r3, #64] ; 0x40
- 8009bb4: f042 5280 orr.w r2, r2, #268435456 ; 0x10000000
- 8009bb8: 641a str r2, [r3, #64] ; 0x40
- PWR->CR |= PWR_CR_VOS;
- 8009bba: 4a1c ldr r2, [pc, #112] ; (8009c2c <SystemInit+0xe0>)
- 8009bbc: 6811 ldr r1, [r2, #0]
- 8009bbe: f441 4180 orr.w r1, r1, #16384 ; 0x4000
- 8009bc2: 6011 str r1, [r2, #0]
- /* HCLK = SYSCLK / 1*/
- RCC->CFGR |= RCC_CFGR_HPRE_DIV1;
- 8009bc4: 689a ldr r2, [r3, #8]
- 8009bc6: 609a str r2, [r3, #8]
-
- /* PCLK2 = HCLK / 2*/
- RCC->CFGR |= RCC_CFGR_PPRE2_DIV2;
- 8009bc8: 689a ldr r2, [r3, #8]
- 8009bca: f442 4200 orr.w r2, r2, #32768 ; 0x8000
- 8009bce: 609a str r2, [r3, #8]
-
- /* PCLK1 = HCLK / 4*/
- RCC->CFGR |= RCC_CFGR_PPRE1_DIV4;
- 8009bd0: 689a ldr r2, [r3, #8]
- 8009bd2: f442 52a0 orr.w r2, r2, #5120 ; 0x1400
- 8009bd6: 609a str r2, [r3, #8]
- /* Configure the main PLL */
- RCC->PLLCFGR = PLL_M | (PLL_N << 6) | (((PLL_P >> 1) -1) << 16) |
- 8009bd8: 4a15 ldr r2, [pc, #84] ; (8009c30 <SystemInit+0xe4>)
- 8009bda: 605a str r2, [r3, #4]
- (RCC_PLLCFGR_PLLSRC_HSE) | (PLL_Q << 24);
- /* Enable the main PLL */
- RCC->CR |= RCC_CR_PLLON;
- 8009bdc: 681a ldr r2, [r3, #0]
- 8009bde: f042 7280 orr.w r2, r2, #16777216 ; 0x1000000
- 8009be2: 601a str r2, [r3, #0]
- /* Wait till the main PLL is ready */
- while((RCC->CR & RCC_CR_PLLRDY) == 0)
- 8009be4: 6819 ldr r1, [r3, #0]
- 8009be6: 4a0f ldr r2, [pc, #60] ; (8009c24 <SystemInit+0xd8>)
- 8009be8: 0189 lsls r1, r1, #6
- 8009bea: d5fb bpl.n 8009be4 <SystemInit+0x98>
- {
- }
-
- /* Configure Flash prefetch, Instruction cache, Data cache and wait state */
- FLASH->ACR = FLASH_ACR_ICEN |FLASH_ACR_DCEN |FLASH_ACR_LATENCY_5WS;
- 8009bec: 4b11 ldr r3, [pc, #68] ; (8009c34 <SystemInit+0xe8>)
- 8009bee: f240 6105 movw r1, #1541 ; 0x605
- 8009bf2: 6019 str r1, [r3, #0]
- /* Select the main PLL as system clock source */
- RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
- 8009bf4: 6893 ldr r3, [r2, #8]
- 8009bf6: f023 0303 bic.w r3, r3, #3
- 8009bfa: 6093 str r3, [r2, #8]
- RCC->CFGR |= RCC_CFGR_SW_PLL;
- 8009bfc: 6893 ldr r3, [r2, #8]
- 8009bfe: f043 0302 orr.w r3, r3, #2
- 8009c02: 6093 str r3, [r2, #8]
- /* Wait till the main PLL is used as system clock source */
- while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);
- 8009c04: 6891 ldr r1, [r2, #8]
- 8009c06: 4b07 ldr r3, [pc, #28] ; (8009c24 <SystemInit+0xd8>)
- 8009c08: f001 010c and.w r1, r1, #12
- 8009c0c: 2908 cmp r1, #8
- 8009c0e: d1f9 bne.n 8009c04 <SystemInit+0xb8>
- {
- }
-
- /* Добавил переход на внутренний генератор в случае отказа HSE */
- RCC->CR|=RCC_CR_CSSON;
- 8009c10: 681a ldr r2, [r3, #0]
- 8009c12: f442 2200 orr.w r2, r2, #524288 ; 0x80000
- 8009c16: 601a str r2, [r3, #0]
- /* Configure the Vector Table location add offset address ------------------*/
- #ifdef VECT_TAB_SRAM
- SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
- #else
- SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
- 8009c18: 4b07 ldr r3, [pc, #28] ; (8009c38 <SystemInit+0xec>)
- 8009c1a: f04f 6200 mov.w r2, #134217728 ; 0x8000000
- 8009c1e: 609a str r2, [r3, #8]
- #endif
- }
- 8009c20: b002 add sp, #8
- 8009c22: 4770 bx lr
- 8009c24: 40023800 .word 0x40023800
- 8009c28: 24003010 .word 0x24003010
- 8009c2c: 40007000 .word 0x40007000
- 8009c30: 07405419 .word 0x07405419
- 8009c34: 40023c00 .word 0x40023c00
- 8009c38: e000ed00 .word 0xe000ed00
- 08009c3c <NVIC_Init>:
- /* Check the parameters */
- assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd));
- assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority));
- assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));
-
- if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
- 8009c3c: 78c3 ldrb r3, [r0, #3]
- 8009c3e: b30b cbz r3, 8009c84 <NVIC_Init+0x48>
- {
- /* Compute the Corresponding IRQ Priority --------------------------------*/
- tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
- 8009c40: 4b16 ldr r3, [pc, #88] ; (8009c9c <NVIC_Init+0x60>)
- tmppre = (0x4 - tmppriority);
- tmpsub = tmpsub >> tmppriority;
- tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
- 8009c42: 7841 ldrb r1, [r0, #1]
- assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));
-
- if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
- {
- /* Compute the Corresponding IRQ Priority --------------------------------*/
- tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
- 8009c44: 68db ldr r3, [r3, #12]
- 8009c46: 43db mvns r3, r3
- 8009c48: f3c3 2302 ubfx r3, r3, #8, #3
- tmppre = (0x4 - tmppriority);
- 8009c4c: f1c3 0204 rsb r2, r3, #4
- tmpsub = tmpsub >> tmppriority;
- tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
- 8009c50: b2d2 uxtb r2, r2
- 8009c52: fa01 f202 lsl.w r2, r1, r2
- if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
- {
- /* Compute the Corresponding IRQ Priority --------------------------------*/
- tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
- tmppre = (0x4 - tmppriority);
- tmpsub = tmpsub >> tmppriority;
- 8009c56: 210f movs r1, #15
- 8009c58: fa41 f303 asr.w r3, r1, r3
- tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
- tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub);
- 8009c5c: 7881 ldrb r1, [r0, #2]
- /* Compute the Corresponding IRQ Priority --------------------------------*/
- tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08;
- tmppre = (0x4 - tmppriority);
- tmpsub = tmpsub >> tmppriority;
- tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
- 8009c5e: b2d2 uxtb r2, r2
- tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub);
- 8009c60: 400b ands r3, r1
- 8009c62: 431a orrs r2, r3
-
- tmppriority = tmppriority << 0x04;
-
- NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
- 8009c64: 7803 ldrb r3, [r0, #0]
- 8009c66: f103 4360 add.w r3, r3, #3758096384 ; 0xe0000000
- 8009c6a: f503 4361 add.w r3, r3, #57600 ; 0xe100
- tmpsub = tmpsub >> tmppriority;
- tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre;
- tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub);
-
- tmppriority = tmppriority << 0x04;
- 8009c6e: 0112 lsls r2, r2, #4
-
- NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
- 8009c70: f883 2300 strb.w r2, [r3, #768] ; 0x300
-
- /* Enable the Selected IRQ Channels --------------------------------------*/
- NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
- 8009c74: 7803 ldrb r3, [r0, #0]
- (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
- 8009c76: 2201 movs r2, #1
- tmppriority = tmppriority << 0x04;
-
- NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
-
- /* Enable the Selected IRQ Channels --------------------------------------*/
- NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
- 8009c78: 0959 lsrs r1, r3, #5
- (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
- 8009c7a: f003 031f and.w r3, r3, #31
- 8009c7e: fa02 f303 lsl.w r3, r2, r3
- 8009c82: e007 b.n 8009c94 <NVIC_Init+0x58>
- }
- else
- {
- /* Disable the Selected IRQ Channels -------------------------------------*/
- NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
- 8009c84: 7803 ldrb r3, [r0, #0]
- (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
- 8009c86: 2201 movs r2, #1
- (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
- }
- else
- {
- /* Disable the Selected IRQ Channels -------------------------------------*/
- NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
- 8009c88: 0959 lsrs r1, r3, #5
- (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
- 8009c8a: f003 031f and.w r3, r3, #31
- 8009c8e: fa02 f303 lsl.w r3, r2, r3
- (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F);
- }
- else
- {
- /* Disable the Selected IRQ Channels -------------------------------------*/
- NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] =
- 8009c92: 3120 adds r1, #32
- 8009c94: 4a02 ldr r2, [pc, #8] ; (8009ca0 <NVIC_Init+0x64>)
- 8009c96: f842 3021 str.w r3, [r2, r1, lsl #2]
- 8009c9a: 4770 bx lr
- 8009c9c: e000ed00 .word 0xe000ed00
- 8009ca0: e000e100 .word 0xe000e100
- 08009ca4 <CRC_ResetDR>:
- * @retval None
- */
- void CRC_ResetDR(void)
- {
- /* Reset CRC generator */
- CRC->CR = CRC_CR_RESET;
- 8009ca4: 4b01 ldr r3, [pc, #4] ; (8009cac <CRC_ResetDR+0x8>)
- 8009ca6: 2201 movs r2, #1
- 8009ca8: 609a str r2, [r3, #8]
- 8009caa: 4770 bx lr
- 8009cac: 40023000 .word 0x40023000
- 08009cb0 <CRC_CalcBlockCRC>:
- * @param pBuffer: pointer to the buffer containing the data to be computed
- * @param BufferLength: length of the buffer to be computed
- * @retval 32-bit CRC
- */
- uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
- {
- 8009cb0: b510 push {r4, lr}
- uint32_t index = 0;
-
- for(index = 0; index < BufferLength; index++)
- 8009cb2: 2300 movs r3, #0
- 8009cb4: 4c05 ldr r4, [pc, #20] ; (8009ccc <CRC_CalcBlockCRC+0x1c>)
- 8009cb6: e003 b.n 8009cc0 <CRC_CalcBlockCRC+0x10>
- {
- CRC->DR = pBuffer[index];
- 8009cb8: f850 2023 ldr.w r2, [r0, r3, lsl #2]
- */
- uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
- {
- uint32_t index = 0;
-
- for(index = 0; index < BufferLength; index++)
- 8009cbc: 3301 adds r3, #1
- {
- CRC->DR = pBuffer[index];
- 8009cbe: 6022 str r2, [r4, #0]
- */
- uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
- {
- uint32_t index = 0;
-
- for(index = 0; index < BufferLength; index++)
- 8009cc0: 428b cmp r3, r1
- 8009cc2: d1f9 bne.n 8009cb8 <CRC_CalcBlockCRC+0x8>
- {
- CRC->DR = pBuffer[index];
- }
- return (CRC->DR);
- 8009cc4: 4b01 ldr r3, [pc, #4] ; (8009ccc <CRC_CalcBlockCRC+0x1c>)
- 8009cc6: 6818 ldr r0, [r3, #0]
- }
- 8009cc8: bd10 pop {r4, pc}
- 8009cca: bf00 nop
- 8009ccc: 40023000 .word 0x40023000
- 08009cd0 <FLASH_Unlock>:
- * @param None
- * @retval None
- */
- void FLASH_Unlock(void)
- {
- if((FLASH->CR & FLASH_CR_LOCK) != RESET)
- 8009cd0: 4b04 ldr r3, [pc, #16] ; (8009ce4 <FLASH_Unlock+0x14>)
- 8009cd2: 691a ldr r2, [r3, #16]
- 8009cd4: 2a00 cmp r2, #0
- 8009cd6: da04 bge.n 8009ce2 <FLASH_Unlock+0x12>
- {
- /* Authorize the FLASH Registers access */
- FLASH->KEYR = FLASH_KEY1;
- 8009cd8: 4a03 ldr r2, [pc, #12] ; (8009ce8 <FLASH_Unlock+0x18>)
- 8009cda: 605a str r2, [r3, #4]
- FLASH->KEYR = FLASH_KEY2;
- 8009cdc: f102 3288 add.w r2, r2, #2290649224 ; 0x88888888
- 8009ce0: 605a str r2, [r3, #4]
- 8009ce2: 4770 bx lr
- 8009ce4: 40023c00 .word 0x40023c00
- 8009ce8: 45670123 .word 0x45670123
- 08009cec <FLASH_Lock>:
- * @retval None
- */
- void FLASH_Lock(void)
- {
- /* Set the LOCK Bit to lock the FLASH Registers access */
- FLASH->CR |= FLASH_CR_LOCK;
- 8009cec: 4b02 ldr r3, [pc, #8] ; (8009cf8 <FLASH_Lock+0xc>)
- 8009cee: 691a ldr r2, [r3, #16]
- 8009cf0: f042 4200 orr.w r2, r2, #2147483648 ; 0x80000000
- 8009cf4: 611a str r2, [r3, #16]
- 8009cf6: 4770 bx lr
- 8009cf8: 40023c00 .word 0x40023c00
- 08009cfc <FLASH_GetStatus>:
- */
- FLASH_Status FLASH_GetStatus(void)
- {
- FLASH_Status flashstatus = FLASH_COMPLETE;
-
- if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY)
- 8009cfc: 4b0b ldr r3, [pc, #44] ; (8009d2c <FLASH_GetStatus+0x30>)
- 8009cfe: 68da ldr r2, [r3, #12]
- 8009d00: 03d0 lsls r0, r2, #15
- 8009d02: d40d bmi.n 8009d20 <FLASH_GetStatus+0x24>
- {
- flashstatus = FLASH_BUSY;
- }
- else
- {
- if((FLASH->SR & FLASH_FLAG_WRPERR) != (uint32_t)0x00)
- 8009d04: 68da ldr r2, [r3, #12]
- 8009d06: 06d1 lsls r1, r2, #27
- 8009d08: d40c bmi.n 8009d24 <FLASH_GetStatus+0x28>
- {
- flashstatus = FLASH_ERROR_WRP;
- }
- else
- {
- if((FLASH->SR & (uint32_t)0xEF) != (uint32_t)0x00)
- 8009d0a: 68da ldr r2, [r3, #12]
- 8009d0c: f012 0fef tst.w r2, #239 ; 0xef
- 8009d10: d10a bne.n 8009d28 <FLASH_GetStatus+0x2c>
- {
- flashstatus = FLASH_ERROR_PROGRAM;
- }
- else
- {
- if((FLASH->SR & FLASH_FLAG_OPERR) != (uint32_t)0x00)
- 8009d12: 68db ldr r3, [r3, #12]
- 8009d14: f013 0f02 tst.w r3, #2
- {
- flashstatus = FLASH_ERROR_OPERATION;
- 8009d18: bf0c ite eq
- 8009d1a: 2008 moveq r0, #8
- 8009d1c: 2007 movne r0, #7
- 8009d1e: 4770 bx lr
- {
- FLASH_Status flashstatus = FLASH_COMPLETE;
-
- if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY)
- {
- flashstatus = FLASH_BUSY;
- 8009d20: 2001 movs r0, #1
- 8009d22: 4770 bx lr
- }
- else
- {
- if((FLASH->SR & FLASH_FLAG_WRPERR) != (uint32_t)0x00)
- {
- flashstatus = FLASH_ERROR_WRP;
- 8009d24: 2005 movs r0, #5
- 8009d26: 4770 bx lr
- }
- else
- {
- if((FLASH->SR & (uint32_t)0xEF) != (uint32_t)0x00)
- {
- flashstatus = FLASH_ERROR_PROGRAM;
- 8009d28: 2006 movs r0, #6
- }
- }
- }
- /* Return the FLASH Status */
- return flashstatus;
- }
- 8009d2a: 4770 bx lr
- 8009d2c: 40023c00 .word 0x40023c00
- 08009d30 <FLASH_WaitForLastOperation>:
- * @param None
- * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
- * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
- */
- FLASH_Status FLASH_WaitForLastOperation(void)
- {
- 8009d30: b507 push {r0, r1, r2, lr}
- __IO FLASH_Status status = FLASH_COMPLETE;
- 8009d32: 2308 movs r3, #8
- 8009d34: f88d 3007 strb.w r3, [sp, #7]
- /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset.
- Even if the FLASH operation fails, the BUSY flag will be reset and an error
- flag will be set */
- while(status == FLASH_BUSY)
- {
- status = FLASH_GetStatus();
- 8009d38: f7ff ffe0 bl 8009cfc <FLASH_GetStatus>
- 8009d3c: f88d 0007 strb.w r0, [sp, #7]
- status = FLASH_GetStatus();
- /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset.
- Even if the FLASH operation fails, the BUSY flag will be reset and an error
- flag will be set */
- while(status == FLASH_BUSY)
- 8009d40: f89d 3007 ldrb.w r3, [sp, #7]
- 8009d44: 2b01 cmp r3, #1
- 8009d46: d0f7 beq.n 8009d38 <FLASH_WaitForLastOperation+0x8>
- {
- status = FLASH_GetStatus();
- }
- /* Return the operation status */
- return status;
- 8009d48: f89d 0007 ldrb.w r0, [sp, #7]
- }
- 8009d4c: bd0e pop {r1, r2, r3, pc}
- 8009d4e: 0000 movs r0, r0
- 08009d50 <FLASH_ProgramByte>:
- * @param Data: specifies the data to be programmed.
- * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
- * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
- */
- FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
- {
- 8009d50: b570 push {r4, r5, r6, lr}
- 8009d52: 4605 mov r5, r0
- 8009d54: 460e mov r6, r1
- /* Check the parameters */
- assert_param(IS_FLASH_ADDRESS(Address));
- /* Wait for last operation to be completed */
- status = FLASH_WaitForLastOperation();
- 8009d56: f7ff ffeb bl 8009d30 <FLASH_WaitForLastOperation>
-
- if(status == FLASH_COMPLETE)
- 8009d5a: 2808 cmp r0, #8
- 8009d5c: d111 bne.n 8009d82 <FLASH_ProgramByte+0x32>
- {
- /* if the previous operation is completed, proceed to program the new data */
- FLASH->CR &= CR_PSIZE_MASK;
- 8009d5e: 4c09 ldr r4, [pc, #36] ; (8009d84 <FLASH_ProgramByte+0x34>)
- 8009d60: 6923 ldr r3, [r4, #16]
- 8009d62: f423 7340 bic.w r3, r3, #768 ; 0x300
- 8009d66: 6123 str r3, [r4, #16]
- FLASH->CR |= FLASH_PSIZE_BYTE;
- 8009d68: 6923 ldr r3, [r4, #16]
- 8009d6a: 6123 str r3, [r4, #16]
- FLASH->CR |= FLASH_CR_PG;
- 8009d6c: 6923 ldr r3, [r4, #16]
- 8009d6e: f043 0301 orr.w r3, r3, #1
- 8009d72: 6123 str r3, [r4, #16]
-
- *(__IO uint8_t*)Address = Data;
- 8009d74: 702e strb r6, [r5, #0]
-
- /* Wait for last operation to be completed */
- status = FLASH_WaitForLastOperation();
- 8009d76: f7ff ffdb bl 8009d30 <FLASH_WaitForLastOperation>
- /* if the program operation is completed, disable the PG Bit */
- FLASH->CR &= (~FLASH_CR_PG);
- 8009d7a: 6923 ldr r3, [r4, #16]
- 8009d7c: f023 0301 bic.w r3, r3, #1
- 8009d80: 6123 str r3, [r4, #16]
- }
- /* Return the Program Status */
- return status;
- }
- 8009d82: bd70 pop {r4, r5, r6, pc}
- 8009d84: 40023c00 .word 0x40023c00
- 08009d88 <FLASH_ProgramWord>:
- * @param Data: specifies the data to be programmed.
- * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
- * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
- */
- FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
- {
- 8009d88: b570 push {r4, r5, r6, lr}
- 8009d8a: 4605 mov r5, r0
- 8009d8c: 460e mov r6, r1
- /* Check the parameters */
- assert_param(IS_FLASH_ADDRESS(Address));
- /* Wait for last operation to be completed */
- status = FLASH_WaitForLastOperation();
- 8009d8e: f7ff ffcf bl 8009d30 <FLASH_WaitForLastOperation>
-
- if(status == FLASH_COMPLETE)
- 8009d92: 2808 cmp r0, #8
- 8009d94: d113 bne.n 8009dbe <FLASH_ProgramWord+0x36>
- {
- /* if the previous operation is completed, proceed to program the new data */
- FLASH->CR &= CR_PSIZE_MASK;
- 8009d96: 4c0a ldr r4, [pc, #40] ; (8009dc0 <FLASH_ProgramWord+0x38>)
- 8009d98: 6923 ldr r3, [r4, #16]
- 8009d9a: f423 7340 bic.w r3, r3, #768 ; 0x300
- 8009d9e: 6123 str r3, [r4, #16]
- FLASH->CR |= FLASH_PSIZE_WORD;
- 8009da0: 6923 ldr r3, [r4, #16]
- 8009da2: f443 7300 orr.w r3, r3, #512 ; 0x200
- 8009da6: 6123 str r3, [r4, #16]
- FLASH->CR |= FLASH_CR_PG;
- 8009da8: 6923 ldr r3, [r4, #16]
- 8009daa: f043 0301 orr.w r3, r3, #1
- 8009dae: 6123 str r3, [r4, #16]
-
- *(__IO uint32_t*)Address = Data;
- 8009db0: 602e str r6, [r5, #0]
-
- /* Wait for last operation to be completed */
- status = FLASH_WaitForLastOperation();
- 8009db2: f7ff ffbd bl 8009d30 <FLASH_WaitForLastOperation>
- /* if the program operation is completed, disable the PG Bit */
- FLASH->CR &= (~FLASH_CR_PG);
- 8009db6: 6923 ldr r3, [r4, #16]
- 8009db8: f023 0301 bic.w r3, r3, #1
- 8009dbc: 6123 str r3, [r4, #16]
- }
- /* Return the Program Status */
- return status;
- }
- 8009dbe: bd70 pop {r4, r5, r6, pc}
- 8009dc0: 40023c00 .word 0x40023c00
- 08009dc4 <FLASH_EraseSector>:
- *
- * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM,
- * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
- */
- FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
- {
- 8009dc4: b570 push {r4, r5, r6, lr}
- 8009dc6: 4606 mov r6, r0
- /* Check the parameters */
- assert_param(IS_FLASH_SECTOR(FLASH_Sector));
- assert_param(IS_VOLTAGERANGE(VoltageRange));
-
- if(VoltageRange == VoltageRange_1)
- 8009dc8: b141 cbz r1, 8009ddc <FLASH_EraseSector+0x18>
- {
- tmp_psize = FLASH_PSIZE_BYTE;
- }
- else if(VoltageRange == VoltageRange_2)
- 8009dca: 2901 cmp r1, #1
- 8009dcc: d008 beq.n 8009de0 <FLASH_EraseSector+0x1c>
- {
- tmp_psize = FLASH_PSIZE_HALF_WORD;
- }
- else if(VoltageRange == VoltageRange_3)
- {
- tmp_psize = FLASH_PSIZE_WORD;
- 8009dce: 2902 cmp r1, #2
- 8009dd0: bf14 ite ne
- 8009dd2: f44f 7540 movne.w r5, #768 ; 0x300
- 8009dd6: f44f 7500 moveq.w r5, #512 ; 0x200
- 8009dda: e003 b.n 8009de4 <FLASH_EraseSector+0x20>
- assert_param(IS_FLASH_SECTOR(FLASH_Sector));
- assert_param(IS_VOLTAGERANGE(VoltageRange));
-
- if(VoltageRange == VoltageRange_1)
- {
- tmp_psize = FLASH_PSIZE_BYTE;
- 8009ddc: 460d mov r5, r1
- 8009dde: e001 b.n 8009de4 <FLASH_EraseSector+0x20>
- }
- else if(VoltageRange == VoltageRange_2)
- {
- tmp_psize = FLASH_PSIZE_HALF_WORD;
- 8009de0: f44f 7580 mov.w r5, #256 ; 0x100
- else
- {
- tmp_psize = FLASH_PSIZE_DOUBLE_WORD;
- }
- /* Wait for last operation to be completed */
- status = FLASH_WaitForLastOperation();
- 8009de4: f7ff ffa4 bl 8009d30 <FLASH_WaitForLastOperation>
-
- if(status == FLASH_COMPLETE)
- 8009de8: 2808 cmp r0, #8
- 8009dea: d11e bne.n 8009e2a <FLASH_EraseSector+0x66>
- {
- /* if the previous operation is completed, proceed to erase the sector */
- FLASH->CR &= CR_PSIZE_MASK;
- 8009dec: 4c0f ldr r4, [pc, #60] ; (8009e2c <FLASH_EraseSector+0x68>)
- 8009dee: 6923 ldr r3, [r4, #16]
- 8009df0: f423 7340 bic.w r3, r3, #768 ; 0x300
- 8009df4: 6123 str r3, [r4, #16]
- FLASH->CR |= tmp_psize;
- 8009df6: 6921 ldr r1, [r4, #16]
- 8009df8: 430d orrs r5, r1
- 8009dfa: 6125 str r5, [r4, #16]
- FLASH->CR &= SECTOR_MASK;
- 8009dfc: 6923 ldr r3, [r4, #16]
- 8009dfe: f023 03f8 bic.w r3, r3, #248 ; 0xf8
- 8009e02: 6123 str r3, [r4, #16]
- FLASH->CR |= FLASH_CR_SER | FLASH_Sector;
- 8009e04: 6923 ldr r3, [r4, #16]
- 8009e06: f043 0302 orr.w r3, r3, #2
- 8009e0a: 431e orrs r6, r3
- 8009e0c: 6126 str r6, [r4, #16]
- FLASH->CR |= FLASH_CR_STRT;
- 8009e0e: 6923 ldr r3, [r4, #16]
- 8009e10: f443 3380 orr.w r3, r3, #65536 ; 0x10000
- 8009e14: 6123 str r3, [r4, #16]
-
- /* Wait for last operation to be completed */
- status = FLASH_WaitForLastOperation();
- 8009e16: f7ff ff8b bl 8009d30 <FLASH_WaitForLastOperation>
-
- /* if the erase operation is completed, disable the SER Bit */
- FLASH->CR &= (~FLASH_CR_SER);
- 8009e1a: 6923 ldr r3, [r4, #16]
- 8009e1c: f023 0302 bic.w r3, r3, #2
- 8009e20: 6123 str r3, [r4, #16]
- FLASH->CR &= SECTOR_MASK;
- 8009e22: 6923 ldr r3, [r4, #16]
- 8009e24: f023 03f8 bic.w r3, r3, #248 ; 0xf8
- 8009e28: 6123 str r3, [r4, #16]
- }
- /* Return the Erase Status */
- return status;
- }
- 8009e2a: bd70 pop {r4, r5, r6, pc}
- 8009e2c: 40023c00 .word 0x40023c00
- 08009e30 <GPIO_Init>:
- * @param GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that contains
- * the configuration information for the specified GPIO peripheral.
- * @retval None
- */
- void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
- {
- 8009e30: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- /*-- GPIO Mode Configuration --*/
- for (pinpos = 0x00; pinpos < 0x10; pinpos++)
- {
- pos = ((uint32_t)0x01) << pinpos;
- /* Get the port pins position */
- currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
- 8009e34: 680f ldr r7, [r1, #0]
- assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode));
- assert_param(IS_GPIO_PUPD(GPIO_InitStruct->GPIO_PuPd));
- /* -------------------------Configure the port pins---------------- */
- /*-- GPIO Mode Configuration --*/
- for (pinpos = 0x00; pinpos < 0x10; pinpos++)
- 8009e36: 2300 movs r3, #0
- {
- pos = ((uint32_t)0x01) << pinpos;
- 8009e38: f04f 0c01 mov.w ip, #1
- /* Get the port pins position */
- currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
- if (currentpin == pos)
- {
- GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
- 8009e3c: f04f 0803 mov.w r8, #3
- /* -------------------------Configure the port pins---------------- */
- /*-- GPIO Mode Configuration --*/
- for (pinpos = 0x00; pinpos < 0x10; pinpos++)
- {
- pos = ((uint32_t)0x01) << pinpos;
- 8009e40: fa0c f203 lsl.w r2, ip, r3
- /* Get the port pins position */
- currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
- 8009e44: ea02 0507 and.w r5, r2, r7
- if (currentpin == pos)
- 8009e48: 4295 cmp r5, r2
- 8009e4a: d131 bne.n 8009eb0 <GPIO_Init+0x80>
- * @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
- * @param GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that contains
- * the configuration information for the specified GPIO peripheral.
- * @retval None
- */
- void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)
- 8009e4c: 005a lsls r2, r3, #1
- /* Get the port pins position */
- currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
- if (currentpin == pos)
- {
- GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
- 8009e4e: 6806 ldr r6, [r0, #0]
- 8009e50: fa08 f402 lsl.w r4, r8, r2
- 8009e54: 43e4 mvns r4, r4
- 8009e56: 4026 ands r6, r4
- 8009e58: 6006 str r6, [r0, #0]
- GPIOx->MODER |= (((uint32_t)GPIO_InitStruct->GPIO_Mode) << (pinpos * 2));
- 8009e5a: 790e ldrb r6, [r1, #4]
- 8009e5c: f8d0 9000 ldr.w r9, [r0]
- 8009e60: fa06 fa02 lsl.w sl, r6, r2
- if ((GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) || (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_AF))
- 8009e64: 3e01 subs r6, #1
- currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
- if (currentpin == pos)
- {
- GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
- GPIOx->MODER |= (((uint32_t)GPIO_InitStruct->GPIO_Mode) << (pinpos * 2));
- 8009e66: ea4a 0909 orr.w r9, sl, r9
- if ((GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) || (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_AF))
- 8009e6a: 2e01 cmp r6, #1
- currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
- if (currentpin == pos)
- {
- GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (pinpos * 2));
- GPIOx->MODER |= (((uint32_t)GPIO_InitStruct->GPIO_Mode) << (pinpos * 2));
- 8009e6c: f8c0 9000 str.w r9, [r0]
- if ((GPIO_InitStruct->GPIO_Mode == GPIO_Mode_OUT) || (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_AF))
- 8009e70: d815 bhi.n 8009e9e <GPIO_Init+0x6e>
- {
- /* Check Speed mode parameters */
- assert_param(IS_GPIO_SPEED(GPIO_InitStruct->GPIO_Speed));
- /* Speed mode configuration */
- GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (pinpos * 2));
- 8009e72: 6886 ldr r6, [r0, #8]
- GPIOx->OSPEEDR |= ((uint32_t)(GPIO_InitStruct->GPIO_Speed) << (pinpos * 2));
- 8009e74: f891 9005 ldrb.w r9, [r1, #5]
- {
- /* Check Speed mode parameters */
- assert_param(IS_GPIO_SPEED(GPIO_InitStruct->GPIO_Speed));
- /* Speed mode configuration */
- GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (pinpos * 2));
- 8009e78: 4026 ands r6, r4
- 8009e7a: 6086 str r6, [r0, #8]
- GPIOx->OSPEEDR |= ((uint32_t)(GPIO_InitStruct->GPIO_Speed) << (pinpos * 2));
- 8009e7c: 6886 ldr r6, [r0, #8]
- 8009e7e: fa09 f902 lsl.w r9, r9, r2
- 8009e82: ea49 0606 orr.w r6, r9, r6
- 8009e86: 6086 str r6, [r0, #8]
- /* Check Output mode parameters */
- assert_param(IS_GPIO_OTYPE(GPIO_InitStruct->GPIO_OType));
- /* Output mode configuration*/
- GPIOx->OTYPER &= ~((GPIO_OTYPER_OT_0) << ((uint16_t)pinpos)) ;
- 8009e88: 6846 ldr r6, [r0, #4]
- 8009e8a: ea26 0505 bic.w r5, r6, r5
- 8009e8e: 6045 str r5, [r0, #4]
- GPIOx->OTYPER |= (uint16_t)(((uint16_t)GPIO_InitStruct->GPIO_OType) << ((uint16_t)pinpos));
- 8009e90: 798d ldrb r5, [r1, #6]
- 8009e92: 6846 ldr r6, [r0, #4]
- 8009e94: fa05 f503 lsl.w r5, r5, r3
-
- temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp;
- GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2;
- }
- 8009e98: b2ad uxth r5, r5
- /* Check Output mode parameters */
- assert_param(IS_GPIO_OTYPE(GPIO_InitStruct->GPIO_OType));
- /* Output mode configuration*/
- GPIOx->OTYPER &= ~((GPIO_OTYPER_OT_0) << ((uint16_t)pinpos)) ;
- GPIOx->OTYPER |= (uint16_t)(((uint16_t)GPIO_InitStruct->GPIO_OType) << ((uint16_t)pinpos));
- 8009e9a: 4335 orrs r5, r6
- 8009e9c: 6045 str r5, [r0, #4]
- }
- /* Pull-up Pull down resistor configuration*/
- GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << ((uint16_t)pinpos * 2));
- 8009e9e: 68c5 ldr r5, [r0, #12]
- 8009ea0: 402c ands r4, r5
- 8009ea2: 60c4 str r4, [r0, #12]
- GPIOx->PUPDR |= (((uint32_t)GPIO_InitStruct->GPIO_PuPd) << (pinpos * 2));
- 8009ea4: 79cd ldrb r5, [r1, #7]
- 8009ea6: 68c4 ldr r4, [r0, #12]
- 8009ea8: fa05 f202 lsl.w r2, r5, r2
- 8009eac: 4322 orrs r2, r4
- 8009eae: 60c2 str r2, [r0, #12]
- assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode));
- assert_param(IS_GPIO_PUPD(GPIO_InitStruct->GPIO_PuPd));
- /* -------------------------Configure the port pins---------------- */
- /*-- GPIO Mode Configuration --*/
- for (pinpos = 0x00; pinpos < 0x10; pinpos++)
- 8009eb0: 3301 adds r3, #1
- 8009eb2: 2b10 cmp r3, #16
- 8009eb4: d1c4 bne.n 8009e40 <GPIO_Init+0x10>
- /* Pull-up Pull down resistor configuration*/
- GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << ((uint16_t)pinpos * 2));
- GPIOx->PUPDR |= (((uint32_t)GPIO_InitStruct->GPIO_PuPd) << (pinpos * 2));
- }
- }
- }
- 8009eb6: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 08009eba <GPIO_ReadInputDataBit>:
- /* Check the parameters */
- assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
- assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
- if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)Bit_RESET)
- 8009eba: 6903 ldr r3, [r0, #16]
- 8009ebc: 4219 tst r1, r3
- else
- {
- bitstatus = (uint8_t)Bit_RESET;
- }
- return bitstatus;
- }
- 8009ebe: bf0c ite eq
- 8009ec0: 2000 moveq r0, #0
- 8009ec2: 2001 movne r0, #1
- 8009ec4: 4770 bx lr
- 08009ec6 <GPIO_SetBits>:
- {
- /* Check the parameters */
- assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
- assert_param(IS_GPIO_PIN(GPIO_Pin));
- GPIOx->BSRRL = GPIO_Pin;
- 8009ec6: 8301 strh r1, [r0, #24]
- 8009ec8: 4770 bx lr
- 08009eca <GPIO_ResetBits>:
- {
- /* Check the parameters */
- assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
- assert_param(IS_GPIO_PIN(GPIO_Pin));
- GPIOx->BSRRH = GPIO_Pin;
- 8009eca: 8341 strh r1, [r0, #26]
- 8009ecc: 4770 bx lr
- 08009ece <GPIO_PinAFConfig>:
- /* Check the parameters */
- assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
- assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
- assert_param(IS_GPIO_AF(GPIO_AF));
-
- temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- 8009ece: f001 0307 and.w r3, r1, #7
- GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- 8009ed2: 08c9 lsrs r1, r1, #3
- 8009ed4: 3108 adds r1, #8
- * @arg GPIO_AF_DCMI: Connect DCMI pins to AF13
- * @arg GPIO_AF_EVENTOUT: Connect EVENTOUT pins to AF15
- * @retval None
- */
- void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
- {
- 8009ed6: b530 push {r4, r5, lr}
- /* Check the parameters */
- assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
- assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
- assert_param(IS_GPIO_AF(GPIO_AF));
-
- temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- 8009ed8: 009b lsls r3, r3, #2
- GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- 8009eda: f850 5021 ldr.w r5, [r0, r1, lsl #2]
- 8009ede: 240f movs r4, #15
- 8009ee0: fa04 f403 lsl.w r4, r4, r3
- 8009ee4: ea25 0404 bic.w r4, r5, r4
- 8009ee8: f840 4021 str.w r4, [r0, r1, lsl #2]
- temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp;
- 8009eec: f850 4021 ldr.w r4, [r0, r1, lsl #2]
- /* Check the parameters */
- assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
- assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
- assert_param(IS_GPIO_AF(GPIO_AF));
-
- temp = ((uint32_t)(GPIO_AF) << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- 8009ef0: fa02 f203 lsl.w r2, r2, r3
- GPIOx->AFR[GPIO_PinSource >> 0x03] &= ~((uint32_t)0xF << ((uint32_t)((uint32_t)GPIO_PinSource & (uint32_t)0x07) * 4)) ;
- temp_2 = GPIOx->AFR[GPIO_PinSource >> 0x03] | temp;
- 8009ef4: 4314 orrs r4, r2
- GPIOx->AFR[GPIO_PinSource >> 0x03] = temp_2;
- 8009ef6: f840 4021 str.w r4, [r0, r1, lsl #2]
- 8009efa: bd30 pop {r4, r5, pc}
- 08009efc <PWR_BackupAccessCmd>:
- void PWR_BackupAccessCmd(FunctionalState NewState)
- {
- /* Check the parameters */
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- *(__IO uint32_t *) CR_DBP_BB = (uint32_t)NewState;
- 8009efc: 4b01 ldr r3, [pc, #4] ; (8009f04 <PWR_BackupAccessCmd+0x8>)
- 8009efe: 6018 str r0, [r3, #0]
- 8009f00: 4770 bx lr
- 8009f02: bf00 nop
- 8009f04: 420e0020 .word 0x420e0020
- 08009f08 <RCC_GetClocksFreq>:
- void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)
- {
- uint32_t tmp = 0, presc = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
- /* Get SYSCLK source -------------------------------------------------------*/
- tmp = RCC->CFGR & RCC_CFGR_SWS;
- 8009f08: 4b1e ldr r3, [pc, #120] ; (8009f84 <RCC_GetClocksFreq+0x7c>)
- 8009f0a: 689a ldr r2, [r3, #8]
- 8009f0c: f002 020c and.w r2, r2, #12
- switch (tmp)
- 8009f10: 2a04 cmp r2, #4
- * configuration based on this function will be incorrect.
- *
- * @retval None
- */
- void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)
- {
- 8009f12: b510 push {r4, lr}
- uint32_t tmp = 0, presc = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
- /* Get SYSCLK source -------------------------------------------------------*/
- tmp = RCC->CFGR & RCC_CFGR_SWS;
- switch (tmp)
- 8009f14: d003 beq.n 8009f1e <RCC_GetClocksFreq+0x16>
- 8009f16: 2a08 cmp r2, #8
- 8009f18: d003 beq.n 8009f22 <RCC_GetClocksFreq+0x1a>
- 8009f1a: 4b1b ldr r3, [pc, #108] ; (8009f88 <RCC_GetClocksFreq+0x80>)
- 8009f1c: e018 b.n 8009f50 <RCC_GetClocksFreq+0x48>
- {
- case 0x00: /* HSI used as system clock source */
- RCC_Clocks->SYSCLK_Frequency = HSI_VALUE;
- break;
- case 0x04: /* HSE used as system clock source */
- RCC_Clocks->SYSCLK_Frequency = HSE_VALUE;
- 8009f1e: 4b1b ldr r3, [pc, #108] ; (8009f8c <RCC_GetClocksFreq+0x84>)
- 8009f20: e016 b.n 8009f50 <RCC_GetClocksFreq+0x48>
- case 0x08: /* PLL used as system clock source */
- /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN
- SYSCLK = PLL_VCO / PLLP
- */
- pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22;
- 8009f22: 6859 ldr r1, [r3, #4]
- pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
- 8009f24: 685a ldr r2, [r3, #4]
-
- if (pllsource != 0)
- 8009f26: f411 0f80 tst.w r1, #4194304 ; 0x400000
- {
- /* HSE used as PLL clock source */
- pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- 8009f2a: 6859 ldr r1, [r3, #4]
- 8009f2c: bf14 ite ne
- 8009f2e: 4b17 ldrne r3, [pc, #92] ; (8009f8c <RCC_GetClocksFreq+0x84>)
- }
- else
- {
- /* HSI used as PLL clock source */
- pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- 8009f30: 4b15 ldreq r3, [pc, #84] ; (8009f88 <RCC_GetClocksFreq+0x80>)
- /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN
- SYSCLK = PLL_VCO / PLLP
- */
- pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22;
- pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
- 8009f32: f002 023f and.w r2, r2, #63 ; 0x3f
- pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- }
- else
- {
- /* HSI used as PLL clock source */
- pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- 8009f36: fbb3 f3f2 udiv r3, r3, r2
- }
- pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
- 8009f3a: 4a12 ldr r2, [pc, #72] ; (8009f84 <RCC_GetClocksFreq+0x7c>)
- 8009f3c: 6852 ldr r2, [r2, #4]
- 8009f3e: f3c2 4201 ubfx r2, r2, #16, #2
- pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
-
- if (pllsource != 0)
- {
- /* HSE used as PLL clock source */
- pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- 8009f42: f3c1 1188 ubfx r1, r1, #6, #9
- {
- /* HSI used as PLL clock source */
- pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- }
- pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
- 8009f46: 3201 adds r2, #1
- pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- }
- else
- {
- /* HSI used as PLL clock source */
- pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- 8009f48: 434b muls r3, r1
- }
- pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
- 8009f4a: 0052 lsls r2, r2, #1
- RCC_Clocks->SYSCLK_Frequency = pllvco/pllp;
- 8009f4c: fbb3 f3f2 udiv r3, r3, r2
- break;
- }
- /* Compute HCLK, PCLK1 and PCLK2 clocks frequencies ------------------------*/
- /* Get HCLK prescaler */
- tmp = RCC->CFGR & RCC_CFGR_HPRE;
- 8009f50: 490c ldr r1, [pc, #48] ; (8009f84 <RCC_GetClocksFreq+0x7c>)
- /* HSI used as PLL clock source */
- pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6);
- }
- pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2;
- RCC_Clocks->SYSCLK_Frequency = pllvco/pllp;
- 8009f52: 6003 str r3, [r0, #0]
- break;
- }
- /* Compute HCLK, PCLK1 and PCLK2 clocks frequencies ------------------------*/
- /* Get HCLK prescaler */
- tmp = RCC->CFGR & RCC_CFGR_HPRE;
- 8009f54: 688b ldr r3, [r1, #8]
- tmp = tmp >> 4;
- presc = APBAHBPrescTable[tmp];
- 8009f56: 4a0e ldr r2, [pc, #56] ; (8009f90 <RCC_GetClocksFreq+0x88>)
- }
- /* Compute HCLK, PCLK1 and PCLK2 clocks frequencies ------------------------*/
- /* Get HCLK prescaler */
- tmp = RCC->CFGR & RCC_CFGR_HPRE;
- tmp = tmp >> 4;
- 8009f58: f3c3 1303 ubfx r3, r3, #4, #4
- presc = APBAHBPrescTable[tmp];
- 8009f5c: 5cd4 ldrb r4, [r2, r3]
- /* HCLK clock frequency */
- RCC_Clocks->HCLK_Frequency = RCC_Clocks->SYSCLK_Frequency >> presc;
- 8009f5e: 6803 ldr r3, [r0, #0]
- 8009f60: fa23 f304 lsr.w r3, r3, r4
- 8009f64: 6043 str r3, [r0, #4]
- /* Get PCLK1 prescaler */
- tmp = RCC->CFGR & RCC_CFGR_PPRE1;
- 8009f66: 688c ldr r4, [r1, #8]
- tmp = tmp >> 10;
- 8009f68: f3c4 2482 ubfx r4, r4, #10, #3
- presc = APBAHBPrescTable[tmp];
- 8009f6c: 5d14 ldrb r4, [r2, r4]
- /* PCLK1 clock frequency */
- RCC_Clocks->PCLK1_Frequency = RCC_Clocks->HCLK_Frequency >> presc;
- 8009f6e: fa23 f404 lsr.w r4, r3, r4
- 8009f72: 6084 str r4, [r0, #8]
- /* Get PCLK2 prescaler */
- tmp = RCC->CFGR & RCC_CFGR_PPRE2;
- 8009f74: 6889 ldr r1, [r1, #8]
- tmp = tmp >> 13;
- 8009f76: f3c1 3142 ubfx r1, r1, #13, #3
- presc = APBAHBPrescTable[tmp];
- 8009f7a: 5c52 ldrb r2, [r2, r1]
- /* PCLK2 clock frequency */
- RCC_Clocks->PCLK2_Frequency = RCC_Clocks->HCLK_Frequency >> presc;
- 8009f7c: fa23 f302 lsr.w r3, r3, r2
- 8009f80: 60c3 str r3, [r0, #12]
- 8009f82: bd10 pop {r4, pc}
- 8009f84: 40023800 .word 0x40023800
- 8009f88: 00f42400 .word 0x00f42400
- 8009f8c: 017d7840 .word 0x017d7840
- 8009f90: 200000f8 .word 0x200000f8
- 08009f94 <RCC_AHB1PeriphClockCmd>:
- * @param NewState: new state of the specified peripheral clock.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void RCC_AHB1PeriphClockCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState)
- {
- 8009f94: 4b04 ldr r3, [pc, #16] ; (8009fa8 <RCC_AHB1PeriphClockCmd+0x14>)
- assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- {
- RCC->AHB1ENR |= RCC_AHB1Periph;
- 8009f96: 6b1a ldr r2, [r3, #48] ; 0x30
- {
- /* Check the parameters */
- assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- 8009f98: b109 cbz r1, 8009f9e <RCC_AHB1PeriphClockCmd+0xa>
- {
- RCC->AHB1ENR |= RCC_AHB1Periph;
- 8009f9a: 4310 orrs r0, r2
- 8009f9c: e001 b.n 8009fa2 <RCC_AHB1PeriphClockCmd+0xe>
- }
- else
- {
- RCC->AHB1ENR &= ~RCC_AHB1Periph;
- 8009f9e: ea22 0000 bic.w r0, r2, r0
- 8009fa2: 6318 str r0, [r3, #48] ; 0x30
- 8009fa4: 4770 bx lr
- 8009fa6: bf00 nop
- 8009fa8: 40023800 .word 0x40023800
- 08009fac <RCC_APB1PeriphClockCmd>:
- * @param NewState: new state of the specified peripheral clock.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
- {
- 8009fac: 4b04 ldr r3, [pc, #16] ; (8009fc0 <RCC_APB1PeriphClockCmd+0x14>)
- assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- {
- RCC->APB1ENR |= RCC_APB1Periph;
- 8009fae: 6c1a ldr r2, [r3, #64] ; 0x40
- {
- /* Check the parameters */
- assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- 8009fb0: b109 cbz r1, 8009fb6 <RCC_APB1PeriphClockCmd+0xa>
- {
- RCC->APB1ENR |= RCC_APB1Periph;
- 8009fb2: 4310 orrs r0, r2
- 8009fb4: e001 b.n 8009fba <RCC_APB1PeriphClockCmd+0xe>
- }
- else
- {
- RCC->APB1ENR &= ~RCC_APB1Periph;
- 8009fb6: ea22 0000 bic.w r0, r2, r0
- 8009fba: 6418 str r0, [r3, #64] ; 0x40
- 8009fbc: 4770 bx lr
- 8009fbe: bf00 nop
- 8009fc0: 40023800 .word 0x40023800
- 08009fc4 <RCC_APB2PeriphClockCmd>:
- * @param NewState: new state of the specified peripheral clock.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
- {
- 8009fc4: 4b04 ldr r3, [pc, #16] ; (8009fd8 <RCC_APB2PeriphClockCmd+0x14>)
- assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- {
- RCC->APB2ENR |= RCC_APB2Periph;
- 8009fc6: 6c5a ldr r2, [r3, #68] ; 0x44
- {
- /* Check the parameters */
- assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- 8009fc8: b109 cbz r1, 8009fce <RCC_APB2PeriphClockCmd+0xa>
- {
- RCC->APB2ENR |= RCC_APB2Periph;
- 8009fca: 4310 orrs r0, r2
- 8009fcc: e001 b.n 8009fd2 <RCC_APB2PeriphClockCmd+0xe>
- }
- else
- {
- RCC->APB2ENR &= ~RCC_APB2Periph;
- 8009fce: ea22 0000 bic.w r0, r2, r0
- 8009fd2: 6458 str r0, [r3, #68] ; 0x44
- 8009fd4: 4770 bx lr
- 8009fd6: bf00 nop
- 8009fd8: 40023800 .word 0x40023800
- 08009fdc <RCC_AHB1PeriphResetCmd>:
- * @param NewState: new state of the specified peripheral reset.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void RCC_AHB1PeriphResetCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState)
- {
- 8009fdc: 4b04 ldr r3, [pc, #16] ; (8009ff0 <RCC_AHB1PeriphResetCmd+0x14>)
- assert_param(IS_RCC_AHB1_RESET_PERIPH(RCC_AHB1Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- {
- RCC->AHB1RSTR |= RCC_AHB1Periph;
- 8009fde: 691a ldr r2, [r3, #16]
- {
- /* Check the parameters */
- assert_param(IS_RCC_AHB1_RESET_PERIPH(RCC_AHB1Periph));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- if (NewState != DISABLE)
- 8009fe0: b109 cbz r1, 8009fe6 <RCC_AHB1PeriphResetCmd+0xa>
- {
- RCC->AHB1RSTR |= RCC_AHB1Periph;
- 8009fe2: 4310 orrs r0, r2
- 8009fe4: e001 b.n 8009fea <RCC_AHB1PeriphResetCmd+0xe>
- }
- else
- {
- RCC->AHB1RSTR &= ~RCC_AHB1Periph;
- 8009fe6: ea22 0000 bic.w r0, r2, r0
- 8009fea: 6118 str r0, [r3, #16]
- 8009fec: 4770 bx lr
- 8009fee: bf00 nop
- 8009ff0: 40023800 .word 0x40023800
- 08009ff4 <RTC_WriteBackupRegister>:
- * specify the register.
- * @param Data: Data to be written in the specified RTC Backup data register.
- * @retval None
- */
- void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data)
- {
- 8009ff4: b082 sub sp, #8
- __IO uint32_t tmp = 0;
- 8009ff6: 2300 movs r3, #0
- 8009ff8: 9301 str r3, [sp, #4]
-
- /* Check the parameters */
- assert_param(IS_RTC_BKP(RTC_BKP_DR));
- tmp = RTC_BASE + 0x50;
- 8009ffa: 4b05 ldr r3, [pc, #20] ; (800a010 <RTC_WriteBackupRegister+0x1c>)
- 8009ffc: 9301 str r3, [sp, #4]
- tmp += (RTC_BKP_DR * 4);
- 8009ffe: 9b01 ldr r3, [sp, #4]
- 800a000: eb03 0080 add.w r0, r3, r0, lsl #2
- 800a004: 9001 str r0, [sp, #4]
- /* Write the specified register */
- *(__IO uint32_t *)tmp = (uint32_t)Data;
- 800a006: 9b01 ldr r3, [sp, #4]
- 800a008: 6019 str r1, [r3, #0]
- }
- 800a00a: b002 add sp, #8
- 800a00c: 4770 bx lr
- 800a00e: bf00 nop
- 800a010: 40002850 .word 0x40002850
- 0800a014 <RTC_ReadBackupRegister>:
- * This parameter can be: RTC_BKP_DRx where x can be from 0 to 19 to
- * specify the register.
- * @retval None
- */
- uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR)
- {
- 800a014: b082 sub sp, #8
- __IO uint32_t tmp = 0;
- 800a016: 2300 movs r3, #0
- 800a018: 9301 str r3, [sp, #4]
-
- /* Check the parameters */
- assert_param(IS_RTC_BKP(RTC_BKP_DR));
- tmp = RTC_BASE + 0x50;
- 800a01a: 4b05 ldr r3, [pc, #20] ; (800a030 <RTC_ReadBackupRegister+0x1c>)
- 800a01c: 9301 str r3, [sp, #4]
- tmp += (RTC_BKP_DR * 4);
- 800a01e: 9b01 ldr r3, [sp, #4]
- 800a020: eb03 0080 add.w r0, r3, r0, lsl #2
- 800a024: 9001 str r0, [sp, #4]
-
- /* Read the specified register */
- return (*(__IO uint32_t *)tmp);
- 800a026: 9b01 ldr r3, [sp, #4]
- 800a028: 6818 ldr r0, [r3, #0]
- }
- 800a02a: b002 add sp, #8
- 800a02c: 4770 bx lr
- 800a02e: bf00 nop
- 800a030: 40002850 .word 0x40002850
- 0800a034 <SYSCFG_ETH_MediaInterfaceConfig>:
- */
- void SYSCFG_ETH_MediaInterfaceConfig(uint32_t SYSCFG_ETH_MediaInterface)
- {
- assert_param(IS_SYSCFG_ETH_MEDIA_INTERFACE(SYSCFG_ETH_MediaInterface));
- /* Configure MII_RMII selection bit */
- *(__IO uint32_t *) PMC_MII_RMII_SEL_BB = SYSCFG_ETH_MediaInterface;
- 800a034: 4b01 ldr r3, [pc, #4] ; (800a03c <SYSCFG_ETH_MediaInterfaceConfig+0x8>)
- 800a036: 6018 str r0, [r3, #0]
- 800a038: 4770 bx lr
- 800a03a: bf00 nop
- 800a03c: 422700dc .word 0x422700dc
- 0800a040 <TIM_TimeBaseInit>:
- assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode));
- assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision));
- tmpcr1 = TIMx->CR1;
- if((TIMx == TIM1) || (TIMx == TIM8)||
- 800a040: 4a1c ldr r2, [pc, #112] ; (800a0b4 <TIM_TimeBaseInit+0x74>)
- /* Check the parameters */
- assert_param(IS_TIM_ALL_PERIPH(TIMx));
- assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode));
- assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision));
- tmpcr1 = TIMx->CR1;
- 800a042: 8803 ldrh r3, [r0, #0]
- if((TIMx == TIM1) || (TIMx == TIM8)||
- 800a044: 4290 cmp r0, r2
- /* Check the parameters */
- assert_param(IS_TIM_ALL_PERIPH(TIMx));
- assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode));
- assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision));
- tmpcr1 = TIMx->CR1;
- 800a046: b29b uxth r3, r3
- if((TIMx == TIM1) || (TIMx == TIM8)||
- 800a048: d012 beq.n 800a070 <TIM_TimeBaseInit+0x30>
- 800a04a: f502 6280 add.w r2, r2, #1024 ; 0x400
- 800a04e: 4290 cmp r0, r2
- 800a050: d00e beq.n 800a070 <TIM_TimeBaseInit+0x30>
- 800a052: f1b0 4f80 cmp.w r0, #1073741824 ; 0x40000000
- 800a056: d00b beq.n 800a070 <TIM_TimeBaseInit+0x30>
- (TIMx == TIM2) || (TIMx == TIM3)||
- 800a058: f5a2 3280 sub.w r2, r2, #65536 ; 0x10000
- 800a05c: 4290 cmp r0, r2
- 800a05e: d007 beq.n 800a070 <TIM_TimeBaseInit+0x30>
- 800a060: f502 6280 add.w r2, r2, #1024 ; 0x400
- 800a064: 4290 cmp r0, r2
- 800a066: d003 beq.n 800a070 <TIM_TimeBaseInit+0x30>
- (TIMx == TIM4) || (TIMx == TIM5))
- 800a068: f502 6280 add.w r2, r2, #1024 ; 0x400
- 800a06c: 4290 cmp r0, r2
- 800a06e: d103 bne.n 800a078 <TIM_TimeBaseInit+0x38>
- {
- /* Select the Counter Mode */
- tmpcr1 &= (uint16_t)(~(TIM_CR1_DIR | TIM_CR1_CMS));
- tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode;
- 800a070: 884a ldrh r2, [r1, #2]
- if((TIMx == TIM1) || (TIMx == TIM8)||
- (TIMx == TIM2) || (TIMx == TIM3)||
- (TIMx == TIM4) || (TIMx == TIM5))
- {
- /* Select the Counter Mode */
- tmpcr1 &= (uint16_t)(~(TIM_CR1_DIR | TIM_CR1_CMS));
- 800a072: f023 0370 bic.w r3, r3, #112 ; 0x70
- tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode;
- 800a076: 4313 orrs r3, r2
- }
-
- if((TIMx != TIM6) && (TIMx != TIM7))
- 800a078: 4a0f ldr r2, [pc, #60] ; (800a0b8 <TIM_TimeBaseInit+0x78>)
- 800a07a: 4290 cmp r0, r2
- 800a07c: d008 beq.n 800a090 <TIM_TimeBaseInit+0x50>
- 800a07e: f502 6280 add.w r2, r2, #1024 ; 0x400
- 800a082: 4290 cmp r0, r2
- 800a084: d004 beq.n 800a090 <TIM_TimeBaseInit+0x50>
- {
- /* Set the clock division */
- tmpcr1 &= (uint16_t)(~TIM_CR1_CKD);
- 800a086: f423 7340 bic.w r3, r3, #768 ; 0x300
- tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision;
- 800a08a: 890a ldrh r2, [r1, #8]
- }
-
- if((TIMx != TIM6) && (TIMx != TIM7))
- {
- /* Set the clock division */
- tmpcr1 &= (uint16_t)(~TIM_CR1_CKD);
- 800a08c: b29b uxth r3, r3
- tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision;
- 800a08e: 4313 orrs r3, r2
- }
- TIMx->CR1 = tmpcr1;
- 800a090: 8003 strh r3, [r0, #0]
- /* Set the Autoreload value */
- TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ;
- 800a092: 684b ldr r3, [r1, #4]
- 800a094: 62c3 str r3, [r0, #44] ; 0x2c
-
- /* Set the Prescaler value */
- TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler;
- 800a096: 880b ldrh r3, [r1, #0]
- 800a098: 8503 strh r3, [r0, #40] ; 0x28
-
- if ((TIMx == TIM1) || (TIMx == TIM8))
- 800a09a: 4b06 ldr r3, [pc, #24] ; (800a0b4 <TIM_TimeBaseInit+0x74>)
- 800a09c: 4298 cmp r0, r3
- 800a09e: d003 beq.n 800a0a8 <TIM_TimeBaseInit+0x68>
- 800a0a0: f503 6380 add.w r3, r3, #1024 ; 0x400
- 800a0a4: 4298 cmp r0, r3
- 800a0a6: d101 bne.n 800a0ac <TIM_TimeBaseInit+0x6c>
- {
- /* Set the Repetition Counter value */
- TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter;
- 800a0a8: 7a8b ldrb r3, [r1, #10]
- 800a0aa: 8603 strh r3, [r0, #48] ; 0x30
- }
- /* Generate an update event to reload the Prescaler
- and the repetition counter(only for TIM1 and TIM8) value immediatly */
- TIMx->EGR = TIM_PSCReloadMode_Immediate;
- 800a0ac: 2301 movs r3, #1
- 800a0ae: 8283 strh r3, [r0, #20]
- 800a0b0: 4770 bx lr
- 800a0b2: bf00 nop
- 800a0b4: 40010000 .word 0x40010000
- 800a0b8: 40001000 .word 0x40001000
- 0800a0bc <TIM_Cmd>:
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the TIM Counter */
- TIMx->CR1 |= TIM_CR1_CEN;
- 800a0bc: 8803 ldrh r3, [r0, #0]
- {
- /* Check the parameters */
- assert_param(IS_TIM_ALL_PERIPH(TIMx));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 800a0be: b119 cbz r1, 800a0c8 <TIM_Cmd+0xc>
- {
- /* Enable the TIM Counter */
- TIMx->CR1 |= TIM_CR1_CEN;
- 800a0c0: b29b uxth r3, r3
- 800a0c2: f043 0301 orr.w r3, r3, #1
- 800a0c6: e003 b.n 800a0d0 <TIM_Cmd+0x14>
- }
- else
- {
- /* Disable the TIM Counter */
- TIMx->CR1 &= (uint16_t)~TIM_CR1_CEN;
- 800a0c8: f023 0301 bic.w r3, r3, #1
- 800a0cc: 041b lsls r3, r3, #16
- 800a0ce: 0c1b lsrs r3, r3, #16
- 800a0d0: 8003 strh r3, [r0, #0]
- 800a0d2: 4770 bx lr
- 0800a0d4 <TIM_ITConfig>:
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the Interrupt sources */
- TIMx->DIER |= TIM_IT;
- 800a0d4: 8983 ldrh r3, [r0, #12]
- 800a0d6: b29b uxth r3, r3
- /* Check the parameters */
- assert_param(IS_TIM_ALL_PERIPH(TIMx));
- assert_param(IS_TIM_IT(TIM_IT));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 800a0d8: b10a cbz r2, 800a0de <TIM_ITConfig+0xa>
- {
- /* Enable the Interrupt sources */
- TIMx->DIER |= TIM_IT;
- 800a0da: 4319 orrs r1, r3
- 800a0dc: e001 b.n 800a0e2 <TIM_ITConfig+0xe>
- }
- else
- {
- /* Disable the Interrupt sources */
- TIMx->DIER &= (uint16_t)~TIM_IT;
- 800a0de: ea23 0101 bic.w r1, r3, r1
- 800a0e2: 8181 strh r1, [r0, #12]
- 800a0e4: 4770 bx lr
- 0800a0e6 <TIM_ClearITPendingBit>:
- {
- /* Check the parameters */
- assert_param(IS_TIM_ALL_PERIPH(TIMx));
- /* Clear the IT pending Bit */
- TIMx->SR = (uint16_t)~TIM_IT;
- 800a0e6: 43c9 mvns r1, r1
- 800a0e8: 8201 strh r1, [r0, #16]
- 800a0ea: 4770 bx lr
- 0800a0ec <USART_Init>:
- {
- assert_param(IS_USART_1236_PERIPH(USARTx));
- }
- /*---------------------------- USART CR2 Configuration -----------------------*/
- tmpreg = USARTx->CR2;
- 800a0ec: 8a03 ldrh r3, [r0, #16]
- /* Clear STOP[13:12] bits */
- tmpreg &= (uint32_t)~((uint32_t)USART_CR2_STOP);
- /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit :
- Set STOP[13:12] bits according to USART_StopBits value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
- 800a0ee: 88ca ldrh r2, [r1, #6]
- {
- assert_param(IS_USART_1236_PERIPH(USARTx));
- }
- /*---------------------------- USART CR2 Configuration -----------------------*/
- tmpreg = USARTx->CR2;
- 800a0f0: b29b uxth r3, r3
- /* Clear STOP[13:12] bits */
- tmpreg &= (uint32_t)~((uint32_t)USART_CR2_STOP);
- 800a0f2: f423 5340 bic.w r3, r3, #12288 ; 0x3000
- * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
- * the configuration information for the specified USART peripheral.
- * @retval None
- */
- void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
- {
- 800a0f6: b530 push {r4, r5, lr}
- /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit :
- Set STOP[13:12] bits according to USART_StopBits value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
-
- /* Write to USART CR2 */
- USARTx->CR2 = (uint16_t)tmpreg;
- 800a0f8: 4313 orrs r3, r2
- * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
- * the configuration information for the specified USART peripheral.
- * @retval None
- */
- void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
- {
- 800a0fa: 460d mov r5, r1
- /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit :
- Set STOP[13:12] bits according to USART_StopBits value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
-
- /* Write to USART CR2 */
- USARTx->CR2 = (uint16_t)tmpreg;
- 800a0fc: 8203 strh r3, [r0, #16]
- /*---------------------------- USART CR1 Configuration -----------------------*/
- tmpreg = USARTx->CR1;
- 800a0fe: 8983 ldrh r3, [r0, #12]
- /* Configure the USART Word Length, Parity and mode:
- Set the M bits according to USART_WordLength value
- Set PCE and PS bits according to USART_Parity value
- Set TE and RE bits according to USART_Mode value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
- 800a100: 8909 ldrh r1, [r1, #8]
- 800a102: 88aa ldrh r2, [r5, #4]
- /*---------------------------- USART CR1 Configuration -----------------------*/
- tmpreg = USARTx->CR1;
- /* Clear M, PCE, PS, TE and RE bits */
- tmpreg &= (uint32_t)~((uint32_t)CR1_CLEAR_MASK);
- 800a104: f423 53b0 bic.w r3, r3, #5632 ; 0x1600
- /* Configure the USART Word Length, Parity and mode:
- Set the M bits according to USART_WordLength value
- Set PCE and PS bits according to USART_Parity value
- Set TE and RE bits according to USART_Mode value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
- 800a108: 430a orrs r2, r1
- 800a10a: 8969 ldrh r1, [r5, #10]
- /*---------------------------- USART CR1 Configuration -----------------------*/
- tmpreg = USARTx->CR1;
- /* Clear M, PCE, PS, TE and RE bits */
- tmpreg &= (uint32_t)~((uint32_t)CR1_CLEAR_MASK);
- 800a10c: f023 030c bic.w r3, r3, #12
- 800a110: 041b lsls r3, r3, #16
- /* Configure the USART Word Length, Parity and mode:
- Set the M bits according to USART_WordLength value
- Set PCE and PS bits according to USART_Parity value
- Set TE and RE bits according to USART_Mode value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
- 800a112: 430a orrs r2, r1
- /*---------------------------- USART CR1 Configuration -----------------------*/
- tmpreg = USARTx->CR1;
- /* Clear M, PCE, PS, TE and RE bits */
- tmpreg &= (uint32_t)~((uint32_t)CR1_CLEAR_MASK);
- 800a114: 0c1b lsrs r3, r3, #16
- /* Configure the USART Word Length, Parity and mode:
- Set the M bits according to USART_WordLength value
- Set PCE and PS bits according to USART_Parity value
- Set TE and RE bits according to USART_Mode value */
- tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
- 800a116: b292 uxth r2, r2
- USART_InitStruct->USART_Mode;
- /* Write to USART CR1 */
- USARTx->CR1 = (uint16_t)tmpreg;
- 800a118: 4313 orrs r3, r2
- 800a11a: 8183 strh r3, [r0, #12]
- /*---------------------------- USART CR3 Configuration -----------------------*/
- tmpreg = USARTx->CR3;
- 800a11c: 8a83 ldrh r3, [r0, #20]
- /* Clear CTSE and RTSE bits */
- tmpreg &= (uint32_t)~((uint32_t)CR3_CLEAR_MASK);
- /* Configure the USART HFC :
- Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
- tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
- 800a11e: 89aa ldrh r2, [r5, #12]
- /* Write to USART CR1 */
- USARTx->CR1 = (uint16_t)tmpreg;
- /*---------------------------- USART CR3 Configuration -----------------------*/
- tmpreg = USARTx->CR3;
- 800a120: b29b uxth r3, r3
- /* Clear CTSE and RTSE bits */
- tmpreg &= (uint32_t)~((uint32_t)CR3_CLEAR_MASK);
- 800a122: f423 7340 bic.w r3, r3, #768 ; 0x300
- /* Configure the USART HFC :
- Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
- tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
- /* Write to USART CR3 */
- USARTx->CR3 = (uint16_t)tmpreg;
- 800a126: 4313 orrs r3, r2
- * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
- * the configuration information for the specified USART peripheral.
- * @retval None
- */
- void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
- {
- 800a128: b085 sub sp, #20
- /* Configure the USART HFC :
- Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
- tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
- /* Write to USART CR3 */
- USARTx->CR3 = (uint16_t)tmpreg;
- 800a12a: 8283 strh r3, [r0, #20]
- * @param USART_InitStruct: pointer to a USART_InitTypeDef structure that contains
- * the configuration information for the specified USART peripheral.
- * @retval None
- */
- void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
- {
- 800a12c: 4604 mov r4, r0
- /* Write to USART CR3 */
- USARTx->CR3 = (uint16_t)tmpreg;
- /*---------------------------- USART BRR Configuration -----------------------*/
- /* Configure the USART Baud Rate */
- RCC_GetClocksFreq(&RCC_ClocksStatus);
- 800a12e: 4668 mov r0, sp
- 800a130: f7ff feea bl 8009f08 <RCC_GetClocksFreq>
- if ((USARTx == USART1) || (USARTx == USART6))
- 800a134: 4b19 ldr r3, [pc, #100] ; (800a19c <USART_Init+0xb0>)
- 800a136: 429c cmp r4, r3
- 800a138: d003 beq.n 800a142 <USART_Init+0x56>
- 800a13a: f503 6380 add.w r3, r3, #1024 ; 0x400
- 800a13e: 429c cmp r4, r3
- 800a140: d101 bne.n 800a146 <USART_Init+0x5a>
- {
- apbclock = RCC_ClocksStatus.PCLK2_Frequency;
- 800a142: 9b03 ldr r3, [sp, #12]
- 800a144: e000 b.n 800a148 <USART_Init+0x5c>
- }
- else
- {
- apbclock = RCC_ClocksStatus.PCLK1_Frequency;
- 800a146: 9b02 ldr r3, [sp, #8]
- }
-
- /* Determine the integer part */
- if ((USARTx->CR1 & USART_CR1_OVER8) != 0)
- 800a148: 89a2 ldrh r2, [r4, #12]
- 800a14a: b212 sxth r2, r2
- 800a14c: 2a00 cmp r2, #0
- 800a14e: f04f 0119 mov.w r1, #25
- 800a152: 682a ldr r2, [r5, #0]
- {
- /* Integer part computing in case Oversampling mode is 8 Samples */
- integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));
- 800a154: fb01 f103 mul.w r1, r1, r3
- {
- apbclock = RCC_ClocksStatus.PCLK1_Frequency;
- }
-
- /* Determine the integer part */
- if ((USARTx->CR1 & USART_CR1_OVER8) != 0)
- 800a158: da01 bge.n 800a15e <USART_Init+0x72>
- {
- /* Integer part computing in case Oversampling mode is 8 Samples */
- integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));
- 800a15a: 0052 lsls r2, r2, #1
- 800a15c: e000 b.n 800a160 <USART_Init+0x74>
- }
- else /* if ((USARTx->CR1 & USART_CR1_OVER8) == 0) */
- {
- /* Integer part computing in case Oversampling mode is 16 Samples */
- integerdivider = ((25 * apbclock) / (4 * (USART_InitStruct->USART_BaudRate)));
- 800a15e: 0092 lsls r2, r2, #2
- }
- tmpreg = (integerdivider / 100) << 4;
- 800a160: 2364 movs r3, #100 ; 0x64
- integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));
- }
- else /* if ((USARTx->CR1 & USART_CR1_OVER8) == 0) */
- {
- /* Integer part computing in case Oversampling mode is 16 Samples */
- integerdivider = ((25 * apbclock) / (4 * (USART_InitStruct->USART_BaudRate)));
- 800a162: fbb1 f1f2 udiv r1, r1, r2
- }
- tmpreg = (integerdivider / 100) << 4;
- 800a166: fbb1 f2f3 udiv r2, r1, r3
- 800a16a: 0112 lsls r2, r2, #4
- /* Determine the fractional part */
- fractionaldivider = integerdivider - (100 * (tmpreg >> 4));
- 800a16c: 0910 lsrs r0, r2, #4
- 800a16e: fb03 1110 mls r1, r3, r0, r1
- /* Implement the fractional part in the register */
- if ((USARTx->CR1 & USART_CR1_OVER8) != 0)
- 800a172: 89a0 ldrh r0, [r4, #12]
- 800a174: b200 sxth r0, r0
- 800a176: 2800 cmp r0, #0
- 800a178: da06 bge.n 800a188 <USART_Init+0x9c>
- {
- tmpreg |= ((((fractionaldivider * 8) + 50) / 100)) & ((uint8_t)0x07);
- 800a17a: 00c9 lsls r1, r1, #3
- 800a17c: 3132 adds r1, #50 ; 0x32
- 800a17e: fbb1 f3f3 udiv r3, r1, r3
- 800a182: f003 0307 and.w r3, r3, #7
- 800a186: e005 b.n 800a194 <USART_Init+0xa8>
- }
- else /* if ((USARTx->CR1 & USART_CR1_OVER8) == 0) */
- {
- tmpreg |= ((((fractionaldivider * 16) + 50) / 100)) & ((uint8_t)0x0F);
- 800a188: 0109 lsls r1, r1, #4
- 800a18a: 3132 adds r1, #50 ; 0x32
- 800a18c: fbb1 f3f3 udiv r3, r1, r3
- 800a190: f003 030f and.w r3, r3, #15
- 800a194: 431a orrs r2, r3
- }
-
- /* Write to USART BRR register */
- USARTx->BRR = (uint16_t)tmpreg;
- 800a196: 8122 strh r2, [r4, #8]
- }
- 800a198: b005 add sp, #20
- 800a19a: bd30 pop {r4, r5, pc}
- 800a19c: 40011000 .word 0x40011000
- 0800a1a0 <USART_Cmd>:
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the selected USART by setting the UE bit in the CR1 register */
- USARTx->CR1 |= USART_CR1_UE;
- 800a1a0: 8983 ldrh r3, [r0, #12]
- {
- /* Check the parameters */
- assert_param(IS_USART_ALL_PERIPH(USARTx));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 800a1a2: b119 cbz r1, 800a1ac <USART_Cmd+0xc>
- {
- /* Enable the selected USART by setting the UE bit in the CR1 register */
- USARTx->CR1 |= USART_CR1_UE;
- 800a1a4: b29b uxth r3, r3
- 800a1a6: f443 5300 orr.w r3, r3, #8192 ; 0x2000
- 800a1aa: e003 b.n 800a1b4 <USART_Cmd+0x14>
- }
- else
- {
- /* Disable the selected USART by clearing the UE bit in the CR1 register */
- USARTx->CR1 &= (uint16_t)~((uint16_t)USART_CR1_UE);
- 800a1ac: f423 5300 bic.w r3, r3, #8192 ; 0x2000
- 800a1b0: 041b lsls r3, r3, #16
- 800a1b2: 0c1b lsrs r3, r3, #16
- 800a1b4: 8183 strh r3, [r0, #12]
- 800a1b6: 4770 bx lr
- 0800a1b8 <USART_ITConfig>:
- }
-
- usartxbase = (uint32_t)USARTx;
- /* Get the USART register index */
- usartreg = (((uint8_t)USART_IT) >> 0x05);
- 800a1b8: f3c1 1342 ubfx r3, r1, #5, #3
- * @param NewState: new state of the specified USARTx interrupts.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState)
- {
- 800a1bc: b510 push {r4, lr}
- /* Get the USART register index */
- usartreg = (((uint8_t)USART_IT) >> 0x05);
- /* Get the interrupt position */
- itpos = USART_IT & IT_MASK;
- itmask = (((uint32_t)0x01) << itpos);
- 800a1be: 2401 movs r4, #1
- 800a1c0: f001 011f and.w r1, r1, #31
-
- if (usartreg == 0x01) /* The IT is in CR1 register */
- 800a1c4: 42a3 cmp r3, r4
- /* Get the USART register index */
- usartreg = (((uint8_t)USART_IT) >> 0x05);
- /* Get the interrupt position */
- itpos = USART_IT & IT_MASK;
- itmask = (((uint32_t)0x01) << itpos);
- 800a1c6: fa04 f101 lsl.w r1, r4, r1
-
- if (usartreg == 0x01) /* The IT is in CR1 register */
- 800a1ca: d101 bne.n 800a1d0 <USART_ITConfig+0x18>
- {
- usartxbase += 0x0C;
- 800a1cc: 300c adds r0, #12
- 800a1ce: e004 b.n 800a1da <USART_ITConfig+0x22>
- }
- else if (usartreg == 0x02) /* The IT is in CR2 register */
- 800a1d0: 2b02 cmp r3, #2
- 800a1d2: d101 bne.n 800a1d8 <USART_ITConfig+0x20>
- {
- usartxbase += 0x10;
- 800a1d4: 3010 adds r0, #16
- 800a1d6: e000 b.n 800a1da <USART_ITConfig+0x22>
- }
- else /* The IT is in CR3 register */
- {
- usartxbase += 0x14;
- 800a1d8: 3014 adds r0, #20
- }
- if (NewState != DISABLE)
- {
- *(__IO uint32_t*)usartxbase |= itmask;
- 800a1da: 6803 ldr r3, [r0, #0]
- }
- else /* The IT is in CR3 register */
- {
- usartxbase += 0x14;
- }
- if (NewState != DISABLE)
- 800a1dc: b10a cbz r2, 800a1e2 <USART_ITConfig+0x2a>
- {
- *(__IO uint32_t*)usartxbase |= itmask;
- 800a1de: 4319 orrs r1, r3
- 800a1e0: e001 b.n 800a1e6 <USART_ITConfig+0x2e>
- }
- else
- {
- *(__IO uint32_t*)usartxbase &= ~itmask;
- 800a1e2: ea23 0101 bic.w r1, r3, r1
- 800a1e6: 6001 str r1, [r0, #0]
- 800a1e8: bd10 pop {r4, pc}
- 0800a1ea <lwip_htons>:
- * @return n in network byte order
- */
- u16_t
- lwip_htons(u16_t n)
- {
- return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
- 800a1ea: 0a03 lsrs r3, r0, #8
- 800a1ec: ea43 2000 orr.w r0, r3, r0, lsl #8
- }
- 800a1f0: b280 uxth r0, r0
- 800a1f2: 4770 bx lr
- 0800a1f4 <lwip_ntohs>:
- * @return n in network byte order
- */
- u16_t
- lwip_htons(u16_t n)
- {
- return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
- 800a1f4: 0a03 lsrs r3, r0, #8
- 800a1f6: ea43 2000 orr.w r0, r3, r0, lsl #8
- */
- u16_t
- lwip_ntohs(u16_t n)
- {
- return lwip_htons(n);
- }
- 800a1fa: b280 uxth r0, r0
- 800a1fc: 4770 bx lr
- 0800a1fe <lwip_htonl>:
- {
- return ((n & 0xff) << 24) |
- ((n & 0xff00) << 8) |
- ((n & 0xff0000UL) >> 8) |
- ((n & 0xff000000UL) >> 24);
- }
- 800a1fe: ba00 rev r0, r0
- 800a200: 4770 bx lr
- 0800a202 <lwip_ntohl>:
- * @return n in host byte order
- */
- u32_t
- lwip_ntohl(u32_t n)
- {
- return lwip_htonl(n);
- 800a202: f7ff bffc b.w 800a1fe <lwip_htonl>
- 0800a206 <dhcp_set_state>:
- * If the state changed, reset the number of tries.
- */
- static void
- dhcp_set_state(struct dhcp *dhcp, u8_t new_state)
- {
- if (new_state != dhcp->state) {
- 800a206: 7b03 ldrb r3, [r0, #12]
- 800a208: 428b cmp r3, r1
- 800a20a: d003 beq.n 800a214 <dhcp_set_state+0xe>
- dhcp->state = new_state;
- dhcp->tries = 0;
- 800a20c: 2300 movs r3, #0
- */
- static void
- dhcp_set_state(struct dhcp *dhcp, u8_t new_state)
- {
- if (new_state != dhcp->state) {
- dhcp->state = new_state;
- 800a20e: 7301 strb r1, [r0, #12]
- dhcp->tries = 0;
- 800a210: 7343 strb r3, [r0, #13]
- dhcp->request_timeout = 0;
- 800a212: 8343 strh r3, [r0, #26]
- 800a214: 4770 bx lr
- 0800a216 <dhcp_option>:
- */
- static void
- dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
- {
- LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
- 800a216: 8b03 ldrh r3, [r0, #24]
- * DHCP message.
- *
- */
- static void
- dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
- {
- 800a218: b510 push {r4, lr}
- LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
- 800a21a: 6944 ldr r4, [r0, #20]
- 800a21c: 18e4 adds r4, r4, r3
- 800a21e: f884 10f0 strb.w r1, [r4, #240] ; 0xf0
- dhcp->msg_out->options[dhcp->options_out_len++] = option_len;
- 800a222: 6941 ldr r1, [r0, #20]
- */
- static void
- dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len)
- {
- LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = option_type;
- 800a224: 1c5c adds r4, r3, #1
- dhcp->msg_out->options[dhcp->options_out_len++] = option_len;
- 800a226: fa11 f184 uxtah r1, r1, r4
- 800a22a: 3302 adds r3, #2
- 800a22c: f881 20f0 strb.w r2, [r1, #240] ; 0xf0
- 800a230: 8303 strh r3, [r0, #24]
- 800a232: bd10 pop {r4, pc}
- 0800a234 <dhcp_option_byte>:
- */
- static void
- dhcp_option_byte(struct dhcp *dhcp, u8_t value)
- {
- LWIP_ASSERT("dhcp_option_byte: dhcp->options_out_len < DHCP_OPTIONS_LEN", dhcp->options_out_len < DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = value;
- 800a234: 8b03 ldrh r3, [r0, #24]
- 800a236: 6942 ldr r2, [r0, #20]
- 800a238: 18d2 adds r2, r2, r3
- 800a23a: 3301 adds r3, #1
- 800a23c: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
- 800a240: 8303 strh r3, [r0, #24]
- 800a242: 4770 bx lr
- 0800a244 <dhcp_option_short>:
- static void
- dhcp_option_short(struct dhcp *dhcp, u16_t value)
- {
- LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
- 800a244: 8b03 ldrh r3, [r0, #24]
- 800a246: 6942 ldr r2, [r0, #20]
- 800a248: 18d2 adds r2, r2, r3
- dhcp->msg_out->options[dhcp->options_out_len++] = value;
- }
- static void
- dhcp_option_short(struct dhcp *dhcp, u16_t value)
- {
- 800a24a: b510 push {r4, lr}
- LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
- 800a24c: 0a0c lsrs r4, r1, #8
- 800a24e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
- 800a252: 6942 ldr r2, [r0, #20]
- static void
- dhcp_option_short(struct dhcp *dhcp, u16_t value)
- {
- LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8);
- 800a254: 1c5c adds r4, r3, #1
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
- 800a256: fa12 f284 uxtah r2, r2, r4
- 800a25a: 3302 adds r3, #2
- 800a25c: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
- 800a260: 8303 strh r3, [r0, #24]
- 800a262: bd10 pop {r4, pc}
- 0800a264 <dhcp_option_long>:
- static void
- dhcp_option_long(struct dhcp *dhcp, u32_t value)
- {
- LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
- 800a264: 8b03 ldrh r3, [r0, #24]
- 800a266: 6942 ldr r2, [r0, #20]
- 800a268: 18d2 adds r2, r2, r3
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU);
- }
- static void
- dhcp_option_long(struct dhcp *dhcp, u32_t value)
- {
- 800a26a: b510 push {r4, lr}
- LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
- 800a26c: 0e0c lsrs r4, r1, #24
- 800a26e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
- 800a272: 6942 ldr r2, [r0, #20]
- static void
- dhcp_option_long(struct dhcp *dhcp, u32_t value)
- {
- LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
- 800a274: 1c5c adds r4, r3, #1
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
- 800a276: fa12 f284 uxtah r2, r2, r4
- 800a27a: f3c1 4407 ubfx r4, r1, #16, #8
- 800a27e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
- 800a282: 6942 ldr r2, [r0, #20]
- static void
- dhcp_option_long(struct dhcp *dhcp, u32_t value)
- {
- LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
- 800a284: 1c9c adds r4, r3, #2
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
- 800a286: fa12 f284 uxtah r2, r2, r4
- 800a28a: f3c1 2407 ubfx r4, r1, #8, #8
- 800a28e: f882 40f0 strb.w r4, [r2, #240] ; 0xf0
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x000000ffUL));
- 800a292: 6942 ldr r2, [r0, #20]
- dhcp_option_long(struct dhcp *dhcp, u32_t value)
- {
- LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16);
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8);
- 800a294: 1cdc adds r4, r3, #3
- dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x000000ffUL));
- 800a296: fa12 f284 uxtah r2, r2, r4
- 800a29a: 3304 adds r3, #4
- 800a29c: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
- 800a2a0: 8303 strh r3, [r0, #24]
- 800a2a2: bd10 pop {r4, pc}
- 0800a2a4 <dhcp_option_trailer>:
- * @param dhcp DHCP state structure
- */
- static void
- dhcp_option_trailer(struct dhcp *dhcp)
- {
- LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
- 800a2a4: b190 cbz r0, 800a2cc <dhcp_option_trailer+0x28>
- LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
- LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
- 800a2a6: 8b03 ldrh r3, [r0, #24]
- 800a2a8: 6942 ldr r2, [r0, #20]
- 800a2aa: 18d2 adds r2, r2, r3
- 800a2ac: 21ff movs r1, #255 ; 0xff
- 800a2ae: 3301 adds r3, #1
- 800a2b0: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
- 800a2b4: 8303 strh r3, [r0, #24]
- /* packet is too small, or not 4 byte aligned? */
- while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) &&
- (dhcp->options_out_len < DHCP_OPTIONS_LEN)) {
- /* add a fill/padding byte */
- dhcp->msg_out->options[dhcp->options_out_len++] = 0;
- 800a2b6: 2100 movs r1, #0
- LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
- LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
- LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
- /* packet is too small, or not 4 byte aligned? */
- while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) &&
- 800a2b8: e005 b.n 800a2c6 <dhcp_option_trailer+0x22>
- (dhcp->options_out_len < DHCP_OPTIONS_LEN)) {
- /* add a fill/padding byte */
- dhcp->msg_out->options[dhcp->options_out_len++] = 0;
- 800a2ba: 6942 ldr r2, [r0, #20]
- 800a2bc: 18d2 adds r2, r2, r3
- 800a2be: 3301 adds r3, #1
- 800a2c0: f882 10f0 strb.w r1, [r2, #240] ; 0xf0
- 800a2c4: 8303 strh r3, [r0, #24]
- LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;);
- LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL);
- LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN);
- dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END;
- /* packet is too small, or not 4 byte aligned? */
- while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) &&
- 800a2c6: 8b03 ldrh r3, [r0, #24]
- 800a2c8: 2b43 cmp r3, #67 ; 0x43
- 800a2ca: d9f6 bls.n 800a2ba <dhcp_option_trailer+0x16>
- 800a2cc: 4770 bx lr
- 800a2ce: 0000 movs r0, r0
- 0800a2d0 <dhcp_create_msg>:
- * @param dhcp dhcp control struct
- * @param message_type message type of the request
- */
- static err_t
- dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
- {
- 800a2d0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- 800a2d4: 460c mov r4, r1
- 800a2d6: 4617 mov r7, r2
- if (!xid_initialised) {
- xid = DHCP_GLOBAL_XID;
- xid_initialised = !xid_initialised;
- }
- #endif
- LWIP_ERROR("dhcp_create_msg: netif != NULL", (netif != NULL), return ERR_ARG;);
- 800a2d8: 4606 mov r6, r0
- 800a2da: 2800 cmp r0, #0
- 800a2dc: f000 808e beq.w 800a3fc <dhcp_create_msg+0x12c>
- LWIP_ERROR("dhcp_create_msg: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
- 800a2e0: 2900 cmp r1, #0
- 800a2e2: f000 808d beq.w 800a400 <dhcp_create_msg+0x130>
- LWIP_ASSERT("dhcp_create_msg: dhcp->p_out == NULL", dhcp->p_out == NULL);
- LWIP_ASSERT("dhcp_create_msg: dhcp->msg_out == NULL", dhcp->msg_out == NULL);
- dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM);
- 800a2e6: 2000 movs r0, #0
- 800a2e8: f44f 719a mov.w r1, #308 ; 0x134
- 800a2ec: 4602 mov r2, r0
- 800a2ee: f001 f93a bl 800b566 <pbuf_alloc>
- 800a2f2: 6120 str r0, [r4, #16]
- if (dhcp->p_out == NULL) {
- 800a2f4: 2800 cmp r0, #0
- 800a2f6: f000 8085 beq.w 800a404 <dhcp_create_msg+0x134>
- }
- LWIP_ASSERT("dhcp_create_msg: check that first pbuf can hold struct dhcp_msg",
- (dhcp->p_out->len >= sizeof(struct dhcp_msg)));
- /* reuse transaction identifier in retransmissions */
- if (dhcp->tries == 0) {
- 800a2fa: 7b62 ldrb r2, [r4, #13]
- 800a2fc: 4b43 ldr r3, [pc, #268] ; (800a40c <dhcp_create_msg+0x13c>)
- 800a2fe: b912 cbnz r2, 800a306 <dhcp_create_msg+0x36>
- #if DHCP_CREATE_RAND_XID && defined(LWIP_RAND)
- xid = LWIP_RAND();
- #else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
- xid++;
- 800a300: 681a ldr r2, [r3, #0]
- 800a302: 3201 adds r2, #1
- 800a304: 601a str r2, [r3, #0]
- #endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
- }
- dhcp->xid = xid;
- 800a306: 681b ldr r3, [r3, #0]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
- ("transaction id xid(%"X32_F")\n", xid));
- dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
- 800a308: 6842 ldr r2, [r0, #4]
- xid = LWIP_RAND();
- #else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
- xid++;
- #endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */
- }
- dhcp->xid = xid;
- 800a30a: 6023 str r3, [r4, #0]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
- ("transaction id xid(%"X32_F")\n", xid));
- dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
- dhcp->msg_out->op = DHCP_BOOTREQUEST;
- 800a30c: 2301 movs r3, #1
- }
- dhcp->xid = xid;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
- ("transaction id xid(%"X32_F")\n", xid));
- dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload;
- 800a30e: 6162 str r2, [r4, #20]
- dhcp->msg_out->op = DHCP_BOOTREQUEST;
- 800a310: 7013 strb r3, [r2, #0]
- /* TODO: make link layer independent */
- dhcp->msg_out->htype = DHCP_HTYPE_ETH;
- 800a312: 6962 ldr r2, [r4, #20]
- 800a314: 7053 strb r3, [r2, #1]
- dhcp->msg_out->hlen = netif->hwaddr_len;
- 800a316: 6963 ldr r3, [r4, #20]
- 800a318: f896 2026 ldrb.w r2, [r6, #38] ; 0x26
- 800a31c: 709a strb r2, [r3, #2]
- dhcp->msg_out->hops = 0;
- 800a31e: 6963 ldr r3, [r4, #20]
- 800a320: 2500 movs r5, #0
- 800a322: 70dd strb r5, [r3, #3]
- dhcp->msg_out->xid = htonl(dhcp->xid);
- 800a324: 6820 ldr r0, [r4, #0]
- 800a326: f8d4 8014 ldr.w r8, [r4, #20]
- 800a32a: f7ff ff68 bl 800a1fe <lwip_htonl>
- 800a32e: f8c8 0004 str.w r0, [r8, #4]
- dhcp->msg_out->secs = 0;
- 800a332: 6963 ldr r3, [r4, #20]
- /* we don't need the broadcast flag since we can receive unicast traffic
- before being fully configured! */
- dhcp->msg_out->flags = 0;
- ip_addr_set_zero(&dhcp->msg_out->ciaddr);
- /* set ciaddr to netif->ip_addr based on message_type and state */
- if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) ||
- 800a334: 2f08 cmp r7, #8
- /* TODO: make link layer independent */
- dhcp->msg_out->htype = DHCP_HTYPE_ETH;
- dhcp->msg_out->hlen = netif->hwaddr_len;
- dhcp->msg_out->hops = 0;
- dhcp->msg_out->xid = htonl(dhcp->xid);
- dhcp->msg_out->secs = 0;
- 800a336: 721d strb r5, [r3, #8]
- 800a338: 725d strb r5, [r3, #9]
- /* we don't need the broadcast flag since we can receive unicast traffic
- before being fully configured! */
- dhcp->msg_out->flags = 0;
- 800a33a: 729d strb r5, [r3, #10]
- 800a33c: 72dd strb r5, [r3, #11]
- ip_addr_set_zero(&dhcp->msg_out->ciaddr);
- 800a33e: 731d strb r5, [r3, #12]
- 800a340: 735d strb r5, [r3, #13]
- 800a342: 739d strb r5, [r3, #14]
- 800a344: 73dd strb r5, [r3, #15]
- /* set ciaddr to netif->ip_addr based on message_type and state */
- if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) ||
- 800a346: d007 beq.n 800a358 <dhcp_create_msg+0x88>
- 800a348: 2f04 cmp r7, #4
- 800a34a: d005 beq.n 800a358 <dhcp_create_msg+0x88>
- 800a34c: 2f03 cmp r7, #3
- 800a34e: d105 bne.n 800a35c <dhcp_create_msg+0x8c>
- ((message_type == DHCP_REQUEST) && /* DHCP_BOUND not used for sending! */
- ((dhcp->state==DHCP_RENEWING) || dhcp->state==DHCP_REBINDING))) {
- 800a350: 7b22 ldrb r2, [r4, #12]
- before being fully configured! */
- dhcp->msg_out->flags = 0;
- ip_addr_set_zero(&dhcp->msg_out->ciaddr);
- /* set ciaddr to netif->ip_addr based on message_type and state */
- if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) ||
- ((message_type == DHCP_REQUEST) && /* DHCP_BOUND not used for sending! */
- 800a352: 3a04 subs r2, #4
- 800a354: 2a01 cmp r2, #1
- 800a356: d801 bhi.n 800a35c <dhcp_create_msg+0x8c>
- ((dhcp->state==DHCP_RENEWING) || dhcp->state==DHCP_REBINDING))) {
- ip_addr_copy(dhcp->msg_out->ciaddr, netif->ip_addr);
- 800a358: 6872 ldr r2, [r6, #4]
- 800a35a: 60da str r2, [r3, #12]
- }
- ip_addr_set_zero(&dhcp->msg_out->yiaddr);
- 800a35c: 2500 movs r5, #0
- 800a35e: 741d strb r5, [r3, #16]
- 800a360: 745d strb r5, [r3, #17]
- 800a362: 749d strb r5, [r3, #18]
- 800a364: 74dd strb r5, [r3, #19]
- ip_addr_set_zero(&dhcp->msg_out->siaddr);
- 800a366: 751d strb r5, [r3, #20]
- 800a368: 755d strb r5, [r3, #21]
- 800a36a: 759d strb r5, [r3, #22]
- 800a36c: 75dd strb r5, [r3, #23]
- ip_addr_set_zero(&dhcp->msg_out->giaddr);
- 800a36e: 761d strb r5, [r3, #24]
- 800a370: 765d strb r5, [r3, #25]
- 800a372: 769d strb r5, [r3, #26]
- 800a374: 76dd strb r5, [r3, #27]
- for (i = 0; i < DHCP_CHADDR_LEN; i++) {
- /* copy netif hardware address, pad with zeroes */
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- 800a376: f896 1026 ldrb.w r1, [r6, #38] ; 0x26
- 800a37a: 6962 ldr r2, [r4, #20]
- 800a37c: b2ab uxth r3, r5
- 800a37e: 4299 cmp r1, r3
- * @param netif the netif under DHCP control
- * @param dhcp dhcp control struct
- * @param message_type message type of the request
- */
- static err_t
- dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
- 800a380: bf88 it hi
- 800a382: 1973 addhi r3, r6, r5
- ip_addr_set_zero(&dhcp->msg_out->yiaddr);
- ip_addr_set_zero(&dhcp->msg_out->siaddr);
- ip_addr_set_zero(&dhcp->msg_out->giaddr);
- for (i = 0; i < DHCP_CHADDR_LEN; i++) {
- /* copy netif hardware address, pad with zeroes */
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- 800a384: 442a add r2, r5
- 800a386: bf8c ite hi
- 800a388: f893 3027 ldrbhi.w r3, [r3, #39] ; 0x27
- 800a38c: 2300 movls r3, #0
- 800a38e: 3501 adds r5, #1
- ip_addr_copy(dhcp->msg_out->ciaddr, netif->ip_addr);
- }
- ip_addr_set_zero(&dhcp->msg_out->yiaddr);
- ip_addr_set_zero(&dhcp->msg_out->siaddr);
- ip_addr_set_zero(&dhcp->msg_out->giaddr);
- for (i = 0; i < DHCP_CHADDR_LEN; i++) {
- 800a390: 2d10 cmp r5, #16
- /* copy netif hardware address, pad with zeroes */
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- 800a392: 7713 strb r3, [r2, #28]
- ip_addr_copy(dhcp->msg_out->ciaddr, netif->ip_addr);
- }
- ip_addr_set_zero(&dhcp->msg_out->yiaddr);
- ip_addr_set_zero(&dhcp->msg_out->siaddr);
- ip_addr_set_zero(&dhcp->msg_out->giaddr);
- for (i = 0; i < DHCP_CHADDR_LEN; i++) {
- 800a394: d1ef bne.n 800a376 <dhcp_create_msg+0xa6>
- 800a396: 2300 movs r3, #0
- /* copy netif hardware address, pad with zeroes */
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- }
- for (i = 0; i < DHCP_SNAME_LEN; i++) {
- dhcp->msg_out->sname[i] = 0;
- 800a398: 4619 mov r1, r3
- 800a39a: 6962 ldr r2, [r4, #20]
- 800a39c: 18d2 adds r2, r2, r3
- 800a39e: 3301 adds r3, #1
- ip_addr_set_zero(&dhcp->msg_out->giaddr);
- for (i = 0; i < DHCP_CHADDR_LEN; i++) {
- /* copy netif hardware address, pad with zeroes */
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- }
- for (i = 0; i < DHCP_SNAME_LEN; i++) {
- 800a3a0: 2b40 cmp r3, #64 ; 0x40
- dhcp->msg_out->sname[i] = 0;
- 800a3a2: f882 102c strb.w r1, [r2, #44] ; 0x2c
- ip_addr_set_zero(&dhcp->msg_out->giaddr);
- for (i = 0; i < DHCP_CHADDR_LEN; i++) {
- /* copy netif hardware address, pad with zeroes */
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- }
- for (i = 0; i < DHCP_SNAME_LEN; i++) {
- 800a3a6: d1f8 bne.n 800a39a <dhcp_create_msg+0xca>
- 800a3a8: 2200 movs r2, #0
- dhcp->msg_out->sname[i] = 0;
- }
- for (i = 0; i < DHCP_FILE_LEN; i++) {
- dhcp->msg_out->file[i] = 0;
- 800a3aa: 4610 mov r0, r2
- 800a3ac: 6963 ldr r3, [r4, #20]
- 800a3ae: 1899 adds r1, r3, r2
- 800a3b0: 3201 adds r2, #1
- 800a3b2: 2300 movs r3, #0
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- }
- for (i = 0; i < DHCP_SNAME_LEN; i++) {
- dhcp->msg_out->sname[i] = 0;
- }
- for (i = 0; i < DHCP_FILE_LEN; i++) {
- 800a3b4: 2a80 cmp r2, #128 ; 0x80
- dhcp->msg_out->file[i] = 0;
- 800a3b6: f881 006c strb.w r0, [r1, #108] ; 0x6c
- dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
- }
- for (i = 0; i < DHCP_SNAME_LEN; i++) {
- dhcp->msg_out->sname[i] = 0;
- }
- for (i = 0; i < DHCP_FILE_LEN; i++) {
- 800a3ba: d1f7 bne.n 800a3ac <dhcp_create_msg+0xdc>
- dhcp->msg_out->file[i] = 0;
- }
- dhcp->msg_out->cookie = PP_HTONL(DHCP_MAGIC_COOKIE);
- 800a3bc: 6962 ldr r2, [r4, #20]
- 800a3be: f06f 007d mvn.w r0, #125 ; 0x7d
- 800a3c2: 2163 movs r1, #99 ; 0x63
- 800a3c4: f882 00ed strb.w r0, [r2, #237] ; 0xed
- 800a3c8: 2053 movs r0, #83 ; 0x53
- 800a3ca: f882 10ec strb.w r1, [r2, #236] ; 0xec
- 800a3ce: f882 00ee strb.w r0, [r2, #238] ; 0xee
- 800a3d2: f882 10ef strb.w r1, [r2, #239] ; 0xef
- dhcp->options_out_len = 0;
- 800a3d6: 8323 strh r3, [r4, #24]
- /* fill options field with an incrementing array (for debugging purposes) */
- for (i = 0; i < DHCP_OPTIONS_LEN; i++) {
- dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */
- 800a3d8: 6962 ldr r2, [r4, #20]
- 800a3da: 18d2 adds r2, r2, r3
- 800a3dc: f882 30f0 strb.w r3, [r2, #240] ; 0xf0
- 800a3e0: 3301 adds r3, #1
- dhcp->msg_out->file[i] = 0;
- }
- dhcp->msg_out->cookie = PP_HTONL(DHCP_MAGIC_COOKIE);
- dhcp->options_out_len = 0;
- /* fill options field with an incrementing array (for debugging purposes) */
- for (i = 0; i < DHCP_OPTIONS_LEN; i++) {
- 800a3e2: 2b44 cmp r3, #68 ; 0x44
- 800a3e4: d1f8 bne.n 800a3d8 <dhcp_create_msg+0x108>
- dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */
- }
- /* Add option MESSAGE_TYPE */
- dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
- 800a3e6: 4620 mov r0, r4
- 800a3e8: 2135 movs r1, #53 ; 0x35
- 800a3ea: 2201 movs r2, #1
- 800a3ec: f7ff ff13 bl 800a216 <dhcp_option>
- dhcp_option_byte(dhcp, message_type);
- 800a3f0: 4620 mov r0, r4
- 800a3f2: 4639 mov r1, r7
- 800a3f4: f7ff ff1e bl 800a234 <dhcp_option_byte>
- return ERR_OK;
- 800a3f8: 2000 movs r0, #0
- 800a3fa: e004 b.n 800a406 <dhcp_create_msg+0x136>
- if (!xid_initialised) {
- xid = DHCP_GLOBAL_XID;
- xid_initialised = !xid_initialised;
- }
- #endif
- LWIP_ERROR("dhcp_create_msg: netif != NULL", (netif != NULL), return ERR_ARG;);
- 800a3fc: 20f2 movs r0, #242 ; 0xf2
- 800a3fe: e002 b.n 800a406 <dhcp_create_msg+0x136>
- LWIP_ERROR("dhcp_create_msg: dhcp != NULL", (dhcp != NULL), return ERR_VAL;);
- 800a400: 20fa movs r0, #250 ; 0xfa
- 800a402: e000 b.n 800a406 <dhcp_create_msg+0x136>
- LWIP_ASSERT("dhcp_create_msg: dhcp->msg_out == NULL", dhcp->msg_out == NULL);
- dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM);
- if (dhcp->p_out == NULL) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
- ("dhcp_create_msg(): could not allocate pbuf\n"));
- return ERR_MEM;
- 800a404: 20ff movs r0, #255 ; 0xff
- }
- /* Add option MESSAGE_TYPE */
- dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN);
- dhcp_option_byte(dhcp, message_type);
- return ERR_OK;
- }
- 800a406: b240 sxtb r0, r0
- 800a408: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800a40c: 20000108 .word 0x20000108
- 0800a410 <dhcp_delete_msg>:
- *
- * @param dhcp the dhcp struct to free the request from
- */
- static void
- dhcp_delete_msg(struct dhcp *dhcp)
- {
- 800a410: b510 push {r4, lr}
- LWIP_ERROR("dhcp_delete_msg: dhcp != NULL", (dhcp != NULL), return;);
- 800a412: 4604 mov r4, r0
- 800a414: b130 cbz r0, 800a424 <dhcp_delete_msg+0x14>
- LWIP_ASSERT("dhcp_delete_msg: dhcp->p_out != NULL", dhcp->p_out != NULL);
- LWIP_ASSERT("dhcp_delete_msg: dhcp->msg_out != NULL", dhcp->msg_out != NULL);
- if (dhcp->p_out != NULL) {
- 800a416: 6900 ldr r0, [r0, #16]
- 800a418: b108 cbz r0, 800a41e <dhcp_delete_msg+0xe>
- pbuf_free(dhcp->p_out);
- 800a41a: f001 f853 bl 800b4c4 <pbuf_free>
- }
- dhcp->p_out = NULL;
- 800a41e: 2300 movs r3, #0
- 800a420: 6123 str r3, [r4, #16]
- dhcp->msg_out = NULL;
- 800a422: 6163 str r3, [r4, #20]
- 800a424: bd10 pop {r4, pc}
- 800a426: 0000 movs r0, r0
- 0800a428 <dhcp_discover>:
- *
- * @param netif the netif under DHCP control
- */
- static err_t
- dhcp_discover(struct netif *netif)
- {
- 800a428: b573 push {r0, r1, r4, r5, r6, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800a42a: 6a04 ldr r4, [r0, #32]
- err_t result = ERR_OK;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover()\n"));
- ip_addr_set_any(&dhcp->offered_ip_addr);
- 800a42c: 2300 movs r3, #0
- *
- * @param netif the netif under DHCP control
- */
- static err_t
- dhcp_discover(struct netif *netif)
- {
- 800a42e: 4605 mov r5, r0
- struct dhcp *dhcp = netif->dhcp;
- err_t result = ERR_OK;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover()\n"));
- ip_addr_set_any(&dhcp->offered_ip_addr);
- 800a430: 6263 str r3, [r4, #36] ; 0x24
- dhcp_set_state(dhcp, DHCP_SELECTING);
- 800a432: 4620 mov r0, r4
- 800a434: 2106 movs r1, #6
- 800a436: f7ff fee6 bl 800a206 <dhcp_set_state>
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_DISCOVER);
- 800a43a: 4628 mov r0, r5
- 800a43c: 4621 mov r1, r4
- 800a43e: 2201 movs r2, #1
- 800a440: f7ff ff46 bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800a444: 4606 mov r6, r0
- 800a446: 2800 cmp r0, #0
- 800a448: d130 bne.n 800a4ac <dhcp_discover+0x84>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: making request\n"));
- dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
- 800a44a: 2202 movs r2, #2
- 800a44c: 4620 mov r0, r4
- 800a44e: 2139 movs r1, #57 ; 0x39
- 800a450: f7ff fee1 bl 800a216 <dhcp_option>
- dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
- 800a454: 4620 mov r0, r4
- 800a456: 8ca9 ldrh r1, [r5, #36] ; 0x24
- 800a458: f7ff fef4 bl 800a244 <dhcp_option_short>
- dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
- 800a45c: 2204 movs r2, #4
- 800a45e: 4620 mov r0, r4
- 800a460: 2137 movs r1, #55 ; 0x37
- 800a462: f7ff fed8 bl 800a216 <dhcp_option>
- dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);
- 800a466: 4620 mov r0, r4
- 800a468: 2101 movs r1, #1
- 800a46a: f7ff fee3 bl 800a234 <dhcp_option_byte>
- dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);
- 800a46e: 4620 mov r0, r4
- 800a470: 2103 movs r1, #3
- 800a472: f7ff fedf bl 800a234 <dhcp_option_byte>
- dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
- 800a476: 4620 mov r0, r4
- 800a478: 211c movs r1, #28
- 800a47a: f7ff fedb bl 800a234 <dhcp_option_byte>
- dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
- 800a47e: 2106 movs r1, #6
- 800a480: 4620 mov r0, r4
- 800a482: f7ff fed7 bl 800a234 <dhcp_option_byte>
- dhcp_option_trailer(dhcp);
- 800a486: 4620 mov r0, r4
- 800a488: f7ff ff0c bl 800a2a4 <dhcp_option_trailer>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: realloc()ing\n"));
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800a48c: 8b21 ldrh r1, [r4, #24]
- 800a48e: 6920 ldr r0, [r4, #16]
- 800a490: 31f0 adds r1, #240 ; 0xf0
- 800a492: b289 uxth r1, r1
- 800a494: f001 f841 bl 800b51a <pbuf_realloc>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)\n"));
- udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
- 800a498: 9500 str r5, [sp, #0]
- 800a49a: 6860 ldr r0, [r4, #4]
- 800a49c: 6921 ldr r1, [r4, #16]
- 800a49e: 4a0f ldr r2, [pc, #60] ; (800a4dc <dhcp_discover+0xb4>)
- 800a4a0: 2343 movs r3, #67 ; 0x43
- 800a4a2: f003 fd51 bl 800df48 <udp_sendto_if>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: deleting()ing\n"));
- dhcp_delete_msg(dhcp);
- 800a4a6: 4620 mov r0, r4
- 800a4a8: f7ff ffb2 bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_discover: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a4ac: 7b63 ldrb r3, [r4, #13]
- 800a4ae: 3301 adds r3, #1
- 800a4b0: b2db uxtb r3, r3
- if(dhcp->tries >= LWIP_DHCP_AUTOIP_COOP_TRIES && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) {
- dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON;
- autoip_start(netif);
- }
- #endif /* LWIP_DHCP_AUTOIP_COOP */
- msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
- 800a4b2: 2b05 cmp r3, #5
- 800a4b4: bf98 it ls
- 800a4b6: f44f 727a movls.w r2, #1000 ; 0x3e8
- dhcp_delete_msg(dhcp);
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_discover: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a4ba: 7363 strb r3, [r4, #13]
- if(dhcp->tries >= LWIP_DHCP_AUTOIP_COOP_TRIES && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) {
- dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON;
- autoip_start(netif);
- }
- #endif /* LWIP_DHCP_AUTOIP_COOP */
- msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
- 800a4bc: bf9a itte ls
- 800a4be: fa02 f303 lslls.w r3, r2, r3
- 800a4c2: b29b uxthls r3, r3
- 800a4c4: f64e 2360 movwhi r3, #60000 ; 0xea60
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800a4c8: f44f 72fa mov.w r2, #500 ; 0x1f4
- 800a4cc: f203 13f3 addw r3, r3, #499 ; 0x1f3
- 800a4d0: fb93 f3f2 sdiv r3, r3, r2
- 800a4d4: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover(): set request timeout %"U16_F" msecs\n", msecs));
- return result;
- }
- 800a4d6: 4630 mov r0, r6
- 800a4d8: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800a4da: bf00 nop
- 800a4dc: 0801187c .word 0x0801187c
- 0800a4e0 <dhcp_rebind>:
- *
- * @param netif network interface which must rebind with a DHCP server
- */
- static err_t
- dhcp_rebind(struct netif *netif)
- {
- 800a4e0: b573 push {r0, r1, r4, r5, r6, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800a4e2: 6a04 ldr r4, [r0, #32]
- *
- * @param netif network interface which must rebind with a DHCP server
- */
- static err_t
- dhcp_rebind(struct netif *netif)
- {
- 800a4e4: 4605 mov r5, r0
- struct dhcp *dhcp = netif->dhcp;
- err_t result;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind()\n"));
- dhcp_set_state(dhcp, DHCP_REBINDING);
- 800a4e6: 2104 movs r1, #4
- 800a4e8: 4620 mov r0, r4
- 800a4ea: f7ff fe8c bl 800a206 <dhcp_set_state>
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
- 800a4ee: 4628 mov r0, r5
- 800a4f0: 4621 mov r1, r4
- 800a4f2: 2203 movs r2, #3
- 800a4f4: f7ff feec bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800a4f8: 4606 mov r6, r0
- 800a4fa: b9d8 cbnz r0, 800a534 <dhcp_rebind+0x54>
- dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
- 800a4fc: 2202 movs r2, #2
- 800a4fe: 4620 mov r0, r4
- 800a500: 2139 movs r1, #57 ; 0x39
- 800a502: f7ff fe88 bl 800a216 <dhcp_option>
- dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
- 800a506: 8ca9 ldrh r1, [r5, #36] ; 0x24
- 800a508: 4620 mov r0, r4
- 800a50a: f7ff fe9b bl 800a244 <dhcp_option_short>
- dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
- dhcp_option_long(dhcp, ntohl(dhcp->server_ip_addr.addr));
- #endif
- dhcp_option_trailer(dhcp);
- 800a50e: 4620 mov r0, r4
- 800a510: f7ff fec8 bl 800a2a4 <dhcp_option_trailer>
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800a514: 8b21 ldrh r1, [r4, #24]
- 800a516: 6920 ldr r0, [r4, #16]
- 800a518: 31f0 adds r1, #240 ; 0xf0
- 800a51a: b289 uxth r1, r1
- 800a51c: f000 fffd bl 800b51a <pbuf_realloc>
- /* broadcast to server */
- udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
- 800a520: 9500 str r5, [sp, #0]
- 800a522: 6860 ldr r0, [r4, #4]
- 800a524: 6921 ldr r1, [r4, #16]
- 800a526: 4a0e ldr r2, [pc, #56] ; (800a560 <dhcp_rebind+0x80>)
- 800a528: 2343 movs r3, #67 ; 0x43
- 800a52a: f003 fd0d bl 800df48 <udp_sendto_if>
- dhcp_delete_msg(dhcp);
- 800a52e: 4620 mov r0, r4
- 800a530: f7ff ff6e bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_rebind: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a534: 7b63 ldrb r3, [r4, #13]
- 800a536: 3301 adds r3, #1
- 800a538: b2db uxtb r3, r3
- msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
- 800a53a: 2b09 cmp r3, #9
- dhcp_delete_msg(dhcp);
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_rebind: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a53c: 7363 strb r3, [r4, #13]
- msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
- 800a53e: d804 bhi.n 800a54a <dhcp_rebind+0x6a>
- 800a540: f44f 727a mov.w r2, #1000 ; 0x3e8
- 800a544: 4353 muls r3, r2
- 800a546: b29b uxth r3, r3
- 800a548: e001 b.n 800a54e <dhcp_rebind+0x6e>
- 800a54a: f242 7310 movw r3, #10000 ; 0x2710
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800a54e: f44f 72fa mov.w r2, #500 ; 0x1f4
- 800a552: f203 13f3 addw r3, r3, #499 ; 0x1f3
- 800a556: fb93 f3f2 sdiv r3, r3, r2
- 800a55a: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind(): set request timeout %"U16_F" msecs\n", msecs));
- return result;
- }
- 800a55c: 4630 mov r0, r6
- 800a55e: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800a560: 0801187c .word 0x0801187c
- 0800a564 <dhcp_reboot>:
- *
- * @param netif network interface which must reboot
- */
- static err_t
- dhcp_reboot(struct netif *netif)
- {
- 800a564: b573 push {r0, r1, r4, r5, r6, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800a566: 6a04 ldr r4, [r0, #32]
- *
- * @param netif network interface which must reboot
- */
- static err_t
- dhcp_reboot(struct netif *netif)
- {
- 800a568: 4605 mov r5, r0
- struct dhcp *dhcp = netif->dhcp;
- err_t result;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot()\n"));
- dhcp_set_state(dhcp, DHCP_REBOOTING);
- 800a56a: 2103 movs r1, #3
- 800a56c: 4620 mov r0, r4
- 800a56e: f7ff fe4a bl 800a206 <dhcp_set_state>
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
- 800a572: 4628 mov r0, r5
- 800a574: 4621 mov r1, r4
- 800a576: 2203 movs r2, #3
- 800a578: f7ff feaa bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800a57c: 4606 mov r6, r0
- 800a57e: bb40 cbnz r0, 800a5d2 <dhcp_reboot+0x6e>
- dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
- 800a580: 2202 movs r2, #2
- 800a582: 4620 mov r0, r4
- 800a584: 2139 movs r1, #57 ; 0x39
- 800a586: f7ff fe46 bl 800a216 <dhcp_option>
- dhcp_option_short(dhcp, 576);
- 800a58a: 4620 mov r0, r4
- 800a58c: f44f 7110 mov.w r1, #576 ; 0x240
- 800a590: f7ff fe58 bl 800a244 <dhcp_option_short>
- dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
- 800a594: 2204 movs r2, #4
- 800a596: 2132 movs r1, #50 ; 0x32
- 800a598: 4620 mov r0, r4
- 800a59a: f7ff fe3c bl 800a216 <dhcp_option>
- dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr)));
- 800a59e: 6a60 ldr r0, [r4, #36] ; 0x24
- 800a5a0: f7ff fe2f bl 800a202 <lwip_ntohl>
- 800a5a4: 4601 mov r1, r0
- 800a5a6: 4620 mov r0, r4
- 800a5a8: f7ff fe5c bl 800a264 <dhcp_option_long>
- dhcp_option_trailer(dhcp);
- 800a5ac: 4620 mov r0, r4
- 800a5ae: f7ff fe79 bl 800a2a4 <dhcp_option_trailer>
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800a5b2: 8b21 ldrh r1, [r4, #24]
- 800a5b4: 6920 ldr r0, [r4, #16]
- 800a5b6: 31f0 adds r1, #240 ; 0xf0
- 800a5b8: b289 uxth r1, r1
- 800a5ba: f000 ffae bl 800b51a <pbuf_realloc>
- /* broadcast to server */
- udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
- 800a5be: 9500 str r5, [sp, #0]
- 800a5c0: 6860 ldr r0, [r4, #4]
- 800a5c2: 6921 ldr r1, [r4, #16]
- 800a5c4: 4a0e ldr r2, [pc, #56] ; (800a600 <dhcp_reboot+0x9c>)
- 800a5c6: 2343 movs r3, #67 ; 0x43
- 800a5c8: f003 fcbe bl 800df48 <udp_sendto_if>
- dhcp_delete_msg(dhcp);
- 800a5cc: 4620 mov r0, r4
- 800a5ce: f7ff ff1f bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot: REBOOTING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_reboot: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a5d2: 7b63 ldrb r3, [r4, #13]
- 800a5d4: 3301 adds r3, #1
- 800a5d6: b2db uxtb r3, r3
- msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
- 800a5d8: 2b09 cmp r3, #9
- dhcp_delete_msg(dhcp);
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot: REBOOTING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_reboot: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a5da: 7363 strb r3, [r4, #13]
- msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
- 800a5dc: d804 bhi.n 800a5e8 <dhcp_reboot+0x84>
- 800a5de: f44f 727a mov.w r2, #1000 ; 0x3e8
- 800a5e2: 4353 muls r3, r2
- 800a5e4: b29b uxth r3, r3
- 800a5e6: e001 b.n 800a5ec <dhcp_reboot+0x88>
- 800a5e8: f242 7310 movw r3, #10000 ; 0x2710
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800a5ec: f44f 72fa mov.w r2, #500 ; 0x1f4
- 800a5f0: f203 13f3 addw r3, r3, #499 ; 0x1f3
- 800a5f4: fb93 f3f2 sdiv r3, r3, r2
- 800a5f8: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot(): set request timeout %"U16_F" msecs\n", msecs));
- return result;
- }
- 800a5fa: 4630 mov r0, r6
- 800a5fc: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800a5fe: bf00 nop
- 800a600: 0801187c .word 0x0801187c
- 0800a604 <dhcp_select>:
- * @param netif the netif under DHCP control
- * @return lwIP specific error (see error.h)
- */
- static err_t
- dhcp_select(struct netif *netif)
- {
- 800a604: b573 push {r0, r1, r4, r5, r6, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800a606: 6a04 ldr r4, [r0, #32]
- * @param netif the netif under DHCP control
- * @return lwIP specific error (see error.h)
- */
- static err_t
- dhcp_select(struct netif *netif)
- {
- 800a608: 4605 mov r5, r0
- struct dhcp *dhcp = netif->dhcp;
- err_t result;
- u16_t msecs;
- 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));
- dhcp_set_state(dhcp, DHCP_REQUESTING);
- 800a60a: 2101 movs r1, #1
- 800a60c: 4620 mov r0, r4
- 800a60e: f7ff fdfa bl 800a206 <dhcp_set_state>
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
- 800a612: 4628 mov r0, r5
- 800a614: 4621 mov r1, r4
- 800a616: 2203 movs r2, #3
- 800a618: f7ff fe5a bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800a61c: 4606 mov r6, r0
- 800a61e: 2800 cmp r0, #0
- 800a620: d148 bne.n 800a6b4 <dhcp_select+0xb0>
- dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
- 800a622: 2202 movs r2, #2
- 800a624: 4620 mov r0, r4
- 800a626: 2139 movs r1, #57 ; 0x39
- 800a628: f7ff fdf5 bl 800a216 <dhcp_option>
- dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
- 800a62c: 4620 mov r0, r4
- 800a62e: 8ca9 ldrh r1, [r5, #36] ; 0x24
- 800a630: f7ff fe08 bl 800a244 <dhcp_option_short>
- /* MUST request the offered IP address */
- dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
- 800a634: 2204 movs r2, #4
- 800a636: 2132 movs r1, #50 ; 0x32
- 800a638: 4620 mov r0, r4
- 800a63a: f7ff fdec bl 800a216 <dhcp_option>
- dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr)));
- 800a63e: 6a60 ldr r0, [r4, #36] ; 0x24
- 800a640: f7ff fddf bl 800a202 <lwip_ntohl>
- 800a644: 4601 mov r1, r0
- 800a646: 4620 mov r0, r4
- 800a648: f7ff fe0c bl 800a264 <dhcp_option_long>
- dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
- 800a64c: 2204 movs r2, #4
- 800a64e: 2136 movs r1, #54 ; 0x36
- 800a650: 4620 mov r0, r4
- 800a652: f7ff fde0 bl 800a216 <dhcp_option>
- dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->server_ip_addr)));
- 800a656: 6a20 ldr r0, [r4, #32]
- 800a658: f7ff fdd3 bl 800a202 <lwip_ntohl>
- 800a65c: 4601 mov r1, r0
- 800a65e: 4620 mov r0, r4
- 800a660: f7ff fe00 bl 800a264 <dhcp_option_long>
- dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
- 800a664: 2204 movs r2, #4
- 800a666: 4620 mov r0, r4
- 800a668: 2137 movs r1, #55 ; 0x37
- 800a66a: f7ff fdd4 bl 800a216 <dhcp_option>
- dhcp_option_byte(dhcp, DHCP_OPTION_SUBNET_MASK);
- 800a66e: 4620 mov r0, r4
- 800a670: 2101 movs r1, #1
- 800a672: f7ff fddf bl 800a234 <dhcp_option_byte>
- dhcp_option_byte(dhcp, DHCP_OPTION_ROUTER);
- 800a676: 4620 mov r0, r4
- 800a678: 2103 movs r1, #3
- 800a67a: f7ff fddb bl 800a234 <dhcp_option_byte>
- dhcp_option_byte(dhcp, DHCP_OPTION_BROADCAST);
- 800a67e: 4620 mov r0, r4
- 800a680: 211c movs r1, #28
- 800a682: f7ff fdd7 bl 800a234 <dhcp_option_byte>
- dhcp_option_byte(dhcp, DHCP_OPTION_DNS_SERVER);
- 800a686: 2106 movs r1, #6
- 800a688: 4620 mov r0, r4
- 800a68a: f7ff fdd3 bl 800a234 <dhcp_option_byte>
- #if LWIP_NETIF_HOSTNAME
- dhcp_option_hostname(dhcp, netif);
- #endif /* LWIP_NETIF_HOSTNAME */
- dhcp_option_trailer(dhcp);
- 800a68e: 4620 mov r0, r4
- 800a690: f7ff fe08 bl 800a2a4 <dhcp_option_trailer>
- /* shrink the pbuf to the actual content length */
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800a694: 8b21 ldrh r1, [r4, #24]
- 800a696: 6920 ldr r0, [r4, #16]
- 800a698: 31f0 adds r1, #240 ; 0xf0
- 800a69a: b289 uxth r1, r1
- 800a69c: f000 ff3d bl 800b51a <pbuf_realloc>
- /* send broadcast to any DHCP server */
- udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
- 800a6a0: 9500 str r5, [sp, #0]
- 800a6a2: 6860 ldr r0, [r4, #4]
- 800a6a4: 6921 ldr r1, [r4, #16]
- 800a6a6: 4a0f ldr r2, [pc, #60] ; (800a6e4 <dhcp_select+0xe0>)
- 800a6a8: 2343 movs r3, #67 ; 0x43
- 800a6aa: f003 fc4d bl 800df48 <udp_sendto_if>
- dhcp_delete_msg(dhcp);
- 800a6ae: 4620 mov r0, r4
- 800a6b0: f7ff feae bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_select: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a6b4: 7b63 ldrb r3, [r4, #13]
- 800a6b6: 3301 adds r3, #1
- 800a6b8: b2db uxtb r3, r3
- msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
- 800a6ba: 2b05 cmp r3, #5
- 800a6bc: bf98 it ls
- 800a6be: f44f 727a movls.w r2, #1000 ; 0x3e8
- dhcp_delete_msg(dhcp);
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_select: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800a6c2: 7363 strb r3, [r4, #13]
- msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000;
- 800a6c4: bf9a itte ls
- 800a6c6: fa02 f303 lslls.w r3, r2, r3
- 800a6ca: b29b uxthls r3, r3
- 800a6cc: f64e 2360 movwhi r3, #60000 ; 0xea60
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800a6d0: f44f 72fa mov.w r2, #500 ; 0x1f4
- 800a6d4: f203 13f3 addw r3, r3, #499 ; 0x1f3
- 800a6d8: fb93 f3f2 sdiv r3, r3, r2
- 800a6dc: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_select(): set request timeout %"U16_F" msecs\n", msecs));
- return result;
- }
- 800a6de: 4630 mov r0, r6
- 800a6e0: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800a6e2: bf00 nop
- 800a6e4: 0801187c .word 0x0801187c
- 0800a6e8 <dhcp_check>:
- *
- * @param netif the netif under DHCP control
- */
- static void
- dhcp_check(struct netif *netif)
- {
- 800a6e8: b538 push {r3, r4, r5, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800a6ea: 6a04 ldr r4, [r0, #32]
- *
- * @param netif the netif under DHCP control
- */
- static void
- dhcp_check(struct netif *netif)
- {
- 800a6ec: 4605 mov r5, r0
- struct dhcp *dhcp = netif->dhcp;
- err_t result;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_check(netif=%p) %c%c\n", (void *)netif, (s16_t)netif->name[0],
- (s16_t)netif->name[1]));
- dhcp_set_state(dhcp, DHCP_CHECKING);
- 800a6ee: 2108 movs r1, #8
- 800a6f0: 4620 mov r0, r4
- 800a6f2: f7ff fd88 bl 800a206 <dhcp_set_state>
- /* create an ARP query for the offered IP address, expecting that no host
- responds, as the IP address should not be in use. */
- result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);
- 800a6f6: 4628 mov r0, r5
- 800a6f8: f104 0124 add.w r1, r4, #36 ; 0x24
- 800a6fc: 2200 movs r2, #0
- 800a6fe: f004 fc73 bl 800efe8 <etharp_query>
- if (result != ERR_OK) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_check: could not perform ARP query\n"));
- }
- dhcp->tries++;
- 800a702: 7b63 ldrb r3, [r4, #13]
- 800a704: 3301 adds r3, #1
- 800a706: 7363 strb r3, [r4, #13]
- msecs = 500;
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800a708: 2301 movs r3, #1
- 800a70a: 8363 strh r3, [r4, #26]
- 800a70c: bd38 pop {r3, r4, r5, pc}
- 0800a70e <dhcp_bind>:
- *
- * @param netif network interface to bind to the offered address
- */
- static void
- dhcp_bind(struct netif *netif)
- {
- 800a70e: b537 push {r0, r1, r2, r4, r5, lr}
- u32_t timeout;
- struct dhcp *dhcp;
- ip_addr_t sn_mask, gw_addr;
- LWIP_ERROR("dhcp_bind: netif != NULL", (netif != NULL), return;);
- 800a710: 4605 mov r5, r0
- 800a712: 2800 cmp r0, #0
- 800a714: d059 beq.n 800a7ca <dhcp_bind+0xbc>
- dhcp = netif->dhcp;
- 800a716: 6a04 ldr r4, [r0, #32]
- LWIP_ERROR("dhcp_bind: dhcp != NULL", (dhcp != NULL), return;);
- 800a718: 2c00 cmp r4, #0
- 800a71a: d056 beq.n 800a7ca <dhcp_bind+0xbc>
- 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));
- /* temporary DHCP lease? */
- if (dhcp->offered_t1_renew != 0xffffffffUL) {
- 800a71c: 6b63 ldr r3, [r4, #52] ; 0x34
- 800a71e: 1c58 adds r0, r3, #1
- 800a720: d00d beq.n 800a73e <dhcp_bind+0x30>
- /* set renewal period timer */
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t1 renewal timer %"U32_F" secs\n", dhcp->offered_t1_renew));
- timeout = (dhcp->offered_t1_renew + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS;
- 800a722: 223c movs r2, #60 ; 0x3c
- 800a724: 331e adds r3, #30
- 800a726: fbb3 f3f2 udiv r3, r3, r2
- if(timeout > 0xffff) {
- timeout = 0xffff;
- }
- dhcp->t1_timeout = (u16_t)timeout;
- 800a72a: f64f 72ff movw r2, #65535 ; 0xffff
- 800a72e: 4293 cmp r3, r2
- 800a730: bf28 it cs
- 800a732: 4613 movcs r3, r2
- 800a734: b29b uxth r3, r3
- 800a736: 83a3 strh r3, [r4, #28]
- if (dhcp->t1_timeout == 0) {
- 800a738: b90b cbnz r3, 800a73e <dhcp_bind+0x30>
- dhcp->t1_timeout = 1;
- 800a73a: 2301 movs r3, #1
- 800a73c: 83a3 strh r3, [r4, #28]
- }
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t1_renew*1000));
- }
- /* set renewal period timer */
- if (dhcp->offered_t2_rebind != 0xffffffffUL) {
- 800a73e: 6ba3 ldr r3, [r4, #56] ; 0x38
- 800a740: 1c59 adds r1, r3, #1
- 800a742: d00d beq.n 800a760 <dhcp_bind+0x52>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t2 rebind timer %"U32_F" secs\n", dhcp->offered_t2_rebind));
- timeout = (dhcp->offered_t2_rebind + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS;
- 800a744: 223c movs r2, #60 ; 0x3c
- 800a746: 331e adds r3, #30
- 800a748: fbb3 f3f2 udiv r3, r3, r2
- if(timeout > 0xffff) {
- timeout = 0xffff;
- }
- dhcp->t2_timeout = (u16_t)timeout;
- 800a74c: f64f 72ff movw r2, #65535 ; 0xffff
- 800a750: 4293 cmp r3, r2
- 800a752: bf28 it cs
- 800a754: 4613 movcs r3, r2
- 800a756: b29b uxth r3, r3
- 800a758: 83e3 strh r3, [r4, #30]
- if (dhcp->t2_timeout == 0) {
- 800a75a: b90b cbnz r3, 800a760 <dhcp_bind+0x52>
- dhcp->t2_timeout = 1;
- 800a75c: 2301 movs r3, #1
- 800a75e: 83e3 strh r3, [r4, #30]
- }
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000));
- }
- /* If we have sub 1 minute lease, t2 and t1 will kick in at the same time. */
- if ((dhcp->t1_timeout >= dhcp->t2_timeout) && (dhcp->t2_timeout > 0)) {
- 800a760: 8be3 ldrh r3, [r4, #30]
- 800a762: 8ba2 ldrh r2, [r4, #28]
- 800a764: 429a cmp r2, r3
- 800a766: d302 bcc.n 800a76e <dhcp_bind+0x60>
- 800a768: b10b cbz r3, 800a76e <dhcp_bind+0x60>
- dhcp->t1_timeout = 0;
- 800a76a: 2300 movs r3, #0
- 800a76c: 83a3 strh r3, [r4, #28]
- }
- if (dhcp->subnet_mask_given) {
- 800a76e: 7ba3 ldrb r3, [r4, #14]
- 800a770: b10b cbz r3, 800a776 <dhcp_bind+0x68>
- /* copy offered network mask */
- ip_addr_copy(sn_mask, dhcp->offered_sn_mask);
- 800a772: 6aa3 ldr r3, [r4, #40] ; 0x28
- 800a774: e00b b.n 800a78e <dhcp_bind+0x80>
- } else {
- /* subnet mask not given, choose a safe subnet mask given the network class */
- u8_t first_octet = ip4_addr1(&dhcp->offered_ip_addr);
- 800a776: f894 3024 ldrb.w r3, [r4, #36] ; 0x24
- if (first_octet <= 127) {
- 800a77a: 061a lsls r2, r3, #24
- 800a77c: d401 bmi.n 800a782 <dhcp_bind+0x74>
- ip4_addr_set_u32(&sn_mask, PP_HTONL(0xff000000UL));
- 800a77e: 23ff movs r3, #255 ; 0xff
- 800a780: e005 b.n 800a78e <dhcp_bind+0x80>
- } else if (first_octet >= 192) {
- 800a782: 2bbf cmp r3, #191 ; 0xbf
- ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffffff00UL));
- 800a784: bf8c ite hi
- 800a786: f06f 437f mvnhi.w r3, #4278190080 ; 0xff000000
- } else {
- ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffff0000UL));
- 800a78a: f64f 73ff movwls r3, #65535 ; 0xffff
- 800a78e: 9300 str r3, [sp, #0]
- }
- }
- ip_addr_copy(gw_addr, dhcp->offered_gw_addr);
- 800a790: 6ae3 ldr r3, [r4, #44] ; 0x2c
- 800a792: 9301 str r3, [sp, #4]
- /* gateway address not given? */
- if (ip_addr_isany(&gw_addr)) {
- 800a794: b92b cbnz r3, 800a7a2 <dhcp_bind+0x94>
- /* copy network address */
- ip_addr_get_network(&gw_addr, &dhcp->offered_ip_addr, &sn_mask);
- 800a796: 6a63 ldr r3, [r4, #36] ; 0x24
- 800a798: 9a00 ldr r2, [sp, #0]
- 800a79a: 4013 ands r3, r2
- /* use first host address on network as gateway */
- ip4_addr_set_u32(&gw_addr, ip4_addr_get_u32(&gw_addr) | PP_HTONL(0x00000001UL));
- 800a79c: f043 7380 orr.w r3, r3, #16777216 ; 0x1000000
- 800a7a0: 9301 str r3, [sp, #4]
- }
- #endif /* LWIP_DHCP_AUTOIP_COOP */
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): IP: 0x%08"X32_F"\n",
- ip4_addr_get_u32(&dhcp->offered_ip_addr)));
- netif_set_ipaddr(netif, &dhcp->offered_ip_addr);
- 800a7a2: 4628 mov r0, r5
- 800a7a4: f104 0124 add.w r1, r4, #36 ; 0x24
- 800a7a8: f000 fdac bl 800b304 <netif_set_ipaddr>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): SN: 0x%08"X32_F"\n",
- ip4_addr_get_u32(&sn_mask)));
- netif_set_netmask(netif, &sn_mask);
- 800a7ac: 4628 mov r0, r5
- 800a7ae: 4669 mov r1, sp
- 800a7b0: f000 fe0c bl 800b3cc <netif_set_netmask>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): GW: 0x%08"X32_F"\n",
- ip4_addr_get_u32(&gw_addr)));
- netif_set_gw(netif, &gw_addr);
- 800a7b4: a901 add r1, sp, #4
- 800a7b6: 4628 mov r0, r5
- 800a7b8: f000 fe04 bl 800b3c4 <netif_set_gw>
- /* bring the interface up */
- netif_set_up(netif);
- 800a7bc: 4628 mov r0, r5
- 800a7be: f000 fe0f bl 800b3e0 <netif_set_up>
- /* netif is now bound to DHCP leased address */
- dhcp_set_state(dhcp, DHCP_BOUND);
- 800a7c2: 4620 mov r0, r4
- 800a7c4: 210a movs r1, #10
- 800a7c6: f7ff fd1e bl 800a206 <dhcp_set_state>
- }
- 800a7ca: bd3e pop {r1, r2, r3, r4, r5, pc}
- 0800a7cc <dhcp_recv>:
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- {
- 800a7cc: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 800a7d0: 4692 mov sl, r2
- 800a7d2: b08b sub sp, #44 ; 0x2c
- LWIP_UNUSED_ARG(addr);
- LWIP_UNUSED_ARG(port);
- LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
- if (p->len < DHCP_MIN_REPLY_LEN) {
- 800a7d4: f8ba 300a ldrh.w r3, [sl, #10]
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- {
- struct netif *netif = (struct netif *)arg;
- struct dhcp *dhcp = netif->dhcp;
- 800a7d8: f8d0 8020 ldr.w r8, [r0, #32]
- struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload;
- 800a7dc: 6852 ldr r2, [r2, #4]
- LWIP_UNUSED_ARG(addr);
- LWIP_UNUSED_ARG(port);
- LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
- if (p->len < DHCP_MIN_REPLY_LEN) {
- 800a7de: 2b2b cmp r3, #43 ; 0x2b
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- {
- 800a7e0: 4605 mov r5, r0
- LWIP_UNUSED_ARG(addr);
- LWIP_UNUSED_ARG(port);
- LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
- if (p->len < DHCP_MIN_REPLY_LEN) {
- 800a7e2: f240 81b8 bls.w 800ab56 <dhcp_recv+0x38a>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP reply message or pbuf too short\n"));
- goto free_pbuf_and_return;
- }
- if (reply_msg->op != DHCP_BOOTREPLY) {
- 800a7e6: 7813 ldrb r3, [r2, #0]
- 800a7e8: 2b02 cmp r3, #2
- 800a7ea: f040 81b4 bne.w 800ab56 <dhcp_recv+0x38a>
- 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));
- goto free_pbuf_and_return;
- }
- /* iterate through hardware address and match against DHCP message */
- for (i = 0; i < netif->hwaddr_len; i++) {
- 800a7ee: f890 1026 ldrb.w r1, [r0, #38] ; 0x26
- 800a7f2: 2300 movs r3, #0
- 800a7f4: e008 b.n 800a808 <dhcp_recv+0x3c>
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- 800a7f6: 18e8 adds r0, r5, r3
- 800a7f8: 3301 adds r3, #1
- 800a7fa: 18d4 adds r4, r2, r3
- 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));
- goto free_pbuf_and_return;
- }
- /* iterate through hardware address and match against DHCP message */
- for (i = 0; i < netif->hwaddr_len; i++) {
- if (netif->hwaddr[i] != reply_msg->chaddr[i]) {
- 800a7fc: f890 0027 ldrb.w r0, [r0, #39] ; 0x27
- 800a800: 7ee4 ldrb r4, [r4, #27]
- 800a802: 4284 cmp r4, r0
- 800a804: f040 81a7 bne.w 800ab56 <dhcp_recv+0x38a>
- if (reply_msg->op != DHCP_BOOTREPLY) {
- 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));
- goto free_pbuf_and_return;
- }
- /* iterate through hardware address and match against DHCP message */
- for (i = 0; i < netif->hwaddr_len; i++) {
- 800a808: b2d8 uxtb r0, r3
- 800a80a: 4288 cmp r0, r1
- 800a80c: d3f3 bcc.n 800a7f6 <dhcp_recv+0x2a>
- (u16_t)i, (u16_t)netif->hwaddr[i], (u16_t)i, (u16_t)reply_msg->chaddr[i]));
- goto free_pbuf_and_return;
- }
- }
- /* match transaction ID against what we expected */
- if (ntohl(reply_msg->xid) != dhcp->xid) {
- 800a80e: 6850 ldr r0, [r2, #4]
- 800a810: f7ff fcf7 bl 800a202 <lwip_ntohl>
- 800a814: f8d8 3000 ldr.w r3, [r8]
- 800a818: 4298 cmp r0, r3
- 800a81a: f040 819c bne.w 800ab56 <dhcp_recv+0x38a>
- struct pbuf *q;
- int parse_file_as_options = 0;
- int parse_sname_as_options = 0;
- /* clear received options */
- dhcp_clear_all_options(dhcp);
- 800a81e: 2100 movs r1, #0
- 800a820: 220a movs r2, #10
- 800a822: 489d ldr r0, [pc, #628] ; (800aa98 <dhcp_recv+0x2cc>)
- 800a824: f7fe fea8 bl 8009578 <memset>
- /* check that beginning of dhcp_msg (up to and including chaddr) is in first pbuf */
- if (p->len < DHCP_SNAME_OFS) {
- 800a828: f8ba 300a ldrh.w r3, [sl, #10]
- 800a82c: 2b2b cmp r3, #43 ; 0x2b
- 800a82e: f240 8192 bls.w 800ab56 <dhcp_recv+0x38a>
- return ERR_BUF;
- }
- dhcp->msg_in = (struct dhcp_msg *)p->payload;
- 800a832: f8da 3004 ldr.w r3, [sl, #4]
- /* parse options */
- /* start with options field */
- options_idx = DHCP_OPTIONS_OFS;
- /* parse options to the end of the received packet */
- options_idx_max = p->tot_len;
- 800a836: f8ba 9008 ldrh.w r9, [sl, #8]
- dhcp_clear_all_options(dhcp);
- /* check that beginning of dhcp_msg (up to and including chaddr) is in first pbuf */
- if (p->len < DHCP_SNAME_OFS) {
- return ERR_BUF;
- }
- dhcp->msg_in = (struct dhcp_msg *)p->payload;
- 800a83a: f8c8 3008 str.w r3, [r8, #8]
- u16_t offset_max;
- u16_t options_idx;
- u16_t options_idx_max;
- struct pbuf *q;
- int parse_file_as_options = 0;
- int parse_sname_as_options = 0;
- 800a83e: f04f 0b00 mov.w fp, #0
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* parse options */
- /* start with options field */
- options_idx = DHCP_OPTIONS_OFS;
- 800a842: 22f0 movs r2, #240 ; 0xf0
- 800a844: e004 b.n 800a850 <dhcp_recv+0x84>
- parse_file_as_options = 0;
- options_idx = DHCP_FILE_OFS;
- options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
- goto again;
- } else if (parse_sname_as_options) {
- parse_sname_as_options = 0;
- 800a846: f04f 0b00 mov.w fp, #0
- options_idx = DHCP_SNAME_OFS;
- options_idx_max = DHCP_SNAME_OFS + DHCP_SNAME_LEN;
- 800a84a: f04f 096c mov.w r9, #108 ; 0x6c
- options_idx = DHCP_FILE_OFS;
- options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
- goto again;
- } else if (parse_sname_as_options) {
- parse_sname_as_options = 0;
- options_idx = DHCP_SNAME_OFS;
- 800a84e: 222c movs r2, #44 ; 0x2c
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* parse options */
- /* start with options field */
- options_idx = DHCP_OPTIONS_OFS;
- 800a850: 4657 mov r7, sl
- 800a852: e009 b.n 800a868 <dhcp_recv+0x9c>
- again:
- q = p;
- while((q != NULL) && (options_idx >= q->len)) {
- options_idx -= q->len;
- options_idx_max -= q->len;
- q = q->next;
- 800a854: 683f ldr r7, [r7, #0]
- /* parse options to the end of the received packet */
- options_idx_max = p->tot_len;
- again:
- q = p;
- while((q != NULL) && (options_idx >= q->len)) {
- options_idx -= q->len;
- 800a856: 1ad2 subs r2, r2, r3
- options_idx_max -= q->len;
- 800a858: ebc3 0909 rsb r9, r3, r9
- /* parse options to the end of the received packet */
- options_idx_max = p->tot_len;
- again:
- q = p;
- while((q != NULL) && (options_idx >= q->len)) {
- options_idx -= q->len;
- 800a85c: b292 uxth r2, r2
- options_idx_max -= q->len;
- 800a85e: fa1f f989 uxth.w r9, r9
- options_idx = DHCP_OPTIONS_OFS;
- /* parse options to the end of the received packet */
- options_idx_max = p->tot_len;
- again:
- q = p;
- while((q != NULL) && (options_idx >= q->len)) {
- 800a862: 2f00 cmp r7, #0
- 800a864: f000 8177 beq.w 800ab56 <dhcp_recv+0x38a>
- 800a868: 897b ldrh r3, [r7, #10]
- 800a86a: 429a cmp r2, r3
- 800a86c: d2f2 bcs.n 800a854 <dhcp_recv+0x88>
- if (q == NULL) {
- return ERR_BUF;
- }
- offset = options_idx;
- offset_max = options_idx_max;
- options = (u8_t*)q->payload;
- 800a86e: 6878 ldr r0, [r7, #4]
- 800a870: 9003 str r0, [sp, #12]
- 800a872: e0db b.n 800aa2c <dhcp_recv+0x260>
- u8_t len;
- u8_t decode_len = 0;
- int decode_idx = -1;
- u16_t val_offset = offset + 2;
- /* len byte might be in the next pbuf */
- if (offset + 1 < q->len) {
- 800a874: 897b ldrh r3, [r7, #10]
- 800a876: 1c50 adds r0, r2, #1
- 800a878: 4298 cmp r0, r3
- 800a87a: da03 bge.n 800a884 <dhcp_recv+0xb8>
- len = options[offset + 1];
- 800a87c: 9803 ldr r0, [sp, #12]
- 800a87e: 1883 adds r3, r0, r2
- 800a880: 785b ldrb r3, [r3, #1]
- 800a882: e003 b.n 800a88c <dhcp_recv+0xc0>
- } else {
- len = (q->next != NULL ? ((u8_t*)q->next->payload)[0] : 0);
- 800a884: 683b ldr r3, [r7, #0]
- 800a886: b10b cbz r3, 800a88c <dhcp_recv+0xc0>
- 800a888: 685b ldr r3, [r3, #4]
- 800a88a: 781b ldrb r3, [r3, #0]
- }
- /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */
- decode_len = len;
- switch(op) {
- 800a88c: 2933 cmp r1, #51 ; 0x33
- 800a88e: d038 beq.n 800a902 <dhcp_recv+0x136>
- 800a890: d807 bhi.n 800a8a2 <dhcp_recv+0xd6>
- 800a892: 2901 cmp r1, #1
- 800a894: d019 beq.n 800a8ca <dhcp_recv+0xfe>
- 800a896: d311 bcc.n 800a8bc <dhcp_recv+0xf0>
- 800a898: 2903 cmp r1, #3
- 800a89a: d01d beq.n 800a8d8 <dhcp_recv+0x10c>
- 800a89c: 2906 cmp r1, #6
- 800a89e: d155 bne.n 800a94c <dhcp_recv+0x180>
- 800a8a0: e021 b.n 800a8e6 <dhcp_recv+0x11a>
- 800a8a2: 2936 cmp r1, #54 ; 0x36
- 800a8a4: d03d beq.n 800a922 <dhcp_recv+0x156>
- 800a8a6: d804 bhi.n 800a8b2 <dhcp_recv+0xe6>
- 800a8a8: 2934 cmp r1, #52 ; 0x34
- 800a8aa: d031 beq.n 800a910 <dhcp_recv+0x144>
- 800a8ac: 2935 cmp r1, #53 ; 0x35
- 800a8ae: d14d bne.n 800a94c <dhcp_recv+0x180>
- 800a8b0: e035 b.n 800a91e <dhcp_recv+0x152>
- 800a8b2: 293a cmp r1, #58 ; 0x3a
- 800a8b4: d03c beq.n 800a930 <dhcp_recv+0x164>
- 800a8b6: 293b cmp r1, #59 ; 0x3b
- 800a8b8: d148 bne.n 800a94c <dhcp_recv+0x180>
- 800a8ba: e040 b.n 800a93e <dhcp_recv+0x172>
- /* case(DHCP_OPTION_END): handled above */
- case(DHCP_OPTION_PAD):
- /* special option: no len encoded */
- decode_len = len = 0;
- /* will be increased below */
- offset--;
- 800a8bc: 1e51 subs r1, r2, #1
- decode_len = len;
- switch(op) {
- /* case(DHCP_OPTION_END): handled above */
- case(DHCP_OPTION_PAD):
- /* special option: no len encoded */
- decode_len = len = 0;
- 800a8be: 2300 movs r3, #0
- /* will be increased below */
- offset--;
- 800a8c0: b289 uxth r1, r1
- /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
- while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
- u8_t op = options[offset];
- u8_t len;
- u8_t decode_len = 0;
- int decode_idx = -1;
- 800a8c2: f04f 34ff mov.w r4, #4294967295
- decode_len = len;
- switch(op) {
- /* case(DHCP_OPTION_END): handled above */
- case(DHCP_OPTION_PAD):
- /* special option: no len encoded */
- decode_len = len = 0;
- 800a8c6: 461e mov r6, r3
- 800a8c8: e044 b.n 800a954 <dhcp_recv+0x188>
- /* will be increased below */
- offset--;
- break;
- case(DHCP_OPTION_SUBNET_MASK):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- 800a8ca: 2b04 cmp r3, #4
- 800a8cc: f040 8143 bne.w 800ab56 <dhcp_recv+0x38a>
- 800a8d0: 461e mov r6, r3
- 800a8d2: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_SUBNET_MASK;
- 800a8d4: 2406 movs r4, #6
- 800a8d6: e03d b.n 800a954 <dhcp_recv+0x188>
- break;
- case(DHCP_OPTION_ROUTER):
- decode_len = 4; /* only copy the first given router */
- LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
- 800a8d8: 2b03 cmp r3, #3
- 800a8da: f240 813c bls.w 800ab56 <dhcp_recv+0x38a>
- 800a8de: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_ROUTER;
- 800a8e0: 2407 movs r4, #7
- case(DHCP_OPTION_SUBNET_MASK):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- decode_idx = DHCP_OPTION_IDX_SUBNET_MASK;
- break;
- case(DHCP_OPTION_ROUTER):
- decode_len = 4; /* only copy the first given router */
- 800a8e2: 2604 movs r6, #4
- 800a8e4: e036 b.n 800a954 <dhcp_recv+0x188>
- LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
- decode_idx = DHCP_OPTION_IDX_ROUTER;
- break;
- case(DHCP_OPTION_DNS_SERVER):
- /* special case: there might be more than one server */
- LWIP_ERROR("len % 4 == 0", len % 4 == 0, return ERR_VAL;);
- 800a8e6: 0799 lsls r1, r3, #30
- 800a8e8: f040 8135 bne.w 800ab56 <dhcp_recv+0x38a>
- /* limit number of DNS servers */
- decode_len = LWIP_MIN(len, 4 * DNS_MAX_SERVERS);
- 800a8ec: 2b08 cmp r3, #8
- 800a8ee: bf34 ite cc
- 800a8f0: 461e movcc r6, r3
- 800a8f2: 2608 movcs r6, #8
- 800a8f4: b2f6 uxtb r6, r6
- LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
- 800a8f6: 42b3 cmp r3, r6
- 800a8f8: f0c0 812d bcc.w 800ab56 <dhcp_recv+0x38a>
- 800a8fc: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_DNS_SERVER;
- 800a8fe: 2408 movs r4, #8
- 800a900: e028 b.n 800a954 <dhcp_recv+0x188>
- break;
- case(DHCP_OPTION_LEASE_TIME):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- 800a902: 2b04 cmp r3, #4
- 800a904: f040 8127 bne.w 800ab56 <dhcp_recv+0x38a>
- 800a908: 461e mov r6, r3
- 800a90a: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_LEASE_TIME;
- 800a90c: 2403 movs r4, #3
- 800a90e: e021 b.n 800a954 <dhcp_recv+0x188>
- break;
- case(DHCP_OPTION_OVERLOAD):
- LWIP_ERROR("len == 1", len == 1, return ERR_VAL;);
- 800a910: 2b01 cmp r3, #1
- 800a912: f040 8120 bne.w 800ab56 <dhcp_recv+0x38a>
- 800a916: 461e mov r6, r3
- 800a918: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_OVERLOAD;
- 800a91a: 2400 movs r4, #0
- 800a91c: e01a b.n 800a954 <dhcp_recv+0x188>
- break;
- case(DHCP_OPTION_MESSAGE_TYPE):
- LWIP_ERROR("len == 1", len == 1, return ERR_VAL;);
- 800a91e: 2b01 cmp r3, #1
- 800a920: e007 b.n 800a932 <dhcp_recv+0x166>
- decode_idx = DHCP_OPTION_IDX_MSG_TYPE;
- break;
- case(DHCP_OPTION_SERVER_ID):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- 800a922: 2b04 cmp r3, #4
- 800a924: f040 8117 bne.w 800ab56 <dhcp_recv+0x38a>
- 800a928: 461e mov r6, r3
- 800a92a: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_SERVER_ID;
- 800a92c: 2402 movs r4, #2
- 800a92e: e011 b.n 800a954 <dhcp_recv+0x188>
- break;
- case(DHCP_OPTION_T1):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- 800a930: 2b04 cmp r3, #4
- 800a932: f040 8110 bne.w 800ab56 <dhcp_recv+0x38a>
- 800a936: 461e mov r6, r3
- 800a938: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_T1;
- 800a93a: 461c mov r4, r3
- 800a93c: e00a b.n 800a954 <dhcp_recv+0x188>
- break;
- case(DHCP_OPTION_T2):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- 800a93e: 2b04 cmp r3, #4
- 800a940: f040 8109 bne.w 800ab56 <dhcp_recv+0x38a>
- 800a944: 461e mov r6, r3
- 800a946: 4611 mov r1, r2
- decode_idx = DHCP_OPTION_IDX_T2;
- 800a948: 2405 movs r4, #5
- 800a94a: e003 b.n 800a954 <dhcp_recv+0x188>
- } else {
- len = (q->next != NULL ? ((u8_t*)q->next->payload)[0] : 0);
- }
- /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */
- decode_len = len;
- switch(op) {
- 800a94c: 4611 mov r1, r2
- /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
- while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
- u8_t op = options[offset];
- u8_t len;
- u8_t decode_len = 0;
- int decode_idx = -1;
- 800a94e: f04f 34ff mov.w r4, #4294967295
- case(DHCP_OPTION_T2):
- LWIP_ERROR("len == 4", len == 4, return ERR_VAL;);
- decode_idx = DHCP_OPTION_IDX_T2;
- break;
- default:
- decode_len = 0;
- 800a952: 2600 movs r6, #0
- LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
- break;
- }
- offset += len + 2;
- 800a954: 3102 adds r1, #2
- 800a956: fa13 f381 uxtah r3, r3, r1
- 800a95a: b29b uxth r3, r3
- 800a95c: 9301 str r3, [sp, #4]
- if (decode_len > 0) {
- 800a95e: 2e00 cmp r6, #0
- 800a960: d04f beq.n 800aa02 <dhcp_recv+0x236>
- while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
- u8_t op = options[offset];
- u8_t len;
- u8_t decode_len = 0;
- int decode_idx = -1;
- u16_t val_offset = offset + 2;
- 800a962: 3202 adds r2, #2
- 800a964: b292 uxth r2, r2
- LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
- break;
- }
- offset += len + 2;
- if (decode_len > 0) {
- u32_t value = 0;
- 800a966: a90a add r1, sp, #40 ; 0x28
- while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
- u8_t op = options[offset];
- u8_t len;
- u8_t decode_len = 0;
- int decode_idx = -1;
- u16_t val_offset = offset + 2;
- 800a968: 9205 str r2, [sp, #20]
- LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
- break;
- }
- offset += len + 2;
- if (decode_len > 0) {
- u32_t value = 0;
- 800a96a: 2300 movs r3, #0
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- 800a96c: 4a4b ldr r2, [pc, #300] ; (800aa9c <dhcp_recv+0x2d0>)
- LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
- break;
- }
- offset += len + 2;
- if (decode_len > 0) {
- u32_t value = 0;
- 800a96e: f841 3d04 str.w r3, [r1, #-4]!
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- 800a972: eb02 0284 add.w r2, r2, r4, lsl #2
- LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", op));
- break;
- }
- offset += len + 2;
- if (decode_len > 0) {
- u32_t value = 0;
- 800a976: 9104 str r1, [sp, #16]
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- 800a978: 9206 str r2, [sp, #24]
- 800a97a: 9302 str r3, [sp, #8]
- 800a97c: 9805 ldr r0, [sp, #20]
- 800a97e: 9902 ldr r1, [sp, #8]
- if (decode_len > 0) {
- u32_t value = 0;
- u16_t copy_len;
- decode_next:
- LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
- if (!dhcp_option_given(dhcp, decode_idx)) {
- 800a980: 4a45 ldr r2, [pc, #276] ; (800aa98 <dhcp_recv+0x2cc>)
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- 800a982: 1843 adds r3, r0, r1
- if (decode_len > 0) {
- u32_t value = 0;
- u16_t copy_len;
- decode_next:
- LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
- if (!dhcp_option_given(dhcp, decode_idx)) {
- 800a984: 4844 ldr r0, [pc, #272] ; (800aa98 <dhcp_recv+0x2cc>)
- 800a986: 18a2 adds r2, r4, r2
- 800a988: 9207 str r2, [sp, #28]
- 800a98a: 5c22 ldrb r2, [r4, r0]
- /**
- * If an incoming DHCP message is in response to us, then trigger the state machine
- */
- static void
- dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
- 800a98c: ebc1 0c06 rsb ip, r1, r6
- 800a990: b29b uxth r3, r3
- 800a992: fa5f fc8c uxtb.w ip, ip
- if (decode_len > 0) {
- u32_t value = 0;
- u16_t copy_len;
- decode_next:
- LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
- if (!dhcp_option_given(dhcp, decode_idx)) {
- 800a996: 2a00 cmp r2, #0
- 800a998: d133 bne.n 800aa02 <dhcp_recv+0x236>
- copy_len = LWIP_MIN(decode_len, 4);
- pbuf_copy_partial(q, &value, copy_len, val_offset);
- 800a99a: f1bc 0f03 cmp.w ip, #3
- 800a99e: bf94 ite ls
- 800a9a0: 4662 movls r2, ip
- 800a9a2: 2204 movhi r2, #4
- 800a9a4: 4638 mov r0, r7
- 800a9a6: 9904 ldr r1, [sp, #16]
- 800a9a8: f8cd c000 str.w ip, [sp]
- 800a9ac: f000 fed4 bl 800b758 <pbuf_copy_partial>
- if (decode_len > 4) {
- 800a9b0: f8dd c000 ldr.w ip, [sp]
- 800a9b4: f1bc 0f04 cmp.w ip, #4
- 800a9b8: d90f bls.n 800a9da <dhcp_recv+0x20e>
- /* decode more than one u32_t */
- LWIP_ERROR("decode_len % 4 == 0", decode_len % 4 == 0, return ERR_VAL;);
- 800a9ba: f01c 0f03 tst.w ip, #3
- 800a9be: f040 80ca bne.w 800ab56 <dhcp_recv+0x38a>
- dhcp_got_option(dhcp, decode_idx);
- 800a9c2: 9907 ldr r1, [sp, #28]
- dhcp_set_option_value(dhcp, decode_idx, htonl(value));
- 800a9c4: 9809 ldr r0, [sp, #36] ; 0x24
- copy_len = LWIP_MIN(decode_len, 4);
- pbuf_copy_partial(q, &value, copy_len, val_offset);
- if (decode_len > 4) {
- /* decode more than one u32_t */
- LWIP_ERROR("decode_len % 4 == 0", decode_len % 4 == 0, return ERR_VAL;);
- dhcp_got_option(dhcp, decode_idx);
- 800a9c6: 2201 movs r2, #1
- 800a9c8: 700a strb r2, [r1, #0]
- dhcp_set_option_value(dhcp, decode_idx, htonl(value));
- 800a9ca: f7ff fc18 bl 800a1fe <lwip_htonl>
- 800a9ce: 9b02 ldr r3, [sp, #8]
- 800a9d0: 9906 ldr r1, [sp, #24]
- decode_len -= 4;
- val_offset += 4;
- decode_idx++;
- 800a9d2: 3401 adds r4, #1
- pbuf_copy_partial(q, &value, copy_len, val_offset);
- if (decode_len > 4) {
- /* decode more than one u32_t */
- LWIP_ERROR("decode_len % 4 == 0", decode_len % 4 == 0, return ERR_VAL;);
- dhcp_got_option(dhcp, decode_idx);
- dhcp_set_option_value(dhcp, decode_idx, htonl(value));
- 800a9d4: 50c8 str r0, [r1, r3]
- 800a9d6: 3304 adds r3, #4
- 800a9d8: e7cf b.n 800a97a <dhcp_recv+0x1ae>
- decode_len -= 4;
- val_offset += 4;
- decode_idx++;
- goto decode_next;
- } else if (decode_len == 4) {
- 800a9da: d104 bne.n 800a9e6 <dhcp_recv+0x21a>
- value = ntohl(value);
- 800a9dc: 9809 ldr r0, [sp, #36] ; 0x24
- 800a9de: f7ff fc10 bl 800a202 <lwip_ntohl>
- 800a9e2: 9009 str r0, [sp, #36] ; 0x24
- 800a9e4: e006 b.n 800a9f4 <dhcp_recv+0x228>
- } else {
- LWIP_ERROR("invalid decode_len", decode_len == 1, return ERR_VAL;);
- 800a9e6: f1bc 0f01 cmp.w ip, #1
- 800a9ea: f040 80b4 bne.w 800ab56 <dhcp_recv+0x38a>
- value = ((u8_t*)&value)[0];
- 800a9ee: f89d 3024 ldrb.w r3, [sp, #36] ; 0x24
- 800a9f2: 9309 str r3, [sp, #36] ; 0x24
- }
- dhcp_got_option(dhcp, decode_idx);
- 800a9f4: 4a28 ldr r2, [pc, #160] ; (800aa98 <dhcp_recv+0x2cc>)
- dhcp_set_option_value(dhcp, decode_idx, value);
- 800a9f6: 4829 ldr r0, [pc, #164] ; (800aa9c <dhcp_recv+0x2d0>)
- value = ntohl(value);
- } else {
- LWIP_ERROR("invalid decode_len", decode_len == 1, return ERR_VAL;);
- value = ((u8_t*)&value)[0];
- }
- dhcp_got_option(dhcp, decode_idx);
- 800a9f8: 2301 movs r3, #1
- 800a9fa: 5513 strb r3, [r2, r4]
- dhcp_set_option_value(dhcp, decode_idx, value);
- 800a9fc: 9b09 ldr r3, [sp, #36] ; 0x24
- 800a9fe: f840 3024 str.w r3, [r0, r4, lsl #2]
- }
- }
- if (offset >= q->len) {
- 800aa02: 897b ldrh r3, [r7, #10]
- 800aa04: 9901 ldr r1, [sp, #4]
- 800aa06: 4299 cmp r1, r3
- 800aa08: d30f bcc.n 800aa2a <dhcp_recv+0x25e>
- offset -= q->len;
- 800aa0a: 1aca subs r2, r1, r3
- offset_max -= q->len;
- 800aa0c: ebc3 0909 rsb r9, r3, r9
- dhcp_got_option(dhcp, decode_idx);
- dhcp_set_option_value(dhcp, decode_idx, value);
- }
- }
- if (offset >= q->len) {
- offset -= q->len;
- 800aa10: b292 uxth r2, r2
- offset_max -= q->len;
- 800aa12: fa1f f989 uxth.w r9, r9
- if ((offset < offset_max) && offset_max) {
- 800aa16: 454a cmp r2, r9
- dhcp_got_option(dhcp, decode_idx);
- dhcp_set_option_value(dhcp, decode_idx, value);
- }
- }
- if (offset >= q->len) {
- offset -= q->len;
- 800aa18: 9201 str r2, [sp, #4]
- offset_max -= q->len;
- if ((offset < offset_max) && offset_max) {
- 800aa1a: d303 bcc.n 800aa24 <dhcp_recv+0x258>
- break;
- }
- }
- }
- /* is this an overloaded message? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
- 800aa1c: 4a1e ldr r2, [pc, #120] ; (800aa98 <dhcp_recv+0x2cc>)
- 800aa1e: 7813 ldrb r3, [r2, #0]
- 800aa20: b963 cbnz r3, 800aa3c <dhcp_recv+0x270>
- 800aa22: e09f b.n 800ab64 <dhcp_recv+0x398>
- }
- if (offset >= q->len) {
- offset -= q->len;
- offset_max -= q->len;
- if ((offset < offset_max) && offset_max) {
- q = q->next;
- 800aa24: 683f ldr r7, [r7, #0]
- LWIP_ASSERT("next pbuf was null", q);
- options = (u8_t*)q->payload;
- 800aa26: 687b ldr r3, [r7, #4]
- 800aa28: 9303 str r3, [sp, #12]
- u32_t value = 0;
- u16_t copy_len;
- decode_next:
- LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX);
- if (!dhcp_option_given(dhcp, decode_idx)) {
- copy_len = LWIP_MIN(decode_len, 4);
- 800aa2a: 9a01 ldr r2, [sp, #4]
- }
- offset = options_idx;
- offset_max = options_idx_max;
- options = (u8_t*)q->payload;
- /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */
- while((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
- 800aa2c: 9803 ldr r0, [sp, #12]
- 800aa2e: 5c81 ldrb r1, [r0, r2]
- 800aa30: 29ff cmp r1, #255 ; 0xff
- 800aa32: d0f3 beq.n 800aa1c <dhcp_recv+0x250>
- 800aa34: 454a cmp r2, r9
- 800aa36: f4ff af1d bcc.w 800a874 <dhcp_recv+0xa8>
- 800aa3a: e7ef b.n 800aa1c <dhcp_recv+0x250>
- }
- }
- }
- /* is this an overloaded message? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
- u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD);
- 800aa3c: 4b17 ldr r3, [pc, #92] ; (800aa9c <dhcp_recv+0x2d0>)
- dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD);
- 800aa3e: 4916 ldr r1, [pc, #88] ; (800aa98 <dhcp_recv+0x2cc>)
- }
- }
- }
- /* is this an overloaded message? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
- u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD);
- 800aa40: 681b ldr r3, [r3, #0]
- dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD);
- 800aa42: 2200 movs r2, #0
- if (overload == DHCP_OVERLOAD_FILE) {
- 800aa44: 2b01 cmp r3, #1
- }
- }
- /* is this an overloaded message? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) {
- u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD);
- dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD);
- 800aa46: 700a strb r2, [r1, #0]
- if (overload == DHCP_OVERLOAD_FILE) {
- 800aa48: f000 8093 beq.w 800ab72 <dhcp_recv+0x3a6>
- parse_file_as_options = 1;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded file field\n"));
- } else if (overload == DHCP_OVERLOAD_SNAME) {
- 800aa4c: 2b02 cmp r3, #2
- 800aa4e: f43f aefa beq.w 800a846 <dhcp_recv+0x7a>
- parse_sname_as_options = 1;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname field\n"));
- } else if (overload == DHCP_OVERLOAD_SNAME_FILE) {
- 800aa52: 2b03 cmp r3, #3
- 800aa54: f040 8086 bne.w 800ab64 <dhcp_recv+0x398>
- 800aa58: e089 b.n 800ab6e <dhcp_recv+0x3a2>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP_OPTION_MESSAGE_TYPE option not found\n"));
- goto free_pbuf_and_return;
- }
- /* read DHCP message type */
- msg_type = (u8_t)dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_MSG_TYPE);
- 800aa5a: 4a10 ldr r2, [pc, #64] ; (800aa9c <dhcp_recv+0x2d0>)
- 800aa5c: 7911 ldrb r1, [r2, #4]
- /* message type is DHCP ACK? */
- if (msg_type == DHCP_ACK) {
- 800aa5e: 2905 cmp r1, #5
- 800aa60: d140 bne.n 800aae4 <dhcp_recv+0x318>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_ACK received\n"));
- /* in requesting state? */
- if (dhcp->state == DHCP_REQUESTING) {
- 800aa62: f898 100c ldrb.w r1, [r8, #12]
- 800aa66: 2901 cmp r1, #1
- 800aa68: d135 bne.n 800aad6 <dhcp_recv+0x30a>
- * @param netif the netif under DHCP control
- */
- static void
- dhcp_handle_ack(struct netif *netif)
- {
- struct dhcp *dhcp = netif->dhcp;
- 800aa6a: 6a2c ldr r4, [r5, #32]
- #if LWIP_DHCP_BOOTP_FILE
- ip_addr_set_zero(&dhcp->offered_si_addr);
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* lease time given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_LEASE_TIME)) {
- 800aa6c: 78db ldrb r3, [r3, #3]
- #if LWIP_DNS
- u8_t n;
- #endif /* LWIP_DNS */
- /* clear options we might not get from the ACK */
- ip_addr_set_zero(&dhcp->offered_sn_mask);
- 800aa6e: f8c4 b028 str.w fp, [r4, #40] ; 0x28
- ip_addr_set_zero(&dhcp->offered_gw_addr);
- 800aa72: f8c4 b02c str.w fp, [r4, #44] ; 0x2c
- #if LWIP_DHCP_BOOTP_FILE
- ip_addr_set_zero(&dhcp->offered_si_addr);
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* lease time given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_LEASE_TIME)) {
- 800aa76: b10b cbz r3, 800aa7c <dhcp_recv+0x2b0>
- /* remember offered lease time */
- dhcp->offered_t0_lease = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_LEASE_TIME);
- 800aa78: 68d3 ldr r3, [r2, #12]
- 800aa7a: 6323 str r3, [r4, #48] ; 0x30
- }
- /* renewal period given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T1)) {
- 800aa7c: 4b06 ldr r3, [pc, #24] ; (800aa98 <dhcp_recv+0x2cc>)
- 800aa7e: 791a ldrb r2, [r3, #4]
- 800aa80: b112 cbz r2, 800aa88 <dhcp_recv+0x2bc>
- /* remember given renewal period */
- dhcp->offered_t1_renew = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T1);
- 800aa82: 4a06 ldr r2, [pc, #24] ; (800aa9c <dhcp_recv+0x2d0>)
- 800aa84: 6912 ldr r2, [r2, #16]
- 800aa86: e001 b.n 800aa8c <dhcp_recv+0x2c0>
- } else {
- /* calculate safe periods for renewal */
- dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2;
- 800aa88: 6b22 ldr r2, [r4, #48] ; 0x30
- 800aa8a: 0852 lsrs r2, r2, #1
- }
- /* renewal period given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T2)) {
- 800aa8c: 795b ldrb r3, [r3, #5]
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T1)) {
- /* remember given renewal period */
- dhcp->offered_t1_renew = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T1);
- } else {
- /* calculate safe periods for renewal */
- dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2;
- 800aa8e: 6362 str r2, [r4, #52] ; 0x34
- }
- /* renewal period given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T2)) {
- 800aa90: b133 cbz r3, 800aaa0 <dhcp_recv+0x2d4>
- /* remember given rebind period */
- dhcp->offered_t2_rebind = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T2);
- 800aa92: 4b02 ldr r3, [pc, #8] ; (800aa9c <dhcp_recv+0x2d0>)
- 800aa94: 695b ldr r3, [r3, #20]
- 800aa96: e004 b.n 800aaa2 <dhcp_recv+0x2d6>
- 800aa98: 20006dd0 .word 0x20006dd0
- 800aa9c: 20006ddc .word 0x20006ddc
- } else {
- /* calculate safe periods for rebinding */
- dhcp->offered_t2_rebind = dhcp->offered_t0_lease;
- 800aaa0: 6b23 ldr r3, [r4, #48] ; 0x30
- 800aaa2: 63a3 str r3, [r4, #56] ; 0x38
- }
- /* (y)our internet address */
- ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
- 800aaa4: 68a3 ldr r3, [r4, #8]
- boot file name copied in dhcp_parse_reply if not overloaded */
- ip_addr_copy(dhcp->offered_si_addr, dhcp->msg_in->siaddr);
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* subnet mask given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
- 800aaa6: 4a39 ldr r2, [pc, #228] ; (800ab8c <dhcp_recv+0x3c0>)
- /* calculate safe periods for rebinding */
- dhcp->offered_t2_rebind = dhcp->offered_t0_lease;
- }
- /* (y)our internet address */
- ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
- 800aaa8: 691b ldr r3, [r3, #16]
- 800aaaa: 6263 str r3, [r4, #36] ; 0x24
- boot file name copied in dhcp_parse_reply if not overloaded */
- ip_addr_copy(dhcp->offered_si_addr, dhcp->msg_in->siaddr);
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* subnet mask given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
- 800aaac: 7993 ldrb r3, [r2, #6]
- 800aaae: 4616 mov r6, r2
- 800aab0: b12b cbz r3, 800aabe <dhcp_recv+0x2f2>
- /* remember given subnet mask */
- ip4_addr_set_u32(&dhcp->offered_sn_mask, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)));
- 800aab2: 4b37 ldr r3, [pc, #220] ; (800ab90 <dhcp_recv+0x3c4>)
- 800aab4: 6998 ldr r0, [r3, #24]
- 800aab6: f7ff fba2 bl 800a1fe <lwip_htonl>
- dhcp->subnet_mask_given = 1;
- 800aaba: 2301 movs r3, #1
- #endif /* LWIP_DHCP_BOOTP_FILE */
- /* subnet mask given? */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
- /* remember given subnet mask */
- ip4_addr_set_u32(&dhcp->offered_sn_mask, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)));
- 800aabc: 62a0 str r0, [r4, #40] ; 0x28
- dhcp->subnet_mask_given = 1;
- } else {
- dhcp->subnet_mask_given = 0;
- 800aabe: 73a3 strb r3, [r4, #14]
- }
- /* gateway router */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) {
- 800aac0: 79f3 ldrb r3, [r6, #7]
- 800aac2: b123 cbz r3, 800aace <dhcp_recv+0x302>
- ip4_addr_set_u32(&dhcp->offered_gw_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER)));
- 800aac4: 4b32 ldr r3, [pc, #200] ; (800ab90 <dhcp_recv+0x3c4>)
- 800aac6: 69d8 ldr r0, [r3, #28]
- 800aac8: f7ff fb99 bl 800a1fe <lwip_htonl>
- 800aacc: 62e0 str r0, [r4, #44] ; 0x2c
- /* in requesting state? */
- if (dhcp->state == DHCP_REQUESTING) {
- dhcp_handle_ack(netif);
- #if DHCP_DOES_ARP_CHECK
- /* check if the acknowledged lease address is already in use */
- dhcp_check(netif);
- 800aace: 4628 mov r0, r5
- 800aad0: f7ff fe0a bl 800a6e8 <dhcp_check>
- 800aad4: e03f b.n 800ab56 <dhcp_recv+0x38a>
- /* bind interface to the acknowledged lease address */
- dhcp_bind(netif);
- #endif
- }
- /* already bound to the given lease address? */
- else if ((dhcp->state == DHCP_REBOOTING) || (dhcp->state == DHCP_REBINDING) || (dhcp->state == DHCP_RENEWING)) {
- 800aad6: 3903 subs r1, #3
- 800aad8: 2902 cmp r1, #2
- 800aada: d83c bhi.n 800ab56 <dhcp_recv+0x38a>
- dhcp_bind(netif);
- 800aadc: 4628 mov r0, r5
- 800aade: f7ff fe16 bl 800a70e <dhcp_bind>
- 800aae2: e038 b.n 800ab56 <dhcp_recv+0x38a>
- }
- }
- /* received a DHCP_NAK in appropriate state? */
- else if ((msg_type == DHCP_NAK) &&
- 800aae4: 2906 cmp r1, #6
- 800aae6: d121 bne.n 800ab2c <dhcp_recv+0x360>
- 800aae8: f898 300c ldrb.w r3, [r8, #12]
- 800aaec: 2b05 cmp r3, #5
- 800aaee: d832 bhi.n 800ab56 <dhcp_recv+0x38a>
- 800aaf0: f998 300c ldrsb.w r3, [r8, #12]
- 800aaf4: f04f 42b8 mov.w r2, #1543503872 ; 0x5c000000
- 800aaf8: 409a lsls r2, r3
- 800aafa: d52c bpl.n 800ab56 <dhcp_recv+0x38a>
- {
- struct dhcp *dhcp = netif->dhcp;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
- (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
- /* Set the interface down since the address must no longer be used, as per RFC2131 */
- netif_set_down(netif);
- 800aafc: 4628 mov r0, r5
- * @param netif the netif under DHCP control
- */
- static void
- dhcp_handle_nak(struct netif *netif)
- {
- struct dhcp *dhcp = netif->dhcp;
- 800aafe: 6a2c ldr r4, [r5, #32]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
- (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
- /* Set the interface down since the address must no longer be used, as per RFC2131 */
- netif_set_down(netif);
- 800ab00: f000 fc7e bl 800b400 <netif_set_down>
- /* remove IP address from interface */
- netif_set_ipaddr(netif, IP_ADDR_ANY);
- 800ab04: 4628 mov r0, r5
- 800ab06: 4923 ldr r1, [pc, #140] ; (800ab94 <dhcp_recv+0x3c8>)
- 800ab08: f000 fbfc bl 800b304 <netif_set_ipaddr>
- netif_set_gw(netif, IP_ADDR_ANY);
- 800ab0c: 4628 mov r0, r5
- 800ab0e: 4921 ldr r1, [pc, #132] ; (800ab94 <dhcp_recv+0x3c8>)
- 800ab10: f000 fc58 bl 800b3c4 <netif_set_gw>
- netif_set_netmask(netif, IP_ADDR_ANY);
- 800ab14: 4628 mov r0, r5
- 800ab16: 491f ldr r1, [pc, #124] ; (800ab94 <dhcp_recv+0x3c8>)
- 800ab18: f000 fc58 bl 800b3cc <netif_set_netmask>
- /* Change to a defined state */
- dhcp_set_state(dhcp, DHCP_BACKING_OFF);
- 800ab1c: 4620 mov r0, r4
- 800ab1e: 210c movs r1, #12
- 800ab20: f7ff fb71 bl 800a206 <dhcp_set_state>
- /* We can immediately restart discovery */
- dhcp_discover(netif);
- 800ab24: 4628 mov r0, r5
- 800ab26: f7ff fc7f bl 800a428 <dhcp_discover>
- 800ab2a: e014 b.n 800ab56 <dhcp_recv+0x38a>
- (dhcp->state == DHCP_REBINDING) || (dhcp->state == DHCP_RENEWING ))) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_NAK received\n"));
- dhcp_handle_nak(netif);
- }
- /* received a DHCP_OFFER in DHCP_SELECTING state? */
- else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_SELECTING)) {
- 800ab2c: 2902 cmp r1, #2
- 800ab2e: d112 bne.n 800ab56 <dhcp_recv+0x38a>
- 800ab30: f898 100c ldrb.w r1, [r8, #12]
- 800ab34: 2906 cmp r1, #6
- 800ab36: d10e bne.n 800ab56 <dhcp_recv+0x38a>
- {
- struct dhcp *dhcp = netif->dhcp;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
- (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
- /* obtain the server address */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
- 800ab38: 789b ldrb r3, [r3, #2]
- dhcp_handle_nak(netif);
- }
- /* received a DHCP_OFFER in DHCP_SELECTING state? */
- else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_SELECTING)) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_OFFER received in DHCP_SELECTING state\n"));
- dhcp->request_timeout = 0;
- 800ab3a: f8a8 b01a strh.w fp, [r8, #26]
- * @param netif the netif under DHCP control
- */
- static void
- dhcp_handle_offer(struct netif *netif)
- {
- struct dhcp *dhcp = netif->dhcp;
- 800ab3e: 6a2c ldr r4, [r5, #32]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
- (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
- /* obtain the server address */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
- 800ab40: b14b cbz r3, 800ab56 <dhcp_recv+0x38a>
- ip4_addr_set_u32(&dhcp->server_ip_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID)));
- 800ab42: 6890 ldr r0, [r2, #8]
- 800ab44: f7ff fb5b bl 800a1fe <lwip_htonl>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n",
- ip4_addr_get_u32(&dhcp->server_ip_addr)));
- /* remember offered address */
- ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
- 800ab48: 68a3 ldr r3, [r4, #8]
- struct dhcp *dhcp = netif->dhcp;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n",
- (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
- /* obtain the server address */
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
- ip4_addr_set_u32(&dhcp->server_ip_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID)));
- 800ab4a: 6220 str r0, [r4, #32]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n",
- ip4_addr_get_u32(&dhcp->server_ip_addr)));
- /* remember offered address */
- ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
- 800ab4c: 691b ldr r3, [r3, #16]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n",
- ip4_addr_get_u32(&dhcp->offered_ip_addr)));
- dhcp_select(netif);
- 800ab4e: 4628 mov r0, r5
- if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) {
- ip4_addr_set_u32(&dhcp->server_ip_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID)));
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n",
- ip4_addr_get_u32(&dhcp->server_ip_addr)));
- /* remember offered address */
- ip_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr);
- 800ab50: 6263 str r3, [r4, #36] ; 0x24
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n",
- ip4_addr_get_u32(&dhcp->offered_ip_addr)));
- dhcp_select(netif);
- 800ab52: f7ff fd57 bl 800a604 <dhcp_select>
- dhcp->request_timeout = 0;
- /* remember offered lease */
- dhcp_handle_offer(netif);
- }
- free_pbuf_and_return:
- dhcp->msg_in = NULL;
- 800ab56: 2300 movs r3, #0
- 800ab58: f8c8 3008 str.w r3, [r8, #8]
- pbuf_free(p);
- 800ab5c: 4650 mov r0, sl
- 800ab5e: f000 fcb1 bl 800b4c4 <pbuf_free>
- 800ab62: e010 b.n 800ab86 <dhcp_recv+0x3ba>
- /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */
- parse_file_as_options = 0;
- options_idx = DHCP_FILE_OFS;
- options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
- goto again;
- } else if (parse_sname_as_options) {
- 800ab64: f1bb 0f00 cmp.w fp, #0
- 800ab68: f47f ae6d bne.w 800a846 <dhcp_recv+0x7a>
- 800ab6c: e005 b.n 800ab7a <dhcp_recv+0x3ae>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded file field\n"));
- } else if (overload == DHCP_OVERLOAD_SNAME) {
- parse_sname_as_options = 1;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname field\n"));
- } else if (overload == DHCP_OVERLOAD_SNAME_FILE) {
- parse_sname_as_options = 1;
- 800ab6e: f04f 0b01 mov.w fp, #1
- }
- if (parse_file_as_options) {
- /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */
- parse_file_as_options = 0;
- options_idx = DHCP_FILE_OFS;
- options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN;
- 800ab72: f04f 09ec mov.w r9, #236 ; 0xec
- #endif /* LWIP_DHCP_BOOTP_FILE */
- }
- if (parse_file_as_options) {
- /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */
- parse_file_as_options = 0;
- options_idx = DHCP_FILE_OFS;
- 800ab76: 226c movs r2, #108 ; 0x6c
- 800ab78: e66a b.n 800a850 <dhcp_recv+0x84>
- goto free_pbuf_and_return;
- }
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("searching DHCP_OPTION_MESSAGE_TYPE\n"));
- /* obtain pointer to DHCP message type */
- if (!dhcp_option_given(dhcp, DHCP_OPTION_IDX_MSG_TYPE)) {
- 800ab7a: 4b04 ldr r3, [pc, #16] ; (800ab8c <dhcp_recv+0x3c0>)
- 800ab7c: 785a ldrb r2, [r3, #1]
- 800ab7e: 2a00 cmp r2, #0
- 800ab80: f47f af6b bne.w 800aa5a <dhcp_recv+0x28e>
- 800ab84: e7e7 b.n 800ab56 <dhcp_recv+0x38a>
- dhcp_handle_offer(netif);
- }
- free_pbuf_and_return:
- dhcp->msg_in = NULL;
- pbuf_free(p);
- }
- 800ab86: b00b add sp, #44 ; 0x2c
- 800ab88: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800ab8c: 20006dd0 .word 0x20006dd0
- 800ab90: 20006ddc .word 0x20006ddc
- 800ab94: 08011880 .word 0x08011880
- 0800ab98 <dhcp_arp_reply>:
- *
- * @param netif the network interface on which the reply was received
- * @param addr The IP address we received a reply from
- */
- void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr)
- {
- 800ab98: b537 push {r0, r1, r2, r4, r5, lr}
- LWIP_ERROR("netif != NULL", (netif != NULL), return;);
- 800ab9a: 4605 mov r5, r0
- 800ab9c: 2800 cmp r0, #0
- 800ab9e: d037 beq.n 800ac10 <dhcp_arp_reply+0x78>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_arp_reply()\n"));
- /* is a DHCP client doing an ARP check? */
- if ((netif->dhcp != NULL) && (netif->dhcp->state == DHCP_CHECKING)) {
- 800aba0: 6a04 ldr r4, [r0, #32]
- 800aba2: 2c00 cmp r4, #0
- 800aba4: d034 beq.n 800ac10 <dhcp_arp_reply+0x78>
- 800aba6: 7b23 ldrb r3, [r4, #12]
- 800aba8: 2b08 cmp r3, #8
- 800abaa: d131 bne.n 800ac10 <dhcp_arp_reply+0x78>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_arp_reply(): CHECKING, arp reply for 0x%08"X32_F"\n",
- ip4_addr_get_u32(addr)));
- /* did a host respond with the address we
- were offered by the DHCP server? */
- if (ip_addr_cmp(addr, &netif->dhcp->offered_ip_addr)) {
- 800abac: 680a ldr r2, [r1, #0]
- 800abae: 6a63 ldr r3, [r4, #36] ; 0x24
- 800abb0: 429a cmp r2, r3
- 800abb2: d12d bne.n 800ac10 <dhcp_arp_reply+0x78>
- {
- struct dhcp *dhcp = netif->dhcp;
- err_t result = ERR_OK;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_decline()\n"));
- dhcp_set_state(dhcp, DHCP_BACKING_OFF);
- 800abb4: 4620 mov r0, r4
- 800abb6: 210c movs r1, #12
- 800abb8: f7ff fb25 bl 800a206 <dhcp_set_state>
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_DECLINE);
- 800abbc: 4628 mov r0, r5
- 800abbe: 4621 mov r1, r4
- 800abc0: 2204 movs r2, #4
- 800abc2: f7ff fb85 bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800abc6: b9f0 cbnz r0, 800ac06 <dhcp_arp_reply+0x6e>
- dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
- 800abc8: 2204 movs r2, #4
- 800abca: 2132 movs r1, #50 ; 0x32
- 800abcc: 4620 mov r0, r4
- 800abce: f7ff fb22 bl 800a216 <dhcp_option>
- dhcp_option_long(dhcp, ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr)));
- 800abd2: 6a60 ldr r0, [r4, #36] ; 0x24
- 800abd4: f7ff fb15 bl 800a202 <lwip_ntohl>
- 800abd8: 4601 mov r1, r0
- 800abda: 4620 mov r0, r4
- 800abdc: f7ff fb42 bl 800a264 <dhcp_option_long>
- dhcp_option_trailer(dhcp);
- 800abe0: 4620 mov r0, r4
- 800abe2: f7ff fb5f bl 800a2a4 <dhcp_option_trailer>
- /* resize pbuf to reflect true size of options */
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800abe6: 8b21 ldrh r1, [r4, #24]
- 800abe8: 6920 ldr r0, [r4, #16]
- 800abea: 31f0 adds r1, #240 ; 0xf0
- 800abec: b289 uxth r1, r1
- 800abee: f000 fc94 bl 800b51a <pbuf_realloc>
- /* per section 4.4.4, broadcast DECLINE messages */
- udp_sendto_if(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
- 800abf2: 9500 str r5, [sp, #0]
- 800abf4: 6860 ldr r0, [r4, #4]
- 800abf6: 6921 ldr r1, [r4, #16]
- 800abf8: 4a06 ldr r2, [pc, #24] ; (800ac14 <dhcp_arp_reply+0x7c>)
- 800abfa: 2343 movs r3, #67 ; 0x43
- 800abfc: f003 f9a4 bl 800df48 <udp_sendto_if>
- dhcp_delete_msg(dhcp);
- 800ac00: 4620 mov r0, r4
- 800ac02: f7ff fc05 bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_decline: BACKING OFF\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
- ("dhcp_decline: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800ac06: 7b63 ldrb r3, [r4, #13]
- 800ac08: 3301 adds r3, #1
- 800ac0a: 7363 strb r3, [r4, #13]
- msecs = 10*1000;
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800ac0c: 2314 movs r3, #20
- 800ac0e: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING,
- ("dhcp_arp_reply(): arp reply matched with offered address, declining\n"));
- dhcp_decline(netif);
- }
- }
- }
- 800ac10: bd3e pop {r1, r2, r3, r4, r5, pc}
- 800ac12: bf00 nop
- 800ac14: 0801187c .word 0x0801187c
- 0800ac18 <dhcp_renew>:
- *
- * @param netif network interface which must renew its lease
- */
- err_t
- dhcp_renew(struct netif *netif)
- {
- 800ac18: b573 push {r0, r1, r4, r5, r6, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800ac1a: 6a04 ldr r4, [r0, #32]
- *
- * @param netif network interface which must renew its lease
- */
- err_t
- dhcp_renew(struct netif *netif)
- {
- 800ac1c: 4605 mov r5, r0
- struct dhcp *dhcp = netif->dhcp;
- err_t result;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_renew()\n"));
- dhcp_set_state(dhcp, DHCP_RENEWING);
- 800ac1e: 2105 movs r1, #5
- 800ac20: 4620 mov r0, r4
- 800ac22: f7ff faf0 bl 800a206 <dhcp_set_state>
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST);
- 800ac26: 4628 mov r0, r5
- 800ac28: 4621 mov r1, r4
- 800ac2a: 2203 movs r2, #3
- 800ac2c: f7ff fb50 bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800ac30: 4606 mov r6, r0
- 800ac32: b9e0 cbnz r0, 800ac6e <dhcp_renew+0x56>
- dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
- 800ac34: 2202 movs r2, #2
- 800ac36: 4620 mov r0, r4
- 800ac38: 2139 movs r1, #57 ; 0x39
- 800ac3a: f7ff faec bl 800a216 <dhcp_option>
- dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
- 800ac3e: 8ca9 ldrh r1, [r5, #36] ; 0x24
- 800ac40: 4620 mov r0, r4
- 800ac42: f7ff faff bl 800a244 <dhcp_option_short>
- #if LWIP_NETIF_HOSTNAME
- dhcp_option_hostname(dhcp, netif);
- #endif /* LWIP_NETIF_HOSTNAME */
- /* append DHCP message trailer */
- dhcp_option_trailer(dhcp);
- 800ac46: 4620 mov r0, r4
- 800ac48: f7ff fb2c bl 800a2a4 <dhcp_option_trailer>
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800ac4c: 8b21 ldrh r1, [r4, #24]
- 800ac4e: 6920 ldr r0, [r4, #16]
- 800ac50: 31f0 adds r1, #240 ; 0xf0
- 800ac52: b289 uxth r1, r1
- 800ac54: f000 fc61 bl 800b51a <pbuf_realloc>
- udp_sendto_if(dhcp->pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif);
- 800ac58: 9500 str r5, [sp, #0]
- 800ac5a: 6860 ldr r0, [r4, #4]
- 800ac5c: 6921 ldr r1, [r4, #16]
- 800ac5e: f104 0220 add.w r2, r4, #32
- 800ac62: 2343 movs r3, #67 ; 0x43
- 800ac64: f003 f970 bl 800df48 <udp_sendto_if>
- dhcp_delete_msg(dhcp);
- 800ac68: 4620 mov r0, r4
- 800ac6a: f7ff fbd1 bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_renew: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800ac6e: 7b63 ldrb r3, [r4, #13]
- 800ac70: 3301 adds r3, #1
- 800ac72: b2db uxtb r3, r3
- /* back-off on retries, but to a maximum of 20 seconds */
- msecs = dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000;
- 800ac74: 2b09 cmp r3, #9
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_renew: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800ac76: 7363 strb r3, [r4, #13]
- /* back-off on retries, but to a maximum of 20 seconds */
- msecs = dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000;
- 800ac78: d804 bhi.n 800ac84 <dhcp_renew+0x6c>
- 800ac7a: f44f 62fa mov.w r2, #2000 ; 0x7d0
- 800ac7e: 4353 muls r3, r2
- 800ac80: b29b uxth r3, r3
- 800ac82: e001 b.n 800ac88 <dhcp_renew+0x70>
- 800ac84: f644 6320 movw r3, #20000 ; 0x4e20
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800ac88: f44f 72fa mov.w r2, #500 ; 0x1f4
- 800ac8c: f203 13f3 addw r3, r3, #499 ; 0x1f3
- 800ac90: fb93 f3f2 sdiv r3, r3, r2
- 800ac94: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew(): set request timeout %"U16_F" msecs\n", msecs));
- return result;
- }
- 800ac96: 4630 mov r0, r6
- 800ac98: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800ac9a: 0000 movs r0, r0
- 0800ac9c <dhcp_coarse_tmr>:
- /**
- * The DHCP timer that checks for lease renewal/rebind timeouts.
- */
- void
- dhcp_coarse_tmr()
- {
- 800ac9c: b538 push {r3, r4, r5, lr}
- struct netif *netif = netif_list;
- 800ac9e: 4b15 ldr r3, [pc, #84] ; (800acf4 <dhcp_coarse_tmr+0x58>)
- 800aca0: 4d15 ldr r5, [pc, #84] ; (800acf8 <dhcp_coarse_tmr+0x5c>)
- 800aca2: 681c ldr r4, [r3, #0]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n"));
- /* iterate through all network interfaces */
- while (netif != NULL) {
- 800aca4: e023 b.n 800acee <dhcp_coarse_tmr+0x52>
- /* only act on DHCP configured interfaces */
- if (netif->dhcp != NULL) {
- 800aca6: 6a23 ldr r3, [r4, #32]
- 800aca8: b303 cbz r3, 800acec <dhcp_coarse_tmr+0x50>
- /* timer is active (non zero), and triggers (zeroes) now? */
- if (netif->dhcp->t2_timeout-- == 1) {
- 800acaa: 8bda ldrh r2, [r3, #30]
- 800acac: 1e51 subs r1, r2, #1
- 800acae: 2a01 cmp r2, #1
- 800acb0: 83d9 strh r1, [r3, #30]
- 800acb2: d10b bne.n 800accc <dhcp_coarse_tmr+0x30>
- 800acb4: 7b1a ldrb r2, [r3, #12]
- 800acb6: 2a0a cmp r2, #10
- 800acb8: d818 bhi.n 800acec <dhcp_coarse_tmr+0x50>
- 800acba: f993 300c ldrsb.w r3, [r3, #12]
- 800acbe: fa15 f303 lsls.w r3, r5, r3
- 800acc2: d513 bpl.n 800acec <dhcp_coarse_tmr+0x50>
- /* just retry to rebind */
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
- ("dhcp_t2_timeout(): must rebind\n"));
- /* This slightly different to RFC2131: DHCPREQUEST will be sent from state
- DHCP_REBINDING, not DHCP_BOUND */
- dhcp_rebind(netif);
- 800acc4: 4620 mov r0, r4
- 800acc6: f7ff fc0b bl 800a4e0 <dhcp_rebind>
- 800acca: e00f b.n 800acec <dhcp_coarse_tmr+0x50>
- if (netif->dhcp->t2_timeout-- == 1) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t2 timeout\n"));
- /* this clients' rebind timeout triggered */
- dhcp_t2_timeout(netif);
- /* timer is active (non zero), and triggers (zeroes) now */
- } else if (netif->dhcp->t1_timeout-- == 1) {
- 800accc: 8b9a ldrh r2, [r3, #28]
- 800acce: 1e51 subs r1, r2, #1
- 800acd0: 2a01 cmp r2, #1
- 800acd2: 8399 strh r1, [r3, #28]
- 800acd4: d10a bne.n 800acec <dhcp_coarse_tmr+0x50>
- 800acd6: 7b1a ldrb r2, [r3, #12]
- 800acd8: 2a0a cmp r2, #10
- 800acda: d807 bhi.n 800acec <dhcp_coarse_tmr+0x50>
- 800acdc: f993 300c ldrsb.w r3, [r3, #12]
- 800ace0: fa15 f303 lsls.w r3, r5, r3
- 800ace4: d502 bpl.n 800acec <dhcp_coarse_tmr+0x50>
- * eventually time-out if renew tries fail. */
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
- ("dhcp_t1_timeout(): must renew\n"));
- /* This slightly different to RFC2131: DHCPREQUEST will be sent from state
- DHCP_RENEWING, not DHCP_BOUND */
- dhcp_renew(netif);
- 800ace6: 4620 mov r0, r4
- 800ace8: f7ff ff96 bl 800ac18 <dhcp_renew>
- /* this clients' renewal timeout triggered */
- dhcp_t1_timeout(netif);
- }
- }
- /* proceed to next netif */
- netif = netif->next;
- 800acec: 6824 ldr r4, [r4, #0]
- dhcp_coarse_tmr()
- {
- struct netif *netif = netif_list;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n"));
- /* iterate through all network interfaces */
- while (netif != NULL) {
- 800acee: 2c00 cmp r4, #0
- 800acf0: d1d9 bne.n 800aca6 <dhcp_coarse_tmr+0xa>
- }
- }
- /* proceed to next netif */
- netif = netif->next;
- }
- }
- 800acf2: bd38 pop {r3, r4, r5, pc}
- 800acf4: 20008218 .word 0x20008218
- 800acf8: 44200000 .word 0x44200000
- 0800acfc <dhcp_release>:
- *
- * @param netif network interface which must release its lease
- */
- err_t
- dhcp_release(struct netif *netif)
- {
- 800acfc: b573 push {r0, r1, r4, r5, r6, lr}
- struct dhcp *dhcp = netif->dhcp;
- 800acfe: 6a04 ldr r4, [r0, #32]
- *
- * @param netif network interface which must release its lease
- */
- err_t
- dhcp_release(struct netif *netif)
- {
- 800ad00: 4605 mov r5, r0
- err_t result;
- u16_t msecs;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_release()\n"));
- /* idle DHCP client */
- dhcp_set_state(dhcp, DHCP_OFF);
- 800ad02: 2100 movs r1, #0
- 800ad04: 4620 mov r0, r4
- 800ad06: f7ff fa7e bl 800a206 <dhcp_set_state>
- /* clean old DHCP offer */
- ip_addr_set_zero(&dhcp->server_ip_addr);
- 800ad0a: 2300 movs r3, #0
- 800ad0c: 6223 str r3, [r4, #32]
- ip_addr_set_zero(&dhcp->offered_ip_addr);
- 800ad0e: 6263 str r3, [r4, #36] ; 0x24
- ip_addr_set_zero(&dhcp->offered_sn_mask);
- 800ad10: 62a3 str r3, [r4, #40] ; 0x28
- ip_addr_set_zero(&dhcp->offered_gw_addr);
- 800ad12: 62e3 str r3, [r4, #44] ; 0x2c
- #if LWIP_DHCP_BOOTP_FILE
- ip_addr_set_zero(&dhcp->offered_si_addr);
- #endif /* LWIP_DHCP_BOOTP_FILE */
- dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0;
- 800ad14: 63a3 str r3, [r4, #56] ; 0x38
- 800ad16: 6363 str r3, [r4, #52] ; 0x34
- 800ad18: 6323 str r3, [r4, #48] ; 0x30
-
- /* create and initialize the DHCP message header */
- result = dhcp_create_msg(netif, dhcp, DHCP_RELEASE);
- 800ad1a: 4628 mov r0, r5
- 800ad1c: 4621 mov r1, r4
- 800ad1e: 2207 movs r2, #7
- 800ad20: f7ff fad6 bl 800a2d0 <dhcp_create_msg>
- if (result == ERR_OK) {
- 800ad24: 4606 mov r6, r0
- 800ad26: b998 cbnz r0, 800ad50 <dhcp_release+0x54>
- dhcp_option_trailer(dhcp);
- 800ad28: 4620 mov r0, r4
- 800ad2a: f7ff fabb bl 800a2a4 <dhcp_option_trailer>
- pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len);
- 800ad2e: 8b21 ldrh r1, [r4, #24]
- 800ad30: 6920 ldr r0, [r4, #16]
- 800ad32: 31f0 adds r1, #240 ; 0xf0
- 800ad34: b289 uxth r1, r1
- 800ad36: f000 fbf0 bl 800b51a <pbuf_realloc>
- udp_sendto_if(dhcp->pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif);
- 800ad3a: 9500 str r5, [sp, #0]
- 800ad3c: 6860 ldr r0, [r4, #4]
- 800ad3e: 6921 ldr r1, [r4, #16]
- 800ad40: f104 0220 add.w r2, r4, #32
- 800ad44: 2343 movs r3, #67 ; 0x43
- 800ad46: f003 f8ff bl 800df48 <udp_sendto_if>
- dhcp_delete_msg(dhcp);
- 800ad4a: 4620 mov r0, r4
- 800ad4c: f7ff fb60 bl 800a410 <dhcp_delete_msg>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release: RELEASED, DHCP_OFF\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_release: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800ad50: 7b63 ldrb r3, [r4, #13]
- 800ad52: 3301 adds r3, #1
- 800ad54: b2db uxtb r3, r3
- msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
- 800ad56: 2b09 cmp r3, #9
- dhcp_delete_msg(dhcp);
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release: RELEASED, DHCP_OFF\n"));
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_release: could not allocate DHCP request\n"));
- }
- dhcp->tries++;
- 800ad58: 7363 strb r3, [r4, #13]
- msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000;
- 800ad5a: d804 bhi.n 800ad66 <dhcp_release+0x6a>
- 800ad5c: f44f 727a mov.w r2, #1000 ; 0x3e8
- 800ad60: 4353 muls r3, r2
- 800ad62: b29b uxth r3, r3
- 800ad64: e001 b.n 800ad6a <dhcp_release+0x6e>
- 800ad66: f242 7310 movw r3, #10000 ; 0x2710
- dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS;
- 800ad6a: f44f 72fa mov.w r2, #500 ; 0x1f4
- 800ad6e: f203 13f3 addw r3, r3, #499 ; 0x1f3
- 800ad72: fb93 f3f2 sdiv r3, r3, r2
- 800ad76: 8363 strh r3, [r4, #26]
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release(): set request timeout %"U16_F" msecs\n", msecs));
- /* bring the interface down */
- netif_set_down(netif);
- 800ad78: 4628 mov r0, r5
- 800ad7a: f000 fb41 bl 800b400 <netif_set_down>
- /* remove IP address from interface */
- netif_set_ipaddr(netif, IP_ADDR_ANY);
- 800ad7e: 4628 mov r0, r5
- 800ad80: 4906 ldr r1, [pc, #24] ; (800ad9c <dhcp_release+0xa0>)
- 800ad82: f000 fabf bl 800b304 <netif_set_ipaddr>
- netif_set_gw(netif, IP_ADDR_ANY);
- 800ad86: 4628 mov r0, r5
- 800ad88: 4904 ldr r1, [pc, #16] ; (800ad9c <dhcp_release+0xa0>)
- 800ad8a: f000 fb1b bl 800b3c4 <netif_set_gw>
- netif_set_netmask(netif, IP_ADDR_ANY);
- 800ad8e: 4628 mov r0, r5
- 800ad90: 4902 ldr r1, [pc, #8] ; (800ad9c <dhcp_release+0xa0>)
- 800ad92: f000 fb1b bl 800b3cc <netif_set_netmask>
-
- return result;
- }
- 800ad96: 4630 mov r0, r6
- 800ad98: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800ad9a: bf00 nop
- 800ad9c: 08011880 .word 0x08011880
- 0800ada0 <dhcp_fine_tmr>:
- * A DHCP server is expected to respond within a short period of time.
- * This timer checks whether an outstanding DHCP request is timed out.
- */
- void
- dhcp_fine_tmr()
- {
- 800ada0: b538 push {r3, r4, r5, lr}
- struct netif *netif = netif_list;
- 800ada2: 4b26 ldr r3, [pc, #152] ; (800ae3c <dhcp_fine_tmr+0x9c>)
- /* timer is active (non zero), and is about to trigger now */
- if (netif->dhcp->request_timeout > 1) {
- netif->dhcp->request_timeout--;
- }
- else if (netif->dhcp->request_timeout == 1) {
- netif->dhcp->request_timeout--;
- 800ada4: 2500 movs r5, #0
- * This timer checks whether an outstanding DHCP request is timed out.
- */
- void
- dhcp_fine_tmr()
- {
- struct netif *netif = netif_list;
- 800ada6: 681c ldr r4, [r3, #0]
- /* loop through netif's */
- while (netif != NULL) {
- 800ada8: e044 b.n 800ae34 <dhcp_fine_tmr+0x94>
- /* only act on DHCP configured interfaces */
- if (netif->dhcp != NULL) {
- 800adaa: 6a23 ldr r3, [r4, #32]
- 800adac: 2b00 cmp r3, #0
- 800adae: d040 beq.n 800ae32 <dhcp_fine_tmr+0x92>
- /* timer is active (non zero), and is about to trigger now */
- if (netif->dhcp->request_timeout > 1) {
- 800adb0: 8b5a ldrh r2, [r3, #26]
- 800adb2: 2a01 cmp r2, #1
- 800adb4: d902 bls.n 800adbc <dhcp_fine_tmr+0x1c>
- netif->dhcp->request_timeout--;
- 800adb6: 3a01 subs r2, #1
- 800adb8: 835a strh r2, [r3, #26]
- 800adba: e03a b.n 800ae32 <dhcp_fine_tmr+0x92>
- }
- else if (netif->dhcp->request_timeout == 1) {
- 800adbc: d139 bne.n 800ae32 <dhcp_fine_tmr+0x92>
- dhcp_timeout(struct netif *netif)
- {
- struct dhcp *dhcp = netif->dhcp;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout()\n"));
- /* back-off period has passed, or server selection timed out */
- if ((dhcp->state == DHCP_BACKING_OFF) || (dhcp->state == DHCP_SELECTING)) {
- 800adbe: 7b1a ldrb r2, [r3, #12]
- /* timer is active (non zero), and is about to trigger now */
- if (netif->dhcp->request_timeout > 1) {
- netif->dhcp->request_timeout--;
- }
- else if (netif->dhcp->request_timeout == 1) {
- netif->dhcp->request_timeout--;
- 800adc0: 835d strh r5, [r3, #26]
- dhcp_timeout(struct netif *netif)
- {
- struct dhcp *dhcp = netif->dhcp;
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout()\n"));
- /* back-off period has passed, or server selection timed out */
- if ((dhcp->state == DHCP_BACKING_OFF) || (dhcp->state == DHCP_SELECTING)) {
- 800adc2: 2a0c cmp r2, #12
- 800adc4: d028 beq.n 800ae18 <dhcp_fine_tmr+0x78>
- 800adc6: 2a06 cmp r2, #6
- 800adc8: d100 bne.n 800adcc <dhcp_fine_tmr+0x2c>
- 800adca: e025 b.n 800ae18 <dhcp_fine_tmr+0x78>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n"));
- dhcp_discover(netif);
- /* receiving the requested lease timed out */
- } else if (dhcp->state == DHCP_REQUESTING) {
- 800adcc: 2a01 cmp r2, #1
- 800adce: d106 bne.n 800adde <dhcp_fine_tmr+0x3e>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, DHCP request timed out\n"));
- if (dhcp->tries <= 5) {
- 800add0: 7b5b ldrb r3, [r3, #13]
- 800add2: 2b05 cmp r3, #5
- dhcp_select(netif);
- 800add4: 4620 mov r0, r4
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n"));
- dhcp_discover(netif);
- /* receiving the requested lease timed out */
- } else if (dhcp->state == DHCP_REQUESTING) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, DHCP request timed out\n"));
- if (dhcp->tries <= 5) {
- 800add6: d81d bhi.n 800ae14 <dhcp_fine_tmr+0x74>
- dhcp_select(netif);
- 800add8: f7ff fc14 bl 800a604 <dhcp_select>
- 800addc: e029 b.n 800ae32 <dhcp_fine_tmr+0x92>
- dhcp_release(netif);
- dhcp_discover(netif);
- }
- #if DHCP_DOES_ARP_CHECK
- /* received no ARP reply for the offered address (which is good) */
- } else if (dhcp->state == DHCP_CHECKING) {
- 800adde: 2a08 cmp r2, #8
- 800ade0: d109 bne.n 800adf6 <dhcp_fine_tmr+0x56>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): CHECKING, ARP request timed out\n"));
- if (dhcp->tries <= 1) {
- 800ade2: 7b5b ldrb r3, [r3, #13]
- 800ade4: 2b01 cmp r3, #1
- dhcp_check(netif);
- 800ade6: 4620 mov r0, r4
- }
- #if DHCP_DOES_ARP_CHECK
- /* received no ARP reply for the offered address (which is good) */
- } else if (dhcp->state == DHCP_CHECKING) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): CHECKING, ARP request timed out\n"));
- if (dhcp->tries <= 1) {
- 800ade8: d802 bhi.n 800adf0 <dhcp_fine_tmr+0x50>
- dhcp_check(netif);
- 800adea: f7ff fc7d bl 800a6e8 <dhcp_check>
- 800adee: e020 b.n 800ae32 <dhcp_fine_tmr+0x92>
- /* no ARP replies on the offered address,
- looks like the IP address is indeed free */
- } else {
- /* bind the interface to the offered address */
- dhcp_bind(netif);
- 800adf0: f7ff fc8d bl 800a70e <dhcp_bind>
- 800adf4: e01d b.n 800ae32 <dhcp_fine_tmr+0x92>
- }
- #endif /* DHCP_DOES_ARP_CHECK */
- }
- /* did not get response to renew request? */
- else if (dhcp->state == DHCP_RENEWING) {
- 800adf6: 2a05 cmp r2, #5
- 800adf8: d103 bne.n 800ae02 <dhcp_fine_tmr+0x62>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RENEWING, DHCP request timed out\n"));
- /* just retry renewal */
- /* note that the rebind timer will eventually time-out if renew does not work */
- dhcp_renew(netif);
- 800adfa: 4620 mov r0, r4
- 800adfc: f7ff ff0c bl 800ac18 <dhcp_renew>
- 800ae00: e017 b.n 800ae32 <dhcp_fine_tmr+0x92>
- /* did not get response to rebind request? */
- } else if (dhcp->state == DHCP_REBINDING) {
- 800ae02: 2a04 cmp r2, #4
- 800ae04: d10a bne.n 800ae1c <dhcp_fine_tmr+0x7c>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REBINDING, DHCP request timed out\n"));
- if (dhcp->tries <= 8) {
- 800ae06: 7b5b ldrb r3, [r3, #13]
- 800ae08: 2b08 cmp r3, #8
- dhcp_rebind(netif);
- 800ae0a: 4620 mov r0, r4
- /* note that the rebind timer will eventually time-out if renew does not work */
- dhcp_renew(netif);
- /* did not get response to rebind request? */
- } else if (dhcp->state == DHCP_REBINDING) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REBINDING, DHCP request timed out\n"));
- if (dhcp->tries <= 8) {
- 800ae0c: d802 bhi.n 800ae14 <dhcp_fine_tmr+0x74>
- dhcp_rebind(netif);
- 800ae0e: f7ff fb67 bl 800a4e0 <dhcp_rebind>
- 800ae12: e00e b.n 800ae32 <dhcp_fine_tmr+0x92>
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RELEASING, DISCOVERING\n"));
- dhcp_release(netif);
- 800ae14: f7ff ff72 bl 800acfc <dhcp_release>
- dhcp_discover(netif);
- 800ae18: 4620 mov r0, r4
- 800ae1a: e008 b.n 800ae2e <dhcp_fine_tmr+0x8e>
- }
- } else if (dhcp->state == DHCP_REBOOTING) {
- 800ae1c: 2a03 cmp r2, #3
- 800ae1e: d108 bne.n 800ae32 <dhcp_fine_tmr+0x92>
- if (dhcp->tries < REBOOT_TRIES) {
- 800ae20: 7b5b ldrb r3, [r3, #13]
- 800ae22: 2b01 cmp r3, #1
- dhcp_reboot(netif);
- 800ae24: 4620 mov r0, r4
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): RELEASING, DISCOVERING\n"));
- dhcp_release(netif);
- dhcp_discover(netif);
- }
- } else if (dhcp->state == DHCP_REBOOTING) {
- if (dhcp->tries < REBOOT_TRIES) {
- 800ae26: d802 bhi.n 800ae2e <dhcp_fine_tmr+0x8e>
- dhcp_reboot(netif);
- 800ae28: f7ff fb9c bl 800a564 <dhcp_reboot>
- 800ae2c: e001 b.n 800ae32 <dhcp_fine_tmr+0x92>
- } else {
- dhcp_discover(netif);
- 800ae2e: f7ff fafb bl 800a428 <dhcp_discover>
- /* this client's request timeout triggered */
- dhcp_timeout(netif);
- }
- }
- /* proceed to next network interface */
- netif = netif->next;
- 800ae32: 6824 ldr r4, [r4, #0]
- void
- dhcp_fine_tmr()
- {
- struct netif *netif = netif_list;
- /* loop through netif's */
- while (netif != NULL) {
- 800ae34: 2c00 cmp r4, #0
- 800ae36: d1b8 bne.n 800adaa <dhcp_fine_tmr+0xa>
- }
- }
- /* proceed to next network interface */
- netif = netif->next;
- }
- }
- 800ae38: bd38 pop {r3, r4, r5, pc}
- 800ae3a: bf00 nop
- 800ae3c: 20008218 .word 0x20008218
- 0800ae40 <dhcp_stop>:
- *
- * @param netif The network interface to stop DHCP on
- */
- void
- dhcp_stop(struct netif *netif)
- {
- 800ae40: b510 push {r4, lr}
- struct dhcp *dhcp;
- LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;);
- 800ae42: b198 cbz r0, 800ae6c <dhcp_stop+0x2c>
- dhcp = netif->dhcp;
- /* Remove the flag that says this netif is handled by DHCP. */
- netif->flags &= ~NETIF_FLAG_DHCP;
- 800ae44: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
- void
- dhcp_stop(struct netif *netif)
- {
- struct dhcp *dhcp;
- LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;);
- dhcp = netif->dhcp;
- 800ae48: 6a04 ldr r4, [r0, #32]
- /* Remove the flag that says this netif is handled by DHCP. */
- netif->flags &= ~NETIF_FLAG_DHCP;
- 800ae4a: f023 0308 bic.w r3, r3, #8
- 800ae4e: f880 302d strb.w r3, [r0, #45] ; 0x2d
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_stop()\n"));
- /* netif is DHCP configured? */
- if (dhcp != NULL) {
- 800ae52: b15c cbz r4, 800ae6c <dhcp_stop+0x2c>
- autoip_stop(netif);
- dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF;
- }
- #endif /* LWIP_DHCP_AUTOIP_COOP */
- if (dhcp->pcb != NULL) {
- 800ae54: 6860 ldr r0, [r4, #4]
- 800ae56: b118 cbz r0, 800ae60 <dhcp_stop+0x20>
- udp_remove(dhcp->pcb);
- 800ae58: f003 f908 bl 800e06c <udp_remove>
- dhcp->pcb = NULL;
- 800ae5c: 2300 movs r3, #0
- 800ae5e: 6063 str r3, [r4, #4]
- }
- LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
- dhcp_set_state(dhcp, DHCP_OFF);
- 800ae60: 4620 mov r0, r4
- 800ae62: 2100 movs r1, #0
- }
- }
- 800ae64: e8bd 4010 ldmia.w sp!, {r4, lr}
- if (dhcp->pcb != NULL) {
- udp_remove(dhcp->pcb);
- dhcp->pcb = NULL;
- }
- LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL);
- dhcp_set_state(dhcp, DHCP_OFF);
- 800ae68: f7ff b9cd b.w 800a206 <dhcp_set_state>
- 800ae6c: bd10 pop {r4, pc}
- 800ae6e: 0000 movs r0, r0
- 0800ae70 <dhcp_start>:
- * - ERR_OK - No error
- * - ERR_MEM - Out of memory
- */
- err_t
- dhcp_start(struct netif *netif)
- {
- 800ae70: b538 push {r3, r4, r5, lr}
- struct dhcp *dhcp;
- err_t result = ERR_OK;
- LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
- 800ae72: 4604 mov r4, r0
- 800ae74: b908 cbnz r0, 800ae7a <dhcp_start+0xa>
- 800ae76: 20f2 movs r0, #242 ; 0xf2
- 800ae78: e047 b.n 800af0a <dhcp_start+0x9a>
- dhcp = netif->dhcp;
- 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));
- /* Remove the flag that says this netif is handled by DHCP,
- it is set when we succeeded starting. */
- netif->flags &= ~NETIF_FLAG_DHCP;
- 800ae7a: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
- {
- struct dhcp *dhcp;
- err_t result = ERR_OK;
- LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
- dhcp = netif->dhcp;
- 800ae7e: 6a05 ldr r5, [r0, #32]
- 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));
- /* Remove the flag that says this netif is handled by DHCP,
- it is set when we succeeded starting. */
- netif->flags &= ~NETIF_FLAG_DHCP;
- 800ae80: f023 0208 bic.w r2, r3, #8
- /* check hwtype of the netif */
- if ((netif->flags & NETIF_FLAG_ETHARP) == 0) {
- 800ae84: f003 0320 and.w r3, r3, #32
- 800ae88: b2db uxtb r3, r3
- LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
- dhcp = netif->dhcp;
- 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));
- /* Remove the flag that says this netif is handled by DHCP,
- it is set when we succeeded starting. */
- netif->flags &= ~NETIF_FLAG_DHCP;
- 800ae8a: f880 202d strb.w r2, [r0, #45] ; 0x2d
- /* check hwtype of the netif */
- if ((netif->flags & NETIF_FLAG_ETHARP) == 0) {
- 800ae8e: 2b00 cmp r3, #0
- 800ae90: d0f1 beq.n 800ae76 <dhcp_start+0x6>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): No ETHARP netif\n"));
- return ERR_ARG;
- }
- /* check MTU of the netif */
- if (netif->mtu < DHCP_MAX_MSG_LEN_MIN_REQUIRED) {
- 800ae92: 8c83 ldrh r3, [r0, #36] ; 0x24
- 800ae94: f5b3 7f10 cmp.w r3, #576 ; 0x240
- 800ae98: d200 bcs.n 800ae9c <dhcp_start+0x2c>
- 800ae9a: e02e b.n 800aefa <dhcp_start+0x8a>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): Cannot use this netif with DHCP: MTU is too small\n"));
- return ERR_MEM;
- }
- /* no DHCP client attached yet? */
- if (dhcp == NULL) {
- 800ae9c: b935 cbnz r5, 800aeac <dhcp_start+0x3c>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting new DHCP client\n"));
- dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp));
- 800ae9e: 203c movs r0, #60 ; 0x3c
- 800aea0: f000 f934 bl 800b10c <mem_malloc>
- if (dhcp == NULL) {
- 800aea4: 4605 mov r5, r0
- 800aea6: b340 cbz r0, 800aefa <dhcp_start+0x8a>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n"));
- return ERR_MEM;
- }
- /* store this dhcp client in the netif */
- netif->dhcp = dhcp;
- 800aea8: 6220 str r0, [r4, #32]
- 800aeaa: e003 b.n 800aeb4 <dhcp_start+0x44>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp"));
- /* already has DHCP client attached */
- } else {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(): restarting DHCP configuration\n"));
- if (dhcp->pcb != NULL) {
- 800aeac: 6868 ldr r0, [r5, #4]
- 800aeae: b108 cbz r0, 800aeb4 <dhcp_start+0x44>
- udp_remove(dhcp->pcb);
- 800aeb0: f003 f8dc bl 800e06c <udp_remove>
- LWIP_ASSERT("pbuf p_out wasn't freed", dhcp->p_out == NULL);
- LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL );
- }
-
- /* clear data structure */
- memset(dhcp, 0, sizeof(struct dhcp));
- 800aeb4: 2100 movs r1, #0
- 800aeb6: 223c movs r2, #60 ; 0x3c
- 800aeb8: 4628 mov r0, r5
- 800aeba: f7fe fb5d bl 8009578 <memset>
- /* dhcp_set_state(&dhcp, DHCP_OFF); */
- /* allocate UDP PCB */
- dhcp->pcb = udp_new();
- 800aebe: f003 f8eb bl 800e098 <udp_new>
- 800aec2: 6068 str r0, [r5, #4]
- if (dhcp->pcb == NULL) {
- 800aec4: b1c8 cbz r0, 800aefa <dhcp_start+0x8a>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not obtain pcb\n"));
- return ERR_MEM;
- }
- ip_set_option(dhcp->pcb, SOF_BROADCAST);
- 800aec6: 7a03 ldrb r3, [r0, #8]
- /* set up local and remote port for the pcb */
- udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
- 800aec8: 4911 ldr r1, [pc, #68] ; (800af10 <dhcp_start+0xa0>)
- dhcp->pcb = udp_new();
- if (dhcp->pcb == NULL) {
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not obtain pcb\n"));
- return ERR_MEM;
- }
- ip_set_option(dhcp->pcb, SOF_BROADCAST);
- 800aeca: f043 0320 orr.w r3, r3, #32
- 800aece: 7203 strb r3, [r0, #8]
- /* set up local and remote port for the pcb */
- udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
- 800aed0: 2244 movs r2, #68 ; 0x44
- 800aed2: 6868 ldr r0, [r5, #4]
- 800aed4: f002 ffec bl 800deb0 <udp_bind>
- udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
- 800aed8: 490d ldr r1, [pc, #52] ; (800af10 <dhcp_start+0xa0>)
- 800aeda: 6868 ldr r0, [r5, #4]
- 800aedc: 2243 movs r2, #67 ; 0x43
- 800aede: f003 f89b bl 800e018 <udp_connect>
- /* set up the recv callback and argument */
- udp_recv(dhcp->pcb, dhcp_recv, netif);
- 800aee2: 6868 ldr r0, [r5, #4]
- 800aee4: 490b ldr r1, [pc, #44] ; (800af14 <dhcp_start+0xa4>)
- 800aee6: 4622 mov r2, r4
- 800aee8: f003 f8bc bl 800e064 <udp_recv>
- LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n"));
- /* (re)start the DHCP negotiation */
- result = dhcp_discover(netif);
- 800aeec: 4620 mov r0, r4
- 800aeee: f7ff fa9b bl 800a428 <dhcp_discover>
- if (result != ERR_OK) {
- 800aef2: b120 cbz r0, 800aefe <dhcp_start+0x8e>
- /* free resources allocated above */
- dhcp_stop(netif);
- 800aef4: 4620 mov r0, r4
- 800aef6: f7ff ffa3 bl 800ae40 <dhcp_stop>
- return ERR_MEM;
- 800aefa: 20ff movs r0, #255 ; 0xff
- 800aefc: e005 b.n 800af0a <dhcp_start+0x9a>
- }
- /* Set the flag that says this netif is handled by DHCP. */
- netif->flags |= NETIF_FLAG_DHCP;
- 800aefe: f894 302d ldrb.w r3, [r4, #45] ; 0x2d
- 800af02: f043 0308 orr.w r3, r3, #8
- 800af06: f884 302d strb.w r3, [r4, #45] ; 0x2d
- return result;
- }
- 800af0a: b240 sxtb r0, r0
- 800af0c: bd38 pop {r3, r4, r5, pc}
- 800af0e: bf00 nop
- 800af10: 08011880 .word 0x08011880
- 800af14: 0800a7cd .word 0x0800a7cd
- 0800af18 <lwip_init>:
- /**
- * Perform Sanity check of user-configurable values, and initialize all modules.
- */
- void
- lwip_init(void)
- {
- 800af18: b508 push {r3, lr}
- /* Modules initialization */
- stats_init();
- 800af1a: f000 fc8f bl 800b83c <stats_init>
- #if !NO_SYS
- sys_init();
- #endif /* !NO_SYS */
- mem_init();
- 800af1e: f000 f80d bl 800af3c <mem_init>
- memp_init();
- 800af22: f000 f973 bl 800b20c <memp_init>
- pbuf_init();
- netif_init();
- 800af26: f000 f9eb bl 800b300 <netif_init>
- #endif /* LWIP_ARP */
- #if LWIP_RAW
- raw_init();
- #endif /* LWIP_RAW */
- #if LWIP_UDP
- udp_init();
- 800af2a: f002 fee3 bl 800dcf4 <udp_init>
- #endif /* LWIP_UDP */
- #if LWIP_TCP
- tcp_init();
- 800af2e: f000 fcb5 bl 800b89c <tcp_init>
- #endif /* LWIP_DNS */
- #if LWIP_TIMERS
- sys_timeouts_init();
- #endif /* LWIP_TIMERS */
- }
- 800af32: e8bd 4008 ldmia.w sp!, {r3, lr}
- #if LWIP_DNS
- dns_init();
- #endif /* LWIP_DNS */
- #if LWIP_TIMERS
- sys_timeouts_init();
- 800af36: f002 be1f b.w 800db78 <sys_timeouts_init>
- 800af3a: 0000 movs r0, r0
- 0800af3c <mem_init>:
- LWIP_ASSERT("Sanity check alignment",
- (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
- /* align the heap */
- ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
- 800af3c: 4b0b ldr r3, [pc, #44] ; (800af6c <mem_init+0x30>)
- 800af3e: 4a0c ldr r2, [pc, #48] ; (800af70 <mem_init+0x34>)
- mem = (struct mem *)(void *)ram;
- mem->next = MEM_SIZE_ALIGNED;
- mem->prev = 0;
- mem->used = 0;
- /* initialize the end of the heap */
- ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
- 800af40: 480c ldr r0, [pc, #48] ; (800af74 <mem_init+0x38>)
- LWIP_ASSERT("Sanity check alignment",
- (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
- /* align the heap */
- ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
- 800af42: f023 0303 bic.w r3, r3, #3
- /* initialize the start of the heap */
- mem = (struct mem *)(void *)ram;
- mem->next = MEM_SIZE_ALIGNED;
- mem->prev = 0;
- 800af46: 2100 movs r1, #0
- LWIP_ASSERT("Sanity check alignment",
- (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
- /* align the heap */
- ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
- 800af48: 6013 str r3, [r2, #0]
- /* initialize the start of the heap */
- mem = (struct mem *)(void *)ram;
- mem->next = MEM_SIZE_ALIGNED;
- 800af4a: f44f 52a0 mov.w r2, #5120 ; 0x1400
- mem->prev = 0;
- 800af4e: 8059 strh r1, [r3, #2]
- mem->used = 0;
- 800af50: 7119 strb r1, [r3, #4]
- /* initialize the end of the heap */
- ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
- 800af52: 1899 adds r1, r3, r2
- 800af54: 6001 str r1, [r0, #0]
- ram_end->used = 1;
- 800af56: 2001 movs r0, #1
- /* align the heap */
- ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
- /* initialize the start of the heap */
- mem = (struct mem *)(void *)ram;
- mem->next = MEM_SIZE_ALIGNED;
- 800af58: 801a strh r2, [r3, #0]
- mem->used = 0;
- /* initialize the end of the heap */
- ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
- ram_end->used = 1;
- ram_end->next = MEM_SIZE_ALIGNED;
- ram_end->prev = MEM_SIZE_ALIGNED;
- 800af5a: 804a strh r2, [r1, #2]
- mem->prev = 0;
- mem->used = 0;
- /* initialize the end of the heap */
- ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
- ram_end->used = 1;
- ram_end->next = MEM_SIZE_ALIGNED;
- 800af5c: 800a strh r2, [r1, #0]
- mem->next = MEM_SIZE_ALIGNED;
- mem->prev = 0;
- mem->used = 0;
- /* initialize the end of the heap */
- ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED];
- ram_end->used = 1;
- 800af5e: 7108 strb r0, [r1, #4]
- ram_end->next = MEM_SIZE_ALIGNED;
- ram_end->prev = MEM_SIZE_ALIGNED;
- /* initialize the lowest-free pointer to the start of the heap */
- lfree = (struct mem *)(void *)ram;
- 800af60: 4905 ldr r1, [pc, #20] ; (800af78 <mem_init+0x3c>)
- 800af62: 600b str r3, [r1, #0]
- MEM_STATS_AVAIL(avail, MEM_SIZE_ALIGNED);
- 800af64: 4b05 ldr r3, [pc, #20] ; (800af7c <mem_init+0x40>)
- 800af66: f8a3 20a8 strh.w r2, [r3, #168] ; 0xa8
- 800af6a: 4770 bx lr
- 800af6c: 20006e07 .word 0x20006e07
- 800af70: 2000013c .word 0x2000013c
- 800af74: 20000138 .word 0x20000138
- 800af78: 20000134 .word 0x20000134
- 800af7c: 20008220 .word 0x20008220
- 0800af80 <mem_free>:
- * @param rmem is the data portion of a struct mem as returned by a previous
- * call to mem_malloc()
- */
- void
- mem_free(void *rmem)
- {
- 800af80: b5f0 push {r4, r5, r6, r7, lr}
- struct mem *mem;
- LWIP_MEM_FREE_DECL_PROTECT();
- if (rmem == NULL) {
- 800af82: 2800 cmp r0, #0
- 800af84: d048 beq.n 800b018 <mem_free+0x98>
- LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("mem_free(p == NULL) was called.\n"));
- return;
- }
- LWIP_ASSERT("mem_free: sanity check alignment", (((mem_ptr_t)rmem) & (MEM_ALIGNMENT-1)) == 0);
- LWIP_ASSERT("mem_free: legal memory", (u8_t *)rmem >= (u8_t *)ram &&
- 800af86: 4b25 ldr r3, [pc, #148] ; (800b01c <mem_free+0x9c>)
- 800af88: 681b ldr r3, [r3, #0]
- (u8_t *)rmem < (u8_t *)ram_end);
- if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {
- 800af8a: 4298 cmp r0, r3
- 800af8c: d303 bcc.n 800af96 <mem_free+0x16>
- 800af8e: 4a24 ldr r2, [pc, #144] ; (800b020 <mem_free+0xa0>)
- 800af90: 6816 ldr r6, [r2, #0]
- 800af92: 42b0 cmp r0, r6
- 800af94: d306 bcc.n 800afa4 <mem_free+0x24>
- SYS_ARCH_DECL_PROTECT(lev);
- LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: illegal memory\n"));
- /* protect mem stats from concurrent access */
- SYS_ARCH_PROTECT(lev);
- MEM_STATS_INC(illegal);
- 800af96: 4b23 ldr r3, [pc, #140] ; (800b024 <mem_free+0xa4>)
- 800af98: f8b3 20b0 ldrh.w r2, [r3, #176] ; 0xb0
- 800af9c: 3201 adds r2, #1
- 800af9e: f8a3 20b0 strh.w r2, [r3, #176] ; 0xb0
- SYS_ARCH_UNPROTECT(lev);
- return;
- 800afa2: bdf0 pop {r4, r5, r6, r7, pc}
- /* Get the corresponding struct mem ... */
- mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
- /* ... which has to be in a used state ... */
- LWIP_ASSERT("mem_free: mem->used", mem->used);
- /* ... and is now unused. */
- mem->used = 0;
- 800afa4: 2100 movs r1, #0
- 800afa6: f800 1c04 strb.w r1, [r0, #-4]
- if (mem < lfree) {
- 800afaa: 491f ldr r1, [pc, #124] ; (800b028 <mem_free+0xa8>)
- 800afac: 680c ldr r4, [r1, #0]
- return;
- }
- /* protect the heap from concurrent access */
- LWIP_MEM_FREE_PROTECT();
- /* Get the corresponding struct mem ... */
- mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
- 800afae: f1a0 0208 sub.w r2, r0, #8
- /* ... which has to be in a used state ... */
- LWIP_ASSERT("mem_free: mem->used", mem->used);
- /* ... and is now unused. */
- mem->used = 0;
- if (mem < lfree) {
- 800afb2: 42a2 cmp r2, r4
- /* the newly freed struct is now the lowest */
- lfree = mem;
- }
- MEM_STATS_DEC_USED(used, mem->next - (mem_size_t)(((u8_t *)mem - ram)));
- 800afb4: 4c1b ldr r4, [pc, #108] ; (800b024 <mem_free+0xa4>)
- /* ... and is now unused. */
- mem->used = 0;
- if (mem < lfree) {
- /* the newly freed struct is now the lowest */
- lfree = mem;
- 800afb6: bf38 it cc
- 800afb8: 600a strcc r2, [r1, #0]
- }
- MEM_STATS_DEC_USED(used, mem->next - (mem_size_t)(((u8_t *)mem - ram)));
- 800afba: f8b4 70aa ldrh.w r7, [r4, #170] ; 0xaa
- 800afbe: f830 1c08 ldrh.w r1, [r0, #-8]
- 800afc2: 1ad5 subs r5, r2, r3
- 800afc4: 1a7f subs r7, r7, r1
- 800afc6: 197f adds r7, r7, r5
- 800afc8: f8a4 70aa strh.w r7, [r4, #170] ; 0xaa
- LWIP_ASSERT("plug_holes: mem->used == 0", mem->used == 0);
- /* plug hole forward */
- LWIP_ASSERT("plug_holes: mem->next <= MEM_SIZE_ALIGNED", mem->next <= MEM_SIZE_ALIGNED);
- nmem = (struct mem *)(void *)&ram[mem->next];
- 800afcc: 185c adds r4, r3, r1
- if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) {
- 800afce: 42a2 cmp r2, r4
- 800afd0: d00e beq.n 800aff0 <mem_free+0x70>
- 800afd2: 7927 ldrb r7, [r4, #4]
- 800afd4: b967 cbnz r7, 800aff0 <mem_free+0x70>
- 800afd6: 42b4 cmp r4, r6
- 800afd8: d00a beq.n 800aff0 <mem_free+0x70>
- /* if mem->next is unused and not end of ram, combine mem and mem->next */
- if (lfree == nmem) {
- 800afda: 4e13 ldr r6, [pc, #76] ; (800b028 <mem_free+0xa8>)
- 800afdc: 6837 ldr r7, [r6, #0]
- 800afde: 42a7 cmp r7, r4
- lfree = mem;
- }
- mem->next = nmem->next;
- 800afe0: 5a5c ldrh r4, [r3, r1]
- nmem = (struct mem *)(void *)&ram[mem->next];
- if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) {
- /* if mem->next is unused and not end of ram, combine mem and mem->next */
- if (lfree == nmem) {
- lfree = mem;
- 800afe2: bf08 it eq
- 800afe4: 6032 streq r2, [r6, #0]
- }
- mem->next = nmem->next;
- 800afe6: f820 4c08 strh.w r4, [r0, #-8]
- ((struct mem *)(void *)&ram[nmem->next])->prev = (mem_size_t)((u8_t *)mem - ram);
- 800afea: 5a59 ldrh r1, [r3, r1]
- 800afec: 1859 adds r1, r3, r1
- 800afee: 804d strh r5, [r1, #2]
- }
- /* plug hole backward */
- pmem = (struct mem *)(void *)&ram[mem->prev];
- 800aff0: f830 4c06 ldrh.w r4, [r0, #-6]
- 800aff4: 1919 adds r1, r3, r4
- if (pmem != mem && pmem->used == 0) {
- 800aff6: 4291 cmp r1, r2
- 800aff8: d00e beq.n 800b018 <mem_free+0x98>
- 800affa: 790d ldrb r5, [r1, #4]
- 800affc: b965 cbnz r5, 800b018 <mem_free+0x98>
- /* if mem->prev is unused, combine mem and mem->prev */
- if (lfree == mem) {
- 800affe: 4d0a ldr r5, [pc, #40] ; (800b028 <mem_free+0xa8>)
- 800b000: 682e ldr r6, [r5, #0]
- 800b002: 4296 cmp r6, r2
- lfree = pmem;
- }
- pmem->next = mem->next;
- 800b004: f830 2c08 ldrh.w r2, [r0, #-8]
- /* plug hole backward */
- pmem = (struct mem *)(void *)&ram[mem->prev];
- if (pmem != mem && pmem->used == 0) {
- /* if mem->prev is unused, combine mem and mem->prev */
- if (lfree == mem) {
- lfree = pmem;
- 800b008: bf08 it eq
- 800b00a: 6029 streq r1, [r5, #0]
- }
- pmem->next = mem->next;
- 800b00c: 531a strh r2, [r3, r4]
- ((struct mem *)(void *)&ram[mem->next])->prev = (mem_size_t)((u8_t *)pmem - ram);
- 800b00e: f830 2c08 ldrh.w r2, [r0, #-8]
- 800b012: 189a adds r2, r3, r2
- 800b014: 1acb subs r3, r1, r3
- 800b016: 8053 strh r3, [r2, #2]
- 800b018: bdf0 pop {r4, r5, r6, r7, pc}
- 800b01a: bf00 nop
- 800b01c: 2000013c .word 0x2000013c
- 800b020: 20000138 .word 0x20000138
- 800b024: 20008220 .word 0x20008220
- 800b028: 20000134 .word 0x20000134
- 0800b02c <mem_trim>:
- /* use the FREE_PROTECT here: it protects with sem OR SYS_ARCH_PROTECT */
- LWIP_MEM_FREE_DECL_PROTECT();
- /* Expand the size of the allocated memory region so that we can
- adjust for alignment. */
- newsize = LWIP_MEM_ALIGN_SIZE(newsize);
- 800b02c: 3103 adds r1, #3
- 800b02e: f64f 72fc movw r2, #65532 ; 0xfffc
- 800b032: 400a ands r2, r1
- if(newsize < MIN_SIZE_ALIGNED) {
- 800b034: 2a0b cmp r2, #11
- * or NULL if newsize is > old size, in which case rmem is NOT touched
- * or freed!
- */
- void *
- mem_trim(void *rmem, mem_size_t newsize)
- {
- 800b036: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- /* Expand the size of the allocated memory region so that we can
- adjust for alignment. */
- newsize = LWIP_MEM_ALIGN_SIZE(newsize);
- if(newsize < MIN_SIZE_ALIGNED) {
- 800b03a: d903 bls.n 800b044 <mem_trim+0x18>
- /* every data block must be at least MIN_SIZE_ALIGNED long */
- newsize = MIN_SIZE_ALIGNED;
- }
- if (newsize > MEM_SIZE_ALIGNED) {
- 800b03c: f5b2 5fa0 cmp.w r2, #5120 ; 0x1400
- 800b040: d901 bls.n 800b046 <mem_trim+0x1a>
- 800b042: e057 b.n 800b0f4 <mem_trim+0xc8>
- adjust for alignment. */
- newsize = LWIP_MEM_ALIGN_SIZE(newsize);
- if(newsize < MIN_SIZE_ALIGNED) {
- /* every data block must be at least MIN_SIZE_ALIGNED long */
- newsize = MIN_SIZE_ALIGNED;
- 800b044: 220c movs r2, #12
- }
- LWIP_ASSERT("mem_trim: legal memory", (u8_t *)rmem >= (u8_t *)ram &&
- (u8_t *)rmem < (u8_t *)ram_end);
- if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {
- 800b046: 4b2d ldr r3, [pc, #180] ; (800b0fc <mem_trim+0xd0>)
- 800b048: 681b ldr r3, [r3, #0]
- 800b04a: 4298 cmp r0, r3
- 800b04c: d303 bcc.n 800b056 <mem_trim+0x2a>
- 800b04e: 492c ldr r1, [pc, #176] ; (800b100 <mem_trim+0xd4>)
- 800b050: 6809 ldr r1, [r1, #0]
- 800b052: 4288 cmp r0, r1
- 800b054: d307 bcc.n 800b066 <mem_trim+0x3a>
- SYS_ARCH_DECL_PROTECT(lev);
- LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_trim: illegal memory\n"));
- /* protect mem stats from concurrent access */
- SYS_ARCH_PROTECT(lev);
- MEM_STATS_INC(illegal);
- 800b056: 4b2b ldr r3, [pc, #172] ; (800b104 <mem_trim+0xd8>)
- 800b058: f8b3 20b0 ldrh.w r2, [r3, #176] ; 0xb0
- 800b05c: 3201 adds r2, #1
- 800b05e: f8a3 20b0 strh.w r2, [r3, #176] ; 0xb0
- SYS_ARCH_UNPROTECT(lev);
- return rmem;
- 800b062: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- }
- /* Get the corresponding struct mem ... */
- mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
- 800b066: f1a0 0408 sub.w r4, r0, #8
- /* ... and its offset pointer */
- ptr = (mem_size_t)((u8_t *)mem - ram);
- size = mem->next - ptr - SIZEOF_STRUCT_MEM;
- 800b06a: f830 cc08 ldrh.w ip, [r0, #-8]
- return rmem;
- }
- /* Get the corresponding struct mem ... */
- mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
- /* ... and its offset pointer */
- ptr = (mem_size_t)((u8_t *)mem - ram);
- 800b06e: 1ae4 subs r4, r4, r3
- 800b070: b2a4 uxth r4, r4
- size = mem->next - ptr - SIZEOF_STRUCT_MEM;
- 800b072: f1ac 0508 sub.w r5, ip, #8
- 800b076: 1b2d subs r5, r5, r4
- 800b078: b2ad uxth r5, r5
- LWIP_ASSERT("mem_trim can only shrink memory", newsize <= size);
- if (newsize > size) {
- 800b07a: 42aa cmp r2, r5
- 800b07c: d83a bhi.n 800b0f4 <mem_trim+0xc8>
- /* not supported */
- return NULL;
- }
- if (newsize == size) {
- 800b07e: d03a beq.n 800b0f6 <mem_trim+0xca>
- }
- /* protect the heap from concurrent access */
- LWIP_MEM_FREE_PROTECT();
- mem2 = (struct mem *)(void *)&ram[mem->next];
- 800b080: eb03 080c add.w r8, r3, ip
- if(mem2->used == 0) {
- 800b084: f898 1004 ldrb.w r1, [r8, #4]
- 800b088: b969 cbnz r1, 800b0a6 <mem_trim+0x7a>
- mem_size_t next;
- /* remember the old next pointer */
- next = mem2->next;
- /* create new struct mem which is moved directly after the shrinked mem */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
- if (lfree == mem2) {
- 800b08a: 4f1f ldr r7, [pc, #124] ; (800b108 <mem_trim+0xdc>)
- mem2 = (struct mem *)(void *)&ram[mem->next];
- if(mem2->used == 0) {
- /* The next struct is unused, we can simply move it at little */
- mem_size_t next;
- /* remember the old next pointer */
- next = mem2->next;
- 800b08c: f833 c00c ldrh.w ip, [r3, ip]
- /* create new struct mem which is moved directly after the shrinked mem */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
- if (lfree == mem2) {
- 800b090: 683e ldr r6, [r7, #0]
- /* The next struct is unused, we can simply move it at little */
- mem_size_t next;
- /* remember the old next pointer */
- next = mem2->next;
- /* create new struct mem which is moved directly after the shrinked mem */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
- 800b092: f104 0108 add.w r1, r4, #8
- 800b096: 1851 adds r1, r2, r1
- 800b098: b289 uxth r1, r1
- if (lfree == mem2) {
- 800b09a: 4546 cmp r6, r8
- 800b09c: eb03 0601 add.w r6, r3, r1
- 800b0a0: d112 bne.n 800b0c8 <mem_trim+0x9c>
- lfree = (struct mem *)(void *)&ram[ptr2];
- 800b0a2: 603e str r6, [r7, #0]
- 800b0a4: e010 b.n 800b0c8 <mem_trim+0x9c>
- if (mem2->next != MEM_SIZE_ALIGNED) {
- ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
- }
- MEM_STATS_DEC_USED(used, (size - newsize));
- /* no need to plug holes, we've already done that */
- } else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) {
- 800b0a6: f102 0114 add.w r1, r2, #20
- 800b0aa: 42a9 cmp r1, r5
- 800b0ac: d823 bhi.n 800b0f6 <mem_trim+0xca>
- * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
- * region that couldn't hold data, but when mem->next gets freed,
- * the 2 regions would be combined, resulting in more free memory */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
- mem2 = (struct mem *)(void *)&ram[ptr2];
- if (mem2 < lfree) {
- 800b0ae: f8df 8058 ldr.w r8, [pc, #88] ; 800b108 <mem_trim+0xdc>
- * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem
- * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED').
- * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
- * region that couldn't hold data, but when mem->next gets freed,
- * the 2 regions would be combined, resulting in more free memory */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
- 800b0b2: f104 0108 add.w r1, r4, #8
- 800b0b6: 1851 adds r1, r2, r1
- mem2 = (struct mem *)(void *)&ram[ptr2];
- if (mem2 < lfree) {
- 800b0b8: f8d8 7000 ldr.w r7, [r8]
- * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem
- * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED').
- * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
- * region that couldn't hold data, but when mem->next gets freed,
- * the 2 regions would be combined, resulting in more free memory */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
- 800b0bc: b289 uxth r1, r1
- mem2 = (struct mem *)(void *)&ram[ptr2];
- 800b0be: 185e adds r6, r3, r1
- if (mem2 < lfree) {
- 800b0c0: 42be cmp r6, r7
- lfree = mem2;
- 800b0c2: bf38 it cc
- 800b0c4: f8c8 6000 strcc.w r6, [r8]
- }
- mem2->used = 0;
- 800b0c8: 2700 movs r7, #0
- 800b0ca: 7137 strb r7, [r6, #4]
- mem2->next = mem->next;
- 800b0cc: f823 c001 strh.w ip, [r3, r1]
- mem2->prev = ptr;
- 800b0d0: 8074 strh r4, [r6, #2]
- mem->next = ptr2;
- 800b0d2: f820 1c08 strh.w r1, [r0, #-8]
- if (mem2->next != MEM_SIZE_ALIGNED) {
- 800b0d6: 5a5c ldrh r4, [r3, r1]
- 800b0d8: f5b4 5fa0 cmp.w r4, #5120 ; 0x1400
- ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
- 800b0dc: bf1c itt ne
- 800b0de: 191b addne r3, r3, r4
- 800b0e0: 8059 strhne r1, [r3, #2]
- }
- MEM_STATS_DEC_USED(used, (size - newsize));
- 800b0e2: 4b08 ldr r3, [pc, #32] ; (800b104 <mem_trim+0xd8>)
- 800b0e4: f8b3 10aa ldrh.w r1, [r3, #170] ; 0xaa
- 800b0e8: 1b4d subs r5, r1, r5
- 800b0ea: 1952 adds r2, r2, r5
- 800b0ec: f8a3 20aa strh.w r2, [r3, #170] ; 0xaa
- 800b0f0: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- /* every data block must be at least MIN_SIZE_ALIGNED long */
- newsize = MIN_SIZE_ALIGNED;
- }
- if (newsize > MEM_SIZE_ALIGNED) {
- return NULL;
- 800b0f4: 2000 movs r0, #0
- #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
- mem_free_count = 1;
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- LWIP_MEM_FREE_UNPROTECT();
- return rmem;
- }
- 800b0f6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800b0fa: bf00 nop
- 800b0fc: 2000013c .word 0x2000013c
- 800b100: 20000138 .word 0x20000138
- 800b104: 20008220 .word 0x20008220
- 800b108: 20000134 .word 0x20000134
- 0800b10c <mem_malloc>:
- *
- * Note that the returned value will always be aligned (as defined by MEM_ALIGNMENT).
- */
- void *
- mem_malloc(mem_size_t size)
- {
- 800b10c: b5f0 push {r4, r5, r6, r7, lr}
- #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
- u8_t local_mem_free_count = 0;
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- LWIP_MEM_ALLOC_DECL_PROTECT();
- if (size == 0) {
- 800b10e: 2800 cmp r0, #0
- 800b110: d073 beq.n 800b1fa <mem_malloc+0xee>
- return NULL;
- }
- /* Expand the size of the allocated memory region so that we can
- adjust for alignment. */
- size = LWIP_MEM_ALIGN_SIZE(size);
- 800b112: 3003 adds r0, #3
- 800b114: f64f 73fc movw r3, #65532 ; 0xfffc
- 800b118: 4003 ands r3, r0
- if(size < MIN_SIZE_ALIGNED) {
- 800b11a: 2b0b cmp r3, #11
- 800b11c: d903 bls.n 800b126 <mem_malloc+0x1a>
- /* every data block must be at least MIN_SIZE_ALIGNED long */
- size = MIN_SIZE_ALIGNED;
- }
- if (size > MEM_SIZE_ALIGNED) {
- 800b11e: f5b3 5fa0 cmp.w r3, #5120 ; 0x1400
- 800b122: d901 bls.n 800b128 <mem_malloc+0x1c>
- 800b124: e068 b.n 800b1f8 <mem_malloc+0xec>
- adjust for alignment. */
- size = LWIP_MEM_ALIGN_SIZE(size);
- if(size < MIN_SIZE_ALIGNED) {
- /* every data block must be at least MIN_SIZE_ALIGNED long */
- size = MIN_SIZE_ALIGNED;
- 800b126: 230c movs r3, #12
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- /* Scan through the heap searching for a free block that is big enough,
- * beginning with the lowest free block.
- */
- for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size;
- 800b128: 4a34 ldr r2, [pc, #208] ; (800b1fc <mem_malloc+0xf0>)
- 800b12a: 6816 ldr r6, [r2, #0]
- 800b12c: 4a34 ldr r2, [pc, #208] ; (800b200 <mem_malloc+0xf4>)
- 800b12e: 6812 ldr r2, [r2, #0]
- 800b130: 1ab1 subs r1, r6, r2
- 800b132: b289 uxth r1, r1
- 800b134: f5c3 57a0 rsb r7, r3, #5120 ; 0x1400
- 800b138: e056 b.n 800b1e8 <mem_malloc+0xdc>
- ptr = ((struct mem *)(void *)&ram[ptr])->next) {
- mem = (struct mem *)(void *)&ram[ptr];
- 800b13a: 1850 adds r0, r2, r1
- local_mem_free_count = 1;
- break;
- }
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- if ((!mem->used) &&
- 800b13c: f890 c004 ldrb.w ip, [r0, #4]
- 800b140: f1bc 0f00 cmp.w ip, #0
- 800b144: d14f bne.n 800b1e6 <mem_malloc+0xda>
- (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) {
- 800b146: 5a55 ldrh r5, [r2, r1]
- 800b148: f1a5 0408 sub.w r4, r5, #8
- 800b14c: 1a64 subs r4, r4, r1
- local_mem_free_count = 1;
- break;
- }
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- if ((!mem->used) &&
- 800b14e: 429c cmp r4, r3
- 800b150: d349 bcc.n 800b1e6 <mem_malloc+0xda>
- (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) {
- /* mem is not used and at least perfect fit is possible:
- * mem->next - (ptr + SIZEOF_STRUCT_MEM) gives us the 'user data size' of mem */
- if (mem->next - (ptr + SIZEOF_STRUCT_MEM) >= (size + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED)) {
- 800b152: f103 0714 add.w r7, r3, #20
- 800b156: 42bc cmp r4, r7
- 800b158: d320 bcc.n 800b19c <mem_malloc+0x90>
- * struct mem would fit in but no data between mem2 and mem2->next
- * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty
- * region that couldn't hold data, but when mem->next gets freed,
- * the 2 regions would be combined, resulting in more free memory
- */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + size;
- 800b15a: f103 0408 add.w r4, r3, #8
- 800b15e: 190c adds r4, r1, r4
- 800b160: b2a4 uxth r4, r4
- /* create mem2 struct */
- mem2 = (struct mem *)(void *)&ram[ptr2];
- 800b162: 1917 adds r7, r2, r4
- mem2->used = 0;
- mem2->next = mem->next;
- 800b164: 5315 strh r5, [r2, r4]
- mem2->prev = ptr;
- 800b166: 8079 strh r1, [r7, #2]
- /* and insert it between mem and mem->next */
- mem->next = ptr2;
- 800b168: 8004 strh r4, [r0, #0]
- mem->used = 1;
- 800b16a: 2101 movs r1, #1
- * the 2 regions would be combined, resulting in more free memory
- */
- ptr2 = ptr + SIZEOF_STRUCT_MEM + size;
- /* create mem2 struct */
- mem2 = (struct mem *)(void *)&ram[ptr2];
- mem2->used = 0;
- 800b16c: f887 c004 strb.w ip, [r7, #4]
- mem2->next = mem->next;
- mem2->prev = ptr;
- /* and insert it between mem and mem->next */
- mem->next = ptr2;
- mem->used = 1;
- 800b170: 7101 strb r1, [r0, #4]
- if (mem2->next != MEM_SIZE_ALIGNED) {
- 800b172: 5b11 ldrh r1, [r2, r4]
- 800b174: f5b1 5fa0 cmp.w r1, #5120 ; 0x1400
- ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
- 800b178: bf1c itt ne
- 800b17a: 1852 addne r2, r2, r1
- 800b17c: 8054 strhne r4, [r2, #2]
- }
- MEM_STATS_INC_USED(used, (size + SIZEOF_STRUCT_MEM));
- 800b17e: 4a21 ldr r2, [pc, #132] ; (800b204 <mem_malloc+0xf8>)
- 800b180: f8b2 10aa ldrh.w r1, [r2, #170] ; 0xaa
- 800b184: 3108 adds r1, #8
- 800b186: 185b adds r3, r3, r1
- 800b188: f8b2 10ac ldrh.w r1, [r2, #172] ; 0xac
- 800b18c: b29b uxth r3, r3
- 800b18e: 4299 cmp r1, r3
- 800b190: f8a2 30aa strh.w r3, [r2, #170] ; 0xaa
- 800b194: d213 bcs.n 800b1be <mem_malloc+0xb2>
- 800b196: f8a2 30ac strh.w r3, [r2, #172] ; 0xac
- 800b19a: e010 b.n 800b1be <mem_malloc+0xb2>
- * take care of this).
- * -> near fit or excact fit: do not split, no mem2 creation
- * also can't move mem->next directly behind mem, since mem->next
- * will always be used at this point!
- */
- mem->used = 1;
- 800b19c: 2301 movs r3, #1
- 800b19e: 7103 strb r3, [r0, #4]
- MEM_STATS_INC_USED(used, mem->next - (mem_size_t)((u8_t *)mem - ram));
- 800b1a0: 4b18 ldr r3, [pc, #96] ; (800b204 <mem_malloc+0xf8>)
- 800b1a2: f8b3 10aa ldrh.w r1, [r3, #170] ; 0xaa
- 800b1a6: 1a82 subs r2, r0, r2
- 800b1a8: 186d adds r5, r5, r1
- 800b1aa: 1aaa subs r2, r5, r2
- 800b1ac: f8b3 10ac ldrh.w r1, [r3, #172] ; 0xac
- 800b1b0: b292 uxth r2, r2
- 800b1b2: 4291 cmp r1, r2
- 800b1b4: f8a3 20aa strh.w r2, [r3, #170] ; 0xaa
- 800b1b8: bf38 it cc
- 800b1ba: f8a3 20ac strhcc.w r2, [r3, #172] ; 0xac
- }
- #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
- mem_malloc_adjust_lfree:
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- if (mem == lfree) {
- 800b1be: 42b0 cmp r0, r6
- 800b1c0: d10f bne.n 800b1e2 <mem_malloc+0xd6>
- struct mem *cur = lfree;
- /* Find next free block after mem and update lowest free pointer */
- while (cur->used && cur != ram_end) {
- 800b1c2: 4b11 ldr r3, [pc, #68] ; (800b208 <mem_malloc+0xfc>)
- 800b1c4: 681a ldr r2, [r3, #0]
- /* If mem_free or mem_trim have run, we have to restart since they
- could have altered our current struct mem or lfree. */
- goto mem_malloc_adjust_lfree;
- }
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- cur = (struct mem *)(void *)&ram[cur->next];
- 800b1c6: 4b0e ldr r3, [pc, #56] ; (800b200 <mem_malloc+0xf4>)
- 800b1c8: 6819 ldr r1, [r3, #0]
- 800b1ca: 4603 mov r3, r0
- 800b1cc: e001 b.n 800b1d2 <mem_malloc+0xc6>
- 800b1ce: 881b ldrh r3, [r3, #0]
- 800b1d0: 18cb adds r3, r1, r3
- mem_malloc_adjust_lfree:
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- if (mem == lfree) {
- struct mem *cur = lfree;
- /* Find next free block after mem and update lowest free pointer */
- while (cur->used && cur != ram_end) {
- 800b1d2: 791c ldrb r4, [r3, #4]
- 800b1d4: b914 cbnz r4, 800b1dc <mem_malloc+0xd0>
- goto mem_malloc_adjust_lfree;
- }
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- cur = (struct mem *)(void *)&ram[cur->next];
- }
- lfree = cur;
- 800b1d6: 4a09 ldr r2, [pc, #36] ; (800b1fc <mem_malloc+0xf0>)
- 800b1d8: 6013 str r3, [r2, #0]
- 800b1da: e002 b.n 800b1e2 <mem_malloc+0xd6>
- mem_malloc_adjust_lfree:
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- if (mem == lfree) {
- struct mem *cur = lfree;
- /* Find next free block after mem and update lowest free pointer */
- while (cur->used && cur != ram_end) {
- 800b1dc: 4293 cmp r3, r2
- 800b1de: d1f6 bne.n 800b1ce <mem_malloc+0xc2>
- 800b1e0: e7f9 b.n 800b1d6 <mem_malloc+0xca>
- LWIP_ASSERT("mem_malloc: allocated memory properly aligned.",
- ((mem_ptr_t)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0);
- LWIP_ASSERT("mem_malloc: sanity check alignment",
- (((mem_ptr_t)mem) & (MEM_ALIGNMENT-1)) == 0);
- return (u8_t *)mem + SIZEOF_STRUCT_MEM;
- 800b1e2: 3008 adds r0, #8
- 800b1e4: bdf0 pop {r4, r5, r6, r7, pc}
- /* Scan through the heap searching for a free block that is big enough,
- * beginning with the lowest free block.
- */
- for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size;
- ptr = ((struct mem *)(void *)&ram[ptr])->next) {
- 800b1e6: 8801 ldrh r1, [r0, #0]
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- /* Scan through the heap searching for a free block that is big enough,
- * beginning with the lowest free block.
- */
- for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size;
- 800b1e8: 42b9 cmp r1, r7
- 800b1ea: dba6 blt.n 800b13a <mem_malloc+0x2e>
- #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT
- /* if we got interrupted by a mem_free, try again */
- } while(local_mem_free_count != 0);
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size));
- MEM_STATS_INC(err);
- 800b1ec: 4b05 ldr r3, [pc, #20] ; (800b204 <mem_malloc+0xf8>)
- 800b1ee: f8b3 20ae ldrh.w r2, [r3, #174] ; 0xae
- 800b1f2: 3201 adds r2, #1
- 800b1f4: f8a3 20ae strh.w r2, [r3, #174] ; 0xae
- u8_t local_mem_free_count = 0;
- #endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */
- LWIP_MEM_ALLOC_DECL_PROTECT();
- if (size == 0) {
- return NULL;
- 800b1f8: 2000 movs r0, #0
- LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size));
- MEM_STATS_INC(err);
- LWIP_MEM_ALLOC_UNPROTECT();
- sys_mutex_unlock(&mem_mutex);
- return NULL;
- }
- 800b1fa: bdf0 pop {r4, r5, r6, r7, pc}
- 800b1fc: 20000134 .word 0x20000134
- 800b200: 2000013c .word 0x2000013c
- 800b204: 20008220 .word 0x20008220
- 800b208: 20000138 .word 0x20000138
- 0800b20c <memp_init>:
- *
- * Carves out memp_memory into linked lists for each pool-type.
- */
- void
- memp_init(void)
- {
- 800b20c: b5f0 push {r4, r5, r6, r7, lr}
- 800b20e: 2200 movs r2, #0
- 800b210: 4b16 ldr r3, [pc, #88] ; (800b26c <memp_init+0x60>)
- for (i = 0; i < MEMP_MAX; ++i) {
- MEMP_STATS_AVAIL(used, i, 0);
- MEMP_STATS_AVAIL(max, i, 0);
- MEMP_STATS_AVAIL(err, i, 0);
- MEMP_STATS_AVAIL(avail, i, memp_num[i]);
- 800b212: 4c17 ldr r4, [pc, #92] ; (800b270 <memp_init+0x64>)
- {
- struct memp *memp;
- u16_t i, j;
- for (i = 0; i < MEMP_MAX; ++i) {
- MEMP_STATS_AVAIL(used, i, 0);
- 800b214: 4611 mov r1, r2
- MEMP_STATS_AVAIL(max, i, 0);
- MEMP_STATS_AVAIL(err, i, 0);
- MEMP_STATS_AVAIL(avail, i, memp_num[i]);
- 800b216: 5b10 ldrh r0, [r2, r4]
- {
- struct memp *memp;
- u16_t i, j;
- for (i = 0; i < MEMP_MAX; ++i) {
- MEMP_STATS_AVAIL(used, i, 0);
- 800b218: f8a3 10b4 strh.w r1, [r3, #180] ; 0xb4
- 800b21c: 3202 adds r2, #2
- MEMP_STATS_AVAIL(max, i, 0);
- 800b21e: f8a3 10b6 strh.w r1, [r3, #182] ; 0xb6
- MEMP_STATS_AVAIL(err, i, 0);
- 800b222: f8a3 10b8 strh.w r1, [r3, #184] ; 0xb8
- MEMP_STATS_AVAIL(avail, i, memp_num[i]);
- 800b226: f8a3 00b2 strh.w r0, [r3, #178] ; 0xb2
- 800b22a: 330a adds r3, #10
- memp_init(void)
- {
- struct memp *memp;
- u16_t i, j;
- for (i = 0; i < MEMP_MAX; ++i) {
- 800b22c: 2a14 cmp r2, #20
- 800b22e: d1f2 bne.n 800b216 <memp_init+0xa>
- MEMP_STATS_AVAIL(err, i, 0);
- MEMP_STATS_AVAIL(avail, i, memp_num[i]);
- }
- #if !MEMP_SEPARATE_POOLS
- memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
- 800b230: 4a10 ldr r2, [pc, #64] ; (800b274 <memp_init+0x68>)
- 800b232: 4911 ldr r1, [pc, #68] ; (800b278 <memp_init+0x6c>)
- memp_tab[i] = NULL;
- #if MEMP_SEPARATE_POOLS
- memp = (struct memp*)memp_bases[i];
- #endif /* MEMP_SEPARATE_POOLS */
- /* create a linked list of memp elements */
- for (j = 0; j < memp_num[i]; ++j) {
- 800b234: 4e0e ldr r6, [pc, #56] ; (800b270 <memp_init+0x64>)
- memp->next = memp_tab[i];
- memp_tab[i] = memp;
- memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
- 800b236: 4f11 ldr r7, [pc, #68] ; (800b27c <memp_init+0x70>)
- MEMP_STATS_AVAIL(err, i, 0);
- MEMP_STATS_AVAIL(avail, i, memp_num[i]);
- }
- #if !MEMP_SEPARATE_POOLS
- memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
- 800b238: 2300 movs r3, #0
- 800b23a: f022 0203 bic.w r2, r2, #3
- #endif /* !MEMP_SEPARATE_POOLS */
- /* for every pool: */
- for (i = 0; i < MEMP_MAX; ++i) {
- memp_tab[i] = NULL;
- 800b23e: 461d mov r5, r3
- 800b240: f841 5b04 str.w r5, [r1], #4
- #if MEMP_SEPARATE_POOLS
- memp = (struct memp*)memp_bases[i];
- #endif /* MEMP_SEPARATE_POOLS */
- /* create a linked list of memp elements */
- for (j = 0; j < memp_num[i]; ++j) {
- 800b244: f833 c006 ldrh.w ip, [r3, r6]
- 800b248: 2000 movs r0, #0
- 800b24a: e008 b.n 800b25e <memp_init+0x52>
- memp->next = memp_tab[i];
- 800b24c: f851 4c04 ldr.w r4, [r1, #-4]
- 800b250: 6014 str r4, [r2, #0]
- memp_tab[i] = memp;
- memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
- 800b252: 5bdc ldrh r4, [r3, r7]
- memp = (struct memp*)memp_bases[i];
- #endif /* MEMP_SEPARATE_POOLS */
- /* create a linked list of memp elements */
- for (j = 0; j < memp_num[i]; ++j) {
- memp->next = memp_tab[i];
- memp_tab[i] = memp;
- 800b254: f841 2c04 str.w r2, [r1, #-4]
- memp_tab[i] = NULL;
- #if MEMP_SEPARATE_POOLS
- memp = (struct memp*)memp_bases[i];
- #endif /* MEMP_SEPARATE_POOLS */
- /* create a linked list of memp elements */
- for (j = 0; j < memp_num[i]; ++j) {
- 800b258: 3001 adds r0, #1
- memp->next = memp_tab[i];
- memp_tab[i] = memp;
- memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
- 800b25a: 1912 adds r2, r2, r4
- memp_tab[i] = NULL;
- #if MEMP_SEPARATE_POOLS
- memp = (struct memp*)memp_bases[i];
- #endif /* MEMP_SEPARATE_POOLS */
- /* create a linked list of memp elements */
- for (j = 0; j < memp_num[i]; ++j) {
- 800b25c: b280 uxth r0, r0
- 800b25e: 4560 cmp r0, ip
- 800b260: d1f4 bne.n 800b24c <memp_init+0x40>
- 800b262: 3302 adds r3, #2
- #if !MEMP_SEPARATE_POOLS
- memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
- #endif /* !MEMP_SEPARATE_POOLS */
- /* for every pool: */
- for (i = 0; i < MEMP_MAX; ++i) {
- 800b264: 2b14 cmp r3, #20
- 800b266: d1eb bne.n 800b240 <memp_init+0x34>
- #if MEMP_OVERFLOW_CHECK
- memp_overflow_init();
- /* check everything a first time to see if it worked */
- memp_overflow_check_all();
- #endif /* MEMP_OVERFLOW_CHECK */
- }
- 800b268: bdf0 pop {r4, r5, r6, r7, pc}
- 800b26a: bf00 nop
- 800b26c: 20008220 .word 0x20008220
- 800b270: 08011830 .word 0x08011830
- 800b274: 20000143 .word 0x20000143
- 800b278: 20006b4c .word 0x20006b4c
- 800b27c: 08011844 .word 0x08011844
- 0800b280 <memp_malloc>:
- #endif
- {
- struct memp *memp;
- SYS_ARCH_DECL_PROTECT(old_level);
-
- LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
- 800b280: 2809 cmp r0, #9
- #if !MEMP_OVERFLOW_CHECK
- memp_malloc(memp_t type)
- #else
- memp_malloc_fn(memp_t type, const char* file, const int line)
- #endif
- {
- 800b282: b530 push {r4, r5, lr}
- 800b284: 4603 mov r3, r0
- struct memp *memp;
- SYS_ARCH_DECL_PROTECT(old_level);
-
- LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
- 800b286: d81f bhi.n 800b2c8 <memp_malloc+0x48>
- SYS_ARCH_PROTECT(old_level);
- #if MEMP_OVERFLOW_CHECK >= 2
- memp_overflow_check_all();
- #endif /* MEMP_OVERFLOW_CHECK >= 2 */
- memp = memp_tab[type];
- 800b288: 4c10 ldr r4, [pc, #64] ; (800b2cc <memp_malloc+0x4c>)
- 800b28a: 4a11 ldr r2, [pc, #68] ; (800b2d0 <memp_malloc+0x50>)
- 800b28c: f854 0020 ldr.w r0, [r4, r0, lsl #2]
- 800b290: 210a movs r1, #10
-
- if (memp != NULL) {
- 800b292: b188 cbz r0, 800b2b8 <memp_malloc+0x38>
- memp_tab[type] = memp->next;
- 800b294: 6805 ldr r5, [r0, #0]
- 800b296: f844 5023 str.w r5, [r4, r3, lsl #2]
- #if MEMP_OVERFLOW_CHECK
- memp->next = NULL;
- memp->file = file;
- memp->line = line;
- #endif /* MEMP_OVERFLOW_CHECK */
- MEMP_STATS_INC_USED(used, type);
- 800b29a: fb01 2303 mla r3, r1, r3, r2
- 800b29e: f8b3 20b4 ldrh.w r2, [r3, #180] ; 0xb4
- 800b2a2: f8b3 10b6 ldrh.w r1, [r3, #182] ; 0xb6
- 800b2a6: 3201 adds r2, #1
- 800b2a8: b292 uxth r2, r2
- 800b2aa: 4291 cmp r1, r2
- 800b2ac: f8a3 20b4 strh.w r2, [r3, #180] ; 0xb4
- 800b2b0: d20b bcs.n 800b2ca <memp_malloc+0x4a>
- 800b2b2: f8a3 20b6 strh.w r2, [r3, #182] ; 0xb6
- 800b2b6: bd30 pop {r4, r5, pc}
- LWIP_ASSERT("memp_malloc: memp properly aligned",
- ((mem_ptr_t)memp % MEM_ALIGNMENT) == 0);
- memp = (struct memp*)(void *)((u8_t*)memp + MEMP_SIZE);
- } else {
- LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", memp_desc[type]));
- MEMP_STATS_INC(err, type);
- 800b2b8: fb01 2303 mla r3, r1, r3, r2
- 800b2bc: f8b3 20b8 ldrh.w r2, [r3, #184] ; 0xb8
- 800b2c0: 3201 adds r2, #1
- 800b2c2: f8a3 20b8 strh.w r2, [r3, #184] ; 0xb8
- 800b2c6: bd30 pop {r4, r5, pc}
- #endif
- {
- struct memp *memp;
- SYS_ARCH_DECL_PROTECT(old_level);
-
- LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
- 800b2c8: 2000 movs r0, #0
- }
- SYS_ARCH_UNPROTECT(old_level);
- return memp;
- }
- 800b2ca: bd30 pop {r4, r5, pc}
- 800b2cc: 20006b4c .word 0x20006b4c
- 800b2d0: 20008220 .word 0x20008220
- 0800b2d4 <memp_free>:
- memp_free(memp_t type, void *mem)
- {
- struct memp *memp;
- SYS_ARCH_DECL_PROTECT(old_level);
- if (mem == NULL) {
- 800b2d4: b171 cbz r1, 800b2f4 <memp_free+0x20>
- memp_overflow_check_element_overflow(memp, type);
- memp_overflow_check_element_underflow(memp, type);
- #endif /* MEMP_OVERFLOW_CHECK >= 2 */
- #endif /* MEMP_OVERFLOW_CHECK */
- MEMP_STATS_DEC(used, type);
- 800b2d6: 4b08 ldr r3, [pc, #32] ; (800b2f8 <memp_free+0x24>)
- 800b2d8: 220a movs r2, #10
- 800b2da: fb02 3300 mla r3, r2, r0, r3
- 800b2de: f8b3 20b4 ldrh.w r2, [r3, #180] ; 0xb4
- 800b2e2: 3a01 subs r2, #1
- 800b2e4: f8a3 20b4 strh.w r2, [r3, #180] ; 0xb4
-
- memp->next = memp_tab[type];
- 800b2e8: 4b04 ldr r3, [pc, #16] ; (800b2fc <memp_free+0x28>)
- 800b2ea: f853 2020 ldr.w r2, [r3, r0, lsl #2]
- 800b2ee: 600a str r2, [r1, #0]
- memp_tab[type] = memp;
- 800b2f0: f843 1020 str.w r1, [r3, r0, lsl #2]
- 800b2f4: 4770 bx lr
- 800b2f6: bf00 nop
- 800b2f8: 20008220 .word 0x20008220
- 800b2fc: 20006b4c .word 0x20006b4c
- 0800b300 <netif_init>:
- }
- #endif /* LWIP_HAVE_LOOPIF */
- void
- netif_init(void)
- {
- 800b300: 4770 bx lr
- 800b302: 0000 movs r0, r0
- 0800b304 <netif_set_ipaddr>:
- * @note call netif_set_addr() if you also want to change netmask and
- * default gateway
- */
- void
- netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
- {
- 800b304: b570 push {r4, r5, r6, lr}
- 800b306: 4605 mov r5, r0
- #if LWIP_TCP
- struct tcp_pcb *pcb;
- struct tcp_pcb_listen *lpcb;
- /* address is actually being changed? */
- if (ipaddr && (ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
- 800b308: 460c mov r4, r1
- 800b30a: b1f1 cbz r1, 800b34a <netif_set_ipaddr+0x46>
- 800b30c: 680a ldr r2, [r1, #0]
- 800b30e: 6843 ldr r3, [r0, #4]
- 800b310: 429a cmp r2, r3
- 800b312: d01c beq.n 800b34e <netif_set_ipaddr+0x4a>
- /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
- LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n"));
- pcb = tcp_active_pcbs;
- 800b314: 4b0f ldr r3, [pc, #60] ; (800b354 <netif_set_ipaddr+0x50>)
- 800b316: 6818 ldr r0, [r3, #0]
- while (pcb != NULL) {
- 800b318: e007 b.n 800b32a <netif_set_ipaddr+0x26>
- /* PCB bound to current local interface address? */
- if (ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))
- 800b31a: 6801 ldr r1, [r0, #0]
- 800b31c: 686a ldr r2, [r5, #4]
- 800b31e: 68c6 ldr r6, [r0, #12]
- 800b320: 4291 cmp r1, r2
- 800b322: d101 bne.n 800b328 <netif_set_ipaddr+0x24>
- #endif /* LWIP_AUTOIP */
- ) {
- /* this connection must be aborted */
- struct tcp_pcb *next = pcb->next;
- LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb));
- tcp_abort(pcb);
- 800b324: f000 fdae bl 800be84 <tcp_abort>
- pcb = next;
- } else {
- pcb = pcb->next;
- 800b328: 4630 mov r0, r6
- /* address is actually being changed? */
- if (ipaddr && (ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
- /* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
- LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n"));
- pcb = tcp_active_pcbs;
- while (pcb != NULL) {
- 800b32a: 2800 cmp r0, #0
- 800b32c: d1f5 bne.n 800b31a <netif_set_ipaddr+0x16>
- pcb = next;
- } else {
- pcb = pcb->next;
- }
- }
- for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
- 800b32e: 4b0a ldr r3, [pc, #40] ; (800b358 <netif_set_ipaddr+0x54>)
- 800b330: 681b ldr r3, [r3, #0]
- 800b332: e007 b.n 800b344 <netif_set_ipaddr+0x40>
- /* PCB bound to current local interface address? */
- if ((!(ip_addr_isany(&(lpcb->local_ip)))) &&
- 800b334: 681a ldr r2, [r3, #0]
- 800b336: b122 cbz r2, 800b342 <netif_set_ipaddr+0x3e>
- 800b338: 6869 ldr r1, [r5, #4]
- 800b33a: 428a cmp r2, r1
- (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr)))) {
- /* The PCB is listening to the old ipaddr and
- * is set to listen to the new one instead */
- ip_addr_set(&(lpcb->local_ip), ipaddr);
- 800b33c: bf04 itt eq
- 800b33e: 6822 ldreq r2, [r4, #0]
- 800b340: 601a streq r2, [r3, #0]
- pcb = next;
- } else {
- pcb = pcb->next;
- }
- }
- for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
- 800b342: 68db ldr r3, [r3, #12]
- 800b344: 2b00 cmp r3, #0
- 800b346: d1f5 bne.n 800b334 <netif_set_ipaddr+0x30>
- 800b348: e001 b.n 800b34e <netif_set_ipaddr+0x4a>
- }
- #endif
- snmp_delete_ipaddridx_tree(netif);
- snmp_delete_iprteidx_tree(0,netif);
- /* set new IP address to netif */
- ip_addr_set(&(netif->ip_addr), ipaddr);
- 800b34a: 606c str r4, [r5, #4]
- 800b34c: bd70 pop {r4, r5, r6, pc}
- 800b34e: 6824 ldr r4, [r4, #0]
- 800b350: e7fb b.n 800b34a <netif_set_ipaddr+0x46>
- 800b352: bf00 nop
- 800b354: 2000833c .word 0x2000833c
- 800b358: 20008344 .word 0x20008344
- 0800b35c <netif_set_addr>:
- * @param gw the new default gateway
- */
- void
- netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
- ip_addr_t *gw)
- {
- 800b35c: b570 push {r4, r5, r6, lr}
- 800b35e: 4614 mov r4, r2
- 800b360: 4606 mov r6, r0
- 800b362: 461d mov r5, r3
- netif_set_ipaddr(netif, ipaddr);
- 800b364: f7ff ffce bl 800b304 <netif_set_ipaddr>
- void
- netif_set_netmask(struct netif *netif, ip_addr_t *netmask)
- {
- snmp_delete_iprteidx_tree(0, netif);
- /* set new netmask to netif */
- ip_addr_set(&(netif->netmask), netmask);
- 800b368: b104 cbz r4, 800b36c <netif_set_addr+0x10>
- 800b36a: 6824 ldr r4, [r4, #0]
- 800b36c: 60b4 str r4, [r6, #8]
- * @note call netif_set_addr() if you also want to change ip address and netmask
- */
- void
- netif_set_gw(struct netif *netif, ip_addr_t *gw)
- {
- ip_addr_set(&(netif->gw), gw);
- 800b36e: b105 cbz r5, 800b372 <netif_set_addr+0x16>
- 800b370: 682d ldr r5, [r5, #0]
- 800b372: 60f5 str r5, [r6, #12]
- 800b374: bd70 pop {r4, r5, r6, pc}
- 800b376: 0000 movs r0, r0
- 0800b378 <netif_add>:
- * @return netif, or NULL if failed.
- */
- struct netif *
- netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
- ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
- {
- 800b378: b5f8 push {r3, r4, r5, r6, r7, lr}
- netif->loop_first = NULL;
- netif->loop_last = NULL;
- #endif /* ENABLE_LOOPBACK */
- /* remember netif specific state information data */
- netif->state = state;
- 800b37a: 9e06 ldr r6, [sp, #24]
- 800b37c: 61c6 str r6, [r0, #28]
- netif->num = netif_num++;
- 800b37e: 4e0f ldr r6, [pc, #60] ; (800b3bc <netif_add+0x44>)
- 800b380: 7837 ldrb r7, [r6, #0]
- 800b382: f880 7030 strb.w r7, [r0, #48] ; 0x30
- 800b386: 3701 adds r7, #1
- 800b388: 7037 strb r7, [r6, #0]
- netif->input = input;
- 800b38a: 9e08 ldr r6, [sp, #32]
- {
- LWIP_ASSERT("No init function given", init != NULL);
- /* reset new interface configuration state */
- ip_addr_set_zero(&netif->ip_addr);
- 800b38c: 2500 movs r5, #0
- * @return netif, or NULL if failed.
- */
- struct netif *
- netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
- ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)
- {
- 800b38e: 4604 mov r4, r0
- LWIP_ASSERT("No init function given", init != NULL);
- /* reset new interface configuration state */
- ip_addr_set_zero(&netif->ip_addr);
- 800b390: 6045 str r5, [r0, #4]
- ip_addr_set_zero(&netif->netmask);
- 800b392: 6085 str r5, [r0, #8]
- ip_addr_set_zero(&netif->gw);
- 800b394: 60c5 str r5, [r0, #12]
- netif->flags = 0;
- 800b396: f880 502d strb.w r5, [r0, #45] ; 0x2d
- #if LWIP_DHCP
- /* netif not under DHCP control by default */
- netif->dhcp = NULL;
- 800b39a: 6205 str r5, [r0, #32]
- #endif /* ENABLE_LOOPBACK */
- /* remember netif specific state information data */
- netif->state = state;
- netif->num = netif_num++;
- netif->input = input;
- 800b39c: 6106 str r6, [r0, #16]
- NETIF_SET_HWADDRHINT(netif, NULL);
- #if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
- netif->loop_cnt_current = 0;
- #endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */
- netif_set_addr(netif, ipaddr, netmask, gw);
- 800b39e: f7ff ffdd bl 800b35c <netif_set_addr>
- /* call user specified initialization function for netif */
- if (init(netif) != ERR_OK) {
- 800b3a2: 4620 mov r0, r4
- 800b3a4: 9b07 ldr r3, [sp, #28]
- 800b3a6: 4798 blx r3
- 800b3a8: b920 cbnz r0, 800b3b4 <netif_add+0x3c>
- return NULL;
- }
- /* add this netif to the list */
- netif->next = netif_list;
- 800b3aa: 4b05 ldr r3, [pc, #20] ; (800b3c0 <netif_add+0x48>)
- 800b3ac: 681a ldr r2, [r3, #0]
- 800b3ae: 6022 str r2, [r4, #0]
- netif_list = netif;
- 800b3b0: 601c str r4, [r3, #0]
- LWIP_DEBUGF(NETIF_DEBUG, (" netmask "));
- ip_addr_debug_print(NETIF_DEBUG, netmask);
- LWIP_DEBUGF(NETIF_DEBUG, (" gw "));
- ip_addr_debug_print(NETIF_DEBUG, gw);
- LWIP_DEBUGF(NETIF_DEBUG, ("\n"));
- return netif;
- 800b3b2: e000 b.n 800b3b6 <netif_add+0x3e>
- netif_set_addr(netif, ipaddr, netmask, gw);
- /* call user specified initialization function for netif */
- if (init(netif) != ERR_OK) {
- return NULL;
- 800b3b4: 462c mov r4, r5
- ip_addr_debug_print(NETIF_DEBUG, netmask);
- LWIP_DEBUGF(NETIF_DEBUG, (" gw "));
- ip_addr_debug_print(NETIF_DEBUG, gw);
- LWIP_DEBUGF(NETIF_DEBUG, ("\n"));
- return netif;
- }
- 800b3b6: 4620 mov r0, r4
- 800b3b8: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 800b3ba: bf00 nop
- 800b3bc: 20006b74 .word 0x20006b74
- 800b3c0: 20008218 .word 0x20008218
- 0800b3c4 <netif_set_gw>:
- * @note call netif_set_addr() if you also want to change ip address and netmask
- */
- void
- netif_set_gw(struct netif *netif, ip_addr_t *gw)
- {
- ip_addr_set(&(netif->gw), gw);
- 800b3c4: b101 cbz r1, 800b3c8 <netif_set_gw+0x4>
- 800b3c6: 6809 ldr r1, [r1, #0]
- 800b3c8: 60c1 str r1, [r0, #12]
- 800b3ca: 4770 bx lr
- 0800b3cc <netif_set_netmask>:
- void
- netif_set_netmask(struct netif *netif, ip_addr_t *netmask)
- {
- snmp_delete_iprteidx_tree(0, netif);
- /* set new netmask to netif */
- ip_addr_set(&(netif->netmask), netmask);
- 800b3cc: b101 cbz r1, 800b3d0 <netif_set_netmask+0x4>
- 800b3ce: 6809 ldr r1, [r1, #0]
- 800b3d0: 6081 str r1, [r0, #8]
- 800b3d2: 4770 bx lr
- 0800b3d4 <netif_set_default>:
- snmp_delete_iprteidx_tree(1, netif);
- } else {
- /* install default route */
- snmp_insert_iprteidx_tree(1, netif);
- }
- netif_default = netif;
- 800b3d4: 4b01 ldr r3, [pc, #4] ; (800b3dc <netif_set_default+0x8>)
- 800b3d6: 6018 str r0, [r3, #0]
- 800b3d8: 4770 bx lr
- 800b3da: bf00 nop
- 800b3dc: 2000821c .word 0x2000821c
- 0800b3e0 <netif_set_up>:
- *
- * @see dhcp_start()
- */
- void netif_set_up(struct netif *netif)
- {
- if (!(netif->flags & NETIF_FLAG_UP)) {
- 800b3e0: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
- 800b3e4: 07da lsls r2, r3, #31
- 800b3e6: d40a bmi.n 800b3fe <netif_set_up+0x1e>
- netif->flags |= NETIF_FLAG_UP;
- 800b3e8: f043 0201 orr.w r2, r3, #1
- NETIF_STATUS_CALLBACK(netif);
- if (netif->flags & NETIF_FLAG_LINK_UP) {
- #if LWIP_ARP
- /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */
- if (netif->flags & (NETIF_FLAG_ETHARP)) {
- 800b3ec: f003 0330 and.w r3, r3, #48 ; 0x30
- 800b3f0: 2b30 cmp r3, #48 ; 0x30
- * @see dhcp_start()
- */
- void netif_set_up(struct netif *netif)
- {
- if (!(netif->flags & NETIF_FLAG_UP)) {
- netif->flags |= NETIF_FLAG_UP;
- 800b3f2: f880 202d strb.w r2, [r0, #45] ; 0x2d
- NETIF_STATUS_CALLBACK(netif);
- if (netif->flags & NETIF_FLAG_LINK_UP) {
- #if LWIP_ARP
- /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */
- if (netif->flags & (NETIF_FLAG_ETHARP)) {
- 800b3f6: d102 bne.n 800b3fe <netif_set_up+0x1e>
- etharp_gratuitous(netif);
- 800b3f8: 1d01 adds r1, r0, #4
- 800b3fa: f003 bd97 b.w 800ef2c <etharp_request>
- 800b3fe: 4770 bx lr
- 0800b400 <netif_set_down>:
- *
- * @see dhcp_start()
- */
- void netif_set_down(struct netif *netif)
- {
- if (netif->flags & NETIF_FLAG_UP) {
- 800b400: f890 302d ldrb.w r3, [r0, #45] ; 0x2d
- 800b404: 07d9 lsls r1, r3, #31
- 800b406: d509 bpl.n 800b41c <netif_set_down+0x1c>
- netif->flags &= ~NETIF_FLAG_UP;
- 800b408: f023 0101 bic.w r1, r3, #1
- #if LWIP_SNMP
- snmp_get_sysuptime(&netif->ts);
- #endif
- #if LWIP_ARP
- if (netif->flags & NETIF_FLAG_ETHARP) {
- 800b40c: f003 0320 and.w r3, r3, #32
- 800b410: b2db uxtb r3, r3
- * @see dhcp_start()
- */
- void netif_set_down(struct netif *netif)
- {
- if (netif->flags & NETIF_FLAG_UP) {
- netif->flags &= ~NETIF_FLAG_UP;
- 800b412: f880 102d strb.w r1, [r0, #45] ; 0x2d
- #if LWIP_SNMP
- snmp_get_sysuptime(&netif->ts);
- #endif
- #if LWIP_ARP
- if (netif->flags & NETIF_FLAG_ETHARP) {
- 800b416: b10b cbz r3, 800b41c <netif_set_down+0x1c>
- etharp_cleanup_netif(netif);
- 800b418: f003 bd74 b.w 800ef04 <etharp_cleanup_netif>
- 800b41c: 4770 bx lr
- 0800b41e <pbuf_alloced_custom>:
- * big enough to hold 'length' plus the header size
- */
- struct pbuf*
- pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p,
- void *payload_mem, u16_t payload_mem_len)
- {
- 800b41e: b570 push {r4, r5, r6, lr}
- 800b420: 9c04 ldr r4, [sp, #16]
- u16_t offset;
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloced_custom(length=%"U16_F")\n", length));
- /* determine header offset */
- switch (l) {
- 800b422: 2803 cmp r0, #3
- 800b424: d821 bhi.n 800b46a <pbuf_alloced_custom+0x4c>
- 800b426: e8df f000 tbb [pc, r0]
- 800b42a: 0802 .short 0x0802
- 800b42c: 0604 .short 0x0604
- case PBUF_TRANSPORT:
- /* add room for transport (often TCP) layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
- 800b42e: 2036 movs r0, #54 ; 0x36
- 800b430: e004 b.n 800b43c <pbuf_alloced_custom+0x1e>
- /* add room for IP layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
- break;
- case PBUF_LINK:
- /* add room for link layer header */
- offset = PBUF_LINK_HLEN;
- 800b432: 200e movs r0, #14
- break;
- 800b434: e002 b.n 800b43c <pbuf_alloced_custom+0x1e>
- case PBUF_RAW:
- offset = 0;
- 800b436: 2000 movs r0, #0
- break;
- 800b438: e000 b.n 800b43c <pbuf_alloced_custom+0x1e>
- /* add room for transport (often TCP) layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
- break;
- case PBUF_IP:
- /* add room for IP layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
- 800b43a: 2022 movs r0, #34 ; 0x22
- default:
- LWIP_ASSERT("pbuf_alloced_custom: bad pbuf layer", 0);
- return NULL;
- }
- if (LWIP_MEM_ALIGN_SIZE(offset) + length > payload_mem_len) {
- 800b43c: 3003 adds r0, #3
- 800b43e: f020 0503 bic.w r5, r0, #3
- 800b442: f8bd 0014 ldrh.w r0, [sp, #20]
- 800b446: 186e adds r6, r5, r1
- 800b448: 4286 cmp r6, r0
- 800b44a: f04f 0000 mov.w r0, #0
- 800b44e: dc0d bgt.n 800b46c <pbuf_alloced_custom+0x4e>
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_WARNING, ("pbuf_alloced_custom(length=%"U16_F") buffer too short\n", length));
- return NULL;
- }
- p->pbuf.next = NULL;
- 800b450: 6018 str r0, [r3, #0]
- if (payload_mem != NULL) {
- 800b452: b104 cbz r4, 800b456 <pbuf_alloced_custom+0x38>
- p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
- 800b454: 1964 adds r4, r4, r5
- } else {
- p->pbuf.payload = NULL;
- }
- p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
- 800b456: 2002 movs r0, #2
- p->pbuf.len = p->pbuf.tot_len = length;
- p->pbuf.type = type;
- 800b458: 731a strb r2, [r3, #12]
- p->pbuf.ref = 1;
- 800b45a: 2201 movs r2, #1
- if (payload_mem != NULL) {
- p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
- } else {
- p->pbuf.payload = NULL;
- }
- p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
- 800b45c: 7358 strb r0, [r3, #13]
- p->pbuf.next = NULL;
- if (payload_mem != NULL) {
- p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset);
- } else {
- p->pbuf.payload = NULL;
- 800b45e: 605c str r4, [r3, #4]
- }
- p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
- p->pbuf.len = p->pbuf.tot_len = length;
- 800b460: 8119 strh r1, [r3, #8]
- 800b462: 8159 strh r1, [r3, #10]
- p->pbuf.type = type;
- p->pbuf.ref = 1;
- 800b464: 81da strh r2, [r3, #14]
- return &p->pbuf;
- 800b466: 4618 mov r0, r3
- 800b468: bd70 pop {r4, r5, r6, pc}
- case PBUF_RAW:
- offset = 0;
- break;
- default:
- LWIP_ASSERT("pbuf_alloced_custom: bad pbuf layer", 0);
- return NULL;
- 800b46a: 2000 movs r0, #0
- p->pbuf.flags = PBUF_FLAG_IS_CUSTOM;
- p->pbuf.len = p->pbuf.tot_len = length;
- p->pbuf.type = type;
- p->pbuf.ref = 1;
- return &p->pbuf;
- }
- 800b46c: bd70 pop {r4, r5, r6, pc}
- 0800b46e <pbuf_header>:
- * @return non-zero on failure, zero on success.
- *
- */
- u8_t
- pbuf_header(struct pbuf *p, s16_t header_size_increment)
- {
- 800b46e: b510 push {r4, lr}
- u16_t type;
- void *payload;
- u16_t increment_magnitude;
- LWIP_ASSERT("p != NULL", p != NULL);
- if ((header_size_increment == 0) || (p == NULL)) {
- 800b470: b321 cbz r1, 800b4bc <pbuf_header+0x4e>
- 800b472: b330 cbz r0, 800b4c2 <pbuf_header+0x54>
- return 0;
- }
-
- if (header_size_increment < 0){
- 800b474: 2900 cmp r1, #0
- 800b476: da05 bge.n 800b484 <pbuf_header+0x16>
- increment_magnitude = -header_size_increment;
- 800b478: 424b negs r3, r1
- /* Check that we aren't going to move off the end of the pbuf */
- LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
- 800b47a: 8942 ldrh r2, [r0, #10]
- if ((header_size_increment == 0) || (p == NULL)) {
- return 0;
- }
-
- if (header_size_increment < 0){
- increment_magnitude = -header_size_increment;
- 800b47c: b29b uxth r3, r3
- /* Check that we aren't going to move off the end of the pbuf */
- LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
- 800b47e: 429a cmp r2, r3
- 800b480: d201 bcs.n 800b486 <pbuf_header+0x18>
- 800b482: e01d b.n 800b4c0 <pbuf_header+0x52>
- } else {
- increment_magnitude = header_size_increment;
- 800b484: b28b uxth r3, r1
- LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF",
- (u8_t *)p->payload - increment_magnitude >= (u8_t *)p + SIZEOF_STRUCT_PBUF);
- #endif
- }
- type = p->type;
- 800b486: 7b02 ldrb r2, [r0, #12]
- /* remember current payload pointer */
- payload = p->payload;
- 800b488: 6844 ldr r4, [r0, #4]
- /* pbuf types containing payloads? */
- if (type == PBUF_RAM || type == PBUF_POOL) {
- 800b48a: b10a cbz r2, 800b490 <pbuf_header+0x22>
- 800b48c: 2a03 cmp r2, #3
- 800b48e: d105 bne.n 800b49c <pbuf_header+0x2e>
- /* set new payload pointer */
- p->payload = (u8_t *)p->payload - header_size_increment;
- 800b490: 1a64 subs r4, r4, r1
- /* boundary check fails? */
- if ((u8_t *)p->payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) {
- 800b492: f100 0310 add.w r3, r0, #16
- 800b496: 429c cmp r4, r3
- 800b498: d312 bcc.n 800b4c0 <pbuf_header+0x52>
- 800b49a: e008 b.n 800b4ae <pbuf_header+0x40>
- p->payload = payload;
- /* bail out unsuccesfully */
- return 1;
- }
- /* pbuf types refering to external payloads? */
- } else if (type == PBUF_REF || type == PBUF_ROM) {
- 800b49c: 3a01 subs r2, #1
- 800b49e: 2a01 cmp r2, #1
- 800b4a0: d80e bhi.n 800b4c0 <pbuf_header+0x52>
- /* hide a header in the payload? */
- if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
- 800b4a2: 2900 cmp r1, #0
- 800b4a4: da0c bge.n 800b4c0 <pbuf_header+0x52>
- 800b4a6: 8942 ldrh r2, [r0, #10]
- 800b4a8: 429a cmp r2, r3
- 800b4aa: d309 bcc.n 800b4c0 <pbuf_header+0x52>
- /* increase payload pointer */
- p->payload = (u8_t *)p->payload - header_size_increment;
- 800b4ac: 1a64 subs r4, r4, r1
- /* Unknown type */
- LWIP_ASSERT("bad pbuf type", 0);
- return 1;
- }
- /* modify pbuf length fields */
- p->len += header_size_increment;
- 800b4ae: 8943 ldrh r3, [r0, #10]
- /* pbuf types refering to external payloads? */
- } else if (type == PBUF_REF || type == PBUF_ROM) {
- /* hide a header in the payload? */
- if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
- /* increase payload pointer */
- p->payload = (u8_t *)p->payload - header_size_increment;
- 800b4b0: 6044 str r4, [r0, #4]
- /* Unknown type */
- LWIP_ASSERT("bad pbuf type", 0);
- return 1;
- }
- /* modify pbuf length fields */
- p->len += header_size_increment;
- 800b4b2: 18cb adds r3, r1, r3
- 800b4b4: 8143 strh r3, [r0, #10]
- p->tot_len += header_size_increment;
- 800b4b6: 8903 ldrh r3, [r0, #8]
- 800b4b8: 18c9 adds r1, r1, r3
- 800b4ba: 8101 strh r1, [r0, #8]
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%"S16_F")\n",
- (void *)payload, (void *)p->payload, header_size_increment));
- return 0;
- 800b4bc: 2000 movs r0, #0
- 800b4be: bd10 pop {r4, pc}
- }
-
- if (header_size_increment < 0){
- increment_magnitude = -header_size_increment;
- /* Check that we aren't going to move off the end of the pbuf */
- LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
- 800b4c0: 2001 movs r0, #1
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%"S16_F")\n",
- (void *)payload, (void *)p->payload, header_size_increment));
- return 0;
- }
- 800b4c2: bd10 pop {r4, pc}
- 0800b4c4 <pbuf_free>:
- * 1->1->1 becomes .......
- *
- */
- u8_t
- pbuf_free(struct pbuf *p)
- {
- 800b4c4: b538 push {r3, r4, r5, lr}
- u16_t type;
- struct pbuf *q;
- u8_t count;
- if (p == NULL) {
- 800b4c6: 4601 mov r1, r0
- 800b4c8: b320 cbz r0, 800b514 <pbuf_free+0x50>
- 800b4ca: 2400 movs r4, #0
- * further protection. */
- SYS_ARCH_PROTECT(old_level);
- /* all pbufs in a chain are referenced at least once */
- LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
- /* decrease reference count (number of pointers to pbuf) */
- ref = --(p->ref);
- 800b4cc: 89cb ldrh r3, [r1, #14]
- 800b4ce: 3b01 subs r3, #1
- 800b4d0: b29b uxth r3, r3
- 800b4d2: 81cb strh r3, [r1, #14]
- SYS_ARCH_UNPROTECT(old_level);
- /* this pbuf is no longer referenced to? */
- if (ref == 0) {
- 800b4d4: b9fb cbnz r3, 800b516 <pbuf_free+0x52>
- q = p->next;
- LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p));
- type = p->type;
- #if LWIP_SUPPORT_CUSTOM_PBUF
- /* is this a custom pbuf? */
- if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) {
- 800b4d6: 7b4a ldrb r2, [r1, #13]
- ref = --(p->ref);
- SYS_ARCH_UNPROTECT(old_level);
- /* this pbuf is no longer referenced to? */
- if (ref == 0) {
- /* remember next pbuf in chain for next iteration */
- q = p->next;
- 800b4d8: 680d ldr r5, [r1, #0]
- LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p));
- type = p->type;
- 800b4da: 7b0b ldrb r3, [r1, #12]
- #if LWIP_SUPPORT_CUSTOM_PBUF
- /* is this a custom pbuf? */
- if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) {
- 800b4dc: f002 0202 and.w r2, r2, #2
- 800b4e0: b2d2 uxtb r2, r2
- 800b4e2: b11a cbz r2, 800b4ec <pbuf_free+0x28>
- struct pbuf_custom *pc = (struct pbuf_custom*)p;
- LWIP_ASSERT("pc->custom_free_function != NULL", pc->custom_free_function != NULL);
- pc->custom_free_function(p);
- 800b4e4: 690b ldr r3, [r1, #16]
- 800b4e6: 4608 mov r0, r1
- 800b4e8: 4798 blx r3
- 800b4ea: e00d b.n 800b508 <pbuf_free+0x44>
- } else
- #endif /* LWIP_SUPPORT_CUSTOM_PBUF */
- {
- /* is this a pbuf from the pool? */
- if (type == PBUF_POOL) {
- 800b4ec: 2b03 cmp r3, #3
- 800b4ee: d101 bne.n 800b4f4 <pbuf_free+0x30>
- memp_free(MEMP_PBUF_POOL, p);
- 800b4f0: 2009 movs r0, #9
- 800b4f2: e003 b.n 800b4fc <pbuf_free+0x38>
- /* is this a ROM or RAM referencing pbuf? */
- } else if (type == PBUF_ROM || type == PBUF_REF) {
- 800b4f4: 3b01 subs r3, #1
- 800b4f6: 2b01 cmp r3, #1
- 800b4f8: d803 bhi.n 800b502 <pbuf_free+0x3e>
- memp_free(MEMP_PBUF, p);
- 800b4fa: 2008 movs r0, #8
- 800b4fc: f7ff feea bl 800b2d4 <memp_free>
- 800b500: e002 b.n 800b508 <pbuf_free+0x44>
- /* type == PBUF_RAM */
- } else {
- mem_free(p);
- 800b502: 4608 mov r0, r1
- 800b504: f7ff fd3c bl 800af80 <mem_free>
- }
- }
- count++;
- 800b508: 3401 adds r4, #1
- 800b50a: b2e4 uxtb r4, r4
- p->type == PBUF_REF || p->type == PBUF_POOL);
- count = 0;
- /* de-allocate all consecutive pbufs from the head of the chain that
- * obtain a zero reference count after decrementing*/
- while (p != NULL) {
- 800b50c: 4629 mov r1, r5
- 800b50e: 2d00 cmp r5, #0
- 800b510: d1dc bne.n 800b4cc <pbuf_free+0x8>
- 800b512: e000 b.n 800b516 <pbuf_free+0x52>
- if (p == NULL) {
- LWIP_ASSERT("p != NULL", p != NULL);
- /* if assertions are disabled, proceed with debug output */
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
- ("pbuf_free(p == NULL) was called.\n"));
- return 0;
- 800b514: 4604 mov r4, r0
- }
- }
- PERF_STOP("pbuf_free");
- /* return number of de-allocated pbufs */
- return count;
- }
- 800b516: 4620 mov r0, r4
- 800b518: bd38 pop {r3, r4, r5, pc}
- 0800b51a <pbuf_realloc>:
- *
- * @note Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain).
- */
- void
- pbuf_realloc(struct pbuf *p, u16_t new_len)
- {
- 800b51a: b538 push {r3, r4, r5, lr}
- p->type == PBUF_ROM ||
- p->type == PBUF_RAM ||
- p->type == PBUF_REF);
- /* desired length larger than current length? */
- if (new_len >= p->tot_len) {
- 800b51c: 8903 ldrh r3, [r0, #8]
- 800b51e: 4299 cmp r1, r3
- 800b520: d220 bcs.n 800b564 <pbuf_realloc+0x4a>
- return;
- }
- /* the pbuf chain grows by (new_len - p->tot_len) bytes
- * (which may be negative in case of shrinking) */
- grow = new_len - p->tot_len;
- 800b522: 1aca subs r2, r1, r3
- /* first, step over any pbufs that should remain in the chain */
- rem_len = new_len;
- q = p;
- /* should this pbuf be kept? */
- while (rem_len > q->len) {
- 800b524: 460d mov r5, r1
- 800b526: 4604 mov r4, r0
- 800b528: e005 b.n 800b536 <pbuf_realloc+0x1c>
- /* decrease remaining length by pbuf length */
- rem_len -= q->len;
- 800b52a: 1aed subs r5, r5, r3
- /* decrease total length indicator */
- LWIP_ASSERT("grow < max_u16_t", grow < 0xffff);
- q->tot_len += (u16_t)grow;
- 800b52c: 8923 ldrh r3, [r4, #8]
- 800b52e: 18d3 adds r3, r2, r3
- 800b530: 8123 strh r3, [r4, #8]
- /* proceed to next pbuf in chain */
- q = q->next;
- 800b532: 6824 ldr r4, [r4, #0]
- rem_len = new_len;
- q = p;
- /* should this pbuf be kept? */
- while (rem_len > q->len) {
- /* decrease remaining length by pbuf length */
- rem_len -= q->len;
- 800b534: b2ad uxth r5, r5
- /* first, step over any pbufs that should remain in the chain */
- rem_len = new_len;
- q = p;
- /* should this pbuf be kept? */
- while (rem_len > q->len) {
- 800b536: 8963 ldrh r3, [r4, #10]
- 800b538: 429d cmp r5, r3
- 800b53a: d8f6 bhi.n 800b52a <pbuf_realloc+0x10>
- /* we have now reached the new last pbuf (in q) */
- /* rem_len == desired length for pbuf q */
- /* shrink allocated memory for PBUF_RAM */
- /* (other types merely adjust their length fields */
- if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
- 800b53c: 7b22 ldrb r2, [r4, #12]
- 800b53e: b94a cbnz r2, 800b554 <pbuf_realloc+0x3a>
- 800b540: 429d cmp r5, r3
- 800b542: d007 beq.n 800b554 <pbuf_realloc+0x3a>
- /* reallocate and adjust the length of the pbuf that will be split */
- q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len);
- 800b544: 6863 ldr r3, [r4, #4]
- 800b546: 1b1b subs r3, r3, r4
- 800b548: 18e9 adds r1, r5, r3
- 800b54a: 4620 mov r0, r4
- 800b54c: b289 uxth r1, r1
- 800b54e: f7ff fd6d bl 800b02c <mem_trim>
- 800b552: 4604 mov r4, r0
- /* adjust length fields for new last pbuf */
- q->len = rem_len;
- q->tot_len = q->len;
- /* any remaining pbufs in chain? */
- if (q->next != NULL) {
- 800b554: 6820 ldr r0, [r4, #0]
- /* reallocate and adjust the length of the pbuf that will be split */
- q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len);
- LWIP_ASSERT("mem_trim returned q == NULL", q != NULL);
- }
- /* adjust length fields for new last pbuf */
- q->len = rem_len;
- 800b556: 8165 strh r5, [r4, #10]
- q->tot_len = q->len;
- 800b558: 8125 strh r5, [r4, #8]
- /* any remaining pbufs in chain? */
- if (q->next != NULL) {
- 800b55a: b108 cbz r0, 800b560 <pbuf_realloc+0x46>
- /* free remaining pbufs in chain */
- pbuf_free(q->next);
- 800b55c: f7ff ffb2 bl 800b4c4 <pbuf_free>
- }
- /* q is last packet in chain */
- q->next = NULL;
- 800b560: 2300 movs r3, #0
- 800b562: 6023 str r3, [r4, #0]
- 800b564: bd38 pop {r3, r4, r5, pc}
- 0800b566 <pbuf_alloc>:
- * @return the allocated pbuf. If multiple pbufs where allocated, this
- * is the first pbuf of a pbuf chain.
- */
- struct pbuf *
- pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
- {
- 800b566: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- 800b56a: 460d mov r5, r1
- 800b56c: 4617 mov r7, r2
- u16_t offset;
- s32_t rem_len; /* remaining length */
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F")\n", length));
- /* determine header offset */
- switch (layer) {
- 800b56e: 2803 cmp r0, #3
- 800b570: d87c bhi.n 800b66c <pbuf_alloc+0x106>
- 800b572: e8df f000 tbb [pc, r0]
- 800b576: 0802 .short 0x0802
- 800b578: 0604 .short 0x0604
- case PBUF_TRANSPORT:
- /* add room for transport (often TCP) layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
- 800b57a: 2636 movs r6, #54 ; 0x36
- 800b57c: e004 b.n 800b588 <pbuf_alloc+0x22>
- /* add room for IP layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
- break;
- case PBUF_LINK:
- /* add room for link layer header */
- offset = PBUF_LINK_HLEN;
- 800b57e: 260e movs r6, #14
- break;
- 800b580: e002 b.n 800b588 <pbuf_alloc+0x22>
- case PBUF_RAW:
- offset = 0;
- 800b582: 2600 movs r6, #0
- break;
- 800b584: e000 b.n 800b588 <pbuf_alloc+0x22>
- /* add room for transport (often TCP) layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN;
- break;
- case PBUF_IP:
- /* add room for IP layer header */
- offset = PBUF_LINK_HLEN + PBUF_IP_HLEN;
- 800b586: 2622 movs r6, #34 ; 0x22
- default:
- LWIP_ASSERT("pbuf_alloc: bad pbuf layer", 0);
- return NULL;
- }
- switch (type) {
- 800b588: 2f03 cmp r7, #3
- 800b58a: d86f bhi.n 800b66c <pbuf_alloc+0x106>
- 800b58c: e8df f007 tbb [pc, r7]
- 800b590: 025e5e46 .word 0x025e5e46
- case PBUF_POOL:
- /* allocate head of pbuf chain into p */
- p = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
- 800b594: 2009 movs r0, #9
- 800b596: f7ff fe73 bl 800b280 <memp_malloc>
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
- if (p == NULL) {
- 800b59a: 4604 mov r4, r0
- 800b59c: b900 cbnz r0, 800b5a0 <pbuf_alloc+0x3a>
- 800b59e: e065 b.n 800b66c <pbuf_alloc+0x106>
- }
- p->type = type;
- p->next = NULL;
- /* make the payload pointer point 'offset' bytes into pbuf data memory */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
- 800b5a0: 1982 adds r2, r0, r6
- LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
- ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
- /* the total length of the pbuf chain is the requested size */
- p->tot_len = length;
- /* set the length of the first pbuf in the chain */
- p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
- 800b5a2: 3603 adds r6, #3
- 800b5a4: f026 0603 bic.w r6, r6, #3
- }
- p->type = type;
- p->next = NULL;
- /* make the payload pointer point 'offset' bytes into pbuf data memory */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
- 800b5a8: 3213 adds r2, #19
- LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
- ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
- /* the total length of the pbuf chain is the requested size */
- p->tot_len = length;
- /* set the length of the first pbuf in the chain */
- p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
- 800b5aa: f5c6 66c0 rsb r6, r6, #1536 ; 0x600
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
- if (p == NULL) {
- PBUF_POOL_IS_EMPTY();
- return NULL;
- }
- p->type = type;
- 800b5ae: 2303 movs r3, #3
- p->next = NULL;
- /* make the payload pointer point 'offset' bytes into pbuf data memory */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
- 800b5b0: f022 0203 bic.w r2, r2, #3
- LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
- ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
- /* the total length of the pbuf chain is the requested size */
- p->tot_len = length;
- /* set the length of the first pbuf in the chain */
- p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
- 800b5b4: 3604 adds r6, #4
- 800b5b6: 42ae cmp r6, r5
- 800b5b8: bfa8 it ge
- 800b5ba: 462e movge r6, r5
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
- if (p == NULL) {
- PBUF_POOL_IS_EMPTY();
- return NULL;
- }
- p->type = type;
- 800b5bc: 7303 strb r3, [r0, #12]
- p->next = NULL;
- /* make the payload pointer point 'offset' bytes into pbuf data memory */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
- 800b5be: 6042 str r2, [r0, #4]
- if (p == NULL) {
- PBUF_POOL_IS_EMPTY();
- return NULL;
- }
- p->type = type;
- p->next = NULL;
- 800b5c0: 2300 movs r3, #0
- ((u8_t*)p->payload + p->len <=
- (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
- LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT",
- (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 );
- /* set reference count (needed here in case we fail) */
- p->ref = 1;
- 800b5c2: 2201 movs r2, #1
- LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
- ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
- /* the total length of the pbuf chain is the requested size */
- p->tot_len = length;
- /* set the length of the first pbuf in the chain */
- p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
- 800b5c4: 8146 strh r6, [r0, #10]
- if (p == NULL) {
- PBUF_POOL_IS_EMPTY();
- return NULL;
- }
- p->type = type;
- p->next = NULL;
- 800b5c6: 6003 str r3, [r0, #0]
- /* make the payload pointer point 'offset' bytes into pbuf data memory */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset)));
- LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned",
- ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0);
- /* the total length of the pbuf chain is the requested size */
- p->tot_len = length;
- 800b5c8: 8105 strh r5, [r0, #8]
- ((u8_t*)p->payload + p->len <=
- (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
- LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT",
- (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 );
- /* set reference count (needed here in case we fail) */
- p->ref = 1;
- 800b5ca: 81c2 strh r2, [r0, #14]
- /* now allocate the tail of the pbuf chain */
- /* remember first pbuf for linkage in next iteration */
- r = p;
- /* remaining length to be allocated */
- rem_len = length - p->len;
- 800b5cc: 1bae subs r6, r5, r6
- /* any remaining pbufs to be allocated? */
- while (rem_len > 0) {
- 800b5ce: 4607 mov r7, r0
- 800b5d0: 4698 mov r8, r3
- r->next = q;
- /* set total length of this pbuf and next in chain */
- LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
- q->tot_len = (u16_t)rem_len;
- /* this pbuf length is pool size, unless smaller sized tail */
- q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
- 800b5d2: f240 6903 movw r9, #1539 ; 0x603
- 800b5d6: f240 6a04 movw sl, #1540 ; 0x604
- /* remember first pbuf for linkage in next iteration */
- r = p;
- /* remaining length to be allocated */
- rem_len = length - p->len;
- /* any remaining pbufs to be allocated? */
- while (rem_len > 0) {
- 800b5da: e01c b.n 800b616 <pbuf_alloc+0xb0>
- q = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
- 800b5dc: 2009 movs r0, #9
- 800b5de: f7ff fe4f bl 800b280 <memp_malloc>
- if (q == NULL) {
- 800b5e2: 4605 mov r5, r0
- 800b5e4: b918 cbnz r0, 800b5ee <pbuf_alloc+0x88>
- PBUF_POOL_IS_EMPTY();
- /* free chain so far allocated */
- pbuf_free(p);
- 800b5e6: 4620 mov r0, r4
- 800b5e8: f7ff ff6c bl 800b4c4 <pbuf_free>
- 800b5ec: e03e b.n 800b66c <pbuf_alloc+0x106>
- /* bail out unsuccesfully */
- return NULL;
- }
- q->type = type;
- 800b5ee: 2303 movs r3, #3
- /* set total length of this pbuf and next in chain */
- LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
- q->tot_len = (u16_t)rem_len;
- /* this pbuf length is pool size, unless smaller sized tail */
- q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
- q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
- 800b5f0: f100 0210 add.w r2, r0, #16
- /* free chain so far allocated */
- pbuf_free(p);
- /* bail out unsuccesfully */
- return NULL;
- }
- q->type = type;
- 800b5f4: 7303 strb r3, [r0, #12]
- q->next = NULL;
- /* make previous pbuf point to this pbuf */
- r->next = q;
- /* set total length of this pbuf and next in chain */
- LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
- q->tot_len = (u16_t)rem_len;
- 800b5f6: b2b3 uxth r3, r6
- 800b5f8: 8103 strh r3, [r0, #8]
- /* this pbuf length is pool size, unless smaller sized tail */
- q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
- q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF);
- 800b5fa: 6042 str r2, [r0, #4]
- r->next = q;
- /* set total length of this pbuf and next in chain */
- LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
- q->tot_len = (u16_t)rem_len;
- /* this pbuf length is pool size, unless smaller sized tail */
- q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
- 800b5fc: 454b cmp r3, r9
- 800b5fe: bf88 it hi
- 800b600: 4653 movhi r3, sl
- LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
- ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
- LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
- ((u8_t*)p->payload + p->len <=
- (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
- q->ref = 1;
- 800b602: 2201 movs r2, #1
- /* bail out unsuccesfully */
- return NULL;
- }
- q->type = type;
- q->flags = 0;
- q->next = NULL;
- 800b604: f8c0 8000 str.w r8, [r0]
- pbuf_free(p);
- /* bail out unsuccesfully */
- return NULL;
- }
- q->type = type;
- q->flags = 0;
- 800b608: f880 800d strb.w r8, [r0, #13]
- q->next = NULL;
- /* make previous pbuf point to this pbuf */
- r->next = q;
- 800b60c: 6038 str r0, [r7, #0]
- /* set total length of this pbuf and next in chain */
- LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff);
- q->tot_len = (u16_t)rem_len;
- /* this pbuf length is pool size, unless smaller sized tail */
- q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
- 800b60e: 8143 strh r3, [r0, #10]
- LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",
- ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0);
- LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
- ((u8_t*)p->payload + p->len <=
- (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
- q->ref = 1;
- 800b610: 81c2 strh r2, [r0, #14]
- /* calculate remaining length to be allocated */
- rem_len -= q->len;
- 800b612: 1af6 subs r6, r6, r3
- 800b614: 4607 mov r7, r0
- /* remember first pbuf for linkage in next iteration */
- r = p;
- /* remaining length to be allocated */
- rem_len = length - p->len;
- /* any remaining pbufs to be allocated? */
- while (rem_len > 0) {
- 800b616: 2e00 cmp r6, #0
- 800b618: dce0 bgt.n 800b5dc <pbuf_alloc+0x76>
- 800b61a: e022 b.n 800b662 <pbuf_alloc+0xfc>
- /*r->next = NULL;*/
- break;
- case PBUF_RAM:
- /* If pbuf is to be allocated in RAM, allocate memory for it. */
- p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
- 800b61c: f106 0013 add.w r0, r6, #19
- 800b620: 1ceb adds r3, r5, #3
- 800b622: f023 0303 bic.w r3, r3, #3
- 800b626: f020 0003 bic.w r0, r0, #3
- 800b62a: 18c0 adds r0, r0, r3
- 800b62c: b280 uxth r0, r0
- 800b62e: f7ff fd6d bl 800b10c <mem_malloc>
- if (p == NULL) {
- 800b632: 4604 mov r4, r0
- 800b634: b1d0 cbz r0, 800b66c <pbuf_alloc+0x106>
- return NULL;
- }
- /* Set up internal structure of the pbuf. */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
- 800b636: 1986 adds r6, r0, r6
- 800b638: 3613 adds r6, #19
- p->len = p->tot_len = length;
- p->next = NULL;
- 800b63a: 2300 movs r3, #0
- p = (struct pbuf*)mem_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length));
- if (p == NULL) {
- return NULL;
- }
- /* Set up internal structure of the pbuf. */
- p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset));
- 800b63c: f026 0603 bic.w r6, r6, #3
- 800b640: 6046 str r6, [r0, #4]
- p->len = p->tot_len = length;
- 800b642: 8105 strh r5, [r0, #8]
- 800b644: 8145 strh r5, [r0, #10]
- p->next = NULL;
- 800b646: 6003 str r3, [r0, #0]
- p->type = type;
- 800b648: 7303 strb r3, [r0, #12]
- 800b64a: e00a b.n 800b662 <pbuf_alloc+0xfc>
- /* pbuf references existing (non-volatile static constant) ROM payload? */
- case PBUF_ROM:
- /* pbuf references existing (externally allocated) RAM payload? */
- case PBUF_REF:
- /* only allocate memory for the pbuf structure */
- p = (struct pbuf *)memp_malloc(MEMP_PBUF);
- 800b64c: 2008 movs r0, #8
- 800b64e: f7ff fe17 bl 800b280 <memp_malloc>
- if (p == NULL) {
- 800b652: 4604 mov r4, r0
- 800b654: b150 cbz r0, 800b66c <pbuf_alloc+0x106>
- ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n",
- (type == PBUF_ROM) ? "ROM" : "REF"));
- return NULL;
- }
- /* caller must set this field properly, afterwards */
- p->payload = NULL;
- 800b656: 2300 movs r3, #0
- 800b658: 6043 str r3, [r0, #4]
- p->len = p->tot_len = length;
- 800b65a: 8105 strh r5, [r0, #8]
- 800b65c: 8145 strh r5, [r0, #10]
- p->next = NULL;
- 800b65e: 6003 str r3, [r0, #0]
- p->type = type;
- 800b660: 7307 strb r7, [r0, #12]
- default:
- LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
- return NULL;
- }
- /* set reference count */
- p->ref = 1;
- 800b662: 2301 movs r3, #1
- 800b664: 81e3 strh r3, [r4, #14]
- /* set flags */
- p->flags = 0;
- 800b666: 2300 movs r3, #0
- 800b668: 7363 strb r3, [r4, #13]
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p));
- return p;
- 800b66a: e000 b.n 800b66e <pbuf_alloc+0x108>
- p->next = NULL;
- p->type = type;
- break;
- default:
- LWIP_ASSERT("pbuf_alloc: erroneous type", 0);
- return NULL;
- 800b66c: 2400 movs r4, #0
- p->ref = 1;
- /* set flags */
- p->flags = 0;
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p));
- return p;
- }
- 800b66e: 4620 mov r0, r4
- 800b670: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 0800b674 <pbuf_clen>:
- * @return the number of pbufs in a chain
- */
- u8_t
- pbuf_clen(struct pbuf *p)
- {
- 800b674: 4603 mov r3, r0
- u8_t len;
- len = 0;
- 800b676: 2000 movs r0, #0
- while (p != NULL) {
- 800b678: e002 b.n 800b680 <pbuf_clen+0xc>
- ++len;
- 800b67a: 3001 adds r0, #1
- p = p->next;
- 800b67c: 681b ldr r3, [r3, #0]
- {
- u8_t len;
- len = 0;
- while (p != NULL) {
- ++len;
- 800b67e: b2c0 uxtb r0, r0
- pbuf_clen(struct pbuf *p)
- {
- u8_t len;
- len = 0;
- while (p != NULL) {
- 800b680: 2b00 cmp r3, #0
- 800b682: d1fa bne.n 800b67a <pbuf_clen+0x6>
- ++len;
- p = p->next;
- }
- return len;
- }
- 800b684: 4770 bx lr
- 0800b686 <pbuf_ref>:
- void
- pbuf_ref(struct pbuf *p)
- {
- SYS_ARCH_DECL_PROTECT(old_level);
- /* pbuf given? */
- if (p != NULL) {
- 800b686: b110 cbz r0, 800b68e <pbuf_ref+0x8>
- SYS_ARCH_PROTECT(old_level);
- ++(p->ref);
- 800b688: 89c3 ldrh r3, [r0, #14]
- 800b68a: 3301 adds r3, #1
- 800b68c: 81c3 strh r3, [r0, #14]
- 800b68e: 4770 bx lr
- 0800b690 <pbuf_cat>:
- * @see pbuf_chain()
- */
- void
- pbuf_cat(struct pbuf *h, struct pbuf *t)
- {
- 800b690: b510 push {r4, lr}
- struct pbuf *p;
- LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
- 800b692: b168 cbz r0, 800b6b0 <pbuf_cat+0x20>
- 800b694: b161 cbz r1, 800b6b0 <pbuf_cat+0x20>
- 800b696: e003 b.n 800b6a0 <pbuf_cat+0x10>
- ((h != NULL) && (t != NULL)), return;);
- /* proceed to last pbuf of chain */
- for (p = h; p->next != NULL; p = p->next) {
- /* add total length of second chain to all totals of first chain */
- p->tot_len += t->tot_len;
- 800b698: 8904 ldrh r4, [r0, #8]
- 800b69a: 191b adds r3, r3, r4
- 800b69c: 8103 strh r3, [r0, #8]
- LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
- ((h != NULL) && (t != NULL)), return;);
- /* proceed to last pbuf of chain */
- for (p = h; p->next != NULL; p = p->next) {
- 800b69e: 4610 mov r0, r2
- 800b6a0: 6802 ldr r2, [r0, #0]
- 800b6a2: 890b ldrh r3, [r1, #8]
- 800b6a4: 2a00 cmp r2, #0
- 800b6a6: d1f7 bne.n 800b698 <pbuf_cat+0x8>
- }
- /* { p is last pbuf of first h chain, p->next == NULL } */
- LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
- LWIP_ASSERT("p->next == NULL", p->next == NULL);
- /* add total length of second chain to last pbuf total of first chain */
- p->tot_len += t->tot_len;
- 800b6a8: 8902 ldrh r2, [r0, #8]
- /* chain last pbuf of head (p) with first of tail (t) */
- p->next = t;
- 800b6aa: 6001 str r1, [r0, #0]
- }
- /* { p is last pbuf of first h chain, p->next == NULL } */
- LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
- LWIP_ASSERT("p->next == NULL", p->next == NULL);
- /* add total length of second chain to last pbuf total of first chain */
- p->tot_len += t->tot_len;
- 800b6ac: 189b adds r3, r3, r2
- 800b6ae: 8103 strh r3, [r0, #8]
- 800b6b0: bd10 pop {r4, pc}
- 0800b6b2 <pbuf_chain>:
- * The ->ref field of the first pbuf of the tail chain is adjusted.
- *
- */
- void
- pbuf_chain(struct pbuf *h, struct pbuf *t)
- {
- 800b6b2: b510 push {r4, lr}
- 800b6b4: 460c mov r4, r1
- pbuf_cat(h, t);
- 800b6b6: f7ff ffeb bl 800b690 <pbuf_cat>
- /* t is now referenced by h */
- pbuf_ref(t);
- 800b6ba: 4620 mov r0, r4
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t));
- }
- 800b6bc: e8bd 4010 ldmia.w sp!, {r4, lr}
- void
- pbuf_chain(struct pbuf *h, struct pbuf *t)
- {
- pbuf_cat(h, t);
- /* t is now referenced by h */
- pbuf_ref(t);
- 800b6c0: f7ff bfe1 b.w 800b686 <pbuf_ref>
- 0800b6c4 <pbuf_copy>:
- * ERR_ARG if one of the pbufs is NULL or p_to is not big
- * enough to hold p_from
- */
- err_t
- pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
- {
- 800b6c4: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- 800b6c8: 460c mov r4, r1
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy(%p, %p)\n",
- (void*)p_to, (void*)p_from));
- /* is the target big enough to hold the source? */
- LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) &&
- 800b6ca: 4605 mov r5, r0
- 800b6cc: b908 cbnz r0, 800b6d2 <pbuf_copy+0xe>
- 800b6ce: 20f2 movs r0, #242 ; 0xf2
- 800b6d0: e03f b.n 800b752 <pbuf_copy+0x8e>
- 800b6d2: 2900 cmp r1, #0
- 800b6d4: d0fb beq.n 800b6ce <pbuf_copy+0xa>
- 800b6d6: 8902 ldrh r2, [r0, #8]
- 800b6d8: 890b ldrh r3, [r1, #8]
- 800b6da: 429a cmp r2, r3
- 800b6dc: d3f7 bcc.n 800b6ce <pbuf_copy+0xa>
- 800b6de: 2600 movs r6, #0
- 800b6e0: 4637 mov r7, r6
- /* iterate through pbuf chain */
- do
- {
- /* copy one part of the original chain */
- if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
- 800b6e2: f8b4 800a ldrh.w r8, [r4, #10]
- 800b6e6: 896b ldrh r3, [r5, #10]
- len = p_from->len - offset_from;
- } else {
- /* current p_from does not fit into current p_to */
- len = p_to->len - offset_to;
- }
- MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
- 800b6e8: 6861 ldr r1, [r4, #4]
- 800b6ea: 6868 ldr r0, [r5, #4]
- /* iterate through pbuf chain */
- do
- {
- /* copy one part of the original chain */
- if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
- 800b6ec: ebc6 0808 rsb r8, r6, r8
- 800b6f0: 1bdb subs r3, r3, r7
- 800b6f2: 4543 cmp r3, r8
- /* complete current p_from fits into current p_to */
- len = p_from->len - offset_from;
- } else {
- /* current p_from does not fit into current p_to */
- len = p_to->len - offset_to;
- 800b6f4: bfb4 ite lt
- 800b6f6: fa1f f883 uxthlt.w r8, r3
- do
- {
- /* copy one part of the original chain */
- if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
- /* complete current p_from fits into current p_to */
- len = p_from->len - offset_from;
- 800b6fa: fa1f f888 uxthge.w r8, r8
- } else {
- /* current p_from does not fit into current p_to */
- len = p_to->len - offset_to;
- }
- MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
- 800b6fe: 19c0 adds r0, r0, r7
- 800b700: 1989 adds r1, r1, r6
- 800b702: 4642 mov r2, r8
- 800b704: f7fd fe7e bl 8009404 <memcpy>
- offset_to += len;
- offset_from += len;
- 800b708: 4446 add r6, r8
- LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
- LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
- if (offset_from >= p_from->len) {
- 800b70a: 8963 ldrh r3, [r4, #10]
- /* current p_from does not fit into current p_to */
- len = p_to->len - offset_to;
- }
- MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
- offset_to += len;
- offset_from += len;
- 800b70c: b2b6 uxth r6, r6
- LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
- LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
- if (offset_from >= p_from->len) {
- 800b70e: 42b3 cmp r3, r6
- } else {
- /* current p_from does not fit into current p_to */
- len = p_to->len - offset_to;
- }
- MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
- offset_to += len;
- 800b710: 4447 add r7, r8
- if (offset_from >= p_from->len) {
- /* on to next p_from (if any) */
- offset_from = 0;
- p_from = p_from->next;
- }
- if (offset_to == p_to->len) {
- 800b712: 896b ldrh r3, [r5, #10]
- LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
- LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
- if (offset_from >= p_from->len) {
- /* on to next p_from (if any) */
- offset_from = 0;
- p_from = p_from->next;
- 800b714: bf98 it ls
- 800b716: 6824 ldrls r4, [r4, #0]
- } else {
- /* current p_from does not fit into current p_to */
- len = p_to->len - offset_to;
- }
- MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
- offset_to += len;
- 800b718: b2bf uxth r7, r7
- offset_from += len;
- LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
- LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
- if (offset_from >= p_from->len) {
- /* on to next p_from (if any) */
- offset_from = 0;
- 800b71a: bf98 it ls
- 800b71c: 2600 movls r6, #0
- p_from = p_from->next;
- }
- if (offset_to == p_to->len) {
- 800b71e: 42bb cmp r3, r7
- 800b720: d105 bne.n 800b72e <pbuf_copy+0x6a>
- /* on to next p_to (if any) */
- offset_to = 0;
- p_to = p_to->next;
- 800b722: 682d ldr r5, [r5, #0]
- LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
- 800b724: b915 cbnz r5, 800b72c <pbuf_copy+0x68>
- 800b726: 2c00 cmp r4, #0
- 800b728: d1d1 bne.n 800b6ce <pbuf_copy+0xa>
- 800b72a: e00f b.n 800b74c <pbuf_copy+0x88>
- offset_from = 0;
- p_from = p_from->next;
- }
- if (offset_to == p_to->len) {
- /* on to next p_to (if any) */
- offset_to = 0;
- 800b72c: 2700 movs r7, #0
- p_to = p_to->next;
- LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
- }
- if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
- 800b72e: b12c cbz r4, 800b73c <pbuf_copy+0x78>
- 800b730: 8962 ldrh r2, [r4, #10]
- 800b732: 8923 ldrh r3, [r4, #8]
- 800b734: 429a cmp r2, r3
- 800b736: d101 bne.n 800b73c <pbuf_copy+0x78>
- /* don't copy more than one packet! */
- LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
- 800b738: 6823 ldr r3, [r4, #0]
- 800b73a: b94b cbnz r3, 800b750 <pbuf_copy+0x8c>
- (p_from->next == NULL), return ERR_VAL;);
- }
- if((p_to != NULL) && (p_to->len == p_to->tot_len)) {
- 800b73c: 896a ldrh r2, [r5, #10]
- 800b73e: 892b ldrh r3, [r5, #8]
- 800b740: 429a cmp r2, r3
- 800b742: d101 bne.n 800b748 <pbuf_copy+0x84>
- /* don't copy more than one packet! */
- LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
- 800b744: 682b ldr r3, [r5, #0]
- 800b746: b91b cbnz r3, 800b750 <pbuf_copy+0x8c>
- (p_to->next == NULL), return ERR_VAL;);
- }
- } while (p_from);
- 800b748: 2c00 cmp r4, #0
- 800b74a: d1ca bne.n 800b6e2 <pbuf_copy+0x1e>
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n"));
- return ERR_OK;
- 800b74c: 4620 mov r0, r4
- 800b74e: e000 b.n 800b752 <pbuf_copy+0x8e>
- LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;);
- }
- if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
- /* don't copy more than one packet! */
- LWIP_ERROR("pbuf_copy() does not allow packet queues!\n",
- 800b750: 20fa movs r0, #250 ; 0xfa
- (p_to->next == NULL), return ERR_VAL;);
- }
- } while (p_from);
- LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n"));
- return ERR_OK;
- }
- 800b752: b240 sxtb r0, r0
- 800b754: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 0800b758 <pbuf_copy_partial>:
- * @param offset offset into the packet buffer from where to begin copying len bytes
- * @return the number of bytes copied, or 0 on failure
- */
- u16_t
- pbuf_copy_partial(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
- {
- 800b758: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
- 800b75c: 4688 mov r8, r1
- 800b75e: 4616 mov r6, r2
- struct pbuf *p;
- u16_t left;
- u16_t buf_copy_len;
- u16_t copied_total = 0;
- LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
- 800b760: b328 cbz r0, 800b7ae <pbuf_copy_partial+0x56>
- LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;);
- 800b762: b331 cbz r1, 800b7b2 <pbuf_copy_partial+0x5a>
- 800b764: 2400 movs r4, #0
- 800b766: 4605 mov r5, r0
- 800b768: 46a1 mov r9, r4
- 800b76a: e01c b.n 800b7a6 <pbuf_copy_partial+0x4e>
- return 0;
- }
- /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
- for(p = buf; len != 0 && p != NULL; p = p->next) {
- if ((offset != 0) && (offset >= p->len)) {
- 800b76c: b12b cbz r3, 800b77a <pbuf_copy_partial+0x22>
- 800b76e: 896a ldrh r2, [r5, #10]
- 800b770: 4293 cmp r3, r2
- 800b772: d302 bcc.n 800b77a <pbuf_copy_partial+0x22>
- /* don't copy from this buffer -> on to the next */
- offset -= p->len;
- 800b774: 1a9b subs r3, r3, r2
- 800b776: b29b uxth r3, r3
- 800b778: e014 b.n 800b7a4 <pbuf_copy_partial+0x4c>
- } else {
- /* copy from this buffer. maybe only partially. */
- buf_copy_len = p->len - offset;
- 800b77a: 896f ldrh r7, [r5, #10]
- if (buf_copy_len > len)
- buf_copy_len = len;
- /* copy the necessary parts of the buffer */
- MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
- 800b77c: 6869 ldr r1, [r5, #4]
- if ((offset != 0) && (offset >= p->len)) {
- /* don't copy from this buffer -> on to the next */
- offset -= p->len;
- } else {
- /* copy from this buffer. maybe only partially. */
- buf_copy_len = p->len - offset;
- 800b77e: 1aff subs r7, r7, r3
- 800b780: b2bf uxth r7, r7
- 800b782: 42b7 cmp r7, r6
- 800b784: bf28 it cs
- 800b786: 4637 movcs r7, r6
- if (buf_copy_len > len)
- buf_copy_len = len;
- /* copy the necessary parts of the buffer */
- MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
- 800b788: eb08 0009 add.w r0, r8, r9
- 800b78c: 18c9 adds r1, r1, r3
- 800b78e: 463a mov r2, r7
- copied_total += buf_copy_len;
- 800b790: 193c adds r4, r7, r4
- left += buf_copy_len;
- 800b792: 44b9 add r9, r7
- len -= buf_copy_len;
- 800b794: 1bf6 subs r6, r6, r7
- /* copy from this buffer. maybe only partially. */
- buf_copy_len = p->len - offset;
- if (buf_copy_len > len)
- buf_copy_len = len;
- /* copy the necessary parts of the buffer */
- MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len);
- 800b796: f7fd fe35 bl 8009404 <memcpy>
- copied_total += buf_copy_len;
- 800b79a: b2a4 uxth r4, r4
- left += buf_copy_len;
- 800b79c: fa1f f989 uxth.w r9, r9
- len -= buf_copy_len;
- 800b7a0: b2b6 uxth r6, r6
- offset = 0;
- 800b7a2: 2300 movs r3, #0
- if((buf == NULL) || (dataptr == NULL)) {
- return 0;
- }
- /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
- for(p = buf; len != 0 && p != NULL; p = p->next) {
- 800b7a4: 682d ldr r5, [r5, #0]
- 800b7a6: b12e cbz r6, 800b7b4 <pbuf_copy_partial+0x5c>
- 800b7a8: 2d00 cmp r5, #0
- 800b7aa: d1df bne.n 800b76c <pbuf_copy_partial+0x14>
- 800b7ac: e002 b.n 800b7b4 <pbuf_copy_partial+0x5c>
- struct pbuf *p;
- u16_t left;
- u16_t buf_copy_len;
- u16_t copied_total = 0;
- LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
- 800b7ae: 4604 mov r4, r0
- 800b7b0: e000 b.n 800b7b4 <pbuf_copy_partial+0x5c>
- 800b7b2: 460c mov r4, r1
- len -= buf_copy_len;
- offset = 0;
- }
- }
- return copied_total;
- }
- 800b7b4: 4620 mov r0, r4
- 800b7b6: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
- 800b7ba: 0000 movs r0, r0
- 0800b7bc <raw_input>:
- * caller).
- *
- */
- u8_t
- raw_input(struct pbuf *p, struct netif *inp)
- {
- 800b7bc: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- u8_t eaten = 0;
- LWIP_UNUSED_ARG(inp);
- iphdr = (struct ip_hdr *)p->payload;
- proto = IPH_PROTO(iphdr);
- 800b7c0: 6843 ldr r3, [r0, #4]
- /* loop through all raw pcbs until the packet is eaten by one */
- /* this allows multiple pcbs to match against the packet by design */
- while ((eaten == 0) && (pcb != NULL)) {
- if ((pcb->protocol == proto) &&
- (ip_addr_isany(&pcb->local_ip) ||
- ip_addr_cmp(&(pcb->local_ip), ¤t_iphdr_dest))) {
- 800b7c2: f8df a074 ldr.w sl, [pc, #116] ; 800b838 <raw_input+0x7c>
- u8_t eaten = 0;
- LWIP_UNUSED_ARG(inp);
- iphdr = (struct ip_hdr *)p->payload;
- proto = IPH_PROTO(iphdr);
- 800b7c6: f893 9009 ldrb.w r9, [r3, #9]
- prev = NULL;
- pcb = raw_pcbs;
- 800b7ca: 4b19 ldr r3, [pc, #100] ; (800b830 <raw_input+0x74>)
- * caller).
- *
- */
- u8_t
- raw_input(struct pbuf *p, struct netif *inp)
- {
- 800b7cc: 4606 mov r6, r0
- iphdr = (struct ip_hdr *)p->payload;
- proto = IPH_PROTO(iphdr);
- prev = NULL;
- pcb = raw_pcbs;
- 800b7ce: 681c ldr r4, [r3, #0]
- LWIP_UNUSED_ARG(inp);
- iphdr = (struct ip_hdr *)p->payload;
- proto = IPH_PROTO(iphdr);
- prev = NULL;
- 800b7d0: 2500 movs r5, #0
- eaten = 1;
- if (prev != NULL) {
- /* move the pcb to the front of raw_pcbs so that is
- found faster next time */
- prev->next = pcb->next;
- pcb->next = raw_pcbs;
- 800b7d2: 4698 mov r8, r3
- 800b7d4: e023 b.n 800b81e <raw_input+0x62>
- prev = NULL;
- pcb = raw_pcbs;
- /* loop through all raw pcbs until the packet is eaten by one */
- /* this allows multiple pcbs to match against the packet by design */
- while ((eaten == 0) && (pcb != NULL)) {
- if ((pcb->protocol == proto) &&
- 800b7d6: 7c23 ldrb r3, [r4, #16]
- 800b7d8: 454b cmp r3, r9
- 800b7da: d118 bne.n 800b80e <raw_input+0x52>
- (ip_addr_isany(&pcb->local_ip) ||
- 800b7dc: 6823 ldr r3, [r4, #0]
- 800b7de: b11b cbz r3, 800b7e8 <raw_input+0x2c>
- 800b7e0: f8da 2000 ldr.w r2, [sl]
- 800b7e4: 4293 cmp r3, r2
- 800b7e6: d112 bne.n 800b80e <raw_input+0x52>
- /* broadcast filter? */
- if (ip_get_option(pcb, SOF_BROADCAST) || !ip_addr_isbroadcast(¤t_iphdr_dest, inp))
- #endif /* IP_SOF_BROADCAST_RECV */
- {
- /* receive callback function available? */
- if (pcb->recv != NULL) {
- 800b7e8: 6967 ldr r7, [r4, #20]
- 800b7ea: b187 cbz r7, 800b80e <raw_input+0x52>
- /* the receive callback function did not eat the packet? */
- if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
- 800b7ec: 69a0 ldr r0, [r4, #24]
- 800b7ee: 4b11 ldr r3, [pc, #68] ; (800b834 <raw_input+0x78>)
- 800b7f0: 4621 mov r1, r4
- 800b7f2: 4632 mov r2, r6
- 800b7f4: 47b8 blx r7
- 800b7f6: b150 cbz r0, 800b80e <raw_input+0x52>
- /* receive function ate the packet */
- p = NULL;
- eaten = 1;
- if (prev != NULL) {
- 800b7f8: b15d cbz r5, 800b812 <raw_input+0x56>
- /* move the pcb to the front of raw_pcbs so that is
- found faster next time */
- prev->next = pcb->next;
- 800b7fa: 68e3 ldr r3, [r4, #12]
- 800b7fc: 60eb str r3, [r5, #12]
- pcb->next = raw_pcbs;
- 800b7fe: f8d8 3000 ldr.w r3, [r8]
- raw_pcbs = pcb;
- 800b802: f8c8 4000 str.w r4, [r8]
- eaten = 1;
- if (prev != NULL) {
- /* move the pcb to the front of raw_pcbs so that is
- found faster next time */
- prev->next = pcb->next;
- pcb->next = raw_pcbs;
- 800b806: 60e3 str r3, [r4, #12]
- /* receive callback function available? */
- if (pcb->recv != NULL) {
- /* the receive callback function did not eat the packet? */
- if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
- /* receive function ate the packet */
- p = NULL;
- 800b808: 2600 movs r6, #0
- eaten = 1;
- 800b80a: 2301 movs r3, #1
- 800b80c: e003 b.n 800b816 <raw_input+0x5a>
- pcb = raw_pcbs;
- /* loop through all raw pcbs until the packet is eaten by one */
- /* this allows multiple pcbs to match against the packet by design */
- while ((eaten == 0) && (pcb != NULL)) {
- if ((pcb->protocol == proto) &&
- (ip_addr_isany(&pcb->local_ip) ||
- 800b80e: 2300 movs r3, #0
- 800b810: e001 b.n 800b816 <raw_input+0x5a>
- if (pcb->recv != NULL) {
- /* the receive callback function did not eat the packet? */
- if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
- /* receive function ate the packet */
- p = NULL;
- eaten = 1;
- 800b812: 2301 movs r3, #1
- /* receive callback function available? */
- if (pcb->recv != NULL) {
- /* the receive callback function did not eat the packet? */
- if (pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()) != 0) {
- /* receive function ate the packet */
- p = NULL;
- 800b814: 462e mov r6, r5
- /* no receive callback function was set for this raw PCB */
- }
- /* drop the packet */
- }
- prev = pcb;
- pcb = pcb->next;
- 800b816: 68e2 ldr r2, [r4, #12]
- 800b818: 4625 mov r5, r4
- prev = NULL;
- pcb = raw_pcbs;
- /* loop through all raw pcbs until the packet is eaten by one */
- /* this allows multiple pcbs to match against the packet by design */
- while ((eaten == 0) && (pcb != NULL)) {
- 800b81a: b92b cbnz r3, 800b828 <raw_input+0x6c>
- /* no receive callback function was set for this raw PCB */
- }
- /* drop the packet */
- }
- prev = pcb;
- pcb = pcb->next;
- 800b81c: 4614 mov r4, r2
- prev = NULL;
- pcb = raw_pcbs;
- /* loop through all raw pcbs until the packet is eaten by one */
- /* this allows multiple pcbs to match against the packet by design */
- while ((eaten == 0) && (pcb != NULL)) {
- 800b81e: 2c00 cmp r4, #0
- 800b820: d1d9 bne.n 800b7d6 <raw_input+0x1a>
- 800b822: 4620 mov r0, r4
- 800b824: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 800b828: 2001 movs r0, #1
- }
- prev = pcb;
- pcb = pcb->next;
- }
- return eaten;
- }
- 800b82a: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 800b82e: bf00 nop
- 800b830: 20006b78 .word 0x20006b78
- 800b834: 2000835c .word 0x2000835c
- 800b838: 20008364 .word 0x20008364
- 0800b83c <stats_init>:
- #include <string.h>
- struct stats_ lwip_stats;
- void stats_init(void)
- {
- 800b83c: 4770 bx lr
- 0800b83e <tcp_accept_null>:
- LWIP_UNUSED_ARG(arg);
- LWIP_UNUSED_ARG(pcb);
- LWIP_UNUSED_ARG(err);
- return ERR_ABRT;
- }
- 800b83e: f06f 0009 mvn.w r0, #9
- 800b842: 4770 bx lr
- 0800b844 <tcp_new_port>:
- *
- * @return a new (free) local TCP port number
- */
- static u16_t
- tcp_new_port(void)
- {
- 800b844: 4b13 ldr r3, [pc, #76] ; (800b894 <tcp_new_port+0x50>)
- 800b846: b570 push {r4, r5, r6, lr}
- 800b848: 8818 ldrh r0, [r3, #0]
- if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
- tcp_port = TCP_LOCAL_PORT_RANGE_START;
- }
- /* Check all PCB lists. */
- for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
- for(pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
- 800b84a: 4d13 ldr r5, [pc, #76] ; (800b898 <tcp_new_port+0x54>)
- *
- * @return a new (free) local TCP port number
- */
- static u16_t
- tcp_new_port(void)
- {
- 800b84c: f44f 4280 mov.w r2, #16384 ; 0x4000
- u8_t i;
- u16_t n = 0;
- struct tcp_pcb *pcb;
-
- again:
- if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
- 800b850: f64f 74ff movw r4, #65535 ; 0xffff
- 800b854: 42a0 cmp r0, r4
- 800b856: d002 beq.n 800b85e <tcp_new_port+0x1a>
- 800b858: 3001 adds r0, #1
- 800b85a: b280 uxth r0, r0
- 800b85c: e001 b.n 800b862 <tcp_new_port+0x1e>
- tcp_port = TCP_LOCAL_PORT_RANGE_START;
- 800b85e: f44f 4040 mov.w r0, #49152 ; 0xc000
- 800b862: 2300 movs r3, #0
- }
- /* Check all PCB lists. */
- for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
- for(pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
- 800b864: 5959 ldr r1, [r3, r5]
- 800b866: 6809 ldr r1, [r1, #0]
- 800b868: e00b b.n 800b882 <tcp_new_port+0x3e>
- if (pcb->local_port == tcp_port) {
- 800b86a: 8b4e ldrh r6, [r1, #26]
- 800b86c: 4286 cmp r6, r0
- 800b86e: d107 bne.n 800b880 <tcp_new_port+0x3c>
- 800b870: 3a01 subs r2, #1
- 800b872: b292 uxth r2, r2
- if (++n > (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) {
- 800b874: 2a00 cmp r2, #0
- 800b876: d1ed bne.n 800b854 <tcp_new_port+0x10>
- 800b878: 4b06 ldr r3, [pc, #24] ; (800b894 <tcp_new_port+0x50>)
- 800b87a: 8018 strh r0, [r3, #0]
- return 0;
- 800b87c: 4610 mov r0, r2
- 800b87e: bd70 pop {r4, r5, r6, pc}
- if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
- tcp_port = TCP_LOCAL_PORT_RANGE_START;
- }
- /* Check all PCB lists. */
- for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
- for(pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
- 800b880: 68c9 ldr r1, [r1, #12]
- 800b882: 2900 cmp r1, #0
- 800b884: d1f1 bne.n 800b86a <tcp_new_port+0x26>
- 800b886: 3304 adds r3, #4
- again:
- if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
- tcp_port = TCP_LOCAL_PORT_RANGE_START;
- }
- /* Check all PCB lists. */
- for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
- 800b888: 2b10 cmp r3, #16
- 800b88a: d1eb bne.n 800b864 <tcp_new_port+0x20>
- 800b88c: 4b01 ldr r3, [pc, #4] ; (800b894 <tcp_new_port+0x50>)
- 800b88e: 8018 strh r0, [r3, #0]
- goto again;
- }
- }
- }
- return tcp_port;
- }
- 800b890: bd70 pop {r4, r5, r6, pc}
- 800b892: bf00 nop
- 800b894: 20000110 .word 0x20000110
- 800b898: 08011858 .word 0x08011858
- 0800b89c <tcp_init>:
- /**
- * Initialize this module.
- */
- void
- tcp_init(void)
- {
- 800b89c: 4770 bx lr
- 800b89e: 0000 movs r0, r0
- 0800b8a0 <tcp_bind>:
- * ERR_VAL if bind failed because the PCB is not in a valid state
- * ERR_OK if bound
- */
- err_t
- tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- 800b8a0: b5f8 push {r3, r4, r5, r6, r7, lr}
- int i;
- int max_pcb_list = NUM_TCP_PCB_LISTS;
- struct tcp_pcb *cpcb;
- LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);
- 800b8a2: 7e03 ldrb r3, [r0, #24]
- * ERR_VAL if bind failed because the PCB is not in a valid state
- * ERR_OK if bound
- */
- err_t
- tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- 800b8a4: 4604 mov r4, r0
- 800b8a6: 460d mov r5, r1
- int i;
- int max_pcb_list = NUM_TCP_PCB_LISTS;
- struct tcp_pcb *cpcb;
- LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);
- 800b8a8: bb33 cbnz r3, 800b8f8 <tcp_bind+0x58>
- if (ip_get_option(pcb, SOF_REUSEADDR)) {
- max_pcb_list = NUM_TCP_PCB_LISTS_NO_TIME_WAIT;
- }
- #endif /* SO_REUSE */
- if (port == 0) {
- 800b8aa: b91a cbnz r2, 800b8b4 <tcp_bind+0x14>
- port = tcp_new_port();
- 800b8ac: f7ff ffca bl 800b844 <tcp_new_port>
- if (port == 0) {
- 800b8b0: 4602 mov r2, r0
- 800b8b2: b318 cbz r0, 800b8fc <tcp_bind+0x5c>
- }
- }
- /* Check if the address already is in use (on all lists) */
- for (i = 0; i < max_pcb_list; i++) {
- for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
- 800b8b4: 4f14 ldr r7, [pc, #80] ; (800b908 <tcp_bind+0x68>)
- * ERR_VAL if bind failed because the PCB is not in a valid state
- * ERR_OK if bound
- */
- err_t
- tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- 800b8b6: 2100 movs r1, #0
- }
- }
- /* Check if the address already is in use (on all lists) */
- for (i = 0; i < max_pcb_list; i++) {
- for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
- 800b8b8: 59cb ldr r3, [r1, r7]
- 800b8ba: 681b ldr r3, [r3, #0]
- 800b8bc: e00a b.n 800b8d4 <tcp_bind+0x34>
- if (cpcb->local_port == port) {
- 800b8be: 8b58 ldrh r0, [r3, #26]
- 800b8c0: 4290 cmp r0, r2
- 800b8c2: d106 bne.n 800b8d2 <tcp_bind+0x32>
- tcp_connect. */
- if (!ip_get_option(pcb, SOF_REUSEADDR) ||
- !ip_get_option(cpcb, SOF_REUSEADDR))
- #endif /* SO_REUSE */
- {
- if (ip_addr_isany(&(cpcb->local_ip)) ||
- 800b8c4: 681e ldr r6, [r3, #0]
- 800b8c6: b1de cbz r6, 800b900 <tcp_bind+0x60>
- 800b8c8: b1d5 cbz r5, 800b900 <tcp_bind+0x60>
- ip_addr_isany(ipaddr) ||
- 800b8ca: 6828 ldr r0, [r5, #0]
- 800b8cc: b1c0 cbz r0, 800b900 <tcp_bind+0x60>
- 800b8ce: 4286 cmp r6, r0
- 800b8d0: d016 beq.n 800b900 <tcp_bind+0x60>
- }
- }
- /* Check if the address already is in use (on all lists) */
- for (i = 0; i < max_pcb_list; i++) {
- for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
- 800b8d2: 68db ldr r3, [r3, #12]
- 800b8d4: 2b00 cmp r3, #0
- 800b8d6: d1f2 bne.n 800b8be <tcp_bind+0x1e>
- 800b8d8: 3104 adds r1, #4
- return ERR_BUF;
- }
- }
- /* Check if the address already is in use (on all lists) */
- for (i = 0; i < max_pcb_list; i++) {
- 800b8da: 2910 cmp r1, #16
- 800b8dc: d1ec bne.n 800b8b8 <tcp_bind+0x18>
- }
- }
- }
- }
- if (!ip_addr_isany(ipaddr)) {
- 800b8de: b115 cbz r5, 800b8e6 <tcp_bind+0x46>
- 800b8e0: 682b ldr r3, [r5, #0]
- 800b8e2: b103 cbz r3, 800b8e6 <tcp_bind+0x46>
- pcb->local_ip = *ipaddr;
- 800b8e4: 6023 str r3, [r4, #0]
- }
- pcb->local_port = port;
- TCP_REG(&tcp_bound_pcbs, pcb);
- 800b8e6: 4b09 ldr r3, [pc, #36] ; (800b90c <tcp_bind+0x6c>)
- }
- if (!ip_addr_isany(ipaddr)) {
- pcb->local_ip = *ipaddr;
- }
- pcb->local_port = port;
- 800b8e8: 8362 strh r2, [r4, #26]
- TCP_REG(&tcp_bound_pcbs, pcb);
- 800b8ea: 681a ldr r2, [r3, #0]
- 800b8ec: 601c str r4, [r3, #0]
- 800b8ee: 60e2 str r2, [r4, #12]
- 800b8f0: f002 f9a2 bl 800dc38 <tcp_timer_needed>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port));
- return ERR_OK;
- 800b8f4: 2000 movs r0, #0
- 800b8f6: e004 b.n 800b902 <tcp_bind+0x62>
- {
- int i;
- int max_pcb_list = NUM_TCP_PCB_LISTS;
- struct tcp_pcb *cpcb;
- LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);
- 800b8f8: 20fa movs r0, #250 ; 0xfa
- 800b8fa: e002 b.n 800b902 <tcp_bind+0x62>
- #endif /* SO_REUSE */
- if (port == 0) {
- port = tcp_new_port();
- if (port == 0) {
- return ERR_BUF;
- 800b8fc: 20fe movs r0, #254 ; 0xfe
- 800b8fe: e000 b.n 800b902 <tcp_bind+0x62>
- #endif /* SO_REUSE */
- {
- if (ip_addr_isany(&(cpcb->local_ip)) ||
- ip_addr_isany(ipaddr) ||
- ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {
- return ERR_USE;
- 800b900: 20f8 movs r0, #248 ; 0xf8
- }
- pcb->local_port = port;
- TCP_REG(&tcp_bound_pcbs, pcb);
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port));
- return ERR_OK;
- }
- 800b902: b240 sxtb r0, r0
- 800b904: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 800b906: bf00 nop
- 800b908: 08011858 .word 0x08011858
- 800b90c: 2000834c .word 0x2000834c
- 0800b910 <tcp_listen_with_backlog>:
- * called like this:
- * tpcb = tcp_listen(tpcb);
- */
- struct tcp_pcb *
- tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
- {
- 800b910: b538 push {r3, r4, r5, lr}
- struct tcp_pcb_listen *lpcb;
- LWIP_UNUSED_ARG(backlog);
- LWIP_ERROR("tcp_listen: pcb already connected", pcb->state == CLOSED, return NULL);
- 800b912: 7e03 ldrb r3, [r0, #24]
- * called like this:
- * tpcb = tcp_listen(tpcb);
- */
- struct tcp_pcb *
- tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
- {
- 800b914: 4604 mov r4, r0
- struct tcp_pcb_listen *lpcb;
- LWIP_UNUSED_ARG(backlog);
- LWIP_ERROR("tcp_listen: pcb already connected", pcb->state == CLOSED, return NULL);
- 800b916: b10b cbz r3, 800b91c <tcp_listen_with_backlog+0xc>
- 800b918: 2000 movs r0, #0
- 800b91a: bd38 pop {r3, r4, r5, pc}
- }
- }
- }
- }
- #endif /* SO_REUSE */
- lpcb = (struct tcp_pcb_listen *)memp_malloc(MEMP_TCP_PCB_LISTEN);
- 800b91c: 2003 movs r0, #3
- 800b91e: f7ff fcaf bl 800b280 <memp_malloc>
- if (lpcb == NULL) {
- 800b922: 4605 mov r5, r0
- 800b924: 2800 cmp r0, #0
- 800b926: d0f7 beq.n 800b918 <tcp_listen_with_backlog+0x8>
- return NULL;
- }
- lpcb->callback_arg = pcb->callback_arg;
- 800b928: 6923 ldr r3, [r4, #16]
- 800b92a: 6103 str r3, [r0, #16]
- lpcb->local_port = pcb->local_port;
- 800b92c: 8b63 ldrh r3, [r4, #26]
- 800b92e: 8343 strh r3, [r0, #26]
- lpcb->state = LISTEN;
- 800b930: 2301 movs r3, #1
- 800b932: 7603 strb r3, [r0, #24]
- lpcb->prio = pcb->prio;
- 800b934: 7e63 ldrb r3, [r4, #25]
- 800b936: 7643 strb r3, [r0, #25]
- lpcb->so_options = pcb->so_options;
- ip_set_option(lpcb, SOF_ACCEPTCONN);
- 800b938: 7a23 ldrb r3, [r4, #8]
- 800b93a: f043 0302 orr.w r3, r3, #2
- 800b93e: 7203 strb r3, [r0, #8]
- lpcb->ttl = pcb->ttl;
- 800b940: 7aa3 ldrb r3, [r4, #10]
- 800b942: 7283 strb r3, [r0, #10]
- lpcb->tos = pcb->tos;
- 800b944: 7a63 ldrb r3, [r4, #9]
- 800b946: 7243 strb r3, [r0, #9]
- ip_addr_copy(lpcb->local_ip, pcb->local_ip);
- 800b948: 6823 ldr r3, [r4, #0]
- 800b94a: 6003 str r3, [r0, #0]
- if (pcb->local_port != 0) {
- 800b94c: 8b63 ldrh r3, [r4, #26]
- 800b94e: b1ab cbz r3, 800b97c <tcp_listen_with_backlog+0x6c>
- TCP_RMV(&tcp_bound_pcbs, pcb);
- 800b950: 4a11 ldr r2, [pc, #68] ; (800b998 <tcp_listen_with_backlog+0x88>)
- 800b952: 6813 ldr r3, [r2, #0]
- 800b954: 42a3 cmp r3, r4
- 800b956: d101 bne.n 800b95c <tcp_listen_with_backlog+0x4c>
- 800b958: 68e3 ldr r3, [r4, #12]
- 800b95a: e00c b.n 800b976 <tcp_listen_with_backlog+0x66>
- 800b95c: 4a0f ldr r2, [pc, #60] ; (800b99c <tcp_listen_with_backlog+0x8c>)
- 800b95e: 6013 str r3, [r2, #0]
- 800b960: e007 b.n 800b972 <tcp_listen_with_backlog+0x62>
- 800b962: 68d9 ldr r1, [r3, #12]
- 800b964: 42a1 cmp r1, r4
- 800b966: d103 bne.n 800b970 <tcp_listen_with_backlog+0x60>
- 800b968: 6013 str r3, [r2, #0]
- 800b96a: 68e2 ldr r2, [r4, #12]
- 800b96c: 60da str r2, [r3, #12]
- 800b96e: e003 b.n 800b978 <tcp_listen_with_backlog+0x68>
- 800b970: 460b mov r3, r1
- 800b972: 2b00 cmp r3, #0
- 800b974: d1f5 bne.n 800b962 <tcp_listen_with_backlog+0x52>
- 800b976: 6013 str r3, [r2, #0]
- 800b978: 2300 movs r3, #0
- 800b97a: 60e3 str r3, [r4, #12]
- }
- memp_free(MEMP_TCP_PCB, pcb);
- 800b97c: 2002 movs r0, #2
- 800b97e: 4621 mov r1, r4
- 800b980: f7ff fca8 bl 800b2d4 <memp_free>
- #if LWIP_CALLBACK_API
- lpcb->accept = tcp_accept_null;
- 800b984: 4b06 ldr r3, [pc, #24] ; (800b9a0 <tcp_listen_with_backlog+0x90>)
- 800b986: 616b str r3, [r5, #20]
- #endif /* LWIP_CALLBACK_API */
- #if TCP_LISTEN_BACKLOG
- lpcb->accepts_pending = 0;
- lpcb->backlog = (backlog ? backlog : 1);
- #endif /* TCP_LISTEN_BACKLOG */
- TCP_REG(&tcp_listen_pcbs.pcbs, (struct tcp_pcb *)lpcb);
- 800b988: 4b06 ldr r3, [pc, #24] ; (800b9a4 <tcp_listen_with_backlog+0x94>)
- 800b98a: 681a ldr r2, [r3, #0]
- 800b98c: 601d str r5, [r3, #0]
- 800b98e: 60ea str r2, [r5, #12]
- 800b990: f002 f952 bl 800dc38 <tcp_timer_needed>
- return (struct tcp_pcb *)lpcb;
- 800b994: 4628 mov r0, r5
- }
- 800b996: bd38 pop {r3, r4, r5, pc}
- 800b998: 2000834c .word 0x2000834c
- 800b99c: 20008348 .word 0x20008348
- 800b9a0: 0800b83f .word 0x0800b83f
- 800b9a4: 20008344 .word 0x20008344
- 0800b9a8 <tcp_update_rcv_ann_wnd>:
- *
- * Returns how much extra window would be advertised if we sent an
- * update now.
- */
- u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
- {
- 800b9a8: b530 push {r4, r5, lr}
- u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
- if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
- 800b9aa: 6b01 ldr r1, [r0, #48] ; 0x30
- * Returns how much extra window would be advertised if we sent an
- * update now.
- */
- u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
- {
- u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
- 800b9ac: 8d84 ldrh r4, [r0, #44] ; 0x2c
- if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
- 800b9ae: 8ec5 ldrh r5, [r0, #54] ; 0x36
- * Returns how much extra window would be advertised if we sent an
- * update now.
- */
- u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
- {
- u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
- 800b9b0: 6a82 ldr r2, [r0, #40] ; 0x28
- *
- * Returns how much extra window would be advertised if we sent an
- * update now.
- */
- u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
- {
- 800b9b2: 4603 mov r3, r0
- u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
- if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
- 800b9b4: f640 3068 movw r0, #2920 ; 0xb68
- 800b9b8: 4285 cmp r5, r0
- 800b9ba: bf28 it cs
- 800b9bc: 4605 movcs r5, r0
- * Returns how much extra window would be advertised if we sent an
- * update now.
- */
- u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
- {
- u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;
- 800b9be: 1a60 subs r0, r4, r1
- if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
- 800b9c0: 1880 adds r0, r0, r2
- 800b9c2: 1b45 subs r5, r0, r5
- 800b9c4: 2d00 cmp r5, #0
- 800b9c6: db01 blt.n 800b9cc <tcp_update_rcv_ann_wnd+0x24>
- /* we can advertise more window */
- pcb->rcv_ann_wnd = pcb->rcv_wnd;
- 800b9c8: 85dc strh r4, [r3, #46] ; 0x2e
- return new_right_edge - pcb->rcv_ann_right_edge;
- 800b9ca: bd30 pop {r4, r5, pc}
- } else {
- if (TCP_SEQ_GT(pcb->rcv_nxt, pcb->rcv_ann_right_edge)) {
- 800b9cc: 1a50 subs r0, r2, r1
- 800b9ce: 2800 cmp r0, #0
- 800b9d0: f04f 0000 mov.w r0, #0
- 800b9d4: dd01 ble.n 800b9da <tcp_update_rcv_ann_wnd+0x32>
- /* Can happen due to other end sending out of advertised window,
- * but within actual available (but not yet advertised) window */
- pcb->rcv_ann_wnd = 0;
- 800b9d6: 85d8 strh r0, [r3, #46] ; 0x2e
- 800b9d8: bd30 pop {r4, r5, pc}
- } else {
- /* keep the right edge of window constant */
- u32_t new_rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt;
- 800b9da: 1a8a subs r2, r1, r2
- LWIP_ASSERT("new_rcv_ann_wnd <= 0xffff", new_rcv_ann_wnd <= 0xffff);
- pcb->rcv_ann_wnd = (u16_t)new_rcv_ann_wnd;
- 800b9dc: 85da strh r2, [r3, #46] ; 0x2e
- }
- return 0;
- }
- }
- 800b9de: bd30 pop {r4, r5, pc}
- 0800b9e0 <tcp_recved>:
- LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
- pcb->state != LISTEN);
- LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n",
- len <= 0xffff - pcb->rcv_wnd );
- pcb->rcv_wnd += len;
- 800b9e0: 8d83 ldrh r3, [r0, #44] ; 0x2c
- 800b9e2: 18c9 adds r1, r1, r3
- 800b9e4: b289 uxth r1, r1
- if (pcb->rcv_wnd > TCP_WND) {
- 800b9e6: f241 63d0 movw r3, #5840 ; 0x16d0
- 800b9ea: 4299 cmp r1, r3
- * @param pcb the tcp_pcb for which data is read
- * @param len the amount of bytes that have been read by the application
- */
- void
- tcp_recved(struct tcp_pcb *pcb, u16_t len)
- {
- 800b9ec: b510 push {r4, lr}
- LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n",
- len <= 0xffff - pcb->rcv_wnd );
- pcb->rcv_wnd += len;
- if (pcb->rcv_wnd > TCP_WND) {
- pcb->rcv_wnd = TCP_WND;
- 800b9ee: bf8c ite hi
- 800b9f0: 8583 strhhi r3, [r0, #44] ; 0x2c
- LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
- pcb->state != LISTEN);
- LWIP_ASSERT("tcp_recved: len would wrap rcv_wnd\n",
- len <= 0xffff - pcb->rcv_wnd );
- pcb->rcv_wnd += len;
- 800b9f2: 8581 strhls r1, [r0, #44] ; 0x2c
- * @param pcb the tcp_pcb for which data is read
- * @param len the amount of bytes that have been read by the application
- */
- void
- tcp_recved(struct tcp_pcb *pcb, u16_t len)
- {
- 800b9f4: 4604 mov r4, r0
- pcb->rcv_wnd += len;
- if (pcb->rcv_wnd > TCP_WND) {
- pcb->rcv_wnd = TCP_WND;
- }
- wnd_inflation = tcp_update_rcv_ann_wnd(pcb);
- 800b9f6: f7ff ffd7 bl 800b9a8 <tcp_update_rcv_ann_wnd>
- /* If the change in the right edge of window is significant (default
- * watermark is TCP_WND/4), then send an explicit update now.
- * Otherwise wait for a packet to be sent in the normal course of
- * events (or more window to be available later) */
- if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
- 800b9fa: f240 53b3 movw r3, #1459 ; 0x5b3
- 800b9fe: 4298 cmp r0, r3
- 800ba00: dd08 ble.n 800ba14 <tcp_recved+0x34>
- tcp_ack_now(pcb);
- 800ba02: 7fa3 ldrb r3, [r4, #30]
- tcp_output(pcb);
- 800ba04: 4620 mov r0, r4
- /* If the change in the right edge of window is significant (default
- * watermark is TCP_WND/4), then send an explicit update now.
- * Otherwise wait for a packet to be sent in the normal course of
- * events (or more window to be available later) */
- if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
- tcp_ack_now(pcb);
- 800ba06: f043 0302 orr.w r3, r3, #2
- 800ba0a: 77a3 strb r3, [r4, #30]
- tcp_output(pcb);
- }
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n",
- len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd));
- }
- 800ba0c: e8bd 4010 ldmia.w sp!, {r4, lr}
- * watermark is TCP_WND/4), then send an explicit update now.
- * Otherwise wait for a packet to be sent in the normal course of
- * events (or more window to be available later) */
- if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
- tcp_ack_now(pcb);
- tcp_output(pcb);
- 800ba10: f001 be10 b.w 800d634 <tcp_output>
- 800ba14: bd10 pop {r4, pc}
- 0800ba16 <tcp_seg_free>:
- *
- * @param seg single tcp_seg to free
- */
- void
- tcp_seg_free(struct tcp_seg *seg)
- {
- 800ba16: b510 push {r4, lr}
- if (seg != NULL) {
- 800ba18: 4604 mov r4, r0
- 800ba1a: b158 cbz r0, 800ba34 <tcp_seg_free+0x1e>
- if (seg->p != NULL) {
- 800ba1c: 6840 ldr r0, [r0, #4]
- 800ba1e: b118 cbz r0, 800ba28 <tcp_seg_free+0x12>
- pbuf_free(seg->p);
- 800ba20: f7ff fd50 bl 800b4c4 <pbuf_free>
- #if TCP_DEBUG
- seg->p = NULL;
- 800ba24: 2300 movs r3, #0
- 800ba26: 6063 str r3, [r4, #4]
- #endif /* TCP_DEBUG */
- }
- memp_free(MEMP_TCP_SEG, seg);
- 800ba28: 2004 movs r0, #4
- 800ba2a: 4621 mov r1, r4
- }
- }
- 800ba2c: e8bd 4010 ldmia.w sp!, {r4, lr}
- pbuf_free(seg->p);
- #if TCP_DEBUG
- seg->p = NULL;
- #endif /* TCP_DEBUG */
- }
- memp_free(MEMP_TCP_SEG, seg);
- 800ba30: f7ff bc50 b.w 800b2d4 <memp_free>
- 800ba34: bd10 pop {r4, pc}
- 0800ba36 <tcp_segs_free>:
- *
- * @param seg tcp_seg list of TCP segments to free
- */
- void
- tcp_segs_free(struct tcp_seg *seg)
- {
- 800ba36: b510 push {r4, lr}
- while (seg != NULL) {
- 800ba38: e003 b.n 800ba42 <tcp_segs_free+0xc>
- struct tcp_seg *next = seg->next;
- 800ba3a: 6804 ldr r4, [r0, #0]
- tcp_seg_free(seg);
- 800ba3c: f7ff ffeb bl 800ba16 <tcp_seg_free>
- seg = next;
- 800ba40: 4620 mov r0, r4
- * @param seg tcp_seg list of TCP segments to free
- */
- void
- tcp_segs_free(struct tcp_seg *seg)
- {
- while (seg != NULL) {
- 800ba42: 2800 cmp r0, #0
- 800ba44: d1f9 bne.n 800ba3a <tcp_segs_free+0x4>
- struct tcp_seg *next = seg->next;
- tcp_seg_free(seg);
- seg = next;
- }
- }
- 800ba46: bd10 pop {r4, pc}
- 0800ba48 <tcp_arg>:
- void
- tcp_arg(struct tcp_pcb *pcb, void *arg)
- {
- /* This function is allowed to be called for both listen pcbs and
- connection pcbs. */
- pcb->callback_arg = arg;
- 800ba48: 6101 str r1, [r0, #16]
- 800ba4a: 4770 bx lr
- 0800ba4c <tcp_recv>:
- */
- void
- tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv)
- {
- LWIP_ASSERT("invalid socket state for recv callback", pcb->state != LISTEN);
- pcb->recv = recv;
- 800ba4c: 67c1 str r1, [r0, #124] ; 0x7c
- 800ba4e: 4770 bx lr
- 0800ba50 <tcp_sent>:
- */
- void
- tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent)
- {
- LWIP_ASSERT("invalid socket state for sent callback", pcb->state != LISTEN);
- pcb->sent = sent;
- 800ba50: 6781 str r1, [r0, #120] ; 0x78
- 800ba52: 4770 bx lr
- 0800ba54 <tcp_err>:
- */
- void
- tcp_err(struct tcp_pcb *pcb, tcp_err_fn err)
- {
- LWIP_ASSERT("invalid socket state for err callback", pcb->state != LISTEN);
- pcb->errf = err;
- 800ba54: f8c0 1088 str.w r1, [r0, #136] ; 0x88
- 800ba58: 4770 bx lr
- 0800ba5a <tcp_accept>:
- void
- tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept)
- {
- /* This function is allowed to be called for both listen pcbs and
- connection pcbs. */
- pcb->accept = accept;
- 800ba5a: 6141 str r1, [r0, #20]
- 800ba5c: 4770 bx lr
- 0800ba5e <tcp_poll>:
- void
- tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval)
- {
- LWIP_ASSERT("invalid socket state for poll", pcb->state != LISTEN);
- #if LWIP_CALLBACK_API
- pcb->poll = poll;
- 800ba5e: f8c0 1084 str.w r1, [r0, #132] ; 0x84
- #else /* LWIP_CALLBACK_API */
- LWIP_UNUSED_ARG(poll);
- #endif /* LWIP_CALLBACK_API */
- pcb->pollinterval = interval;
- 800ba62: f880 2020 strb.w r2, [r0, #32]
- 800ba66: 4770 bx lr
- 0800ba68 <tcp_pcb_purge>:
- * @param pcb tcp_pcb to purge. The pcb itself is not deallocated!
- */
- void
- tcp_pcb_purge(struct tcp_pcb *pcb)
- {
- if (pcb->state != CLOSED &&
- 800ba68: 7e03 ldrb r3, [r0, #24]
- *
- * @param pcb tcp_pcb to purge. The pcb itself is not deallocated!
- */
- void
- tcp_pcb_purge(struct tcp_pcb *pcb)
- {
- 800ba6a: b510 push {r4, lr}
- 800ba6c: 4604 mov r4, r0
- if (pcb->state != CLOSED &&
- 800ba6e: b1bb cbz r3, 800baa0 <tcp_pcb_purge+0x38>
- 800ba70: 2b0a cmp r3, #10
- 800ba72: d015 beq.n 800baa0 <tcp_pcb_purge+0x38>
- pcb->state != TIME_WAIT &&
- 800ba74: 2b01 cmp r3, #1
- 800ba76: d013 beq.n 800baa0 <tcp_pcb_purge+0x38>
- }
- }
- #endif /* TCP_LISTEN_BACKLOG */
- if (pcb->refused_data != NULL) {
- 800ba78: 6f40 ldr r0, [r0, #116] ; 0x74
- 800ba7a: b118 cbz r0, 800ba84 <tcp_pcb_purge+0x1c>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->refused_data\n"));
- pbuf_free(pcb->refused_data);
- 800ba7c: f7ff fd22 bl 800b4c4 <pbuf_free>
- pcb->refused_data = NULL;
- 800ba80: 2300 movs r3, #0
- 800ba82: 6763 str r3, [r4, #116] ; 0x74
- pcb->ooseq = NULL;
- #endif /* TCP_QUEUE_OOSEQ */
- /* Stop the retransmission timer as it will expect data on unacked
- queue if it fires */
- pcb->rtime = -1;
- 800ba84: f64f 73ff movw r3, #65535 ; 0xffff
- 800ba88: 86a3 strh r3, [r4, #52] ; 0x34
- tcp_segs_free(pcb->unsent);
- 800ba8a: 6ee0 ldr r0, [r4, #108] ; 0x6c
- 800ba8c: f7ff ffd3 bl 800ba36 <tcp_segs_free>
- tcp_segs_free(pcb->unacked);
- 800ba90: 6f20 ldr r0, [r4, #112] ; 0x70
- 800ba92: f7ff ffd0 bl 800ba36 <tcp_segs_free>
- pcb->unacked = pcb->unsent = NULL;
- 800ba96: 2300 movs r3, #0
- 800ba98: 66e3 str r3, [r4, #108] ; 0x6c
- 800ba9a: 6723 str r3, [r4, #112] ; 0x70
- #if TCP_OVERSIZE
- pcb->unsent_oversize = 0;
- 800ba9c: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
- 800baa0: bd10 pop {r4, pc}
- 800baa2: 0000 movs r0, r0
- 0800baa4 <tcp_slowtmr>:
- u8_t pcb_reset; /* flag if a RST should be sent when removing */
- err_t err;
- err = ERR_OK;
- ++tcp_ticks;
- 800baa4: 4b9c ldr r3, [pc, #624] ; (800bd18 <tcp_slowtmr+0x274>)
- *
- * Automatically called from tcp_tmr().
- */
- void
- tcp_slowtmr(void)
- {
- 800baa6: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- u8_t pcb_reset; /* flag if a RST should be sent when removing */
- err_t err;
- err = ERR_OK;
- ++tcp_ticks;
- 800baaa: 681a ldr r2, [r3, #0]
- err_arg = pcb->callback_arg;
- pcb2 = pcb;
- pcb = pcb->next;
- memp_free(MEMP_TCP_PCB, pcb2);
- tcp_active_pcbs_changed = 0;
- 800baac: f8df 8284 ldr.w r8, [pc, #644] ; 800bd34 <tcp_slowtmr+0x290>
- u8_t pcb_reset; /* flag if a RST should be sent when removing */
- err_t err;
- err = ERR_OK;
- ++tcp_ticks;
- 800bab0: 3201 adds r2, #1
- 800bab2: 601a str r2, [r3, #0]
- ++tcp_timer_ctr;
- 800bab4: 4b99 ldr r3, [pc, #612] ; (800bd1c <tcp_slowtmr+0x278>)
- 800bab6: 781a ldrb r2, [r3, #0]
- 800bab8: 3201 adds r2, #1
- 800baba: 701a strb r2, [r3, #0]
- 800babc: 46c1 mov r9, r8
- tcp_slowtmr_start:
- /* Steps through all of the active PCBs. */
- prev = NULL;
- pcb = tcp_active_pcbs;
- 800babe: 4b98 ldr r3, [pc, #608] ; (800bd20 <tcp_slowtmr+0x27c>)
- while (pcb != NULL) {
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n"));
- LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN);
- LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT);
- if (pcb->last_timer == tcp_timer_ctr) {
- 800bac0: f8df a258 ldr.w sl, [pc, #600] ; 800bd1c <tcp_slowtmr+0x278>
- ++tcp_timer_ctr;
- tcp_slowtmr_start:
- /* Steps through all of the active PCBs. */
- prev = NULL;
- pcb = tcp_active_pcbs;
- 800bac4: 681c ldr r4, [r3, #0]
- ++tcp_ticks;
- ++tcp_timer_ctr;
- tcp_slowtmr_start:
- /* Steps through all of the active PCBs. */
- prev = NULL;
- 800bac6: 2600 movs r6, #0
- pcb = tcp_active_pcbs;
- if (pcb == NULL) {
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
- }
- while (pcb != NULL) {
- 800bac8: e0ff b.n 800bcca <tcp_slowtmr+0x226>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n"));
- LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN);
- LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT);
- if (pcb->last_timer == tcp_timer_ctr) {
- 800baca: f89a 3000 ldrb.w r3, [sl]
- 800bace: f894 2021 ldrb.w r2, [r4, #33] ; 0x21
- 800bad2: 429a cmp r2, r3
- 800bad4: d101 bne.n 800bada <tcp_slowtmr+0x36>
- /* skip this pcb, we have already processed it */
- pcb = pcb->next;
- 800bad6: 68e7 ldr r7, [r4, #12]
- continue;
- 800bad8: e0f6 b.n 800bcc8 <tcp_slowtmr+0x224>
- pcb->last_timer = tcp_timer_ctr;
- pcb_remove = 0;
- pcb_reset = 0;
- if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
- 800bada: 7e21 ldrb r1, [r4, #24]
- if (pcb->last_timer == tcp_timer_ctr) {
- /* skip this pcb, we have already processed it */
- pcb = pcb->next;
- continue;
- }
- pcb->last_timer = tcp_timer_ctr;
- 800badc: f884 3021 strb.w r3, [r4, #33] ; 0x21
- pcb_remove = 0;
- pcb_reset = 0;
- if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
- 800bae0: 2902 cmp r1, #2
- 800bae2: f894 2046 ldrb.w r2, [r4, #70] ; 0x46
- 800bae6: d101 bne.n 800baec <tcp_slowtmr+0x48>
- 800bae8: 2a06 cmp r2, #6
- 800baea: d051 beq.n 800bb90 <tcp_slowtmr+0xec>
- ++pcb_remove;
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n"));
- }
- else if (pcb->nrtx == TCP_MAXRTX) {
- 800baec: 2a0c cmp r2, #12
- 800baee: d04f beq.n 800bb90 <tcp_slowtmr+0xec>
- ++pcb_remove;
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
- } else {
- if (pcb->persist_backoff > 0) {
- 800baf0: f894 3091 ldrb.w r3, [r4, #145] ; 0x91
- 800baf4: b1c3 cbz r3, 800bb28 <tcp_slowtmr+0x84>
- /* If snd_wnd is zero, use persist timer to send 1 byte probes
- * instead of using the standard retransmission mechanism. */
- pcb->persist_cnt++;
- if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
- 800baf6: 498b ldr r1, [pc, #556] ; (800bd24 <tcp_slowtmr+0x280>)
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
- } else {
- if (pcb->persist_backoff > 0) {
- /* If snd_wnd is zero, use persist timer to send 1 byte probes
- * instead of using the standard retransmission mechanism. */
- pcb->persist_cnt++;
- 800baf8: f894 2090 ldrb.w r2, [r4, #144] ; 0x90
- if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
- 800bafc: 18c9 adds r1, r1, r3
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
- } else {
- if (pcb->persist_backoff > 0) {
- /* If snd_wnd is zero, use persist timer to send 1 byte probes
- * instead of using the standard retransmission mechanism. */
- pcb->persist_cnt++;
- 800bafe: 3201 adds r2, #1
- if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
- 800bb00: f811 1c01 ldrb.w r1, [r1, #-1]
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
- } else {
- if (pcb->persist_backoff > 0) {
- /* If snd_wnd is zero, use persist timer to send 1 byte probes
- * instead of using the standard retransmission mechanism. */
- pcb->persist_cnt++;
- 800bb04: b2d2 uxtb r2, r2
- if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
- 800bb06: 4291 cmp r1, r2
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
- } else {
- if (pcb->persist_backoff > 0) {
- /* If snd_wnd is zero, use persist timer to send 1 byte probes
- * instead of using the standard retransmission mechanism. */
- pcb->persist_cnt++;
- 800bb08: f884 2090 strb.w r2, [r4, #144] ; 0x90
- if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
- 800bb0c: d900 bls.n 800bb10 <tcp_slowtmr+0x6c>
- 800bb0e: e03d b.n 800bb8c <tcp_slowtmr+0xe8>
- pcb->persist_cnt = 0;
- 800bb10: 2200 movs r2, #0
- if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) {
- 800bb12: 2b06 cmp r3, #6
- if (pcb->persist_backoff > 0) {
- /* If snd_wnd is zero, use persist timer to send 1 byte probes
- * instead of using the standard retransmission mechanism. */
- pcb->persist_cnt++;
- if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
- pcb->persist_cnt = 0;
- 800bb14: f884 2090 strb.w r2, [r4, #144] ; 0x90
- if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) {
- 800bb18: d802 bhi.n 800bb20 <tcp_slowtmr+0x7c>
- pcb->persist_backoff++;
- 800bb1a: 3301 adds r3, #1
- 800bb1c: f884 3091 strb.w r3, [r4, #145] ; 0x91
- }
- tcp_zero_window_probe(pcb);
- 800bb20: 4620 mov r0, r4
- 800bb22: f001 ffa5 bl 800da70 <tcp_zero_window_probe>
- 800bb26: e031 b.n 800bb8c <tcp_slowtmr+0xe8>
- }
- } else {
- /* Increase the retransmission timer if it is running */
- if(pcb->rtime >= 0) {
- 800bb28: 8ea3 ldrh r3, [r4, #52] ; 0x34
- 800bb2a: 0418 lsls r0, r3, #16
- 800bb2c: d401 bmi.n 800bb32 <tcp_slowtmr+0x8e>
- ++pcb->rtime;
- 800bb2e: 3301 adds r3, #1
- 800bb30: 86a3 strh r3, [r4, #52] ; 0x34
- }
- if (pcb->unacked != NULL && pcb->rtime >= pcb->rto) {
- 800bb32: 6f23 ldr r3, [r4, #112] ; 0x70
- 800bb34: b353 cbz r3, 800bb8c <tcp_slowtmr+0xe8>
- 800bb36: f9b4 0034 ldrsh.w r0, [r4, #52] ; 0x34
- 800bb3a: f9b4 3044 ldrsh.w r3, [r4, #68] ; 0x44
- 800bb3e: 4298 cmp r0, r3
- 800bb40: db24 blt.n 800bb8c <tcp_slowtmr+0xe8>
- " pcb->rto %"S16_F"\n",
- pcb->rtime, pcb->rto));
- /* Double retransmission time-out unless we are trying to
- * connect to somebody (i.e., we are in SYN_SENT). */
- if (pcb->state != SYN_SENT) {
- 800bb42: 2902 cmp r1, #2
- 800bb44: d00b beq.n 800bb5e <tcp_slowtmr+0xba>
- pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx];
- 800bb46: f9b4 1040 ldrsh.w r1, [r4, #64] ; 0x40
- 800bb4a: f9b4 3042 ldrsh.w r3, [r4, #66] ; 0x42
- 800bb4e: eb03 03e1 add.w r3, r3, r1, asr #3
- 800bb52: 4975 ldr r1, [pc, #468] ; (800bd28 <tcp_slowtmr+0x284>)
- 800bb54: 5c8a ldrb r2, [r1, r2]
- 800bb56: fa03 f302 lsl.w r3, r3, r2
- 800bb5a: f8a4 3044 strh.w r3, [r4, #68] ; 0x44
- }
- /* Reset the retransmission timer. */
- pcb->rtime = 0;
- 800bb5e: 2300 movs r3, #0
- /* Reduce congestion window and ssthresh. */
- eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
- 800bb60: f8b4 104c ldrh.w r1, [r4, #76] ; 0x4c
- if (pcb->state != SYN_SENT) {
- pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx];
- }
- /* Reset the retransmission timer. */
- pcb->rtime = 0;
- 800bb64: 86a3 strh r3, [r4, #52] ; 0x34
- /* Reduce congestion window and ssthresh. */
- eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
- 800bb66: f8b4 3060 ldrh.w r3, [r4, #96] ; 0x60
- pcb->ssthresh = eff_wnd >> 1;
- 800bb6a: 4299 cmp r1, r3
- 800bb6c: bf28 it cs
- 800bb6e: 4619 movcs r1, r3
- if (pcb->ssthresh < (pcb->mss << 1)) {
- 800bb70: 8ee3 ldrh r3, [r4, #54] ; 0x36
- /* Reset the retransmission timer. */
- pcb->rtime = 0;
- /* Reduce congestion window and ssthresh. */
- eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
- pcb->ssthresh = eff_wnd >> 1;
- 800bb72: 0849 lsrs r1, r1, #1
- if (pcb->ssthresh < (pcb->mss << 1)) {
- 800bb74: 005a lsls r2, r3, #1
- 800bb76: 4291 cmp r1, r2
- /* Reset the retransmission timer. */
- pcb->rtime = 0;
- /* Reduce congestion window and ssthresh. */
- eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
- pcb->ssthresh = eff_wnd >> 1;
- 800bb78: f8a4 104e strh.w r1, [r4, #78] ; 0x4e
- if (pcb->ssthresh < (pcb->mss << 1)) {
- pcb->ssthresh = (pcb->mss << 1);
- }
- pcb->cwnd = pcb->mss;
- 800bb7c: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
- /* Reduce congestion window and ssthresh. */
- eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd);
- pcb->ssthresh = eff_wnd >> 1;
- if (pcb->ssthresh < (pcb->mss << 1)) {
- pcb->ssthresh = (pcb->mss << 1);
- 800bb80: bfb8 it lt
- 800bb82: f8a4 204e strhlt.w r2, [r4, #78] ; 0x4e
- " ssthresh %"U16_F"\n",
- pcb->cwnd, pcb->ssthresh));
-
- /* The following needs to be called AFTER cwnd is set to one
- mss - STJ */
- tcp_rexmit_rto(pcb);
- 800bb86: 4620 mov r0, r4
- 800bb88: f001 fedc bl 800d944 <tcp_rexmit_rto>
- pcb = pcb->next;
- continue;
- }
- pcb->last_timer = tcp_timer_ctr;
- pcb_remove = 0;
- 800bb8c: 2500 movs r5, #0
- 800bb8e: e000 b.n 800bb92 <tcp_slowtmr+0xee>
- pcb_reset = 0;
- if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) {
- ++pcb_remove;
- 800bb90: 2501 movs r5, #1
- tcp_rexmit_rto(pcb);
- }
- }
- }
- /* Check if this PCB has stayed too long in FIN-WAIT-2 */
- if (pcb->state == FIN_WAIT_2) {
- 800bb92: 7e23 ldrb r3, [r4, #24]
- 800bb94: 2b06 cmp r3, #6
- 800bb96: d10c bne.n 800bbb2 <tcp_slowtmr+0x10e>
- /* If this PCB is in FIN_WAIT_2 because of SHUT_WR don't let it time out. */
- if (pcb->flags & TF_RXCLOSED) {
- 800bb98: 7fa2 ldrb r2, [r4, #30]
- 800bb9a: f002 0210 and.w r2, r2, #16
- 800bb9e: b2d2 uxtb r2, r2
- 800bba0: b13a cbz r2, 800bbb2 <tcp_slowtmr+0x10e>
- /* PCB was fully closed (either through close() or SHUT_RDWR):
- normal FIN-WAIT timeout handling. */
- if ((u32_t)(tcp_ticks - pcb->tmr) >
- 800bba2: 4a5d ldr r2, [pc, #372] ; (800bd18 <tcp_slowtmr+0x274>)
- 800bba4: 6811 ldr r1, [r2, #0]
- 800bba6: 6a62 ldr r2, [r4, #36] ; 0x24
- 800bba8: 1a8a subs r2, r1, r2
- 800bbaa: 2a28 cmp r2, #40 ; 0x28
- 800bbac: d901 bls.n 800bbb2 <tcp_slowtmr+0x10e>
- TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) {
- ++pcb_remove;
- 800bbae: 3501 adds r5, #1
- 800bbb0: b2ed uxtb r5, r5
- }
- }
- }
- /* Check if KEEPALIVE should be sent */
- if(ip_get_option(pcb, SOF_KEEPALIVE) &&
- 800bbb2: 7a27 ldrb r7, [r4, #8]
- 800bbb4: f007 0708 and.w r7, r7, #8
- 800bbb8: b2ff uxtb r7, r7
- 800bbba: b34f cbz r7, 800bc10 <tcp_slowtmr+0x16c>
- 800bbbc: 2b04 cmp r3, #4
- 800bbbe: d001 beq.n 800bbc4 <tcp_slowtmr+0x120>
- ((pcb->state == ESTABLISHED) ||
- 800bbc0: 2b07 cmp r3, #7
- 800bbc2: d124 bne.n 800bc0e <tcp_slowtmr+0x16a>
- (pcb->state == CLOSE_WAIT))) {
- if((u32_t)(tcp_ticks - pcb->tmr) >
- 800bbc4: 4b54 ldr r3, [pc, #336] ; (800bd18 <tcp_slowtmr+0x274>)
- (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL)
- 800bbc6: f8d4 008c ldr.w r0, [r4, #140] ; 0x8c
- /* Check if KEEPALIVE should be sent */
- if(ip_get_option(pcb, SOF_KEEPALIVE) &&
- ((pcb->state == ESTABLISHED) ||
- (pcb->state == CLOSE_WAIT))) {
- if((u32_t)(tcp_ticks - pcb->tmr) >
- 800bbca: 681a ldr r2, [r3, #0]
- 800bbcc: 6a63 ldr r3, [r4, #36] ; 0x24
- 800bbce: 1ad2 subs r2, r2, r3
- (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL)
- 800bbd0: f500 2324 add.w r3, r0, #671744 ; 0xa4000
- 800bbd4: f603 43b8 addw r3, r3, #3256 ; 0xcb8
- 800bbd8: f44f 71fa mov.w r1, #500 ; 0x1f4
- 800bbdc: fbb3 f3f1 udiv r3, r3, r1
- /* Check if KEEPALIVE should be sent */
- if(ip_get_option(pcb, SOF_KEEPALIVE) &&
- ((pcb->state == ESTABLISHED) ||
- (pcb->state == CLOSE_WAIT))) {
- if((u32_t)(tcp_ticks - pcb->tmr) >
- 800bbe0: 429a cmp r2, r3
- 800bbe2: d903 bls.n 800bbec <tcp_slowtmr+0x148>
- {
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to %"U16_F".%"U16_F".%"U16_F".%"U16_F".\n",
- ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip),
- ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip)));
-
- ++pcb_remove;
- 800bbe4: 3501 adds r5, #1
- 800bbe6: b2ed uxtb r5, r5
- ++pcb_reset;
- 800bbe8: 2701 movs r7, #1
- 800bbea: e011 b.n 800bc10 <tcp_slowtmr+0x16c>
- }
- else if((u32_t)(tcp_ticks - pcb->tmr) >
- (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb))
- 800bbec: f894 3092 ldrb.w r3, [r4, #146] ; 0x92
- 800bbf0: 4f4e ldr r7, [pc, #312] ; (800bd2c <tcp_slowtmr+0x288>)
- 800bbf2: fb07 0003 mla r0, r7, r3, r0
- / TCP_SLOW_INTERVAL)
- 800bbf6: fbb0 f1f1 udiv r1, r0, r1
- ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip)));
-
- ++pcb_remove;
- ++pcb_reset;
- }
- else if((u32_t)(tcp_ticks - pcb->tmr) >
- 800bbfa: 428a cmp r2, r1
- 800bbfc: d907 bls.n 800bc0e <tcp_slowtmr+0x16a>
- (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb))
- / TCP_SLOW_INTERVAL)
- {
- tcp_keepalive(pcb);
- 800bbfe: 4620 mov r0, r4
- 800bc00: f001 ff0e bl 800da20 <tcp_keepalive>
- pcb->keep_cnt_sent++;
- 800bc04: f894 3092 ldrb.w r3, [r4, #146] ; 0x92
- 800bc08: 3301 adds r3, #1
- 800bc0a: f884 3092 strb.w r3, [r4, #146] ; 0x92
- continue;
- }
- pcb->last_timer = tcp_timer_ctr;
- pcb_remove = 0;
- pcb_reset = 0;
- 800bc0e: 2700 movs r7, #0
- LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: dropping OOSEQ queued data\n"));
- }
- #endif /* TCP_QUEUE_OOSEQ */
- /* Check if this PCB has stayed too long in SYN-RCVD */
- if (pcb->state == SYN_RCVD) {
- 800bc10: 7e23 ldrb r3, [r4, #24]
- 800bc12: 2b03 cmp r3, #3
- 800bc14: d108 bne.n 800bc28 <tcp_slowtmr+0x184>
- if ((u32_t)(tcp_ticks - pcb->tmr) >
- 800bc16: 4b40 ldr r3, [pc, #256] ; (800bd18 <tcp_slowtmr+0x274>)
- 800bc18: 681a ldr r2, [r3, #0]
- 800bc1a: 6a63 ldr r3, [r4, #36] ; 0x24
- 800bc1c: 1ad3 subs r3, r2, r3
- 800bc1e: 2b28 cmp r3, #40 ; 0x28
- 800bc20: d90a bls.n 800bc38 <tcp_slowtmr+0x194>
- TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) {
- ++pcb_remove;
- 800bc22: 3501 adds r5, #1
- 800bc24: b2ed uxtb r5, r5
- 800bc26: e007 b.n 800bc38 <tcp_slowtmr+0x194>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in SYN-RCVD\n"));
- }
- }
- /* Check if this PCB has stayed too long in LAST-ACK */
- if (pcb->state == LAST_ACK) {
- 800bc28: 2b09 cmp r3, #9
- 800bc2a: d105 bne.n 800bc38 <tcp_slowtmr+0x194>
- if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
- 800bc2c: 4b3a ldr r3, [pc, #232] ; (800bd18 <tcp_slowtmr+0x274>)
- 800bc2e: 681a ldr r2, [r3, #0]
- 800bc30: 6a63 ldr r3, [r4, #36] ; 0x24
- 800bc32: 1ad3 subs r3, r2, r3
- 800bc34: 2bf0 cmp r3, #240 ; 0xf0
- 800bc36: d800 bhi.n 800bc3a <tcp_slowtmr+0x196>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in LAST-ACK\n"));
- }
- }
- /* If the PCB should be removed, do it. */
- if (pcb_remove) {
- 800bc38: b345 cbz r5, 800bc8c <tcp_slowtmr+0x1e8>
- struct tcp_pcb *pcb2;
- tcp_err_fn err_fn;
- void *err_arg;
- tcp_pcb_purge(pcb);
- 800bc3a: 4620 mov r0, r4
- 800bc3c: f7ff ff14 bl 800ba68 <tcp_pcb_purge>
- 800bc40: 68e3 ldr r3, [r4, #12]
- /* Remove PCB from tcp_active_pcbs list. */
- if (prev != NULL) {
- 800bc42: b10e cbz r6, 800bc48 <tcp_slowtmr+0x1a4>
- LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_active_pcbs", pcb != tcp_active_pcbs);
- prev->next = pcb->next;
- 800bc44: 60f3 str r3, [r6, #12]
- 800bc46: e001 b.n 800bc4c <tcp_slowtmr+0x1a8>
- } else {
- /* This PCB was the first. */
- LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_active_pcbs", tcp_active_pcbs == pcb);
- tcp_active_pcbs = pcb->next;
- 800bc48: 4a35 ldr r2, [pc, #212] ; (800bd20 <tcp_slowtmr+0x27c>)
- 800bc4a: 6013 str r3, [r2, #0]
- }
- if (pcb_reset) {
- 800bc4c: b14f cbz r7, 800bc62 <tcp_slowtmr+0x1be>
- tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
- 800bc4e: 8b63 ldrh r3, [r4, #26]
- 800bc50: 9300 str r3, [sp, #0]
- 800bc52: 8ba3 ldrh r3, [r4, #28]
- 800bc54: 9301 str r3, [sp, #4]
- 800bc56: 6d20 ldr r0, [r4, #80] ; 0x50
- 800bc58: 6aa1 ldr r1, [r4, #40] ; 0x28
- 800bc5a: 4622 mov r2, r4
- 800bc5c: 1d23 adds r3, r4, #4
- 800bc5e: f001 fe25 bl 800d8ac <tcp_rst>
- pcb->local_port, pcb->remote_port);
- }
- err_fn = pcb->errf;
- 800bc62: f8d4 5088 ldr.w r5, [r4, #136] ; 0x88
- err_arg = pcb->callback_arg;
- 800bc66: f8d4 b010 ldr.w fp, [r4, #16]
- pcb2 = pcb;
- pcb = pcb->next;
- 800bc6a: 68e7 ldr r7, [r4, #12]
- memp_free(MEMP_TCP_PCB, pcb2);
- 800bc6c: 2002 movs r0, #2
- 800bc6e: 4621 mov r1, r4
- 800bc70: f7ff fb30 bl 800b2d4 <memp_free>
- tcp_active_pcbs_changed = 0;
- 800bc74: 2300 movs r3, #0
- 800bc76: f888 3000 strb.w r3, [r8]
- TCP_EVENT_ERR(err_fn, err_arg, ERR_ABRT);
- 800bc7a: b11d cbz r5, 800bc84 <tcp_slowtmr+0x1e0>
- 800bc7c: 4658 mov r0, fp
- 800bc7e: f06f 0109 mvn.w r1, #9
- 800bc82: 47a8 blx r5
- if (tcp_active_pcbs_changed) {
- 800bc84: f899 3000 ldrb.w r3, [r9]
- 800bc88: b1f3 cbz r3, 800bcc8 <tcp_slowtmr+0x224>
- 800bc8a: e718 b.n 800babe <tcp_slowtmr+0x1a>
- /* get the 'next' element now and work with 'prev' below (in case of abort) */
- prev = pcb;
- pcb = pcb->next;
- /* We check if we should poll the connection. */
- ++prev->polltmr;
- 800bc8c: 7fe3 ldrb r3, [r4, #31]
- if (prev->polltmr >= prev->pollinterval) {
- 800bc8e: f894 2020 ldrb.w r2, [r4, #32]
- goto tcp_slowtmr_start;
- }
- } else {
- /* get the 'next' element now and work with 'prev' below (in case of abort) */
- prev = pcb;
- pcb = pcb->next;
- 800bc92: 68e7 ldr r7, [r4, #12]
- /* We check if we should poll the connection. */
- ++prev->polltmr;
- 800bc94: 3301 adds r3, #1
- 800bc96: b2db uxtb r3, r3
- if (prev->polltmr >= prev->pollinterval) {
- 800bc98: 429a cmp r2, r3
- /* get the 'next' element now and work with 'prev' below (in case of abort) */
- prev = pcb;
- pcb = pcb->next;
- /* We check if we should poll the connection. */
- ++prev->polltmr;
- 800bc9a: 77e3 strb r3, [r4, #31]
- if (prev->polltmr >= prev->pollinterval) {
- 800bc9c: d813 bhi.n 800bcc6 <tcp_slowtmr+0x222>
- prev->polltmr = 0;
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n"));
- tcp_active_pcbs_changed = 0;
- TCP_EVENT_POLL(prev, err);
- 800bc9e: f8d4 3084 ldr.w r3, [r4, #132] ; 0x84
- pcb = pcb->next;
- /* We check if we should poll the connection. */
- ++prev->polltmr;
- if (prev->polltmr >= prev->pollinterval) {
- prev->polltmr = 0;
- 800bca2: 77e5 strb r5, [r4, #31]
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n"));
- tcp_active_pcbs_changed = 0;
- 800bca4: f888 5000 strb.w r5, [r8]
- TCP_EVENT_POLL(prev, err);
- 800bca8: b11b cbz r3, 800bcb2 <tcp_slowtmr+0x20e>
- 800bcaa: 6920 ldr r0, [r4, #16]
- 800bcac: 4621 mov r1, r4
- 800bcae: 4798 blx r3
- 800bcb0: e000 b.n 800bcb4 <tcp_slowtmr+0x210>
- 800bcb2: 4628 mov r0, r5
- if (tcp_active_pcbs_changed) {
- 800bcb4: f899 3000 ldrb.w r3, [r9]
- 800bcb8: 2b00 cmp r3, #0
- 800bcba: f47f af00 bne.w 800babe <tcp_slowtmr+0x1a>
- goto tcp_slowtmr_start;
- }
- /* if err == ERR_ABRT, 'prev' is already deallocated */
- if (err == ERR_OK) {
- 800bcbe: b910 cbnz r0, 800bcc6 <tcp_slowtmr+0x222>
- tcp_output(prev);
- 800bcc0: 4620 mov r0, r4
- 800bcc2: f001 fcb7 bl 800d634 <tcp_output>
- TCP_EVENT_POLL(prev, err);
- if (tcp_active_pcbs_changed) {
- goto tcp_slowtmr_start;
- }
- /* if err == ERR_ABRT, 'prev' is already deallocated */
- if (err == ERR_OK) {
- 800bcc6: 4626 mov r6, r4
- prev = pcb;
- pcb = pcb->next;
- /* We check if we should poll the connection. */
- ++prev->polltmr;
- if (prev->polltmr >= prev->pollinterval) {
- 800bcc8: 463c mov r4, r7
- prev = NULL;
- pcb = tcp_active_pcbs;
- if (pcb == NULL) {
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n"));
- }
- while (pcb != NULL) {
- 800bcca: 2c00 cmp r4, #0
- 800bccc: f47f aefd bne.w 800baca <tcp_slowtmr+0x26>
- }
-
- /* Steps through all of the TIME-WAIT PCBs. */
- prev = NULL;
- pcb = tcp_tw_pcbs;
- 800bcd0: 4b17 ldr r3, [pc, #92] ; (800bd30 <tcp_slowtmr+0x28c>)
- while (pcb != NULL) {
- LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
- pcb_remove = 0;
- /* Check if this PCB has stayed long enough in TIME-WAIT */
- if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
- 800bcd2: 4e11 ldr r6, [pc, #68] ; (800bd18 <tcp_slowtmr+0x274>)
- }
-
- /* Steps through all of the TIME-WAIT PCBs. */
- prev = NULL;
- pcb = tcp_tw_pcbs;
- 800bcd4: 681d ldr r5, [r3, #0]
- LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs);
- prev->next = pcb->next;
- } else {
- /* This PCB was the first. */
- LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
- tcp_tw_pcbs = pcb->next;
- 800bcd6: 461f mov r7, r3
-
- /* Steps through all of the TIME-WAIT PCBs. */
- prev = NULL;
- pcb = tcp_tw_pcbs;
- while (pcb != NULL) {
- 800bcd8: e00f b.n 800bcfa <tcp_slowtmr+0x256>
- LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
- pcb_remove = 0;
- /* Check if this PCB has stayed long enough in TIME-WAIT */
- if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) {
- 800bcda: 6832 ldr r2, [r6, #0]
- 800bcdc: 6a6b ldr r3, [r5, #36] ; 0x24
- 800bcde: 1ad3 subs r3, r2, r3
- 800bce0: 2bf0 cmp r3, #240 ; 0xf0
- 800bce2: d810 bhi.n 800bd06 <tcp_slowtmr+0x262>
- 800bce4: e00c b.n 800bd00 <tcp_slowtmr+0x25c>
- struct tcp_pcb *pcb2;
- tcp_pcb_purge(pcb);
- /* Remove PCB from tcp_tw_pcbs list. */
- if (prev != NULL) {
- LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs);
- prev->next = pcb->next;
- 800bce6: 60e2 str r2, [r4, #12]
- 800bce8: e000 b.n 800bcec <tcp_slowtmr+0x248>
- } else {
- /* This PCB was the first. */
- LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
- tcp_tw_pcbs = pcb->next;
- 800bcea: 603a str r2, [r7, #0]
- }
- pcb2 = pcb;
- pcb = pcb->next;
- memp_free(MEMP_TCP_PCB, pcb2);
- 800bcec: 4629 mov r1, r5
- 800bcee: 2002 movs r0, #2
- /* This PCB was the first. */
- LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
- tcp_tw_pcbs = pcb->next;
- }
- pcb2 = pcb;
- pcb = pcb->next;
- 800bcf0: f8d5 800c ldr.w r8, [r5, #12]
- memp_free(MEMP_TCP_PCB, pcb2);
- 800bcf4: f7ff faee bl 800b2d4 <memp_free>
- /* This PCB was the first. */
- LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
- tcp_tw_pcbs = pcb->next;
- }
- pcb2 = pcb;
- pcb = pcb->next;
- 800bcf8: 4645 mov r5, r8
-
- /* Steps through all of the TIME-WAIT PCBs. */
- prev = NULL;
- pcb = tcp_tw_pcbs;
- while (pcb != NULL) {
- 800bcfa: 2d00 cmp r5, #0
- 800bcfc: d1ed bne.n 800bcda <tcp_slowtmr+0x236>
- 800bcfe: e009 b.n 800bd14 <tcp_slowtmr+0x270>
- pcb2 = pcb;
- pcb = pcb->next;
- memp_free(MEMP_TCP_PCB, pcb2);
- } else {
- prev = pcb;
- pcb = pcb->next;
- 800bd00: 462c mov r4, r5
- 800bd02: 68ed ldr r5, [r5, #12]
- 800bd04: e7f9 b.n 800bcfa <tcp_slowtmr+0x256>
- /* If the PCB should be removed, do it. */
- if (pcb_remove) {
- struct tcp_pcb *pcb2;
- tcp_pcb_purge(pcb);
- 800bd06: 4628 mov r0, r5
- 800bd08: f7ff feae bl 800ba68 <tcp_pcb_purge>
- 800bd0c: 68ea ldr r2, [r5, #12]
- /* Remove PCB from tcp_tw_pcbs list. */
- if (prev != NULL) {
- 800bd0e: 2c00 cmp r4, #0
- 800bd10: d1e9 bne.n 800bce6 <tcp_slowtmr+0x242>
- 800bd12: e7ea b.n 800bcea <tcp_slowtmr+0x246>
- } else {
- prev = pcb;
- pcb = pcb->next;
- }
- }
- }
- 800bd14: e8bd 8ffe ldmia.w sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800bd18: 20008340 .word 0x20008340
- 800bd1c: 20006b7d .word 0x20006b7d
- 800bd20: 2000833c .word 0x2000833c
- 800bd24: 08011875 .word 0x08011875
- 800bd28: 08011868 .word 0x08011868
- 800bd2c: 000124f8 .word 0x000124f8
- 800bd30: 20008350 .word 0x20008350
- 800bd34: 20008338 .word 0x20008338
- 0800bd38 <tcp_next_iss>:
- u32_t
- tcp_next_iss(void)
- {
- static u32_t iss = 6510;
-
- iss += tcp_ticks; /* XXX */
- 800bd38: 4b03 ldr r3, [pc, #12] ; (800bd48 <tcp_next_iss+0x10>)
- 800bd3a: 4a04 ldr r2, [pc, #16] ; (800bd4c <tcp_next_iss+0x14>)
- 800bd3c: 6810 ldr r0, [r2, #0]
- 800bd3e: 681a ldr r2, [r3, #0]
- 800bd40: 1880 adds r0, r0, r2
- 800bd42: 6018 str r0, [r3, #0]
- return iss;
- }
- 800bd44: 4770 bx lr
- 800bd46: bf00 nop
- 800bd48: 2000010c .word 0x2000010c
- 800bd4c: 20008340 .word 0x20008340
- 0800bd50 <tcp_eff_send_mss>:
- * by using ip_route to determin the netif used to send to the address and
- * calculating the minimum of TCP_MSS and that netif's mtu (if set).
- */
- u16_t
- tcp_eff_send_mss(u16_t sendmss, ip_addr_t *addr)
- {
- 800bd50: b510 push {r4, lr}
- 800bd52: 4604 mov r4, r0
- u16_t mss_s;
- struct netif *outif;
- outif = ip_route(addr);
- 800bd54: 4608 mov r0, r1
- 800bd56: f002 fbb5 bl 800e4c4 <ip_route>
- if ((outif != NULL) && (outif->mtu != 0)) {
- 800bd5a: b130 cbz r0, 800bd6a <tcp_eff_send_mss+0x1a>
- 800bd5c: 8c83 ldrh r3, [r0, #36] ; 0x24
- 800bd5e: b123 cbz r3, 800bd6a <tcp_eff_send_mss+0x1a>
- mss_s = outif->mtu - IP_HLEN - TCP_HLEN;
- 800bd60: 3b28 subs r3, #40 ; 0x28
- /* RFC 1122, chap 4.2.2.6:
- * Eff.snd.MSS = min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize
- * We correct for TCP options in tcp_write(), and don't support IP options.
- */
- sendmss = LWIP_MIN(sendmss, mss_s);
- 800bd62: b29b uxth r3, r3
- 800bd64: 429c cmp r4, r3
- 800bd66: bf28 it cs
- 800bd68: 461c movcs r4, r3
- }
- return sendmss;
- }
- 800bd6a: 4620 mov r0, r4
- 800bd6c: bd10 pop {r4, pc}
- 800bd6e: 0000 movs r0, r0
- 0800bd70 <tcp_pcbs_sane>:
- */
- s16_t
- tcp_pcbs_sane(void)
- {
- struct tcp_pcb *pcb;
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800bd70: 4b06 ldr r3, [pc, #24] ; (800bd8c <tcp_pcbs_sane+0x1c>)
- 800bd72: 681b ldr r3, [r3, #0]
- 800bd74: e000 b.n 800bd78 <tcp_pcbs_sane+0x8>
- 800bd76: 68db ldr r3, [r3, #12]
- 800bd78: 2b00 cmp r3, #0
- 800bd7a: d1fc bne.n 800bd76 <tcp_pcbs_sane+0x6>
- LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != CLOSED", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != LISTEN", pcb->state != LISTEN);
- LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
- }
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- 800bd7c: 4b04 ldr r3, [pc, #16] ; (800bd90 <tcp_pcbs_sane+0x20>)
- 800bd7e: 681b ldr r3, [r3, #0]
- 800bd80: e000 b.n 800bd84 <tcp_pcbs_sane+0x14>
- 800bd82: 68db ldr r3, [r3, #12]
- 800bd84: 2b00 cmp r3, #0
- 800bd86: d1fc bne.n 800bd82 <tcp_pcbs_sane+0x12>
- LWIP_ASSERT("tcp_pcbs_sane: tw pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
- }
- return 1;
- }
- 800bd88: 2001 movs r0, #1
- 800bd8a: 4770 bx lr
- 800bd8c: 2000833c .word 0x2000833c
- 800bd90: 20008350 .word 0x20008350
- 0800bd94 <tcp_pcb_remove>:
- * @param pcb tcp_pcb to purge. The pcb itself is NOT deallocated!
- */
- void
- tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
- {
- TCP_RMV(pcblist, pcb);
- 800bd94: 6803 ldr r3, [r0, #0]
- 800bd96: 428b cmp r3, r1
- * @param pcblist PCB list to purge.
- * @param pcb tcp_pcb to purge. The pcb itself is NOT deallocated!
- */
- void
- tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
- {
- 800bd98: b510 push {r4, lr}
- 800bd9a: 460c mov r4, r1
- TCP_RMV(pcblist, pcb);
- 800bd9c: d102 bne.n 800bda4 <tcp_pcb_remove+0x10>
- 800bd9e: 68cb ldr r3, [r1, #12]
- 800bda0: 6003 str r3, [r0, #0]
- 800bda2: e00d b.n 800bdc0 <tcp_pcb_remove+0x2c>
- 800bda4: 4a13 ldr r2, [pc, #76] ; (800bdf4 <tcp_pcb_remove+0x60>)
- 800bda6: 6013 str r3, [r2, #0]
- 800bda8: e007 b.n 800bdba <tcp_pcb_remove+0x26>
- 800bdaa: 68d9 ldr r1, [r3, #12]
- 800bdac: 42a1 cmp r1, r4
- 800bdae: d103 bne.n 800bdb8 <tcp_pcb_remove+0x24>
- 800bdb0: 6013 str r3, [r2, #0]
- 800bdb2: 68e2 ldr r2, [r4, #12]
- 800bdb4: 60da str r2, [r3, #12]
- 800bdb6: e003 b.n 800bdc0 <tcp_pcb_remove+0x2c>
- 800bdb8: 460b mov r3, r1
- 800bdba: 2b00 cmp r3, #0
- 800bdbc: d1f5 bne.n 800bdaa <tcp_pcb_remove+0x16>
- 800bdbe: 6013 str r3, [r2, #0]
- 800bdc0: 2300 movs r3, #0
- 800bdc2: 60e3 str r3, [r4, #12]
- tcp_pcb_purge(pcb);
- 800bdc4: 4620 mov r0, r4
- 800bdc6: f7ff fe4f bl 800ba68 <tcp_pcb_purge>
-
- /* if there is an outstanding delayed ACKs, send it */
- if (pcb->state != TIME_WAIT &&
- 800bdca: 7e23 ldrb r3, [r4, #24]
- 800bdcc: 2b0a cmp r3, #10
- 800bdce: d00a beq.n 800bde6 <tcp_pcb_remove+0x52>
- 800bdd0: 2b01 cmp r3, #1
- 800bdd2: d008 beq.n 800bde6 <tcp_pcb_remove+0x52>
- pcb->state != LISTEN &&
- pcb->flags & TF_ACK_DELAY) {
- 800bdd4: 7fa3 ldrb r3, [r4, #30]
- tcp_pcb_purge(pcb);
-
- /* if there is an outstanding delayed ACKs, send it */
- if (pcb->state != TIME_WAIT &&
- pcb->state != LISTEN &&
- 800bdd6: 07da lsls r2, r3, #31
- 800bdd8: d505 bpl.n 800bde6 <tcp_pcb_remove+0x52>
- pcb->flags & TF_ACK_DELAY) {
- pcb->flags |= TF_ACK_NOW;
- 800bdda: f043 0302 orr.w r3, r3, #2
- 800bdde: 77a3 strb r3, [r4, #30]
- tcp_output(pcb);
- 800bde0: 4620 mov r0, r4
- 800bde2: f001 fc27 bl 800d634 <tcp_output>
- #if TCP_QUEUE_OOSEQ
- LWIP_ASSERT("ooseq segments leaking", pcb->ooseq == NULL);
- #endif /* TCP_QUEUE_OOSEQ */
- }
- pcb->state = CLOSED;
- 800bde6: 2300 movs r3, #0
- 800bde8: 7623 strb r3, [r4, #24]
- LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane());
- }
- 800bdea: e8bd 4010 ldmia.w sp!, {r4, lr}
- #endif /* TCP_QUEUE_OOSEQ */
- }
- pcb->state = CLOSED;
- LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane());
- 800bdee: f7ff bfbf b.w 800bd70 <tcp_pcbs_sane>
- 800bdf2: bf00 nop
- 800bdf4: 20008348 .word 0x20008348
- 0800bdf8 <tcp_abandon>:
- LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs",
- pcb->state != LISTEN);
- /* Figure out on which TCP PCB list we are, and remove us. If we
- are in an active state, call the receive function associated with
- the PCB with a NULL argument, and send an RST to the remote end. */
- if (pcb->state == TIME_WAIT) {
- 800bdf8: 7e03 ldrb r3, [r0, #24]
- 800bdfa: 2b0a cmp r3, #10
- * @param pcb the tcp_pcb to abort
- * @param reset boolean to indicate whether a reset should be sent
- */
- void
- tcp_abandon(struct tcp_pcb *pcb, int reset)
- {
- 800bdfc: e92d 43f7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, lr}
- 800be00: 4604 mov r4, r0
- 800be02: 4689 mov r9, r1
- LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs",
- pcb->state != LISTEN);
- /* Figure out on which TCP PCB list we are, and remove us. If we
- are in an active state, call the receive function associated with
- the PCB with a NULL argument, and send an RST to the remote end. */
- if (pcb->state == TIME_WAIT) {
- 800be04: d10a bne.n 800be1c <tcp_abandon+0x24>
- tcp_pcb_remove(&tcp_tw_pcbs, pcb);
- 800be06: 4621 mov r1, r4
- 800be08: 481b ldr r0, [pc, #108] ; (800be78 <tcp_abandon+0x80>)
- 800be0a: f7ff ffc3 bl 800bd94 <tcp_pcb_remove>
- memp_free(MEMP_TCP_PCB, pcb);
- 800be0e: 2002 movs r0, #2
- 800be10: 4621 mov r1, r4
- tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port);
- }
- memp_free(MEMP_TCP_PCB, pcb);
- TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
- }
- }
- 800be12: b003 add sp, #12
- 800be14: e8bd 43f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, lr}
- /* Figure out on which TCP PCB list we are, and remove us. If we
- are in an active state, call the receive function associated with
- the PCB with a NULL argument, and send an RST to the remote end. */
- if (pcb->state == TIME_WAIT) {
- tcp_pcb_remove(&tcp_tw_pcbs, pcb);
- memp_free(MEMP_TCP_PCB, pcb);
- 800be18: f7ff ba5c b.w 800b2d4 <memp_free>
- } else {
- seqno = pcb->snd_nxt;
- 800be1c: f8d0 8050 ldr.w r8, [r0, #80] ; 0x50
- ackno = pcb->rcv_nxt;
- 800be20: 6a87 ldr r7, [r0, #40] ; 0x28
- #if LWIP_CALLBACK_API
- errf = pcb->errf;
- 800be22: f8d0 5088 ldr.w r5, [r0, #136] ; 0x88
- #endif /* LWIP_CALLBACK_API */
- errf_arg = pcb->callback_arg;
- 800be26: 6906 ldr r6, [r0, #16]
- TCP_PCB_REMOVE_ACTIVE(pcb);
- 800be28: 4814 ldr r0, [pc, #80] ; (800be7c <tcp_abandon+0x84>)
- 800be2a: 4621 mov r1, r4
- 800be2c: f7ff ffb2 bl 800bd94 <tcp_pcb_remove>
- 800be30: 4b13 ldr r3, [pc, #76] ; (800be80 <tcp_abandon+0x88>)
- if (pcb->unacked != NULL) {
- 800be32: 6f20 ldr r0, [r4, #112] ; 0x70
- ackno = pcb->rcv_nxt;
- #if LWIP_CALLBACK_API
- errf = pcb->errf;
- #endif /* LWIP_CALLBACK_API */
- errf_arg = pcb->callback_arg;
- TCP_PCB_REMOVE_ACTIVE(pcb);
- 800be34: 2201 movs r2, #1
- 800be36: 701a strb r2, [r3, #0]
- if (pcb->unacked != NULL) {
- 800be38: b108 cbz r0, 800be3e <tcp_abandon+0x46>
- tcp_segs_free(pcb->unacked);
- 800be3a: f7ff fdfc bl 800ba36 <tcp_segs_free>
- }
- if (pcb->unsent != NULL) {
- 800be3e: 6ee0 ldr r0, [r4, #108] ; 0x6c
- 800be40: b108 cbz r0, 800be46 <tcp_abandon+0x4e>
- tcp_segs_free(pcb->unsent);
- 800be42: f7ff fdf8 bl 800ba36 <tcp_segs_free>
- #if TCP_QUEUE_OOSEQ
- if (pcb->ooseq != NULL) {
- tcp_segs_free(pcb->ooseq);
- }
- #endif /* TCP_QUEUE_OOSEQ */
- if (reset) {
- 800be46: f1b9 0f00 cmp.w r9, #0
- 800be4a: d009 beq.n 800be60 <tcp_abandon+0x68>
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n"));
- tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port);
- 800be4c: 8b63 ldrh r3, [r4, #26]
- 800be4e: 9300 str r3, [sp, #0]
- 800be50: 8ba3 ldrh r3, [r4, #28]
- 800be52: 4640 mov r0, r8
- 800be54: 9301 str r3, [sp, #4]
- 800be56: 4639 mov r1, r7
- 800be58: 4622 mov r2, r4
- 800be5a: 1d23 adds r3, r4, #4
- 800be5c: f001 fd26 bl 800d8ac <tcp_rst>
- }
- memp_free(MEMP_TCP_PCB, pcb);
- 800be60: 2002 movs r0, #2
- 800be62: 4621 mov r1, r4
- 800be64: f7ff fa36 bl 800b2d4 <memp_free>
- TCP_EVENT_ERR(errf, errf_arg, ERR_ABRT);
- 800be68: b11d cbz r5, 800be72 <tcp_abandon+0x7a>
- 800be6a: 4630 mov r0, r6
- 800be6c: f06f 0109 mvn.w r1, #9
- 800be70: 47a8 blx r5
- }
- }
- 800be72: b003 add sp, #12
- 800be74: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
- 800be78: 20008350 .word 0x20008350
- 800be7c: 2000833c .word 0x2000833c
- 800be80: 20008338 .word 0x20008338
- 0800be84 <tcp_abort>:
- * @param pcb the tcp pcb to abort
- */
- void
- tcp_abort(struct tcp_pcb *pcb)
- {
- tcp_abandon(pcb, 1);
- 800be84: 2101 movs r1, #1
- 800be86: f7ff bfb7 b.w 800bdf8 <tcp_abandon>
- 800be8a: 0000 movs r0, r0
- 0800be8c <tcp_alloc>:
- * @param prio priority for the new pcb
- * @return a new tcp_pcb that initially is in state CLOSED
- */
- struct tcp_pcb *
- tcp_alloc(u8_t prio)
- {
- 800be8c: b5f8 push {r3, r4, r5, r6, r7, lr}
- 800be8e: 4605 mov r5, r0
- struct tcp_pcb *pcb;
- u32_t iss;
-
- pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);
- 800be90: 2002 movs r0, #2
- 800be92: f7ff f9f5 bl 800b280 <memp_malloc>
- if (pcb == NULL) {
- 800be96: 4604 mov r4, r0
- 800be98: 2800 cmp r0, #0
- 800be9a: d142 bne.n 800bf22 <tcp_alloc+0x96>
- u32_t inactivity;
- inactivity = 0;
- inactive = NULL;
- /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- 800be9c: 4b3f ldr r3, [pc, #252] ; (800bf9c <tcp_alloc+0x110>)
- if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
- 800be9e: 4a40 ldr r2, [pc, #256] ; (800bfa0 <tcp_alloc+0x114>)
- u32_t inactivity;
- inactivity = 0;
- inactive = NULL;
- /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- 800bea0: 681b ldr r3, [r3, #0]
- if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
- 800bea2: 6811 ldr r1, [r2, #0]
- 800bea4: e007 b.n 800beb6 <tcp_alloc+0x2a>
- 800bea6: 6a5a ldr r2, [r3, #36] ; 0x24
- 800bea8: 1a8a subs r2, r1, r2
- 800beaa: 42a2 cmp r2, r4
- 800beac: bf34 ite cc
- 800beae: 4622 movcc r2, r4
- 800beb0: 4618 movcs r0, r3
- u32_t inactivity;
- inactivity = 0;
- inactive = NULL;
- /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- 800beb2: 68db ldr r3, [r3, #12]
- 800beb4: 4614 mov r4, r2
- 800beb6: 2b00 cmp r3, #0
- 800beb8: d1f5 bne.n 800bea6 <tcp_alloc+0x1a>
- if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
- inactivity = tcp_ticks - pcb->tmr;
- inactive = pcb;
- }
- }
- if (inactive != NULL) {
- 800beba: b108 cbz r0, 800bec0 <tcp_alloc+0x34>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_timewait: killing oldest TIME-WAIT PCB %p (%"S32_F")\n",
- (void *)inactive, inactivity));
- tcp_abort(inactive);
- 800bebc: f7ff ffe2 bl 800be84 <tcp_abort>
- if (pcb == NULL) {
- /* Try killing oldest connection in TIME-WAIT. */
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest TIME-WAIT connection\n"));
- tcp_kill_timewait();
- /* Try to allocate a tcp_pcb again. */
- pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);
- 800bec0: 2002 movs r0, #2
- 800bec2: f7ff f9dd bl 800b280 <memp_malloc>
- if (pcb == NULL) {
- 800bec6: 4604 mov r4, r0
- 800bec8: bb28 cbnz r0, 800bf16 <tcp_alloc+0x8a>
- inactivity = 0;
- inactive = NULL;
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- if (pcb->prio <= prio &&
- pcb->prio <= mprio &&
- (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
- 800beca: 4a35 ldr r2, [pc, #212] ; (800bfa0 <tcp_alloc+0x114>)
- mprio = TCP_PRIO_MAX;
-
- /* We kill the oldest active connection that has lower priority than prio. */
- inactivity = 0;
- inactive = NULL;
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800becc: 4b35 ldr r3, [pc, #212] ; (800bfa4 <tcp_alloc+0x118>)
- if (pcb->prio <= prio &&
- pcb->prio <= mprio &&
- (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
- 800bece: 6817 ldr r7, [r2, #0]
- mprio = TCP_PRIO_MAX;
-
- /* We kill the oldest active connection that has lower priority than prio. */
- inactivity = 0;
- inactive = NULL;
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800bed0: 681b ldr r3, [r3, #0]
- struct tcp_pcb *pcb, *inactive;
- u32_t inactivity;
- u8_t mprio;
- mprio = TCP_PRIO_MAX;
- 800bed2: 207f movs r0, #127 ; 0x7f
-
- /* We kill the oldest active connection that has lower priority than prio. */
- inactivity = 0;
- inactive = NULL;
- 800bed4: 4622 mov r2, r4
- 800bed6: e00c b.n 800bef2 <tcp_alloc+0x66>
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- if (pcb->prio <= prio &&
- 800bed8: 7e59 ldrb r1, [r3, #25]
- 800beda: 42a9 cmp r1, r5
- 800bedc: d808 bhi.n 800bef0 <tcp_alloc+0x64>
- 800bede: 4281 cmp r1, r0
- 800bee0: d806 bhi.n 800bef0 <tcp_alloc+0x64>
- pcb->prio <= mprio &&
- (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
- 800bee2: 6a5e ldr r6, [r3, #36] ; 0x24
- 800bee4: 1bbe subs r6, r7, r6
- /* We kill the oldest active connection that has lower priority than prio. */
- inactivity = 0;
- inactive = NULL;
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- if (pcb->prio <= prio &&
- pcb->prio <= mprio &&
- 800bee6: 42a6 cmp r6, r4
- 800bee8: d302 bcc.n 800bef0 <tcp_alloc+0x64>
- 800beea: 4608 mov r0, r1
- 800beec: 4634 mov r4, r6
- 800beee: 461a mov r2, r3
- mprio = TCP_PRIO_MAX;
-
- /* We kill the oldest active connection that has lower priority than prio. */
- inactivity = 0;
- inactive = NULL;
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800bef0: 68db ldr r3, [r3, #12]
- 800bef2: 2b00 cmp r3, #0
- 800bef4: d1f0 bne.n 800bed8 <tcp_alloc+0x4c>
- inactivity = tcp_ticks - pcb->tmr;
- inactive = pcb;
- mprio = pcb->prio;
- }
- }
- if (inactive != NULL) {
- 800bef6: b112 cbz r2, 800befe <tcp_alloc+0x72>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_prio: killing oldest PCB %p (%"S32_F")\n",
- (void *)inactive, inactivity));
- tcp_abort(inactive);
- 800bef8: 4610 mov r0, r2
- 800befa: f7ff ffc3 bl 800be84 <tcp_abort>
- if (pcb == NULL) {
- /* Try killing active connections with lower priority than the new one. */
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing connection with prio lower than %d\n", prio));
- tcp_kill_prio(prio);
- /* Try to allocate a tcp_pcb again. */
- pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB);
- 800befe: 2002 movs r0, #2
- 800bf00: f7ff f9be bl 800b280 <memp_malloc>
- if (pcb != NULL) {
- 800bf04: 4604 mov r4, r0
- 800bf06: 2800 cmp r0, #0
- 800bf08: d045 beq.n 800bf96 <tcp_alloc+0x10a>
- /* adjust err stats: memp_malloc failed twice before */
- MEMP_STATS_DEC(err, MEMP_TCP_PCB);
- 800bf0a: 4b27 ldr r3, [pc, #156] ; (800bfa8 <tcp_alloc+0x11c>)
- 800bf0c: f8b3 20cc ldrh.w r2, [r3, #204] ; 0xcc
- 800bf10: 3a01 subs r2, #1
- 800bf12: f8a3 20cc strh.w r2, [r3, #204] ; 0xcc
- }
- }
- if (pcb != NULL) {
- /* adjust err stats: timewait PCB was freed above */
- MEMP_STATS_DEC(err, MEMP_TCP_PCB);
- 800bf16: 4b24 ldr r3, [pc, #144] ; (800bfa8 <tcp_alloc+0x11c>)
- 800bf18: f8b3 20cc ldrh.w r2, [r3, #204] ; 0xcc
- 800bf1c: 3a01 subs r2, #1
- 800bf1e: f8a3 20cc strh.w r2, [r3, #204] ; 0xcc
- }
- }
- if (pcb != NULL) {
- memset(pcb, 0, sizeof(struct tcp_pcb));
- 800bf22: 2100 movs r1, #0
- 800bf24: 2294 movs r2, #148 ; 0x94
- 800bf26: 4620 mov r0, r4
- 800bf28: f7fd fb26 bl 8009578 <memset>
- pcb->prio = prio;
- pcb->snd_buf = TCP_SND_BUF;
- pcb->snd_queuelen = 0;
- pcb->rcv_wnd = TCP_WND;
- 800bf2c: f241 62d0 movw r2, #5840 ; 0x16d0
- }
- }
- if (pcb != NULL) {
- memset(pcb, 0, sizeof(struct tcp_pcb));
- pcb->prio = prio;
- pcb->snd_buf = TCP_SND_BUF;
- 800bf30: f246 63a8 movw r3, #26280 ; 0x66a8
- 800bf34: f8a4 3066 strh.w r3, [r4, #102] ; 0x66
- pcb->snd_queuelen = 0;
- pcb->rcv_wnd = TCP_WND;
- 800bf38: 85a2 strh r2, [r4, #44] ; 0x2c
- }
- if (pcb != NULL) {
- memset(pcb, 0, sizeof(struct tcp_pcb));
- pcb->prio = prio;
- pcb->snd_buf = TCP_SND_BUF;
- pcb->snd_queuelen = 0;
- 800bf3a: 2300 movs r3, #0
- pcb->rcv_wnd = TCP_WND;
- pcb->rcv_ann_wnd = TCP_WND;
- 800bf3c: 85e2 strh r2, [r4, #46] ; 0x2e
- pcb->tos = 0;
- pcb->ttl = TCP_TTL;
- 800bf3e: 22ff movs r2, #255 ; 0xff
- MEMP_STATS_DEC(err, MEMP_TCP_PCB);
- }
- }
- if (pcb != NULL) {
- memset(pcb, 0, sizeof(struct tcp_pcb));
- pcb->prio = prio;
- 800bf40: 7665 strb r5, [r4, #25]
- pcb->snd_buf = TCP_SND_BUF;
- pcb->snd_queuelen = 0;
- 800bf42: f8a4 3068 strh.w r3, [r4, #104] ; 0x68
- 800bf46: 461d mov r5, r3
- pcb->rcv_wnd = TCP_WND;
- pcb->rcv_ann_wnd = TCP_WND;
- pcb->tos = 0;
- 800bf48: 7263 strb r3, [r4, #9]
- pcb->ttl = TCP_TTL;
- 800bf4a: 72a2 strb r2, [r4, #10]
- /* As initial send MSS, we use TCP_MSS but limit it to 536.
- The send MSS is updated when an MSS option is received. */
- pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
- pcb->rto = 3000 / TCP_SLOW_INTERVAL;
- pcb->sa = 0;
- 800bf4c: f8a4 3040 strh.w r3, [r4, #64] ; 0x40
- pcb->rcv_ann_wnd = TCP_WND;
- pcb->tos = 0;
- pcb->ttl = TCP_TTL;
- /* As initial send MSS, we use TCP_MSS but limit it to 536.
- The send MSS is updated when an MSS option is received. */
- pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
- 800bf50: f44f 7206 mov.w r2, #536 ; 0x218
- pcb->rto = 3000 / TCP_SLOW_INTERVAL;
- pcb->sa = 0;
- pcb->sv = 3000 / TCP_SLOW_INTERVAL;
- pcb->rtime = -1;
- 800bf54: f64f 73ff movw r3, #65535 ; 0xffff
- pcb->rcv_ann_wnd = TCP_WND;
- pcb->tos = 0;
- pcb->ttl = TCP_TTL;
- /* As initial send MSS, we use TCP_MSS but limit it to 536.
- The send MSS is updated when an MSS option is received. */
- pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
- 800bf58: 86e2 strh r2, [r4, #54] ; 0x36
- pcb->rto = 3000 / TCP_SLOW_INTERVAL;
- pcb->sa = 0;
- pcb->sv = 3000 / TCP_SLOW_INTERVAL;
- pcb->rtime = -1;
- 800bf5a: 86a3 strh r3, [r4, #52] ; 0x34
- pcb->tos = 0;
- pcb->ttl = TCP_TTL;
- /* As initial send MSS, we use TCP_MSS but limit it to 536.
- The send MSS is updated when an MSS option is received. */
- pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
- pcb->rto = 3000 / TCP_SLOW_INTERVAL;
- 800bf5c: 2206 movs r2, #6
- pcb->sa = 0;
- pcb->sv = 3000 / TCP_SLOW_INTERVAL;
- pcb->rtime = -1;
- pcb->cwnd = 1;
- 800bf5e: 2301 movs r3, #1
- 800bf60: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
- pcb->tos = 0;
- pcb->ttl = TCP_TTL;
- /* As initial send MSS, we use TCP_MSS but limit it to 536.
- The send MSS is updated when an MSS option is received. */
- pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
- pcb->rto = 3000 / TCP_SLOW_INTERVAL;
- 800bf64: f8a4 2044 strh.w r2, [r4, #68] ; 0x44
- pcb->sa = 0;
- pcb->sv = 3000 / TCP_SLOW_INTERVAL;
- 800bf68: f8a4 2042 strh.w r2, [r4, #66] ; 0x42
- pcb->rtime = -1;
- pcb->cwnd = 1;
- iss = tcp_next_iss();
- 800bf6c: f7ff fee4 bl 800bd38 <tcp_next_iss>
- pcb->snd_wl2 = iss;
- pcb->snd_nxt = iss;
- pcb->lastack = iss;
- pcb->snd_lbb = iss;
- pcb->tmr = tcp_ticks;
- 800bf70: 4b0b ldr r3, [pc, #44] ; (800bfa0 <tcp_alloc+0x114>)
- pcb->sa = 0;
- pcb->sv = 3000 / TCP_SLOW_INTERVAL;
- pcb->rtime = -1;
- pcb->cwnd = 1;
- iss = tcp_next_iss();
- pcb->snd_wl2 = iss;
- 800bf72: 65a0 str r0, [r4, #88] ; 0x58
- pcb->snd_nxt = iss;
- pcb->lastack = iss;
- pcb->snd_lbb = iss;
- pcb->tmr = tcp_ticks;
- 800bf74: 681b ldr r3, [r3, #0]
- pcb->sv = 3000 / TCP_SLOW_INTERVAL;
- pcb->rtime = -1;
- pcb->cwnd = 1;
- iss = tcp_next_iss();
- pcb->snd_wl2 = iss;
- pcb->snd_nxt = iss;
- 800bf76: 6520 str r0, [r4, #80] ; 0x50
- pcb->lastack = iss;
- pcb->snd_lbb = iss;
- pcb->tmr = tcp_ticks;
- 800bf78: 6263 str r3, [r4, #36] ; 0x24
- pcb->last_timer = tcp_timer_ctr;
- 800bf7a: 4b0c ldr r3, [pc, #48] ; (800bfac <tcp_alloc+0x120>)
- pcb->rtime = -1;
- pcb->cwnd = 1;
- iss = tcp_next_iss();
- pcb->snd_wl2 = iss;
- pcb->snd_nxt = iss;
- pcb->lastack = iss;
- 800bf7c: 64a0 str r0, [r4, #72] ; 0x48
- pcb->snd_lbb = iss;
- pcb->tmr = tcp_ticks;
- pcb->last_timer = tcp_timer_ctr;
- 800bf7e: 781b ldrb r3, [r3, #0]
- pcb->cwnd = 1;
- iss = tcp_next_iss();
- pcb->snd_wl2 = iss;
- pcb->snd_nxt = iss;
- pcb->lastack = iss;
- pcb->snd_lbb = iss;
- 800bf80: 65e0 str r0, [r4, #92] ; 0x5c
- pcb->tmr = tcp_ticks;
- pcb->last_timer = tcp_timer_ctr;
- 800bf82: f884 3021 strb.w r3, [r4, #33] ; 0x21
- pcb->polltmr = 0;
- #if LWIP_CALLBACK_API
- pcb->recv = tcp_recv_null;
- 800bf86: 4b0a ldr r3, [pc, #40] ; (800bfb0 <tcp_alloc+0x124>)
- pcb->lastack = iss;
- pcb->snd_lbb = iss;
- pcb->tmr = tcp_ticks;
- pcb->last_timer = tcp_timer_ctr;
- pcb->polltmr = 0;
- 800bf88: 77e5 strb r5, [r4, #31]
- #if LWIP_CALLBACK_API
- pcb->recv = tcp_recv_null;
- 800bf8a: 67e3 str r3, [r4, #124] ; 0x7c
- #endif /* LWIP_CALLBACK_API */
-
- /* Init KEEPALIVE timer */
- pcb->keep_idle = TCP_KEEPIDLE_DEFAULT;
- 800bf8c: 4b09 ldr r3, [pc, #36] ; (800bfb4 <tcp_alloc+0x128>)
- #if LWIP_TCP_KEEPALIVE
- pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT;
- pcb->keep_cnt = TCP_KEEPCNT_DEFAULT;
- #endif /* LWIP_TCP_KEEPALIVE */
- pcb->keep_cnt_sent = 0;
- 800bf8e: f884 5092 strb.w r5, [r4, #146] ; 0x92
- #if LWIP_CALLBACK_API
- pcb->recv = tcp_recv_null;
- #endif /* LWIP_CALLBACK_API */
-
- /* Init KEEPALIVE timer */
- pcb->keep_idle = TCP_KEEPIDLE_DEFAULT;
- 800bf92: f8c4 308c str.w r3, [r4, #140] ; 0x8c
- #endif /* LWIP_TCP_KEEPALIVE */
- pcb->keep_cnt_sent = 0;
- }
- return pcb;
- }
- 800bf96: 4620 mov r0, r4
- 800bf98: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 800bf9a: bf00 nop
- 800bf9c: 20008350 .word 0x20008350
- 800bfa0: 20008340 .word 0x20008340
- 800bfa4: 2000833c .word 0x2000833c
- 800bfa8: 20008220 .word 0x20008220
- 800bfac: 20006b7d .word 0x20006b7d
- 800bfb0: 0800c111 .word 0x0800c111
- 800bfb4: 006ddd00 .word 0x006ddd00
- 0800bfb8 <tcp_new>:
- * @return a new tcp_pcb that initially is in state CLOSED
- */
- struct tcp_pcb *
- tcp_new(void)
- {
- return tcp_alloc(TCP_PRIO_NORMAL);
- 800bfb8: 2040 movs r0, #64 ; 0x40
- 800bfba: f7ff bf67 b.w 800be8c <tcp_alloc>
- 800bfbe: 0000 movs r0, r0
- 0800bfc0 <tcp_close_shutdown>:
- * @return ERR_OK if connection has been closed
- * another err_t if closing failed and pcb is not freed
- */
- static err_t
- tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data)
- {
- 800bfc0: b537 push {r0, r1, r2, r4, r5, lr}
- 800bfc2: 4604 mov r4, r0
- err_t err;
- if (rst_on_unacked_data && ((pcb->state == ESTABLISHED) || (pcb->state == CLOSE_WAIT))) {
- 800bfc4: 2900 cmp r1, #0
- 800bfc6: d043 beq.n 800c050 <tcp_close_shutdown+0x90>
- 800bfc8: 7e03 ldrb r3, [r0, #24]
- 800bfca: 2b04 cmp r3, #4
- 800bfcc: d001 beq.n 800bfd2 <tcp_close_shutdown+0x12>
- 800bfce: 2b07 cmp r3, #7
- 800bfd0: d13e bne.n 800c050 <tcp_close_shutdown+0x90>
- if ((pcb->refused_data != NULL) || (pcb->rcv_wnd != TCP_WND)) {
- 800bfd2: 6f63 ldr r3, [r4, #116] ; 0x74
- 800bfd4: b923 cbnz r3, 800bfe0 <tcp_close_shutdown+0x20>
- 800bfd6: 8da2 ldrh r2, [r4, #44] ; 0x2c
- 800bfd8: f241 63d0 movw r3, #5840 ; 0x16d0
- 800bfdc: 429a cmp r2, r3
- 800bfde: d037 beq.n 800c050 <tcp_close_shutdown+0x90>
- side about this. */
- LWIP_ASSERT("pcb->flags & TF_RXCLOSED", pcb->flags & TF_RXCLOSED);
- /* don't call tcp_abort here: we must not deallocate the pcb since
- that might not be expected when calling tcp_close */
- tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
- 800bfe0: 8b63 ldrh r3, [r4, #26]
- 800bfe2: 6d20 ldr r0, [r4, #80] ; 0x50
- 800bfe4: 9300 str r3, [sp, #0]
- 800bfe6: 8ba3 ldrh r3, [r4, #28]
- 800bfe8: 6aa1 ldr r1, [r4, #40] ; 0x28
- 800bfea: 9301 str r3, [sp, #4]
- 800bfec: 4622 mov r2, r4
- 800bfee: 1d23 adds r3, r4, #4
- 800bff0: f001 fc5c bl 800d8ac <tcp_rst>
- pcb->local_port, pcb->remote_port);
- tcp_pcb_purge(pcb);
- 800bff4: 4620 mov r0, r4
- 800bff6: f7ff fd37 bl 800ba68 <tcp_pcb_purge>
- TCP_RMV_ACTIVE(pcb);
- 800bffa: 4a3a ldr r2, [pc, #232] ; (800c0e4 <tcp_close_shutdown+0x124>)
- 800bffc: 6813 ldr r3, [r2, #0]
- 800bffe: 42a3 cmp r3, r4
- 800c000: d101 bne.n 800c006 <tcp_close_shutdown+0x46>
- 800c002: 68e3 ldr r3, [r4, #12]
- 800c004: e00c b.n 800c020 <tcp_close_shutdown+0x60>
- 800c006: 4a38 ldr r2, [pc, #224] ; (800c0e8 <tcp_close_shutdown+0x128>)
- 800c008: 6013 str r3, [r2, #0]
- 800c00a: e007 b.n 800c01c <tcp_close_shutdown+0x5c>
- 800c00c: 68d9 ldr r1, [r3, #12]
- 800c00e: 42a1 cmp r1, r4
- 800c010: d103 bne.n 800c01a <tcp_close_shutdown+0x5a>
- 800c012: 6013 str r3, [r2, #0]
- 800c014: 68e2 ldr r2, [r4, #12]
- 800c016: 60da str r2, [r3, #12]
- 800c018: e003 b.n 800c022 <tcp_close_shutdown+0x62>
- 800c01a: 460b mov r3, r1
- 800c01c: 2b00 cmp r3, #0
- 800c01e: d1f5 bne.n 800c00c <tcp_close_shutdown+0x4c>
- 800c020: 6013 str r3, [r2, #0]
- 800c022: 4b32 ldr r3, [pc, #200] ; (800c0ec <tcp_close_shutdown+0x12c>)
- 800c024: 2201 movs r2, #1
- 800c026: 701a strb r2, [r3, #0]
- if (pcb->state == ESTABLISHED) {
- 800c028: 7e23 ldrb r3, [r4, #24]
- that might not be expected when calling tcp_close */
- tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
- pcb->local_port, pcb->remote_port);
- tcp_pcb_purge(pcb);
- TCP_RMV_ACTIVE(pcb);
- 800c02a: 2500 movs r5, #0
- if (pcb->state == ESTABLISHED) {
- 800c02c: 2b04 cmp r3, #4
- that might not be expected when calling tcp_close */
- tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip,
- pcb->local_port, pcb->remote_port);
- tcp_pcb_purge(pcb);
- TCP_RMV_ACTIVE(pcb);
- 800c02e: 60e5 str r5, [r4, #12]
- if (pcb->state == ESTABLISHED) {
- 800c030: d108 bne.n 800c044 <tcp_close_shutdown+0x84>
- /* move to TIME_WAIT since we close actively */
- pcb->state = TIME_WAIT;
- 800c032: 230a movs r3, #10
- 800c034: 7623 strb r3, [r4, #24]
- TCP_REG(&tcp_tw_pcbs, pcb);
- 800c036: 4b2e ldr r3, [pc, #184] ; (800c0f0 <tcp_close_shutdown+0x130>)
- 800c038: 681a ldr r2, [r3, #0]
- 800c03a: 601c str r4, [r3, #0]
- 800c03c: 60e2 str r2, [r4, #12]
- 800c03e: f001 fdfb bl 800dc38 <tcp_timer_needed>
- 800c042: e003 b.n 800c04c <tcp_close_shutdown+0x8c>
- } else {
- /* CLOSE_WAIT: deallocate the pcb since we already sent a RST for it */
- memp_free(MEMP_TCP_PCB, pcb);
- 800c044: 2002 movs r0, #2
- 800c046: 4621 mov r1, r4
- 800c048: f7ff f944 bl 800b2d4 <memp_free>
- }
- return ERR_OK;
- 800c04c: 4628 mov r0, r5
- 800c04e: e040 b.n 800c0d2 <tcp_close_shutdown+0x112>
- }
- }
- switch (pcb->state) {
- 800c050: 7e23 ldrb r3, [r4, #24]
- 800c052: 2b07 cmp r3, #7
- 800c054: d842 bhi.n 800c0dc <tcp_close_shutdown+0x11c>
- 800c056: e8df f003 tbb [pc, r3]
- 800c05a: 1d04 .short 0x1d04
- 800c05c: 412f2f23 .word 0x412f2f23
- 800c060: 3541 .short 0x3541
- * Calling tcp_close() with a pcb that has already been closed, (i.e. twice)
- * or for a pcb that has been used and then entered the CLOSED state
- * is erroneous, but this should never happen as the pcb has in those cases
- * been freed, and so any remaining handles are bogus. */
- err = ERR_OK;
- if (pcb->local_port != 0) {
- 800c062: 8b63 ldrh r3, [r4, #26]
- 800c064: b31b cbz r3, 800c0ae <tcp_close_shutdown+0xee>
- TCP_RMV(&tcp_bound_pcbs, pcb);
- 800c066: 4a23 ldr r2, [pc, #140] ; (800c0f4 <tcp_close_shutdown+0x134>)
- 800c068: 6813 ldr r3, [r2, #0]
- 800c06a: 42a3 cmp r3, r4
- 800c06c: d101 bne.n 800c072 <tcp_close_shutdown+0xb2>
- 800c06e: 68e3 ldr r3, [r4, #12]
- 800c070: e00c b.n 800c08c <tcp_close_shutdown+0xcc>
- 800c072: 4a1d ldr r2, [pc, #116] ; (800c0e8 <tcp_close_shutdown+0x128>)
- 800c074: 6013 str r3, [r2, #0]
- 800c076: e007 b.n 800c088 <tcp_close_shutdown+0xc8>
- 800c078: 68d9 ldr r1, [r3, #12]
- 800c07a: 42a1 cmp r1, r4
- 800c07c: d103 bne.n 800c086 <tcp_close_shutdown+0xc6>
- 800c07e: 6013 str r3, [r2, #0]
- 800c080: 68e2 ldr r2, [r4, #12]
- 800c082: 60da str r2, [r3, #12]
- 800c084: e003 b.n 800c08e <tcp_close_shutdown+0xce>
- 800c086: 460b mov r3, r1
- 800c088: 2b00 cmp r3, #0
- 800c08a: d1f5 bne.n 800c078 <tcp_close_shutdown+0xb8>
- 800c08c: 6013 str r3, [r2, #0]
- 800c08e: 2300 movs r3, #0
- 800c090: 60e3 str r3, [r4, #12]
- 800c092: e00c b.n 800c0ae <tcp_close_shutdown+0xee>
- memp_free(MEMP_TCP_PCB, pcb);
- pcb = NULL;
- break;
- case LISTEN:
- err = ERR_OK;
- tcp_pcb_remove(&tcp_listen_pcbs.pcbs, pcb);
- 800c094: 4818 ldr r0, [pc, #96] ; (800c0f8 <tcp_close_shutdown+0x138>)
- 800c096: 4621 mov r1, r4
- 800c098: f7ff fe7c bl 800bd94 <tcp_pcb_remove>
- memp_free(MEMP_TCP_PCB_LISTEN, pcb);
- 800c09c: 2003 movs r0, #3
- 800c09e: e007 b.n 800c0b0 <tcp_close_shutdown+0xf0>
- pcb = NULL;
- break;
- case SYN_SENT:
- err = ERR_OK;
- TCP_PCB_REMOVE_ACTIVE(pcb);
- 800c0a0: 4810 ldr r0, [pc, #64] ; (800c0e4 <tcp_close_shutdown+0x124>)
- 800c0a2: 4621 mov r1, r4
- 800c0a4: f7ff fe76 bl 800bd94 <tcp_pcb_remove>
- 800c0a8: 4b10 ldr r3, [pc, #64] ; (800c0ec <tcp_close_shutdown+0x12c>)
- 800c0aa: 2201 movs r2, #1
- 800c0ac: 701a strb r2, [r3, #0]
- memp_free(MEMP_TCP_PCB, pcb);
- 800c0ae: 2002 movs r0, #2
- 800c0b0: 4621 mov r1, r4
- 800c0b2: f7ff f90f bl 800b2d4 <memp_free>
- pcb = NULL;
- snmp_inc_tcpattemptfails();
- break;
- 800c0b6: e011 b.n 800c0dc <tcp_close_shutdown+0x11c>
- snmp_inc_tcpattemptfails();
- pcb->state = FIN_WAIT_1;
- }
- break;
- case ESTABLISHED:
- err = tcp_send_fin(pcb);
- 800c0b8: 4620 mov r0, r4
- 800c0ba: f001 fa77 bl 800d5ac <tcp_send_fin>
- if (err == ERR_OK) {
- 800c0be: b940 cbnz r0, 800c0d2 <tcp_close_shutdown+0x112>
- snmp_inc_tcpestabresets();
- pcb->state = FIN_WAIT_1;
- 800c0c0: 2305 movs r3, #5
- 800c0c2: e004 b.n 800c0ce <tcp_close_shutdown+0x10e>
- }
- break;
- case CLOSE_WAIT:
- err = tcp_send_fin(pcb);
- 800c0c4: 4620 mov r0, r4
- 800c0c6: f001 fa71 bl 800d5ac <tcp_send_fin>
- if (err == ERR_OK) {
- 800c0ca: b910 cbnz r0, 800c0d2 <tcp_close_shutdown+0x112>
- snmp_inc_tcpestabresets();
- pcb->state = LAST_ACK;
- 800c0cc: 2309 movs r3, #9
- 800c0ce: 7623 strb r3, [r4, #24]
- 800c0d0: e001 b.n 800c0d6 <tcp_close_shutdown+0x116>
- 800c0d2: b240 sxtb r0, r0
- 800c0d4: e004 b.n 800c0e0 <tcp_close_shutdown+0x120>
- returns (unsent data is sent from tcp timer functions, also), we don't care
- for the return value of tcp_output for now. */
- /* @todo: When implementing SO_LINGER, this must be changed somehow:
- If SOF_LINGER is set, the data should be sent and acked before close returns.
- This can only be valid for sequential APIs, not for the raw API. */
- tcp_output(pcb);
- 800c0d6: 4620 mov r0, r4
- 800c0d8: f001 faac bl 800d634 <tcp_output>
- 800c0dc: 2000 movs r0, #0
- 800c0de: e7f8 b.n 800c0d2 <tcp_close_shutdown+0x112>
- }
- return err;
- }
- 800c0e0: bd3e pop {r1, r2, r3, r4, r5, pc}
- 800c0e2: bf00 nop
- 800c0e4: 2000833c .word 0x2000833c
- 800c0e8: 20008348 .word 0x20008348
- 800c0ec: 20008338 .word 0x20008338
- 800c0f0: 20008350 .word 0x20008350
- 800c0f4: 2000834c .word 0x2000834c
- 800c0f8: 20008344 .word 0x20008344
- 0800c0fc <tcp_close>:
- #if TCP_DEBUG
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in "));
- tcp_debug_print_state(pcb->state);
- #endif /* TCP_DEBUG */
- if (pcb->state != LISTEN) {
- 800c0fc: 7e03 ldrb r3, [r0, #24]
- 800c0fe: 2b01 cmp r3, #1
- 800c100: d003 beq.n 800c10a <tcp_close+0xe>
- /* Set a flag not to receive any more data... */
- pcb->flags |= TF_RXCLOSED;
- 800c102: 7f83 ldrb r3, [r0, #30]
- 800c104: f043 0310 orr.w r3, r3, #16
- 800c108: 7783 strb r3, [r0, #30]
- }
- /* ... and close */
- return tcp_close_shutdown(pcb, 1);
- 800c10a: 2101 movs r1, #1
- 800c10c: f7ff bf58 b.w 800bfc0 <tcp_close_shutdown>
- 0800c110 <tcp_recv_null>:
- * Default receive callback that is called if the user didn't register
- * a recv callback for the pcb.
- */
- err_t
- tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
- {
- 800c110: b510 push {r4, lr}
- 800c112: 4608 mov r0, r1
- LWIP_UNUSED_ARG(arg);
- if (p != NULL) {
- 800c114: 4614 mov r4, r2
- 800c116: b132 cbz r2, 800c126 <tcp_recv_null+0x16>
- tcp_recved(pcb, p->tot_len);
- 800c118: 8911 ldrh r1, [r2, #8]
- 800c11a: f7ff fc61 bl 800b9e0 <tcp_recved>
- pbuf_free(p);
- 800c11e: 4620 mov r0, r4
- 800c120: f7ff f9d0 bl 800b4c4 <pbuf_free>
- 800c124: e004 b.n 800c130 <tcp_recv_null+0x20>
- } else if (err == ERR_OK) {
- 800c126: b91b cbnz r3, 800c130 <tcp_recv_null+0x20>
- return tcp_close(pcb);
- }
- return ERR_OK;
- }
- 800c128: e8bd 4010 ldmia.w sp!, {r4, lr}
- LWIP_UNUSED_ARG(arg);
- if (p != NULL) {
- tcp_recved(pcb, p->tot_len);
- pbuf_free(p);
- } else if (err == ERR_OK) {
- return tcp_close(pcb);
- 800c12c: f7ff bfe6 b.w 800c0fc <tcp_close>
- }
- return ERR_OK;
- }
- 800c130: 2000 movs r0, #0
- 800c132: bd10 pop {r4, pc}
- 0800c134 <tcp_process_refused_data>:
- }
- /** Pass pcb->refused_data to the recv callback */
- err_t
- tcp_process_refused_data(struct tcp_pcb *pcb)
- {
- 800c134: b5f8 push {r3, r4, r5, r6, r7, lr}
- err_t err;
- u8_t refused_flags = pcb->refused_data->flags;
- 800c136: 6f45 ldr r5, [r0, #116] ; 0x74
- closes the pcb */
- struct pbuf *refused_data = pcb->refused_data;
- pcb->refused_data = NULL;
- /* Notify again application with data previously received. */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
- TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err);
- 800c138: 6fc6 ldr r6, [r0, #124] ; 0x7c
- /** Pass pcb->refused_data to the recv callback */
- err_t
- tcp_process_refused_data(struct tcp_pcb *pcb)
- {
- err_t err;
- u8_t refused_flags = pcb->refused_data->flags;
- 800c13a: 7b6f ldrb r7, [r5, #13]
- /* set pcb->refused_data to NULL in case the callback frees it and then
- closes the pcb */
- struct pbuf *refused_data = pcb->refused_data;
- pcb->refused_data = NULL;
- 800c13c: 2300 movs r3, #0
- }
- /** Pass pcb->refused_data to the recv callback */
- err_t
- tcp_process_refused_data(struct tcp_pcb *pcb)
- {
- 800c13e: 4604 mov r4, r0
- err_t err;
- u8_t refused_flags = pcb->refused_data->flags;
- /* set pcb->refused_data to NULL in case the callback frees it and then
- closes the pcb */
- struct pbuf *refused_data = pcb->refused_data;
- pcb->refused_data = NULL;
- 800c140: 6743 str r3, [r0, #116] ; 0x74
- /* Notify again application with data previously received. */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
- TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err);
- 800c142: b126 cbz r6, 800c14e <tcp_process_refused_data+0x1a>
- 800c144: 4621 mov r1, r4
- 800c146: 462a mov r2, r5
- 800c148: 6900 ldr r0, [r0, #16]
- 800c14a: 47b0 blx r6
- 800c14c: e005 b.n 800c15a <tcp_process_refused_data+0x26>
- 800c14e: 4630 mov r0, r6
- 800c150: 4621 mov r1, r4
- 800c152: 462a mov r2, r5
- 800c154: 4633 mov r3, r6
- 800c156: f7ff ffdb bl 800c110 <tcp_recv_null>
- if (err == ERR_OK) {
- 800c15a: b9b0 cbnz r0, 800c18a <tcp_process_refused_data+0x56>
- /* did refused_data include a FIN? */
- if (refused_flags & PBUF_FLAG_TCP_FIN) {
- 800c15c: f007 0720 and.w r7, r7, #32
- 800c160: b2ff uxtb r7, r7
- 800c162: b1bf cbz r7, 800c194 <tcp_process_refused_data+0x60>
- /* correct rcv_wnd as the application won't call tcp_recved()
- for the FIN's seqno */
- if (pcb->rcv_wnd != TCP_WND) {
- 800c164: 8da3 ldrh r3, [r4, #44] ; 0x2c
- 800c166: f241 62d0 movw r2, #5840 ; 0x16d0
- 800c16a: 4293 cmp r3, r2
- 800c16c: d001 beq.n 800c172 <tcp_process_refused_data+0x3e>
- pcb->rcv_wnd++;
- 800c16e: 3301 adds r3, #1
- 800c170: 85a3 strh r3, [r4, #44] ; 0x2c
- }
- TCP_EVENT_CLOSED(pcb, err);
- 800c172: 6fe5 ldr r5, [r4, #124] ; 0x7c
- 800c174: b905 cbnz r5, 800c178 <tcp_process_refused_data+0x44>
- 800c176: e00c b.n 800c192 <tcp_process_refused_data+0x5e>
- 800c178: 2200 movs r2, #0
- 800c17a: 6920 ldr r0, [r4, #16]
- 800c17c: 4621 mov r1, r4
- 800c17e: 4613 mov r3, r2
- 800c180: 47a8 blx r5
- if (err == ERR_ABRT) {
- 800c182: 300a adds r0, #10
- 800c184: d105 bne.n 800c192 <tcp_process_refused_data+0x5e>
- return ERR_ABRT;
- 800c186: 20f6 movs r0, #246 ; 0xf6
- 800c188: e004 b.n 800c194 <tcp_process_refused_data+0x60>
- }
- }
- } else if (err == ERR_ABRT) {
- 800c18a: b240 sxtb r0, r0
- 800c18c: 300a adds r0, #10
- 800c18e: d0fa beq.n 800c186 <tcp_process_refused_data+0x52>
- segment contains data). */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: drop incoming packets, because pcb is \"full\"\n"));
- return ERR_ABRT;
- } else {
- /* data is still refused, pbuf is still valid (go on for ACK-only packets) */
- pcb->refused_data = refused_data;
- 800c190: 6765 str r5, [r4, #116] ; 0x74
- }
- return ERR_OK;
- 800c192: 2000 movs r0, #0
- }
- 800c194: b240 sxtb r0, r0
- 800c196: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 0800c198 <tcp_fasttmr>:
- *
- * Automatically called from tcp_tmr().
- */
- void
- tcp_fasttmr(void)
- {
- 800c198: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
- struct tcp_pcb *pcb;
- ++tcp_timer_ctr;
- 800c19c: 4b18 ldr r3, [pc, #96] ; (800c200 <tcp_fasttmr+0x68>)
- tcp_fasttmr_start:
- pcb = tcp_active_pcbs;
- 800c19e: 4f19 ldr r7, [pc, #100] ; (800c204 <tcp_fasttmr+0x6c>)
- void
- tcp_fasttmr(void)
- {
- struct tcp_pcb *pcb;
- ++tcp_timer_ctr;
- 800c1a0: 781a ldrb r2, [r3, #0]
- 800c1a2: 3201 adds r2, #1
- 800c1a4: 701a strb r2, [r3, #0]
- tcp_fasttmr_start:
- pcb = tcp_active_pcbs;
- while(pcb != NULL) {
- if (pcb->last_timer != tcp_timer_ctr) {
- 800c1a6: 4698 mov r8, r3
- struct tcp_pcb *pcb;
- ++tcp_timer_ctr;
- tcp_fasttmr_start:
- pcb = tcp_active_pcbs;
- 800c1a8: 683c ldr r4, [r7, #0]
- next = pcb->next;
- /* If there is data which was previously "refused" by upper layer */
- if (pcb->refused_data != NULL) {
- tcp_active_pcbs_changed = 0;
- 800c1aa: 4d17 ldr r5, [pc, #92] ; (800c208 <tcp_fasttmr+0x70>)
- 800c1ac: 2600 movs r6, #0
- ++tcp_timer_ctr;
- tcp_fasttmr_start:
- pcb = tcp_active_pcbs;
- while(pcb != NULL) {
- 800c1ae: e022 b.n 800c1f6 <tcp_fasttmr+0x5e>
- if (pcb->last_timer != tcp_timer_ctr) {
- 800c1b0: f898 2000 ldrb.w r2, [r8]
- 800c1b4: f894 3021 ldrb.w r3, [r4, #33] ; 0x21
- 800c1b8: 4293 cmp r3, r2
- 800c1ba: d020 beq.n 800c1fe <tcp_fasttmr+0x66>
- struct tcp_pcb *next;
- pcb->last_timer = tcp_timer_ctr;
- 800c1bc: f884 2021 strb.w r2, [r4, #33] ; 0x21
- /* send delayed ACKs */
- if (pcb->flags & TF_ACK_DELAY) {
- 800c1c0: 7fa2 ldrb r2, [r4, #30]
- 800c1c2: 07d1 lsls r1, r2, #31
- 800c1c4: d509 bpl.n 800c1da <tcp_fasttmr+0x42>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
- tcp_ack_now(pcb);
- 800c1c6: f042 0202 orr.w r2, r2, #2
- 800c1ca: 77a2 strb r2, [r4, #30]
- tcp_output(pcb);
- 800c1cc: 4620 mov r0, r4
- 800c1ce: f001 fa31 bl 800d634 <tcp_output>
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- 800c1d2: 7fa3 ldrb r3, [r4, #30]
- 800c1d4: f023 0303 bic.w r3, r3, #3
- 800c1d8: 77a3 strb r3, [r4, #30]
- }
- next = pcb->next;
- /* If there is data which was previously "refused" by upper layer */
- if (pcb->refused_data != NULL) {
- 800c1da: 6f63 ldr r3, [r4, #116] ; 0x74
- tcp_ack_now(pcb);
- tcp_output(pcb);
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- }
- next = pcb->next;
- 800c1dc: f8d4 900c ldr.w r9, [r4, #12]
- /* If there is data which was previously "refused" by upper layer */
- if (pcb->refused_data != NULL) {
- 800c1e0: b90b cbnz r3, 800c1e6 <tcp_fasttmr+0x4e>
- 800c1e2: 464c mov r4, r9
- 800c1e4: e007 b.n 800c1f6 <tcp_fasttmr+0x5e>
- tcp_active_pcbs_changed = 0;
- tcp_process_refused_data(pcb);
- 800c1e6: 4620 mov r0, r4
- next = pcb->next;
- /* If there is data which was previously "refused" by upper layer */
- if (pcb->refused_data != NULL) {
- tcp_active_pcbs_changed = 0;
- 800c1e8: 702e strb r6, [r5, #0]
- tcp_process_refused_data(pcb);
- 800c1ea: f7ff ffa3 bl 800c134 <tcp_process_refused_data>
- if (tcp_active_pcbs_changed) {
- 800c1ee: 782b ldrb r3, [r5, #0]
- 800c1f0: 2b00 cmp r3, #0
- 800c1f2: d1d9 bne.n 800c1a8 <tcp_fasttmr+0x10>
- 800c1f4: e7f5 b.n 800c1e2 <tcp_fasttmr+0x4a>
- ++tcp_timer_ctr;
- tcp_fasttmr_start:
- pcb = tcp_active_pcbs;
- while(pcb != NULL) {
- 800c1f6: 2c00 cmp r4, #0
- 800c1f8: d1da bne.n 800c1b0 <tcp_fasttmr+0x18>
- 800c1fa: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
- 800c1fe: e7fe b.n 800c1fe <tcp_fasttmr+0x66>
- 800c200: 20006b7d .word 0x20006b7d
- 800c204: 2000833c .word 0x2000833c
- 800c208: 20008338 .word 0x20008338
- 0800c20c <tcp_tmr>:
- /**
- * Called periodically to dispatch TCP timers.
- */
- void
- tcp_tmr(void)
- {
- 800c20c: b508 push {r3, lr}
- /* Call tcp_fasttmr() every 250 ms */
- tcp_fasttmr();
- 800c20e: f7ff ffc3 bl 800c198 <tcp_fasttmr>
- if (++tcp_timer & 1) {
- 800c212: 4a06 ldr r2, [pc, #24] ; (800c22c <tcp_tmr+0x20>)
- 800c214: 7813 ldrb r3, [r2, #0]
- 800c216: 3301 adds r3, #1
- 800c218: b2db uxtb r3, r3
- 800c21a: 07d8 lsls r0, r3, #31
- 800c21c: 7013 strb r3, [r2, #0]
- 800c21e: d503 bpl.n 800c228 <tcp_tmr+0x1c>
- /* Call tcp_tmr() every 500 ms, i.e., every other timer
- tcp_tmr() is called. */
- tcp_slowtmr();
- }
- }
- 800c220: e8bd 4008 ldmia.w sp!, {r3, lr}
- tcp_fasttmr();
- if (++tcp_timer & 1) {
- /* Call tcp_tmr() every 500 ms, i.e., every other timer
- tcp_tmr() is called. */
- tcp_slowtmr();
- 800c224: f7ff bc3e b.w 800baa4 <tcp_slowtmr>
- 800c228: bd08 pop {r3, pc}
- 800c22a: bf00 nop
- 800c22c: 20006b7c .word 0x20006b7c
- 0800c230 <tcp_parseopt>:
- *
- * @param pcb the tcp_pcb for which a segment arrived
- */
- static void
- tcp_parseopt(struct tcp_pcb *pcb)
- {
- 800c230: b5f8 push {r3, r4, r5, r6, r7, lr}
- u8_t *opts, opt;
- #if LWIP_TCP_TIMESTAMPS
- u32_t tsval;
- #endif
- opts = (u8_t *)tcphdr + TCP_HLEN;
- 800c232: 4d1e ldr r5, [pc, #120] ; (800c2ac <tcp_parseopt+0x7c>)
- 800c234: 682c ldr r4, [r5, #0]
- *
- * @param pcb the tcp_pcb for which a segment arrived
- */
- static void
- tcp_parseopt(struct tcp_pcb *pcb)
- {
- 800c236: 4606 mov r6, r0
- #endif
- opts = (u8_t *)tcphdr + TCP_HLEN;
- /* Parse the TCP MSS option, if present. */
- if(TCPH_HDRLEN(tcphdr) > 0x5) {
- 800c238: 89a0 ldrh r0, [r4, #12]
- 800c23a: f7fd ffdb bl 800a1f4 <lwip_ntohs>
- 800c23e: f3c0 300f ubfx r0, r0, #12, #16
- 800c242: 2805 cmp r0, #5
- 800c244: d931 bls.n 800c2aa <tcp_parseopt+0x7a>
- max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
- 800c246: 682b ldr r3, [r5, #0]
- 800c248: 8998 ldrh r0, [r3, #12]
- 800c24a: f7fd ffd3 bl 800a1f4 <lwip_ntohs>
- 800c24e: 0b00 lsrs r0, r0, #12
- 800c250: 1f41 subs r1, r0, #5
- 800c252: 0089 lsls r1, r1, #2
- u8_t *opts, opt;
- #if LWIP_TCP_TIMESTAMPS
- u32_t tsval;
- #endif
- opts = (u8_t *)tcphdr + TCP_HLEN;
- 800c254: 3414 adds r4, #20
- /* Parse the TCP MSS option, if present. */
- if(TCPH_HDRLEN(tcphdr) > 0x5) {
- max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
- 800c256: b289 uxth r1, r1
- for (c = 0; c < max_c; ) {
- 800c258: 2300 movs r3, #0
- return;
- }
- /* An MSS option with the right option length. */
- mss = (opts[c + 2] << 8) | opts[c + 3];
- /* Limit the mss to the configured TCP_MSS and prevent division by zero */
- pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss;
- 800c25a: f240 50b3 movw r0, #1459 ; 0x5b3
- 800c25e: f240 55b4 movw r5, #1460 ; 0x5b4
- opts = (u8_t *)tcphdr + TCP_HLEN;
- /* Parse the TCP MSS option, if present. */
- if(TCPH_HDRLEN(tcphdr) > 0x5) {
- max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
- for (c = 0; c < max_c; ) {
- 800c262: e020 b.n 800c2a6 <tcp_parseopt+0x76>
- opt = opts[c];
- switch (opt) {
- 800c264: 5ce2 ldrb r2, [r4, r3]
- 800c266: 2a01 cmp r2, #1
- 800c268: d005 beq.n 800c276 <tcp_parseopt+0x46>
- 800c26a: d31e bcc.n 800c2aa <tcp_parseopt+0x7a>
- 800c26c: 2a02 cmp r2, #2
- 800c26e: eb04 0203 add.w r2, r4, r3
- 800c272: d114 bne.n 800c29e <tcp_parseopt+0x6e>
- 800c274: e001 b.n 800c27a <tcp_parseopt+0x4a>
- /* End of options. */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: EOL\n"));
- return;
- case 0x01:
- /* NOP option. */
- ++c;
- 800c276: 3301 adds r3, #1
- 800c278: e014 b.n 800c2a4 <tcp_parseopt+0x74>
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: NOP\n"));
- break;
- case 0x02:
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: MSS\n"));
- if (opts[c + 1] != 0x04 || c + 0x04 > max_c) {
- 800c27a: 7857 ldrb r7, [r2, #1]
- 800c27c: 2f04 cmp r7, #4
- 800c27e: d114 bne.n 800c2aa <tcp_parseopt+0x7a>
- 800c280: 1cdf adds r7, r3, #3
- 800c282: 428f cmp r7, r1
- 800c284: da11 bge.n 800c2aa <tcp_parseopt+0x7a>
- /* Bad length */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n"));
- return;
- }
- /* An MSS option with the right option length. */
- mss = (opts[c + 2] << 8) | opts[c + 3];
- 800c286: 7897 ldrb r7, [r2, #2]
- 800c288: 78d2 ldrb r2, [r2, #3]
- 800c28a: ea42 2207 orr.w r2, r2, r7, lsl #8
- /* Limit the mss to the configured TCP_MSS and prevent division by zero */
- pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss;
- 800c28e: 1e57 subs r7, r2, #1
- 800c290: b2bf uxth r7, r7
- 800c292: 4287 cmp r7, r0
- 800c294: bf88 it hi
- 800c296: 462a movhi r2, r5
- 800c298: 86f2 strh r2, [r6, #54] ; 0x36
- /* Advance to next option */
- c += 0x04;
- 800c29a: 3304 adds r3, #4
- 800c29c: e002 b.n 800c2a4 <tcp_parseopt+0x74>
- c += 0x0A;
- break;
- #endif
- default:
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: other\n"));
- if (opts[c + 1] == 0) {
- 800c29e: 7852 ldrb r2, [r2, #1]
- 800c2a0: b11a cbz r2, 800c2aa <tcp_parseopt+0x7a>
- and we don't process them further. */
- return;
- }
- /* All other options have a length field, so that we easily
- can skip past them. */
- c += opts[c + 1];
- 800c2a2: 18d3 adds r3, r2, r3
- 800c2a4: b29b uxth r3, r3
- opts = (u8_t *)tcphdr + TCP_HLEN;
- /* Parse the TCP MSS option, if present. */
- if(TCPH_HDRLEN(tcphdr) > 0x5) {
- max_c = (TCPH_HDRLEN(tcphdr) - 5) << 2;
- for (c = 0; c < max_c; ) {
- 800c2a6: 428b cmp r3, r1
- 800c2a8: d3dc bcc.n 800c264 <tcp_parseopt+0x34>
- 800c2aa: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 800c2ac: 20006b80 .word 0x20006b80
- 0800c2b0 <tcp_receive>:
- *
- * Called from tcp_process().
- */
- static void
- tcp_receive(struct tcp_pcb *pcb)
- {
- 800c2b0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- u16_t ooseq_qlen;
- #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
- LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
- if (flags & TCP_ACK) {
- 800c2b4: 4ba0 ldr r3, [pc, #640] ; (800c538 <tcp_receive+0x288>)
- 800c2b6: 781b ldrb r3, [r3, #0]
- 800c2b8: f003 0310 and.w r3, r3, #16
- 800c2bc: b2db uxtb r3, r3
- *
- * Called from tcp_process().
- */
- static void
- tcp_receive(struct tcp_pcb *pcb)
- {
- 800c2be: 4604 mov r4, r0
- u16_t ooseq_qlen;
- #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
- LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
- if (flags & TCP_ACK) {
- 800c2c0: 2b00 cmp r3, #0
- 800c2c2: f000 816b beq.w 800c59c <tcp_receive+0x2ec>
- right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
- /* Update window. */
- if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
- 800c2c6: 4a9d ldr r2, [pc, #628] ; (800c53c <tcp_receive+0x28c>)
- 800c2c8: 6d43 ldr r3, [r0, #84] ; 0x54
- 800c2ca: 6812 ldr r2, [r2, #0]
- #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
- LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
- if (flags & TCP_ACK) {
- right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
- 800c2cc: f8b0 5060 ldrh.w r5, [r0, #96] ; 0x60
- 800c2d0: 6d81 ldr r1, [r0, #88] ; 0x58
- /* Update window. */
- if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
- 800c2d2: 1a98 subs r0, r3, r2
- 800c2d4: 2800 cmp r0, #0
- 800c2d6: db0e blt.n 800c2f6 <tcp_receive+0x46>
- 800c2d8: 4293 cmp r3, r2
- 800c2da: 4b99 ldr r3, [pc, #612] ; (800c540 <tcp_receive+0x290>)
- 800c2dc: d103 bne.n 800c2e6 <tcp_receive+0x36>
- (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
- 800c2de: 6818 ldr r0, [r3, #0]
- 800c2e0: 1a08 subs r0, r1, r0
- 800c2e2: 2800 cmp r0, #0
- 800c2e4: db07 blt.n 800c2f6 <tcp_receive+0x46>
- 800c2e6: 681b ldr r3, [r3, #0]
- 800c2e8: 4299 cmp r1, r3
- 800c2ea: d11f bne.n 800c32c <tcp_receive+0x7c>
- (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
- 800c2ec: 4b95 ldr r3, [pc, #596] ; (800c544 <tcp_receive+0x294>)
- 800c2ee: 681b ldr r3, [r3, #0]
- 800c2f0: 89db ldrh r3, [r3, #14]
- 800c2f2: 42ab cmp r3, r5
- 800c2f4: d91a bls.n 800c32c <tcp_receive+0x7c>
- pcb->snd_wnd = tcphdr->wnd;
- 800c2f6: 4b93 ldr r3, [pc, #588] ; (800c544 <tcp_receive+0x294>)
- /* keep track of the biggest window announced by the remote host to calculate
- the maximum segment size */
- if (pcb->snd_wnd_max < tcphdr->wnd) {
- 800c2f8: f8b4 6062 ldrh.w r6, [r4, #98] ; 0x62
- /* Update window. */
- if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
- (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
- (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
- pcb->snd_wnd = tcphdr->wnd;
- 800c2fc: 681b ldr r3, [r3, #0]
- 800c2fe: 89d8 ldrh r0, [r3, #14]
- /* keep track of the biggest window announced by the remote host to calculate
- the maximum segment size */
- if (pcb->snd_wnd_max < tcphdr->wnd) {
- pcb->snd_wnd_max = tcphdr->wnd;
- }
- pcb->snd_wl1 = seqno;
- 800c300: 6562 str r2, [r4, #84] ; 0x54
- pcb->snd_wl2 = ackno;
- 800c302: 4a8f ldr r2, [pc, #572] ; (800c540 <tcp_receive+0x290>)
- /* Update window. */
- if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
- (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
- (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
- pcb->snd_wnd = tcphdr->wnd;
- 800c304: f8a4 0060 strh.w r0, [r4, #96] ; 0x60
- the maximum segment size */
- if (pcb->snd_wnd_max < tcphdr->wnd) {
- pcb->snd_wnd_max = tcphdr->wnd;
- }
- pcb->snd_wl1 = seqno;
- pcb->snd_wl2 = ackno;
- 800c308: 6812 ldr r2, [r2, #0]
- (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
- (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
- pcb->snd_wnd = tcphdr->wnd;
- /* keep track of the biggest window announced by the remote host to calculate
- the maximum segment size */
- if (pcb->snd_wnd_max < tcphdr->wnd) {
- 800c30a: 4286 cmp r6, r0
- pcb->snd_wnd_max = tcphdr->wnd;
- }
- pcb->snd_wl1 = seqno;
- pcb->snd_wl2 = ackno;
- 800c30c: 65a2 str r2, [r4, #88] ; 0x58
- (pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) {
- pcb->snd_wnd = tcphdr->wnd;
- /* keep track of the biggest window announced by the remote host to calculate
- the maximum segment size */
- if (pcb->snd_wnd_max < tcphdr->wnd) {
- pcb->snd_wnd_max = tcphdr->wnd;
- 800c30e: bf38 it cc
- 800c310: f8a4 0062 strhcc.w r0, [r4, #98] ; 0x62
- 800c314: f894 2091 ldrb.w r2, [r4, #145] ; 0x91
- }
- pcb->snd_wl1 = seqno;
- pcb->snd_wl2 = ackno;
- if (pcb->snd_wnd == 0) {
- 800c318: b920 cbnz r0, 800c324 <tcp_receive+0x74>
- if (pcb->persist_backoff == 0) {
- 800c31a: b93a cbnz r2, 800c32c <tcp_receive+0x7c>
- /* start persist timer */
- pcb->persist_cnt = 0;
- 800c31c: f884 0090 strb.w r0, [r4, #144] ; 0x90
- pcb->persist_backoff = 1;
- 800c320: 2301 movs r3, #1
- 800c322: e001 b.n 800c328 <tcp_receive+0x78>
- }
- } else if (pcb->persist_backoff > 0) {
- 800c324: b112 cbz r2, 800c32c <tcp_receive+0x7c>
- /* stop persist timer */
- pcb->persist_backoff = 0;
- 800c326: 2300 movs r3, #0
- 800c328: f884 3091 strb.w r3, [r4, #145] ; 0x91
- * If it only passes 1, should reset dupack counter
- *
- */
- /* Clause 1 */
- if (TCP_SEQ_LEQ(ackno, pcb->lastack)) {
- 800c32c: 4b84 ldr r3, [pc, #528] ; (800c540 <tcp_receive+0x290>)
- 800c32e: 6ca2 ldr r2, [r4, #72] ; 0x48
- 800c330: 681b ldr r3, [r3, #0]
- 800c332: 1a98 subs r0, r3, r2
- 800c334: 2800 cmp r0, #0
- 800c336: dc34 bgt.n 800c3a2 <tcp_receive+0xf2>
- pcb->acked = 0;
- 800c338: 2000 movs r0, #0
- 800c33a: f8a4 0064 strh.w r0, [r4, #100] ; 0x64
- /* Clause 2 */
- if (tcplen == 0) {
- 800c33e: 4882 ldr r0, [pc, #520] ; (800c548 <tcp_receive+0x298>)
- 800c340: 8800 ldrh r0, [r0, #0]
- 800c342: 2800 cmp r0, #0
- 800c344: f040 81f4 bne.w 800c730 <tcp_receive+0x480>
- /* Clause 3 */
- if (pcb->snd_wl2 + pcb->snd_wnd == right_wnd_edge){
- 800c348: f8b4 6060 ldrh.w r6, [r4, #96] ; 0x60
- 800c34c: 6da0 ldr r0, [r4, #88] ; 0x58
- #endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */
- LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
- if (flags & TCP_ACK) {
- right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
- 800c34e: 1869 adds r1, r5, r1
- if (TCP_SEQ_LEQ(ackno, pcb->lastack)) {
- pcb->acked = 0;
- /* Clause 2 */
- if (tcplen == 0) {
- /* Clause 3 */
- if (pcb->snd_wl2 + pcb->snd_wnd == right_wnd_edge){
- 800c350: 1830 adds r0, r6, r0
- 800c352: 4288 cmp r0, r1
- 800c354: f040 81ec bne.w 800c730 <tcp_receive+0x480>
- /* Clause 4 */
- if (pcb->rtime >= 0) {
- 800c358: f9b4 1034 ldrsh.w r1, [r4, #52] ; 0x34
- 800c35c: 2900 cmp r1, #0
- 800c35e: f2c0 81e7 blt.w 800c730 <tcp_receive+0x480>
- /* Clause 5 */
- if (pcb->lastack == ackno) {
- 800c362: 429a cmp r2, r3
- 800c364: f040 81e4 bne.w 800c730 <tcp_receive+0x480>
- found_dupack = 1;
- if ((u8_t)(pcb->dupacks + 1) > pcb->dupacks) {
- 800c368: f894 2047 ldrb.w r2, [r4, #71] ; 0x47
- 800c36c: 1c53 adds r3, r2, #1
- 800c36e: b2db uxtb r3, r3
- 800c370: 4293 cmp r3, r2
- ++pcb->dupacks;
- 800c372: bf88 it hi
- 800c374: f884 3047 strbhi.w r3, [r4, #71] ; 0x47
- }
- if (pcb->dupacks > 3) {
- 800c378: f894 3047 ldrb.w r3, [r4, #71] ; 0x47
- 800c37c: 2b03 cmp r3, #3
- 800c37e: d90a bls.n 800c396 <tcp_receive+0xe6>
- /* Inflate the congestion window, but not if it means that
- the value overflows. */
- if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
- 800c380: f8b4 204c ldrh.w r2, [r4, #76] ; 0x4c
- 800c384: 8ee3 ldrh r3, [r4, #54] ; 0x36
- 800c386: 18d3 adds r3, r2, r3
- 800c388: b29b uxth r3, r3
- 800c38a: 4293 cmp r3, r2
- 800c38c: f240 80b2 bls.w 800c4f4 <tcp_receive+0x244>
- pcb->cwnd += pcb->mss;
- 800c390: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
- 800c394: e0ae b.n 800c4f4 <tcp_receive+0x244>
- }
- } else if (pcb->dupacks == 3) {
- 800c396: f040 80ad bne.w 800c4f4 <tcp_receive+0x244>
- /* Do fast retransmit */
- tcp_rexmit_fast(pcb);
- 800c39a: 4620 mov r0, r4
- 800c39c: f001 fb13 bl 800d9c6 <tcp_rexmit_fast>
- 800c3a0: e0a8 b.n 800c4f4 <tcp_receive+0x244>
- /* If Clause (1) or more is true, but not a duplicate ack, reset
- * count of consecutive duplicate acks */
- if (!found_dupack) {
- pcb->dupacks = 0;
- }
- } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)){
- 800c3a2: 43d1 mvns r1, r2
- 800c3a4: 42d9 cmn r1, r3
- 800c3a6: d47e bmi.n 800c4a6 <tcp_receive+0x1f6>
- 800c3a8: 6d21 ldr r1, [r4, #80] ; 0x50
- 800c3aa: 1a59 subs r1, r3, r1
- 800c3ac: 2900 cmp r1, #0
- 800c3ae: dc7a bgt.n 800c4a6 <tcp_receive+0x1f6>
- /* We come here when the ACK acknowledges new data. */
- /* Reset the "IN Fast Retransmit" flag, since we are no longer
- in fast retransmit. Also reset the congestion window to the
- slow start threshold. */
- if (pcb->flags & TF_INFR) {
- 800c3b0: 7fa1 ldrb r1, [r4, #30]
- 800c3b2: f001 0004 and.w r0, r1, #4
- 800c3b6: b2c0 uxtb r0, r0
- 800c3b8: b130 cbz r0, 800c3c8 <tcp_receive+0x118>
- pcb->flags &= ~TF_INFR;
- 800c3ba: f021 0104 bic.w r1, r1, #4
- 800c3be: 77a1 strb r1, [r4, #30]
- pcb->cwnd = pcb->ssthresh;
- 800c3c0: f8b4 104e ldrh.w r1, [r4, #78] ; 0x4e
- 800c3c4: f8a4 104c strh.w r1, [r4, #76] ; 0x4c
- /* Reset the number of retransmissions. */
- pcb->nrtx = 0;
- /* Reset the retransmission time-out. */
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- 800c3c8: f9b4 5040 ldrsh.w r5, [r4, #64] ; 0x40
- 800c3cc: f8b4 0042 ldrh.w r0, [r4, #66] ; 0x42
- pcb->snd_buf += pcb->acked;
- /* Reset the fast retransmit variables. */
- pcb->dupacks = 0;
- pcb->lastack = ackno;
- 800c3d0: 64a3 str r3, [r4, #72] ; 0x48
- /* Reset the number of retransmissions. */
- pcb->nrtx = 0;
- /* Reset the retransmission time-out. */
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- 800c3d2: eb00 00e5 add.w r0, r0, r5, asr #3
- /* Update the send buffer space. Diff between the two can never exceed 64K? */
- pcb->acked = (u16_t)(ackno - pcb->lastack);
- 800c3d6: 1a9a subs r2, r3, r2
- /* Reset the number of retransmissions. */
- pcb->nrtx = 0;
- /* Reset the retransmission time-out. */
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- 800c3d8: f8a4 0044 strh.w r0, [r4, #68] ; 0x44
- pcb->dupacks = 0;
- pcb->lastack = ackno;
- /* Update the congestion control variables (cwnd and
- ssthresh). */
- if (pcb->state >= ESTABLISHED) {
- 800c3dc: 7e23 ldrb r3, [r4, #24]
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- /* Update the send buffer space. Diff between the two can never exceed 64K? */
- pcb->acked = (u16_t)(ackno - pcb->lastack);
- pcb->snd_buf += pcb->acked;
- 800c3de: f8b4 0066 ldrh.w r0, [r4, #102] ; 0x66
- /* Reset the retransmission time-out. */
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- /* Update the send buffer space. Diff between the two can never exceed 64K? */
- pcb->acked = (u16_t)(ackno - pcb->lastack);
- 800c3e2: f8a4 2064 strh.w r2, [r4, #100] ; 0x64
- pcb->flags &= ~TF_INFR;
- pcb->cwnd = pcb->ssthresh;
- }
- /* Reset the number of retransmissions. */
- pcb->nrtx = 0;
- 800c3e6: 2100 movs r1, #0
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- /* Update the send buffer space. Diff between the two can never exceed 64K? */
- pcb->acked = (u16_t)(ackno - pcb->lastack);
- pcb->snd_buf += pcb->acked;
- 800c3e8: 1812 adds r2, r2, r0
- pcb->dupacks = 0;
- pcb->lastack = ackno;
- /* Update the congestion control variables (cwnd and
- ssthresh). */
- if (pcb->state >= ESTABLISHED) {
- 800c3ea: 2b03 cmp r3, #3
- pcb->flags &= ~TF_INFR;
- pcb->cwnd = pcb->ssthresh;
- }
- /* Reset the number of retransmissions. */
- pcb->nrtx = 0;
- 800c3ec: f884 1046 strb.w r1, [r4, #70] ; 0x46
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- /* Update the send buffer space. Diff between the two can never exceed 64K? */
- pcb->acked = (u16_t)(ackno - pcb->lastack);
- pcb->snd_buf += pcb->acked;
- 800c3f0: f8a4 2066 strh.w r2, [r4, #102] ; 0x66
- /* Reset the fast retransmit variables. */
- pcb->dupacks = 0;
- 800c3f4: f884 1047 strb.w r1, [r4, #71] ; 0x47
- pcb->lastack = ackno;
- /* Update the congestion control variables (cwnd and
- ssthresh). */
- if (pcb->state >= ESTABLISHED) {
- 800c3f8: d931 bls.n 800c45e <tcp_receive+0x1ae>
- if (pcb->cwnd < pcb->ssthresh) {
- 800c3fa: f8b4 204e ldrh.w r2, [r4, #78] ; 0x4e
- 800c3fe: f8b4 304c ldrh.w r3, [r4, #76] ; 0x4c
- 800c402: 429a cmp r2, r3
- if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
- 800c404: 8ee2 ldrh r2, [r4, #54] ; 0x36
- pcb->lastack = ackno;
- /* Update the congestion control variables (cwnd and
- ssthresh). */
- if (pcb->state >= ESTABLISHED) {
- if (pcb->cwnd < pcb->ssthresh) {
- 800c406: d900 bls.n 800c40a <tcp_receive+0x15a>
- 800c408: e002 b.n 800c410 <tcp_receive+0x160>
- if ((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
- pcb->cwnd += pcb->mss;
- }
- LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %"U16_F"\n", pcb->cwnd));
- } else {
- u16_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd);
- 800c40a: 4352 muls r2, r2
- 800c40c: fb92 f2f3 sdiv r2, r2, r3
- 800c410: 189a adds r2, r3, r2
- 800c412: b292 uxth r2, r2
- if (new_cwnd > pcb->cwnd) {
- 800c414: 429a cmp r2, r3
- 800c416: d922 bls.n 800c45e <tcp_receive+0x1ae>
- pcb->cwnd = new_cwnd;
- 800c418: f8a4 204c strh.w r2, [r4, #76] ; 0x4c
- 800c41c: e01f b.n 800c45e <tcp_receive+0x1ae>
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unacked\n",
- ntohl(pcb->unacked->tcphdr->seqno),
- ntohl(pcb->unacked->tcphdr->seqno) +
- TCP_TCPLEN(pcb->unacked)));
- next = pcb->unacked;
- 800c41e: 6f25 ldr r5, [r4, #112] ; 0x70
- pcb->unacked = pcb->unacked->next;
- 800c420: 682b ldr r3, [r5, #0]
- LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
- LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
- 800c422: 6868 ldr r0, [r5, #4]
- ntohl(pcb->unacked->tcphdr->seqno),
- ntohl(pcb->unacked->tcphdr->seqno) +
- TCP_TCPLEN(pcb->unacked)));
- next = pcb->unacked;
- pcb->unacked = pcb->unacked->next;
- 800c424: 6723 str r3, [r4, #112] ; 0x70
- LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
- LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
- 800c426: f7ff f925 bl 800b674 <pbuf_clen>
- /* Prevent ACK for FIN to generate a sent event */
- if ((pcb->acked != 0) && ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0)) {
- 800c42a: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
- 800c42e: b153 cbz r3, 800c446 <tcp_receive+0x196>
- 800c430: 68eb ldr r3, [r5, #12]
- 800c432: 8998 ldrh r0, [r3, #12]
- 800c434: f7fd fede bl 800a1f4 <lwip_ntohs>
- 800c438: 07c3 lsls r3, r0, #31
- 800c43a: d504 bpl.n 800c446 <tcp_receive+0x196>
- pcb->acked--;
- 800c43c: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
- 800c440: 3b01 subs r3, #1
- 800c442: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
- }
- pcb->snd_queuelen -= pbuf_clen(next->p);
- 800c446: 6868 ldr r0, [r5, #4]
- 800c448: f8b4 7068 ldrh.w r7, [r4, #104] ; 0x68
- 800c44c: f7ff f912 bl 800b674 <pbuf_clen>
- 800c450: 1a38 subs r0, r7, r0
- 800c452: f8a4 0068 strh.w r0, [r4, #104] ; 0x68
- tcp_seg_free(next);
- 800c456: 4628 mov r0, r5
- 800c458: f7ff fadd bl 800ba16 <tcp_seg_free>
- 800c45c: e000 b.n 800c460 <tcp_receive+0x1b0>
- ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
- /* Remove segment from the unacknowledged list if the incoming
- ACK acknowlegdes them. */
- while (pcb->unacked != NULL &&
- TCP_SEQ_LEQ(ntohl(pcb->unacked->tcphdr->seqno) +
- 800c45e: 4e38 ldr r6, [pc, #224] ; (800c540 <tcp_receive+0x290>)
- pcb->unacked != NULL?
- ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
- /* Remove segment from the unacknowledged list if the incoming
- ACK acknowlegdes them. */
- while (pcb->unacked != NULL &&
- 800c460: 6f23 ldr r3, [r4, #112] ; 0x70
- 800c462: b91b cbnz r3, 800c46c <tcp_receive+0x1bc>
- }
- }
- /* If there's nothing left to acknowledge, stop the retransmit
- timer, otherwise reset it to start again */
- if(pcb->unacked == NULL)
- 800c464: 6f22 ldr r2, [r4, #112] ; 0x70
- 800c466: 2300 movs r3, #0
- 800c468: b9d2 cbnz r2, 800c4a0 <tcp_receive+0x1f0>
- 800c46a: e015 b.n 800c498 <tcp_receive+0x1e8>
- ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
- /* Remove segment from the unacknowledged list if the incoming
- ACK acknowlegdes them. */
- while (pcb->unacked != NULL &&
- TCP_SEQ_LEQ(ntohl(pcb->unacked->tcphdr->seqno) +
- 800c46c: 68db ldr r3, [r3, #12]
- 800c46e: 6858 ldr r0, [r3, #4]
- 800c470: f7fd fec7 bl 800a202 <lwip_ntohl>
- 800c474: 6f23 ldr r3, [r4, #112] ; 0x70
- 800c476: 891d ldrh r5, [r3, #8]
- 800c478: 68db ldr r3, [r3, #12]
- 800c47a: 4607 mov r7, r0
- 800c47c: 8998 ldrh r0, [r3, #12]
- 800c47e: f7fd feb9 bl 800a1f4 <lwip_ntohs>
- 800c482: 6833 ldr r3, [r6, #0]
- 800c484: f010 0003 ands.w r0, r0, #3
- 800c488: bf18 it ne
- 800c48a: 2001 movne r0, #1
- 800c48c: 1afb subs r3, r7, r3
- 800c48e: 1828 adds r0, r5, r0
- 800c490: 181b adds r3, r3, r0
- pcb->unacked != NULL?
- ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0));
- /* Remove segment from the unacknowledged list if the incoming
- ACK acknowlegdes them. */
- while (pcb->unacked != NULL &&
- 800c492: 2b00 cmp r3, #0
- 800c494: ddc3 ble.n 800c41e <tcp_receive+0x16e>
- 800c496: e7e5 b.n 800c464 <tcp_receive+0x1b4>
- }
- /* If there's nothing left to acknowledge, stop the retransmit
- timer, otherwise reset it to start again */
- if(pcb->unacked == NULL)
- pcb->rtime = -1;
- 800c498: f64f 72ff movw r2, #65535 ; 0xffff
- 800c49c: 86a2 strh r2, [r4, #52] ; 0x34
- 800c49e: e000 b.n 800c4a2 <tcp_receive+0x1f2>
- else
- pcb->rtime = 0;
- 800c4a0: 86a3 strh r3, [r4, #52] ; 0x34
- pcb->polltmr = 0;
- 800c4a2: 77e3 strb r3, [r4, #31]
- 800c4a4: e026 b.n 800c4f4 <tcp_receive+0x244>
- } else {
- /* Fix bug bug #21582: out of sequence ACK, didn't really ack anything */
- pcb->acked = 0;
- 800c4a6: 2300 movs r3, #0
- 800c4a8: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
- 800c4ac: e022 b.n 800c4f4 <tcp_receive+0x244>
- TCP_TCPLEN(pcb->unsent), pcb->snd_nxt)) {
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unsent\n",
- ntohl(pcb->unsent->tcphdr->seqno), ntohl(pcb->unsent->tcphdr->seqno) +
- TCP_TCPLEN(pcb->unsent)));
- next = pcb->unsent;
- 800c4ae: 6ee5 ldr r5, [r4, #108] ; 0x6c
- pcb->unsent = pcb->unsent->next;
- 800c4b0: 682b ldr r3, [r5, #0]
- 800c4b2: 66e3 str r3, [r4, #108] ; 0x6c
- #if TCP_OVERSIZE
- if (pcb->unsent == NULL) {
- 800c4b4: b90b cbnz r3, 800c4ba <tcp_receive+0x20a>
- pcb->unsent_oversize = 0;
- 800c4b6: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
- }
- #endif /* TCP_OVERSIZE */
- LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen));
- LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p)));
- 800c4ba: 6868 ldr r0, [r5, #4]
- 800c4bc: f7ff f8da bl 800b674 <pbuf_clen>
- /* Prevent ACK for FIN to generate a sent event */
- if ((pcb->acked != 0) && ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0)) {
- 800c4c0: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
- 800c4c4: b153 cbz r3, 800c4dc <tcp_receive+0x22c>
- 800c4c6: 68eb ldr r3, [r5, #12]
- 800c4c8: 8998 ldrh r0, [r3, #12]
- 800c4ca: f7fd fe93 bl 800a1f4 <lwip_ntohs>
- 800c4ce: 07c7 lsls r7, r0, #31
- 800c4d0: d504 bpl.n 800c4dc <tcp_receive+0x22c>
- pcb->acked--;
- 800c4d2: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
- 800c4d6: 3b01 subs r3, #1
- 800c4d8: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
- }
- pcb->snd_queuelen -= pbuf_clen(next->p);
- 800c4dc: 6868 ldr r0, [r5, #4]
- 800c4de: f8b4 7068 ldrh.w r7, [r4, #104] ; 0x68
- 800c4e2: f7ff f8c7 bl 800b674 <pbuf_clen>
- 800c4e6: 1a38 subs r0, r7, r0
- 800c4e8: f8a4 0068 strh.w r0, [r4, #104] ; 0x68
- tcp_seg_free(next);
- 800c4ec: 4628 mov r0, r5
- 800c4ee: f7ff fa92 bl 800ba16 <tcp_seg_free>
- 800c4f2: e000 b.n 800c4f6 <tcp_receive+0x246>
- strange since an "unsent" segment shouldn't be acked. The
- rationale is that lwIP puts all outstanding segments on the
- ->unsent list after a retransmission, so these segments may
- in fact have been sent once. */
- while (pcb->unsent != NULL &&
- TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
- 800c4f4: 4e12 ldr r6, [pc, #72] ; (800c540 <tcp_receive+0x290>)
- on the list are acknowledged by the ACK. This may seem
- strange since an "unsent" segment shouldn't be acked. The
- rationale is that lwIP puts all outstanding segments on the
- ->unsent list after a retransmission, so these segments may
- in fact have been sent once. */
- while (pcb->unsent != NULL &&
- 800c4f6: 6ee3 ldr r3, [r4, #108] ; 0x6c
- 800c4f8: b913 cbnz r3, 800c500 <tcp_receive+0x250>
- pcb->rttest, pcb->rtseq, ackno));
- /* RTT estimation calculations. This is done by checking if the
- incoming segment acknowledges the segment we use to take a
- round-trip time measurement. */
- if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
- 800c4fa: 6ba3 ldr r3, [r4, #56] ; 0x38
- 800c4fc: bb33 cbnz r3, 800c54c <tcp_receive+0x29c>
- 800c4fe: e04d b.n 800c59c <tcp_receive+0x2ec>
- strange since an "unsent" segment shouldn't be acked. The
- rationale is that lwIP puts all outstanding segments on the
- ->unsent list after a retransmission, so these segments may
- in fact have been sent once. */
- while (pcb->unsent != NULL &&
- TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
- 800c500: 68db ldr r3, [r3, #12]
- 800c502: 6835 ldr r5, [r6, #0]
- 800c504: 6858 ldr r0, [r3, #4]
- 800c506: f7fd fe7c bl 800a202 <lwip_ntohl>
- 800c50a: 6ee3 ldr r3, [r4, #108] ; 0x6c
- 800c50c: 891f ldrh r7, [r3, #8]
- 800c50e: 68db ldr r3, [r3, #12]
- 800c510: 4680 mov r8, r0
- 800c512: 8998 ldrh r0, [r3, #12]
- 800c514: f7fd fe6e bl 800a1f4 <lwip_ntohs>
- 800c518: f010 0003 ands.w r0, r0, #3
- 800c51c: bf18 it ne
- 800c51e: 2001 movne r0, #1
- 800c520: ebc8 0505 rsb r5, r8, r5
- 800c524: 1838 adds r0, r7, r0
- 800c526: 1a2d subs r5, r5, r0
- on the list are acknowledged by the ACK. This may seem
- strange since an "unsent" segment shouldn't be acked. The
- rationale is that lwIP puts all outstanding segments on the
- ->unsent list after a retransmission, so these segments may
- in fact have been sent once. */
- while (pcb->unsent != NULL &&
- 800c528: 2d00 cmp r5, #0
- 800c52a: dbe6 blt.n 800c4fa <tcp_receive+0x24a>
- TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) +
- 800c52c: 6832 ldr r2, [r6, #0]
- 800c52e: 6d23 ldr r3, [r4, #80] ; 0x50
- 800c530: 1ad3 subs r3, r2, r3
- 800c532: 2b00 cmp r3, #0
- 800c534: ddbb ble.n 800c4ae <tcp_receive+0x1fe>
- 800c536: e7e0 b.n 800c4fa <tcp_receive+0x24a>
- 800c538: 20006b90 .word 0x20006b90
- 800c53c: 20006b84 .word 0x20006b84
- 800c540: 20006b8c .word 0x20006b8c
- 800c544: 20006b80 .word 0x20006b80
- 800c548: 20006b88 .word 0x20006b88
- pcb->rttest, pcb->rtseq, ackno));
- /* RTT estimation calculations. This is done by checking if the
- incoming segment acknowledges the segment we use to take a
- round-trip time measurement. */
- if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
- 800c54c: 497b ldr r1, [pc, #492] ; (800c73c <tcp_receive+0x48c>)
- 800c54e: 6be2 ldr r2, [r4, #60] ; 0x3c
- 800c550: 6809 ldr r1, [r1, #0]
- 800c552: 1a52 subs r2, r2, r1
- 800c554: 2a00 cmp r2, #0
- 800c556: da21 bge.n 800c59c <tcp_receive+0x2ec>
- /* diff between this shouldn't exceed 32K since this are tcp timer ticks
- and a round-trip shouldn't be that long... */
- m = (s16_t)(tcp_ticks - pcb->rttest);
- 800c558: 4a79 ldr r2, [pc, #484] ; (800c740 <tcp_receive+0x490>)
- LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
- m, m * TCP_SLOW_INTERVAL));
- /* This is taken directly from VJs original code in his paper */
- m = m - (pcb->sa >> 3);
- 800c55a: f8b4 1040 ldrh.w r1, [r4, #64] ; 0x40
- incoming segment acknowledges the segment we use to take a
- round-trip time measurement. */
- if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
- /* diff between this shouldn't exceed 32K since this are tcp timer ticks
- and a round-trip shouldn't be that long... */
- m = (s16_t)(tcp_ticks - pcb->rttest);
- 800c55e: 6812 ldr r2, [r2, #0]
- LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
- m, m * TCP_SLOW_INTERVAL));
- /* This is taken directly from VJs original code in his paper */
- m = m - (pcb->sa >> 3);
- 800c560: f341 00cc sbfx r0, r1, #3, #13
- incoming segment acknowledges the segment we use to take a
- round-trip time measurement. */
- if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) {
- /* diff between this shouldn't exceed 32K since this are tcp timer ticks
- and a round-trip shouldn't be that long... */
- m = (s16_t)(tcp_ticks - pcb->rttest);
- 800c564: 1ad2 subs r2, r2, r3
- LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
- m, m * TCP_SLOW_INTERVAL));
- /* This is taken directly from VJs original code in his paper */
- m = m - (pcb->sa >> 3);
- 800c566: 1a12 subs r2, r2, r0
- 800c568: b292 uxth r2, r2
- 800c56a: b293 uxth r3, r2
- pcb->sa += m;
- 800c56c: 1851 adds r1, r2, r1
- 800c56e: b289 uxth r1, r1
- if (m < 0) {
- 800c570: 0418 lsls r0, r3, #16
- LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n",
- m, m * TCP_SLOW_INTERVAL));
- /* This is taken directly from VJs original code in his paper */
- m = m - (pcb->sa >> 3);
- pcb->sa += m;
- 800c572: f8a4 1040 strh.w r1, [r4, #64] ; 0x40
- if (m < 0) {
- 800c576: d501 bpl.n 800c57c <tcp_receive+0x2cc>
- m = -m;
- 800c578: 4253 negs r3, r2
- 800c57a: b29b uxth r3, r3
- }
- m = m - (pcb->sv >> 2);
- 800c57c: f8b4 2042 ldrh.w r2, [r4, #66] ; 0x42
- 800c580: f342 008d sbfx r0, r2, #2, #14
- 800c584: 1a12 subs r2, r2, r0
- pcb->sv += m;
- 800c586: 18d3 adds r3, r2, r3
- 800c588: b29b uxth r3, r3
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- 800c58a: f341 01cc sbfx r1, r1, #3, #13
- pcb->sa += m;
- if (m < 0) {
- m = -m;
- }
- m = m - (pcb->sv >> 2);
- pcb->sv += m;
- 800c58e: f8a4 3042 strh.w r3, [r4, #66] ; 0x42
- pcb->rto = (pcb->sa >> 3) + pcb->sv;
- 800c592: 185b adds r3, r3, r1
- 800c594: f8a4 3044 strh.w r3, [r4, #68] ; 0x44
- LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: RTO %"U16_F" (%"U16_F" milliseconds)\n",
- pcb->rto, pcb->rto * TCP_SLOW_INTERVAL));
- pcb->rttest = 0;
- 800c598: 2300 movs r3, #0
- 800c59a: 63a3 str r3, [r4, #56] ; 0x38
- /* If the incoming segment contains data, we must process it
- further unless the pcb already received a FIN.
- (RFC 793, chapeter 3.9, "SEGMENT ARRIVES" in states CLOSE-WAIT, CLOSING,
- LAST-ACK and TIME-WAIT: "Ignore the segment text.") */
- if ((tcplen > 0) && (pcb->state < CLOSE_WAIT)) {
- 800c59c: 4b69 ldr r3, [pc, #420] ; (800c744 <tcp_receive+0x494>)
- 800c59e: 4a6a ldr r2, [pc, #424] ; (800c748 <tcp_receive+0x498>)
- 800c5a0: 8818 ldrh r0, [r3, #0]
- 800c5a2: 2800 cmp r0, #0
- 800c5a4: f000 80b3 beq.w 800c70e <tcp_receive+0x45e>
- 800c5a8: 7e23 ldrb r3, [r4, #24]
- 800c5aa: 2b06 cmp r3, #6
- 800c5ac: f200 80af bhi.w 800c70e <tcp_receive+0x45e>
- this if the sequence number of the incoming segment is less
- than rcv_nxt, and the sequence number plus the length of the
- segment is larger than rcv_nxt. */
- /* if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
- if (TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {*/
- if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)){
- 800c5b0: 6811 ldr r1, [r2, #0]
- 800c5b2: 6aa3 ldr r3, [r4, #40] ; 0x28
- 800c5b4: 43ca mvns r2, r1
- 800c5b6: 42da cmn r2, r3
- 800c5b8: d425 bmi.n 800c606 <tcp_receive+0x356>
- 800c5ba: 1c5a adds r2, r3, #1
- 800c5bc: 1a52 subs r2, r2, r1
- 800c5be: 1a10 subs r0, r2, r0
- 800c5c0: 2800 cmp r0, #0
- 800c5c2: dc20 bgt.n 800c606 <tcp_receive+0x356>
- After we are done with adjusting the pbuf pointers we must
- adjust the ->data pointer in the seg and the segment
- length.*/
- off = pcb->rcv_nxt - seqno;
- 800c5c4: 1a59 subs r1, r3, r1
- p = inseg.p;
- 800c5c6: 4b61 ldr r3, [pc, #388] ; (800c74c <tcp_receive+0x49c>)
- 800c5c8: 6858 ldr r0, [r3, #4]
- LWIP_ASSERT("inseg.p != NULL", inseg.p);
- LWIP_ASSERT("insane offset!", (off < 0x7fff));
- if (inseg.p->len < off) {
- 800c5ca: 8943 ldrh r3, [r0, #10]
- 800c5cc: 428b cmp r3, r1
- 800c5ce: da0a bge.n 800c5e6 <tcp_receive+0x336>
- LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
- new_tot_len = (u16_t)(inseg.p->tot_len - off);
- 800c5d0: 8902 ldrh r2, [r0, #8]
- off -= p->len;
- /* KJM following line changed (with addition of new_tot_len var)
- to fix bug #9076
- inseg.p->tot_len -= p->len; */
- p->tot_len = new_tot_len;
- p->len = 0;
- 800c5d2: 2500 movs r5, #0
- p = inseg.p;
- LWIP_ASSERT("inseg.p != NULL", inseg.p);
- LWIP_ASSERT("insane offset!", (off < 0x7fff));
- if (inseg.p->len < off) {
- LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
- new_tot_len = (u16_t)(inseg.p->tot_len - off);
- 800c5d4: 1a52 subs r2, r2, r1
- while (p->len < off) {
- 800c5d6: e003 b.n 800c5e0 <tcp_receive+0x330>
- off -= p->len;
- /* KJM following line changed (with addition of new_tot_len var)
- to fix bug #9076
- inseg.p->tot_len -= p->len; */
- p->tot_len = new_tot_len;
- 800c5d8: 8102 strh r2, [r0, #8]
- p->len = 0;
- 800c5da: 8145 strh r5, [r0, #10]
- p = p->next;
- 800c5dc: 6800 ldr r0, [r0, #0]
- LWIP_ASSERT("insane offset!", (off < 0x7fff));
- if (inseg.p->len < off) {
- LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
- new_tot_len = (u16_t)(inseg.p->tot_len - off);
- while (p->len < off) {
- off -= p->len;
- 800c5de: 1ac9 subs r1, r1, r3
- LWIP_ASSERT("inseg.p != NULL", inseg.p);
- LWIP_ASSERT("insane offset!", (off < 0x7fff));
- if (inseg.p->len < off) {
- LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off));
- new_tot_len = (u16_t)(inseg.p->tot_len - off);
- while (p->len < off) {
- 800c5e0: 8943 ldrh r3, [r0, #10]
- 800c5e2: 428b cmp r3, r1
- 800c5e4: dbf8 blt.n 800c5d8 <tcp_receive+0x328>
- if(pbuf_header(p, (s16_t)-off)) {
- /* Do we need to cope with this failing? Assert for now */
- LWIP_ASSERT("pbuf_header failed", 0);
- }
- } else {
- if(pbuf_header(inseg.p, (s16_t)-off)) {
- 800c5e6: 4249 negs r1, r1
- 800c5e8: b209 sxth r1, r1
- 800c5ea: f7fe ff40 bl 800b46e <pbuf_header>
- /* Do we need to cope with this failing? Assert for now */
- LWIP_ASSERT("pbuf_header failed", 0);
- }
- }
- inseg.len -= (u16_t)(pcb->rcv_nxt - seqno);
- 800c5ee: 4a57 ldr r2, [pc, #348] ; (800c74c <tcp_receive+0x49c>)
- 800c5f0: 4955 ldr r1, [pc, #340] ; (800c748 <tcp_receive+0x498>)
- 800c5f2: 8915 ldrh r5, [r2, #8]
- 800c5f4: 6808 ldr r0, [r1, #0]
- 800c5f6: 6aa3 ldr r3, [r4, #40] ; 0x28
- 800c5f8: 1940 adds r0, r0, r5
- 800c5fa: 1ac0 subs r0, r0, r3
- 800c5fc: 8110 strh r0, [r2, #8]
- inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
- 800c5fe: 68d2 ldr r2, [r2, #12]
- 800c600: 600b str r3, [r1, #0]
- 800c602: 6053 str r3, [r2, #4]
- 800c604: e006 b.n 800c614 <tcp_receive+0x364>
- }
- else {
- if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
- 800c606: 1ac9 subs r1, r1, r3
- 800c608: 2900 cmp r1, #0
- 800c60a: da03 bge.n 800c614 <tcp_receive+0x364>
- /* the whole segment is < rcv_nxt */
- /* must be a duplicate of a packet that has already been correctly handled */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: duplicate seqno %"U32_F"\n", seqno));
- tcp_ack_now(pcb);
- 800c60c: 7fa3 ldrb r3, [r4, #30]
- 800c60e: f043 0302 orr.w r3, r3, #2
- 800c612: 77a3 strb r3, [r4, #30]
- }
- /* The sequence number must be within the window (above rcv_nxt
- and below rcv_nxt + rcv_wnd) in order to be further
- processed. */
- if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,
- 800c614: 4b4c ldr r3, [pc, #304] ; (800c748 <tcp_receive+0x498>)
- 800c616: 6aa2 ldr r2, [r4, #40] ; 0x28
- 800c618: 681b ldr r3, [r3, #0]
- 800c61a: 1a99 subs r1, r3, r2
- 800c61c: 2900 cmp r1, #0
- 800c61e: db71 blt.n 800c704 <tcp_receive+0x454>
- 800c620: 1c59 adds r1, r3, #1
- 800c622: 8da0 ldrh r0, [r4, #44] ; 0x2c
- 800c624: 1a89 subs r1, r1, r2
- 800c626: 1a09 subs r1, r1, r0
- 800c628: 2900 cmp r1, #0
- 800c62a: dc6b bgt.n 800c704 <tcp_receive+0x454>
- pcb->rcv_nxt + pcb->rcv_wnd - 1)){
- if (pcb->rcv_nxt == seqno) {
- 800c62c: 429a cmp r2, r3
- 800c62e: d169 bne.n 800c704 <tcp_receive+0x454>
- /* The incoming segment is the next in sequence. We check if
- we have to trim the end of the segment and update rcv_nxt
- and pass the data to the application. */
- tcplen = TCP_TCPLEN(&inseg);
- 800c630: 4d46 ldr r5, [pc, #280] ; (800c74c <tcp_receive+0x49c>)
- 800c632: 68eb ldr r3, [r5, #12]
- 800c634: 892e ldrh r6, [r5, #8]
- 800c636: 8998 ldrh r0, [r3, #12]
- 800c638: f7fd fddc bl 800a1f4 <lwip_ntohs>
- 800c63c: f010 0003 ands.w r0, r0, #3
- 800c640: bf18 it ne
- 800c642: 2001 movne r0, #1
- 800c644: 4b3f ldr r3, [pc, #252] ; (800c744 <tcp_receive+0x494>)
- 800c646: 1830 adds r0, r6, r0
- 800c648: b280 uxth r0, r0
- 800c64a: 8018 strh r0, [r3, #0]
- if (tcplen > pcb->rcv_wnd) {
- 800c64c: 8da3 ldrh r3, [r4, #44] ; 0x2c
- 800c64e: 4283 cmp r3, r0
- 800c650: d230 bcs.n 800c6b4 <tcp_receive+0x404>
- LWIP_DEBUGF(TCP_INPUT_DEBUG,
- ("tcp_receive: other end overran receive window"
- "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n",
- seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd));
- if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
- 800c652: 68eb ldr r3, [r5, #12]
- 800c654: 8998 ldrh r0, [r3, #12]
- 800c656: f7fd fdcd bl 800a1f4 <lwip_ntohs>
- 800c65a: 07c0 lsls r0, r0, #31
- 800c65c: d50c bpl.n 800c678 <tcp_receive+0x3c8>
- /* Must remove the FIN from the header as we're trimming
- * that byte of sequence-space from the packet */
- TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) &~ TCP_FIN);
- 800c65e: 68ed ldr r5, [r5, #12]
- 800c660: 89ae ldrh r6, [r5, #12]
- 800c662: 4630 mov r0, r6
- 800c664: f7fd fdc6 bl 800a1f4 <lwip_ntohs>
- 800c668: f000 003e and.w r0, r0, #62 ; 0x3e
- 800c66c: f7fd fdbd bl 800a1ea <lwip_htons>
- 800c670: f426 567c bic.w r6, r6, #16128 ; 0x3f00
- 800c674: 4330 orrs r0, r6
- 800c676: 81a8 strh r0, [r5, #12]
- }
- /* Adjust length of segment to fit in the window. */
- inseg.len = pcb->rcv_wnd;
- 800c678: 8da3 ldrh r3, [r4, #44] ; 0x2c
- 800c67a: 4d34 ldr r5, [pc, #208] ; (800c74c <tcp_receive+0x49c>)
- 800c67c: 812b strh r3, [r5, #8]
- if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) {
- 800c67e: 68eb ldr r3, [r5, #12]
- 800c680: 8998 ldrh r0, [r3, #12]
- 800c682: f7fd fdb7 bl 800a1f4 <lwip_ntohs>
- 800c686: f000 0002 and.w r0, r0, #2
- 800c68a: b280 uxth r0, r0
- 800c68c: b110 cbz r0, 800c694 <tcp_receive+0x3e4>
- inseg.len -= 1;
- 800c68e: 892b ldrh r3, [r5, #8]
- 800c690: 3b01 subs r3, #1
- 800c692: 812b strh r3, [r5, #8]
- }
- pbuf_realloc(inseg.p, inseg.len);
- 800c694: 6868 ldr r0, [r5, #4]
- 800c696: 8929 ldrh r1, [r5, #8]
- 800c698: f7fe ff3f bl 800b51a <pbuf_realloc>
- tcplen = TCP_TCPLEN(&inseg);
- 800c69c: 68eb ldr r3, [r5, #12]
- 800c69e: 892e ldrh r6, [r5, #8]
- 800c6a0: 8998 ldrh r0, [r3, #12]
- 800c6a2: f7fd fda7 bl 800a1f4 <lwip_ntohs>
- 800c6a6: f010 0003 ands.w r0, r0, #3
- 800c6aa: bf18 it ne
- 800c6ac: 2001 movne r0, #1
- 800c6ae: 4b25 ldr r3, [pc, #148] ; (800c744 <tcp_receive+0x494>)
- 800c6b0: 1830 adds r0, r6, r0
- 800c6b2: 8018 strh r0, [r3, #0]
- pcb->ooseq = next;
- }
- }
- #endif /* TCP_QUEUE_OOSEQ */
- pcb->rcv_nxt = seqno + tcplen;
- 800c6b4: 4b23 ldr r3, [pc, #140] ; (800c744 <tcp_receive+0x494>)
- 800c6b6: 4a24 ldr r2, [pc, #144] ; (800c748 <tcp_receive+0x498>)
- 800c6b8: 881b ldrh r3, [r3, #0]
- 800c6ba: 6812 ldr r2, [r2, #0]
- 800c6bc: 189a adds r2, r3, r2
- 800c6be: 62a2 str r2, [r4, #40] ; 0x28
- /* Update the receiver's (our) window. */
- LWIP_ASSERT("tcp_receive: tcplen > rcv_wnd\n", pcb->rcv_wnd >= tcplen);
- pcb->rcv_wnd -= tcplen;
- 800c6c0: 8da2 ldrh r2, [r4, #44] ; 0x2c
- 800c6c2: 1ad3 subs r3, r2, r3
- 800c6c4: 85a3 strh r3, [r4, #44] ; 0x2c
- tcp_update_rcv_ann_wnd(pcb);
- 800c6c6: 4620 mov r0, r4
- 800c6c8: f7ff f96e bl 800b9a8 <tcp_update_rcv_ann_wnd>
- chains its data on this pbuf as well.
- If the segment was a FIN, we set the TF_GOT_FIN flag that will
- be used to indicate to the application that the remote side has
- closed its end of the connection. */
- if (inseg.p->tot_len > 0) {
- 800c6cc: 4b1f ldr r3, [pc, #124] ; (800c74c <tcp_receive+0x49c>)
- 800c6ce: 685a ldr r2, [r3, #4]
- 800c6d0: 8911 ldrh r1, [r2, #8]
- 800c6d2: b119 cbz r1, 800c6dc <tcp_receive+0x42c>
- recv_data = inseg.p;
- 800c6d4: 491e ldr r1, [pc, #120] ; (800c750 <tcp_receive+0x4a0>)
- 800c6d6: 600a str r2, [r1, #0]
- /* Since this pbuf now is the responsibility of the
- application, we delete our reference to it so that we won't
- (mistakingly) deallocate it. */
- inseg.p = NULL;
- 800c6d8: 2200 movs r2, #0
- 800c6da: 605a str r2, [r3, #4]
- }
- if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) {
- 800c6dc: 68db ldr r3, [r3, #12]
- 800c6de: 8998 ldrh r0, [r3, #12]
- 800c6e0: f7fd fd88 bl 800a1f4 <lwip_ntohs>
- 800c6e4: 07c1 lsls r1, r0, #31
- 800c6e6: d504 bpl.n 800c6f2 <tcp_receive+0x442>
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received FIN.\n"));
- recv_flags |= TF_GOT_FIN;
- 800c6e8: 4b1a ldr r3, [pc, #104] ; (800c754 <tcp_receive+0x4a4>)
- 800c6ea: 781a ldrb r2, [r3, #0]
- 800c6ec: f042 0220 orr.w r2, r2, #32
- 800c6f0: 701a strb r2, [r3, #0]
- }
- #endif /* TCP_QUEUE_OOSEQ */
- /* Acknowledge the segment(s). */
- tcp_ack(pcb);
- 800c6f2: 7fa3 ldrb r3, [r4, #30]
- 800c6f4: 07da lsls r2, r3, #31
- 800c6f6: d502 bpl.n 800c6fe <tcp_receive+0x44e>
- 800c6f8: f023 0301 bic.w r3, r3, #1
- 800c6fc: e013 b.n 800c726 <tcp_receive+0x476>
- 800c6fe: f043 0301 orr.w r3, r3, #1
- 800c702: e012 b.n 800c72a <tcp_receive+0x47a>
- } else {
- /* We get here if the incoming segment is out-of-sequence. */
- tcp_send_empty_ack(pcb);
- 800c704: 4620 mov r0, r4
- TCP_SEQ_GEQ(seqno, pcb->rcv_nxt + pcb->rcv_wnd)) {*/
- if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd-1)){
- tcp_ack_now(pcb);
- }
- }
- }
- 800c706: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
- /* Acknowledge the segment(s). */
- tcp_ack(pcb);
- } else {
- /* We get here if the incoming segment is out-of-sequence. */
- tcp_send_empty_ack(pcb);
- 800c70a: f000 bf72 b.w 800d5f2 <tcp_send_empty_ack>
- } else {
- /* Segments with length 0 is taken care of here. Segments that
- fall out of the window are ACKed. */
- /*if (TCP_SEQ_GT(pcb->rcv_nxt, seqno) ||
- TCP_SEQ_GEQ(seqno, pcb->rcv_nxt + pcb->rcv_wnd)) {*/
- if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd-1)){
- 800c70e: 6812 ldr r2, [r2, #0]
- 800c710: 6aa3 ldr r3, [r4, #40] ; 0x28
- 800c712: 1ad1 subs r1, r2, r3
- 800c714: 2900 cmp r1, #0
- 800c716: db05 blt.n 800c724 <tcp_receive+0x474>
- 800c718: 3201 adds r2, #1
- 800c71a: 8da1 ldrh r1, [r4, #44] ; 0x2c
- 800c71c: 1ad3 subs r3, r2, r3
- 800c71e: 1a5b subs r3, r3, r1
- 800c720: 2b00 cmp r3, #0
- 800c722: dd09 ble.n 800c738 <tcp_receive+0x488>
- tcp_ack_now(pcb);
- 800c724: 7fa3 ldrb r3, [r4, #30]
- 800c726: f043 0302 orr.w r3, r3, #2
- 800c72a: 77a3 strb r3, [r4, #30]
- 800c72c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- }
- }
- /* If Clause (1) or more is true, but not a duplicate ack, reset
- * count of consecutive duplicate acks */
- if (!found_dupack) {
- pcb->dupacks = 0;
- 800c730: 2300 movs r3, #0
- 800c732: f884 3047 strb.w r3, [r4, #71] ; 0x47
- 800c736: e6dd b.n 800c4f4 <tcp_receive+0x244>
- 800c738: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800c73c: 20006b8c .word 0x20006b8c
- 800c740: 20008340 .word 0x20008340
- 800c744: 20006b88 .word 0x20006b88
- 800c748: 20006b84 .word 0x20006b84
- 800c74c: 20006b9c .word 0x20006b9c
- 800c750: 20006b94 .word 0x20006b94
- 800c754: 20006b91 .word 0x20006b91
- 0800c758 <tcp_input>:
- * @param p received TCP segment to process (p->payload pointing to the IP header)
- * @param inp network interface on which this segment was received
- */
- void
- tcp_input(struct pbuf *p, struct netif *inp)
- {
- 800c758: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- u8_t hdrlen;
- err_t err;
- PERF_START;
- TCP_STATS_INC(tcp.recv);
- 800c75c: 4f91 ldr r7, [pc, #580] ; (800c9a4 <tcp_input+0x24c>)
- snmp_inc_tcpinsegs();
- iphdr = (struct ip_hdr *)p->payload;
- 800c75e: 4a92 ldr r2, [pc, #584] ; (800c9a8 <tcp_input+0x250>)
- u8_t hdrlen;
- err_t err;
- PERF_START;
- TCP_STATS_INC(tcp.recv);
- 800c760: f8b7 3092 ldrh.w r3, [r7, #146] ; 0x92
- snmp_inc_tcpinsegs();
- iphdr = (struct ip_hdr *)p->payload;
- tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
- 800c764: 4c91 ldr r4, [pc, #580] ; (800c9ac <tcp_input+0x254>)
- u8_t hdrlen;
- err_t err;
- PERF_START;
- TCP_STATS_INC(tcp.recv);
- 800c766: 3301 adds r3, #1
- 800c768: f8a7 3092 strh.w r3, [r7, #146] ; 0x92
- snmp_inc_tcpinsegs();
- iphdr = (struct ip_hdr *)p->payload;
- 800c76c: 6843 ldr r3, [r0, #4]
- 800c76e: 6013 str r3, [r2, #0]
- tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
- 800c770: 781a ldrb r2, [r3, #0]
- 800c772: f002 020f and.w r2, r2, #15
- * @param p received TCP segment to process (p->payload pointing to the IP header)
- * @param inp network interface on which this segment was received
- */
- void
- tcp_input(struct pbuf *p, struct netif *inp)
- {
- 800c776: 4688 mov r8, r1
- #if TCP_INPUT_DEBUG
- tcp_debug_print(tcphdr);
- #endif
- /* remove header from payload */
- if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
- 800c778: 0091 lsls r1, r2, #2
- TCP_STATS_INC(tcp.recv);
- snmp_inc_tcpinsegs();
- iphdr = (struct ip_hdr *)p->payload;
- tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
- 800c77a: eb03 0382 add.w r3, r3, r2, lsl #2
- #if TCP_INPUT_DEBUG
- tcp_debug_print(tcphdr);
- #endif
- /* remove header from payload */
- if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
- 800c77e: 4249 negs r1, r1
- TCP_STATS_INC(tcp.recv);
- snmp_inc_tcpinsegs();
- iphdr = (struct ip_hdr *)p->payload;
- tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
- 800c780: 6023 str r3, [r4, #0]
- * @param p received TCP segment to process (p->payload pointing to the IP header)
- * @param inp network interface on which this segment was received
- */
- void
- tcp_input(struct pbuf *p, struct netif *inp)
- {
- 800c782: 4606 mov r6, r0
- #if TCP_INPUT_DEBUG
- tcp_debug_print(tcphdr);
- #endif
- /* remove header from payload */
- if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) {
- 800c784: f7fe fe73 bl 800b46e <pbuf_header>
- 800c788: 463b mov r3, r7
- 800c78a: b910 cbnz r0, 800c792 <tcp_input+0x3a>
- 800c78c: 8932 ldrh r2, [r6, #8]
- 800c78e: 2a13 cmp r2, #19
- 800c790: d806 bhi.n 800c7a0 <tcp_input+0x48>
- /* drop short packets */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet (%"U16_F" bytes) discarded\n", p->tot_len));
- TCP_STATS_INC(tcp.lenerr);
- 800c792: f8b3 209a ldrh.w r2, [r3, #154] ; 0x9a
- 800c796: 3201 adds r2, #1
- 800c798: f8a3 209a strh.w r2, [r3, #154] ; 0x9a
- goto dropped;
- 800c79c: f000 bc09 b.w 800cfb2 <tcp_input+0x85a>
- }
- /* Don't even process incoming broadcasts/multicasts. */
- if (ip_addr_isbroadcast(¤t_iphdr_dest, inp) ||
- 800c7a0: 4d83 ldr r5, [pc, #524] ; (800c9b0 <tcp_input+0x258>)
- 800c7a2: 4641 mov r1, r8
- 800c7a4: 6828 ldr r0, [r5, #0]
- 800c7a6: f001 fdec bl 800e382 <ip4_addr_isbroadcast>
- 800c7aa: b920 cbnz r0, 800c7b6 <tcp_input+0x5e>
- ip_addr_ismulticast(¤t_iphdr_dest)) {
- 800c7ac: 682b ldr r3, [r5, #0]
- 800c7ae: f003 03f0 and.w r3, r3, #240 ; 0xf0
- TCP_STATS_INC(tcp.lenerr);
- goto dropped;
- }
- /* Don't even process incoming broadcasts/multicasts. */
- if (ip_addr_isbroadcast(¤t_iphdr_dest, inp) ||
- 800c7b2: 2be0 cmp r3, #224 ; 0xe0
- 800c7b4: d106 bne.n 800c7c4 <tcp_input+0x6c>
- ip_addr_ismulticast(¤t_iphdr_dest)) {
- TCP_STATS_INC(tcp.proterr);
- 800c7b6: 4b7b ldr r3, [pc, #492] ; (800c9a4 <tcp_input+0x24c>)
- 800c7b8: f8b3 20a0 ldrh.w r2, [r3, #160] ; 0xa0
- 800c7bc: 3201 adds r2, #1
- 800c7be: f8a3 20a0 strh.w r2, [r3, #160] ; 0xa0
- goto dropped;
- 800c7c2: e3f6 b.n 800cfb2 <tcp_input+0x85a>
- }
- #endif
- /* Move the payload pointer in the pbuf so that it points to the
- TCP data instead of the TCP header. */
- hdrlen = TCPH_HDRLEN(tcphdr);
- 800c7c4: 6823 ldr r3, [r4, #0]
- 800c7c6: 8998 ldrh r0, [r3, #12]
- 800c7c8: f7fd fd14 bl 800a1f4 <lwip_ntohs>
- if(pbuf_header(p, -(hdrlen * 4))){
- 800c7cc: f06f 0103 mvn.w r1, #3
- 800c7d0: f3c0 3307 ubfx r3, r0, #12, #8
- 800c7d4: 4359 muls r1, r3
- 800c7d6: 4630 mov r0, r6
- 800c7d8: f7fe fe49 bl 800b46e <pbuf_header>
- 800c7dc: 4683 mov fp, r0
- 800c7de: b128 cbz r0, 800c7ec <tcp_input+0x94>
- /* drop short packets */
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet\n"));
- TCP_STATS_INC(tcp.lenerr);
- 800c7e0: f8b7 309a ldrh.w r3, [r7, #154] ; 0x9a
- 800c7e4: 3301 adds r3, #1
- 800c7e6: f8a7 309a strh.w r3, [r7, #154] ; 0x9a
- goto dropped;
- 800c7ea: e3e2 b.n 800cfb2 <tcp_input+0x85a>
- }
- /* Convert fields in TCP header to host byte order. */
- tcphdr->src = ntohs(tcphdr->src);
- 800c7ec: 6827 ldr r7, [r4, #0]
- 800c7ee: 8838 ldrh r0, [r7, #0]
- 800c7f0: f7fd fd00 bl 800a1f4 <lwip_ntohs>
- 800c7f4: 8038 strh r0, [r7, #0]
- tcphdr->dest = ntohs(tcphdr->dest);
- 800c7f6: 6827 ldr r7, [r4, #0]
- 800c7f8: 8878 ldrh r0, [r7, #2]
- 800c7fa: f7fd fcfb bl 800a1f4 <lwip_ntohs>
- 800c7fe: 8078 strh r0, [r7, #2]
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- 800c800: 6827 ldr r7, [r4, #0]
- 800c802: 6878 ldr r0, [r7, #4]
- 800c804: f7fd fcfd bl 800a202 <lwip_ntohl>
- 800c808: 4b6a ldr r3, [pc, #424] ; (800c9b4 <tcp_input+0x25c>)
- 800c80a: 6078 str r0, [r7, #4]
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- 800c80c: 6827 ldr r7, [r4, #0]
- }
- /* Convert fields in TCP header to host byte order. */
- tcphdr->src = ntohs(tcphdr->src);
- tcphdr->dest = ntohs(tcphdr->dest);
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- 800c80e: 6018 str r0, [r3, #0]
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- 800c810: 68b8 ldr r0, [r7, #8]
- 800c812: f7fd fcf6 bl 800a202 <lwip_ntohl>
- 800c816: 4b68 ldr r3, [pc, #416] ; (800c9b8 <tcp_input+0x260>)
- 800c818: 60b8 str r0, [r7, #8]
- tcphdr->wnd = ntohs(tcphdr->wnd);
- 800c81a: 6827 ldr r7, [r4, #0]
- /* Convert fields in TCP header to host byte order. */
- tcphdr->src = ntohs(tcphdr->src);
- tcphdr->dest = ntohs(tcphdr->dest);
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- 800c81c: 6018 str r0, [r3, #0]
- tcphdr->wnd = ntohs(tcphdr->wnd);
- 800c81e: 89f8 ldrh r0, [r7, #14]
- 800c820: f7fd fce8 bl 800a1f4 <lwip_ntohs>
- 800c824: 81f8 strh r0, [r7, #14]
- flags = TCPH_FLAGS(tcphdr);
- 800c826: 6823 ldr r3, [r4, #0]
- 800c828: 8998 ldrh r0, [r3, #12]
- 800c82a: f7fd fce3 bl 800a1f4 <lwip_ntohs>
- 800c82e: 4b63 ldr r3, [pc, #396] ; (800c9bc <tcp_input+0x264>)
- tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
- 800c830: f8b6 9008 ldrh.w r9, [r6, #8]
-
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
- LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
- if (pcb->remote_port == tcphdr->src &&
- 800c834: 6827 ldr r7, [r4, #0]
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- tcphdr->wnd = ntohs(tcphdr->wnd);
- flags = TCPH_FLAGS(tcphdr);
- tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
- 800c836: f010 0c03 ands.w ip, r0, #3
- tcphdr->dest = ntohs(tcphdr->dest);
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- tcphdr->wnd = ntohs(tcphdr->wnd);
- flags = TCPH_FLAGS(tcphdr);
- 800c83a: f000 013f and.w r1, r0, #63 ; 0x3f
- tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
- 800c83e: bf18 it ne
- 800c840: f04f 0c01 movne.w ip, #1
- tcphdr->dest = ntohs(tcphdr->dest);
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- tcphdr->wnd = ntohs(tcphdr->wnd);
- flags = TCPH_FLAGS(tcphdr);
- 800c844: 7019 strb r1, [r3, #0]
- tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
- 800c846: 44cc add ip, r9
- 800c848: 4b5d ldr r3, [pc, #372] ; (800c9c0 <tcp_input+0x268>)
- LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
- LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
- if (pcb->remote_port == tcphdr->src &&
- pcb->local_port == tcphdr->dest &&
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src) &&
- ip_addr_cmp(&(pcb->local_ip), ¤t_iphdr_dest)) {
- 800c84a: 6829 ldr r1, [r5, #0]
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- tcphdr->wnd = ntohs(tcphdr->wnd);
- flags = TCPH_FLAGS(tcphdr);
- tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
- 800c84c: fa1f fc8c uxth.w ip, ip
- 800c850: f8a3 c000 strh.w ip, [r3]
- /* Demultiplex an incoming segment. First, we check if it is destined
- for an active connection. */
- prev = NULL;
-
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800c854: 4b5b ldr r3, [pc, #364] ; (800c9c4 <tcp_input+0x26c>)
- 800c856: f8d3 a000 ldr.w sl, [r3]
- LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
- LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
- if (pcb->remote_port == tcphdr->src &&
- pcb->local_port == tcphdr->dest &&
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src) &&
- 800c85a: 4b5b ldr r3, [pc, #364] ; (800c9c8 <tcp_input+0x270>)
- tcphdr->dest = ntohs(tcphdr->dest);
- seqno = tcphdr->seqno = ntohl(tcphdr->seqno);
- ackno = tcphdr->ackno = ntohl(tcphdr->ackno);
- tcphdr->wnd = ntohs(tcphdr->wnd);
- flags = TCPH_FLAGS(tcphdr);
- 800c85c: 4602 mov r2, r0
- LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
- LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
- if (pcb->remote_port == tcphdr->src &&
- pcb->local_port == tcphdr->dest &&
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src) &&
- 800c85e: f8d3 8000 ldr.w r8, [r3]
- /* Demultiplex an incoming segment. First, we check if it is destined
- for an active connection. */
- prev = NULL;
-
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800c862: 4654 mov r4, sl
- flags = TCPH_FLAGS(tcphdr);
- tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0);
- /* Demultiplex an incoming segment. First, we check if it is destined
- for an active connection. */
- prev = NULL;
- 800c864: 4658 mov r0, fp
-
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800c866: e019 b.n 800c89c <tcp_input+0x144>
- LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED);
- LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
- LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN);
- if (pcb->remote_port == tcphdr->src &&
- 800c868: 8ba5 ldrh r5, [r4, #28]
- 800c86a: 883b ldrh r3, [r7, #0]
- 800c86c: 429d cmp r5, r3
- 800c86e: d113 bne.n 800c898 <tcp_input+0x140>
- 800c870: 8b65 ldrh r5, [r4, #26]
- 800c872: 887b ldrh r3, [r7, #2]
- 800c874: 429d cmp r5, r3
- 800c876: d10f bne.n 800c898 <tcp_input+0x140>
- pcb->local_port == tcphdr->dest &&
- 800c878: 6863 ldr r3, [r4, #4]
- 800c87a: 4543 cmp r3, r8
- 800c87c: d10c bne.n 800c898 <tcp_input+0x140>
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src) &&
- 800c87e: 6823 ldr r3, [r4, #0]
- 800c880: 428b cmp r3, r1
- 800c882: d109 bne.n 800c898 <tcp_input+0x140>
- /* Move this PCB to the front of the list so that subsequent
- lookups will be faster (we exploit locality in TCP segment
- arrivals). */
- LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb);
- if (prev != NULL) {
- 800c884: 2800 cmp r0, #0
- 800c886: f000 83a0 beq.w 800cfca <tcp_input+0x872>
- prev->next = pcb->next;
- 800c88a: 68e3 ldr r3, [r4, #12]
- 800c88c: 60c3 str r3, [r0, #12]
- pcb->next = tcp_active_pcbs;
- tcp_active_pcbs = pcb;
- 800c88e: 4b4d ldr r3, [pc, #308] ; (800c9c4 <tcp_input+0x26c>)
- lookups will be faster (we exploit locality in TCP segment
- arrivals). */
- LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb);
- if (prev != NULL) {
- prev->next = pcb->next;
- pcb->next = tcp_active_pcbs;
- 800c890: f8c4 a00c str.w sl, [r4, #12]
- tcp_active_pcbs = pcb;
- 800c894: 601c str r4, [r3, #0]
- 800c896: e398 b.n 800cfca <tcp_input+0x872>
- 800c898: 4620 mov r0, r4
- /* Demultiplex an incoming segment. First, we check if it is destined
- for an active connection. */
- prev = NULL;
-
- for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
- 800c89a: 68e4 ldr r4, [r4, #12]
- 800c89c: 2c00 cmp r4, #0
- 800c89e: d1e3 bne.n 800c868 <tcp_input+0x110>
- 800c8a0: e3a5 b.n 800cfee <tcp_input+0x896>
- if (pcb == NULL) {
- /* If it did not go to an active connection, we check the connections
- in the TIME-WAIT state. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
- if (pcb->remote_port == tcphdr->src &&
- 800c8a2: 8b98 ldrh r0, [r3, #28]
- 800c8a4: 883c ldrh r4, [r7, #0]
- 800c8a6: 4284 cmp r4, r0
- 800c8a8: d130 bne.n 800c90c <tcp_input+0x1b4>
- pcb->local_port == tcphdr->dest &&
- 800c8aa: 8b58 ldrh r0, [r3, #26]
- if (pcb == NULL) {
- /* If it did not go to an active connection, we check the connections
- in the TIME-WAIT state. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
- if (pcb->remote_port == tcphdr->src &&
- 800c8ac: 887d ldrh r5, [r7, #2]
- 800c8ae: 4285 cmp r5, r0
- 800c8b0: d12c bne.n 800c90c <tcp_input+0x1b4>
- pcb->local_port == tcphdr->dest &&
- 800c8b2: 6858 ldr r0, [r3, #4]
- 800c8b4: 4540 cmp r0, r8
- 800c8b6: d129 bne.n 800c90c <tcp_input+0x1b4>
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src) &&
- 800c8b8: 6818 ldr r0, [r3, #0]
- 800c8ba: 4288 cmp r0, r1
- 800c8bc: d126 bne.n 800c90c <tcp_input+0x1b4>
- /* RFC 1337: in TIME_WAIT, ignore RST and ACK FINs + any 'acceptable' segments */
- /* RFC 793 3.9 Event Processing - Segment Arrives:
- * - first check sequence number - we skip that one in TIME_WAIT (always
- * acceptable since we only send ACKs)
- * - second check the RST bit (... return) */
- if (flags & TCP_RST) {
- 800c8be: f002 0104 and.w r1, r2, #4
- 800c8c2: b2c9 uxtb r1, r1
- 800c8c4: 2900 cmp r1, #0
- 800c8c6: f040 837a bne.w 800cfbe <tcp_input+0x866>
- return ERR_OK;
- }
- /* - fourth, check the SYN bit, */
- if (flags & TCP_SYN) {
- 800c8ca: f002 0102 and.w r1, r2, #2
- 800c8ce: b2c9 uxtb r1, r1
- 800c8d0: b159 cbz r1, 800c8ea <tcp_input+0x192>
- /* If an incoming segment is not acceptable, an acknowledgment
- should be sent in reply */
- if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt+pcb->rcv_wnd)) {
- 800c8d2: 4a38 ldr r2, [pc, #224] ; (800c9b4 <tcp_input+0x25c>)
- 800c8d4: 6811 ldr r1, [r2, #0]
- 800c8d6: 6a9a ldr r2, [r3, #40] ; 0x28
- 800c8d8: 1a8a subs r2, r1, r2
- 800c8da: d40b bmi.n 800c8f4 <tcp_input+0x19c>
- 800c8dc: 8d98 ldrh r0, [r3, #44] ; 0x2c
- 800c8de: 1a12 subs r2, r2, r0
- 800c8e0: 2a00 cmp r2, #0
- 800c8e2: dc07 bgt.n 800c8f4 <tcp_input+0x19c>
- /* If the SYN is in the window it is an error, send a reset */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- 800c8e4: 9500 str r5, [sp, #0]
- 800c8e6: 9401 str r4, [sp, #4]
- 800c8e8: e041 b.n 800c96e <tcp_input+0x216>
- tcphdr->dest, tcphdr->src);
- return ERR_OK;
- }
- } else if (flags & TCP_FIN) {
- 800c8ea: 07d2 lsls r2, r2, #31
- 800c8ec: d502 bpl.n 800c8f4 <tcp_input+0x19c>
- /* - eighth, check the FIN bit: Remain in the TIME-WAIT state.
- Restart the 2 MSL time-wait timeout.*/
- pcb->tmr = tcp_ticks;
- 800c8ee: 4a37 ldr r2, [pc, #220] ; (800c9cc <tcp_input+0x274>)
- 800c8f0: 6812 ldr r2, [r2, #0]
- 800c8f2: 625a str r2, [r3, #36] ; 0x24
- }
- if ((tcplen > 0)) {
- 800c8f4: f1bc 0f00 cmp.w ip, #0
- 800c8f8: f000 8361 beq.w 800cfbe <tcp_input+0x866>
- /* Acknowledge data, FIN or out-of-window SYN */
- pcb->flags |= TF_ACK_NOW;
- 800c8fc: 7f9a ldrb r2, [r3, #30]
- 800c8fe: f042 0202 orr.w r2, r2, #2
- 800c902: 779a strb r2, [r3, #30]
- return tcp_output(pcb);
- 800c904: 4618 mov r0, r3
- 800c906: f000 fe95 bl 800d634 <tcp_output>
- 800c90a: e358 b.n 800cfbe <tcp_input+0x866>
- }
- if (pcb == NULL) {
- /* If it did not go to an active connection, we check the connections
- in the TIME-WAIT state. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- 800c90c: 68db ldr r3, [r3, #12]
- 800c90e: 2b00 cmp r3, #0
- 800c910: d1c7 bne.n 800c8a2 <tcp_input+0x14a>
- }
- /* Finally, if we still did not get a match, we check all PCBs that
- are LISTENing for incoming connections. */
- prev = NULL;
- for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
- 800c912: 482f ldr r0, [pc, #188] ; (800c9d0 <tcp_input+0x278>)
- 800c914: 6804 ldr r4, [r0, #0]
- 800c916: 4625 mov r5, r4
- 800c918: e00f b.n 800c93a <tcp_input+0x1e2>
- if (lpcb->local_port == tcphdr->dest) {
- 800c91a: 8b68 ldrh r0, [r5, #26]
- 800c91c: f8b7 8002 ldrh.w r8, [r7, #2]
- 800c920: 4580 cmp r8, r0
- 800c922: d108 bne.n 800c936 <tcp_input+0x1de>
- /* found an ANY-match */
- lpcb_any = lpcb;
- lpcb_prev = prev;
- }
- #else /* SO_REUSE */
- if (ip_addr_cmp(&(lpcb->local_ip), ¤t_iphdr_dest) ||
- 800c924: f8d5 8000 ldr.w r8, [r5]
- 800c928: 4588 cmp r8, r1
- 800c92a: f000 8363 beq.w 800cff4 <tcp_input+0x89c>
- ip_addr_isany(&(lpcb->local_ip))) {
- 800c92e: f1b8 0f00 cmp.w r8, #0
- 800c932: f000 835f beq.w 800cff4 <tcp_input+0x89c>
- 800c936: 462b mov r3, r5
- }
- /* Finally, if we still did not get a match, we check all PCBs that
- are LISTENing for incoming connections. */
- prev = NULL;
- for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
- 800c938: 68ed ldr r5, [r5, #12]
- 800c93a: 2d00 cmp r5, #0
- 800c93c: d1ed bne.n 800c91a <tcp_input+0x1c2>
- 800c93e: e35d b.n 800cffc <tcp_input+0x8a4>
- if (lpcb != NULL) {
- /* Move this PCB to the front of the list so that subsequent
- lookups will be faster (we exploit locality in TCP segment
- arrivals). */
- if (prev != NULL) {
- ((struct tcp_pcb_listen *)prev)->next = lpcb->next;
- 800c940: 68e9 ldr r1, [r5, #12]
- 800c942: 60d9 str r1, [r3, #12]
- /* our successor is the remainder of the listening list */
- lpcb->next = tcp_listen_pcbs.listen_pcbs;
- /* put this listening pcb at the head of the listening list */
- tcp_listen_pcbs.listen_pcbs = lpcb;
- 800c944: 4b22 ldr r3, [pc, #136] ; (800c9d0 <tcp_input+0x278>)
- lookups will be faster (we exploit locality in TCP segment
- arrivals). */
- if (prev != NULL) {
- ((struct tcp_pcb_listen *)prev)->next = lpcb->next;
- /* our successor is the remainder of the listening list */
- lpcb->next = tcp_listen_pcbs.listen_pcbs;
- 800c946: 60ec str r4, [r5, #12]
- /* put this listening pcb at the head of the listening list */
- tcp_listen_pcbs.listen_pcbs = lpcb;
- 800c948: 601d str r5, [r3, #0]
- tcp_listen_input(struct tcp_pcb_listen *pcb)
- {
- struct tcp_pcb *npcb;
- err_t rc;
- if (flags & TCP_RST) {
- 800c94a: f002 0304 and.w r3, r2, #4
- 800c94e: b2db uxtb r3, r3
- 800c950: 2b00 cmp r3, #0
- 800c952: f040 8334 bne.w 800cfbe <tcp_input+0x866>
- return ERR_OK;
- }
- /* In the LISTEN state, we check for incoming SYN segments,
- creates a new PCB, and responds with a SYN|ACK. */
- if (flags & TCP_ACK) {
- 800c956: f002 0810 and.w r8, r2, #16
- 800c95a: fa5f f888 uxtb.w r8, r8
- 800c95e: f1b8 0f00 cmp.w r8, #0
- 800c962: d00c beq.n 800c97e <tcp_input+0x226>
- /* For incoming segments with the ACK flag set, respond with a
- RST. */
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n"));
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(),
- 800c964: 4b13 ldr r3, [pc, #76] ; (800c9b4 <tcp_input+0x25c>)
- 800c966: 6819 ldr r1, [r3, #0]
- 800c968: 9000 str r0, [sp, #0]
- 800c96a: 883b ldrh r3, [r7, #0]
- 800c96c: 9301 str r3, [sp, #4]
- 800c96e: 4b12 ldr r3, [pc, #72] ; (800c9b8 <tcp_input+0x260>)
- 800c970: 4a0f ldr r2, [pc, #60] ; (800c9b0 <tcp_input+0x258>)
- 800c972: 6818 ldr r0, [r3, #0]
- 800c974: 4b14 ldr r3, [pc, #80] ; (800c9c8 <tcp_input+0x270>)
- 800c976: 4461 add r1, ip
- 800c978: f000 ff98 bl 800d8ac <tcp_rst>
- 800c97c: e31f b.n 800cfbe <tcp_input+0x866>
- ip_current_src_addr(), tcphdr->dest, tcphdr->src);
- } else if (flags & TCP_SYN) {
- 800c97e: f002 0202 and.w r2, r2, #2
- 800c982: b2d2 uxtb r2, r2
- 800c984: 2a00 cmp r2, #0
- 800c986: f000 831a beq.w 800cfbe <tcp_input+0x866>
- if (pcb->accepts_pending >= pcb->backlog) {
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: listen backlog exceeded for port %"U16_F"\n", tcphdr->dest));
- return ERR_ABRT;
- }
- #endif /* TCP_LISTEN_BACKLOG */
- npcb = tcp_alloc(pcb->prio);
- 800c98a: 7e68 ldrb r0, [r5, #25]
- 800c98c: f7ff fa7e bl 800be8c <tcp_alloc>
- /* If a new PCB could not be created (probably due to lack of memory),
- we don't do anything, but rely on the sender will retransmit the
- SYN at a time when we have more memory available. */
- if (npcb == NULL) {
- 800c990: 4604 mov r4, r0
- 800c992: b9f8 cbnz r0, 800c9d4 <tcp_input+0x27c>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: could not allocate PCB\n"));
- TCP_STATS_INC(tcp.memerr);
- 800c994: 4b03 ldr r3, [pc, #12] ; (800c9a4 <tcp_input+0x24c>)
- 800c996: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
- 800c99a: 3201 adds r2, #1
- 800c99c: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
- 800c9a0: e30d b.n 800cfbe <tcp_input+0x866>
- 800c9a2: bf00 nop
- 800c9a4: 20008220 .word 0x20008220
- 800c9a8: 20006b98 .word 0x20006b98
- 800c9ac: 20006b80 .word 0x20006b80
- 800c9b0: 20008364 .word 0x20008364
- 800c9b4: 20006b84 .word 0x20006b84
- 800c9b8: 20006b8c .word 0x20006b8c
- 800c9bc: 20006b90 .word 0x20006b90
- 800c9c0: 20006b88 .word 0x20006b88
- 800c9c4: 2000833c .word 0x2000833c
- 800c9c8: 2000835c .word 0x2000835c
- 800c9cc: 20008340 .word 0x20008340
- 800c9d0: 20008344 .word 0x20008344
- }
- #if TCP_LISTEN_BACKLOG
- pcb->accepts_pending++;
- #endif /* TCP_LISTEN_BACKLOG */
- /* Set up the new PCB. */
- ip_addr_copy(npcb->local_ip, current_iphdr_dest);
- 800c9d4: 4b96 ldr r3, [pc, #600] ; (800cc30 <tcp_input+0x4d8>)
- 800c9d6: 681b ldr r3, [r3, #0]
- 800c9d8: 6003 str r3, [r0, #0]
- npcb->local_port = pcb->local_port;
- 800c9da: 8b6b ldrh r3, [r5, #26]
- 800c9dc: 8343 strh r3, [r0, #26]
- ip_addr_copy(npcb->remote_ip, current_iphdr_src);
- 800c9de: 4b95 ldr r3, [pc, #596] ; (800cc34 <tcp_input+0x4dc>)
- 800c9e0: 681b ldr r3, [r3, #0]
- 800c9e2: 6043 str r3, [r0, #4]
- npcb->remote_port = tcphdr->src;
- 800c9e4: 4b94 ldr r3, [pc, #592] ; (800cc38 <tcp_input+0x4e0>)
- 800c9e6: 681b ldr r3, [r3, #0]
- 800c9e8: 7859 ldrb r1, [r3, #1]
- 800c9ea: 781a ldrb r2, [r3, #0]
- 800c9ec: ea42 2201 orr.w r2, r2, r1, lsl #8
- 800c9f0: 8382 strh r2, [r0, #28]
- npcb->state = SYN_RCVD;
- 800c9f2: 2203 movs r2, #3
- 800c9f4: 7602 strb r2, [r0, #24]
- npcb->rcv_nxt = seqno + 1;
- 800c9f6: 4a91 ldr r2, [pc, #580] ; (800cc3c <tcp_input+0x4e4>)
- 800c9f8: 6812 ldr r2, [r2, #0]
- 800c9fa: 1c51 adds r1, r2, #1
- 800c9fc: 6281 str r1, [r0, #40] ; 0x28
- npcb->rcv_ann_right_edge = npcb->rcv_nxt;
- 800c9fe: 6301 str r1, [r0, #48] ; 0x30
- npcb->snd_wnd = tcphdr->wnd;
- 800ca00: 89db ldrh r3, [r3, #14]
- 800ca02: f8a0 3060 strh.w r3, [r0, #96] ; 0x60
- npcb->snd_wnd_max = tcphdr->wnd;
- 800ca06: f8a0 3062 strh.w r3, [r0, #98] ; 0x62
- npcb->ssthresh = npcb->snd_wnd;
- 800ca0a: f8a0 304e strh.w r3, [r0, #78] ; 0x4e
- npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */
- npcb->callback_arg = pcb->callback_arg;
- 800ca0e: 692b ldr r3, [r5, #16]
- 800ca10: 6103 str r3, [r0, #16]
- #if LWIP_CALLBACK_API
- npcb->accept = pcb->accept;
- 800ca12: 696b ldr r3, [r5, #20]
- npcb->rcv_nxt = seqno + 1;
- npcb->rcv_ann_right_edge = npcb->rcv_nxt;
- npcb->snd_wnd = tcphdr->wnd;
- npcb->snd_wnd_max = tcphdr->wnd;
- npcb->ssthresh = npcb->snd_wnd;
- npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */
- 800ca14: 3a01 subs r2, #1
- 800ca16: 6542 str r2, [r0, #84] ; 0x54
- npcb->callback_arg = pcb->callback_arg;
- #if LWIP_CALLBACK_API
- npcb->accept = pcb->accept;
- 800ca18: 6143 str r3, [r0, #20]
- #endif /* LWIP_CALLBACK_API */
- /* inherit socket options */
- npcb->so_options = pcb->so_options & SOF_INHERITED;
- 800ca1a: 7a2b ldrb r3, [r5, #8]
- 800ca1c: f023 0373 bic.w r3, r3, #115 ; 0x73
- 800ca20: 7203 strb r3, [r0, #8]
- /* Register the new PCB so that we can begin receiving segments
- for it. */
- TCP_REG_ACTIVE(npcb);
- 800ca22: 4b87 ldr r3, [pc, #540] ; (800cc40 <tcp_input+0x4e8>)
- 800ca24: 681a ldr r2, [r3, #0]
- 800ca26: 6018 str r0, [r3, #0]
- 800ca28: 60c2 str r2, [r0, #12]
- 800ca2a: f001 f905 bl 800dc38 <tcp_timer_needed>
- 800ca2e: 4b85 ldr r3, [pc, #532] ; (800cc44 <tcp_input+0x4ec>)
- 800ca30: 2201 movs r2, #1
- /* Parse any options in the SYN. */
- tcp_parseopt(npcb);
- 800ca32: 4620 mov r0, r4
- #endif /* LWIP_CALLBACK_API */
- /* inherit socket options */
- npcb->so_options = pcb->so_options & SOF_INHERITED;
- /* Register the new PCB so that we can begin receiving segments
- for it. */
- TCP_REG_ACTIVE(npcb);
- 800ca34: 701a strb r2, [r3, #0]
- /* Parse any options in the SYN. */
- tcp_parseopt(npcb);
- 800ca36: f7ff fbfb bl 800c230 <tcp_parseopt>
- #if TCP_CALCULATE_EFF_SEND_MSS
- npcb->mss = tcp_eff_send_mss(npcb->mss, &(npcb->remote_ip));
- 800ca3a: 1d21 adds r1, r4, #4
- 800ca3c: 8ee0 ldrh r0, [r4, #54] ; 0x36
- 800ca3e: f7ff f987 bl 800bd50 <tcp_eff_send_mss>
- #endif /* TCP_CALCULATE_EFF_SEND_MSS */
- snmp_inc_tcppassiveopens();
- /* Send a SYN|ACK together with the MSS option. */
- rc = tcp_enqueue_flags(npcb, TCP_SYN | TCP_ACK);
- 800ca42: 2112 movs r1, #18
- TCP_REG_ACTIVE(npcb);
- /* Parse any options in the SYN. */
- tcp_parseopt(npcb);
- #if TCP_CALCULATE_EFF_SEND_MSS
- npcb->mss = tcp_eff_send_mss(npcb->mss, &(npcb->remote_ip));
- 800ca44: 86e0 strh r0, [r4, #54] ; 0x36
- #endif /* TCP_CALCULATE_EFF_SEND_MSS */
- snmp_inc_tcppassiveopens();
- /* Send a SYN|ACK together with the MSS option. */
- rc = tcp_enqueue_flags(npcb, TCP_SYN | TCP_ACK);
- 800ca46: 4620 mov r0, r4
- 800ca48: f000 fd54 bl 800d4f4 <tcp_enqueue_flags>
- if (rc != ERR_OK) {
- 800ca4c: b120 cbz r0, 800ca58 <tcp_input+0x300>
- tcp_abandon(npcb, 0);
- 800ca4e: 4620 mov r0, r4
- 800ca50: 4641 mov r1, r8
- 800ca52: f7ff f9d1 bl 800bdf8 <tcp_abandon>
- 800ca56: e2b2 b.n 800cfbe <tcp_input+0x866>
- return rc;
- }
- return tcp_output(npcb);
- 800ca58: 4620 mov r0, r4
- 800ca5a: e754 b.n 800c906 <tcp_input+0x1ae>
- recv_data = NULL;
- recv_flags = 0;
- if (flags & TCP_PSH) {
- p->flags |= PBUF_FLAG_PUSH;
- 800ca5c: 7b73 ldrb r3, [r6, #13]
- 800ca5e: f043 0301 orr.w r3, r3, #1
- 800ca62: 7373 strb r3, [r6, #13]
- }
- /* If there is data which was previously "refused" by upper layer */
- if (pcb->refused_data != NULL) {
- 800ca64: 6f63 ldr r3, [r4, #116] ; 0x74
- 800ca66: b183 cbz r3, 800ca8a <tcp_input+0x332>
- if ((tcp_process_refused_data(pcb) == ERR_ABRT) ||
- 800ca68: 4620 mov r0, r4
- 800ca6a: f7ff fb63 bl 800c134 <tcp_process_refused_data>
- 800ca6e: 300a adds r0, #10
- 800ca70: d004 beq.n 800ca7c <tcp_input+0x324>
- 800ca72: 6f63 ldr r3, [r4, #116] ; 0x74
- 800ca74: b14b cbz r3, 800ca8a <tcp_input+0x332>
- ((pcb->refused_data != NULL) && (tcplen > 0))) {
- 800ca76: 4b74 ldr r3, [pc, #464] ; (800cc48 <tcp_input+0x4f0>)
- 800ca78: 881b ldrh r3, [r3, #0]
- 800ca7a: b133 cbz r3, 800ca8a <tcp_input+0x332>
- /* pcb has been aborted or refused data is still refused and the new
- segment contains data */
- TCP_STATS_INC(tcp.drop);
- 800ca7c: 4b73 ldr r3, [pc, #460] ; (800cc4c <tcp_input+0x4f4>)
- 800ca7e: f8b3 2096 ldrh.w r2, [r3, #150] ; 0x96
- 800ca82: 3201 adds r2, #1
- 800ca84: f8a3 2096 strh.w r2, [r3, #150] ; 0x96
- snmp_inc_tcpinerrs();
- goto aborted;
- 800ca88: e263 b.n 800cf52 <tcp_input+0x7fa>
- }
- }
- tcp_input_pcb = pcb;
- 800ca8a: 4b71 ldr r3, [pc, #452] ; (800cc50 <tcp_input+0x4f8>)
- 800ca8c: 601c str r4, [r3, #0]
- err_t err;
- err = ERR_OK;
- /* Process incoming RST segments. */
- if (flags & TCP_RST) {
- 800ca8e: 4b71 ldr r3, [pc, #452] ; (800cc54 <tcp_input+0x4fc>)
- 800ca90: 781b ldrb r3, [r3, #0]
- 800ca92: f003 0204 and.w r2, r3, #4
- 800ca96: b2d2 uxtb r2, r2
- 800ca98: b1aa cbz r2, 800cac6 <tcp_input+0x36e>
- /* First, determine if the reset is acceptable. */
- if (pcb->state == SYN_SENT) {
- 800ca9a: 7e23 ldrb r3, [r4, #24]
- 800ca9c: 2b02 cmp r3, #2
- 800ca9e: d106 bne.n 800caae <tcp_input+0x356>
- if (ackno == pcb->snd_nxt) {
- 800caa0: 4b6d ldr r3, [pc, #436] ; (800cc58 <tcp_input+0x500>)
- 800caa2: 681a ldr r2, [r3, #0]
- 800caa4: 6d23 ldr r3, [r4, #80] ; 0x50
- 800caa6: 429a cmp r2, r3
- 800caa8: f040 82ba bne.w 800d020 <tcp_input+0x8c8>
- 800caac: e2af b.n 800d00e <tcp_input+0x8b6>
- acceptable = 1;
- }
- } else {
- if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,
- 800caae: 4b63 ldr r3, [pc, #396] ; (800cc3c <tcp_input+0x4e4>)
- 800cab0: 681a ldr r2, [r3, #0]
- 800cab2: 6aa3 ldr r3, [r4, #40] ; 0x28
- 800cab4: 1ad3 subs r3, r2, r3
- 800cab6: f100 82b3 bmi.w 800d020 <tcp_input+0x8c8>
- 800caba: 8da1 ldrh r1, [r4, #44] ; 0x2c
- 800cabc: 1a5b subs r3, r3, r1
- 800cabe: 2b00 cmp r3, #0
- 800cac0: f300 82ae bgt.w 800d020 <tcp_input+0x8c8>
- 800cac4: e2a3 b.n 800d00e <tcp_input+0x8b6>
- seqno, pcb->rcv_nxt));
- return ERR_OK;
- }
- }
- if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) {
- 800cac6: f003 0302 and.w r3, r3, #2
- 800caca: b2db uxtb r3, r3
- 800cacc: b123 cbz r3, 800cad8 <tcp_input+0x380>
- 800cace: 7e23 ldrb r3, [r4, #24]
- 800cad0: 3b02 subs r3, #2
- 800cad2: 2b01 cmp r3, #1
- 800cad4: d900 bls.n 800cad8 <tcp_input+0x380>
- 800cad6: e06b b.n 800cbb0 <tcp_input+0x458>
- /* Cope with new connection attempt after remote end crashed */
- tcp_ack_now(pcb);
- return ERR_OK;
- }
-
- if ((pcb->flags & TF_RXCLOSED) == 0) {
- 800cad8: 7fa3 ldrb r3, [r4, #30]
- 800cada: f003 0310 and.w r3, r3, #16
- 800cade: b2db uxtb r3, r3
- 800cae0: b913 cbnz r3, 800cae8 <tcp_input+0x390>
- /* Update the PCB (in)activity timer unless rx is closed (see tcp_shutdown) */
- pcb->tmr = tcp_ticks;
- 800cae2: 4b5e ldr r3, [pc, #376] ; (800cc5c <tcp_input+0x504>)
- 800cae4: 681b ldr r3, [r3, #0]
- 800cae6: 6263 str r3, [r4, #36] ; 0x24
- }
- pcb->keep_cnt_sent = 0;
- 800cae8: 2300 movs r3, #0
- 800caea: f884 3092 strb.w r3, [r4, #146] ; 0x92
- tcp_parseopt(pcb);
- 800caee: 4620 mov r0, r4
- 800caf0: f7ff fb9e bl 800c230 <tcp_parseopt>
- /* Do different things depending on the TCP state. */
- switch (pcb->state) {
- 800caf4: 7e23 ldrb r3, [r4, #24]
- 800caf6: 3b02 subs r3, #2
- 800caf8: 2b07 cmp r3, #7
- 800cafa: f200 8291 bhi.w 800d020 <tcp_input+0x8c8>
- 800cafe: e8df f013 tbh [pc, r3, lsl #1]
- 800cb02: 0008 .short 0x0008
- 800cb04: 00e20077 .word 0x00e20077
- 800cb08: 013000f3 .word 0x013000f3
- 800cb0c: 015200e2 .word 0x015200e2
- 800cb10: 0186 .short 0x0186
- case SYN_SENT:
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno,
- pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
- /* received SYN ACK with expected sequence number? */
- if ((flags & TCP_ACK) && (flags & TCP_SYN)
- 800cb12: 4b50 ldr r3, [pc, #320] ; (800cc54 <tcp_input+0x4fc>)
- 800cb14: 781b ldrb r3, [r3, #0]
- 800cb16: f003 0312 and.w r3, r3, #18
- 800cb1a: 2b12 cmp r3, #18
- 800cb1c: d153 bne.n 800cbc6 <tcp_input+0x46e>
- && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
- 800cb1e: 6f23 ldr r3, [r4, #112] ; 0x70
- 800cb20: 4d4d ldr r5, [pc, #308] ; (800cc58 <tcp_input+0x500>)
- 800cb22: 68db ldr r3, [r3, #12]
- 800cb24: 682e ldr r6, [r5, #0]
- 800cb26: 6858 ldr r0, [r3, #4]
- 800cb28: f7fd fb6b bl 800a202 <lwip_ntohl>
- 800cb2c: 3001 adds r0, #1
- 800cb2e: 4286 cmp r6, r0
- 800cb30: d149 bne.n 800cbc6 <tcp_input+0x46e>
- pcb->snd_buf++;
- 800cb32: f8b4 3066 ldrh.w r3, [r4, #102] ; 0x66
- pcb->snd_wnd_max = tcphdr->wnd;
- pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
- pcb->state = ESTABLISHED;
- #if TCP_CALCULATE_EFF_SEND_MSS
- pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
- 800cb36: 8ee0 ldrh r0, [r4, #54] ; 0x36
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno,
- pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
- /* received SYN ACK with expected sequence number? */
- if ((flags & TCP_ACK) && (flags & TCP_SYN)
- && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
- pcb->snd_buf++;
- 800cb38: 3301 adds r3, #1
- 800cb3a: f8a4 3066 strh.w r3, [r4, #102] ; 0x66
- pcb->rcv_nxt = seqno + 1;
- 800cb3e: 4b3f ldr r3, [pc, #252] ; (800cc3c <tcp_input+0x4e4>)
- 800cb40: 681b ldr r3, [r3, #0]
- 800cb42: 1c5a adds r2, r3, #1
- 800cb44: 62a2 str r2, [r4, #40] ; 0x28
- pcb->rcv_ann_right_edge = pcb->rcv_nxt;
- 800cb46: 6322 str r2, [r4, #48] ; 0x30
- pcb->lastack = ackno;
- 800cb48: 682a ldr r2, [r5, #0]
- 800cb4a: 64a2 str r2, [r4, #72] ; 0x48
- pcb->snd_wnd = tcphdr->wnd;
- 800cb4c: 4a3a ldr r2, [pc, #232] ; (800cc38 <tcp_input+0x4e0>)
- 800cb4e: 6812 ldr r2, [r2, #0]
- pcb->snd_wnd_max = tcphdr->wnd;
- pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
- 800cb50: 3b01 subs r3, #1
- && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
- pcb->snd_buf++;
- pcb->rcv_nxt = seqno + 1;
- pcb->rcv_ann_right_edge = pcb->rcv_nxt;
- pcb->lastack = ackno;
- pcb->snd_wnd = tcphdr->wnd;
- 800cb52: 89d2 ldrh r2, [r2, #14]
- pcb->snd_wnd_max = tcphdr->wnd;
- pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
- 800cb54: 6563 str r3, [r4, #84] ; 0x54
- pcb->state = ESTABLISHED;
- 800cb56: 2304 movs r3, #4
- 800cb58: 7623 strb r3, [r4, #24]
- #if TCP_CALCULATE_EFF_SEND_MSS
- pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
- 800cb5a: 18e1 adds r1, r4, r3
- && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
- pcb->snd_buf++;
- pcb->rcv_nxt = seqno + 1;
- pcb->rcv_ann_right_edge = pcb->rcv_nxt;
- pcb->lastack = ackno;
- pcb->snd_wnd = tcphdr->wnd;
- 800cb5c: f8a4 2060 strh.w r2, [r4, #96] ; 0x60
- pcb->snd_wnd_max = tcphdr->wnd;
- 800cb60: f8a4 2062 strh.w r2, [r4, #98] ; 0x62
- pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
- pcb->state = ESTABLISHED;
- #if TCP_CALCULATE_EFF_SEND_MSS
- pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
- 800cb64: f7ff f8f4 bl 800bd50 <tcp_eff_send_mss>
- #endif /* TCP_CALCULATE_EFF_SEND_MSS */
- /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
- * but for the default value of pcb->mss) */
- pcb->ssthresh = pcb->mss * 10;
- 800cb68: 230a movs r3, #10
- 800cb6a: 4343 muls r3, r0
- 800cb6c: f8a4 304e strh.w r3, [r4, #78] ; 0x4e
- pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
- 800cb70: f8b4 304c ldrh.w r3, [r4, #76] ; 0x4c
- pcb->snd_wnd_max = tcphdr->wnd;
- pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */
- pcb->state = ESTABLISHED;
- #if TCP_CALCULATE_EFF_SEND_MSS
- pcb->mss = tcp_eff_send_mss(pcb->mss, &(pcb->remote_ip));
- 800cb74: 86e0 strh r0, [r4, #54] ; 0x36
- /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
- * but for the default value of pcb->mss) */
- pcb->ssthresh = pcb->mss * 10;
- pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
- 800cb76: 2b01 cmp r3, #1
- 800cb78: d101 bne.n 800cb7e <tcp_input+0x426>
- 800cb7a: 0040 lsls r0, r0, #1
- 800cb7c: b280 uxth r0, r0
- LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
- --pcb->snd_queuelen;
- 800cb7e: f8b4 3068 ldrh.w r3, [r4, #104] ; 0x68
- /* Set ssthresh again after changing pcb->mss (already set in tcp_connect
- * but for the default value of pcb->mss) */
- pcb->ssthresh = pcb->mss * 10;
- pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
- 800cb82: f8a4 004c strh.w r0, [r4, #76] ; 0x4c
- LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
- --pcb->snd_queuelen;
- LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen));
- rseg = pcb->unacked;
- 800cb86: 6f20 ldr r0, [r4, #112] ; 0x70
- * but for the default value of pcb->mss) */
- pcb->ssthresh = pcb->mss * 10;
- pcb->cwnd = ((pcb->cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
- LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0));
- --pcb->snd_queuelen;
- 800cb88: 3b01 subs r3, #1
- 800cb8a: f8a4 3068 strh.w r3, [r4, #104] ; 0x68
- LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen));
- rseg = pcb->unacked;
- pcb->unacked = rseg->next;
- 800cb8e: 6803 ldr r3, [r0, #0]
- 800cb90: 6723 str r3, [r4, #112] ; 0x70
- tcp_seg_free(rseg);
- 800cb92: f7fe ff40 bl 800ba16 <tcp_seg_free>
- /* If there's nothing left to acknowledge, stop the retransmit
- timer, otherwise reset it to start again */
- if(pcb->unacked == NULL)
- 800cb96: 6f23 ldr r3, [r4, #112] ; 0x70
- 800cb98: b91b cbnz r3, 800cba2 <tcp_input+0x44a>
- pcb->rtime = -1;
- 800cb9a: f64f 73ff movw r3, #65535 ; 0xffff
- 800cb9e: 86a3 strh r3, [r4, #52] ; 0x34
- 800cba0: e003 b.n 800cbaa <tcp_input+0x452>
- else {
- pcb->rtime = 0;
- 800cba2: 2300 movs r3, #0
- 800cba4: 86a3 strh r3, [r4, #52] ; 0x34
- pcb->nrtx = 0;
- 800cba6: f884 3046 strb.w r3, [r4, #70] ; 0x46
- }
- /* Call the user specified function to call when sucessfully
- * connected. */
- TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
- 800cbaa: f8d4 3080 ldr.w r3, [r4, #128] ; 0x80
- 800cbae: b91b cbnz r3, 800cbb8 <tcp_input+0x460>
- if (err == ERR_ABRT) {
- return ERR_ABRT;
- }
- tcp_ack_now(pcb);
- 800cbb0: 7fa3 ldrb r3, [r4, #30]
- 800cbb2: f043 0302 orr.w r3, r3, #2
- 800cbb6: e232 b.n 800d01e <tcp_input+0x8c6>
- pcb->nrtx = 0;
- }
- /* Call the user specified function to call when sucessfully
- * connected. */
- TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
- 800cbb8: 2200 movs r2, #0
- 800cbba: 6920 ldr r0, [r4, #16]
- 800cbbc: 4621 mov r1, r4
- 800cbbe: 4798 blx r3
- if (err == ERR_ABRT) {
- 800cbc0: 300a adds r0, #10
- 800cbc2: d1f5 bne.n 800cbb0 <tcp_input+0x458>
- 800cbc4: e1c5 b.n 800cf52 <tcp_input+0x7fa>
- return ERR_ABRT;
- }
- tcp_ack_now(pcb);
- }
- /* received ACK? possibly a half-open connection */
- else if (flags & TCP_ACK) {
- 800cbc6: 4b23 ldr r3, [pc, #140] ; (800cc54 <tcp_input+0x4fc>)
- 800cbc8: 781b ldrb r3, [r3, #0]
- 800cbca: f003 0310 and.w r3, r3, #16
- 800cbce: b2db uxtb r3, r3
- 800cbd0: 2b00 cmp r3, #0
- 800cbd2: f000 8225 beq.w 800d020 <tcp_input+0x8c8>
- /* send a RST to bring the other side in a non-synchronized state. */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- tcphdr->dest, tcphdr->src);
- 800cbd6: 4b18 ldr r3, [pc, #96] ; (800cc38 <tcp_input+0x4e0>)
- tcp_ack_now(pcb);
- }
- /* received ACK? possibly a half-open connection */
- else if (flags & TCP_ACK) {
- /* send a RST to bring the other side in a non-synchronized state. */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- 800cbd8: 4a1b ldr r2, [pc, #108] ; (800cc48 <tcp_input+0x4f0>)
- tcphdr->dest, tcphdr->src);
- 800cbda: 681b ldr r3, [r3, #0]
- tcp_ack_now(pcb);
- }
- /* received ACK? possibly a half-open connection */
- else if (flags & TCP_ACK) {
- /* send a RST to bring the other side in a non-synchronized state. */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- 800cbdc: 8811 ldrh r1, [r2, #0]
- 800cbde: 8858 ldrh r0, [r3, #2]
- 800cbe0: 4a16 ldr r2, [pc, #88] ; (800cc3c <tcp_input+0x4e4>)
- 800cbe2: 6812 ldr r2, [r2, #0]
- 800cbe4: 9000 str r0, [sp, #0]
- 800cbe6: 881b ldrh r3, [r3, #0]
- 800cbe8: 9301 str r3, [sp, #4]
- 800cbea: 4b1b ldr r3, [pc, #108] ; (800cc58 <tcp_input+0x500>)
- 800cbec: 6818 ldr r0, [r3, #0]
- 800cbee: e053 b.n 800cc98 <tcp_input+0x540>
- tcphdr->dest, tcphdr->src);
- }
- break;
- case SYN_RCVD:
- if (flags & TCP_ACK) {
- 800cbf0: 4b18 ldr r3, [pc, #96] ; (800cc54 <tcp_input+0x4fc>)
- 800cbf2: 781b ldrb r3, [r3, #0]
- 800cbf4: f003 0210 and.w r2, r3, #16
- 800cbf8: b2d2 uxtb r2, r2
- 800cbfa: 2a00 cmp r2, #0
- 800cbfc: d052 beq.n 800cca4 <tcp_input+0x54c>
- /* expected ACK number? */
- if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)) {
- 800cbfe: 4b16 ldr r3, [pc, #88] ; (800cc58 <tcp_input+0x500>)
- 800cc00: 6818 ldr r0, [r3, #0]
- 800cc02: 6ca3 ldr r3, [r4, #72] ; 0x48
- 800cc04: 43db mvns r3, r3
- 800cc06: 42c3 cmn r3, r0
- 800cc08: d43c bmi.n 800cc84 <tcp_input+0x52c>
- 800cc0a: 6d23 ldr r3, [r4, #80] ; 0x50
- 800cc0c: 1ac3 subs r3, r0, r3
- 800cc0e: 2b00 cmp r3, #0
- 800cc10: dc38 bgt.n 800cc84 <tcp_input+0x52c>
- u16_t old_cwnd;
- pcb->state = ESTABLISHED;
- 800cc12: 2304 movs r3, #4
- 800cc14: 7623 strb r3, [r4, #24]
- LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
- #if LWIP_CALLBACK_API
- LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);
- #endif
- /* Call the accept function. */
- TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
- 800cc16: 6963 ldr r3, [r4, #20]
- 800cc18: b903 cbnz r3, 800cc1c <tcp_input+0x4c4>
- 800cc1a: e147 b.n 800ceac <tcp_input+0x754>
- 800cc1c: 6920 ldr r0, [r4, #16]
- 800cc1e: 4621 mov r1, r4
- 800cc20: 2200 movs r2, #0
- 800cc22: 4798 blx r3
- if (err != ERR_OK) {
- 800cc24: b1e0 cbz r0, 800cc60 <tcp_input+0x508>
- /* If the accept function returns with an error, we abort
- * the connection. */
- /* Already aborted? */
- if (err != ERR_ABRT) {
- 800cc26: 300a adds r0, #10
- 800cc28: f040 8140 bne.w 800ceac <tcp_input+0x754>
- 800cc2c: e191 b.n 800cf52 <tcp_input+0x7fa>
- 800cc2e: bf00 nop
- 800cc30: 20008364 .word 0x20008364
- 800cc34: 2000835c .word 0x2000835c
- 800cc38: 20006b80 .word 0x20006b80
- 800cc3c: 20006b84 .word 0x20006b84
- 800cc40: 2000833c .word 0x2000833c
- 800cc44: 20008338 .word 0x20008338
- 800cc48: 20006b88 .word 0x20006b88
- 800cc4c: 20008220 .word 0x20008220
- 800cc50: 20008354 .word 0x20008354
- 800cc54: 20006b90 .word 0x20006b90
- 800cc58: 20006b8c .word 0x20006b8c
- 800cc5c: 20008340 .word 0x20008340
- return ERR_ABRT;
- }
- old_cwnd = pcb->cwnd;
- /* If there was any data contained within this ACK,
- * we'd better pass it on to the application as well. */
- tcp_receive(pcb);
- 800cc60: 4620 mov r0, r4
- if (err != ERR_ABRT) {
- tcp_abort(pcb);
- }
- return ERR_ABRT;
- }
- old_cwnd = pcb->cwnd;
- 800cc62: f8b4 504c ldrh.w r5, [r4, #76] ; 0x4c
- /* If there was any data contained within this ACK,
- * we'd better pass it on to the application as well. */
- tcp_receive(pcb);
- 800cc66: f7ff fb23 bl 800c2b0 <tcp_receive>
- /* Prevent ACK for SYN to generate a sent event */
- if (pcb->acked != 0) {
- 800cc6a: f8b4 3064 ldrh.w r3, [r4, #100] ; 0x64
- 800cc6e: b113 cbz r3, 800cc76 <tcp_input+0x51e>
- pcb->acked--;
- 800cc70: 3b01 subs r3, #1
- 800cc72: f8a4 3064 strh.w r3, [r4, #100] ; 0x64
- }
- pcb->cwnd = ((old_cwnd == 1) ? (pcb->mss * 2) : pcb->mss);
- 800cc76: 8ee3 ldrh r3, [r4, #54] ; 0x36
- 800cc78: 2d01 cmp r5, #1
- 800cc7a: bf08 it eq
- 800cc7c: 005b lsleq r3, r3, #1
- 800cc7e: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
- 800cc82: e023 b.n 800cccc <tcp_input+0x574>
- pcb->state = CLOSE_WAIT;
- }
- } else {
- /* incorrect ACK number, send RST */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- tcphdr->dest, tcphdr->src);
- 800cc84: 4b8e ldr r3, [pc, #568] ; (800cec0 <tcp_input+0x768>)
- tcp_ack_now(pcb);
- pcb->state = CLOSE_WAIT;
- }
- } else {
- /* incorrect ACK number, send RST */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- 800cc86: 4a8f ldr r2, [pc, #572] ; (800cec4 <tcp_input+0x76c>)
- tcphdr->dest, tcphdr->src);
- 800cc88: 681b ldr r3, [r3, #0]
- tcp_ack_now(pcb);
- pcb->state = CLOSE_WAIT;
- }
- } else {
- /* incorrect ACK number, send RST */
- tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), ip_current_src_addr(),
- 800cc8a: 8811 ldrh r1, [r2, #0]
- 800cc8c: 885d ldrh r5, [r3, #2]
- 800cc8e: 4a8e ldr r2, [pc, #568] ; (800cec8 <tcp_input+0x770>)
- 800cc90: 6812 ldr r2, [r2, #0]
- 800cc92: 9500 str r5, [sp, #0]
- 800cc94: 881b ldrh r3, [r3, #0]
- 800cc96: 9301 str r3, [sp, #4]
- 800cc98: 1889 adds r1, r1, r2
- 800cc9a: 4b8c ldr r3, [pc, #560] ; (800cecc <tcp_input+0x774>)
- 800cc9c: 4a8c ldr r2, [pc, #560] ; (800ced0 <tcp_input+0x778>)
- 800cc9e: f000 fe05 bl 800d8ac <tcp_rst>
- 800cca2: e1bd b.n 800d020 <tcp_input+0x8c8>
- tcphdr->dest, tcphdr->src);
- }
- } else if ((flags & TCP_SYN) && (seqno == pcb->rcv_nxt - 1)) {
- 800cca4: f003 0302 and.w r3, r3, #2
- 800cca8: b2db uxtb r3, r3
- 800ccaa: 2b00 cmp r3, #0
- 800ccac: f000 81b8 beq.w 800d020 <tcp_input+0x8c8>
- 800ccb0: 4a85 ldr r2, [pc, #532] ; (800cec8 <tcp_input+0x770>)
- 800ccb2: 6aa3 ldr r3, [r4, #40] ; 0x28
- 800ccb4: 6812 ldr r2, [r2, #0]
- 800ccb6: 3b01 subs r3, #1
- 800ccb8: 429a cmp r2, r3
- 800ccba: f040 81b1 bne.w 800d020 <tcp_input+0x8c8>
- /* Looks like another copy of the SYN - retransmit our SYN-ACK */
- tcp_rexmit(pcb);
- 800ccbe: 4620 mov r0, r4
- 800ccc0: f000 fe58 bl 800d974 <tcp_rexmit>
- 800ccc4: e1ac b.n 800d020 <tcp_input+0x8c8>
- }
- break;
- case CLOSE_WAIT:
- /* FALLTHROUGH */
- case ESTABLISHED:
- tcp_receive(pcb);
- 800ccc6: 4620 mov r0, r4
- 800ccc8: f7ff faf2 bl 800c2b0 <tcp_receive>
- if (recv_flags & TF_GOT_FIN) { /* passive close */
- 800cccc: 4b81 ldr r3, [pc, #516] ; (800ced4 <tcp_input+0x77c>)
- 800ccce: 781b ldrb r3, [r3, #0]
- 800ccd0: f003 0320 and.w r3, r3, #32
- 800ccd4: b2db uxtb r3, r3
- 800ccd6: 2b00 cmp r3, #0
- 800ccd8: f000 81a2 beq.w 800d020 <tcp_input+0x8c8>
- tcp_ack_now(pcb);
- 800ccdc: 7fa3 ldrb r3, [r4, #30]
- 800ccde: f043 0302 orr.w r3, r3, #2
- 800cce2: 77a3 strb r3, [r4, #30]
- pcb->state = CLOSE_WAIT;
- 800cce4: 2307 movs r3, #7
- 800cce6: e03a b.n 800cd5e <tcp_input+0x606>
- }
- break;
- case FIN_WAIT_1:
- tcp_receive(pcb);
- 800cce8: 4620 mov r0, r4
- 800ccea: f7ff fae1 bl 800c2b0 <tcp_receive>
- if (recv_flags & TF_GOT_FIN) {
- 800ccee: 4b79 ldr r3, [pc, #484] ; (800ced4 <tcp_input+0x77c>)
- 800ccf0: 781a ldrb r2, [r3, #0]
- 800ccf2: 4b79 ldr r3, [pc, #484] ; (800ced8 <tcp_input+0x780>)
- if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
- 800ccf4: 781b ldrb r3, [r3, #0]
- pcb->state = CLOSE_WAIT;
- }
- break;
- case FIN_WAIT_1:
- tcp_receive(pcb);
- if (recv_flags & TF_GOT_FIN) {
- 800ccf6: f002 0220 and.w r2, r2, #32
- if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
- 800ccfa: f003 0310 and.w r3, r3, #16
- pcb->state = CLOSE_WAIT;
- }
- break;
- case FIN_WAIT_1:
- tcp_receive(pcb);
- if (recv_flags & TF_GOT_FIN) {
- 800ccfe: b2d2 uxtb r2, r2
- if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
- 800cd00: b2db uxtb r3, r3
- pcb->state = CLOSE_WAIT;
- }
- break;
- case FIN_WAIT_1:
- tcp_receive(pcb);
- if (recv_flags & TF_GOT_FIN) {
- 800cd02: b312 cbz r2, 800cd4a <tcp_input+0x5f2>
- if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
- 800cd04: b1db cbz r3, 800cd3e <tcp_input+0x5e6>
- 800cd06: 4b75 ldr r3, [pc, #468] ; (800cedc <tcp_input+0x784>)
- 800cd08: 681a ldr r2, [r3, #0]
- 800cd0a: 6d23 ldr r3, [r4, #80] ; 0x50
- 800cd0c: 429a cmp r2, r3
- 800cd0e: d116 bne.n 800cd3e <tcp_input+0x5e6>
- LWIP_DEBUGF(TCP_DEBUG,
- ("TCP connection closed: FIN_WAIT_1 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
- tcp_ack_now(pcb);
- 800cd10: 7fa3 ldrb r3, [r4, #30]
- 800cd12: f043 0302 orr.w r3, r3, #2
- 800cd16: 77a3 strb r3, [r4, #30]
- tcp_pcb_purge(pcb);
- 800cd18: 4620 mov r0, r4
- 800cd1a: f7fe fea5 bl 800ba68 <tcp_pcb_purge>
- TCP_RMV_ACTIVE(pcb);
- 800cd1e: 4a70 ldr r2, [pc, #448] ; (800cee0 <tcp_input+0x788>)
- 800cd20: 6813 ldr r3, [r2, #0]
- 800cd22: 42a3 cmp r3, r4
- 800cd24: d100 bne.n 800cd28 <tcp_input+0x5d0>
- 800cd26: e056 b.n 800cdd6 <tcp_input+0x67e>
- 800cd28: 4a6e ldr r2, [pc, #440] ; (800cee4 <tcp_input+0x78c>)
- 800cd2a: 6013 str r3, [r2, #0]
- 800cd2c: e004 b.n 800cd38 <tcp_input+0x5e0>
- 800cd2e: 68d9 ldr r1, [r3, #12]
- 800cd30: 42a1 cmp r1, r4
- 800cd32: d100 bne.n 800cd36 <tcp_input+0x5de>
- 800cd34: e057 b.n 800cde6 <tcp_input+0x68e>
- 800cd36: 460b mov r3, r1
- 800cd38: 2b00 cmp r3, #0
- 800cd3a: d1f8 bne.n 800cd2e <tcp_input+0x5d6>
- 800cd3c: e05a b.n 800cdf4 <tcp_input+0x69c>
- pcb->state = TIME_WAIT;
- TCP_REG(&tcp_tw_pcbs, pcb);
- } else {
- tcp_ack_now(pcb);
- 800cd3e: 7fa3 ldrb r3, [r4, #30]
- 800cd40: f043 0302 orr.w r3, r3, #2
- 800cd44: 77a3 strb r3, [r4, #30]
- pcb->state = CLOSING;
- 800cd46: 2308 movs r3, #8
- 800cd48: e009 b.n 800cd5e <tcp_input+0x606>
- }
- } else if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt)) {
- 800cd4a: 2b00 cmp r3, #0
- 800cd4c: f000 8168 beq.w 800d020 <tcp_input+0x8c8>
- 800cd50: 4b62 ldr r3, [pc, #392] ; (800cedc <tcp_input+0x784>)
- 800cd52: 681a ldr r2, [r3, #0]
- 800cd54: 6d23 ldr r3, [r4, #80] ; 0x50
- 800cd56: 429a cmp r2, r3
- 800cd58: f040 8162 bne.w 800d020 <tcp_input+0x8c8>
- pcb->state = FIN_WAIT_2;
- 800cd5c: 2306 movs r3, #6
- 800cd5e: 7623 strb r3, [r4, #24]
- 800cd60: e15e b.n 800d020 <tcp_input+0x8c8>
- }
- break;
- case FIN_WAIT_2:
- tcp_receive(pcb);
- 800cd62: 4620 mov r0, r4
- 800cd64: f7ff faa4 bl 800c2b0 <tcp_receive>
- if (recv_flags & TF_GOT_FIN) {
- 800cd68: 4b5a ldr r3, [pc, #360] ; (800ced4 <tcp_input+0x77c>)
- 800cd6a: 781b ldrb r3, [r3, #0]
- 800cd6c: f003 0320 and.w r3, r3, #32
- 800cd70: b2db uxtb r3, r3
- 800cd72: 2b00 cmp r3, #0
- 800cd74: f000 8154 beq.w 800d020 <tcp_input+0x8c8>
- LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: FIN_WAIT_2 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
- tcp_ack_now(pcb);
- 800cd78: 7fa3 ldrb r3, [r4, #30]
- 800cd7a: f043 0302 orr.w r3, r3, #2
- 800cd7e: 77a3 strb r3, [r4, #30]
- tcp_pcb_purge(pcb);
- 800cd80: 4620 mov r0, r4
- 800cd82: f7fe fe71 bl 800ba68 <tcp_pcb_purge>
- TCP_RMV_ACTIVE(pcb);
- 800cd86: 4a56 ldr r2, [pc, #344] ; (800cee0 <tcp_input+0x788>)
- 800cd88: 6813 ldr r3, [r2, #0]
- 800cd8a: 42a3 cmp r3, r4
- 800cd8c: d100 bne.n 800cd90 <tcp_input+0x638>
- 800cd8e: e022 b.n 800cdd6 <tcp_input+0x67e>
- 800cd90: 4a54 ldr r2, [pc, #336] ; (800cee4 <tcp_input+0x78c>)
- 800cd92: 6013 str r3, [r2, #0]
- 800cd94: e004 b.n 800cda0 <tcp_input+0x648>
- 800cd96: 68d9 ldr r1, [r3, #12]
- 800cd98: 42a1 cmp r1, r4
- 800cd9a: d100 bne.n 800cd9e <tcp_input+0x646>
- 800cd9c: e023 b.n 800cde6 <tcp_input+0x68e>
- 800cd9e: 460b mov r3, r1
- 800cda0: 2b00 cmp r3, #0
- 800cda2: d1f8 bne.n 800cd96 <tcp_input+0x63e>
- 800cda4: e026 b.n 800cdf4 <tcp_input+0x69c>
- pcb->state = TIME_WAIT;
- TCP_REG(&tcp_tw_pcbs, pcb);
- }
- break;
- case CLOSING:
- tcp_receive(pcb);
- 800cda6: 4620 mov r0, r4
- 800cda8: f7ff fa82 bl 800c2b0 <tcp_receive>
- if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
- 800cdac: 4b4a ldr r3, [pc, #296] ; (800ced8 <tcp_input+0x780>)
- 800cdae: 781b ldrb r3, [r3, #0]
- 800cdb0: f003 0310 and.w r3, r3, #16
- 800cdb4: b2db uxtb r3, r3
- 800cdb6: 2b00 cmp r3, #0
- 800cdb8: f000 8132 beq.w 800d020 <tcp_input+0x8c8>
- 800cdbc: 4b47 ldr r3, [pc, #284] ; (800cedc <tcp_input+0x784>)
- 800cdbe: 681a ldr r2, [r3, #0]
- 800cdc0: 6d23 ldr r3, [r4, #80] ; 0x50
- 800cdc2: 429a cmp r2, r3
- 800cdc4: f040 812c bne.w 800d020 <tcp_input+0x8c8>
- LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: CLOSING %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
- tcp_pcb_purge(pcb);
- 800cdc8: 4620 mov r0, r4
- 800cdca: f7fe fe4d bl 800ba68 <tcp_pcb_purge>
- TCP_RMV_ACTIVE(pcb);
- 800cdce: 4a44 ldr r2, [pc, #272] ; (800cee0 <tcp_input+0x788>)
- 800cdd0: 6813 ldr r3, [r2, #0]
- 800cdd2: 42a3 cmp r3, r4
- 800cdd4: d101 bne.n 800cdda <tcp_input+0x682>
- 800cdd6: 68e3 ldr r3, [r4, #12]
- 800cdd8: e00c b.n 800cdf4 <tcp_input+0x69c>
- 800cdda: 4a42 ldr r2, [pc, #264] ; (800cee4 <tcp_input+0x78c>)
- 800cddc: 6013 str r3, [r2, #0]
- 800cdde: e007 b.n 800cdf0 <tcp_input+0x698>
- 800cde0: 68d9 ldr r1, [r3, #12]
- 800cde2: 42a1 cmp r1, r4
- 800cde4: d103 bne.n 800cdee <tcp_input+0x696>
- 800cde6: 6013 str r3, [r2, #0]
- 800cde8: 68e2 ldr r2, [r4, #12]
- 800cdea: 60da str r2, [r3, #12]
- 800cdec: e003 b.n 800cdf6 <tcp_input+0x69e>
- 800cdee: 460b mov r3, r1
- 800cdf0: 2b00 cmp r3, #0
- 800cdf2: d1f5 bne.n 800cde0 <tcp_input+0x688>
- 800cdf4: 6013 str r3, [r2, #0]
- 800cdf6: 4b3c ldr r3, [pc, #240] ; (800cee8 <tcp_input+0x790>)
- 800cdf8: 2201 movs r2, #1
- 800cdfa: 701a strb r2, [r3, #0]
- pcb->state = TIME_WAIT;
- 800cdfc: 230a movs r3, #10
- 800cdfe: 7623 strb r3, [r4, #24]
- TCP_REG(&tcp_tw_pcbs, pcb);
- 800ce00: 4b3a ldr r3, [pc, #232] ; (800ceec <tcp_input+0x794>)
- 800ce02: 681a ldr r2, [r3, #0]
- 800ce04: 601c str r4, [r3, #0]
- 800ce06: 60e2 str r2, [r4, #12]
- 800ce08: f000 ff16 bl 800dc38 <tcp_timer_needed>
- 800ce0c: e108 b.n 800d020 <tcp_input+0x8c8>
- }
- break;
- case LAST_ACK:
- tcp_receive(pcb);
- 800ce0e: 4620 mov r0, r4
- 800ce10: f7ff fa4e bl 800c2b0 <tcp_receive>
- if (flags & TCP_ACK && ackno == pcb->snd_nxt) {
- 800ce14: 4b30 ldr r3, [pc, #192] ; (800ced8 <tcp_input+0x780>)
- 800ce16: 781b ldrb r3, [r3, #0]
- 800ce18: f003 0310 and.w r3, r3, #16
- 800ce1c: b2db uxtb r3, r3
- 800ce1e: 2b00 cmp r3, #0
- 800ce20: f000 80fe beq.w 800d020 <tcp_input+0x8c8>
- 800ce24: 4b2d ldr r3, [pc, #180] ; (800cedc <tcp_input+0x784>)
- 800ce26: 681a ldr r2, [r3, #0]
- 800ce28: 6d23 ldr r3, [r4, #80] ; 0x50
- 800ce2a: 429a cmp r2, r3
- 800ce2c: f040 80f8 bne.w 800d020 <tcp_input+0x8c8>
- LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: LAST_ACK %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest));
- /* bugfix #21699: don't set pcb->state to CLOSED here or we risk leaking segments */
- recv_flags |= TF_CLOSED;
- 800ce30: 4b28 ldr r3, [pc, #160] ; (800ced4 <tcp_input+0x77c>)
- 800ce32: 781a ldrb r2, [r3, #0]
- 800ce34: f042 0210 orr.w r2, r2, #16
- 800ce38: 701a strb r2, [r3, #0]
- 800ce3a: e0f1 b.n 800d020 <tcp_input+0x8c8>
- if (recv_flags & TF_RESET) {
- /* TF_RESET means that the connection was reset by the other
- end. We then call the error callback to inform the
- application that the connection is dead before we
- deallocate the PCB. */
- TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_RST);
- 800ce3c: f8d4 3088 ldr.w r3, [r4, #136] ; 0x88
- 800ce40: b19b cbz r3, 800ce6a <tcp_input+0x712>
- 800ce42: 6920 ldr r0, [r4, #16]
- 800ce44: f06f 010a mvn.w r1, #10
- 800ce48: e00e b.n 800ce68 <tcp_input+0x710>
- tcp_pcb_remove(&tcp_active_pcbs, pcb);
- memp_free(MEMP_TCP_PCB, pcb);
- } else if (recv_flags & TF_CLOSED) {
- 800ce4a: f003 0310 and.w r3, r3, #16
- 800ce4e: b2db uxtb r3, r3
- 800ce50: b1a3 cbz r3, 800ce7c <tcp_input+0x724>
- /* The connection has been closed and we will deallocate the
- PCB. */
- if (!(pcb->flags & TF_RXCLOSED)) {
- 800ce52: 7fa3 ldrb r3, [r4, #30]
- 800ce54: f003 0310 and.w r3, r3, #16
- 800ce58: b2db uxtb r3, r3
- 800ce5a: b933 cbnz r3, 800ce6a <tcp_input+0x712>
- /* Connection closed although the application has only shut down the
- tx side: call the PCB's err callback and indicate the closure to
- ensure the application doesn't continue using the PCB. */
- TCP_EVENT_ERR(pcb->errf, pcb->callback_arg, ERR_CLSD);
- 800ce5c: f8d4 3088 ldr.w r3, [r4, #136] ; 0x88
- 800ce60: b11b cbz r3, 800ce6a <tcp_input+0x712>
- 800ce62: 6920 ldr r0, [r4, #16]
- 800ce64: f06f 010b mvn.w r1, #11
- 800ce68: 4798 blx r3
- }
- tcp_pcb_remove(&tcp_active_pcbs, pcb);
- 800ce6a: 4621 mov r1, r4
- 800ce6c: 481c ldr r0, [pc, #112] ; (800cee0 <tcp_input+0x788>)
- 800ce6e: f7fe ff91 bl 800bd94 <tcp_pcb_remove>
- memp_free(MEMP_TCP_PCB, pcb);
- 800ce72: 2002 movs r0, #2
- 800ce74: 4621 mov r1, r4
- 800ce76: f7fe fa2d bl 800b2d4 <memp_free>
- 800ce7a: e06a b.n 800cf52 <tcp_input+0x7fa>
- } else {
- err = ERR_OK;
- /* If the application has registered a "sent" function to be
- called when new send buffer space is available, we call it
- now. */
- if (pcb->acked > 0) {
- 800ce7c: f8b4 2064 ldrh.w r2, [r4, #100] ; 0x64
- 800ce80: b91a cbnz r2, 800ce8a <tcp_input+0x732>
- if (err == ERR_ABRT) {
- goto aborted;
- }
- }
- if (recv_data != NULL) {
- 800ce82: 4b1b ldr r3, [pc, #108] ; (800cef0 <tcp_input+0x798>)
- 800ce84: 681a ldr r2, [r3, #0]
- 800ce86: b94a cbnz r2, 800ce9c <tcp_input+0x744>
- 800ce88: e040 b.n 800cf0c <tcp_input+0x7b4>
- err = ERR_OK;
- /* If the application has registered a "sent" function to be
- called when new send buffer space is available, we call it
- now. */
- if (pcb->acked > 0) {
- TCP_EVENT_SENT(pcb, pcb->acked, err);
- 800ce8a: 6fa3 ldr r3, [r4, #120] ; 0x78
- 800ce8c: 2b00 cmp r3, #0
- 800ce8e: d0f8 beq.n 800ce82 <tcp_input+0x72a>
- 800ce90: 6920 ldr r0, [r4, #16]
- 800ce92: 4621 mov r1, r4
- 800ce94: 4798 blx r3
- if (err == ERR_ABRT) {
- 800ce96: 300a adds r0, #10
- 800ce98: d1f3 bne.n 800ce82 <tcp_input+0x72a>
- 800ce9a: e05a b.n 800cf52 <tcp_input+0x7fa>
- }
- }
- if (recv_data != NULL) {
- LWIP_ASSERT("pcb->refused_data == NULL", pcb->refused_data == NULL);
- if (pcb->flags & TF_RXCLOSED) {
- 800ce9c: 7fa3 ldrb r3, [r4, #30]
- 800ce9e: f003 0310 and.w r3, r3, #16
- 800cea2: b2db uxtb r3, r3
- 800cea4: b133 cbz r3, 800ceb4 <tcp_input+0x75c>
- /* received data although already closed -> abort (send RST) to
- notify the remote host that not all data has been processed */
- pbuf_free(recv_data);
- 800cea6: 4610 mov r0, r2
- 800cea8: f7fe fb0c bl 800b4c4 <pbuf_free>
- tcp_abort(pcb);
- 800ceac: 4620 mov r0, r4
- 800ceae: f7fe ffe9 bl 800be84 <tcp_abort>
- goto aborted;
- 800ceb2: e04e b.n 800cf52 <tcp_input+0x7fa>
- }
- /* Notify application that data has been received. */
- TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err);
- 800ceb4: 6fe5 ldr r5, [r4, #124] ; 0x7c
- 800ceb6: b1ed cbz r5, 800cef4 <tcp_input+0x79c>
- 800ceb8: 6920 ldr r0, [r4, #16]
- 800ceba: 4621 mov r1, r4
- 800cebc: 47a8 blx r5
- 800cebe: e01e b.n 800cefe <tcp_input+0x7a6>
- 800cec0: 20006b80 .word 0x20006b80
- 800cec4: 20006b88 .word 0x20006b88
- 800cec8: 20006b84 .word 0x20006b84
- 800cecc: 2000835c .word 0x2000835c
- 800ced0: 20008364 .word 0x20008364
- 800ced4: 20006b91 .word 0x20006b91
- 800ced8: 20006b90 .word 0x20006b90
- 800cedc: 20006b8c .word 0x20006b8c
- 800cee0: 2000833c .word 0x2000833c
- 800cee4: 20008348 .word 0x20008348
- 800cee8: 20008338 .word 0x20008338
- 800ceec: 20008350 .word 0x20008350
- 800cef0: 20006b94 .word 0x20006b94
- 800cef4: 4628 mov r0, r5
- 800cef6: 4621 mov r1, r4
- 800cef8: 462b mov r3, r5
- 800cefa: f7ff f909 bl 800c110 <tcp_recv_null>
- if (err == ERR_ABRT) {
- 800cefe: b243 sxtb r3, r0
- 800cf00: 330a adds r3, #10
- 800cf02: d026 beq.n 800cf52 <tcp_input+0x7fa>
- goto aborted;
- }
- /* If the upper layer can't receive this data, store it */
- if (err != ERR_OK) {
- 800cf04: b110 cbz r0, 800cf0c <tcp_input+0x7b4>
- pcb->refused_data = recv_data;
- 800cf06: 4b4b ldr r3, [pc, #300] ; (800d034 <tcp_input+0x8dc>)
- 800cf08: 681b ldr r3, [r3, #0]
- 800cf0a: 6763 str r3, [r4, #116] ; 0x74
- }
- }
- /* If a FIN segment was received, we call the callback
- function with a NULL buffer to indicate EOF. */
- if (recv_flags & TF_GOT_FIN) {
- 800cf0c: 4b4a ldr r3, [pc, #296] ; (800d038 <tcp_input+0x8e0>)
- 800cf0e: 781b ldrb r3, [r3, #0]
- 800cf10: f003 0320 and.w r3, r3, #32
- 800cf14: b2db uxtb r3, r3
- 800cf16: b1b3 cbz r3, 800cf46 <tcp_input+0x7ee>
- if (pcb->refused_data != NULL) {
- 800cf18: 6f63 ldr r3, [r4, #116] ; 0x74
- 800cf1a: b123 cbz r3, 800cf26 <tcp_input+0x7ce>
- /* Delay this if we have refused data. */
- pcb->refused_data->flags |= PBUF_FLAG_TCP_FIN;
- 800cf1c: 7b5a ldrb r2, [r3, #13]
- 800cf1e: f042 0220 orr.w r2, r2, #32
- 800cf22: 735a strb r2, [r3, #13]
- 800cf24: e00f b.n 800cf46 <tcp_input+0x7ee>
- } else {
- /* correct rcv_wnd as the application won't call tcp_recved()
- for the FIN's seqno */
- if (pcb->rcv_wnd != TCP_WND) {
- 800cf26: 8da3 ldrh r3, [r4, #44] ; 0x2c
- 800cf28: f241 62d0 movw r2, #5840 ; 0x16d0
- 800cf2c: 4293 cmp r3, r2
- 800cf2e: d001 beq.n 800cf34 <tcp_input+0x7dc>
- pcb->rcv_wnd++;
- 800cf30: 3301 adds r3, #1
- 800cf32: 85a3 strh r3, [r4, #44] ; 0x2c
- }
- TCP_EVENT_CLOSED(pcb, err);
- 800cf34: 6fe5 ldr r5, [r4, #124] ; 0x7c
- 800cf36: b135 cbz r5, 800cf46 <tcp_input+0x7ee>
- 800cf38: 2200 movs r2, #0
- 800cf3a: 6920 ldr r0, [r4, #16]
- 800cf3c: 4621 mov r1, r4
- 800cf3e: 4613 mov r3, r2
- 800cf40: 47a8 blx r5
- if (err == ERR_ABRT) {
- 800cf42: 300a adds r0, #10
- 800cf44: d005 beq.n 800cf52 <tcp_input+0x7fa>
- goto aborted;
- }
- }
- }
- tcp_input_pcb = NULL;
- 800cf46: 4b3d ldr r3, [pc, #244] ; (800d03c <tcp_input+0x8e4>)
- 800cf48: 2200 movs r2, #0
- /* Try to send something out. */
- tcp_output(pcb);
- 800cf4a: 4620 mov r0, r4
- goto aborted;
- }
- }
- }
- tcp_input_pcb = NULL;
- 800cf4c: 601a str r2, [r3, #0]
- /* Try to send something out. */
- tcp_output(pcb);
- 800cf4e: f000 fb71 bl 800d634 <tcp_output>
- }
- }
- /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()).
- Below this line, 'pcb' may not be dereferenced! */
- aborted:
- tcp_input_pcb = NULL;
- 800cf52: 4b3a ldr r3, [pc, #232] ; (800d03c <tcp_input+0x8e4>)
- recv_data = NULL;
- /* give up our reference to inseg.p */
- if (inseg.p != NULL)
- 800cf54: 4d3a ldr r5, [pc, #232] ; (800d040 <tcp_input+0x8e8>)
- }
- }
- /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()).
- Below this line, 'pcb' may not be dereferenced! */
- aborted:
- tcp_input_pcb = NULL;
- 800cf56: 2400 movs r4, #0
- 800cf58: 601c str r4, [r3, #0]
- recv_data = NULL;
- /* give up our reference to inseg.p */
- if (inseg.p != NULL)
- 800cf5a: 6868 ldr r0, [r5, #4]
- }
- /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()).
- Below this line, 'pcb' may not be dereferenced! */
- aborted:
- tcp_input_pcb = NULL;
- recv_data = NULL;
- 800cf5c: 4b35 ldr r3, [pc, #212] ; (800d034 <tcp_input+0x8dc>)
- 800cf5e: 601c str r4, [r3, #0]
- /* give up our reference to inseg.p */
- if (inseg.p != NULL)
- 800cf60: b310 cbz r0, 800cfa8 <tcp_input+0x850>
- {
- pbuf_free(inseg.p);
- 800cf62: f7fe faaf bl 800b4c4 <pbuf_free>
- inseg.p = NULL;
- 800cf66: 606c str r4, [r5, #4]
- 800cf68: e01e b.n 800cfa8 <tcp_input+0x850>
- /* If no matching PCB was found, send a TCP RST (reset) to the
- sender. */
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
- if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
- TCP_STATS_INC(tcp.proterr);
- 800cf6a: 4b36 ldr r3, [pc, #216] ; (800d044 <tcp_input+0x8ec>)
- 800cf6c: f8b3 20a0 ldrh.w r2, [r3, #160] ; 0xa0
- 800cf70: 3201 adds r2, #1
- 800cf72: f8a3 20a0 strh.w r2, [r3, #160] ; 0xa0
- TCP_STATS_INC(tcp.drop);
- 800cf76: f8b3 2096 ldrh.w r2, [r3, #150] ; 0x96
- 800cf7a: 3201 adds r2, #1
- 800cf7c: f8a3 2096 strh.w r2, [r3, #150] ; 0x96
- tcp_rst(ackno, seqno + tcplen,
- ip_current_dest_addr(), ip_current_src_addr(),
- tcphdr->dest, tcphdr->src);
- 800cf80: 4b31 ldr r3, [pc, #196] ; (800d048 <tcp_input+0x8f0>)
- sender. */
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
- if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
- TCP_STATS_INC(tcp.proterr);
- TCP_STATS_INC(tcp.drop);
- tcp_rst(ackno, seqno + tcplen,
- 800cf82: 4a32 ldr r2, [pc, #200] ; (800d04c <tcp_input+0x8f4>)
- ip_current_dest_addr(), ip_current_src_addr(),
- tcphdr->dest, tcphdr->src);
- 800cf84: 681b ldr r3, [r3, #0]
- sender. */
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
- if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
- TCP_STATS_INC(tcp.proterr);
- TCP_STATS_INC(tcp.drop);
- tcp_rst(ackno, seqno + tcplen,
- 800cf86: 8811 ldrh r1, [r2, #0]
- 800cf88: 8858 ldrh r0, [r3, #2]
- 800cf8a: 4a31 ldr r2, [pc, #196] ; (800d050 <tcp_input+0x8f8>)
- 800cf8c: 6812 ldr r2, [r2, #0]
- 800cf8e: 9000 str r0, [sp, #0]
- 800cf90: 881b ldrh r3, [r3, #0]
- 800cf92: 9301 str r3, [sp, #4]
- 800cf94: 4b2f ldr r3, [pc, #188] ; (800d054 <tcp_input+0x8fc>)
- 800cf96: 1889 adds r1, r1, r2
- 800cf98: 6818 ldr r0, [r3, #0]
- 800cf9a: 4a2f ldr r2, [pc, #188] ; (800d058 <tcp_input+0x900>)
- 800cf9c: 4b2f ldr r3, [pc, #188] ; (800d05c <tcp_input+0x904>)
- 800cf9e: f000 fc85 bl 800d8ac <tcp_rst>
- ip_current_dest_addr(), ip_current_src_addr(),
- tcphdr->dest, tcphdr->src);
- }
- pbuf_free(p);
- 800cfa2: 4630 mov r0, r6
- 800cfa4: f7fe fa8e bl 800b4c4 <pbuf_free>
- return;
- dropped:
- TCP_STATS_INC(tcp.drop);
- snmp_inc_tcpinerrs();
- pbuf_free(p);
- }
- 800cfa8: b003 add sp, #12
- 800cfaa: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- tcphdr->dest, tcphdr->src);
- }
- pbuf_free(p);
- }
- LWIP_ASSERT("tcp_input: tcp_pcbs_sane()", tcp_pcbs_sane());
- 800cfae: f7fe bedf b.w 800bd70 <tcp_pcbs_sane>
- PERF_STOP("tcp_input");
- return;
- dropped:
- TCP_STATS_INC(tcp.drop);
- 800cfb2: 4b24 ldr r3, [pc, #144] ; (800d044 <tcp_input+0x8ec>)
- 800cfb4: f8b3 2096 ldrh.w r2, [r3, #150] ; 0x96
- 800cfb8: 3201 adds r2, #1
- 800cfba: f8a3 2096 strh.w r2, [r3, #150] ; 0x96
- snmp_inc_tcpinerrs();
- pbuf_free(p);
- 800cfbe: 4630 mov r0, r6
- }
- 800cfc0: b003 add sp, #12
- 800cfc2: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- PERF_STOP("tcp_input");
- return;
- dropped:
- TCP_STATS_INC(tcp.drop);
- snmp_inc_tcpinerrs();
- pbuf_free(p);
- 800cfc6: f7fe ba7d b.w 800b4c4 <pbuf_free>
- tcp_debug_print_state(pcb->state);
- #endif /* TCP_DEBUG */
- #endif /* TCP_INPUT_DEBUG */
- /* Set up a tcp_seg structure. */
- inseg.next = NULL;
- 800cfca: 4b1d ldr r3, [pc, #116] ; (800d040 <tcp_input+0x8e8>)
- 800cfcc: 2100 movs r1, #0
- 800cfce: 6019 str r1, [r3, #0]
- inseg.len = p->tot_len;
- 800cfd0: f8a3 9008 strh.w r9, [r3, #8]
- inseg.p = p;
- 800cfd4: 605e str r6, [r3, #4]
- inseg.tcphdr = tcphdr;
- 800cfd6: 60df str r7, [r3, #12]
- recv_data = NULL;
- 800cfd8: 4b16 ldr r3, [pc, #88] ; (800d034 <tcp_input+0x8dc>)
- recv_flags = 0;
- if (flags & TCP_PSH) {
- 800cfda: f002 0208 and.w r2, r2, #8
- inseg.next = NULL;
- inseg.len = p->tot_len;
- inseg.p = p;
- inseg.tcphdr = tcphdr;
- recv_data = NULL;
- 800cfde: 6019 str r1, [r3, #0]
- recv_flags = 0;
- 800cfe0: 4b15 ldr r3, [pc, #84] ; (800d038 <tcp_input+0x8e0>)
- if (flags & TCP_PSH) {
- 800cfe2: b2d2 uxtb r2, r2
- inseg.len = p->tot_len;
- inseg.p = p;
- inseg.tcphdr = tcphdr;
- recv_data = NULL;
- recv_flags = 0;
- 800cfe4: 7019 strb r1, [r3, #0]
- if (flags & TCP_PSH) {
- 800cfe6: 2a00 cmp r2, #0
- 800cfe8: f47f ad38 bne.w 800ca5c <tcp_input+0x304>
- 800cfec: e53a b.n 800ca64 <tcp_input+0x30c>
- }
- if (pcb == NULL) {
- /* If it did not go to an active connection, we check the connections
- in the TIME-WAIT state. */
- for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
- 800cfee: 4b1c ldr r3, [pc, #112] ; (800d060 <tcp_input+0x908>)
- 800cff0: 681b ldr r3, [r3, #0]
- 800cff2: e48c b.n 800c90e <tcp_input+0x1b6>
- #endif /* SO_REUSE */
- if (lpcb != NULL) {
- /* Move this PCB to the front of the list so that subsequent
- lookups will be faster (we exploit locality in TCP segment
- arrivals). */
- if (prev != NULL) {
- 800cff4: 2b00 cmp r3, #0
- 800cff6: f47f aca3 bne.w 800c940 <tcp_input+0x1e8>
- 800cffa: e4a6 b.n 800c94a <tcp_input+0x1f2>
- } else {
- /* If no matching PCB was found, send a TCP RST (reset) to the
- sender. */
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
- if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
- 800cffc: 89b8 ldrh r0, [r7, #12]
- 800cffe: f7fd f8f9 bl 800a1f4 <lwip_ntohs>
- 800d002: f000 0004 and.w r0, r0, #4
- 800d006: b280 uxth r0, r0
- 800d008: 2800 cmp r0, #0
- 800d00a: d1ca bne.n 800cfa2 <tcp_input+0x84a>
- 800d00c: e7ad b.n 800cf6a <tcp_input+0x812>
- }
- if (acceptable) {
- LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: Connection RESET\n"));
- LWIP_ASSERT("tcp_input: pcb->state != CLOSED", pcb->state != CLOSED);
- recv_flags |= TF_RESET;
- 800d00e: 4b0a ldr r3, [pc, #40] ; (800d038 <tcp_input+0x8e0>)
- 800d010: 781a ldrb r2, [r3, #0]
- 800d012: f042 0208 orr.w r2, r2, #8
- 800d016: 701a strb r2, [r3, #0]
- pcb->flags &= ~TF_ACK_DELAY;
- 800d018: 7fa3 ldrb r3, [r4, #30]
- 800d01a: f023 0301 bic.w r3, r3, #1
- 800d01e: 77a3 strb r3, [r4, #30]
- tcp_input_pcb = pcb;
- err = tcp_process(pcb);
- /* A return value of ERR_ABRT means that tcp_abort() was called
- and that the pcb has been freed. If so, we don't do anything. */
- if (err != ERR_ABRT) {
- if (recv_flags & TF_RESET) {
- 800d020: 4b05 ldr r3, [pc, #20] ; (800d038 <tcp_input+0x8e0>)
- 800d022: 781b ldrb r3, [r3, #0]
- 800d024: f003 0208 and.w r2, r3, #8
- 800d028: b2d2 uxtb r2, r2
- 800d02a: 2a00 cmp r2, #0
- 800d02c: f47f af06 bne.w 800ce3c <tcp_input+0x6e4>
- 800d030: e70b b.n 800ce4a <tcp_input+0x6f2>
- 800d032: bf00 nop
- 800d034: 20006b94 .word 0x20006b94
- 800d038: 20006b91 .word 0x20006b91
- 800d03c: 20008354 .word 0x20008354
- 800d040: 20006b9c .word 0x20006b9c
- 800d044: 20008220 .word 0x20008220
- 800d048: 20006b80 .word 0x20006b80
- 800d04c: 20006b88 .word 0x20006b88
- 800d050: 20006b84 .word 0x20006b84
- 800d054: 20006b8c .word 0x20006b8c
- 800d058: 20008364 .word 0x20008364
- 800d05c: 2000835c .word 0x2000835c
- 800d060: 20008350 .word 0x20008350
- 0800d064 <tcp_pbuf_prealloc>:
- #if TCP_OVERSIZE
- static struct pbuf *
- tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
- u16_t *oversize, struct tcp_pcb *pcb, u8_t apiflags,
- u8_t first_seg)
- {
- 800d064: b570 push {r4, r5, r6, lr}
- LWIP_UNUSED_ARG(apiflags);
- LWIP_UNUSED_ARG(first_seg);
- /* always create MSS-sized pbufs */
- alloc = max_length;
- #else /* LWIP_NETIF_TX_SINGLE_PBUF */
- if (length < max_length) {
- 800d066: 4291 cmp r1, r2
- #if TCP_OVERSIZE
- static struct pbuf *
- tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
- u16_t *oversize, struct tcp_pcb *pcb, u8_t apiflags,
- u8_t first_seg)
- {
- 800d068: 460c mov r4, r1
- 800d06a: 461e mov r6, r3
- 800d06c: 9d04 ldr r5, [sp, #16]
- LWIP_UNUSED_ARG(apiflags);
- LWIP_UNUSED_ARG(first_seg);
- /* always create MSS-sized pbufs */
- alloc = max_length;
- #else /* LWIP_NETIF_TX_SINGLE_PBUF */
- if (length < max_length) {
- 800d06e: d21a bcs.n 800d0a6 <tcp_pbuf_prealloc+0x42>
- *
- * Did the user set TCP_WRITE_FLAG_MORE?
- *
- * Will the Nagle algorithm defer transmission of this segment?
- */
- if ((apiflags & TCP_WRITE_FLAG_MORE) ||
- 800d070: f89d 3014 ldrb.w r3, [sp, #20]
- 800d074: f003 0302 and.w r3, r3, #2
- 800d078: b2db uxtb r3, r3
- 800d07a: b95b cbnz r3, 800d094 <tcp_pbuf_prealloc+0x30>
- (!(pcb->flags & TF_NODELAY) &&
- 800d07c: 7fab ldrb r3, [r5, #30]
- *
- * Did the user set TCP_WRITE_FLAG_MORE?
- *
- * Will the Nagle algorithm defer transmission of this segment?
- */
- if ((apiflags & TCP_WRITE_FLAG_MORE) ||
- 800d07e: f003 0340 and.w r3, r3, #64 ; 0x40
- 800d082: b2db uxtb r3, r3
- 800d084: b97b cbnz r3, 800d0a6 <tcp_pbuf_prealloc+0x42>
- (!(pcb->flags & TF_NODELAY) &&
- 800d086: f89d 3018 ldrb.w r3, [sp, #24]
- 800d08a: b11b cbz r3, 800d094 <tcp_pbuf_prealloc+0x30>
- (!first_seg ||
- 800d08c: 6ee9 ldr r1, [r5, #108] ; 0x6c
- 800d08e: b909 cbnz r1, 800d094 <tcp_pbuf_prealloc+0x30>
- pcb->unsent != NULL ||
- 800d090: 6f2b ldr r3, [r5, #112] ; 0x70
- 800d092: b143 cbz r3, 800d0a6 <tcp_pbuf_prealloc+0x42>
- pcb->unacked != NULL))) {
- alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(length + TCP_OVERSIZE));
- 800d094: f204 51b7 addw r1, r4, #1463 ; 0x5b7
- 800d098: f021 0103 bic.w r1, r1, #3
- 800d09c: 4291 cmp r1, r2
- 800d09e: bfa8 it ge
- 800d0a0: 4611 movge r1, r2
- 800d0a2: b289 uxth r1, r1
- 800d0a4: e000 b.n 800d0a8 <tcp_pbuf_prealloc+0x44>
- * Will the Nagle algorithm defer transmission of this segment?
- */
- if ((apiflags & TCP_WRITE_FLAG_MORE) ||
- (!(pcb->flags & TF_NODELAY) &&
- (!first_seg ||
- pcb->unsent != NULL ||
- 800d0a6: 4621 mov r1, r4
- pcb->unacked != NULL))) {
- alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(length + TCP_OVERSIZE));
- }
- }
- #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
- p = pbuf_alloc(layer, alloc, PBUF_RAM);
- 800d0a8: 2200 movs r2, #0
- 800d0aa: f7fe fa5c bl 800b566 <pbuf_alloc>
- if (p == NULL) {
- 800d0ae: b120 cbz r0, 800d0ba <tcp_pbuf_prealloc+0x56>
- return NULL;
- }
- LWIP_ASSERT("need unchained pbuf", p->next == NULL);
- *oversize = p->len - length;
- 800d0b0: 8943 ldrh r3, [r0, #10]
- 800d0b2: 1b1b subs r3, r3, r4
- 800d0b4: 8033 strh r3, [r6, #0]
- /* trim p->len to the currently used size */
- p->len = p->tot_len = length;
- 800d0b6: 8104 strh r4, [r0, #8]
- 800d0b8: 8144 strh r4, [r0, #10]
- return p;
- }
- 800d0ba: bd70 pop {r4, r5, r6, pc}
- 0800d0bc <tcp_create_segment>:
- * The TCP header is filled in except ackno and wnd.
- * p is freed on failure.
- */
- static struct tcp_seg *
- tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags)
- {
- 800d0bc: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- 800d0c0: f89d 6020 ldrb.w r6, [sp, #32]
- struct tcp_seg *seg;
- u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags);
- 800d0c4: f006 0702 and.w r7, r6, #2
- 800d0c8: f016 0f01 tst.w r6, #1
- 800d0cc: b2ff uxtb r7, r7
- * The TCP header is filled in except ackno and wnd.
- * p is freed on failure.
- */
- static struct tcp_seg *
- tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags)
- {
- 800d0ce: 4680 mov r8, r0
- 800d0d0: 469a mov sl, r3
- struct tcp_seg *seg;
- u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags);
- 800d0d2: bf0c ite eq
- 800d0d4: 2300 moveq r3, #0
- 800d0d6: 2304 movne r3, #4
- 800d0d8: 2f00 cmp r7, #0
- 800d0da: bf14 ite ne
- 800d0dc: 270c movne r7, #12
- 800d0de: 2700 moveq r7, #0
- if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) {
- 800d0e0: 2004 movs r0, #4
- * The TCP header is filled in except ackno and wnd.
- * p is freed on failure.
- */
- static struct tcp_seg *
- tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags)
- {
- 800d0e2: 460d mov r5, r1
- 800d0e4: 4691 mov r9, r2
- struct tcp_seg *seg;
- u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags);
- 800d0e6: 18ff adds r7, r7, r3
- if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) {
- 800d0e8: f7fe f8ca bl 800b280 <memp_malloc>
- 800d0ec: 4604 mov r4, r0
- 800d0ee: b918 cbnz r0, 800d0f8 <tcp_create_segment+0x3c>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no memory.\n"));
- pbuf_free(p);
- 800d0f0: 4628 mov r0, r5
- 800d0f2: f7fe f9e7 bl 800b4c4 <pbuf_free>
- return NULL;
- 800d0f6: e036 b.n 800d166 <tcp_create_segment+0xaa>
- }
- seg->flags = optflags;
- 800d0f8: 7286 strb r6, [r0, #10]
- seg->next = NULL;
- seg->p = p;
- seg->len = p->tot_len - optlen;
- 800d0fa: 892b ldrh r3, [r5, #8]
- pbuf_free(p);
- return NULL;
- }
- seg->flags = optflags;
- seg->next = NULL;
- seg->p = p;
- 800d0fc: 6045 str r5, [r0, #4]
- seg->len = p->tot_len - optlen;
- 800d0fe: 1bdb subs r3, r3, r7
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no memory.\n"));
- pbuf_free(p);
- return NULL;
- }
- seg->flags = optflags;
- seg->next = NULL;
- 800d100: 2600 movs r6, #0
- 800d102: 6006 str r6, [r0, #0]
- seg->p = p;
- seg->len = p->tot_len - optlen;
- 800d104: 8103 strh r3, [r0, #8]
- LWIP_ASSERT("invalid optflags passed: TF_SEG_DATA_CHECKSUMMED",
- (optflags & TF_SEG_DATA_CHECKSUMMED) == 0);
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* build TCP header */
- if (pbuf_header(p, TCP_HLEN)) {
- 800d106: 2114 movs r1, #20
- 800d108: 4628 mov r0, r5
- 800d10a: f7fe f9b0 bl 800b46e <pbuf_header>
- 800d10e: 4605 mov r5, r0
- 800d110: b150 cbz r0, 800d128 <tcp_create_segment+0x6c>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
- TCP_STATS_INC(tcp.err);
- 800d112: 4b16 ldr r3, [pc, #88] ; (800d16c <tcp_create_segment+0xb0>)
- 800d114: f8b3 20a4 ldrh.w r2, [r3, #164] ; 0xa4
- tcp_seg_free(seg);
- 800d118: 4620 mov r0, r4
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* build TCP header */
- if (pbuf_header(p, TCP_HLEN)) {
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
- TCP_STATS_INC(tcp.err);
- 800d11a: 3201 adds r2, #1
- 800d11c: f8a3 20a4 strh.w r2, [r3, #164] ; 0xa4
- tcp_seg_free(seg);
- return NULL;
- 800d120: 4634 mov r4, r6
- /* build TCP header */
- if (pbuf_header(p, TCP_HLEN)) {
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
- TCP_STATS_INC(tcp.err);
- tcp_seg_free(seg);
- 800d122: f7fe fc78 bl 800ba16 <tcp_seg_free>
- return NULL;
- 800d126: e01e b.n 800d166 <tcp_create_segment+0xaa>
- }
- seg->tcphdr = (struct tcp_hdr *)seg->p->payload;
- 800d128: 6863 ldr r3, [r4, #4]
- seg->tcphdr->src = htons(pcb->local_port);
- 800d12a: f8b8 001a ldrh.w r0, [r8, #26]
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_create_segment: no room for TCP header in pbuf.\n"));
- TCP_STATS_INC(tcp.err);
- tcp_seg_free(seg);
- return NULL;
- }
- seg->tcphdr = (struct tcp_hdr *)seg->p->payload;
- 800d12e: 685e ldr r6, [r3, #4]
- 800d130: 60e6 str r6, [r4, #12]
- seg->tcphdr->src = htons(pcb->local_port);
- 800d132: f7fd f85a bl 800a1ea <lwip_htons>
- 800d136: 8030 strh r0, [r6, #0]
- seg->tcphdr->dest = htons(pcb->remote_port);
- 800d138: f8b8 001c ldrh.w r0, [r8, #28]
- 800d13c: 68e6 ldr r6, [r4, #12]
- 800d13e: f7fd f854 bl 800a1ea <lwip_htons>
- 800d142: 8070 strh r0, [r6, #2]
- seg->tcphdr->seqno = htonl(seqno);
- 800d144: 4650 mov r0, sl
- 800d146: 68e6 ldr r6, [r4, #12]
- 800d148: f7fd f859 bl 800a1fe <lwip_htonl>
- /* ackno is set in tcp_output */
- TCPH_HDRLEN_FLAGS_SET(seg->tcphdr, (5 + optlen / 4), flags);
- 800d14c: 02bf lsls r7, r7, #10
- return NULL;
- }
- seg->tcphdr = (struct tcp_hdr *)seg->p->payload;
- seg->tcphdr->src = htons(pcb->local_port);
- seg->tcphdr->dest = htons(pcb->remote_port);
- seg->tcphdr->seqno = htonl(seqno);
- 800d14e: 6070 str r0, [r6, #4]
- /* ackno is set in tcp_output */
- TCPH_HDRLEN_FLAGS_SET(seg->tcphdr, (5 + optlen / 4), flags);
- 800d150: f507 40a0 add.w r0, r7, #20480 ; 0x5000
- 800d154: ea40 0009 orr.w r0, r0, r9
- 800d158: 68e6 ldr r6, [r4, #12]
- 800d15a: f7fd f846 bl 800a1ea <lwip_htons>
- 800d15e: 81b0 strh r0, [r6, #12]
- /* wnd and chksum are set in tcp_output */
- seg->tcphdr->urgp = 0;
- 800d160: 68e3 ldr r3, [r4, #12]
- 800d162: 749d strb r5, [r3, #18]
- 800d164: 74dd strb r5, [r3, #19]
- return seg;
- }
- 800d166: 4620 mov r0, r4
- 800d168: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 800d16c: 20008220 .word 0x20008220
- 0800d170 <tcp_output_alloc_header.constprop.0>:
- static struct pbuf *
- tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
- u32_t seqno_be /* already in network byte order */)
- {
- struct tcp_hdr *tcphdr;
- struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
- 800d170: 3114 adds r1, #20
- * @param datalen length of tcp data to reserve in pbuf
- * @param seqno_be seqno in network byte order (big-endian)
- * @return pbuf with p->payload being the tcp_hdr
- */
- static struct pbuf *
- tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
- 800d172: b5f8 push {r3, r4, r5, r6, r7, lr}
- u32_t seqno_be /* already in network byte order */)
- {
- struct tcp_hdr *tcphdr;
- struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
- 800d174: b289 uxth r1, r1
- * @param datalen length of tcp data to reserve in pbuf
- * @param seqno_be seqno in network byte order (big-endian)
- * @return pbuf with p->payload being the tcp_hdr
- */
- static struct pbuf *
- tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
- 800d176: 4605 mov r5, r0
- 800d178: 4617 mov r7, r2
- u32_t seqno_be /* already in network byte order */)
- {
- struct tcp_hdr *tcphdr;
- struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
- 800d17a: 2001 movs r0, #1
- 800d17c: 2200 movs r2, #0
- 800d17e: f7fe f9f2 bl 800b566 <pbuf_alloc>
- if (p != NULL) {
- 800d182: 4606 mov r6, r0
- 800d184: b1f8 cbz r0, 800d1c6 <tcp_output_alloc_header.constprop.0+0x56>
- LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
- (p->len >= TCP_HLEN + optlen));
- tcphdr = (struct tcp_hdr *)p->payload;
- 800d186: 6844 ldr r4, [r0, #4]
- tcphdr->src = htons(pcb->local_port);
- 800d188: 8b68 ldrh r0, [r5, #26]
- 800d18a: f7fd f82e bl 800a1ea <lwip_htons>
- 800d18e: 8020 strh r0, [r4, #0]
- tcphdr->dest = htons(pcb->remote_port);
- 800d190: 8ba8 ldrh r0, [r5, #28]
- 800d192: f7fd f82a bl 800a1ea <lwip_htons>
- tcphdr->seqno = seqno_be;
- 800d196: 6067 str r7, [r4, #4]
- if (p != NULL) {
- LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
- (p->len >= TCP_HLEN + optlen));
- tcphdr = (struct tcp_hdr *)p->payload;
- tcphdr->src = htons(pcb->local_port);
- tcphdr->dest = htons(pcb->remote_port);
- 800d198: 8060 strh r0, [r4, #2]
- tcphdr->seqno = seqno_be;
- tcphdr->ackno = htonl(pcb->rcv_nxt);
- 800d19a: 6aa8 ldr r0, [r5, #40] ; 0x28
- 800d19c: f7fd f82f bl 800a1fe <lwip_htonl>
- 800d1a0: 60a0 str r0, [r4, #8]
- TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), TCP_ACK);
- 800d1a2: f245 0010 movw r0, #20496 ; 0x5010
- 800d1a6: f7fd f820 bl 800a1ea <lwip_htons>
- 800d1aa: 81a0 strh r0, [r4, #12]
- tcphdr->wnd = htons(pcb->rcv_ann_wnd);
- 800d1ac: 8de8 ldrh r0, [r5, #46] ; 0x2e
- 800d1ae: f7fd f81c bl 800a1ea <lwip_htons>
- tcphdr->chksum = 0;
- 800d1b2: 2300 movs r3, #0
- tcphdr->src = htons(pcb->local_port);
- tcphdr->dest = htons(pcb->remote_port);
- tcphdr->seqno = seqno_be;
- tcphdr->ackno = htonl(pcb->rcv_nxt);
- TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), TCP_ACK);
- tcphdr->wnd = htons(pcb->rcv_ann_wnd);
- 800d1b4: 81e0 strh r0, [r4, #14]
- tcphdr->chksum = 0;
- 800d1b6: 7423 strb r3, [r4, #16]
- 800d1b8: 7463 strb r3, [r4, #17]
- tcphdr->urgp = 0;
- 800d1ba: 74a3 strb r3, [r4, #18]
- 800d1bc: 74e3 strb r3, [r4, #19]
- /* If we're sending a packet, update the announced right window edge */
- pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
- 800d1be: 8dea ldrh r2, [r5, #46] ; 0x2e
- 800d1c0: 6aab ldr r3, [r5, #40] ; 0x28
- 800d1c2: 18d3 adds r3, r2, r3
- 800d1c4: 632b str r3, [r5, #48] ; 0x30
- }
- return p;
- }
- 800d1c6: 4630 mov r0, r6
- 800d1c8: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 800d1ca: 0000 movs r0, r0
- 0800d1cc <tcp_write>:
- * - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will be set on last segment sent,
- * @return ERR_OK if enqueued, another err_t on error
- */
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- 800d1cc: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 800d1d0: b08f sub sp, #60 ; 0x3c
- 800d1d2: 4691 mov r9, r2
- 800d1d4: 9307 str r3, [sp, #28]
- u16_t pos = 0; /* position in 'arg' data */
- u16_t queuelen;
- u8_t optlen = 0;
- u8_t optflags = 0;
- #if TCP_OVERSIZE
- u16_t oversize = 0;
- 800d1d6: 2300 movs r3, #0
- 800d1d8: f8ad 3036 strh.w r3, [sp, #54] ; 0x36
- * - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will be set on last segment sent,
- * @return ERR_OK if enqueued, another err_t on error
- */
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- 800d1dc: 4604 mov r4, r0
- u8_t concat_chksum_swapped = 0;
- u16_t concat_chksummed = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- err_t err;
- /* don't allocate segments bigger than half the maximum window we ever received */
- u16_t mss_local = LWIP_MIN(pcb->mss, pcb->snd_wnd_max/2);
- 800d1de: f8b0 2062 ldrh.w r2, [r0, #98] ; 0x62
- 800d1e2: 8ec3 ldrh r3, [r0, #54] ; 0x36
- apiflags |= TCP_WRITE_FLAG_COPY;
- #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n",
- (void *)pcb, arg, len, (u16_t)apiflags));
- LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)",
- 800d1e4: 9106 str r1, [sp, #24]
- 800d1e6: 2900 cmp r1, #0
- 800d1e8: f000 8176 beq.w 800d4d8 <tcp_write+0x30c>
- 800d1ec: 7e01 ldrb r1, [r0, #24]
- 800d1ee: 2907 cmp r1, #7
- 800d1f0: f200 8174 bhi.w 800d4dc <tcp_write+0x310>
- 800d1f4: f990 1018 ldrsb.w r1, [r0, #24]
- 800d1f8: f04f 5064 mov.w r0, #956301312 ; 0x39000000
- 800d1fc: 4088 lsls r0, r1
- 800d1fe: f140 816d bpl.w 800d4dc <tcp_write+0x310>
- (pcb->state != CLOSE_WAIT) &&
- (pcb->state != SYN_SENT) &&
- (pcb->state != SYN_RCVD)) {
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_STATE | LWIP_DBG_LEVEL_SEVERE, ("tcp_write() called in invalid state\n"));
- return ERR_CONN;
- } else if (len == 0) {
- 800d202: f1b9 0f00 cmp.w r9, #0
- 800d206: d013 beq.n 800d230 <tcp_write+0x64>
- return ERR_OK;
- }
- /* fail on too much data */
- if (len > pcb->snd_buf) {
- 800d208: f8b4 1066 ldrh.w r1, [r4, #102] ; 0x66
- 800d20c: 4549 cmp r1, r9
- 800d20e: d200 bcs.n 800d212 <tcp_write+0x46>
- 800d210: e009 b.n 800d226 <tcp_write+0x5a>
- LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_write: queuelen: %"U16_F"\n", (u16_t)pcb->snd_queuelen));
- /* If total number of pbufs on the unsent/unacked queues exceeds the
- * configured maximum, return an error */
- /* check for configured max queuelen and possible overflow */
- if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
- 800d212: f8b4 1068 ldrh.w r1, [r4, #104] ; 0x68
- 800d216: 2947 cmp r1, #71 ; 0x47
- 800d218: d90a bls.n 800d230 <tcp_write+0x64>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too long queue %"U16_F" (max %"U16_F")\n",
- pcb->snd_queuelen, TCP_SND_QUEUELEN));
- TCP_STATS_INC(tcp.memerr);
- 800d21a: 4b94 ldr r3, [pc, #592] ; (800d46c <tcp_write+0x2a0>)
- 800d21c: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
- 800d220: 3201 adds r2, #1
- 800d222: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
- pcb->flags |= TF_NAGLEMEMERR;
- 800d226: 7fa3 ldrb r3, [r4, #30]
- 800d228: f063 037f orn r3, r3, #127 ; 0x7f
- 800d22c: 77a3 strb r3, [r4, #30]
- 800d22e: e159 b.n 800d4e4 <tcp_write+0x318>
- u8_t concat_chksum_swapped = 0;
- u16_t concat_chksummed = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- err_t err;
- /* don't allocate segments bigger than half the maximum window we ever received */
- u16_t mss_local = LWIP_MIN(pcb->mss, pcb->snd_wnd_max/2);
- 800d230: 0852 lsrs r2, r2, #1
- *
- * pos records progress as data is segmented.
- */
- /* Find the tail of the unsent queue. */
- if (pcb->unsent != NULL) {
- 800d232: 6ee6 ldr r6, [r4, #108] ; 0x6c
- err = tcp_write_checks(pcb, len);
- if (err != ERR_OK) {
- return err;
- }
- queuelen = pcb->snd_queuelen;
- 800d234: f8b4 b068 ldrh.w fp, [r4, #104] ; 0x68
- u8_t concat_chksum_swapped = 0;
- u16_t concat_chksummed = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- err_t err;
- /* don't allocate segments bigger than half the maximum window we ever received */
- u16_t mss_local = LWIP_MIN(pcb->mss, pcb->snd_wnd_max/2);
- 800d238: 429a cmp r2, r3
- 800d23a: bf28 it cs
- 800d23c: 461a movcs r2, r3
- 800d23e: 920a str r2, [sp, #40] ; 0x28
- *
- * pos records progress as data is segmented.
- */
- /* Find the tail of the unsent queue. */
- if (pcb->unsent != NULL) {
- 800d240: b90e cbnz r6, 800d246 <tcp_write+0x7a>
- 800d242: e066 b.n 800d312 <tcp_write+0x146>
- u16_t space;
- u16_t unsent_optlen;
- /* @todo: this could be sped up by keeping last_unsent in the pcb */
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- last_unsent = last_unsent->next);
- 800d244: 461e mov r6, r3
- if (pcb->unsent != NULL) {
- u16_t space;
- u16_t unsent_optlen;
- /* @todo: this could be sped up by keeping last_unsent in the pcb */
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- 800d246: 6833 ldr r3, [r6, #0]
- 800d248: 2b00 cmp r3, #0
- 800d24a: d1fb bne.n 800d244 <tcp_write+0x78>
- last_unsent = last_unsent->next);
- /* Usable space at the end of the last unsent segment */
- unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags);
- 800d24c: 7ab3 ldrb r3, [r6, #10]
- space = mss_local - (last_unsent->len + unsent_optlen);
- 800d24e: 8937 ldrh r7, [r6, #8]
- /* @todo: this could be sped up by keeping last_unsent in the pcb */
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- last_unsent = last_unsent->next);
- /* Usable space at the end of the last unsent segment */
- unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags);
- 800d250: 980a ldr r0, [sp, #40] ; 0x28
- #if TCP_OVERSIZE_DBGCHECK
- /* check that pcb->unsent_oversize matches last_unsent->unsent_oversize */
- LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)",
- pcb->unsent_oversize == last_unsent->oversize_left);
- #endif /* TCP_OVERSIZE_DBGCHECK */
- oversize = pcb->unsent_oversize;
- 800d252: f8b4 506a ldrh.w r5, [r4, #106] ; 0x6a
- /* @todo: this could be sped up by keeping last_unsent in the pcb */
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- last_unsent = last_unsent->next);
- /* Usable space at the end of the last unsent segment */
- unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags);
- 800d256: f013 0f01 tst.w r3, #1
- 800d25a: f003 0302 and.w r3, r3, #2
- 800d25e: bf0c ite eq
- 800d260: 2100 moveq r1, #0
- 800d262: 2104 movne r1, #4
- 800d264: b2db uxtb r3, r3
- 800d266: 1bc2 subs r2, r0, r7
- 800d268: 2b00 cmp r3, #0
- 800d26a: bf14 ite ne
- 800d26c: 230c movne r3, #12
- 800d26e: 2300 moveq r3, #0
- space = mss_local - (last_unsent->len + unsent_optlen);
- 800d270: 1a52 subs r2, r2, r1
- 800d272: 1ad2 subs r2, r2, r3
- 800d274: b292 uxth r2, r2
- /* check that pcb->unsent_oversize matches last_unsent->unsent_oversize */
- LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)",
- pcb->unsent_oversize == last_unsent->oversize_left);
- #endif /* TCP_OVERSIZE_DBGCHECK */
- oversize = pcb->unsent_oversize;
- if (oversize > 0) {
- 800d276: b91d cbnz r5, 800d280 <tcp_write+0xb4>
- #if TCP_OVERSIZE_DBGCHECK
- /* check that pcb->unsent_oversize matches last_unsent->unsent_oversize */
- LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)",
- pcb->unsent_oversize == last_unsent->oversize_left);
- #endif /* TCP_OVERSIZE_DBGCHECK */
- oversize = pcb->unsent_oversize;
- 800d278: f8ad 5036 strh.w r5, [sp, #54] ; 0x36
- */
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- struct pbuf *concat_p = NULL;
- struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
- 800d27c: 462b mov r3, r5
- 800d27e: e00a b.n 800d296 <tcp_write+0xca>
- #endif /* TCP_OVERSIZE_DBGCHECK */
- oversize = pcb->unsent_oversize;
- if (oversize > 0) {
- LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
- seg = last_unsent;
- oversize_used = oversize < len ? oversize : len;
- 800d280: 45a9 cmp r9, r5
- 800d282: bf34 ite cc
- 800d284: 464b movcc r3, r9
- 800d286: 462b movcs r3, r5
- pos += oversize_used;
- oversize -= oversize_used;
- 800d288: 1aed subs r5, r5, r3
- space -= oversize_used;
- 800d28a: 1ad2 subs r2, r2, r3
- if (oversize > 0) {
- LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
- seg = last_unsent;
- oversize_used = oversize < len ? oversize : len;
- pos += oversize_used;
- oversize -= oversize_used;
- 800d28c: f8ad 5036 strh.w r5, [sp, #54] ; 0x36
- space -= oversize_used;
- 800d290: b292 uxth r2, r2
- oversize = pcb->unsent_oversize;
- if (oversize > 0) {
- LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
- seg = last_unsent;
- oversize_used = oversize < len ? oversize : len;
- pos += oversize_used;
- 800d292: 461d mov r5, r3
- oversize -= oversize_used;
- space -= oversize_used;
- 800d294: 4633 mov r3, r6
- *
- * We don't extend segments containing SYN/FIN flags or options
- * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
- * the end.
- */
- if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
- 800d296: 454d cmp r5, r9
- 800d298: d23f bcs.n 800d31a <tcp_write+0x14e>
- 800d29a: 2a00 cmp r2, #0
- 800d29c: d03d beq.n 800d31a <tcp_write+0x14e>
- 800d29e: 2f00 cmp r7, #0
- 800d2a0: d03e beq.n 800d320 <tcp_write+0x154>
- seg = last_unsent;
- /* Create a pbuf with a copy or reference to seglen bytes. We
- * can use PBUF_RAW here since the data appears in the middle of
- * a segment. A header will never be prepended. */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d2a2: 9907 ldr r1, [sp, #28]
- * We don't extend segments containing SYN/FIN flags or options
- * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
- * the end.
- */
- if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
- u16_t seglen = space < len - pos ? space : len - pos;
- 800d2a4: ebc5 0a09 rsb sl, r5, r9
- 800d2a8: 4592 cmp sl, r2
- 800d2aa: bfa8 it ge
- 800d2ac: 4692 movge sl, r2
- seg = last_unsent;
- /* Create a pbuf with a copy or reference to seglen bytes. We
- * can use PBUF_RAW here since the data appears in the middle of
- * a segment. A header will never be prepended. */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d2ae: 07cb lsls r3, r1, #31
- * We don't extend segments containing SYN/FIN flags or options
- * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
- * the end.
- */
- if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
- u16_t seglen = space < len - pos ? space : len - pos;
- 800d2b0: fa1f f88a uxth.w r8, sl
- seg = last_unsent;
- /* Create a pbuf with a copy or reference to seglen bytes. We
- * can use PBUF_RAW here since the data appears in the middle of
- * a segment. A header will never be prepended. */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d2b4: d514 bpl.n 800d2e0 <tcp_write+0x114>
- /* Data is copied */
- if ((concat_p = tcp_pbuf_prealloc(PBUF_RAW, seglen, space, &oversize, pcb, apiflags, 1)) == NULL) {
- 800d2b6: 2301 movs r3, #1
- 800d2b8: 9101 str r1, [sp, #4]
- 800d2ba: 9302 str r3, [sp, #8]
- 800d2bc: 9400 str r4, [sp, #0]
- 800d2be: 2003 movs r0, #3
- 800d2c0: 4641 mov r1, r8
- 800d2c2: f10d 0336 add.w r3, sp, #54 ; 0x36
- 800d2c6: f7ff fecd bl 800d064 <tcp_pbuf_prealloc>
- 800d2ca: 4607 mov r7, r0
- 800d2cc: 2800 cmp r0, #0
- 800d2ce: f000 80eb beq.w 800d4a8 <tcp_write+0x2dc>
- goto memerr;
- }
- #if TCP_OVERSIZE_DBGCHECK
- last_unsent->oversize_left += oversize;
- #endif /* TCP_OVERSIZE_DBGCHECK */
- TCP_DATA_COPY2(concat_p->payload, (u8_t*)arg + pos, seglen, &concat_chksum, &concat_chksum_swapped);
- 800d2d2: 9a06 ldr r2, [sp, #24]
- 800d2d4: 6840 ldr r0, [r0, #4]
- 800d2d6: 1951 adds r1, r2, r5
- 800d2d8: 4642 mov r2, r8
- 800d2da: f7fc f893 bl 8009404 <memcpy>
- 800d2de: e00b b.n 800d2f8 <tcp_write+0x12c>
- #if TCP_CHECKSUM_ON_COPY
- concat_chksummed += seglen;
- #endif /* TCP_CHECKSUM_ON_COPY */
- } else {
- /* Data is not copied */
- if ((concat_p = pbuf_alloc(PBUF_RAW, seglen, PBUF_ROM)) == NULL) {
- 800d2e0: 2003 movs r0, #3
- 800d2e2: 4641 mov r1, r8
- 800d2e4: 2201 movs r2, #1
- 800d2e6: f7fe f93e bl 800b566 <pbuf_alloc>
- 800d2ea: 4607 mov r7, r0
- 800d2ec: 2800 cmp r0, #0
- 800d2ee: f000 80db beq.w 800d4a8 <tcp_write+0x2dc>
- tcp_seg_add_chksum(~inet_chksum((u8_t*)arg + pos, seglen), seglen,
- &concat_chksum, &concat_chksum_swapped);
- concat_chksummed += seglen;
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* reference the non-volatile payload data */
- concat_p->payload = (u8_t*)arg + pos;
- 800d2f2: 9806 ldr r0, [sp, #24]
- 800d2f4: 1943 adds r3, r0, r5
- 800d2f6: 607b str r3, [r7, #4]
- }
- pos += seglen;
- queuelen += pbuf_clen(concat_p);
- 800d2f8: 4638 mov r0, r7
- 800d2fa: f7fe f9bb bl 800b674 <pbuf_clen>
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* reference the non-volatile payload data */
- concat_p->payload = (u8_t*)arg + pos;
- }
- pos += seglen;
- 800d2fe: 44a8 add r8, r5
- 800d300: fa1f f888 uxth.w r8, r8
- queuelen += pbuf_clen(concat_p);
- 800d304: 4458 add r0, fp
- 800d306: 46aa mov sl, r5
- 800d308: fa1f fb80 uxth.w fp, r0
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* reference the non-volatile payload data */
- concat_p->payload = (u8_t*)arg + pos;
- }
- pos += seglen;
- 800d30c: 4645 mov r5, r8
- queuelen += pbuf_clen(concat_p);
- 800d30e: 4633 mov r3, r6
- 800d310: e007 b.n 800d322 <tcp_write+0x156>
- u16_t queuelen;
- u8_t optlen = 0;
- u8_t optflags = 0;
- #if TCP_OVERSIZE
- u16_t oversize = 0;
- u16_t oversize_used = 0;
- 800d312: 46b2 mov sl, r6
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- struct pbuf *concat_p = NULL;
- struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
- u16_t pos = 0; /* position in 'arg' data */
- 800d314: 4635 mov r5, r6
- */
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- struct pbuf *concat_p = NULL;
- struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
- 800d316: 4633 mov r3, r6
- 800d318: e000 b.n 800d31c <tcp_write+0x150>
- *
- * We don't extend segments containing SYN/FIN flags or options
- * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
- * the end.
- */
- if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
- 800d31a: 46aa mov sl, r5
- * @return ERR_OK if enqueued, another err_t on error
- */
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- struct pbuf *concat_p = NULL;
- 800d31c: 2700 movs r7, #0
- 800d31e: e000 b.n 800d322 <tcp_write+0x156>
- *
- * We don't extend segments containing SYN/FIN flags or options
- * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at
- * the end.
- */
- if ((pos < len) && (space > 0) && (last_unsent->len > 0)) {
- 800d320: 46aa mov sl, r5
- #if TCP_CHECKSUM_ON_COPY
- u16_t chksum = 0;
- u8_t chksum_swapped = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d322: 9907 ldr r1, [sp, #28]
- seg->chksum_swapped = chksum_swapped;
- seg->flags |= TF_SEG_DATA_CHECKSUMMED;
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* first segment of to-be-queued data? */
- if (queue == NULL) {
- 800d324: f04f 0800 mov.w r8, #0
- #if TCP_CHECKSUM_ON_COPY
- u16_t chksum = 0;
- u8_t chksum_swapped = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d328: f001 0101 and.w r1, r1, #1
- seg->chksum_swapped = chksum_swapped;
- seg->flags |= TF_SEG_DATA_CHECKSUMMED;
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* first segment of to-be-queued data? */
- if (queue == NULL) {
- 800d32c: f8cd 802c str.w r8, [sp, #44] ; 0x2c
- #if TCP_CHECKSUM_ON_COPY
- u16_t chksum = 0;
- u8_t chksum_swapped = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d330: 9108 str r1, [sp, #32]
- 800d332: e068 b.n 800d406 <tcp_write+0x23a>
- * The new segments are chained together in the local 'queue'
- * variable, ready to be appended to pcb->unsent.
- */
- while (pos < len) {
- struct pbuf *p;
- u16_t left = len - pos;
- 800d334: ebc5 0309 rsb r3, r5, r9
- u16_t max_len = mss_local - optlen;
- u16_t seglen = left > max_len ? max_len : left;
- 800d338: 9a0a ldr r2, [sp, #40] ; 0x28
- 800d33a: b29b uxth r3, r3
- 800d33c: 4293 cmp r3, r2
- 800d33e: bf38 it cc
- 800d340: 461a movcc r2, r3
- #if TCP_CHECKSUM_ON_COPY
- u16_t chksum = 0;
- u8_t chksum_swapped = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d342: 9b08 ldr r3, [sp, #32]
- */
- while (pos < len) {
- struct pbuf *p;
- u16_t left = len - pos;
- u16_t max_len = mss_local - optlen;
- u16_t seglen = left > max_len ? max_len : left;
- 800d344: 9209 str r2, [sp, #36] ; 0x24
- #if TCP_CHECKSUM_ON_COPY
- u16_t chksum = 0;
- u8_t chksum_swapped = 0;
- #endif /* TCP_CHECKSUM_ON_COPY */
- if (apiflags & TCP_WRITE_FLAG_COPY) {
- 800d346: b1db cbz r3, 800d380 <tcp_write+0x1b4>
- /* If copy is set, memory should be allocated and data copied
- * into pbuf */
- if ((p = tcp_pbuf_prealloc(PBUF_TRANSPORT, seglen + optlen, mss_local, &oversize, pcb, apiflags, queue == NULL)) == NULL) {
- 800d348: f1d8 0301 rsbs r3, r8, #1
- 800d34c: 9807 ldr r0, [sp, #28]
- 800d34e: 9400 str r4, [sp, #0]
- 800d350: bf38 it cc
- 800d352: 2300 movcc r3, #0
- 800d354: 9001 str r0, [sp, #4]
- 800d356: 9302 str r3, [sp, #8]
- 800d358: 4611 mov r1, r2
- 800d35a: 2000 movs r0, #0
- 800d35c: 9a0a ldr r2, [sp, #40] ; 0x28
- 800d35e: f10d 0336 add.w r3, sp, #54 ; 0x36
- 800d362: f7ff fe7f bl 800d064 <tcp_pbuf_prealloc>
- 800d366: 4684 mov ip, r0
- 800d368: 2800 cmp r0, #0
- 800d36a: f000 80a0 beq.w 800d4ae <tcp_write+0x2e2>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write : could not allocate memory for pbuf copy size %"U16_F"\n", seglen));
- goto memerr;
- }
- LWIP_ASSERT("tcp_write: check that first pbuf can hold the complete seglen",
- (p->len >= seglen));
- TCP_DATA_COPY2((char *)p->payload + optlen, (u8_t*)arg + pos, seglen, &chksum, &chksum_swapped);
- 800d36e: 9a06 ldr r2, [sp, #24]
- 800d370: 6840 ldr r0, [r0, #4]
- 800d372: f8cd c014 str.w ip, [sp, #20]
- 800d376: 1951 adds r1, r2, r5
- 800d378: 9a09 ldr r2, [sp, #36] ; 0x24
- 800d37a: f7fc f843 bl 8009404 <memcpy>
- 800d37e: e019 b.n 800d3b4 <tcp_write+0x1e8>
- */
- struct pbuf *p2;
- #if TCP_OVERSIZE
- LWIP_ASSERT("oversize == 0", oversize == 0);
- #endif /* TCP_OVERSIZE */
- if ((p2 = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_ROM)) == NULL) {
- 800d380: 9808 ldr r0, [sp, #32]
- 800d382: 9909 ldr r1, [sp, #36] ; 0x24
- 800d384: 2201 movs r2, #1
- 800d386: f7fe f8ee bl 800b566 <pbuf_alloc>
- 800d38a: 4603 mov r3, r0
- 800d38c: 2800 cmp r0, #0
- 800d38e: f000 808e beq.w 800d4ae <tcp_write+0x2e2>
- #if TCP_CHECKSUM_ON_COPY
- /* calculate the checksum of nocopy-data */
- chksum = ~inet_chksum((u8_t*)arg + pos, seglen);
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* reference the non-volatile payload data */
- p2->payload = (u8_t*)arg + pos;
- 800d392: 9806 ldr r0, [sp, #24]
- 800d394: 1942 adds r2, r0, r5
- /* Second, allocate a pbuf for the headers. */
- if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
- 800d396: 9808 ldr r0, [sp, #32]
- #if TCP_CHECKSUM_ON_COPY
- /* calculate the checksum of nocopy-data */
- chksum = ~inet_chksum((u8_t*)arg + pos, seglen);
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* reference the non-volatile payload data */
- p2->payload = (u8_t*)arg + pos;
- 800d398: 605a str r2, [r3, #4]
- /* Second, allocate a pbuf for the headers. */
- if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
- 800d39a: 4601 mov r1, r0
- 800d39c: 4602 mov r2, r0
- 800d39e: 9305 str r3, [sp, #20]
- 800d3a0: f7fe f8e1 bl 800b566 <pbuf_alloc>
- 800d3a4: 9b05 ldr r3, [sp, #20]
- 800d3a6: b908 cbnz r0, 800d3ac <tcp_write+0x1e0>
- /* If allocation fails, we have to deallocate the data pbuf as
- * well. */
- pbuf_free(p2);
- 800d3a8: 4618 mov r0, r3
- 800d3aa: e013 b.n 800d3d4 <tcp_write+0x208>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: could not allocate memory for header pbuf\n"));
- goto memerr;
- }
- /* Concatenate the headers and data pbufs together. */
- pbuf_cat(p/*header*/, p2/*data*/);
- 800d3ac: 4619 mov r1, r3
- 800d3ae: 9005 str r0, [sp, #20]
- 800d3b0: f7fe f96e bl 800b690 <pbuf_cat>
- 800d3b4: f8dd c014 ldr.w ip, [sp, #20]
- }
- queuelen += pbuf_clen(p);
- 800d3b8: 4660 mov r0, ip
- 800d3ba: f8cd c014 str.w ip, [sp, #20]
- 800d3be: f7fe f959 bl 800b674 <pbuf_clen>
- 800d3c2: 4458 add r0, fp
- 800d3c4: fa1f fb80 uxth.w fp, r0
- /* Now that there are more segments queued, we check again if the
- * length of the queue exceeds the configured maximum or
- * overflows. */
- if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
- 800d3c8: f1bb 0f48 cmp.w fp, #72 ; 0x48
- 800d3cc: f8dd c014 ldr.w ip, [sp, #20]
- 800d3d0: d903 bls.n 800d3da <tcp_write+0x20e>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: queue too long %"U16_F" (%"U16_F")\n", queuelen, TCP_SND_QUEUELEN));
- pbuf_free(p);
- 800d3d2: 4660 mov r0, ip
- 800d3d4: f7fe f876 bl 800b4c4 <pbuf_free>
- goto memerr;
- 800d3d8: e069 b.n 800d4ae <tcp_write+0x2e2>
- }
- if ((seg = tcp_create_segment(pcb, p, 0, pcb->snd_lbb + pos, optflags)) == NULL) {
- 800d3da: 6de3 ldr r3, [r4, #92] ; 0x5c
- 800d3dc: 2200 movs r2, #0
- 800d3de: 18eb adds r3, r5, r3
- 800d3e0: 9200 str r2, [sp, #0]
- 800d3e2: 4620 mov r0, r4
- 800d3e4: 4661 mov r1, ip
- 800d3e6: f7ff fe69 bl 800d0bc <tcp_create_segment>
- 800d3ea: 4603 mov r3, r0
- 800d3ec: 2800 cmp r0, #0
- 800d3ee: d05e beq.n 800d4ae <tcp_write+0x2e2>
- seg->chksum_swapped = chksum_swapped;
- seg->flags |= TF_SEG_DATA_CHECKSUMMED;
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* first segment of to-be-queued data? */
- if (queue == NULL) {
- 800d3f0: f1b8 0f00 cmp.w r8, #0
- 800d3f4: d002 beq.n 800d3fc <tcp_write+0x230>
- queue = seg;
- } else {
- /* Attach the segment to the end of the queued segments */
- LWIP_ASSERT("prev_seg != NULL", prev_seg != NULL);
- prev_seg->next = seg;
- 800d3f6: 990b ldr r1, [sp, #44] ; 0x2c
- 800d3f8: 6008 str r0, [r1, #0]
- 800d3fa: e000 b.n 800d3fe <tcp_write+0x232>
- seg->chksum_swapped = chksum_swapped;
- seg->flags |= TF_SEG_DATA_CHECKSUMMED;
- #endif /* TCP_CHECKSUM_ON_COPY */
- /* first segment of to-be-queued data? */
- if (queue == NULL) {
- 800d3fc: 4680 mov r8, r0
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE, ("tcp_write: queueing %"U32_F":%"U32_F"\n",
- ntohl(seg->tcphdr->seqno),
- ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg)));
- pos += seglen;
- 800d3fe: 9a09 ldr r2, [sp, #36] ; 0x24
- 800d400: 930b str r3, [sp, #44] ; 0x2c
- 800d402: 1955 adds r5, r2, r5
- 800d404: b2ad uxth r5, r5
- * Phase 3: Create new segments.
- *
- * The new segments are chained together in the local 'queue'
- * variable, ready to be appended to pcb->unsent.
- */
- while (pos < len) {
- 800d406: 454d cmp r5, r9
- 800d408: d394 bcc.n 800d334 <tcp_write+0x168>
- /*
- * Phase 1: If data has been added to the preallocated tail of
- * last_unsent, we update the length fields of the pbuf chain.
- */
- #if TCP_OVERSIZE
- if (oversize_used > 0) {
- 800d40a: f1ba 0f00 cmp.w sl, #0
- 800d40e: d019 beq.n 800d444 <tcp_write+0x278>
- struct pbuf *p;
- /* Bump tot_len of whole chain, len of tail */
- for (p = last_unsent->p; p; p = p->next) {
- 800d410: 6875 ldr r5, [r6, #4]
- 800d412: e011 b.n 800d438 <tcp_write+0x26c>
- p->tot_len += oversize_used;
- 800d414: 892a ldrh r2, [r5, #8]
- 800d416: 4452 add r2, sl
- 800d418: 812a strh r2, [r5, #8]
- if (p->next == NULL) {
- 800d41a: 682a ldr r2, [r5, #0]
- 800d41c: b95a cbnz r2, 800d436 <tcp_write+0x26a>
- TCP_DATA_COPY((char *)p->payload + p->len, arg, oversize_used, last_unsent);
- 800d41e: 686a ldr r2, [r5, #4]
- 800d420: 8968 ldrh r0, [r5, #10]
- 800d422: 9906 ldr r1, [sp, #24]
- 800d424: 9305 str r3, [sp, #20]
- 800d426: 1810 adds r0, r2, r0
- 800d428: 4652 mov r2, sl
- 800d42a: f7fb ffeb bl 8009404 <memcpy>
- p->len += oversize_used;
- 800d42e: 896a ldrh r2, [r5, #10]
- 800d430: 9b05 ldr r3, [sp, #20]
- 800d432: 4452 add r2, sl
- 800d434: 816a strh r2, [r5, #10]
- */
- #if TCP_OVERSIZE
- if (oversize_used > 0) {
- struct pbuf *p;
- /* Bump tot_len of whole chain, len of tail */
- for (p = last_unsent->p; p; p = p->next) {
- 800d436: 682d ldr r5, [r5, #0]
- 800d438: 2d00 cmp r5, #0
- 800d43a: d1eb bne.n 800d414 <tcp_write+0x248>
- if (p->next == NULL) {
- TCP_DATA_COPY((char *)p->payload + p->len, arg, oversize_used, last_unsent);
- p->len += oversize_used;
- }
- }
- last_unsent->len += oversize_used;
- 800d43c: 8932 ldrh r2, [r6, #8]
- 800d43e: 4492 add sl, r2
- 800d440: f8a6 a008 strh.w sl, [r6, #8]
- LWIP_ASSERT("last_unsent->oversize_left >= oversize_used",
- last_unsent->oversize_left >= oversize_used);
- last_unsent->oversize_left -= oversize_used;
- #endif /* TCP_OVERSIZE_DBGCHECK */
- }
- pcb->unsent_oversize = oversize;
- 800d444: f8bd 2036 ldrh.w r2, [sp, #54] ; 0x36
- 800d448: f8a4 206a strh.w r2, [r4, #106] ; 0x6a
- #endif /* TCP_OVERSIZE */
- /*
- * Phase 2: concat_p can be concatenated onto last_unsent->p
- */
- if (concat_p != NULL) {
- 800d44c: b157 cbz r7, 800d464 <tcp_write+0x298>
- LWIP_ASSERT("tcp_write: cannot concatenate when pcb->unsent is empty",
- (last_unsent != NULL));
- pbuf_cat(last_unsent->p, concat_p);
- 800d44e: 6870 ldr r0, [r6, #4]
- 800d450: 9305 str r3, [sp, #20]
- 800d452: 4639 mov r1, r7
- 800d454: f7fe f91c bl 800b690 <pbuf_cat>
- last_unsent->len += concat_p->tot_len;
- 800d458: 8939 ldrh r1, [r7, #8]
- 800d45a: 8932 ldrh r2, [r6, #8]
- 800d45c: 9b05 ldr r3, [sp, #20]
- 800d45e: 188a adds r2, r1, r2
- 800d460: 8132 strh r2, [r6, #8]
- 800d462: e005 b.n 800d470 <tcp_write+0x2a4>
- /*
- * Phase 3: Append queue to pcb->unsent. Queue may be NULL, but that
- * is harmless
- */
- if (last_unsent == NULL) {
- 800d464: b926 cbnz r6, 800d470 <tcp_write+0x2a4>
- pcb->unsent = queue;
- 800d466: f8c4 806c str.w r8, [r4, #108] ; 0x6c
- 800d46a: e003 b.n 800d474 <tcp_write+0x2a8>
- 800d46c: 20008220 .word 0x20008220
- } else {
- last_unsent->next = queue;
- 800d470: f8c6 8000 str.w r8, [r6]
- }
- /*
- * Finally update the pcb state.
- */
- pcb->snd_lbb += len;
- 800d474: 6de2 ldr r2, [r4, #92] ; 0x5c
- pcb->snd_buf -= len;
- pcb->snd_queuelen = queuelen;
- 800d476: f8a4 b068 strh.w fp, [r4, #104] ; 0x68
- }
- /*
- * Finally update the pcb state.
- */
- pcb->snd_lbb += len;
- 800d47a: 444a add r2, r9
- 800d47c: 65e2 str r2, [r4, #92] ; 0x5c
- pcb->snd_buf -= len;
- 800d47e: f8b4 2066 ldrh.w r2, [r4, #102] ; 0x66
- 800d482: ebc9 0902 rsb r9, r9, r2
- 800d486: f8a4 9066 strh.w r9, [r4, #102] ; 0x66
- LWIP_ASSERT("tcp_write: valid queue length",
- pcb->unacked != NULL || pcb->unsent != NULL);
- }
- /* Set the PSH flag in the last segment that we enqueued. */
- if (seg != NULL && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE)==0)) {
- 800d48a: b363 cbz r3, 800d4e6 <tcp_write+0x31a>
- 800d48c: 68dc ldr r4, [r3, #12]
- 800d48e: b33c cbz r4, 800d4e0 <tcp_write+0x314>
- 800d490: 9b07 ldr r3, [sp, #28]
- 800d492: f003 0502 and.w r5, r3, #2
- 800d496: b2ed uxtb r5, r5
- 800d498: bb15 cbnz r5, 800d4e0 <tcp_write+0x314>
- TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
- 800d49a: 2008 movs r0, #8
- 800d49c: 89a6 ldrh r6, [r4, #12]
- 800d49e: f7fc fea4 bl 800a1ea <lwip_htons>
- 800d4a2: 4330 orrs r0, r6
- 800d4a4: 81a0 strh r0, [r4, #12]
- 800d4a6: e01b b.n 800d4e0 <tcp_write+0x314>
- */
- err_t
- tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
- {
- struct pbuf *concat_p = NULL;
- struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL;
- 800d4a8: f04f 0800 mov.w r8, #0
- 800d4ac: 4647 mov r7, r8
- TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
- }
- return ERR_OK;
- memerr:
- pcb->flags |= TF_NAGLEMEMERR;
- 800d4ae: 7fa3 ldrb r3, [r4, #30]
- 800d4b0: f063 037f orn r3, r3, #127 ; 0x7f
- 800d4b4: 77a3 strb r3, [r4, #30]
- TCP_STATS_INC(tcp.memerr);
- 800d4b6: 4b0e ldr r3, [pc, #56] ; (800d4f0 <tcp_write+0x324>)
- 800d4b8: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
- 800d4bc: 3201 adds r2, #1
- 800d4be: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
- if (concat_p != NULL) {
- 800d4c2: b117 cbz r7, 800d4ca <tcp_write+0x2fe>
- pbuf_free(concat_p);
- 800d4c4: 4638 mov r0, r7
- 800d4c6: f7fd fffd bl 800b4c4 <pbuf_free>
- }
- if (queue != NULL) {
- 800d4ca: f1b8 0f00 cmp.w r8, #0
- 800d4ce: d009 beq.n 800d4e4 <tcp_write+0x318>
- tcp_segs_free(queue);
- 800d4d0: 4640 mov r0, r8
- 800d4d2: f7fe fab0 bl 800ba36 <tcp_segs_free>
- 800d4d6: e005 b.n 800d4e4 <tcp_write+0x318>
- apiflags |= TCP_WRITE_FLAG_COPY;
- #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n",
- (void *)pcb, arg, len, (u16_t)apiflags));
- LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)",
- 800d4d8: 23f2 movs r3, #242 ; 0xf2
- 800d4da: e004 b.n 800d4e6 <tcp_write+0x31a>
- if ((pcb->state != ESTABLISHED) &&
- (pcb->state != CLOSE_WAIT) &&
- (pcb->state != SYN_SENT) &&
- (pcb->state != SYN_RCVD)) {
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_STATE | LWIP_DBG_LEVEL_SEVERE, ("tcp_write() called in invalid state\n"));
- return ERR_CONN;
- 800d4dc: 23f3 movs r3, #243 ; 0xf3
- 800d4de: e002 b.n 800d4e6 <tcp_write+0x31a>
- /* Set the PSH flag in the last segment that we enqueued. */
- if (seg != NULL && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE)==0)) {
- TCPH_SET_FLAG(seg->tcphdr, TCP_PSH);
- }
- return ERR_OK;
- 800d4e0: 2300 movs r3, #0
- 800d4e2: e000 b.n 800d4e6 <tcp_write+0x31a>
- if (pcb->snd_queuelen != 0) {
- LWIP_ASSERT("tcp_write: valid queue length", pcb->unacked != NULL ||
- pcb->unsent != NULL);
- }
- LWIP_DEBUGF(TCP_QLEN_DEBUG | LWIP_DBG_STATE, ("tcp_write: %"S16_F" (with mem err)\n", pcb->snd_queuelen));
- return ERR_MEM;
- 800d4e4: 23ff movs r3, #255 ; 0xff
- 800d4e6: b258 sxtb r0, r3
- }
- 800d4e8: b00f add sp, #60 ; 0x3c
- 800d4ea: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800d4ee: bf00 nop
- 800d4f0: 20008220 .word 0x20008220
- 0800d4f4 <tcp_enqueue_flags>:
- LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)",
- (flags & (TCP_SYN | TCP_FIN)) != 0);
- /* check for configured max queuelen and possible overflow */
- if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
- 800d4f4: f8b0 3068 ldrh.w r3, [r0, #104] ; 0x68
- 800d4f8: 2b47 cmp r3, #71 ; 0x47
- * @param optdata pointer to TCP options, or NULL.
- * @param optlen length of TCP options in bytes.
- */
- err_t
- tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)
- {
- 800d4fa: b573 push {r0, r1, r4, r5, r6, lr}
- 800d4fc: 4604 mov r4, r0
- 800d4fe: 460d mov r5, r1
- LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)",
- (flags & (TCP_SYN | TCP_FIN)) != 0);
- /* check for configured max queuelen and possible overflow */
- if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) {
- 800d500: d90a bls.n 800d518 <tcp_enqueue_flags+0x24>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue_flags: too long queue %"U16_F" (max %"U16_F")\n",
- pcb->snd_queuelen, TCP_SND_QUEUELEN));
- TCP_STATS_INC(tcp.memerr);
- 800d502: 4b29 ldr r3, [pc, #164] ; (800d5a8 <tcp_enqueue_flags+0xb4>)
- 800d504: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
- 800d508: 3201 adds r2, #1
- 800d50a: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
- pcb->flags |= TF_NAGLEMEMERR;
- 800d50e: 7f83 ldrb r3, [r0, #30]
- 800d510: f063 037f orn r3, r3, #127 ; 0x7f
- 800d514: 7783 strb r3, [r0, #30]
- 800d516: e00b b.n 800d530 <tcp_enqueue_flags+0x3c>
- /* tcp_enqueue_flags is always called with either SYN or FIN in flags.
- * We need one available snd_buf byte to do that.
- * This means we can't send FIN while snd_buf==0. A better fix would be to
- * not include SYN and FIN sequence numbers in the snd_buf count. */
- if (pcb->snd_buf == 0) {
- 800d518: f8b0 3066 ldrh.w r3, [r0, #102] ; 0x66
- err_t
- tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)
- {
- struct pbuf *p;
- struct tcp_seg *seg;
- u8_t optflags = 0;
- 800d51c: f3c1 0640 ubfx r6, r1, #1, #1
- #if LWIP_TCP_TIMESTAMPS
- if ((pcb->flags & TF_TIMESTAMP)) {
- optflags |= TF_SEG_OPTS_TS;
- }
- #endif /* LWIP_TCP_TIMESTAMPS */
- optlen = LWIP_TCP_OPT_LENGTH(optflags);
- 800d520: 00b1 lsls r1, r6, #2
- /* tcp_enqueue_flags is always called with either SYN or FIN in flags.
- * We need one available snd_buf byte to do that.
- * This means we can't send FIN while snd_buf==0. A better fix would be to
- * not include SYN and FIN sequence numbers in the snd_buf count. */
- if (pcb->snd_buf == 0) {
- 800d522: b93b cbnz r3, 800d534 <tcp_enqueue_flags+0x40>
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue_flags: no send buffer available\n"));
- TCP_STATS_INC(tcp.memerr);
- 800d524: 4b20 ldr r3, [pc, #128] ; (800d5a8 <tcp_enqueue_flags+0xb4>)
- 800d526: f8b3 209c ldrh.w r2, [r3, #156] ; 0x9c
- 800d52a: 3201 adds r2, #1
- 800d52c: f8a3 209c strh.w r2, [r3, #156] ; 0x9c
- return ERR_MEM;
- 800d530: 20ff movs r0, #255 ; 0xff
- 800d532: e037 b.n 800d5a4 <tcp_enqueue_flags+0xb0>
- }
- /* Allocate pbuf with room for TCP header + options */
- if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) {
- 800d534: 2000 movs r0, #0
- 800d536: 4602 mov r2, r0
- 800d538: f7fe f815 bl 800b566 <pbuf_alloc>
- 800d53c: 4601 mov r1, r0
- 800d53e: b900 cbnz r0, 800d542 <tcp_enqueue_flags+0x4e>
- 800d540: e006 b.n 800d550 <tcp_enqueue_flags+0x5c>
- }
- LWIP_ASSERT("tcp_enqueue_flags: check that first pbuf can hold optlen",
- (p->len >= optlen));
- /* Allocate memory for tcp_seg, and fill in fields. */
- if ((seg = tcp_create_segment(pcb, p, flags, pcb->snd_lbb, optflags)) == NULL) {
- 800d542: 9600 str r6, [sp, #0]
- 800d544: 4620 mov r0, r4
- 800d546: 462a mov r2, r5
- 800d548: 6de3 ldr r3, [r4, #92] ; 0x5c
- 800d54a: f7ff fdb7 bl 800d0bc <tcp_create_segment>
- 800d54e: b920 cbnz r0, 800d55a <tcp_enqueue_flags+0x66>
- pcb->flags |= TF_NAGLEMEMERR;
- 800d550: 7fa3 ldrb r3, [r4, #30]
- 800d552: f063 037f orn r3, r3, #127 ; 0x7f
- 800d556: 77a3 strb r3, [r4, #30]
- 800d558: e7e4 b.n 800d524 <tcp_enqueue_flags+0x30>
- ntohl(seg->tcphdr->seqno),
- ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg),
- (u16_t)flags));
- /* Now append seg to pcb->unsent queue */
- if (pcb->unsent == NULL) {
- 800d55a: 6ee3 ldr r3, [r4, #108] ; 0x6c
- 800d55c: b913 cbnz r3, 800d564 <tcp_enqueue_flags+0x70>
- pcb->unsent = seg;
- 800d55e: 66e0 str r0, [r4, #108] ; 0x6c
- 800d560: e004 b.n 800d56c <tcp_enqueue_flags+0x78>
- } else {
- struct tcp_seg *useg;
- for (useg = pcb->unsent; useg->next != NULL; useg = useg->next);
- 800d562: 4613 mov r3, r2
- 800d564: 681a ldr r2, [r3, #0]
- 800d566: 2a00 cmp r2, #0
- 800d568: d1fb bne.n 800d562 <tcp_enqueue_flags+0x6e>
- useg->next = seg;
- 800d56a: 6018 str r0, [r3, #0]
- }
- #if TCP_OVERSIZE
- /* The new unsent tail has no space */
- pcb->unsent_oversize = 0;
- 800d56c: 2300 movs r3, #0
- #endif /* TCP_OVERSIZE */
- /* SYN and FIN bump the sequence number */
- if ((flags & TCP_SYN) || (flags & TCP_FIN)) {
- 800d56e: 07a9 lsls r1, r5, #30
- for (useg = pcb->unsent; useg->next != NULL; useg = useg->next);
- useg->next = seg;
- }
- #if TCP_OVERSIZE
- /* The new unsent tail has no space */
- pcb->unsent_oversize = 0;
- 800d570: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
- #endif /* TCP_OVERSIZE */
- /* SYN and FIN bump the sequence number */
- if ((flags & TCP_SYN) || (flags & TCP_FIN)) {
- 800d574: d007 beq.n 800d586 <tcp_enqueue_flags+0x92>
- pcb->snd_lbb++;
- 800d576: 6de3 ldr r3, [r4, #92] ; 0x5c
- 800d578: 3301 adds r3, #1
- 800d57a: 65e3 str r3, [r4, #92] ; 0x5c
- /* optlen does not influence snd_buf */
- pcb->snd_buf--;
- 800d57c: f8b4 3066 ldrh.w r3, [r4, #102] ; 0x66
- 800d580: 3b01 subs r3, #1
- 800d582: f8a4 3066 strh.w r3, [r4, #102] ; 0x66
- }
- if (flags & TCP_FIN) {
- 800d586: 07ea lsls r2, r5, #31
- 800d588: d503 bpl.n 800d592 <tcp_enqueue_flags+0x9e>
- pcb->flags |= TF_FIN;
- 800d58a: 7fa3 ldrb r3, [r4, #30]
- 800d58c: f043 0320 orr.w r3, r3, #32
- 800d590: 77a3 strb r3, [r4, #30]
- }
- /* update number of segments on the queues */
- pcb->snd_queuelen += pbuf_clen(seg->p);
- 800d592: 6840 ldr r0, [r0, #4]
- 800d594: f8b4 5068 ldrh.w r5, [r4, #104] ; 0x68
- 800d598: f7fe f86c bl 800b674 <pbuf_clen>
- 800d59c: 1940 adds r0, r0, r5
- 800d59e: f8a4 0068 strh.w r0, [r4, #104] ; 0x68
- if (pcb->snd_queuelen != 0) {
- LWIP_ASSERT("tcp_enqueue_flags: invalid queue length",
- pcb->unacked != NULL || pcb->unsent != NULL);
- }
- return ERR_OK;
- 800d5a2: 2000 movs r0, #0
- }
- 800d5a4: b240 sxtb r0, r0
- 800d5a6: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800d5a8: 20008220 .word 0x20008220
- 0800d5ac <tcp_send_fin>:
- * @param pcb the tcp_pcb over which to send a segment
- * @return ERR_OK if sent, another err_t otherwise
- */
- err_t
- tcp_send_fin(struct tcp_pcb *pcb)
- {
- 800d5ac: b5f8 push {r3, r4, r5, r6, r7, lr}
- /* first, try to add the fin to the last unsent segment */
- if (pcb->unsent != NULL) {
- 800d5ae: 6ec4 ldr r4, [r0, #108] ; 0x6c
- * @param pcb the tcp_pcb over which to send a segment
- * @return ERR_OK if sent, another err_t otherwise
- */
- err_t
- tcp_send_fin(struct tcp_pcb *pcb)
- {
- 800d5b0: 4605 mov r5, r0
- /* first, try to add the fin to the last unsent segment */
- if (pcb->unsent != NULL) {
- 800d5b2: b90c cbnz r4, 800d5b8 <tcp_send_fin+0xc>
- 800d5b4: e00a b.n 800d5cc <tcp_send_fin+0x20>
- struct tcp_seg *last_unsent;
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- last_unsent = last_unsent->next);
- 800d5b6: 461c mov r4, r3
- tcp_send_fin(struct tcp_pcb *pcb)
- {
- /* first, try to add the fin to the last unsent segment */
- if (pcb->unsent != NULL) {
- struct tcp_seg *last_unsent;
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- 800d5b8: 6823 ldr r3, [r4, #0]
- 800d5ba: 2b00 cmp r3, #0
- 800d5bc: d1fb bne.n 800d5b6 <tcp_send_fin+0xa>
- last_unsent = last_unsent->next);
- if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) {
- 800d5be: 68e3 ldr r3, [r4, #12]
- 800d5c0: 8998 ldrh r0, [r3, #12]
- 800d5c2: f7fc fe17 bl 800a1f4 <lwip_ntohs>
- 800d5c6: f010 0607 ands.w r6, r0, #7
- 800d5ca: d005 beq.n 800d5d8 <tcp_send_fin+0x2c>
- pcb->flags |= TF_FIN;
- return ERR_OK;
- }
- }
- /* no data, no length, flags, copy=1, no optdata */
- return tcp_enqueue_flags(pcb, TCP_FIN);
- 800d5cc: 4628 mov r0, r5
- 800d5ce: 2101 movs r1, #1
- }
- 800d5d0: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr}
- pcb->flags |= TF_FIN;
- return ERR_OK;
- }
- }
- /* no data, no length, flags, copy=1, no optdata */
- return tcp_enqueue_flags(pcb, TCP_FIN);
- 800d5d4: f7ff bf8e b.w 800d4f4 <tcp_enqueue_flags>
- for (last_unsent = pcb->unsent; last_unsent->next != NULL;
- last_unsent = last_unsent->next);
- if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) {
- /* no SYN/FIN/RST flag in the header, we can add the FIN flag */
- TCPH_SET_FLAG(last_unsent->tcphdr, TCP_FIN);
- 800d5d8: 68e4 ldr r4, [r4, #12]
- 800d5da: 2001 movs r0, #1
- 800d5dc: 89a7 ldrh r7, [r4, #12]
- 800d5de: f7fc fe04 bl 800a1ea <lwip_htons>
- 800d5e2: 4338 orrs r0, r7
- 800d5e4: 81a0 strh r0, [r4, #12]
- pcb->flags |= TF_FIN;
- 800d5e6: 7fab ldrb r3, [r5, #30]
- 800d5e8: f043 0320 orr.w r3, r3, #32
- 800d5ec: 77ab strb r3, [r5, #30]
- return ERR_OK;
- }
- }
- /* no data, no length, flags, copy=1, no optdata */
- return tcp_enqueue_flags(pcb, TCP_FIN);
- }
- 800d5ee: 4630 mov r0, r6
- 800d5f0: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 0800d5f2 <tcp_send_empty_ack>:
- *
- * @param pcb Protocol control block for the TCP connection to send the ACK
- */
- err_t
- tcp_send_empty_ack(struct tcp_pcb *pcb)
- {
- 800d5f2: b537 push {r0, r1, r2, r4, r5, lr}
- 800d5f4: 4604 mov r4, r0
- if (pcb->flags & TF_TIMESTAMP) {
- optlen = LWIP_TCP_OPT_LENGTH(TF_SEG_OPTS_TS);
- }
- #endif
- p = tcp_output_alloc_header(pcb, optlen, 0, htonl(pcb->snd_nxt));
- 800d5f6: 6d00 ldr r0, [r0, #80] ; 0x50
- 800d5f8: f7fc fe01 bl 800a1fe <lwip_htonl>
- 800d5fc: 2100 movs r1, #0
- 800d5fe: 4602 mov r2, r0
- 800d600: 4620 mov r0, r4
- 800d602: f7ff fdb5 bl 800d170 <tcp_output_alloc_header.constprop.0>
- if (p == NULL) {
- 800d606: 4605 mov r5, r0
- 800d608: b188 cbz r0, 800d62e <tcp_send_empty_ack+0x3c>
- }
- tcphdr = (struct tcp_hdr *)p->payload;
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG,
- ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
- /* remove ACK flags from the PCB, as we send an empty ACK now */
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- 800d60a: 7fa3 ldrb r3, [r4, #30]
- #endif
- #if LWIP_NETIF_HWADDRHINT
- ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- IP_PROTO_TCP, &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- 800d60c: 7a62 ldrb r2, [r4, #9]
- }
- tcphdr = (struct tcp_hdr *)p->payload;
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG,
- ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
- /* remove ACK flags from the PCB, as we send an empty ACK now */
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- 800d60e: f023 0303 bic.w r3, r3, #3
- #endif
- #if LWIP_NETIF_HWADDRHINT
- ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- IP_PROTO_TCP, &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- 800d612: 9200 str r2, [sp, #0]
- 800d614: 2206 movs r2, #6
- }
- tcphdr = (struct tcp_hdr *)p->payload;
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG,
- ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
- /* remove ACK flags from the PCB, as we send an empty ACK now */
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- 800d616: 77a3 strb r3, [r4, #30]
- #endif
- #if LWIP_NETIF_HWADDRHINT
- ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- IP_PROTO_TCP, &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- 800d618: 9201 str r2, [sp, #4]
- 800d61a: 7aa3 ldrb r3, [r4, #10]
- 800d61c: 4621 mov r1, r4
- 800d61e: 1d22 adds r2, r4, #4
- 800d620: f001 f8d4 bl 800e7cc <ip_output>
- IP_PROTO_TCP);
- #endif /* LWIP_NETIF_HWADDRHINT*/
- pbuf_free(p);
- 800d624: 4628 mov r0, r5
- 800d626: f7fd ff4d bl 800b4c4 <pbuf_free>
- return ERR_OK;
- 800d62a: 2000 movs r0, #0
- 800d62c: e000 b.n 800d630 <tcp_send_empty_ack+0x3e>
- #endif
- p = tcp_output_alloc_header(pcb, optlen, 0, htonl(pcb->snd_nxt));
- if (p == NULL) {
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: (ACK) could not allocate pbuf\n"));
- return ERR_BUF;
- 800d62e: 20fe movs r0, #254 ; 0xfe
- IP_PROTO_TCP);
- #endif /* LWIP_NETIF_HWADDRHINT*/
- pbuf_free(p);
- return ERR_OK;
- }
- 800d630: b240 sxtb r0, r0
- 800d632: bd3e pop {r1, r2, r3, r4, r5, pc}
- 0800d634 <tcp_output>:
- * @return ERR_OK if data has been sent or nothing to send
- * another err_t on error
- */
- err_t
- tcp_output(struct tcp_pcb *pcb)
- {
- 800d634: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- /* First, check if we are invoked by the TCP input processing
- code. If so, we do not output anything. Instead, we rely on the
- input processing code to call us when input processing is done
- with. */
- if (tcp_input_pcb == pcb) {
- 800d638: 4b99 ldr r3, [pc, #612] ; (800d8a0 <tcp_output+0x26c>)
- 800d63a: 681b ldr r3, [r3, #0]
- 800d63c: 4283 cmp r3, r0
- * @return ERR_OK if data has been sent or nothing to send
- * another err_t on error
- */
- err_t
- tcp_output(struct tcp_pcb *pcb)
- {
- 800d63e: b085 sub sp, #20
- 800d640: 4604 mov r4, r0
- /* First, check if we are invoked by the TCP input processing
- code. If so, we do not output anything. Instead, we rely on the
- input processing code to call us when input processing is done
- with. */
- if (tcp_input_pcb == pcb) {
- 800d642: f000 8128 beq.w 800d896 <tcp_output+0x262>
- return ERR_OK;
- }
- wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
- 800d646: f8b0 304c ldrh.w r3, [r0, #76] ; 0x4c
- 800d64a: f8b0 8060 ldrh.w r8, [r0, #96] ; 0x60
- seg = pcb->unsent;
- 800d64e: 6ec5 ldr r5, [r0, #108] ; 0x6c
- with. */
- if (tcp_input_pcb == pcb) {
- return ERR_OK;
- }
- wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd);
- 800d650: 4598 cmp r8, r3
- 800d652: bf28 it cs
- 800d654: 4698 movcs r8, r3
- * because the ->unsent queue is empty or because the window does
- * not allow it), construct an empty ACK segment and send it.
- *
- * If data is to be sent, we will just piggyback the ACK (see below).
- */
- if (pcb->flags & TF_ACK_NOW &&
- 800d656: 7f83 ldrb r3, [r0, #30]
- 800d658: f003 0302 and.w r3, r3, #2
- 800d65c: b2db uxtb r3, r3
- 800d65e: b183 cbz r3, 800d682 <tcp_output+0x4e>
- 800d660: b92d cbnz r5, 800d66e <tcp_output+0x3a>
- (seg == NULL ||
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
- return tcp_send_empty_ack(pcb);
- 800d662: 4620 mov r0, r4
- }
- #endif /* TCP_OVERSIZE */
- pcb->flags &= ~TF_NAGLEMEMERR;
- return ERR_OK;
- }
- 800d664: b005 add sp, #20
- 800d666: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- * If data is to be sent, we will just piggyback the ACK (see below).
- */
- if (pcb->flags & TF_ACK_NOW &&
- (seg == NULL ||
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
- return tcp_send_empty_ack(pcb);
- 800d66a: f7ff bfc2 b.w 800d5f2 <tcp_send_empty_ack>
- *
- * If data is to be sent, we will just piggyback the ACK (see below).
- */
- if (pcb->flags & TF_ACK_NOW &&
- (seg == NULL ||
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
- 800d66e: 68eb ldr r3, [r5, #12]
- 800d670: 6858 ldr r0, [r3, #4]
- 800d672: f7fc fdc6 bl 800a202 <lwip_ntohl>
- 800d676: 892a ldrh r2, [r5, #8]
- 800d678: 6ca3 ldr r3, [r4, #72] ; 0x48
- 800d67a: 1ad3 subs r3, r2, r3
- 800d67c: 1818 adds r0, r3, r0
- * not allow it), construct an empty ACK segment and send it.
- *
- * If data is to be sent, we will just piggyback the ACK (see below).
- */
- if (pcb->flags & TF_ACK_NOW &&
- (seg == NULL ||
- 800d67e: 4540 cmp r0, r8
- 800d680: d8ef bhi.n 800d662 <tcp_output+0x2e>
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) {
- return tcp_send_empty_ack(pcb);
- }
- /* useg should point to last segment on unacked queue */
- useg = pcb->unacked;
- 800d682: 6f26 ldr r6, [r4, #112] ; 0x70
- if (useg != NULL) {
- 800d684: b90e cbnz r6, 800d68a <tcp_output+0x56>
- 800d686: e0e5 b.n 800d854 <tcp_output+0x220>
- for (; useg->next != NULL; useg = useg->next);
- 800d688: 461e mov r6, r3
- 800d68a: 6833 ldr r3, [r6, #0]
- 800d68c: 2b00 cmp r3, #0
- 800d68e: d1fb bne.n 800d688 <tcp_output+0x54>
- 800d690: e0e0 b.n 800d854 <tcp_output+0x220>
- }
- #endif /* TCP_CWND_DEBUG */
- /* data available and window allows it to be sent? */
- while (seg != NULL &&
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
- LWIP_ASSERT("RST not expected here!",
- 800d692: 68eb ldr r3, [r5, #12]
- 800d694: 8998 ldrh r0, [r3, #12]
- 800d696: f7fc fdad bl 800a1f4 <lwip_ntohs>
- * - if tcp_write had a memory error before (prevent delayed ACK timeout) or
- * - if FIN was already enqueued for this PCB (SYN is always alone in a segment -
- * either seg->next != NULL or pcb->unacked == NULL;
- * RST is no sent using tcp_write/tcp_output.
- */
- if((tcp_do_output_nagle(pcb) == 0) &&
- 800d69a: 6f23 ldr r3, [r4, #112] ; 0x70
- 800d69c: b19b cbz r3, 800d6c6 <tcp_output+0x92>
- 800d69e: 7fa2 ldrb r2, [r4, #30]
- 800d6a0: f012 0f44 tst.w r2, #68 ; 0x44
- 800d6a4: d10f bne.n 800d6c6 <tcp_output+0x92>
- 800d6a6: 6ee3 ldr r3, [r4, #108] ; 0x6c
- 800d6a8: b12b cbz r3, 800d6b6 <tcp_output+0x82>
- 800d6aa: 6819 ldr r1, [r3, #0]
- 800d6ac: b959 cbnz r1, 800d6c6 <tcp_output+0x92>
- 800d6ae: 8919 ldrh r1, [r3, #8]
- 800d6b0: 8ee3 ldrh r3, [r4, #54] ; 0x36
- 800d6b2: 4299 cmp r1, r3
- 800d6b4: d207 bcs.n 800d6c6 <tcp_output+0x92>
- 800d6b6: f8b4 3066 ldrh.w r3, [r4, #102] ; 0x66
- 800d6ba: b123 cbz r3, 800d6c6 <tcp_output+0x92>
- 800d6bc: f8b4 3068 ldrh.w r3, [r4, #104] ; 0x68
- 800d6c0: 2b47 cmp r3, #71 ; 0x47
- 800d6c2: f240 80e3 bls.w 800d88c <tcp_output+0x258>
- pcb->lastack,
- ntohl(seg->tcphdr->seqno), pcb->lastack, i));
- ++i;
- #endif /* TCP_CWND_DEBUG */
- pcb->unsent = seg->next;
- 800d6c6: 682b ldr r3, [r5, #0]
- 800d6c8: 66e3 str r3, [r4, #108] ; 0x6c
- if (pcb->state != SYN_SENT) {
- 800d6ca: 7e23 ldrb r3, [r4, #24]
- 800d6cc: 2b02 cmp r3, #2
- 800d6ce: d00f beq.n 800d6f0 <tcp_output+0xbc>
- TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
- 800d6d0: f8d5 b00c ldr.w fp, [r5, #12]
- 800d6d4: f8bb 300c ldrh.w r3, [fp, #12]
- 800d6d8: 2010 movs r0, #16
- 800d6da: 9303 str r3, [sp, #12]
- 800d6dc: f7fc fd85 bl 800a1ea <lwip_htons>
- 800d6e0: 9b03 ldr r3, [sp, #12]
- 800d6e2: 4318 orrs r0, r3
- 800d6e4: f8ab 000c strh.w r0, [fp, #12]
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- 800d6e8: 7fa3 ldrb r3, [r4, #30]
- 800d6ea: f023 0303 bic.w r3, r3, #3
- 800d6ee: 77a3 strb r3, [r4, #30]
- /** @bug Exclude retransmitted segments from this count. */
- snmp_inc_tcpoutsegs();
- /* The TCP header has already been constructed, but the ackno and
- wnd fields remain. */
- seg->tcphdr->ackno = htonl(pcb->rcv_nxt);
- 800d6f0: 6aa0 ldr r0, [r4, #40] ; 0x28
- 800d6f2: f8d5 b00c ldr.w fp, [r5, #12]
- 800d6f6: f7fc fd82 bl 800a1fe <lwip_htonl>
- 800d6fa: f8cb 0008 str.w r0, [fp, #8]
- /* advertise our receive window size in this TCP segment */
- seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);
- 800d6fe: 8de0 ldrh r0, [r4, #46] ; 0x2e
- 800d700: f8d5 b00c ldr.w fp, [r5, #12]
- 800d704: f7fc fd71 bl 800a1ea <lwip_htons>
- 800d708: f8ab 000e strh.w r0, [fp, #14]
- pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
- 800d70c: 8de2 ldrh r2, [r4, #46] ; 0x2e
- 800d70e: 6aa3 ldr r3, [r4, #40] ; 0x28
- /* Add any requested options. NB MSS option is only set on SYN
- packets, so ignore it here */
- opts = (u32_t *)(void *)(seg->tcphdr + 1);
- 800d710: f8d5 b00c ldr.w fp, [r5, #12]
- seg->tcphdr->ackno = htonl(pcb->rcv_nxt);
- /* advertise our receive window size in this TCP segment */
- seg->tcphdr->wnd = htons(pcb->rcv_ann_wnd);
- pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
- 800d714: 18d3 adds r3, r2, r3
- 800d716: 6323 str r3, [r4, #48] ; 0x30
- /* Add any requested options. NB MSS option is only set on SYN
- packets, so ignore it here */
- opts = (u32_t *)(void *)(seg->tcphdr + 1);
- if (seg->flags & TF_SEG_OPTS_MSS) {
- 800d718: 7aab ldrb r3, [r5, #10]
- 800d71a: 07d8 lsls r0, r3, #31
- 800d71c: d50a bpl.n 800d734 <tcp_output+0x100>
- u16_t mss;
- #if TCP_CALCULATE_EFF_SEND_MSS
- mss = tcp_eff_send_mss(TCP_MSS, &pcb->remote_ip);
- 800d71e: 4639 mov r1, r7
- 800d720: f240 50b4 movw r0, #1460 ; 0x5b4
- 800d724: f7fe fb14 bl 800bd50 <tcp_eff_send_mss>
- #else /* TCP_CALCULATE_EFF_SEND_MSS */
- mss = TCP_MSS;
- #endif /* TCP_CALCULATE_EFF_SEND_MSS */
- *opts = TCP_BUILD_MSS_OPTION(mss);
- 800d728: f040 7001 orr.w r0, r0, #33816576 ; 0x2040000
- 800d72c: f7fc fd67 bl 800a1fe <lwip_htonl>
- 800d730: f8cb 0014 str.w r0, [fp, #20]
- }
- #endif
- /* Set retransmission timer running if it is not currently enabled
- This must be set before checking the route. */
- if (pcb->rtime == -1) {
- 800d734: f9b4 3034 ldrsh.w r3, [r4, #52] ; 0x34
- 800d738: 3301 adds r3, #1
- 800d73a: d101 bne.n 800d740 <tcp_output+0x10c>
- pcb->rtime = 0;
- 800d73c: 2300 movs r3, #0
- 800d73e: 86a3 strh r3, [r4, #52] ; 0x34
- }
- /* If we don't have a local IP address, we get one by
- calling ip_route(). */
- if (ip_addr_isany(&(pcb->local_ip))) {
- 800d740: 6823 ldr r3, [r4, #0]
- 800d742: b92b cbnz r3, 800d750 <tcp_output+0x11c>
- netif = ip_route(&(pcb->remote_ip));
- 800d744: 4638 mov r0, r7
- 800d746: f000 febd bl 800e4c4 <ip_route>
- if (netif == NULL) {
- 800d74a: b338 cbz r0, 800d79c <tcp_output+0x168>
- return;
- }
- ip_addr_copy(pcb->local_ip, netif->ip_addr);
- 800d74c: 6843 ldr r3, [r0, #4]
- 800d74e: 6023 str r3, [r4, #0]
- }
- if (pcb->rttest == 0) {
- 800d750: 6ba3 ldr r3, [r4, #56] ; 0x38
- 800d752: b93b cbnz r3, 800d764 <tcp_output+0x130>
- pcb->rttest = tcp_ticks;
- 800d754: f8da 3000 ldr.w r3, [sl]
- 800d758: 63a3 str r3, [r4, #56] ; 0x38
- pcb->rtseq = ntohl(seg->tcphdr->seqno);
- 800d75a: 68eb ldr r3, [r5, #12]
- 800d75c: 6858 ldr r0, [r3, #4]
- 800d75e: f7fc fd50 bl 800a202 <lwip_ntohl>
- 800d762: 63e0 str r0, [r4, #60] ; 0x3c
- }
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n",
- htonl(seg->tcphdr->seqno), htonl(seg->tcphdr->seqno) +
- seg->len));
- len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload);
- 800d764: 6868 ldr r0, [r5, #4]
- 800d766: 68eb ldr r3, [r5, #12]
- 800d768: 6842 ldr r2, [r0, #4]
- seg->p->len -= len;
- 800d76a: 8941 ldrh r1, [r0, #10]
- seg->p->tot_len -= len;
- seg->p->payload = seg->tcphdr;
- 800d76c: 6043 str r3, [r0, #4]
- }
- LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n",
- htonl(seg->tcphdr->seqno), htonl(seg->tcphdr->seqno) +
- seg->len));
- len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload);
- 800d76e: 1a9a subs r2, r3, r2
- seg->p->len -= len;
- 800d770: 1a89 subs r1, r1, r2
- 800d772: 8141 strh r1, [r0, #10]
- seg->p->tot_len -= len;
- 800d774: 8901 ldrh r1, [r0, #8]
- 800d776: 1a8a subs r2, r1, r2
- 800d778: 8102 strh r2, [r0, #8]
- seg->p->payload = seg->tcphdr;
- seg->tcphdr->chksum = 0;
- 800d77a: 2200 movs r2, #0
- 800d77c: 741a strb r2, [r3, #16]
- 800d77e: 745a strb r2, [r3, #17]
- seg->tcphdr->chksum = inet_chksum_pseudo(seg->p, &(pcb->local_ip),
- &(pcb->remote_ip),
- IP_PROTO_TCP, seg->p->tot_len);
- #endif /* TCP_CHECKSUM_ON_COPY */
- #endif /* CHECKSUM_GEN_TCP */
- TCP_STATS_INC(tcp.xmit);
- 800d780: f8b9 3090 ldrh.w r3, [r9, #144] ; 0x90
- 800d784: 3301 adds r3, #1
- 800d786: f8a9 3090 strh.w r3, [r9, #144] ; 0x90
- #if LWIP_NETIF_HWADDRHINT
- ip_output_hinted(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- IP_PROTO_TCP, &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
- 800d78a: 7a62 ldrb r2, [r4, #9]
- 800d78c: 7aa3 ldrb r3, [r4, #10]
- 800d78e: 9200 str r2, [sp, #0]
- 800d790: 2206 movs r2, #6
- 800d792: 9201 str r2, [sp, #4]
- 800d794: 4621 mov r1, r4
- 800d796: 463a mov r2, r7
- 800d798: f001 f818 bl 800e7cc <ip_output>
- TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- }
- tcp_output_segment(seg, pcb);
- snd_nxt = ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
- 800d79c: 68eb ldr r3, [r5, #12]
- 800d79e: 6858 ldr r0, [r3, #4]
- 800d7a0: f7fc fd2f bl 800a202 <lwip_ntohl>
- 800d7a4: 68ea ldr r2, [r5, #12]
- 800d7a6: 8929 ldrh r1, [r5, #8]
- 800d7a8: 4683 mov fp, r0
- 800d7aa: 8990 ldrh r0, [r2, #12]
- 800d7ac: 9103 str r1, [sp, #12]
- 800d7ae: f7fc fd21 bl 800a1f4 <lwip_ntohs>
- 800d7b2: 9903 ldr r1, [sp, #12]
- if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) {
- 800d7b4: 6d22 ldr r2, [r4, #80] ; 0x50
- TCPH_SET_FLAG(seg->tcphdr, TCP_ACK);
- pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
- }
- tcp_output_segment(seg, pcb);
- snd_nxt = ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
- 800d7b6: f010 0003 ands.w r0, r0, #3
- 800d7ba: bf18 it ne
- 800d7bc: 2001 movne r0, #1
- 800d7be: 180b adds r3, r1, r0
- 800d7c0: 445b add r3, fp
- if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) {
- 800d7c2: 1ad2 subs r2, r2, r3
- 800d7c4: 2a00 cmp r2, #0
- pcb->snd_nxt = snd_nxt;
- 800d7c6: bfb8 it lt
- 800d7c8: 6523 strlt r3, [r4, #80] ; 0x50
- }
- /* put segment on unacknowledged list if length > 0 */
- if (TCP_TCPLEN(seg) > 0) {
- 800d7ca: 68eb ldr r3, [r5, #12]
- 800d7cc: f8b5 b008 ldrh.w fp, [r5, #8]
- 800d7d0: 8998 ldrh r0, [r3, #12]
- 800d7d2: f7fc fd0f bl 800a1f4 <lwip_ntohs>
- 800d7d6: f010 0003 ands.w r0, r0, #3
- 800d7da: bf18 it ne
- 800d7dc: 2001 movne r0, #1
- 800d7de: 4458 add r0, fp
- 800d7e0: 2800 cmp r0, #0
- 800d7e2: d032 beq.n 800d84a <tcp_output+0x216>
- seg->next = NULL;
- 800d7e4: 2300 movs r3, #0
- 800d7e6: 602b str r3, [r5, #0]
- /* unacked list is empty? */
- if (pcb->unacked == NULL) {
- 800d7e8: 6f23 ldr r3, [r4, #112] ; 0x70
- 800d7ea: b90b cbnz r3, 800d7f0 <tcp_output+0x1bc>
- pcb->unacked = seg;
- 800d7ec: 6725 str r5, [r4, #112] ; 0x70
- 800d7ee: e02a b.n 800d846 <tcp_output+0x212>
- /* unacked list is not empty? */
- } else {
- /* In the case of fast retransmit, the packet should not go to the tail
- * of the unacked queue, but rather somewhere before it. We need to check for
- * this case. -STJ Jul 27, 2004 */
- if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
- 800d7f0: 68eb ldr r3, [r5, #12]
- 800d7f2: 6858 ldr r0, [r3, #4]
- 800d7f4: f7fc fd05 bl 800a202 <lwip_ntohl>
- 800d7f8: 68f3 ldr r3, [r6, #12]
- 800d7fa: 4683 mov fp, r0
- 800d7fc: 6858 ldr r0, [r3, #4]
- 800d7fe: f7fc fd00 bl 800a202 <lwip_ntohl>
- 800d802: ebc0 000b rsb r0, r0, fp
- 800d806: 2800 cmp r0, #0
- 800d808: da1c bge.n 800d844 <tcp_output+0x210>
- /* add segment to before tail of unacked list, keeping the list sorted */
- struct tcp_seg **cur_seg = &(pcb->unacked);
- 800d80a: f104 0b70 add.w fp, r4, #112 ; 0x70
- while (*cur_seg &&
- 800d80e: e001 b.n 800d814 <tcp_output+0x1e0>
- TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
- cur_seg = &((*cur_seg)->next );
- 800d810: f8db b000 ldr.w fp, [fp]
- * of the unacked queue, but rather somewhere before it. We need to check for
- * this case. -STJ Jul 27, 2004 */
- if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
- /* add segment to before tail of unacked list, keeping the list sorted */
- struct tcp_seg **cur_seg = &(pcb->unacked);
- while (*cur_seg &&
- 800d814: f8db 3000 ldr.w r3, [fp]
- 800d818: b92b cbnz r3, 800d826 <tcp_output+0x1f2>
- TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
- cur_seg = &((*cur_seg)->next );
- }
- seg->next = (*cur_seg);
- 800d81a: f8db 3000 ldr.w r3, [fp]
- 800d81e: 602b str r3, [r5, #0]
- (*cur_seg) = seg;
- 800d820: f8cb 5000 str.w r5, [fp]
- 800d824: e014 b.n 800d850 <tcp_output+0x21c>
- * this case. -STJ Jul 27, 2004 */
- if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
- /* add segment to before tail of unacked list, keeping the list sorted */
- struct tcp_seg **cur_seg = &(pcb->unacked);
- while (*cur_seg &&
- TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
- 800d826: 68db ldr r3, [r3, #12]
- 800d828: 6858 ldr r0, [r3, #4]
- 800d82a: f7fc fcea bl 800a202 <lwip_ntohl>
- 800d82e: 68eb ldr r3, [r5, #12]
- 800d830: 4602 mov r2, r0
- 800d832: 6858 ldr r0, [r3, #4]
- 800d834: 9203 str r2, [sp, #12]
- 800d836: f7fc fce4 bl 800a202 <lwip_ntohl>
- 800d83a: 9a03 ldr r2, [sp, #12]
- 800d83c: 1a10 subs r0, r2, r0
- * of the unacked queue, but rather somewhere before it. We need to check for
- * this case. -STJ Jul 27, 2004 */
- if (TCP_SEQ_LT(ntohl(seg->tcphdr->seqno), ntohl(useg->tcphdr->seqno))) {
- /* add segment to before tail of unacked list, keeping the list sorted */
- struct tcp_seg **cur_seg = &(pcb->unacked);
- while (*cur_seg &&
- 800d83e: 2800 cmp r0, #0
- 800d840: dbe6 blt.n 800d810 <tcp_output+0x1dc>
- 800d842: e7ea b.n 800d81a <tcp_output+0x1e6>
- }
- seg->next = (*cur_seg);
- (*cur_seg) = seg;
- } else {
- /* add segment to tail of unacked list */
- useg->next = seg;
- 800d844: 6035 str r5, [r6, #0]
- 800d846: 462e mov r6, r5
- 800d848: e002 b.n 800d850 <tcp_output+0x21c>
- useg = useg->next;
- }
- }
- /* do not queue empty segments on the unacked list */
- } else {
- tcp_seg_free(seg);
- 800d84a: 4628 mov r0, r5
- 800d84c: f7fe f8e3 bl 800ba16 <tcp_seg_free>
- }
- seg = pcb->unsent;
- 800d850: 6ee5 ldr r5, [r4, #108] ; 0x6c
- 800d852: e004 b.n 800d85e <tcp_output+0x22a>
- seg->tcphdr->chksum = inet_chksum_pseudo(seg->p, &(pcb->local_ip),
- &(pcb->remote_ip),
- IP_PROTO_TCP, seg->p->tot_len);
- #endif /* TCP_CHECKSUM_ON_COPY */
- #endif /* CHECKSUM_GEN_TCP */
- TCP_STATS_INC(tcp.xmit);
- 800d854: f8df 904c ldr.w r9, [pc, #76] ; 800d8a4 <tcp_output+0x270>
- }
- ip_addr_copy(pcb->local_ip, netif->ip_addr);
- }
- if (pcb->rttest == 0) {
- pcb->rttest = tcp_ticks;
- 800d858: f8df a04c ldr.w sl, [pc, #76] ; 800d8a8 <tcp_output+0x274>
- packets, so ignore it here */
- opts = (u32_t *)(void *)(seg->tcphdr + 1);
- if (seg->flags & TF_SEG_OPTS_MSS) {
- u16_t mss;
- #if TCP_CALCULATE_EFF_SEND_MSS
- mss = tcp_eff_send_mss(TCP_MSS, &pcb->remote_ip);
- 800d85c: 1d27 adds r7, r4, #4
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
- ntohl(seg->tcphdr->seqno), pcb->lastack));
- }
- #endif /* TCP_CWND_DEBUG */
- /* data available and window allows it to be sent? */
- while (seg != NULL &&
- 800d85e: b915 cbnz r5, 800d866 <tcp_output+0x232>
- tcp_seg_free(seg);
- }
- seg = pcb->unsent;
- }
- #if TCP_OVERSIZE
- if (pcb->unsent == NULL) {
- 800d860: 6ee3 ldr r3, [r4, #108] ; 0x6c
- 800d862: b973 cbnz r3, 800d882 <tcp_output+0x24e>
- 800d864: e00b b.n 800d87e <tcp_output+0x24a>
- ntohl(seg->tcphdr->seqno), pcb->lastack));
- }
- #endif /* TCP_CWND_DEBUG */
- /* data available and window allows it to be sent? */
- while (seg != NULL &&
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
- 800d866: 68eb ldr r3, [r5, #12]
- 800d868: 6858 ldr r0, [r3, #4]
- 800d86a: f7fc fcca bl 800a202 <lwip_ntohl>
- 800d86e: 892a ldrh r2, [r5, #8]
- 800d870: 6ca3 ldr r3, [r4, #72] ; 0x48
- 800d872: 1ad3 subs r3, r2, r3
- 800d874: 1818 adds r0, r3, r0
- ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len,
- ntohl(seg->tcphdr->seqno), pcb->lastack));
- }
- #endif /* TCP_CWND_DEBUG */
- /* data available and window allows it to be sent? */
- while (seg != NULL &&
- 800d876: 4540 cmp r0, r8
- 800d878: f67f af0b bls.w 800d692 <tcp_output+0x5e>
- 800d87c: e7f0 b.n 800d860 <tcp_output+0x22c>
- seg = pcb->unsent;
- }
- #if TCP_OVERSIZE
- if (pcb->unsent == NULL) {
- /* last unsent has been removed, reset unsent_oversize */
- pcb->unsent_oversize = 0;
- 800d87e: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
- }
- #endif /* TCP_OVERSIZE */
- pcb->flags &= ~TF_NAGLEMEMERR;
- 800d882: 7fa3 ldrb r3, [r4, #30]
- 800d884: f003 037f and.w r3, r3, #127 ; 0x7f
- 800d888: 77a3 strb r3, [r4, #30]
- return ERR_OK;
- 800d88a: e004 b.n 800d896 <tcp_output+0x262>
- * - if tcp_write had a memory error before (prevent delayed ACK timeout) or
- * - if FIN was already enqueued for this PCB (SYN is always alone in a segment -
- * either seg->next != NULL or pcb->unacked == NULL;
- * RST is no sent using tcp_write/tcp_output.
- */
- if((tcp_do_output_nagle(pcb) == 0) &&
- 800d88c: f012 0fa0 tst.w r2, #160 ; 0xa0
- 800d890: f47f af19 bne.w 800d6c6 <tcp_output+0x92>
- 800d894: e7e4 b.n 800d860 <tcp_output+0x22c>
- }
- #endif /* TCP_OVERSIZE */
- pcb->flags &= ~TF_NAGLEMEMERR;
- return ERR_OK;
- }
- 800d896: 2000 movs r0, #0
- 800d898: b005 add sp, #20
- 800d89a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800d89e: bf00 nop
- 800d8a0: 20008354 .word 0x20008354
- 800d8a4: 20008220 .word 0x20008220
- 800d8a8: 20008340 .word 0x20008340
- 0800d8ac <tcp_rst>:
- */
- void
- tcp_rst(u32_t seqno, u32_t ackno,
- ip_addr_t *local_ip, ip_addr_t *remote_ip,
- u16_t local_port, u16_t remote_port)
- {
- 800d8ac: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 800d8b0: 4681 mov r9, r0
- 800d8b2: 460d mov r5, r1
- 800d8b4: 4690 mov r8, r2
- struct pbuf *p;
- struct tcp_hdr *tcphdr;
- p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
- 800d8b6: 2001 movs r0, #1
- 800d8b8: 2114 movs r1, #20
- 800d8ba: 2200 movs r2, #0
- */
- void
- tcp_rst(u32_t seqno, u32_t ackno,
- ip_addr_t *local_ip, ip_addr_t *remote_ip,
- u16_t local_port, u16_t remote_port)
- {
- 800d8bc: 461f mov r7, r3
- 800d8be: f8bd b030 ldrh.w fp, [sp, #48] ; 0x30
- 800d8c2: f8bd a034 ldrh.w sl, [sp, #52] ; 0x34
- struct pbuf *p;
- struct tcp_hdr *tcphdr;
- p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM);
- 800d8c6: f7fd fe4e bl 800b566 <pbuf_alloc>
- if (p == NULL) {
- 800d8ca: 4606 mov r6, r0
- 800d8cc: 2800 cmp r0, #0
- 800d8ce: d034 beq.n 800d93a <tcp_rst+0x8e>
- return;
- }
- LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
- (p->len >= sizeof(struct tcp_hdr)));
- tcphdr = (struct tcp_hdr *)p->payload;
- 800d8d0: 6844 ldr r4, [r0, #4]
- tcphdr->src = htons(local_port);
- 800d8d2: 4658 mov r0, fp
- 800d8d4: f7fc fc89 bl 800a1ea <lwip_htons>
- 800d8d8: 8020 strh r0, [r4, #0]
- tcphdr->dest = htons(remote_port);
- 800d8da: 4650 mov r0, sl
- 800d8dc: f7fc fc85 bl 800a1ea <lwip_htons>
- 800d8e0: 8060 strh r0, [r4, #2]
- tcphdr->seqno = htonl(seqno);
- 800d8e2: 4648 mov r0, r9
- 800d8e4: f7fc fc8b bl 800a1fe <lwip_htonl>
- 800d8e8: 6060 str r0, [r4, #4]
- tcphdr->ackno = htonl(ackno);
- 800d8ea: 4628 mov r0, r5
- 800d8ec: f7fc fc87 bl 800a1fe <lwip_htonl>
- 800d8f0: 60a0 str r0, [r4, #8]
- TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
- 800d8f2: f245 0014 movw r0, #20500 ; 0x5014
- 800d8f6: f7fc fc78 bl 800a1ea <lwip_htons>
- tcphdr->wnd = PP_HTONS(TCP_WND);
- 800d8fa: 2316 movs r3, #22
- tcphdr = (struct tcp_hdr *)p->payload;
- tcphdr->src = htons(local_port);
- tcphdr->dest = htons(remote_port);
- tcphdr->seqno = htonl(seqno);
- tcphdr->ackno = htonl(ackno);
- TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
- 800d8fc: 81a0 strh r0, [r4, #12]
- tcphdr->wnd = PP_HTONS(TCP_WND);
- 800d8fe: 73a3 strb r3, [r4, #14]
- 800d900: 2500 movs r5, #0
- #if CHECKSUM_GEN_TCP
- tcphdr->chksum = inet_chksum_pseudo(p, local_ip, remote_ip,
- IP_PROTO_TCP, p->tot_len);
- #endif
- TCP_STATS_INC(tcp.xmit);
- 800d902: 480f ldr r0, [pc, #60] ; (800d940 <tcp_rst+0x94>)
- tcphdr->dest = htons(remote_port);
- tcphdr->seqno = htonl(seqno);
- tcphdr->ackno = htonl(ackno);
- TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
- tcphdr->wnd = PP_HTONS(TCP_WND);
- tcphdr->chksum = 0;
- 800d904: 7425 strb r5, [r4, #16]
- tcphdr->src = htons(local_port);
- tcphdr->dest = htons(remote_port);
- tcphdr->seqno = htonl(seqno);
- tcphdr->ackno = htonl(ackno);
- TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK);
- tcphdr->wnd = PP_HTONS(TCP_WND);
- 800d906: f06f 032f mvn.w r3, #47 ; 0x2f
- 800d90a: 73e3 strb r3, [r4, #15]
- tcphdr->chksum = 0;
- 800d90c: 7465 strb r5, [r4, #17]
- tcphdr->urgp = 0;
- 800d90e: 74a5 strb r5, [r4, #18]
- 800d910: 74e5 strb r5, [r4, #19]
- #if CHECKSUM_GEN_TCP
- tcphdr->chksum = inet_chksum_pseudo(p, local_ip, remote_ip,
- IP_PROTO_TCP, p->tot_len);
- #endif
- TCP_STATS_INC(tcp.xmit);
- 800d912: f8b0 3090 ldrh.w r3, [r0, #144] ; 0x90
- 800d916: 3301 adds r3, #1
- 800d918: f8a0 3090 strh.w r3, [r0, #144] ; 0x90
- snmp_inc_tcpoutrsts();
- /* Send output with hardcoded TTL since we have no access to the pcb */
- ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP);
- 800d91c: 2306 movs r3, #6
- 800d91e: 9301 str r3, [sp, #4]
- 800d920: 9500 str r5, [sp, #0]
- 800d922: 4630 mov r0, r6
- 800d924: 4641 mov r1, r8
- 800d926: 463a mov r2, r7
- 800d928: 23ff movs r3, #255 ; 0xff
- 800d92a: f000 ff4f bl 800e7cc <ip_output>
- pbuf_free(p);
- 800d92e: 4630 mov r0, r6
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
- }
- 800d930: b003 add sp, #12
- 800d932: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- #endif
- TCP_STATS_INC(tcp.xmit);
- snmp_inc_tcpoutrsts();
- /* Send output with hardcoded TTL since we have no access to the pcb */
- ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP);
- pbuf_free(p);
- 800d936: f7fd bdc5 b.w 800b4c4 <pbuf_free>
- LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
- }
- 800d93a: b003 add sp, #12
- 800d93c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800d940: 20008220 .word 0x20008220
- 0800d944 <tcp_rexmit_rto>:
- void
- tcp_rexmit_rto(struct tcp_pcb *pcb)
- {
- struct tcp_seg *seg;
- if (pcb->unacked == NULL) {
- 800d944: 6f02 ldr r2, [r0, #112] ; 0x70
- *
- * @param pcb the tcp_pcb for which to re-enqueue all unacked segments
- */
- void
- tcp_rexmit_rto(struct tcp_pcb *pcb)
- {
- 800d946: b510 push {r4, lr}
- struct tcp_seg *seg;
- if (pcb->unacked == NULL) {
- 800d948: b19a cbz r2, 800d972 <tcp_rexmit_rto+0x2e>
- 800d94a: 4611 mov r1, r2
- 800d94c: e000 b.n 800d950 <tcp_rexmit_rto+0xc>
- return;
- }
- /* Move all unacked segments to the head of the unsent queue */
- for (seg = pcb->unacked; seg->next != NULL; seg = seg->next);
- 800d94e: 4619 mov r1, r3
- 800d950: 680b ldr r3, [r1, #0]
- 800d952: 2b00 cmp r3, #0
- 800d954: d1fb bne.n 800d94e <tcp_rexmit_rto+0xa>
- /* concatenate unsent queue after unacked queue */
- seg->next = pcb->unsent;
- 800d956: 6ec4 ldr r4, [r0, #108] ; 0x6c
- 800d958: 600c str r4, [r1, #0]
- /* unsent queue is the concatenated queue (of unacked, unsent) */
- pcb->unsent = pcb->unacked;
- 800d95a: 66c2 str r2, [r0, #108] ; 0x6c
- /* unacked queue is now empty */
- pcb->unacked = NULL;
- /* last unsent hasn't changed, no need to reset unsent_oversize */
- /* increment number of retransmissions */
- ++pcb->nrtx;
- 800d95c: f890 2046 ldrb.w r2, [r0, #70] ; 0x46
- /* concatenate unsent queue after unacked queue */
- seg->next = pcb->unsent;
- /* unsent queue is the concatenated queue (of unacked, unsent) */
- pcb->unsent = pcb->unacked;
- /* unacked queue is now empty */
- pcb->unacked = NULL;
- 800d960: 6703 str r3, [r0, #112] ; 0x70
- /* last unsent hasn't changed, no need to reset unsent_oversize */
- /* increment number of retransmissions */
- ++pcb->nrtx;
- 800d962: 3201 adds r2, #1
- 800d964: f880 2046 strb.w r2, [r0, #70] ; 0x46
- /* Don't take any RTT measurements after retransmitting. */
- pcb->rttest = 0;
- 800d968: 6383 str r3, [r0, #56] ; 0x38
- /* Do the actual retransmission */
- tcp_output(pcb);
- }
- 800d96a: e8bd 4010 ldmia.w sp!, {r4, lr}
- /* Don't take any RTT measurements after retransmitting. */
- pcb->rttest = 0;
- /* Do the actual retransmission */
- tcp_output(pcb);
- 800d96e: f7ff be61 b.w 800d634 <tcp_output>
- 800d972: bd10 pop {r4, pc}
- 0800d974 <tcp_rexmit>:
- *
- * @param pcb the tcp_pcb for which to retransmit the first unacked segment
- */
- void
- tcp_rexmit(struct tcp_pcb *pcb)
- {
- 800d974: b5f8 push {r3, r4, r5, r6, r7, lr}
- struct tcp_seg *seg;
- struct tcp_seg **cur_seg;
- if (pcb->unacked == NULL) {
- 800d976: 6f05 ldr r5, [r0, #112] ; 0x70
- *
- * @param pcb the tcp_pcb for which to retransmit the first unacked segment
- */
- void
- tcp_rexmit(struct tcp_pcb *pcb)
- {
- 800d978: 4604 mov r4, r0
- struct tcp_seg *seg;
- struct tcp_seg **cur_seg;
- if (pcb->unacked == NULL) {
- 800d97a: b31d cbz r5, 800d9c4 <tcp_rexmit+0x50>
- }
- /* Move the first unacked segment to the unsent queue */
- /* Keep the unsent queue sorted. */
- seg = pcb->unacked;
- pcb->unacked = seg->next;
- 800d97c: 682b ldr r3, [r5, #0]
- cur_seg = &(pcb->unsent);
- 800d97e: f100 066c add.w r6, r0, #108 ; 0x6c
- }
- /* Move the first unacked segment to the unsent queue */
- /* Keep the unsent queue sorted. */
- seg = pcb->unacked;
- pcb->unacked = seg->next;
- 800d982: 6703 str r3, [r0, #112] ; 0x70
- cur_seg = &(pcb->unsent);
- while (*cur_seg &&
- 800d984: e000 b.n 800d988 <tcp_rexmit+0x14>
- TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
- cur_seg = &((*cur_seg)->next );
- 800d986: 6836 ldr r6, [r6, #0]
- /* Keep the unsent queue sorted. */
- seg = pcb->unacked;
- pcb->unacked = seg->next;
- cur_seg = &(pcb->unsent);
- while (*cur_seg &&
- 800d988: 6833 ldr r3, [r6, #0]
- 800d98a: b92b cbnz r3, 800d998 <tcp_rexmit+0x24>
- TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
- cur_seg = &((*cur_seg)->next );
- }
- seg->next = *cur_seg;
- 800d98c: 6833 ldr r3, [r6, #0]
- 800d98e: 602b str r3, [r5, #0]
- *cur_seg = seg;
- 800d990: 6035 str r5, [r6, #0]
- #if TCP_OVERSIZE
- if (seg->next == NULL) {
- 800d992: 682b ldr r3, [r5, #0]
- 800d994: b97b cbnz r3, 800d9b6 <tcp_rexmit+0x42>
- 800d996: e00c b.n 800d9b2 <tcp_rexmit+0x3e>
- seg = pcb->unacked;
- pcb->unacked = seg->next;
- cur_seg = &(pcb->unsent);
- while (*cur_seg &&
- TCP_SEQ_LT(ntohl((*cur_seg)->tcphdr->seqno), ntohl(seg->tcphdr->seqno))) {
- 800d998: 68db ldr r3, [r3, #12]
- 800d99a: 6858 ldr r0, [r3, #4]
- 800d99c: f7fc fc31 bl 800a202 <lwip_ntohl>
- 800d9a0: 68eb ldr r3, [r5, #12]
- 800d9a2: 4607 mov r7, r0
- 800d9a4: 6858 ldr r0, [r3, #4]
- 800d9a6: f7fc fc2c bl 800a202 <lwip_ntohl>
- 800d9aa: 1a38 subs r0, r7, r0
- /* Keep the unsent queue sorted. */
- seg = pcb->unacked;
- pcb->unacked = seg->next;
- cur_seg = &(pcb->unsent);
- while (*cur_seg &&
- 800d9ac: 2800 cmp r0, #0
- 800d9ae: dbea blt.n 800d986 <tcp_rexmit+0x12>
- 800d9b0: e7ec b.n 800d98c <tcp_rexmit+0x18>
- seg->next = *cur_seg;
- *cur_seg = seg;
- #if TCP_OVERSIZE
- if (seg->next == NULL) {
- /* the retransmitted segment is last in unsent, so reset unsent_oversize */
- pcb->unsent_oversize = 0;
- 800d9b2: f8a4 306a strh.w r3, [r4, #106] ; 0x6a
- }
- #endif /* TCP_OVERSIZE */
- ++pcb->nrtx;
- 800d9b6: f894 3046 ldrb.w r3, [r4, #70] ; 0x46
- 800d9ba: 3301 adds r3, #1
- 800d9bc: f884 3046 strb.w r3, [r4, #70] ; 0x46
- /* Don't take any rtt measurements after retransmitting. */
- pcb->rttest = 0;
- 800d9c0: 2300 movs r3, #0
- 800d9c2: 63a3 str r3, [r4, #56] ; 0x38
- 800d9c4: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 0800d9c6 <tcp_rexmit_fast>:
- * @param pcb the tcp_pcb for which to retransmit the first unacked segment
- */
- void
- tcp_rexmit_fast(struct tcp_pcb *pcb)
- {
- if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) {
- 800d9c6: 6f03 ldr r3, [r0, #112] ; 0x70
- *
- * @param pcb the tcp_pcb for which to retransmit the first unacked segment
- */
- void
- tcp_rexmit_fast(struct tcp_pcb *pcb)
- {
- 800d9c8: b510 push {r4, lr}
- 800d9ca: 4604 mov r4, r0
- if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) {
- 800d9cc: b333 cbz r3, 800da1c <tcp_rexmit_fast+0x56>
- 800d9ce: 7f83 ldrb r3, [r0, #30]
- 800d9d0: f003 0304 and.w r3, r3, #4
- 800d9d4: b2db uxtb r3, r3
- 800d9d6: bb0b cbnz r3, 800da1c <tcp_rexmit_fast+0x56>
- LWIP_DEBUGF(TCP_FR_DEBUG,
- ("tcp_receive: dupacks %"U16_F" (%"U32_F
- "), fast retransmit %"U32_F"\n",
- (u16_t)pcb->dupacks, pcb->lastack,
- ntohl(pcb->unacked->tcphdr->seqno)));
- tcp_rexmit(pcb);
- 800d9d8: f7ff ffcc bl 800d974 <tcp_rexmit>
- /* Set ssthresh to half of the minimum of the current
- * cwnd and the advertised window */
- if (pcb->cwnd > pcb->snd_wnd) {
- 800d9dc: f8b4 304c ldrh.w r3, [r4, #76] ; 0x4c
- 800d9e0: f8b4 2060 ldrh.w r2, [r4, #96] ; 0x60
- 800d9e4: 4293 cmp r3, r2
- 800d9e6: d903 bls.n 800d9f0 <tcp_rexmit_fast+0x2a>
- pcb->ssthresh = pcb->snd_wnd / 2;
- 800d9e8: 0852 lsrs r2, r2, #1
- 800d9ea: f8a4 204e strh.w r2, [r4, #78] ; 0x4e
- 800d9ee: e002 b.n 800d9f6 <tcp_rexmit_fast+0x30>
- } else {
- pcb->ssthresh = pcb->cwnd / 2;
- 800d9f0: 085b lsrs r3, r3, #1
- 800d9f2: f8a4 304e strh.w r3, [r4, #78] ; 0x4e
- }
-
- /* The minimum value for ssthresh should be 2 MSS */
- if (pcb->ssthresh < 2*pcb->mss) {
- 800d9f6: 8ee3 ldrh r3, [r4, #54] ; 0x36
- 800d9f8: f8b4 104e ldrh.w r1, [r4, #78] ; 0x4e
- 800d9fc: 005a lsls r2, r3, #1
- 800d9fe: 4291 cmp r1, r2
- LWIP_DEBUGF(TCP_FR_DEBUG,
- ("tcp_receive: The minimum value for ssthresh %"U16_F
- " should be min 2 mss %"U16_F"...\n",
- pcb->ssthresh, 2*pcb->mss));
- pcb->ssthresh = 2*pcb->mss;
- 800da00: bfb8 it lt
- 800da02: f8a4 204e strhlt.w r2, [r4, #78] ; 0x4e
- }
-
- pcb->cwnd = pcb->ssthresh + 3 * pcb->mss;
- 800da06: f8b4 204e ldrh.w r2, [r4, #78] ; 0x4e
- 800da0a: 2103 movs r1, #3
- 800da0c: fb01 2303 mla r3, r1, r3, r2
- 800da10: f8a4 304c strh.w r3, [r4, #76] ; 0x4c
- pcb->flags |= TF_INFR;
- 800da14: 7fa3 ldrb r3, [r4, #30]
- 800da16: f043 0304 orr.w r3, r3, #4
- 800da1a: 77a3 strb r3, [r4, #30]
- 800da1c: bd10 pop {r4, pc}
- 800da1e: 0000 movs r0, r0
- 0800da20 <tcp_keepalive>:
- *
- * @param pcb the tcp_pcb for which to send a keepalive packet
- */
- void
- tcp_keepalive(struct tcp_pcb *pcb)
- {
- 800da20: b537 push {r0, r1, r2, r4, r5, lr}
- 800da22: 4604 mov r4, r0
- ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip)));
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
- tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
-
- p = tcp_output_alloc_header(pcb, 0, 0, htonl(pcb->snd_nxt - 1));
- 800da24: 6d00 ldr r0, [r0, #80] ; 0x50
- 800da26: 3801 subs r0, #1
- 800da28: f7fc fbe9 bl 800a1fe <lwip_htonl>
- 800da2c: 2100 movs r1, #0
- 800da2e: 4602 mov r2, r0
- 800da30: 4620 mov r0, r4
- 800da32: f7ff fb9d bl 800d170 <tcp_output_alloc_header.constprop.0>
- if(p == NULL) {
- 800da36: 4605 mov r5, r0
- 800da38: b1a8 cbz r0, 800da66 <tcp_keepalive+0x46>
- #if CHECKSUM_GEN_TCP
- tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
- IP_PROTO_TCP, p->tot_len);
- #endif
- TCP_STATS_INC(tcp.xmit);
- 800da3a: 4b0c ldr r3, [pc, #48] ; (800da6c <tcp_keepalive+0x4c>)
- 800da3c: f8b3 2090 ldrh.w r2, [r3, #144] ; 0x90
- 800da40: 3201 adds r2, #1
- 800da42: f8a3 2090 strh.w r2, [r3, #144] ; 0x90
- /* Send output to IP */
- #if LWIP_NETIF_HWADDRHINT
- ip_output_hinted(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP,
- &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
- 800da46: f04f 0e06 mov.w lr, #6
- 800da4a: 2200 movs r2, #0
- 800da4c: e88d 4004 stmia.w sp, {r2, lr}
- 800da50: 7aa3 ldrb r3, [r4, #10]
- 800da52: 4621 mov r1, r4
- 800da54: 1d22 adds r2, r4, #4
- 800da56: f000 feb9 bl 800e7cc <ip_output>
- #endif /* LWIP_NETIF_HWADDRHINT*/
- pbuf_free(p);
- 800da5a: 4628 mov r0, r5
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F".\n",
- pcb->snd_nxt - 1, pcb->rcv_nxt));
- }
- 800da5c: b003 add sp, #12
- 800da5e: e8bd 4030 ldmia.w sp!, {r4, r5, lr}
- &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
- #endif /* LWIP_NETIF_HWADDRHINT*/
- pbuf_free(p);
- 800da62: f7fd bd2f b.w 800b4c4 <pbuf_free>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F".\n",
- pcb->snd_nxt - 1, pcb->rcv_nxt));
- }
- 800da66: b003 add sp, #12
- 800da68: bd30 pop {r4, r5, pc}
- 800da6a: bf00 nop
- 800da6c: 20008220 .word 0x20008220
- 0800da70 <tcp_zero_window_probe>:
- *
- * @param pcb the tcp_pcb for which to send a zero-window probe packet
- */
- void
- tcp_zero_window_probe(struct tcp_pcb *pcb)
- {
- 800da70: e92d 41f3 stmdb sp!, {r0, r1, r4, r5, r6, r7, r8, lr}
- LWIP_DEBUGF(TCP_DEBUG,
- ("tcp_zero_window_probe: tcp_ticks %"U32_F
- " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
- tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
- seg = pcb->unacked;
- 800da74: 6f04 ldr r4, [r0, #112] ; 0x70
- *
- * @param pcb the tcp_pcb for which to send a zero-window probe packet
- */
- void
- tcp_zero_window_probe(struct tcp_pcb *pcb)
- {
- 800da76: 4605 mov r5, r0
- " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
- tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));
- seg = pcb->unacked;
- if(seg == NULL) {
- 800da78: b914 cbnz r4, 800da80 <tcp_zero_window_probe+0x10>
- seg = pcb->unsent;
- 800da7a: 6ec4 ldr r4, [r0, #108] ; 0x6c
- }
- if(seg == NULL) {
- 800da7c: 2c00 cmp r4, #0
- 800da7e: d048 beq.n 800db12 <tcp_zero_window_probe+0xa2>
- return;
- }
- is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0);
- 800da80: 68e3 ldr r3, [r4, #12]
- 800da82: 8998 ldrh r0, [r3, #12]
- 800da84: f7fc fbb6 bl 800a1f4 <lwip_ntohs>
- 800da88: f010 0001 ands.w r0, r0, #1
- 800da8c: d005 beq.n 800da9a <tcp_zero_window_probe+0x2a>
- 800da8e: 8921 ldrh r1, [r4, #8]
- 800da90: f1d1 0101 rsbs r1, r1, #1
- 800da94: bf38 it cc
- 800da96: 2100 movcc r1, #0
- 800da98: e000 b.n 800da9c <tcp_zero_window_probe+0x2c>
- 800da9a: 4601 mov r1, r0
- /* we want to send one seqno: either FIN or data (no options) */
- len = is_fin ? 0 : 1;
- p = tcp_output_alloc_header(pcb, 0, len, seg->tcphdr->seqno);
- 800da9c: 68e3 ldr r3, [r4, #12]
- }
- if(seg == NULL) {
- return;
- }
- is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0);
- 800da9e: fa5f f881 uxtb.w r8, r1
- /* we want to send one seqno: either FIN or data (no options) */
- len = is_fin ? 0 : 1;
- p = tcp_output_alloc_header(pcb, 0, len, seg->tcphdr->seqno);
- 800daa2: 4628 mov r0, r5
- 800daa4: f081 0101 eor.w r1, r1, #1
- 800daa8: 685a ldr r2, [r3, #4]
- 800daaa: f7ff fb61 bl 800d170 <tcp_output_alloc_header.constprop.0>
- if(p == NULL) {
- 800daae: 4606 mov r6, r0
- 800dab0: 2800 cmp r0, #0
- 800dab2: d02e beq.n 800db12 <tcp_zero_window_probe+0xa2>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: no memory for pbuf\n"));
- return;
- }
- tcphdr = (struct tcp_hdr *)p->payload;
- 800dab4: 6847 ldr r7, [r0, #4]
- if (is_fin) {
- 800dab6: f1b8 0f00 cmp.w r8, #0
- 800daba: d009 beq.n 800dad0 <tcp_zero_window_probe+0x60>
- /* FIN segment, no data */
- TCPH_FLAGS_SET(tcphdr, TCP_ACK | TCP_FIN);
- 800dabc: 89bc ldrh r4, [r7, #12]
- 800dabe: 2011 movs r0, #17
- 800dac0: f7fc fb93 bl 800a1ea <lwip_htons>
- 800dac4: f424 547c bic.w r4, r4, #16128 ; 0x3f00
- 800dac8: b2a4 uxth r4, r4
- 800daca: 4320 orrs r0, r4
- 800dacc: 81b8 strh r0, [r7, #12]
- 800dace: e009 b.n 800dae4 <tcp_zero_window_probe+0x74>
- /* Data segment, copy in one byte from the head of the unacked queue */
- char *d = ((char *)p->payload + TCP_HLEN);
- /* Depending on whether the segment has already been sent (unacked) or not
- (unsent), seg->p->payload points to the IP header or TCP header.
- Ensure we copy the first TCP data byte: */
- pbuf_copy_partial(seg->p, d, 1, seg->p->tot_len - seg->len);
- 800dad0: 6860 ldr r0, [r4, #4]
- 800dad2: 8923 ldrh r3, [r4, #8]
- 800dad4: 8902 ldrh r2, [r0, #8]
- 800dad6: 1ad3 subs r3, r2, r3
- 800dad8: f107 0114 add.w r1, r7, #20
- 800dadc: 2201 movs r2, #1
- 800dade: b29b uxth r3, r3
- 800dae0: f7fd fe3a bl 800b758 <pbuf_copy_partial>
- #if CHECKSUM_GEN_TCP
- tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
- IP_PROTO_TCP, p->tot_len);
- #endif
- TCP_STATS_INC(tcp.xmit);
- 800dae4: 4b0c ldr r3, [pc, #48] ; (800db18 <tcp_zero_window_probe+0xa8>)
- 800dae6: f8b3 2090 ldrh.w r2, [r3, #144] ; 0x90
- 800daea: 3201 adds r2, #1
- 800daec: f8a3 2090 strh.w r2, [r3, #144] ; 0x90
- /* Send output to IP */
- #if LWIP_NETIF_HWADDRHINT
- ip_output_hinted(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP,
- &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
- 800daf0: f04f 0c06 mov.w ip, #6
- 800daf4: 2200 movs r2, #0
- 800daf6: e88d 1004 stmia.w sp, {r2, ip}
- 800dafa: 7aab ldrb r3, [r5, #10]
- 800dafc: 4630 mov r0, r6
- 800dafe: 4629 mov r1, r5
- 800db00: 1d2a adds r2, r5, #4
- 800db02: f000 fe63 bl 800e7cc <ip_output>
- #endif /* LWIP_NETIF_HWADDRHINT*/
- pbuf_free(p);
- 800db06: 4630 mov r0, r6
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F
- " ackno %"U32_F".\n",
- pcb->snd_nxt - 1, pcb->rcv_nxt));
- }
- 800db08: b002 add sp, #8
- 800db0a: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
- &(pcb->addr_hint));
- #else /* LWIP_NETIF_HWADDRHINT*/
- ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
- #endif /* LWIP_NETIF_HWADDRHINT*/
- pbuf_free(p);
- 800db0e: f7fd bcd9 b.w 800b4c4 <pbuf_free>
- LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F
- " ackno %"U32_F".\n",
- pcb->snd_nxt - 1, pcb->rcv_nxt));
- }
- 800db12: b002 add sp, #8
- 800db14: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800db18: 20008220 .word 0x20008220
- 0800db1c <sys_timeout>:
- sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name)
- #else /* LWIP_DEBUG_TIMERNAMES */
- void
- sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
- #endif /* LWIP_DEBUG_TIMERNAMES */
- {
- 800db1c: b570 push {r4, r5, r6, lr}
- 800db1e: 4604 mov r4, r0
- struct sys_timeo *timeout, *t;
- timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
- 800db20: 2007 movs r0, #7
- sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name)
- #else /* LWIP_DEBUG_TIMERNAMES */
- void
- sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
- #endif /* LWIP_DEBUG_TIMERNAMES */
- {
- 800db22: 460d mov r5, r1
- 800db24: 4616 mov r6, r2
- struct sys_timeo *timeout, *t;
- timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
- 800db26: f7fd fbab bl 800b280 <memp_malloc>
- if (timeout == NULL) {
- 800db2a: 4603 mov r3, r0
- 800db2c: b308 cbz r0, 800db72 <sys_timeout+0x56>
- timeout->handler_name = handler_name;
- LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
- (void *)timeout, msecs, handler_name, (void *)arg));
- #endif /* LWIP_DEBUG_TIMERNAMES */
- if (next_timeout == NULL) {
- 800db2e: 4911 ldr r1, [pc, #68] ; (800db74 <sys_timeout+0x58>)
- timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
- if (timeout == NULL) {
- LWIP_ASSERT("sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout != NULL);
- return;
- }
- timeout->next = NULL;
- 800db30: 2200 movs r2, #0
- timeout->h = handler;
- timeout->arg = arg;
- timeout->time = msecs;
- 800db32: e880 0074 stmia.w r0, {r2, r4, r5, r6}
- timeout->handler_name = handler_name;
- LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
- (void *)timeout, msecs, handler_name, (void *)arg));
- #endif /* LWIP_DEBUG_TIMERNAMES */
- if (next_timeout == NULL) {
- 800db36: 680a ldr r2, [r1, #0]
- 800db38: b902 cbnz r2, 800db3c <sys_timeout+0x20>
- 800db3a: e005 b.n 800db48 <sys_timeout+0x2c>
- next_timeout = timeout;
- return;
- }
- if (next_timeout->time > msecs) {
- 800db3c: 6850 ldr r0, [r2, #4]
- 800db3e: 42a0 cmp r0, r4
- 800db40: d90c bls.n 800db5c <sys_timeout+0x40>
- next_timeout->time -= msecs;
- 800db42: 1b04 subs r4, r0, r4
- 800db44: 6054 str r4, [r2, #4]
- timeout->next = next_timeout;
- 800db46: 601a str r2, [r3, #0]
- next_timeout = timeout;
- 800db48: 600b str r3, [r1, #0]
- 800db4a: bd70 pop {r4, r5, r6, pc}
- } else {
- for(t = next_timeout; t != NULL; t = t->next) {
- timeout->time -= t->time;
- if (t->next == NULL || t->next->time > timeout->time) {
- 800db4c: 684c ldr r4, [r1, #4]
- 800db4e: 4284 cmp r4, r0
- 800db50: d80c bhi.n 800db6c <sys_timeout+0x50>
- 800db52: 460a mov r2, r1
- 800db54: e002 b.n 800db5c <sys_timeout+0x40>
- if (t->next != NULL) {
- t->next->time -= timeout->time;
- }
- timeout->next = t->next;
- 800db56: 6019 str r1, [r3, #0]
- t->next = timeout;
- 800db58: 6013 str r3, [r2, #0]
- break;
- 800db5a: bd70 pop {r4, r5, r6, pc}
- next_timeout->time -= msecs;
- timeout->next = next_timeout;
- next_timeout = timeout;
- } else {
- for(t = next_timeout; t != NULL; t = t->next) {
- timeout->time -= t->time;
- 800db5c: 6851 ldr r1, [r2, #4]
- 800db5e: 6858 ldr r0, [r3, #4]
- 800db60: 1a40 subs r0, r0, r1
- if (t->next == NULL || t->next->time > timeout->time) {
- 800db62: 6811 ldr r1, [r2, #0]
- next_timeout->time -= msecs;
- timeout->next = next_timeout;
- next_timeout = timeout;
- } else {
- for(t = next_timeout; t != NULL; t = t->next) {
- timeout->time -= t->time;
- 800db64: 6058 str r0, [r3, #4]
- if (t->next == NULL || t->next->time > timeout->time) {
- 800db66: 2900 cmp r1, #0
- 800db68: d1f0 bne.n 800db4c <sys_timeout+0x30>
- 800db6a: e7f4 b.n 800db56 <sys_timeout+0x3a>
- if (t->next != NULL) {
- t->next->time -= timeout->time;
- 800db6c: 1a20 subs r0, r4, r0
- 800db6e: 6048 str r0, [r1, #4]
- 800db70: e7f1 b.n 800db56 <sys_timeout+0x3a>
- 800db72: bd70 pop {r4, r5, r6, pc}
- 800db74: 20006bb4 .word 0x20006bb4
- 0800db78 <sys_timeouts_init>:
- }
- #endif /* LWIP_DNS */
- /** Initialize this module */
- void sys_timeouts_init(void)
- {
- 800db78: b508 push {r3, lr}
- #if IP_REASSEMBLY
- sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
- 800db7a: f44f 707a mov.w r0, #1000 ; 0x3e8
- 800db7e: 490d ldr r1, [pc, #52] ; (800dbb4 <sys_timeouts_init+0x3c>)
- 800db80: 2200 movs r2, #0
- 800db82: f7ff ffcb bl 800db1c <sys_timeout>
- #endif /* IP_REASSEMBLY */
- #if LWIP_ARP
- sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
- 800db86: f241 3088 movw r0, #5000 ; 0x1388
- 800db8a: 490b ldr r1, [pc, #44] ; (800dbb8 <sys_timeouts_init+0x40>)
- 800db8c: 2200 movs r2, #0
- 800db8e: f7ff ffc5 bl 800db1c <sys_timeout>
- #endif /* LWIP_ARP */
- #if LWIP_DHCP
- sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
- 800db92: f64e 2060 movw r0, #60000 ; 0xea60
- 800db96: 4909 ldr r1, [pc, #36] ; (800dbbc <sys_timeouts_init+0x44>)
- 800db98: 2200 movs r2, #0
- 800db9a: f7ff ffbf bl 800db1c <sys_timeout>
- sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
- 800db9e: f44f 70fa mov.w r0, #500 ; 0x1f4
- 800dba2: 4907 ldr r1, [pc, #28] ; (800dbc0 <sys_timeouts_init+0x48>)
- 800dba4: 2200 movs r2, #0
- 800dba6: f7ff ffb9 bl 800db1c <sys_timeout>
- sys_timeout(DNS_TMR_INTERVAL, dns_timer, NULL);
- #endif /* LWIP_DNS */
- #if NO_SYS
- /* Initialise timestamp for sys_check_timeouts */
- timeouts_last_time = sys_now();
- 800dbaa: f003 fa09 bl 8010fc0 <sys_now>
- 800dbae: 4b05 ldr r3, [pc, #20] ; (800dbc4 <sys_timeouts_init+0x4c>)
- 800dbb0: 6018 str r0, [r3, #0]
- 800dbb2: bd08 pop {r3, pc}
- 800dbb4: 0800dc1d .word 0x0800dc1d
- 800dbb8: 0800dc01 .word 0x0800dc01
- 800dbbc: 0800dbe5 .word 0x0800dbe5
- 800dbc0: 0800dbc9 .word 0x0800dbc9
- 800dbc4: 20006bb0 .word 0x20006bb0
- 0800dbc8 <dhcp_timer_fine>:
- *
- * @param arg unused argument
- */
- static void
- dhcp_timer_fine(void *arg)
- {
- 800dbc8: b508 push {r3, lr}
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_fine_tmr()\n"));
- dhcp_fine_tmr();
- 800dbca: f7fd f8e9 bl 800ada0 <dhcp_fine_tmr>
- sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
- 800dbce: 4904 ldr r1, [pc, #16] ; (800dbe0 <dhcp_timer_fine+0x18>)
- 800dbd0: f44f 70fa mov.w r0, #500 ; 0x1f4
- 800dbd4: 2200 movs r2, #0
- }
- 800dbd6: e8bd 4008 ldmia.w sp!, {r3, lr}
- dhcp_timer_fine(void *arg)
- {
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_fine_tmr()\n"));
- dhcp_fine_tmr();
- sys_timeout(DHCP_FINE_TIMER_MSECS, dhcp_timer_fine, NULL);
- 800dbda: f7ff bf9f b.w 800db1c <sys_timeout>
- 800dbde: bf00 nop
- 800dbe0: 0800dbc9 .word 0x0800dbc9
- 0800dbe4 <dhcp_timer_coarse>:
- *
- * @param arg unused argument
- */
- static void
- dhcp_timer_coarse(void *arg)
- {
- 800dbe4: b508 push {r3, lr}
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_coarse_tmr()\n"));
- dhcp_coarse_tmr();
- 800dbe6: f7fd f859 bl 800ac9c <dhcp_coarse_tmr>
- sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
- 800dbea: 4904 ldr r1, [pc, #16] ; (800dbfc <dhcp_timer_coarse+0x18>)
- 800dbec: f64e 2060 movw r0, #60000 ; 0xea60
- 800dbf0: 2200 movs r2, #0
- }
- 800dbf2: e8bd 4008 ldmia.w sp!, {r3, lr}
- dhcp_timer_coarse(void *arg)
- {
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: dhcp_coarse_tmr()\n"));
- dhcp_coarse_tmr();
- sys_timeout(DHCP_COARSE_TIMER_MSECS, dhcp_timer_coarse, NULL);
- 800dbf6: f7ff bf91 b.w 800db1c <sys_timeout>
- 800dbfa: bf00 nop
- 800dbfc: 0800dbe5 .word 0x0800dbe5
- 0800dc00 <arp_timer>:
- *
- * @param arg unused argument
- */
- static void
- arp_timer(void *arg)
- {
- 800dc00: b508 push {r3, lr}
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n"));
- etharp_tmr();
- 800dc02: f001 f961 bl 800eec8 <etharp_tmr>
- sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
- 800dc06: 4904 ldr r1, [pc, #16] ; (800dc18 <arp_timer+0x18>)
- 800dc08: f241 3088 movw r0, #5000 ; 0x1388
- 800dc0c: 2200 movs r2, #0
- }
- 800dc0e: e8bd 4008 ldmia.w sp!, {r3, lr}
- arp_timer(void *arg)
- {
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: etharp_tmr()\n"));
- etharp_tmr();
- sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
- 800dc12: f7ff bf83 b.w 800db1c <sys_timeout>
- 800dc16: bf00 nop
- 800dc18: 0800dc01 .word 0x0800dc01
- 0800dc1c <ip_reass_timer>:
- *
- * @param arg unused argument
- */
- static void
- ip_reass_timer(void *arg)
- {
- 800dc1c: b508 push {r3, lr}
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: ip_reass_tmr()\n"));
- ip_reass_tmr();
- 800dc1e: f000 fe83 bl 800e928 <ip_reass_tmr>
- sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
- 800dc22: 4904 ldr r1, [pc, #16] ; (800dc34 <ip_reass_timer+0x18>)
- 800dc24: f44f 707a mov.w r0, #1000 ; 0x3e8
- 800dc28: 2200 movs r2, #0
- }
- 800dc2a: e8bd 4008 ldmia.w sp!, {r3, lr}
- ip_reass_timer(void *arg)
- {
- LWIP_UNUSED_ARG(arg);
- LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: ip_reass_tmr()\n"));
- ip_reass_tmr();
- sys_timeout(IP_TMR_INTERVAL, ip_reass_timer, NULL);
- 800dc2e: f7ff bf75 b.w 800db1c <sys_timeout>
- 800dc32: bf00 nop
- 800dc34: 0800dc1d .word 0x0800dc1d
- 0800dc38 <tcp_timer_needed>:
- */
- void
- tcp_timer_needed(void)
- {
- /* timer is off but needed again? */
- if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
- 800dc38: 4b08 ldr r3, [pc, #32] ; (800dc5c <tcp_timer_needed+0x24>)
- 800dc3a: 681b ldr r3, [r3, #0]
- 800dc3c: b96b cbnz r3, 800dc5a <tcp_timer_needed+0x22>
- 800dc3e: 4b08 ldr r3, [pc, #32] ; (800dc60 <tcp_timer_needed+0x28>)
- 800dc40: 681b ldr r3, [r3, #0]
- 800dc42: b913 cbnz r3, 800dc4a <tcp_timer_needed+0x12>
- 800dc44: 4b07 ldr r3, [pc, #28] ; (800dc64 <tcp_timer_needed+0x2c>)
- 800dc46: 681b ldr r3, [r3, #0]
- 800dc48: b13b cbz r3, 800dc5a <tcp_timer_needed+0x22>
- /* enable and start timer */
- tcpip_tcp_timer_active = 1;
- 800dc4a: 4b04 ldr r3, [pc, #16] ; (800dc5c <tcp_timer_needed+0x24>)
- sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
- 800dc4c: 4906 ldr r1, [pc, #24] ; (800dc68 <tcp_timer_needed+0x30>)
- tcp_timer_needed(void)
- {
- /* timer is off but needed again? */
- if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
- /* enable and start timer */
- tcpip_tcp_timer_active = 1;
- 800dc4e: 2201 movs r2, #1
- 800dc50: 601a str r2, [r3, #0]
- sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
- 800dc52: 20fa movs r0, #250 ; 0xfa
- 800dc54: 2200 movs r2, #0
- 800dc56: f7ff bf61 b.w 800db1c <sys_timeout>
- 800dc5a: 4770 bx lr
- 800dc5c: 20006bac .word 0x20006bac
- 800dc60: 2000833c .word 0x2000833c
- 800dc64: 20008350 .word 0x20008350
- 800dc68: 0800dc6d .word 0x0800dc6d
- 0800dc6c <tcpip_tcp_timer>:
- *
- * @param arg unused argument
- */
- static void
- tcpip_tcp_timer(void *arg)
- {
- 800dc6c: b508 push {r3, lr}
- LWIP_UNUSED_ARG(arg);
- /* call TCP timer handler */
- tcp_tmr();
- 800dc6e: f7fe facd bl 800c20c <tcp_tmr>
- /* timer still needed? */
- if (tcp_active_pcbs || tcp_tw_pcbs) {
- 800dc72: 4b08 ldr r3, [pc, #32] ; (800dc94 <tcpip_tcp_timer+0x28>)
- 800dc74: 681b ldr r3, [r3, #0]
- 800dc76: b913 cbnz r3, 800dc7e <tcpip_tcp_timer+0x12>
- 800dc78: 4b07 ldr r3, [pc, #28] ; (800dc98 <tcpip_tcp_timer+0x2c>)
- 800dc7a: 681b ldr r3, [r3, #0]
- 800dc7c: b133 cbz r3, 800dc8c <tcpip_tcp_timer+0x20>
- /* restart timer */
- sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
- 800dc7e: 4907 ldr r1, [pc, #28] ; (800dc9c <tcpip_tcp_timer+0x30>)
- 800dc80: 20fa movs r0, #250 ; 0xfa
- 800dc82: 2200 movs r2, #0
- } else {
- /* disable timer */
- tcpip_tcp_timer_active = 0;
- }
- }
- 800dc84: e8bd 4008 ldmia.w sp!, {r3, lr}
- /* call TCP timer handler */
- tcp_tmr();
- /* timer still needed? */
- if (tcp_active_pcbs || tcp_tw_pcbs) {
- /* restart timer */
- sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
- 800dc88: f7ff bf48 b.w 800db1c <sys_timeout>
- } else {
- /* disable timer */
- tcpip_tcp_timer_active = 0;
- 800dc8c: 4a04 ldr r2, [pc, #16] ; (800dca0 <tcpip_tcp_timer+0x34>)
- 800dc8e: 6013 str r3, [r2, #0]
- 800dc90: bd08 pop {r3, pc}
- 800dc92: bf00 nop
- 800dc94: 2000833c .word 0x2000833c
- 800dc98: 20008350 .word 0x20008350
- 800dc9c: 0800dc6d .word 0x0800dc6d
- 800dca0: 20006bac .word 0x20006bac
- 0800dca4 <sys_check_timeouts>:
- *
- * Must be called periodically from your main loop.
- */
- void
- sys_check_timeouts(void)
- {
- 800dca4: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
- if (next_timeout) {
- 800dca8: 4e10 ldr r6, [pc, #64] ; (800dcec <sys_check_timeouts+0x48>)
- 800dcaa: 6833 ldr r3, [r6, #0]
- 800dcac: b1db cbz r3, 800dce6 <sys_check_timeouts+0x42>
- sys_timeout_handler handler;
- void *arg;
- u8_t had_one;
- u32_t now;
- now = sys_now();
- 800dcae: f003 f987 bl 8010fc0 <sys_now>
- /* this cares for wraparounds */
- diff = now - timeouts_last_time;
- 800dcb2: 4b0f ldr r3, [pc, #60] ; (800dcf0 <sys_check_timeouts+0x4c>)
- 800dcb4: 681c ldr r4, [r3, #0]
- sys_timeout_handler handler;
- void *arg;
- u8_t had_one;
- u32_t now;
- now = sys_now();
- 800dcb6: 4605 mov r5, r0
- /* this cares for wraparounds */
- diff = now - timeouts_last_time;
- 800dcb8: 1b04 subs r4, r0, r4
- had_one = 0;
- tmptimeout = next_timeout;
- if (tmptimeout && (tmptimeout->time <= diff)) {
- /* timeout has expired */
- had_one = 1;
- timeouts_last_time = now;
- 800dcba: 4698 mov r8, r3
- {
- #if PBUF_POOL_FREE_OOSEQ
- PBUF_CHECK_FREE_OOSEQ();
- #endif /* PBUF_POOL_FREE_OOSEQ */
- had_one = 0;
- tmptimeout = next_timeout;
- 800dcbc: 6831 ldr r1, [r6, #0]
- if (tmptimeout && (tmptimeout->time <= diff)) {
- 800dcbe: b191 cbz r1, 800dce6 <sys_check_timeouts+0x42>
- 800dcc0: 684b ldr r3, [r1, #4]
- 800dcc2: 42a3 cmp r3, r4
- 800dcc4: d80f bhi.n 800dce6 <sys_check_timeouts+0x42>
- /* timeout has expired */
- had_one = 1;
- timeouts_last_time = now;
- diff -= tmptimeout->time;
- 800dcc6: 1ae4 subs r4, r4, r3
- next_timeout = tmptimeout->next;
- handler = tmptimeout->h;
- 800dcc8: 688f ldr r7, [r1, #8]
- if (tmptimeout && (tmptimeout->time <= diff)) {
- /* timeout has expired */
- had_one = 1;
- timeouts_last_time = now;
- diff -= tmptimeout->time;
- next_timeout = tmptimeout->next;
- 800dcca: 680b ldr r3, [r1, #0]
- had_one = 0;
- tmptimeout = next_timeout;
- if (tmptimeout && (tmptimeout->time <= diff)) {
- /* timeout has expired */
- had_one = 1;
- timeouts_last_time = now;
- 800dccc: f8c8 5000 str.w r5, [r8]
- if (handler != NULL) {
- LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%s arg=%p\n",
- tmptimeout->handler_name, arg));
- }
- #endif /* LWIP_DEBUG_TIMERNAMES */
- memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
- 800dcd0: 2007 movs r0, #7
- if (tmptimeout && (tmptimeout->time <= diff)) {
- /* timeout has expired */
- had_one = 1;
- timeouts_last_time = now;
- diff -= tmptimeout->time;
- next_timeout = tmptimeout->next;
- 800dcd2: 6033 str r3, [r6, #0]
- handler = tmptimeout->h;
- arg = tmptimeout->arg;
- 800dcd4: f8d1 900c ldr.w r9, [r1, #12]
- if (handler != NULL) {
- LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%s arg=%p\n",
- tmptimeout->handler_name, arg));
- }
- #endif /* LWIP_DEBUG_TIMERNAMES */
- memp_free(MEMP_SYS_TIMEOUT, tmptimeout);
- 800dcd8: f7fd fafc bl 800b2d4 <memp_free>
- if (handler != NULL) {
- 800dcdc: 2f00 cmp r7, #0
- 800dcde: d0ed beq.n 800dcbc <sys_check_timeouts+0x18>
- handler(arg);
- 800dce0: 4648 mov r0, r9
- 800dce2: 47b8 blx r7
- 800dce4: e7ea b.n 800dcbc <sys_check_timeouts+0x18>
- 800dce6: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
- 800dcea: bf00 nop
- 800dcec: 20006bb4 .word 0x20006bb4
- 800dcf0: 20006bb0 .word 0x20006bb0
- 0800dcf4 <udp_init>:
- /**
- * Initialize this module.
- */
- void
- udp_init(void)
- {
- 800dcf4: 4770 bx lr
- 800dcf6: 0000 movs r0, r0
- 0800dcf8 <udp_input>:
- u8_t local_match;
- u8_t broadcast;
- PERF_START;
- UDP_STATS_INC(udp.recv);
- 800dcf8: 4b69 ldr r3, [pc, #420] ; (800dea0 <udp_input+0x1a8>)
- * @param inp network interface on which the datagram was received.
- *
- */
- void
- udp_input(struct pbuf *p, struct netif *inp)
- {
- 800dcfa: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- u8_t local_match;
- u8_t broadcast;
- PERF_START;
- UDP_STATS_INC(udp.recv);
- 800dcfe: f8b3 207a ldrh.w r2, [r3, #122] ; 0x7a
- iphdr = (struct ip_hdr *)p->payload;
- 800dd02: f8d0 9004 ldr.w r9, [r0, #4]
- u8_t local_match;
- u8_t broadcast;
- PERF_START;
- UDP_STATS_INC(udp.recv);
- 800dd06: 3201 adds r2, #1
- 800dd08: f8a3 207a strh.w r2, [r3, #122] ; 0x7a
- * @param inp network interface on which the datagram was received.
- *
- */
- void
- udp_input(struct pbuf *p, struct netif *inp)
- {
- 800dd0c: 460e mov r6, r1
- iphdr = (struct ip_hdr *)p->payload;
- /* Check minimum length (IP header + UDP header)
- * and move payload pointer to UDP header */
- if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
- 800dd0e: f899 1000 ldrb.w r1, [r9]
- 800dd12: 8903 ldrh r3, [r0, #8]
- 800dd14: f001 010f and.w r1, r1, #15
- 800dd18: 1c8a adds r2, r1, #2
- 800dd1a: ebb3 0f82 cmp.w r3, r2, lsl #2
- * @param inp network interface on which the datagram was received.
- *
- */
- void
- udp_input(struct pbuf *p, struct netif *inp)
- {
- 800dd1e: b085 sub sp, #20
- 800dd20: 4605 mov r5, r0
- iphdr = (struct ip_hdr *)p->payload;
- /* Check minimum length (IP header + UDP header)
- * and move payload pointer to UDP header */
- if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
- 800dd22: da06 bge.n 800dd32 <udp_input+0x3a>
- /* drop short packets */
- LWIP_DEBUGF(UDP_DEBUG,
- ("udp_input: short UDP datagram (%"U16_F" bytes) discarded\n", p->tot_len));
- UDP_STATS_INC(udp.lenerr);
- 800dd24: 4b5e ldr r3, [pc, #376] ; (800dea0 <udp_input+0x1a8>)
- 800dd26: f8b3 2082 ldrh.w r2, [r3, #130] ; 0x82
- 800dd2a: 3201 adds r2, #1
- 800dd2c: f8a3 2082 strh.w r2, [r3, #130] ; 0x82
- 800dd30: e0a3 b.n 800de7a <udp_input+0x182>
- iphdr = (struct ip_hdr *)p->payload;
- /* Check minimum length (IP header + UDP header)
- * and move payload pointer to UDP header */
- if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
- 800dd32: 0089 lsls r1, r1, #2
- 800dd34: 4249 negs r1, r1
- 800dd36: f7fd fb9a bl 800b46e <pbuf_header>
- 800dd3a: 4683 mov fp, r0
- 800dd3c: 2800 cmp r0, #0
- 800dd3e: d1f1 bne.n 800dd24 <udp_input+0x2c>
- }
- udphdr = (struct udp_hdr *)p->payload;
- /* is broadcast packet ? */
- broadcast = ip_addr_isbroadcast(¤t_iphdr_dest, inp);
- 800dd40: f8df a168 ldr.w sl, [pc, #360] ; 800deac <udp_input+0x1b4>
- snmp_inc_udpinerrors();
- pbuf_free(p);
- goto end;
- }
- udphdr = (struct udp_hdr *)p->payload;
- 800dd44: 686c ldr r4, [r5, #4]
- /* is broadcast packet ? */
- broadcast = ip_addr_isbroadcast(¤t_iphdr_dest, inp);
- 800dd46: f8da 0000 ldr.w r0, [sl]
- 800dd4a: 4631 mov r1, r6
- 800dd4c: f000 fb19 bl 800e382 <ip4_addr_isbroadcast>
- 800dd50: 4607 mov r7, r0
- LWIP_DEBUGF(UDP_DEBUG, ("udp_input: received datagram of length %"U16_F"\n", p->tot_len));
- /* convert src and dest ports to host byte order */
- src = ntohs(udphdr->src);
- 800dd52: 8820 ldrh r0, [r4, #0]
- 800dd54: f7fc fa4e bl 800a1f4 <lwip_ntohs>
- 800dd58: 4680 mov r8, r0
- dest = ntohs(udphdr->dest);
- 800dd5a: 8860 ldrh r0, [r4, #2]
- 800dd5c: f7fc fa4a bl 800a1f4 <lwip_ntohs>
- #if LWIP_DHCP
- pcb = NULL;
- /* when LWIP_DHCP is active, packets to DHCP_CLIENT_PORT may only be processed by
- the dhcp module, no other UDP pcb may use the local UDP port DHCP_CLIENT_PORT */
- if (dest == DHCP_CLIENT_PORT) {
- 800dd60: 2844 cmp r0, #68 ; 0x44
- 800dd62: d110 bne.n 800dd86 <udp_input+0x8e>
- /* all packets for DHCP_CLIENT_PORT not coming from DHCP_SERVER_PORT are dropped! */
- if (src == DHCP_SERVER_PORT) {
- 800dd64: f1b8 0f43 cmp.w r8, #67 ; 0x43
- 800dd68: d152 bne.n 800de10 <udp_input+0x118>
- if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) {
- 800dd6a: 6a33 ldr r3, [r6, #32]
- 800dd6c: 2b00 cmp r3, #0
- 800dd6e: d04f beq.n 800de10 <udp_input+0x118>
- 800dd70: 685c ldr r4, [r3, #4]
- 800dd72: 2c00 cmp r4, #0
- 800dd74: d04c beq.n 800de10 <udp_input+0x118>
- /* accept the packe if
- (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY!
- - inp->dhcp->pcb->remote == ANY or iphdr->src */
- if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) ||
- 800dd76: 6863 ldr r3, [r4, #4]
- 800dd78: 2b00 cmp r3, #0
- 800dd7a: d051 beq.n 800de20 <udp_input+0x128>
- ip_addr_cmp(&(inp->dhcp->pcb->remote_ip), ¤t_iphdr_src))) {
- 800dd7c: 4a49 ldr r2, [pc, #292] ; (800dea4 <udp_input+0x1ac>)
- if (src == DHCP_SERVER_PORT) {
- if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) {
- /* accept the packe if
- (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY!
- - inp->dhcp->pcb->remote == ANY or iphdr->src */
- if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) ||
- 800dd7e: 6812 ldr r2, [r2, #0]
- 800dd80: 4293 cmp r3, r2
- 800dd82: d145 bne.n 800de10 <udp_input+0x118>
- 800dd84: e04c b.n 800de20 <udp_input+0x128>
- uncon_pcb = NULL;
- /* Iterate through the UDP pcb list for a matching pcb.
- * 'Perfect match' pcbs (connected to the remote port & ip address) are
- * preferred. If no perfect match is found, the first unconnected pcb that
- * matches the local port and ip address gets the datagram. */
- for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800dd86: 4b48 ldr r3, [pc, #288] ; (800dea8 <udp_input+0x1b0>)
- /* compare PCB local addr+port to UDP destination addr+port */
- if (pcb->local_port == dest) {
- if (
- (!broadcast && ip_addr_isany(&pcb->local_ip)) ||
- ip_addr_cmp(&(pcb->local_ip), ¤t_iphdr_dest) ||
- 800dd88: f8da a000 ldr.w sl, [sl]
- uncon_pcb = NULL;
- /* Iterate through the UDP pcb list for a matching pcb.
- * 'Perfect match' pcbs (connected to the remote port & ip address) are
- * preferred. If no perfect match is found, the first unconnected pcb that
- * matches the local port and ip address gets the datagram. */
- for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800dd8c: f8d3 c000 ldr.w ip, [r3]
- }
- /* compare PCB remote addr+port to UDP source addr+port */
- if ((local_match != 0) &&
- (pcb->remote_port == src) &&
- (ip_addr_isany(&pcb->remote_ip) ||
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src))) {
- 800dd90: 4b44 ldr r3, [pc, #272] ; (800dea4 <udp_input+0x1ac>)
- 800dd92: 681b ldr r3, [r3, #0]
- uncon_pcb = NULL;
- /* Iterate through the UDP pcb list for a matching pcb.
- * 'Perfect match' pcbs (connected to the remote port & ip address) are
- * preferred. If no perfect match is found, the first unconnected pcb that
- * matches the local port and ip address gets the datagram. */
- for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800dd94: 4664 mov r4, ip
- }
- /* compare PCB remote addr+port to UDP source addr+port */
- if ((local_match != 0) &&
- (pcb->remote_port == src) &&
- (ip_addr_isany(&pcb->remote_ip) ||
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src))) {
- 800dd96: 9303 str r3, [sp, #12]
- }
- }
- } else
- #endif /* LWIP_DHCP */
- {
- prev = NULL;
- 800dd98: 4659 mov r1, fp
- local_match = 0;
- uncon_pcb = NULL;
- 800dd9a: 465b mov r3, fp
- /* Iterate through the UDP pcb list for a matching pcb.
- * 'Perfect match' pcbs (connected to the remote port & ip address) are
- * preferred. If no perfect match is found, the first unconnected pcb that
- * matches the local port and ip address gets the datagram. */
- for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800dd9c: e035 b.n 800de0a <udp_input+0x112>
- ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip), pcb->local_port,
- ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip),
- ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip), pcb->remote_port));
- /* compare PCB local addr+port to UDP destination addr+port */
- if (pcb->local_port == dest) {
- 800dd9e: 8a62 ldrh r2, [r4, #18]
- 800dda0: 4282 cmp r2, r0
- 800dda2: d130 bne.n 800de06 <udp_input+0x10e>
- 800dda4: 6822 ldr r2, [r4, #0]
- if (
- 800dda6: b907 cbnz r7, 800ddaa <udp_input+0xb2>
- (!broadcast && ip_addr_isany(&pcb->local_ip)) ||
- 800dda8: b14a cbz r2, 800ddbe <udp_input+0xc6>
- 800ddaa: 4552 cmp r2, sl
- 800ddac: d007 beq.n 800ddbe <udp_input+0xc6>
- ip_addr_cmp(&(pcb->local_ip), ¤t_iphdr_dest) ||
- 800ddae: b357 cbz r7, 800de06 <udp_input+0x10e>
- (broadcast && ip_get_option(pcb, SOF_BROADCAST) &&
- (ip_addr_isany(&pcb->local_ip) ||
- ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
- #else /* IP_SOF_BROADCAST_RECV */
- (broadcast &&
- (ip_addr_isany(&pcb->local_ip) ||
- 800ddb0: b12a cbz r2, 800ddbe <udp_input+0xc6>
- ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
- 800ddb2: ea8a 0b02 eor.w fp, sl, r2
- 800ddb6: 68b2 ldr r2, [r6, #8]
- (broadcast && ip_get_option(pcb, SOF_BROADCAST) &&
- (ip_addr_isany(&pcb->local_ip) ||
- ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
- #else /* IP_SOF_BROADCAST_RECV */
- (broadcast &&
- (ip_addr_isany(&pcb->local_ip) ||
- 800ddb8: ea1b 0f02 tst.w fp, r2
- 800ddbc: d123 bne.n 800de06 <udp_input+0x10e>
- ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
- #endif /* IP_SOF_BROADCAST_RECV */
- local_match = 1;
- if ((uncon_pcb == NULL) &&
- 800ddbe: 2b00 cmp r3, #0
- 800ddc0: d166 bne.n 800de90 <udp_input+0x198>
- ((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) {
- 800ddc2: 7c23 ldrb r3, [r4, #16]
- (broadcast &&
- (ip_addr_isany(&pcb->local_ip) ||
- ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
- #endif /* IP_SOF_BROADCAST_RECV */
- local_match = 1;
- if ((uncon_pcb == NULL) &&
- 800ddc4: f003 0304 and.w r3, r3, #4
- 800ddc8: b2db uxtb r3, r3
- 800ddca: 2b00 cmp r3, #0
- 800ddcc: bf0c ite eq
- 800ddce: 4623 moveq r3, r4
- 800ddd0: 2300 movne r3, #0
- 800ddd2: e05d b.n 800de90 <udp_input+0x198>
- }
- }
- /* compare PCB remote addr+port to UDP source addr+port */
- if ((local_match != 0) &&
- (pcb->remote_port == src) &&
- (ip_addr_isany(&pcb->remote_ip) ||
- 800ddd4: f8d4 b004 ldr.w fp, [r4, #4]
- 800ddd8: f1bb 0f00 cmp.w fp, #0
- 800dddc: d101 bne.n 800dde2 <udp_input+0xea>
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src))) {
- /* the first fully matching PCB */
- if (prev != NULL) {
- 800ddde: b921 cbnz r1, 800ddea <udp_input+0xf2>
- 800dde0: e00a b.n 800ddf8 <udp_input+0x100>
- }
- }
- /* compare PCB remote addr+port to UDP source addr+port */
- if ((local_match != 0) &&
- (pcb->remote_port == src) &&
- (ip_addr_isany(&pcb->remote_ip) ||
- 800dde2: 9a03 ldr r2, [sp, #12]
- 800dde4: 4593 cmp fp, r2
- 800dde6: d10e bne.n 800de06 <udp_input+0x10e>
- 800dde8: e7f9 b.n 800ddde <udp_input+0xe6>
- ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src))) {
- /* the first fully matching PCB */
- if (prev != NULL) {
- /* move the pcb to the front of udp_pcbs so that is
- found faster next time */
- prev->next = pcb->next;
- 800ddea: 68e3 ldr r3, [r4, #12]
- 800ddec: 60cb str r3, [r1, #12]
- pcb->next = udp_pcbs;
- udp_pcbs = pcb;
- 800ddee: 4b2e ldr r3, [pc, #184] ; (800dea8 <udp_input+0x1b0>)
- /* the first fully matching PCB */
- if (prev != NULL) {
- /* move the pcb to the front of udp_pcbs so that is
- found faster next time */
- prev->next = pcb->next;
- pcb->next = udp_pcbs;
- 800ddf0: f8c4 c00c str.w ip, [r4, #12]
- udp_pcbs = pcb;
- 800ddf4: 601c str r4, [r3, #0]
- 800ddf6: e013 b.n 800de20 <udp_input+0x128>
- } else {
- UDP_STATS_INC(udp.cachehit);
- 800ddf8: 4b29 ldr r3, [pc, #164] ; (800dea0 <udp_input+0x1a8>)
- 800ddfa: f8b3 208e ldrh.w r2, [r3, #142] ; 0x8e
- 800ddfe: 3201 adds r2, #1
- 800de00: f8a3 208e strh.w r2, [r3, #142] ; 0x8e
- 800de04: e00c b.n 800de20 <udp_input+0x128>
- 800de06: 4621 mov r1, r4
- uncon_pcb = NULL;
- /* Iterate through the UDP pcb list for a matching pcb.
- * 'Perfect match' pcbs (connected to the remote port & ip address) are
- * preferred. If no perfect match is found, the first unconnected pcb that
- * matches the local port and ip address gets the datagram. */
- for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800de08: 68e4 ldr r4, [r4, #12]
- 800de0a: 2c00 cmp r4, #0
- 800de0c: d1c7 bne.n 800dd9e <udp_input+0xa6>
- pcb = uncon_pcb;
- }
- }
- /* Check checksum if this is a match or if it was directed at us. */
- if (pcb != NULL || ip_addr_cmp(&inp->ip_addr, ¤t_iphdr_dest)) {
- 800de0e: b933 cbnz r3, 800de1e <udp_input+0x126>
- 800de10: 4b26 ldr r3, [pc, #152] ; (800deac <udp_input+0x1b4>)
- 800de12: 6872 ldr r2, [r6, #4]
- 800de14: 681b ldr r3, [r3, #0]
- 800de16: 429a cmp r2, r3
- 800de18: d134 bne.n 800de84 <udp_input+0x18c>
- 800de1a: 2400 movs r4, #0
- 800de1c: e000 b.n 800de20 <udp_input+0x128>
- 800de1e: 461c mov r4, r3
- goto end;
- }
- }
- #endif /* CHECKSUM_CHECK_UDP */
- }
- if(pbuf_header(p, -UDP_HLEN)) {
- 800de20: 4628 mov r0, r5
- 800de22: f06f 0107 mvn.w r1, #7
- 800de26: f7fd fb22 bl 800b46e <pbuf_header>
- 800de2a: b108 cbz r0, 800de30 <udp_input+0x138>
- /* Can we cope with this failing? Just assert for now */
- LWIP_ASSERT("pbuf_header failed\n", 0);
- UDP_STATS_INC(udp.drop);
- 800de2c: 4b1c ldr r3, [pc, #112] ; (800dea0 <udp_input+0x1a8>)
- 800de2e: e024 b.n 800de7a <udp_input+0x182>
- snmp_inc_udpinerrors();
- pbuf_free(p);
- goto end;
- }
- if (pcb != NULL) {
- 800de30: b14c cbz r4, 800de46 <udp_input+0x14e>
- pbuf_header(p, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
- }
- }
- #endif /* SO_REUSE && SO_REUSE_RXTOALL */
- /* callback */
- if (pcb->recv != NULL) {
- 800de32: 69a6 ldr r6, [r4, #24]
- 800de34: b336 cbz r6, 800de84 <udp_input+0x18c>
- /* now the recv function is responsible for freeing p */
- pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr(), src);
- 800de36: f8cd 8000 str.w r8, [sp]
- 800de3a: 69e0 ldr r0, [r4, #28]
- 800de3c: 4b19 ldr r3, [pc, #100] ; (800dea4 <udp_input+0x1ac>)
- 800de3e: 4621 mov r1, r4
- 800de40: 462a mov r2, r5
- 800de42: 47b0 blx r6
- 800de44: e028 b.n 800de98 <udp_input+0x1a0>
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));
- #if LWIP_ICMP
- /* No match was found, send ICMP destination port unreachable unless
- destination address was broadcast/multicast. */
- if (!broadcast &&
- 800de46: b997 cbnz r7, 800de6e <udp_input+0x176>
- !ip_addr_ismulticast(¤t_iphdr_dest)) {
- 800de48: 4b18 ldr r3, [pc, #96] ; (800deac <udp_input+0x1b4>)
- 800de4a: 681b ldr r3, [r3, #0]
- 800de4c: f003 03f0 and.w r3, r3, #240 ; 0xf0
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));
- #if LWIP_ICMP
- /* No match was found, send ICMP destination port unreachable unless
- destination address was broadcast/multicast. */
- if (!broadcast &&
- 800de50: 2be0 cmp r3, #224 ; 0xe0
- 800de52: d00c beq.n 800de6e <udp_input+0x176>
- !ip_addr_ismulticast(¤t_iphdr_dest)) {
- /* move payload pointer back to ip header */
- pbuf_header(p, (IPH_HL(iphdr) * 4) + UDP_HLEN);
- 800de54: f899 1000 ldrb.w r1, [r9]
- 800de58: f001 010f and.w r1, r1, #15
- 800de5c: 3102 adds r1, #2
- 800de5e: 0089 lsls r1, r1, #2
- 800de60: 4628 mov r0, r5
- 800de62: f7fd fb04 bl 800b46e <pbuf_header>
- LWIP_ASSERT("p->payload == iphdr", (p->payload == iphdr));
- icmp_dest_unreach(p, ICMP_DUR_PORT);
- 800de66: 4628 mov r0, r5
- 800de68: 2103 movs r1, #3
- 800de6a: f000 fa2d bl 800e2c8 <icmp_dest_unreach>
- }
- #endif /* LWIP_ICMP */
- UDP_STATS_INC(udp.proterr);
- 800de6e: 4b0c ldr r3, [pc, #48] ; (800dea0 <udp_input+0x1a8>)
- 800de70: f8b3 2088 ldrh.w r2, [r3, #136] ; 0x88
- 800de74: 3201 adds r2, #1
- 800de76: f8a3 2088 strh.w r2, [r3, #136] ; 0x88
- UDP_STATS_INC(udp.drop);
- 800de7a: f8b3 207e ldrh.w r2, [r3, #126] ; 0x7e
- 800de7e: 3201 adds r2, #1
- 800de80: f8a3 207e strh.w r2, [r3, #126] ; 0x7e
- snmp_inc_udpnoports();
- pbuf_free(p);
- 800de84: 4628 mov r0, r5
- } else {
- pbuf_free(p);
- }
- end:
- PERF_STOP("udp_input");
- }
- 800de86: b005 add sp, #20
- 800de88: e8bd 4ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- }
- #endif /* LWIP_ICMP */
- UDP_STATS_INC(udp.proterr);
- UDP_STATS_INC(udp.drop);
- snmp_inc_udpnoports();
- pbuf_free(p);
- 800de8c: f7fd bb1a b.w 800b4c4 <pbuf_free>
- uncon_pcb = pcb;
- }
- }
- }
- /* compare PCB remote addr+port to UDP source addr+port */
- if ((local_match != 0) &&
- 800de90: 8aa2 ldrh r2, [r4, #20]
- 800de92: 4542 cmp r2, r8
- 800de94: d1b7 bne.n 800de06 <udp_input+0x10e>
- 800de96: e79d b.n 800ddd4 <udp_input+0xdc>
- } else {
- pbuf_free(p);
- }
- end:
- PERF_STOP("udp_input");
- }
- 800de98: b005 add sp, #20
- 800de9a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800de9e: bf00 nop
- 800dea0: 20008220 .word 0x20008220
- 800dea4: 2000835c .word 0x2000835c
- 800dea8: 20008358 .word 0x20008358
- 800deac: 20008364 .word 0x20008364
- 0800deb0 <udp_bind>:
- ip_addr_debug_print(UDP_DEBUG, ipaddr);
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
- rebind = 0;
- /* Check for double bind and rebind of the same pcb */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800deb0: 4b23 ldr r3, [pc, #140] ; (800df40 <udp_bind+0x90>)
- *
- * @see udp_disconnect()
- */
- err_t
- udp_bind(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- 800deb2: b5f0 push {r4, r5, r6, r7, lr}
- ip_addr_debug_print(UDP_DEBUG, ipaddr);
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
- rebind = 0;
- /* Check for double bind and rebind of the same pcb */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800deb4: 681d ldr r5, [r3, #0]
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_bind(ipaddr = "));
- ip_addr_debug_print(UDP_DEBUG, ipaddr);
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
- rebind = 0;
- 800deb6: 2400 movs r4, #0
- /* Check for double bind and rebind of the same pcb */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800deb8: 462b mov r3, r5
- 800deba: e012 b.n 800dee2 <udp_bind+0x32>
- /* is this UDP PCB already on active list? */
- if (pcb == ipcb) {
- 800debc: 4298 cmp r0, r3
- 800debe: d00e beq.n 800dede <udp_bind+0x2e>
- !ip_get_option(ipcb, SOF_REUSEADDR)) {
- #else /* SO_REUSE */
- /* port matches that of PCB in list and REUSEADDR not set -> reject */
- else {
- #endif /* SO_REUSE */
- if ((ipcb->local_port == port) &&
- 800dec0: 8a5e ldrh r6, [r3, #18]
- 800dec2: 4296 cmp r6, r2
- 800dec4: d10c bne.n 800dee0 <udp_bind+0x30>
- /* IP address matches, or one is IP_ADDR_ANY? */
- (ip_addr_isany(&(ipcb->local_ip)) ||
- 800dec6: 681f ldr r7, [r3, #0]
- 800dec8: b90f cbnz r7, 800dece <udp_bind+0x1e>
- ip_addr_isany(ipaddr) ||
- ip_addr_cmp(&(ipcb->local_ip), ipaddr))) {
- /* other PCB already binds to this local IP and port */
- LWIP_DEBUGF(UDP_DEBUG,
- ("udp_bind: local port %"U16_F" already bound by another pcb\n", port));
- return ERR_USE;
- 800deca: 20f8 movs r0, #248 ; 0xf8
- 800decc: e035 b.n 800df3a <udp_bind+0x8a>
- /* port matches that of PCB in list and REUSEADDR not set -> reject */
- else {
- #endif /* SO_REUSE */
- if ((ipcb->local_port == port) &&
- /* IP address matches, or one is IP_ADDR_ANY? */
- (ip_addr_isany(&(ipcb->local_ip)) ||
- 800dece: 2900 cmp r1, #0
- 800ded0: d0fb beq.n 800deca <udp_bind+0x1a>
- ip_addr_isany(ipaddr) ||
- 800ded2: 680e ldr r6, [r1, #0]
- 800ded4: 2e00 cmp r6, #0
- 800ded6: d0f8 beq.n 800deca <udp_bind+0x1a>
- 800ded8: 42b7 cmp r7, r6
- 800deda: d101 bne.n 800dee0 <udp_bind+0x30>
- 800dedc: e7f5 b.n 800deca <udp_bind+0x1a>
- /* is this UDP PCB already on active list? */
- if (pcb == ipcb) {
- /* pcb may occur at most once in active list */
- LWIP_ASSERT("rebind == 0", rebind == 0);
- /* pcb already in list, just rebind */
- rebind = 1;
- 800dede: 2401 movs r4, #1
- ip_addr_debug_print(UDP_DEBUG, ipaddr);
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
- rebind = 0;
- /* Check for double bind and rebind of the same pcb */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800dee0: 68db ldr r3, [r3, #12]
- 800dee2: 2b00 cmp r3, #0
- 800dee4: d1ea bne.n 800debc <udp_bind+0xc>
- return ERR_USE;
- }
- }
- }
- ip_addr_set(&pcb->local_ip, ipaddr);
- 800dee6: b101 cbz r1, 800deea <udp_bind+0x3a>
- 800dee8: 6809 ldr r1, [r1, #0]
- 800deea: 6001 str r1, [r0, #0]
- /* no port specified? */
- if (port == 0) {
- 800deec: b9fa cbnz r2, 800df2e <udp_bind+0x7e>
- 800deee: 4b15 ldr r3, [pc, #84] ; (800df44 <udp_bind+0x94>)
- 800def0: 881a ldrh r2, [r3, #0]
- 800def2: f44f 4180 mov.w r1, #16384 ; 0x4000
- {
- u16_t n = 0;
- struct udp_pcb *pcb;
-
- again:
- if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) {
- 800def6: f64f 76ff movw r6, #65535 ; 0xffff
- 800defa: 42b2 cmp r2, r6
- 800defc: d002 beq.n 800df04 <udp_bind+0x54>
- 800defe: 3201 adds r2, #1
- 800df00: b292 uxth r2, r2
- 800df02: e001 b.n 800df08 <udp_bind+0x58>
- udp_port = UDP_LOCAL_PORT_RANGE_START;
- 800df04: f44f 4240 mov.w r2, #49152 ; 0xc000
- }
- /* Check all PCBs. */
- for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800df08: 462b mov r3, r5
- 800df0a: e00a b.n 800df22 <udp_bind+0x72>
- if (pcb->local_port == udp_port) {
- 800df0c: 8a5f ldrh r7, [r3, #18]
- 800df0e: 4297 cmp r7, r2
- 800df10: d106 bne.n 800df20 <udp_bind+0x70>
- 800df12: 3901 subs r1, #1
- 800df14: b289 uxth r1, r1
- if (++n > (UDP_LOCAL_PORT_RANGE_END - UDP_LOCAL_PORT_RANGE_START)) {
- 800df16: 2900 cmp r1, #0
- 800df18: d1ef bne.n 800defa <udp_bind+0x4a>
- 800df1a: 4b0a ldr r3, [pc, #40] ; (800df44 <udp_bind+0x94>)
- 800df1c: 801a strh r2, [r3, #0]
- 800df1e: e7d4 b.n 800deca <udp_bind+0x1a>
- again:
- if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) {
- udp_port = UDP_LOCAL_PORT_RANGE_START;
- }
- /* Check all PCBs. */
- for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
- 800df20: 68db ldr r3, [r3, #12]
- 800df22: 2b00 cmp r3, #0
- 800df24: d1f2 bne.n 800df0c <udp_bind+0x5c>
- 800df26: 4b07 ldr r3, [pc, #28] ; (800df44 <udp_bind+0x94>)
- 800df28: 801a strh r2, [r3, #0]
- ip_addr_set(&pcb->local_ip, ipaddr);
- /* no port specified? */
- if (port == 0) {
- port = udp_new_port();
- if (port == 0) {
- 800df2a: 2a00 cmp r2, #0
- 800df2c: d0cd beq.n 800deca <udp_bind+0x1a>
- /* no more ports available in local range */
- LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));
- return ERR_USE;
- }
- }
- pcb->local_port = port;
- 800df2e: 8242 strh r2, [r0, #18]
- snmp_insert_udpidx_tree(pcb);
- /* pcb not active yet? */
- if (rebind == 0) {
- 800df30: b914 cbnz r4, 800df38 <udp_bind+0x88>
- /* place the PCB on the active list if not already there */
- pcb->next = udp_pcbs;
- udp_pcbs = pcb;
- 800df32: 4b03 ldr r3, [pc, #12] ; (800df40 <udp_bind+0x90>)
- pcb->local_port = port;
- snmp_insert_udpidx_tree(pcb);
- /* pcb not active yet? */
- if (rebind == 0) {
- /* place the PCB on the active list if not already there */
- pcb->next = udp_pcbs;
- 800df34: 60c5 str r5, [r0, #12]
- udp_pcbs = pcb;
- 800df36: 6018 str r0, [r3, #0]
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
- ("udp_bind: bound to %"U16_F".%"U16_F".%"U16_F".%"U16_F", port %"U16_F"\n",
- ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
- ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
- pcb->local_port));
- return ERR_OK;
- 800df38: 2000 movs r0, #0
- }
- 800df3a: b240 sxtb r0, r0
- 800df3c: bdf0 pop {r4, r5, r6, r7, pc}
- 800df3e: bf00 nop
- 800df40: 20008358 .word 0x20008358
- 800df44: 20000112 .word 0x20000112
- 0800df48 <udp_sendto_if>:
- * @see udp_disconnect() udp_send()
- */
- err_t
- udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
- ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif)
- {
- 800df48: e92d 47ff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, lr}
- 800df4c: 4692 mov sl, r2
- return ERR_VAL;
- }
- #endif /* IP_SOF_BROADCAST */
- /* if the PCB is not yet bound to a port, bind it here */
- if (pcb->local_port == 0) {
- 800df4e: 8a42 ldrh r2, [r0, #18]
- * @see udp_disconnect() udp_send()
- */
- err_t
- udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
- ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif)
- {
- 800df50: f8dd 8030 ldr.w r8, [sp, #48] ; 0x30
- 800df54: 4605 mov r5, r0
- 800df56: 460e mov r6, r1
- 800df58: 4699 mov r9, r3
- return ERR_VAL;
- }
- #endif /* IP_SOF_BROADCAST */
- /* if the PCB is not yet bound to a port, bind it here */
- if (pcb->local_port == 0) {
- 800df5a: b132 cbz r2, 800df6a <udp_sendto_if+0x22>
- return err;
- }
- }
- /* not enough space to add an UDP header to first pbuf in given p chain? */
- if (pbuf_header(p, UDP_HLEN)) {
- 800df5c: 4630 mov r0, r6
- 800df5e: 2108 movs r1, #8
- 800df60: f7fd fa85 bl 800b46e <pbuf_header>
- 800df64: b940 cbnz r0, 800df78 <udp_sendto_if+0x30>
- 800df66: 4634 mov r4, r6
- 800df68: e013 b.n 800df92 <udp_sendto_if+0x4a>
- #endif /* IP_SOF_BROADCAST */
- /* if the PCB is not yet bound to a port, bind it here */
- if (pcb->local_port == 0) {
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send: not yet bound to a port, binding now\n"));
- err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
- 800df6a: 4601 mov r1, r0
- 800df6c: f7ff ffa0 bl 800deb0 <udp_bind>
- if (err != ERR_OK) {
- 800df70: 4607 mov r7, r0
- 800df72: 2800 cmp r0, #0
- 800df74: d0f2 beq.n 800df5c <udp_sendto_if+0x14>
- 800df76: e048 b.n 800e00a <udp_sendto_if+0xc2>
- }
- /* not enough space to add an UDP header to first pbuf in given p chain? */
- if (pbuf_header(p, UDP_HLEN)) {
- /* allocate header in a separate new pbuf */
- q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
- 800df78: 2001 movs r0, #1
- 800df7a: 2108 movs r1, #8
- 800df7c: 2200 movs r2, #0
- 800df7e: f7fd faf2 bl 800b566 <pbuf_alloc>
- /* new header pbuf could not be allocated? */
- if (q == NULL) {
- 800df82: 4604 mov r4, r0
- 800df84: 2800 cmp r0, #0
- 800df86: d03d beq.n 800e004 <udp_sendto_if+0xbc>
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n"));
- return ERR_MEM;
- }
- if (p->tot_len != 0) {
- 800df88: 8933 ldrh r3, [r6, #8]
- 800df8a: b113 cbz r3, 800df92 <udp_sendto_if+0x4a>
- /* chain header q in front of given pbuf p (only if p contains data) */
- pbuf_chain(q, p);
- 800df8c: 4631 mov r1, r6
- 800df8e: f7fd fb90 bl 800b6b2 <pbuf_chain>
- }
- LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
- (q->len >= sizeof(struct udp_hdr)));
- /* q now represents the packet to be sent */
- udphdr = (struct udp_hdr *)q->payload;
- udphdr->src = htons(pcb->local_port);
- 800df92: 8a68 ldrh r0, [r5, #18]
- LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));
- }
- LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
- (q->len >= sizeof(struct udp_hdr)));
- /* q now represents the packet to be sent */
- udphdr = (struct udp_hdr *)q->payload;
- 800df94: 6867 ldr r7, [r4, #4]
- udphdr->src = htons(pcb->local_port);
- 800df96: f7fc f928 bl 800a1ea <lwip_htons>
- 800df9a: 8038 strh r0, [r7, #0]
- udphdr->dest = htons(dst_port);
- 800df9c: 4648 mov r0, r9
- 800df9e: f7fc f924 bl 800a1ea <lwip_htons>
- /* in UDP, 0 checksum means 'no checksum' */
- udphdr->chksum = 0x0000;
- 800dfa2: 2300 movs r3, #0
- LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
- (q->len >= sizeof(struct udp_hdr)));
- /* q now represents the packet to be sent */
- udphdr = (struct udp_hdr *)q->payload;
- udphdr->src = htons(pcb->local_port);
- udphdr->dest = htons(dst_port);
- 800dfa4: 8078 strh r0, [r7, #2]
- /* in UDP, 0 checksum means 'no checksum' */
- udphdr->chksum = 0x0000;
- 800dfa6: 71bb strb r3, [r7, #6]
- 800dfa8: 71fb strb r3, [r7, #7]
- }
- #endif /* LWIP_IGMP */
- /* PCB local address is IP_ANY_ADDR? */
- if (ip_addr_isany(&pcb->local_ip)) {
- 800dfaa: 682b ldr r3, [r5, #0]
- 800dfac: b913 cbnz r3, 800dfb4 <udp_sendto_if+0x6c>
- /* use outgoing network interface IP address as source address */
- src_ip = &(netif->ip_addr);
- 800dfae: f108 0904 add.w r9, r8, #4
- 800dfb2: e00a b.n 800dfca <udp_sendto_if+0x82>
- } else {
- /* check if UDP PCB local IP address is correct
- * this could be an old address if netif->ip_addr has changed */
- if (!ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {
- 800dfb4: f8d8 2004 ldr.w r2, [r8, #4]
- 800dfb8: 4293 cmp r3, r2
- 800dfba: d005 beq.n 800dfc8 <udp_sendto_if+0x80>
- /* local_ip doesn't match, drop the packet */
- if (q != p) {
- 800dfbc: 42b4 cmp r4, r6
- 800dfbe: d023 beq.n 800e008 <udp_sendto_if+0xc0>
- /* free the header pbuf */
- pbuf_free(q);
- 800dfc0: 4620 mov r0, r4
- 800dfc2: f7fd fa7f bl 800b4c4 <pbuf_free>
- 800dfc6: e01f b.n 800e008 <udp_sendto_if+0xc0>
- }
- #endif /* LWIP_IGMP */
- /* PCB local address is IP_ANY_ADDR? */
- if (ip_addr_isany(&pcb->local_ip)) {
- 800dfc8: 46a9 mov r9, r5
- NETIF_SET_HWADDRHINT(netif, NULL);
- } else
- #endif /* LWIP_UDPLITE */
- { /* UDP */
- LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));
- udphdr->len = htons(q->tot_len);
- 800dfca: 8920 ldrh r0, [r4, #8]
- 800dfcc: f7fc f90d bl 800a1ea <lwip_htons>
- 800dfd0: 80b8 strh r0, [r7, #4]
- #endif /* CHECKSUM_GEN_UDP */
- LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));
- LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
- /* output to IP */
- NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint);
- err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);
- 800dfd2: 7a6a ldrb r2, [r5, #9]
- 800dfd4: 7aab ldrb r3, [r5, #10]
- 800dfd6: 9200 str r2, [sp, #0]
- 800dfd8: 2211 movs r2, #17
- 800dfda: 9201 str r2, [sp, #4]
- 800dfdc: f8cd 8008 str.w r8, [sp, #8]
- 800dfe0: 4620 mov r0, r4
- 800dfe2: 4649 mov r1, r9
- 800dfe4: 4652 mov r2, sl
- 800dfe6: f000 fb8b bl 800e700 <ip_output_if>
- }
- /* TODO: must this be increased even if error occured? */
- snmp_inc_udpoutdatagrams();
- /* did we chain a separate header pbuf earlier? */
- if (q != p) {
- 800dfea: 42b4 cmp r4, r6
- #endif /* CHECKSUM_GEN_UDP */
- LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));
- LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
- /* output to IP */
- NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint);
- err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);
- 800dfec: 4607 mov r7, r0
- }
- /* TODO: must this be increased even if error occured? */
- snmp_inc_udpoutdatagrams();
- /* did we chain a separate header pbuf earlier? */
- if (q != p) {
- 800dfee: d002 beq.n 800dff6 <udp_sendto_if+0xae>
- /* free the header pbuf */
- pbuf_free(q);
- 800dff0: 4620 mov r0, r4
- 800dff2: f7fd fa67 bl 800b4c4 <pbuf_free>
- q = NULL;
- /* p is still referenced by the caller, and will live on */
- }
- UDP_STATS_INC(udp.xmit);
- 800dff6: 4b07 ldr r3, [pc, #28] ; (800e014 <udp_sendto_if+0xcc>)
- 800dff8: f8b3 2078 ldrh.w r2, [r3, #120] ; 0x78
- 800dffc: 3201 adds r2, #1
- 800dffe: f8a3 2078 strh.w r2, [r3, #120] ; 0x78
- return err;
- 800e002: e002 b.n 800e00a <udp_sendto_if+0xc2>
- /* allocate header in a separate new pbuf */
- q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
- /* new header pbuf could not be allocated? */
- if (q == NULL) {
- LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n"));
- return ERR_MEM;
- 800e004: 27ff movs r7, #255 ; 0xff
- 800e006: e000 b.n 800e00a <udp_sendto_if+0xc2>
- /* free the header pbuf */
- pbuf_free(q);
- q = NULL;
- /* p is still referenced by the caller, and will live on */
- }
- return ERR_VAL;
- 800e008: 27fa movs r7, #250 ; 0xfa
- /* p is still referenced by the caller, and will live on */
- }
- UDP_STATS_INC(udp.xmit);
- return err;
- }
- 800e00a: b278 sxtb r0, r7
- 800e00c: b004 add sp, #16
- 800e00e: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 800e012: bf00 nop
- 800e014: 20008220 .word 0x20008220
- 0800e018 <udp_connect>:
- *
- * @see udp_disconnect()
- */
- err_t
- udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- 800e018: b570 push {r4, r5, r6, lr}
- 800e01a: 4616 mov r6, r2
- struct udp_pcb *ipcb;
- if (pcb->local_port == 0) {
- 800e01c: 8a42 ldrh r2, [r0, #18]
- *
- * @see udp_disconnect()
- */
- err_t
- udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- 800e01e: 4604 mov r4, r0
- 800e020: 460d mov r5, r1
- struct udp_pcb *ipcb;
- if (pcb->local_port == 0) {
- 800e022: b10a cbz r2, 800e028 <udp_connect+0x10>
- if (err != ERR_OK) {
- return err;
- }
- }
- ip_addr_set(&pcb->remote_ip, ipaddr);
- 800e024: b935 cbnz r5, 800e034 <udp_connect+0x1c>
- 800e026: e006 b.n 800e036 <udp_connect+0x1e>
- udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
- {
- struct udp_pcb *ipcb;
- if (pcb->local_port == 0) {
- err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
- 800e028: 4601 mov r1, r0
- 800e02a: f7ff ff41 bl 800deb0 <udp_bind>
- if (err != ERR_OK) {
- 800e02e: 2800 cmp r0, #0
- 800e030: d0f8 beq.n 800e024 <udp_connect+0xc>
- 800e032: e013 b.n 800e05c <udp_connect+0x44>
- return err;
- }
- }
- ip_addr_set(&pcb->remote_ip, ipaddr);
- 800e034: 682d ldr r5, [r5, #0]
- pcb->remote_port = port;
- pcb->flags |= UDP_FLAGS_CONNECTED;
- 800e036: 7c23 ldrb r3, [r4, #16]
- ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
- ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
- pcb->local_port));
- /* Insert UDP PCB into the list of active UDP PCBs. */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800e038: 4a09 ldr r2, [pc, #36] ; (800e060 <udp_connect+0x48>)
- if (err != ERR_OK) {
- return err;
- }
- }
- ip_addr_set(&pcb->remote_ip, ipaddr);
- 800e03a: 6065 str r5, [r4, #4]
- pcb->remote_port = port;
- pcb->flags |= UDP_FLAGS_CONNECTED;
- 800e03c: f043 0304 orr.w r3, r3, #4
- 800e040: 7423 strb r3, [r4, #16]
- ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
- ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
- pcb->local_port));
- /* Insert UDP PCB into the list of active UDP PCBs. */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800e042: 6813 ldr r3, [r2, #0]
- return err;
- }
- }
- ip_addr_set(&pcb->remote_ip, ipaddr);
- pcb->remote_port = port;
- 800e044: 82a6 strh r6, [r4, #20]
- ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
- ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
- pcb->local_port));
- /* Insert UDP PCB into the list of active UDP PCBs. */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800e046: 4618 mov r0, r3
- 800e048: e002 b.n 800e050 <udp_connect+0x38>
- if (pcb == ipcb) {
- 800e04a: 4284 cmp r4, r0
- 800e04c: d005 beq.n 800e05a <udp_connect+0x42>
- ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
- ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
- pcb->local_port));
- /* Insert UDP PCB into the list of active UDP PCBs. */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- 800e04e: 68c0 ldr r0, [r0, #12]
- 800e050: 2800 cmp r0, #0
- 800e052: d1fa bne.n 800e04a <udp_connect+0x32>
- /* already on the list, just return */
- return ERR_OK;
- }
- }
- /* PCB not yet on the list, add PCB now */
- pcb->next = udp_pcbs;
- 800e054: 60e3 str r3, [r4, #12]
- udp_pcbs = pcb;
- 800e056: 6014 str r4, [r2, #0]
- return ERR_OK;
- 800e058: e000 b.n 800e05c <udp_connect+0x44>
- /* Insert UDP PCB into the list of active UDP PCBs. */
- for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
- if (pcb == ipcb) {
- /* already on the list, just return */
- return ERR_OK;
- 800e05a: 2000 movs r0, #0
- }
- /* PCB not yet on the list, add PCB now */
- pcb->next = udp_pcbs;
- udp_pcbs = pcb;
- return ERR_OK;
- }
- 800e05c: b240 sxtb r0, r0
- 800e05e: bd70 pop {r4, r5, r6, pc}
- 800e060: 20008358 .word 0x20008358
- 0800e064 <udp_recv>:
- */
- void
- udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg)
- {
- /* remember recv() callback and user data */
- pcb->recv = recv;
- 800e064: 6181 str r1, [r0, #24]
- pcb->recv_arg = recv_arg;
- 800e066: 61c2 str r2, [r0, #28]
- 800e068: 4770 bx lr
- 800e06a: 0000 movs r0, r0
- 0800e06c <udp_remove>:
- {
- struct udp_pcb *pcb2;
- snmp_delete_udpidx_tree(pcb);
- /* pcb to be removed is first in list? */
- if (udp_pcbs == pcb) {
- 800e06c: 4a09 ldr r2, [pc, #36] ; (800e094 <udp_remove+0x28>)
- 800e06e: 6813 ldr r3, [r2, #0]
- 800e070: 4283 cmp r3, r0
- *
- * @see udp_new()
- */
- void
- udp_remove(struct udp_pcb *pcb)
- {
- 800e072: 4601 mov r1, r0
- struct udp_pcb *pcb2;
- snmp_delete_udpidx_tree(pcb);
- /* pcb to be removed is first in list? */
- if (udp_pcbs == pcb) {
- 800e074: d109 bne.n 800e08a <udp_remove+0x1e>
- /* make list start at 2nd pcb */
- udp_pcbs = udp_pcbs->next;
- 800e076: 68c3 ldr r3, [r0, #12]
- 800e078: 6013 str r3, [r2, #0]
- 800e07a: e008 b.n 800e08e <udp_remove+0x22>
- /* pcb not 1st in list */
- } else {
- for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
- /* find pcb in udp_pcbs list */
- if (pcb2->next != NULL && pcb2->next == pcb) {
- 800e07c: 68da ldr r2, [r3, #12]
- 800e07e: b11a cbz r2, 800e088 <udp_remove+0x1c>
- 800e080: 428a cmp r2, r1
- /* remove pcb from list */
- pcb2->next = pcb->next;
- 800e082: bf04 itt eq
- 800e084: 68ca ldreq r2, [r1, #12]
- 800e086: 60da streq r2, [r3, #12]
- if (udp_pcbs == pcb) {
- /* make list start at 2nd pcb */
- udp_pcbs = udp_pcbs->next;
- /* pcb not 1st in list */
- } else {
- for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
- 800e088: 68db ldr r3, [r3, #12]
- 800e08a: 2b00 cmp r3, #0
- 800e08c: d1f6 bne.n 800e07c <udp_remove+0x10>
- /* remove pcb from list */
- pcb2->next = pcb->next;
- }
- }
- }
- memp_free(MEMP_UDP_PCB, pcb);
- 800e08e: 2001 movs r0, #1
- 800e090: f7fd b920 b.w 800b2d4 <memp_free>
- 800e094: 20008358 .word 0x20008358
- 0800e098 <udp_new>:
- *
- * @see udp_remove()
- */
- struct udp_pcb *
- udp_new(void)
- {
- 800e098: b510 push {r4, lr}
- struct udp_pcb *pcb;
- pcb = (struct udp_pcb *)memp_malloc(MEMP_UDP_PCB);
- 800e09a: 2001 movs r0, #1
- 800e09c: f7fd f8f0 bl 800b280 <memp_malloc>
- /* could allocate UDP PCB? */
- if (pcb != NULL) {
- 800e0a0: 4604 mov r4, r0
- 800e0a2: b128 cbz r0, 800e0b0 <udp_new+0x18>
- /* UDP Lite: by initializing to all zeroes, chksum_len is set to 0
- * which means checksum is generated over the whole datagram per default
- * (recommended as default by RFC 3828). */
- /* initialize PCB to all zeroes */
- memset(pcb, 0, sizeof(struct udp_pcb));
- 800e0a4: 2100 movs r1, #0
- 800e0a6: 2220 movs r2, #32
- 800e0a8: f7fb fa66 bl 8009578 <memset>
- pcb->ttl = UDP_TTL;
- 800e0ac: 23ff movs r3, #255 ; 0xff
- 800e0ae: 72a3 strb r3, [r4, #10]
- }
- return pcb;
- }
- 800e0b0: 4620 mov r0, r4
- 800e0b2: bd10 pop {r4, pc}
- 0800e0b4 <icmp_send_response>:
- * @param type Type of the ICMP header
- * @param code Code of the ICMP header
- */
- static void
- icmp_send_response(struct pbuf *p, u8_t type, u8_t code)
- {
- 800e0b4: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
- 800e0b8: 4607 mov r7, r0
- 800e0ba: b085 sub sp, #20
- 800e0bc: 4689 mov r9, r1
- 800e0be: 4615 mov r5, r2
- /* we can use the echo header here */
- struct icmp_echo_hdr *icmphdr;
- ip_addr_t iphdr_src;
- /* ICMP header + IP header + 8 bytes of data */
- q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE,
- 800e0c0: 2001 movs r0, #1
- 800e0c2: 2124 movs r1, #36 ; 0x24
- 800e0c4: 2200 movs r2, #0
- 800e0c6: f7fd fa4e bl 800b566 <pbuf_alloc>
- PBUF_RAM);
- if (q == NULL) {
- 800e0ca: 4606 mov r6, r0
- 800e0cc: b368 cbz r0, 800e12a <icmp_send_response+0x76>
- ip_addr_debug_print(ICMP_DEBUG, &(iphdr->src));
- LWIP_DEBUGF(ICMP_DEBUG, (" to "));
- ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
- LWIP_DEBUGF(ICMP_DEBUG, ("\n"));
- icmphdr = (struct icmp_echo_hdr *)q->payload;
- 800e0ce: 6844 ldr r4, [r0, #4]
- return;
- }
- LWIP_ASSERT("check that first pbuf can hold icmp message",
- (q->len >= (sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE)));
- iphdr = (struct ip_hdr *)p->payload;
- 800e0d0: f8d7 8004 ldr.w r8, [r7, #4]
- ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
- LWIP_DEBUGF(ICMP_DEBUG, ("\n"));
- icmphdr = (struct icmp_echo_hdr *)q->payload;
- icmphdr->type = type;
- icmphdr->code = code;
- 800e0d4: 7065 strb r5, [r4, #1]
- icmphdr->id = 0;
- 800e0d6: 2500 movs r5, #0
- LWIP_DEBUGF(ICMP_DEBUG, (" to "));
- ip_addr_debug_print(ICMP_DEBUG, &(iphdr->dest));
- LWIP_DEBUGF(ICMP_DEBUG, ("\n"));
- icmphdr = (struct icmp_echo_hdr *)q->payload;
- icmphdr->type = type;
- 800e0d8: f884 9000 strb.w r9, [r4]
- icmphdr->code = code;
- icmphdr->id = 0;
- 800e0dc: 7125 strb r5, [r4, #4]
- 800e0de: 7165 strb r5, [r4, #5]
- icmphdr->seqno = 0;
- 800e0e0: 71a5 strb r5, [r4, #6]
- 800e0e2: 71e5 strb r5, [r4, #7]
- /* copy fields from original packet */
- SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_echo_hdr), (u8_t *)p->payload,
- 800e0e4: 6840 ldr r0, [r0, #4]
- 800e0e6: 6879 ldr r1, [r7, #4]
- 800e0e8: 221c movs r2, #28
- 800e0ea: 3008 adds r0, #8
- 800e0ec: f7fb f98a bl 8009404 <memcpy>
- IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);
- /* calculate checksum */
- icmphdr->chksum = 0;
- 800e0f0: 70a5 strb r5, [r4, #2]
- 800e0f2: 70e5 strb r5, [r4, #3]
- icmphdr->chksum = inet_chksum(icmphdr, q->len);
- 800e0f4: 8971 ldrh r1, [r6, #10]
- 800e0f6: 4620 mov r0, r4
- 800e0f8: f000 f919 bl 800e32e <inet_chksum>
- ICMP_STATS_INC(icmp.xmit);
- 800e0fc: 4b0c ldr r3, [pc, #48] ; (800e130 <icmp_send_response+0x7c>)
- SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_echo_hdr), (u8_t *)p->payload,
- IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);
- /* calculate checksum */
- icmphdr->chksum = 0;
- icmphdr->chksum = inet_chksum(icmphdr, q->len);
- 800e0fe: 8060 strh r0, [r4, #2]
- ICMP_STATS_INC(icmp.xmit);
- 800e100: f8b3 2060 ldrh.w r2, [r3, #96] ; 0x60
- 800e104: 3201 adds r2, #1
- 800e106: f8a3 2060 strh.w r2, [r3, #96] ; 0x60
- /* increase number of messages attempted to send */
- snmp_inc_icmpoutmsgs();
- /* increase number of destination unreachable messages attempted to send */
- snmp_inc_icmpouttimeexcds();
- ip_addr_copy(iphdr_src, iphdr->src);
- 800e10a: f8d8 300c ldr.w r3, [r8, #12]
- 800e10e: aa04 add r2, sp, #16
- ip_output(q, NULL, &iphdr_src, ICMP_TTL, 0, IP_PROTO_ICMP);
- 800e110: 4630 mov r0, r6
- ICMP_STATS_INC(icmp.xmit);
- /* increase number of messages attempted to send */
- snmp_inc_icmpoutmsgs();
- /* increase number of destination unreachable messages attempted to send */
- snmp_inc_icmpouttimeexcds();
- ip_addr_copy(iphdr_src, iphdr->src);
- 800e112: f842 3d04 str.w r3, [r2, #-4]!
- ip_output(q, NULL, &iphdr_src, ICMP_TTL, 0, IP_PROTO_ICMP);
- 800e116: 2301 movs r3, #1
- 800e118: 9301 str r3, [sp, #4]
- 800e11a: 9500 str r5, [sp, #0]
- 800e11c: 4629 mov r1, r5
- 800e11e: 23ff movs r3, #255 ; 0xff
- 800e120: f000 fb54 bl 800e7cc <ip_output>
- pbuf_free(q);
- 800e124: 4630 mov r0, r6
- 800e126: f7fd f9cd bl 800b4c4 <pbuf_free>
- }
- 800e12a: b005 add sp, #20
- 800e12c: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
- 800e130: 20008220 .word 0x20008220
- 0800e134 <icmp_input>:
- * @param p the icmp echo request packet, p->payload pointing to the ip header
- * @param inp the netif on which this packet was received
- */
- void
- icmp_input(struct pbuf *p, struct netif *inp)
- {
- 800e134: e92d 47ff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, lr}
- #endif /* LWIP_DEBUG */
- struct icmp_echo_hdr *iecho;
- struct ip_hdr *iphdr;
- s16_t hlen;
- ICMP_STATS_INC(icmp.recv);
- 800e138: 4d60 ldr r5, [pc, #384] ; (800e2bc <icmp_input+0x188>)
- snmp_inc_icmpinmsgs();
- iphdr = (struct ip_hdr *)p->payload;
- 800e13a: 6846 ldr r6, [r0, #4]
- #endif /* LWIP_DEBUG */
- struct icmp_echo_hdr *iecho;
- struct ip_hdr *iphdr;
- s16_t hlen;
- ICMP_STATS_INC(icmp.recv);
- 800e13c: f8b5 3062 ldrh.w r3, [r5, #98] ; 0x62
- 800e140: 3301 adds r3, #1
- 800e142: f8a5 3062 strh.w r3, [r5, #98] ; 0x62
- snmp_inc_icmpinmsgs();
- iphdr = (struct ip_hdr *)p->payload;
- hlen = IPH_HL(iphdr) * 4;
- 800e146: f896 8000 ldrb.w r8, [r6]
- 800e14a: f008 080f and.w r8, r8, #15
- 800e14e: ea4f 0888 mov.w r8, r8, lsl #2
- if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
- 800e152: f1c8 0900 rsb r9, r8, #0
- * @param p the icmp echo request packet, p->payload pointing to the ip header
- * @param inp the netif on which this packet was received
- */
- void
- icmp_input(struct pbuf *p, struct netif *inp)
- {
- 800e156: 460f mov r7, r1
- snmp_inc_icmpinmsgs();
- iphdr = (struct ip_hdr *)p->payload;
- hlen = IPH_HL(iphdr) * 4;
- if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
- 800e158: fa0f f189 sxth.w r1, r9
- * @param p the icmp echo request packet, p->payload pointing to the ip header
- * @param inp the netif on which this packet was received
- */
- void
- icmp_input(struct pbuf *p, struct netif *inp)
- {
- 800e15c: 4604 mov r4, r0
- snmp_inc_icmpinmsgs();
- iphdr = (struct ip_hdr *)p->payload;
- hlen = IPH_HL(iphdr) * 4;
- if (pbuf_header(p, -hlen) || (p->tot_len < sizeof(u16_t)*2)) {
- 800e15e: f7fd f986 bl 800b46e <pbuf_header>
- 800e162: 2800 cmp r0, #0
- 800e164: f040 8093 bne.w 800e28e <icmp_input+0x15a>
- 800e168: 8923 ldrh r3, [r4, #8]
- 800e16a: 2b03 cmp r3, #3
- 800e16c: f240 808f bls.w 800e28e <icmp_input+0x15a>
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: short ICMP (%"U16_F" bytes) received\n", p->tot_len));
- goto lenerr;
- }
- type = *((u8_t *)p->payload);
- 800e170: 6863 ldr r3, [r4, #4]
- #ifdef LWIP_DEBUG
- code = *(((u8_t *)p->payload)+1);
- #endif /* LWIP_DEBUG */
- switch (type) {
- 800e172: 781b ldrb r3, [r3, #0]
- 800e174: 2b00 cmp r3, #0
- 800e176: f000 8084 beq.w 800e282 <icmp_input+0x14e>
- 800e17a: 2b08 cmp r3, #8
- 800e17c: d177 bne.n 800e26e <icmp_input+0x13a>
- #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING
- {
- int accepted = 1;
- #if !LWIP_MULTICAST_PING
- /* multicast destination address? */
- if (ip_addr_ismulticast(¤t_iphdr_dest)) {
- 800e17e: 4b50 ldr r3, [pc, #320] ; (800e2c0 <icmp_input+0x18c>)
- 800e180: f8d3 a000 ldr.w sl, [r3]
- accepted = 0;
- }
- #endif /* LWIP_MULTICAST_PING */
- #if !LWIP_BROADCAST_PING
- /* broadcast destination address? */
- if (ip_addr_isbroadcast(¤t_iphdr_dest, inp)) {
- 800e184: 4639 mov r1, r7
- 800e186: 4650 mov r0, sl
- 800e188: f000 f8fb bl 800e382 <ip4_addr_isbroadcast>
- 800e18c: b920 cbnz r0, 800e198 <icmp_input+0x64>
- #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING
- {
- int accepted = 1;
- #if !LWIP_MULTICAST_PING
- /* multicast destination address? */
- if (ip_addr_ismulticast(¤t_iphdr_dest)) {
- 800e18e: f00a 0af0 and.w sl, sl, #240 ; 0xf0
- if (ip_addr_isbroadcast(¤t_iphdr_dest, inp)) {
- accepted = 0;
- }
- #endif /* LWIP_BROADCAST_PING */
- /* broadcast or multicast destination address not acceptd? */
- if (!accepted) {
- 800e192: f1ba 0fe0 cmp.w sl, #224 ; 0xe0
- 800e196: d106 bne.n 800e1a6 <icmp_input+0x72>
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast or broadcast pings\n"));
- ICMP_STATS_INC(icmp.err);
- 800e198: 4b48 ldr r3, [pc, #288] ; (800e2bc <icmp_input+0x188>)
- 800e19a: f8b3 2074 ldrh.w r2, [r3, #116] ; 0x74
- 800e19e: 3201 adds r2, #1
- 800e1a0: f8a3 2074 strh.w r2, [r3, #116] ; 0x74
- 800e1a4: e06d b.n 800e282 <icmp_input+0x14e>
- return;
- }
- }
- #endif /* !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING */
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n"));
- if (p->tot_len < sizeof(struct icmp_echo_hdr)) {
- 800e1a6: 8923 ldrh r3, [r4, #8]
- 800e1a8: 2b07 cmp r3, #7
- 800e1aa: d970 bls.n 800e28e <icmp_input+0x15a>
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
- goto lenerr;
- }
- if (inet_chksum_pbuf(p) != 0) {
- 800e1ac: 4620 mov r0, r4
- 800e1ae: f000 f8c4 bl 800e33a <inet_chksum_pbuf>
- 800e1b2: b140 cbz r0, 800e1c6 <icmp_input+0x92>
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n"));
- pbuf_free(p);
- 800e1b4: 4620 mov r0, r4
- 800e1b6: f7fd f985 bl 800b4c4 <pbuf_free>
- ICMP_STATS_INC(icmp.chkerr);
- 800e1ba: f8b5 3068 ldrh.w r3, [r5, #104] ; 0x68
- 800e1be: 3301 adds r3, #1
- 800e1c0: f8a5 3068 strh.w r3, [r5, #104] ; 0x68
- snmp_inc_icmpinerrors();
- return;
- 800e1c4: e076 b.n 800e2b4 <icmp_input+0x180>
- }
- #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
- if (pbuf_header(p, (PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
- 800e1c6: 4620 mov r0, r4
- 800e1c8: 2122 movs r1, #34 ; 0x22
- ICMP_STATS_INC(icmp.recv);
- snmp_inc_icmpinmsgs();
- iphdr = (struct ip_hdr *)p->payload;
- hlen = IPH_HL(iphdr) * 4;
- 800e1ca: fa1f f888 uxth.w r8, r8
- ICMP_STATS_INC(icmp.chkerr);
- snmp_inc_icmpinerrors();
- return;
- }
- #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
- if (pbuf_header(p, (PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
- 800e1ce: f7fd f94e bl 800b46e <pbuf_header>
- 800e1d2: b1f8 cbz r0, 800e214 <icmp_input+0xe0>
- /* p is not big enough to contain link headers
- * allocate a new one and copy p into it
- */
- struct pbuf *r;
- /* switch p->payload to ip header */
- if (pbuf_header(p, hlen)) {
- 800e1d4: 4620 mov r0, r4
- 800e1d6: 4641 mov r1, r8
- 800e1d8: f7fd f949 bl 800b46e <pbuf_header>
- 800e1dc: 2800 cmp r0, #0
- 800e1de: d160 bne.n 800e2a2 <icmp_input+0x16e>
- LWIP_ASSERT("icmp_input: moving p->payload to ip header failed\n", 0);
- goto memerr;
- }
- /* allocate new packet buffer with space for link headers */
- r = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM);
- 800e1e0: 2002 movs r0, #2
- 800e1e2: 8921 ldrh r1, [r4, #8]
- 800e1e4: 2200 movs r2, #0
- 800e1e6: f7fd f9be bl 800b566 <pbuf_alloc>
- if (r == NULL) {
- 800e1ea: 4605 mov r5, r0
- 800e1ec: 2800 cmp r0, #0
- 800e1ee: d058 beq.n 800e2a2 <icmp_input+0x16e>
- goto memerr;
- }
- LWIP_ASSERT("check that first pbuf can hold struct the ICMP header",
- (r->len >= hlen + sizeof(struct icmp_echo_hdr)));
- /* copy the whole packet including ip header */
- if (pbuf_copy(r, p) != ERR_OK) {
- 800e1f0: 4621 mov r1, r4
- 800e1f2: f7fd fa67 bl 800b6c4 <pbuf_copy>
- 800e1f6: 2800 cmp r0, #0
- 800e1f8: d153 bne.n 800e2a2 <icmp_input+0x16e>
- LWIP_ASSERT("icmp_input: copying to new pbuf failed\n", 0);
- goto memerr;
- }
- iphdr = (struct ip_hdr *)r->payload;
- /* switch r->payload back to icmp header */
- if (pbuf_header(r, -hlen)) {
- 800e1fa: 4628 mov r0, r5
- 800e1fc: fa0f f189 sxth.w r1, r9
- /* copy the whole packet including ip header */
- if (pbuf_copy(r, p) != ERR_OK) {
- LWIP_ASSERT("icmp_input: copying to new pbuf failed\n", 0);
- goto memerr;
- }
- iphdr = (struct ip_hdr *)r->payload;
- 800e200: 686e ldr r6, [r5, #4]
- /* switch r->payload back to icmp header */
- if (pbuf_header(r, -hlen)) {
- 800e202: f7fd f934 bl 800b46e <pbuf_header>
- 800e206: 2800 cmp r0, #0
- 800e208: d14b bne.n 800e2a2 <icmp_input+0x16e>
- LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0);
- goto memerr;
- }
- /* free the original p */
- pbuf_free(p);
- 800e20a: 4620 mov r0, r4
- 800e20c: f7fd f95a bl 800b4c4 <pbuf_free>
- 800e210: 462c mov r4, r5
- 800e212: e006 b.n 800e222 <icmp_input+0xee>
- /* we now have an identical copy of p that has room for link headers */
- p = r;
- } else {
- /* restore p->payload to point to icmp header */
- if (pbuf_header(p, -(s16_t)(PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
- 800e214: 4620 mov r0, r4
- 800e216: f06f 0121 mvn.w r1, #33 ; 0x21
- 800e21a: f7fd f928 bl 800b46e <pbuf_header>
- 800e21e: 2800 cmp r0, #0
- 800e220: d13f bne.n 800e2a2 <icmp_input+0x16e>
- #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
- /* At this point, all checks are OK. */
- /* We generate an answer by switching the dest and src ip addresses,
- * setting the icmp type to ECHO_RESPONSE and updating the checksum. */
- iecho = (struct icmp_echo_hdr *)p->payload;
- ip_addr_copy(iphdr->src, *ip_current_dest_addr());
- 800e222: f8df 909c ldr.w r9, [pc, #156] ; 800e2c0 <icmp_input+0x18c>
- }
- #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
- /* At this point, all checks are OK. */
- /* We generate an answer by switching the dest and src ip addresses,
- * setting the icmp type to ECHO_RESPONSE and updating the checksum. */
- iecho = (struct icmp_echo_hdr *)p->payload;
- 800e226: 6863 ldr r3, [r4, #4]
- ip_addr_copy(iphdr->src, *ip_current_dest_addr());
- 800e228: f8d9 2000 ldr.w r2, [r9]
- 800e22c: 60f2 str r2, [r6, #12]
- ip_addr_copy(iphdr->dest, *ip_current_src_addr());
- 800e22e: 4a25 ldr r2, [pc, #148] ; (800e2c4 <icmp_input+0x190>)
- 800e230: 6812 ldr r2, [r2, #0]
- 800e232: 6132 str r2, [r6, #16]
- ICMPH_TYPE_SET(iecho, ICMP_ER);
- 800e234: 2200 movs r2, #0
- 800e236: 701a strb r2, [r3, #0]
- //-----------------------------------------------------------
- // Добавил фикс 15.08.15.
- // Фикс исправляет баг с пингом.
- #ifdef CHECKSUM_BY_HARDWARE
- iecho->chksum = 0;
- 800e238: 709a strb r2, [r3, #2]
- 800e23a: 70da strb r2, [r3, #3]
- #else // CHECKSUM_GEN_ICMP
- iecho->chksum = 0;
- #endif // CHECKSUM_GEN_ICMP
- */
- /* Set the correct TTL and recalculate the header checksum. */
- IPH_TTL_SET(iphdr, ICMP_TTL);
- 800e23c: 25ff movs r5, #255 ; 0xff
- IPH_CHKSUM_SET(iphdr, 0);
- #if CHECKSUM_GEN_IP
- IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
- #endif /* CHECKSUM_GEN_IP */
- ICMP_STATS_INC(icmp.xmit);
- 800e23e: 4b1f ldr r3, [pc, #124] ; (800e2bc <icmp_input+0x188>)
- #else // CHECKSUM_GEN_ICMP
- iecho->chksum = 0;
- #endif // CHECKSUM_GEN_ICMP
- */
- /* Set the correct TTL and recalculate the header checksum. */
- IPH_TTL_SET(iphdr, ICMP_TTL);
- 800e240: 7235 strb r5, [r6, #8]
- IPH_CHKSUM_SET(iphdr, 0);
- 800e242: 72b2 strb r2, [r6, #10]
- 800e244: 72f2 strb r2, [r6, #11]
- #if CHECKSUM_GEN_IP
- IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
- #endif /* CHECKSUM_GEN_IP */
- ICMP_STATS_INC(icmp.xmit);
- 800e246: f8b3 2060 ldrh.w r2, [r3, #96] ; 0x60
- /* increase number of messages attempted to send */
- snmp_inc_icmpoutmsgs();
- /* increase number of echo replies attempted to send */
- snmp_inc_icmpoutechoreps();
- if(pbuf_header(p, hlen)) {
- 800e24a: 4620 mov r0, r4
- IPH_CHKSUM_SET(iphdr, 0);
- #if CHECKSUM_GEN_IP
- IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
- #endif /* CHECKSUM_GEN_IP */
- ICMP_STATS_INC(icmp.xmit);
- 800e24c: 3201 adds r2, #1
- /* increase number of messages attempted to send */
- snmp_inc_icmpoutmsgs();
- /* increase number of echo replies attempted to send */
- snmp_inc_icmpoutechoreps();
- if(pbuf_header(p, hlen)) {
- 800e24e: 4641 mov r1, r8
- IPH_CHKSUM_SET(iphdr, 0);
- #if CHECKSUM_GEN_IP
- IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
- #endif /* CHECKSUM_GEN_IP */
- ICMP_STATS_INC(icmp.xmit);
- 800e250: f8a3 2060 strh.w r2, [r3, #96] ; 0x60
- /* increase number of messages attempted to send */
- snmp_inc_icmpoutmsgs();
- /* increase number of echo replies attempted to send */
- snmp_inc_icmpoutechoreps();
- if(pbuf_header(p, hlen)) {
- 800e254: f7fd f90b bl 800b46e <pbuf_header>
- 800e258: 4602 mov r2, r0
- 800e25a: b990 cbnz r0, 800e282 <icmp_input+0x14e>
- LWIP_ASSERT("Can't move over header in packet", 0);
- } else {
- err_t ret;
- /* send an ICMP packet, src addr is the dest addr of the curren packet */
- ret = ip_output_if(p, ip_current_dest_addr(), IP_HDRINCL,
- 800e25c: 2301 movs r3, #1
- 800e25e: e88d 0089 stmia.w sp, {r0, r3, r7}
- 800e262: 4620 mov r0, r4
- 800e264: 4649 mov r1, r9
- 800e266: 462b mov r3, r5
- 800e268: f000 fa4a bl 800e700 <ip_output_if>
- 800e26c: e009 b.n 800e282 <icmp_input+0x14e>
- }
- break;
- default:
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n",
- (s16_t)type, (s16_t)code));
- ICMP_STATS_INC(icmp.proterr);
- 800e26e: f8b5 3070 ldrh.w r3, [r5, #112] ; 0x70
- 800e272: 3301 adds r3, #1
- 800e274: f8a5 3070 strh.w r3, [r5, #112] ; 0x70
- ICMP_STATS_INC(icmp.drop);
- 800e278: f8b5 3066 ldrh.w r3, [r5, #102] ; 0x66
- 800e27c: 3301 adds r3, #1
- 800e27e: f8a5 3066 strh.w r3, [r5, #102] ; 0x66
- }
- pbuf_free(p);
- 800e282: 4620 mov r0, r4
- pbuf_free(p);
- ICMP_STATS_INC(icmp.err);
- snmp_inc_icmpinerrors();
- return;
- #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
- }
- 800e284: b004 add sp, #16
- 800e286: e8bd 47f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
- LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n",
- (s16_t)type, (s16_t)code));
- ICMP_STATS_INC(icmp.proterr);
- ICMP_STATS_INC(icmp.drop);
- }
- pbuf_free(p);
- 800e28a: f7fd b91b b.w 800b4c4 <pbuf_free>
- return;
- lenerr:
- pbuf_free(p);
- 800e28e: 4620 mov r0, r4
- 800e290: f7fd f918 bl 800b4c4 <pbuf_free>
- ICMP_STATS_INC(icmp.lenerr);
- 800e294: 4b09 ldr r3, [pc, #36] ; (800e2bc <icmp_input+0x188>)
- 800e296: f8b3 206a ldrh.w r2, [r3, #106] ; 0x6a
- 800e29a: 3201 adds r2, #1
- 800e29c: f8a3 206a strh.w r2, [r3, #106] ; 0x6a
- snmp_inc_icmpinerrors();
- return;
- 800e2a0: e008 b.n 800e2b4 <icmp_input+0x180>
- #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
- memerr:
- pbuf_free(p);
- 800e2a2: 4620 mov r0, r4
- 800e2a4: f7fd f90e bl 800b4c4 <pbuf_free>
- ICMP_STATS_INC(icmp.err);
- 800e2a8: 4b04 ldr r3, [pc, #16] ; (800e2bc <icmp_input+0x188>)
- 800e2aa: f8b3 2074 ldrh.w r2, [r3, #116] ; 0x74
- 800e2ae: 3201 adds r2, #1
- 800e2b0: f8a3 2074 strh.w r2, [r3, #116] ; 0x74
- snmp_inc_icmpinerrors();
- return;
- #endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */
- }
- 800e2b4: b004 add sp, #16
- 800e2b6: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
- 800e2ba: bf00 nop
- 800e2bc: 20008220 .word 0x20008220
- 800e2c0: 20008364 .word 0x20008364
- 800e2c4: 2000835c .word 0x2000835c
- 0800e2c8 <icmp_dest_unreach>:
- * p->payload pointing to the IP header
- * @param t type of the 'unreachable' packet
- */
- void
- icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)
- {
- 800e2c8: 460a mov r2, r1
- icmp_send_response(p, ICMP_DUR, t);
- 800e2ca: 2103 movs r1, #3
- 800e2cc: f7ff bef2 b.w 800e0b4 <icmp_send_response>
- 0800e2d0 <icmp_time_exceeded>:
- * p->payload pointing to the IP header
- * @param t type of the 'time exceeded' packet
- */
- void
- icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)
- {
- 800e2d0: 460a mov r2, r1
- icmp_send_response(p, ICMP_TE, t);
- 800e2d2: 210b movs r1, #11
- 800e2d4: f7ff beee b.w 800e0b4 <icmp_send_response>
- 0800e2d8 <lwip_standard_chksum>:
- * @return host order (!) lwip checksum (non-inverted Internet sum)
- */
- static u16_t
- lwip_standard_chksum(void *dataptr, int len)
- {
- 800e2d8: b513 push {r0, r1, r4, lr}
- u8_t *pb = (u8_t *)dataptr;
- u16_t *ps, t = 0;
- 800e2da: 2300 movs r3, #0
- u32_t sum = 0;
- int odd = ((mem_ptr_t)pb & 1);
- /* Get aligned to u16_t */
- if (odd && len > 0) {
- 800e2dc: f010 0201 ands.w r2, r0, #1
- static u16_t
- lwip_standard_chksum(void *dataptr, int len)
- {
- u8_t *pb = (u8_t *)dataptr;
- u16_t *ps, t = 0;
- 800e2e0: f8ad 3006 strh.w r3, [sp, #6]
- u32_t sum = 0;
- int odd = ((mem_ptr_t)pb & 1);
- /* Get aligned to u16_t */
- if (odd && len > 0) {
- 800e2e4: d006 beq.n 800e2f4 <lwip_standard_chksum+0x1c>
- 800e2e6: 4299 cmp r1, r3
- 800e2e8: dd04 ble.n 800e2f4 <lwip_standard_chksum+0x1c>
- ((u8_t *)&t)[1] = *pb++;
- 800e2ea: f810 3b01 ldrb.w r3, [r0], #1
- len--;
- 800e2ee: 3901 subs r1, #1
- u32_t sum = 0;
- int odd = ((mem_ptr_t)pb & 1);
- /* Get aligned to u16_t */
- if (odd && len > 0) {
- ((u8_t *)&t)[1] = *pb++;
- 800e2f0: f88d 3007 strb.w r3, [sp, #7]
- static u16_t
- lwip_standard_chksum(void *dataptr, int len)
- {
- u8_t *pb = (u8_t *)dataptr;
- u16_t *ps, t = 0;
- u32_t sum = 0;
- 800e2f4: 2300 movs r3, #0
- len--;
- }
- /* Add the bulk of the data */
- ps = (u16_t *)(void *)pb;
- while (len > 1) {
- 800e2f6: e003 b.n 800e300 <lwip_standard_chksum+0x28>
- sum += *ps++;
- 800e2f8: f830 4b02 ldrh.w r4, [r0], #2
- len -= 2;
- 800e2fc: 3902 subs r1, #2
- }
- /* Add the bulk of the data */
- ps = (u16_t *)(void *)pb;
- while (len > 1) {
- sum += *ps++;
- 800e2fe: 191b adds r3, r3, r4
- len--;
- }
- /* Add the bulk of the data */
- ps = (u16_t *)(void *)pb;
- while (len > 1) {
- 800e300: 2901 cmp r1, #1
- 800e302: dcf9 bgt.n 800e2f8 <lwip_standard_chksum+0x20>
- len -= 2;
- }
- /* Consume left-over byte, if any */
- if (len > 0) {
- ((u8_t *)&t)[0] = *(u8_t *)ps;
- 800e304: bf04 itt eq
- 800e306: 7801 ldrbeq r1, [r0, #0]
- 800e308: f88d 1006 strbeq.w r1, [sp, #6]
- }
- /* Add end bytes */
- sum += t;
- 800e30c: f8bd 0006 ldrh.w r0, [sp, #6]
- 800e310: 181b adds r3, r3, r0
- /* Fold 32-bit sum to 16 bits
- calling this twice is propably faster than if statements... */
- sum = FOLD_U32T(sum);
- 800e312: b298 uxth r0, r3
- 800e314: eb00 4313 add.w r3, r0, r3, lsr #16
- sum = FOLD_U32T(sum);
- 800e318: b298 uxth r0, r3
- 800e31a: eb00 4013 add.w r0, r0, r3, lsr #16
- /* Swap if alignment was odd */
- if (odd) {
- 800e31e: b122 cbz r2, 800e32a <lwip_standard_chksum+0x52>
- sum = SWAP_BYTES_IN_WORD(sum);
- 800e320: 0603 lsls r3, r0, #24
- 800e322: f3c0 2007 ubfx r0, r0, #8, #8
- 800e326: ea40 4013 orr.w r0, r0, r3, lsr #16
- }
- return (u16_t)sum;
- }
- 800e32a: b280 uxth r0, r0
- 800e32c: bd1c pop {r2, r3, r4, pc}
- 0800e32e <inet_chksum>:
- * @return checksum (as u16_t) to be saved directly in the protocol header
- */
- u16_t
- inet_chksum(void *dataptr, u16_t len)
- {
- 800e32e: b508 push {r3, lr}
- return ~LWIP_CHKSUM(dataptr, len);
- 800e330: f7ff ffd2 bl 800e2d8 <lwip_standard_chksum>
- 800e334: 43c0 mvns r0, r0
- }
- 800e336: b280 uxth r0, r0
- 800e338: bd08 pop {r3, pc}
- 0800e33a <inet_chksum_pbuf>:
- * @param p pbuf chain over that the checksum should be calculated
- * @return checksum (as u16_t) to be saved directly in the protocol header
- */
- u16_t
- inet_chksum_pbuf(struct pbuf *p)
- {
- 800e33a: b570 push {r4, r5, r6, lr}
- u32_t acc;
- struct pbuf *q;
- u8_t swapped;
- acc = 0;
- swapped = 0;
- 800e33c: 2600 movs r6, #0
- * @param p pbuf chain over that the checksum should be calculated
- * @return checksum (as u16_t) to be saved directly in the protocol header
- */
- u16_t
- inet_chksum_pbuf(struct pbuf *p)
- {
- 800e33e: 4605 mov r5, r0
- u32_t acc;
- struct pbuf *q;
- u8_t swapped;
- acc = 0;
- 800e340: 4634 mov r4, r6
- swapped = 0;
- for(q = p; q != NULL; q = q->next) {
- 800e342: e013 b.n 800e36c <inet_chksum_pbuf+0x32>
- acc += LWIP_CHKSUM(q->payload, q->len);
- 800e344: 8969 ldrh r1, [r5, #10]
- 800e346: 6868 ldr r0, [r5, #4]
- 800e348: f7ff ffc6 bl 800e2d8 <lwip_standard_chksum>
- acc = FOLD_U32T(acc);
- if (q->len % 2 != 0) {
- 800e34c: 896b ldrh r3, [r5, #10]
- u8_t swapped;
- acc = 0;
- swapped = 0;
- for(q = p; q != NULL; q = q->next) {
- acc += LWIP_CHKSUM(q->payload, q->len);
- 800e34e: 1900 adds r0, r0, r4
- acc = FOLD_U32T(acc);
- 800e350: b284 uxth r4, r0
- if (q->len % 2 != 0) {
- 800e352: 07d9 lsls r1, r3, #31
- acc = 0;
- swapped = 0;
- for(q = p; q != NULL; q = q->next) {
- acc += LWIP_CHKSUM(q->payload, q->len);
- acc = FOLD_U32T(acc);
- 800e354: eb04 4410 add.w r4, r4, r0, lsr #16
- if (q->len % 2 != 0) {
- 800e358: d507 bpl.n 800e36a <inet_chksum_pbuf+0x30>
- swapped = 1 - swapped;
- acc = SWAP_BYTES_IN_WORD(acc);
- 800e35a: 0623 lsls r3, r4, #24
- swapped = 0;
- for(q = p; q != NULL; q = q->next) {
- acc += LWIP_CHKSUM(q->payload, q->len);
- acc = FOLD_U32T(acc);
- if (q->len % 2 != 0) {
- swapped = 1 - swapped;
- 800e35c: f1c6 0601 rsb r6, r6, #1
- acc = SWAP_BYTES_IN_WORD(acc);
- 800e360: f3c4 2407 ubfx r4, r4, #8, #8
- swapped = 0;
- for(q = p; q != NULL; q = q->next) {
- acc += LWIP_CHKSUM(q->payload, q->len);
- acc = FOLD_U32T(acc);
- if (q->len % 2 != 0) {
- swapped = 1 - swapped;
- 800e364: b2f6 uxtb r6, r6
- acc = SWAP_BYTES_IN_WORD(acc);
- 800e366: ea44 4413 orr.w r4, r4, r3, lsr #16
- struct pbuf *q;
- u8_t swapped;
- acc = 0;
- swapped = 0;
- for(q = p; q != NULL; q = q->next) {
- 800e36a: 682d ldr r5, [r5, #0]
- 800e36c: 2d00 cmp r5, #0
- 800e36e: d1e9 bne.n 800e344 <inet_chksum_pbuf+0xa>
- swapped = 1 - swapped;
- acc = SWAP_BYTES_IN_WORD(acc);
- }
- }
- if (swapped) {
- 800e370: b126 cbz r6, 800e37c <inet_chksum_pbuf+0x42>
- acc = SWAP_BYTES_IN_WORD(acc);
- 800e372: 0623 lsls r3, r4, #24
- 800e374: f3c4 2407 ubfx r4, r4, #8, #8
- 800e378: ea44 4413 orr.w r4, r4, r3, lsr #16
- }
- return (u16_t)~(acc & 0xffffUL);
- 800e37c: 43e0 mvns r0, r4
- }
- 800e37e: b280 uxth r0, r0
- 800e380: bd70 pop {r4, r5, r6, pc}
- 0800e382 <ip4_addr_isbroadcast>:
- {
- ip_addr_t ipaddr;
- ip4_addr_set_u32(&ipaddr, addr);
- /* all ones (broadcast) or all zeroes (old skool broadcast) */
- if ((~addr == IPADDR_ANY) ||
- 800e382: 1e43 subs r3, r0, #1
- 800e384: 3303 adds r3, #3
- 800e386: d811 bhi.n 800e3ac <ip4_addr_isbroadcast+0x2a>
- (addr == IPADDR_ANY)) {
- return 1;
- /* no broadcast support on this network interface? */
- } else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) {
- 800e388: f891 302d ldrb.w r3, [r1, #45] ; 0x2d
- 800e38c: f003 0302 and.w r3, r3, #2
- 800e390: b2db uxtb r3, r3
- 800e392: b16b cbz r3, 800e3b0 <ip4_addr_isbroadcast+0x2e>
- /* the given address cannot be a broadcast address
- * nor can we check against any broadcast addresses */
- return 0;
- /* address matches network interface address exactly? => no broadcast */
- } else if (addr == ip4_addr_get_u32(&netif->ip_addr)) {
- 800e394: 684a ldr r2, [r1, #4]
- 800e396: 4290 cmp r0, r2
- 800e398: d00a beq.n 800e3b0 <ip4_addr_isbroadcast+0x2e>
- return 0;
- /* on the same (sub) network... */
- } else if (ip_addr_netcmp(&ipaddr, &(netif->ip_addr), &(netif->netmask))
- 800e39a: 688b ldr r3, [r1, #8]
- 800e39c: 4042 eors r2, r0
- 800e39e: 421a tst r2, r3
- 800e3a0: d000 beq.n 800e3a4 <ip4_addr_isbroadcast+0x22>
- 800e3a2: e005 b.n 800e3b0 <ip4_addr_isbroadcast+0x2e>
- /* ...and host identifier bits are all ones? =>... */
- && ((addr & ~ip4_addr_get_u32(&netif->netmask)) ==
- 800e3a4: 43db mvns r3, r3
- 800e3a6: 4018 ands r0, r3
- 800e3a8: 4298 cmp r0, r3
- 800e3aa: d101 bne.n 800e3b0 <ip4_addr_isbroadcast+0x2e>
- ip4_addr_set_u32(&ipaddr, addr);
- /* all ones (broadcast) or all zeroes (old skool broadcast) */
- if ((~addr == IPADDR_ANY) ||
- (addr == IPADDR_ANY)) {
- return 1;
- 800e3ac: 2001 movs r0, #1
- 800e3ae: 4770 bx lr
- /* no broadcast support on this network interface? */
- } else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) {
- /* the given address cannot be a broadcast address
- * nor can we check against any broadcast addresses */
- return 0;
- 800e3b0: 2000 movs r0, #0
- /* => network broadcast address */
- return 1;
- } else {
- return 0;
- }
- }
- 800e3b2: 4770 bx lr
- 0800e3b4 <ipaddr_aton>:
- * @param addr pointer to which to save the ip address in network order
- * @return 1 if cp could be converted to addr, 0 on failure
- */
- int
- ipaddr_aton(const char *cp, ip_addr_t *addr)
- {
- 800e3b4: b5f0 push {r4, r5, r6, r7, lr}
- u8_t base;
- char c;
- u32_t parts[4];
- u32_t *pp = parts;
- c = *cp;
- 800e3b6: 7803 ldrb r3, [r0, #0]
- * @param addr pointer to which to save the ip address in network order
- * @return 1 if cp could be converted to addr, 0 on failure
- */
- int
- ipaddr_aton(const char *cp, ip_addr_t *addr)
- {
- 800e3b8: b085 sub sp, #20
- 800e3ba: 460e mov r6, r1
- u8_t base;
- char c;
- u32_t parts[4];
- u32_t *pp = parts;
- c = *cp;
- 800e3bc: 2400 movs r4, #0
- * @param cp IP address in ascii represenation (e.g. "127.0.0.1")
- * @param addr pointer to which to save the ip address in network order
- * @return 1 if cp could be converted to addr, 0 on failure
- */
- int
- ipaddr_aton(const char *cp, ip_addr_t *addr)
- 800e3be: aa00 add r2, sp, #0
- 800e3c0: 18a7 adds r7, r4, r2
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, 1-9=decimal.
- */
- if (!isdigit(c))
- 800e3c2: f1a3 0230 sub.w r2, r3, #48 ; 0x30
- 800e3c6: 2a09 cmp r2, #9
- 800e3c8: d86d bhi.n 800e4a6 <ipaddr_aton+0xf2>
- return (0);
- val = 0;
- base = 10;
- if (c == '0') {
- 800e3ca: 2b30 cmp r3, #48 ; 0x30
- 800e3cc: d10b bne.n 800e3e6 <ipaddr_aton+0x32>
- c = *++cp;
- 800e3ce: 7843 ldrb r3, [r0, #1]
- if (c == 'x' || c == 'X') {
- 800e3d0: 2b78 cmp r3, #120 ; 0x78
- 800e3d2: d004 beq.n 800e3de <ipaddr_aton+0x2a>
- 800e3d4: 2b58 cmp r3, #88 ; 0x58
- 800e3d6: d002 beq.n 800e3de <ipaddr_aton+0x2a>
- if (!isdigit(c))
- return (0);
- val = 0;
- base = 10;
- if (c == '0') {
- c = *++cp;
- 800e3d8: 3001 adds r0, #1
- if (c == 'x' || c == 'X') {
- base = 16;
- c = *++cp;
- } else
- base = 8;
- 800e3da: 2508 movs r5, #8
- 800e3dc: e004 b.n 800e3e8 <ipaddr_aton+0x34>
- base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X') {
- base = 16;
- c = *++cp;
- 800e3de: 7883 ldrb r3, [r0, #2]
- val = 0;
- base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X') {
- base = 16;
- 800e3e0: 2510 movs r5, #16
- c = *++cp;
- 800e3e2: 3002 adds r0, #2
- 800e3e4: e000 b.n 800e3e8 <ipaddr_aton+0x34>
- * 0x=hex, 0=octal, 1-9=decimal.
- */
- if (!isdigit(c))
- return (0);
- val = 0;
- base = 10;
- 800e3e6: 250a movs r5, #10
- 800e3e8: 4602 mov r2, r0
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X') {
- base = 16;
- 800e3ea: 2000 movs r0, #0
- 800e3ec: e000 b.n 800e3f0 <ipaddr_aton+0x3c>
- 800e3ee: 3201 adds r2, #1
- c = *++cp;
- } else
- base = 8;
- }
- for (;;) {
- if (isdigit(c)) {
- 800e3f0: f1a3 0130 sub.w r1, r3, #48 ; 0x30
- 800e3f4: 2909 cmp r1, #9
- 800e3f6: d803 bhi.n 800e400 <ipaddr_aton+0x4c>
- val = (val * base) + (int)(c - '0');
- 800e3f8: fb05 3000 mla r0, r5, r0, r3
- 800e3fc: 3830 subs r0, #48 ; 0x30
- 800e3fe: e013 b.n 800e428 <ipaddr_aton+0x74>
- c = *++cp;
- } else if (base == 16 && isxdigit(c)) {
- 800e400: 2d10 cmp r5, #16
- 800e402: d113 bne.n 800e42c <ipaddr_aton+0x78>
- 800e404: f1a3 0161 sub.w r1, r3, #97 ; 0x61
- 800e408: b2c9 uxtb r1, r1
- 800e40a: 2905 cmp r1, #5
- 800e40c: d904 bls.n 800e418 <ipaddr_aton+0x64>
- 800e40e: f1a3 0c41 sub.w ip, r3, #65 ; 0x41
- 800e412: f1bc 0f05 cmp.w ip, #5
- 800e416: d809 bhi.n 800e42c <ipaddr_aton+0x78>
- val = (val << 4) | (int)(c + 10 - (islower(c) ? 'a' : 'A'));
- 800e418: 330a adds r3, #10
- 800e41a: 2919 cmp r1, #25
- 800e41c: bf8c ite hi
- 800e41e: 2141 movhi r1, #65 ; 0x41
- 800e420: 2161 movls r1, #97 ; 0x61
- 800e422: 1a5b subs r3, r3, r1
- 800e424: ea43 1000 orr.w r0, r3, r0, lsl #4
- c = *++cp;
- 800e428: 7853 ldrb r3, [r2, #1]
- 800e42a: e7e0 b.n 800e3ee <ipaddr_aton+0x3a>
- } else
- break;
- }
- if (c == '.') {
- 800e42c: 2b2e cmp r3, #46 ; 0x2e
- 800e42e: d107 bne.n 800e440 <ipaddr_aton+0x8c>
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3) {
- 800e430: 2c0c cmp r4, #12
- 800e432: d038 beq.n 800e4a6 <ipaddr_aton+0xf2>
- return (0);
- }
- *pp++ = val;
- 800e434: f84d 0004 str.w r0, [sp, r4]
- c = *++cp;
- 800e438: 7853 ldrb r3, [r2, #1]
- 800e43a: 1c50 adds r0, r2, #1
- 800e43c: 3404 adds r4, #4
- } else
- break;
- }
- 800e43e: e7be b.n 800e3be <ipaddr_aton+0xa>
- 800e440: 2b0d cmp r3, #13
- 800e442: d803 bhi.n 800e44c <ipaddr_aton+0x98>
- 800e444: 2b09 cmp r3, #9
- 800e446: d203 bcs.n 800e450 <ipaddr_aton+0x9c>
- 800e448: b113 cbz r3, 800e450 <ipaddr_aton+0x9c>
- 800e44a: e02c b.n 800e4a6 <ipaddr_aton+0xf2>
- 800e44c: 2b20 cmp r3, #32
- 800e44e: d12a bne.n 800e4a6 <ipaddr_aton+0xf2>
- }
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- switch (pp - parts + 1) {
- 800e450: 466b mov r3, sp
- 800e452: 1afb subs r3, r7, r3
- 800e454: 109b asrs r3, r3, #2
- 800e456: 3301 adds r3, #1
- 800e458: 2b04 cmp r3, #4
- 800e45a: d81f bhi.n 800e49c <ipaddr_aton+0xe8>
- 800e45c: e8df f003 tbb [pc, r3]
- 800e460: 0a031e23 .word 0x0a031e23
- 800e464: 13 .byte 0x13
- 800e465: 00 .byte 0x00
- case 1: /* a -- 32 bits */
- break;
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffffUL) {
- 800e466: f1b0 7f80 cmp.w r0, #16777216 ; 0x1000000
- 800e46a: d21c bcs.n 800e4a6 <ipaddr_aton+0xf2>
- return (0);
- }
- val |= parts[0] << 24;
- 800e46c: 9b00 ldr r3, [sp, #0]
- 800e46e: ea40 6003 orr.w r0, r0, r3, lsl #24
- break;
- 800e472: e013 b.n 800e49c <ipaddr_aton+0xe8>
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff) {
- 800e474: f5b0 3f80 cmp.w r0, #65536 ; 0x10000
- 800e478: d215 bcs.n 800e4a6 <ipaddr_aton+0xf2>
- return (0);
- }
- val |= (parts[0] << 24) | (parts[1] << 16);
- 800e47a: 9b00 ldr r3, [sp, #0]
- 800e47c: 061a lsls r2, r3, #24
- 800e47e: 9b01 ldr r3, [sp, #4]
- 800e480: ea42 4303 orr.w r3, r2, r3, lsl #16
- 800e484: e009 b.n 800e49a <ipaddr_aton+0xe6>
- break;
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff) {
- 800e486: 28ff cmp r0, #255 ; 0xff
- 800e488: d80d bhi.n 800e4a6 <ipaddr_aton+0xf2>
- return (0);
- }
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- 800e48a: 9b00 ldr r3, [sp, #0]
- 800e48c: 061a lsls r2, r3, #24
- 800e48e: 9b01 ldr r3, [sp, #4]
- 800e490: ea42 4203 orr.w r2, r2, r3, lsl #16
- 800e494: 9b02 ldr r3, [sp, #8]
- 800e496: ea42 2303 orr.w r3, r2, r3, lsl #8
- 800e49a: 4318 orrs r0, r3
- break;
- default:
- LWIP_ASSERT("unhandled", 0);
- break;
- }
- if (addr) {
- 800e49c: b12e cbz r6, 800e4aa <ipaddr_aton+0xf6>
- ip4_addr_set_u32(addr, htonl(val));
- 800e49e: f7fb feae bl 800a1fe <lwip_htonl>
- 800e4a2: 6030 str r0, [r6, #0]
- 800e4a4: e001 b.n 800e4aa <ipaddr_aton+0xf6>
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, 1-9=decimal.
- */
- if (!isdigit(c))
- return (0);
- 800e4a6: 2000 movs r0, #0
- 800e4a8: e000 b.n 800e4ac <ipaddr_aton+0xf8>
- break;
- }
- if (addr) {
- ip4_addr_set_u32(addr, htonl(val));
- }
- return (1);
- 800e4aa: 2001 movs r0, #1
- }
- 800e4ac: b005 add sp, #20
- 800e4ae: bdf0 pop {r4, r5, r6, r7, pc}
- 0800e4b0 <ipaddr_addr>:
- * @param cp IP address in ascii represenation (e.g. "127.0.0.1")
- * @return ip address in network order
- */
- u32_t
- ipaddr_addr(const char *cp)
- {
- 800e4b0: b507 push {r0, r1, r2, lr}
- ip_addr_t val;
- if (ipaddr_aton(cp, &val)) {
- 800e4b2: a901 add r1, sp, #4
- 800e4b4: f7ff ff7e bl 800e3b4 <ipaddr_aton>
- 800e4b8: b108 cbz r0, 800e4be <ipaddr_addr+0xe>
- return ip4_addr_get_u32(&val);
- 800e4ba: 9801 ldr r0, [sp, #4]
- 800e4bc: e001 b.n 800e4c2 <ipaddr_addr+0x12>
- }
- return (IPADDR_NONE);
- 800e4be: f04f 30ff mov.w r0, #4294967295
- }
- 800e4c2: bd0e pop {r1, r2, r3, pc}
- 0800e4c4 <ip_route>:
- return netif;
- }
- #endif
- /* iterate through netifs */
- for (netif = netif_list; netif != NULL; netif = netif->next) {
- 800e4c4: 4b10 ldr r3, [pc, #64] ; (800e508 <ip_route+0x44>)
- 800e4c6: e009 b.n 800e4dc <ip_route+0x18>
- /* network mask matches? */
- if (netif_is_up(netif)) {
- 800e4c8: f893 202d ldrb.w r2, [r3, #45] ; 0x2d
- 800e4cc: 07d2 lsls r2, r2, #31
- 800e4ce: d505 bpl.n 800e4dc <ip_route+0x18>
- if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {
- 800e4d0: 6802 ldr r2, [r0, #0]
- 800e4d2: 6859 ldr r1, [r3, #4]
- 800e4d4: 4051 eors r1, r2
- 800e4d6: 689a ldr r2, [r3, #8]
- 800e4d8: 4211 tst r1, r2
- 800e4da: d012 beq.n 800e502 <ip_route+0x3e>
- return netif;
- }
- #endif
- /* iterate through netifs */
- for (netif = netif_list; netif != NULL; netif = netif->next) {
- 800e4dc: 681b ldr r3, [r3, #0]
- 800e4de: 2b00 cmp r3, #0
- 800e4e0: d1f2 bne.n 800e4c8 <ip_route+0x4>
- /* return netif on which to forward IP packet */
- return netif;
- }
- }
- }
- if ((netif_default == NULL) || (!netif_is_up(netif_default))) {
- 800e4e2: 4a0a ldr r2, [pc, #40] ; (800e50c <ip_route+0x48>)
- 800e4e4: 6812 ldr r2, [r2, #0]
- 800e4e6: b12a cbz r2, 800e4f4 <ip_route+0x30>
- 800e4e8: f892 102d ldrb.w r1, [r2, #45] ; 0x2d
- 800e4ec: 07c9 lsls r1, r1, #31
- 800e4ee: bf48 it mi
- 800e4f0: 4613 movmi r3, r2
- 800e4f2: d406 bmi.n 800e502 <ip_route+0x3e>
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip_route: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
- ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
- IP_STATS_INC(ip.rterr);
- 800e4f4: 4a06 ldr r2, [pc, #24] ; (800e510 <ip_route+0x4c>)
- 800e4f6: f8b2 1056 ldrh.w r1, [r2, #86] ; 0x56
- 800e4fa: 3101 adds r1, #1
- 800e4fc: f8a2 1056 strh.w r1, [r2, #86] ; 0x56
- snmp_inc_ipoutnoroutes();
- return NULL;
- 800e500: e7ff b.n 800e502 <ip_route+0x3e>
- }
- /* no matching netif found, use default netif */
- return netif_default;
- }
- 800e502: 4618 mov r0, r3
- 800e504: 4770 bx lr
- 800e506: bf00 nop
- 800e508: 20008218 .word 0x20008218
- 800e50c: 2000821c .word 0x2000821c
- 800e510: 20008220 .word 0x20008220
- 0800e514 <ip_input>:
- * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't
- * processed, but currently always returns ERR_OK)
- */
- err_t
- ip_input(struct pbuf *p, struct netif *inp)
- {
- 800e514: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- u16_t iphdr_len;
- #if IP_ACCEPT_LINK_LAYER_ADDRESSING
- int check_ip_src=1;
- #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
- IP_STATS_INC(ip.recv);
- 800e518: 4d73 ldr r5, [pc, #460] ; (800e6e8 <ip_input+0x1d4>)
- snmp_inc_ipinreceives();
- /* identify the IP header */
- iphdr = (struct ip_hdr *)p->payload;
- 800e51a: 6846 ldr r6, [r0, #4]
- u16_t iphdr_len;
- #if IP_ACCEPT_LINK_LAYER_ADDRESSING
- int check_ip_src=1;
- #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
- IP_STATS_INC(ip.recv);
- 800e51c: f8b5 304a ldrh.w r3, [r5, #74] ; 0x4a
- 800e520: 3301 adds r3, #1
- 800e522: f8a5 304a strh.w r3, [r5, #74] ; 0x4a
- snmp_inc_ipinreceives();
- /* identify the IP header */
- iphdr = (struct ip_hdr *)p->payload;
- if (IPH_V(iphdr) != 4) {
- 800e526: f896 8000 ldrb.w r8, [r6]
- 800e52a: ea4f 1318 mov.w r3, r8, lsr #4
- 800e52e: 2b04 cmp r3, #4
- * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't
- * processed, but currently always returns ERR_OK)
- */
- err_t
- ip_input(struct pbuf *p, struct netif *inp)
- {
- 800e530: 4604 mov r4, r0
- 800e532: 460f mov r7, r1
- IP_STATS_INC(ip.recv);
- snmp_inc_ipinreceives();
- /* identify the IP header */
- iphdr = (struct ip_hdr *)p->payload;
- if (IPH_V(iphdr) != 4) {
- 800e534: d00c beq.n 800e550 <ip_input+0x3c>
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IP packet dropped due to bad version number %"U16_F"\n", IPH_V(iphdr)));
- ip_debug_print(p);
- pbuf_free(p);
- 800e536: f7fc ffc5 bl 800b4c4 <pbuf_free>
- IP_STATS_INC(ip.err);
- 800e53a: f8b5 305c ldrh.w r3, [r5, #92] ; 0x5c
- 800e53e: 3301 adds r3, #1
- 800e540: f8a5 305c strh.w r3, [r5, #92] ; 0x5c
- IP_STATS_INC(ip.drop);
- 800e544: f8b5 304e ldrh.w r3, [r5, #78] ; 0x4e
- 800e548: 3301 adds r3, #1
- 800e54a: f8a5 304e strh.w r3, [r5, #78] ; 0x4e
- snmp_inc_ipinhdrerrors();
- return ERR_OK;
- 800e54e: e0c7 b.n 800e6e0 <ip_input+0x1cc>
- /* obtain IP header length in number of 32-bit words */
- iphdr_hlen = IPH_HL(iphdr);
- /* calculate IP header length in bytes */
- iphdr_hlen *= 4;
- /* obtain ip length in bytes */
- iphdr_len = ntohs(IPH_LEN(iphdr));
- 800e550: 8870 ldrh r0, [r6, #2]
- 800e552: f7fb fe4f bl 800a1f4 <lwip_ntohs>
- return ERR_OK;
- }
- #endif
- /* obtain IP header length in number of 32-bit words */
- iphdr_hlen = IPH_HL(iphdr);
- 800e556: f008 080f and.w r8, r8, #15
- iphdr_hlen *= 4;
- /* obtain ip length in bytes */
- iphdr_len = ntohs(IPH_LEN(iphdr));
- /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
- if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
- 800e55a: 8963 ldrh r3, [r4, #10]
- #endif
- /* obtain IP header length in number of 32-bit words */
- iphdr_hlen = IPH_HL(iphdr);
- /* calculate IP header length in bytes */
- iphdr_hlen *= 4;
- 800e55c: ea4f 0888 mov.w r8, r8, lsl #2
- /* obtain ip length in bytes */
- iphdr_len = ntohs(IPH_LEN(iphdr));
- /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
- if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
- 800e560: 4543 cmp r3, r8
- /* obtain IP header length in number of 32-bit words */
- iphdr_hlen = IPH_HL(iphdr);
- /* calculate IP header length in bytes */
- iphdr_hlen *= 4;
- /* obtain ip length in bytes */
- iphdr_len = ntohs(IPH_LEN(iphdr));
- 800e562: 4601 mov r1, r0
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
- ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n",
- iphdr_len, p->tot_len));
- }
- /* free (drop) packet pbufs */
- pbuf_free(p);
- 800e564: 4620 mov r0, r4
- iphdr_hlen *= 4;
- /* obtain ip length in bytes */
- iphdr_len = ntohs(IPH_LEN(iphdr));
- /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
- if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
- 800e566: d302 bcc.n 800e56e <ip_input+0x5a>
- 800e568: 8923 ldrh r3, [r4, #8]
- 800e56a: 428b cmp r3, r1
- 800e56c: d208 bcs.n 800e580 <ip_input+0x6c>
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
- ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n",
- iphdr_len, p->tot_len));
- }
- /* free (drop) packet pbufs */
- pbuf_free(p);
- 800e56e: f7fc ffa9 bl 800b4c4 <pbuf_free>
- IP_STATS_INC(ip.lenerr);
- 800e572: 4b5d ldr r3, [pc, #372] ; (800e6e8 <ip_input+0x1d4>)
- 800e574: f8b3 2052 ldrh.w r2, [r3, #82] ; 0x52
- 800e578: 3201 adds r2, #1
- 800e57a: f8a3 2052 strh.w r2, [r3, #82] ; 0x52
- 800e57e: e044 b.n 800e60a <ip_input+0xf6>
- }
- #endif
- /* Trim pbuf. This should have been done at the netif layer,
- * but we'll do it anyway just to be sure that its done. */
- pbuf_realloc(p, iphdr_len);
- 800e580: f7fc ffcb bl 800b51a <pbuf_realloc>
- /* copy IP addresses to aligned ip_addr_t */
- ip_addr_copy(current_iphdr_dest, iphdr->dest);
- 800e584: 6932 ldr r2, [r6, #16]
- 800e586: 4b59 ldr r3, [pc, #356] ; (800e6ec <ip_input+0x1d8>)
- }
- #endif /* LWIP_AUTOIP */
- }
- if (first) {
- first = 0;
- netif = netif_list;
- 800e588: f8df b170 ldr.w fp, [pc, #368] ; 800e6fc <ip_input+0x1e8>
- /* Trim pbuf. This should have been done at the netif layer,
- * but we'll do it anyway just to be sure that its done. */
- pbuf_realloc(p, iphdr_len);
- /* copy IP addresses to aligned ip_addr_t */
- ip_addr_copy(current_iphdr_dest, iphdr->dest);
- 800e58c: 601a str r2, [r3, #0]
- ip_addr_copy(current_iphdr_src, iphdr->src);
- 800e58e: 68f1 ldr r1, [r6, #12]
- 800e590: 4a57 ldr r2, [pc, #348] ; (800e6f0 <ip_input+0x1dc>)
- 800e592: 463d mov r5, r7
- 800e594: 6011 str r1, [r2, #0]
- #endif /* LWIP_IGMP */
- {
- /* start trying with inp. if that's not acceptable, start walking the
- list of configured netifs.
- 'first' is used as a boolean to mark whether we started walking the list */
- int first = 1;
- 800e596: f04f 0901 mov.w r9, #1
- ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
- /* interface is up and configured? */
- if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
- /* unicast to this interface address? */
- if (ip_addr_cmp(¤t_iphdr_dest, &(netif->ip_addr)) ||
- 800e59a: 469a mov sl, r3
- ip4_addr_get_u32(&iphdr->dest) & ip4_addr_get_u32(&netif->netmask),
- ip4_addr_get_u32(&netif->ip_addr) & ip4_addr_get_u32(&netif->netmask),
- ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
- /* interface is up and configured? */
- if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
- 800e59c: f895 302d ldrb.w r3, [r5, #45] ; 0x2d
- 800e5a0: 07d9 lsls r1, r3, #31
- 800e5a2: d403 bmi.n 800e5ac <ip_input+0x98>
- /* break out of for loop */
- break;
- }
- #endif /* LWIP_AUTOIP */
- }
- if (first) {
- 800e5a4: f1b9 0f00 cmp.w r9, #0
- 800e5a8: d10e bne.n 800e5c8 <ip_input+0xb4>
- 800e5aa: e010 b.n 800e5ce <ip_input+0xba>
- ip4_addr_get_u32(&iphdr->dest) & ip4_addr_get_u32(&netif->netmask),
- ip4_addr_get_u32(&netif->ip_addr) & ip4_addr_get_u32(&netif->netmask),
- ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
- /* interface is up and configured? */
- if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
- 800e5ac: 686b ldr r3, [r5, #4]
- 800e5ae: 2b00 cmp r3, #0
- 800e5b0: d0f8 beq.n 800e5a4 <ip_input+0x90>
- /* unicast to this interface address? */
- if (ip_addr_cmp(¤t_iphdr_dest, &(netif->ip_addr)) ||
- 800e5b2: f8da 0000 ldr.w r0, [sl]
- 800e5b6: 4298 cmp r0, r3
- 800e5b8: f000 808b beq.w 800e6d2 <ip_input+0x1be>
- /* or broadcast on this interface network address? */
- ip_addr_isbroadcast(¤t_iphdr_dest, netif)) {
- 800e5bc: 4629 mov r1, r5
- 800e5be: f7ff fee0 bl 800e382 <ip4_addr_isbroadcast>
- ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
- /* interface is up and configured? */
- if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
- /* unicast to this interface address? */
- if (ip_addr_cmp(¤t_iphdr_dest, &(netif->ip_addr)) ||
- 800e5c2: 2800 cmp r0, #0
- 800e5c4: d0ee beq.n 800e5a4 <ip_input+0x90>
- 800e5c6: e084 b.n 800e6d2 <ip_input+0x1be>
- }
- #endif /* LWIP_AUTOIP */
- }
- if (first) {
- first = 0;
- netif = netif_list;
- 800e5c8: f8db 5000 ldr.w r5, [fp]
- 800e5cc: e000 b.n 800e5d0 <ip_input+0xbc>
- } else {
- netif = netif->next;
- 800e5ce: 682d ldr r5, [r5, #0]
- }
- if (netif == inp) {
- 800e5d0: 42bd cmp r5, r7
- netif = netif->next;
- 800e5d2: bf08 it eq
- 800e5d4: 682d ldreq r5, [r5, #0]
- 800e5d6: f04f 0900 mov.w r9, #0
- }
- } while(netif != NULL);
- 800e5da: 2d00 cmp r5, #0
- 800e5dc: d1de bne.n 800e59c <ip_input+0x88>
- 800e5de: e075 b.n 800e6cc <ip_input+0x1b8>
- /* remote port is DHCP server? */
- if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
- struct udp_hdr *udphdr = (struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen);
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip_input: UDP packet to DHCP client port %"U16_F"\n",
- ntohs(udphdr->dest)));
- if (IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(udphdr->dest)) {
- 800e5e0: eb06 0308 add.w r3, r6, r8
- 800e5e4: 885b ldrh r3, [r3, #2]
- 800e5e6: f5b3 4f88 cmp.w r3, #17408 ; 0x4400
- 800e5ea: d172 bne.n 800e6d2 <ip_input+0x1be>
- 800e5ec: e013 b.n 800e616 <ip_input+0x102>
- /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
- #if IP_ACCEPT_LINK_LAYER_ADDRESSING
- /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */
- if (check_ip_src && !ip_addr_isany(¤t_iphdr_src))
- #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
- { if ((ip_addr_isbroadcast(¤t_iphdr_src, inp)) ||
- 800e5ee: 4639 mov r1, r7
- 800e5f0: f7ff fec7 bl 800e382 <ip4_addr_isbroadcast>
- 800e5f4: b928 cbnz r0, 800e602 <ip_input+0xee>
- (ip_addr_ismulticast(¤t_iphdr_src))) {
- 800e5f6: f8d8 3000 ldr.w r3, [r8]
- 800e5fa: f003 03f0 and.w r3, r3, #240 ; 0xf0
- /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
- #if IP_ACCEPT_LINK_LAYER_ADDRESSING
- /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */
- if (check_ip_src && !ip_addr_isany(¤t_iphdr_src))
- #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
- { if ((ip_addr_isbroadcast(¤t_iphdr_src, inp)) ||
- 800e5fe: 2be0 cmp r3, #224 ; 0xe0
- 800e600: d10a bne.n 800e618 <ip_input+0x104>
- (ip_addr_ismulticast(¤t_iphdr_src))) {
- /* packet source is not valid */
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("ip_input: packet source is not valid.\n"));
- /* free (drop) packet pbufs */
- pbuf_free(p);
- 800e602: 4620 mov r0, r4
- 800e604: f7fc ff5e bl 800b4c4 <pbuf_free>
- IP_STATS_INC(ip.drop);
- 800e608: 4b37 ldr r3, [pc, #220] ; (800e6e8 <ip_input+0x1d4>)
- 800e60a: f8b3 204e ldrh.w r2, [r3, #78] ; 0x4e
- 800e60e: 3201 adds r2, #1
- 800e610: f8a3 204e strh.w r2, [r3, #78] ; 0x4e
- snmp_inc_ipinaddrerrors();
- snmp_inc_ipindiscards();
- return ERR_OK;
- 800e614: e064 b.n 800e6e0 <ip_input+0x1cc>
- /* remote port is DHCP server? */
- if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
- struct udp_hdr *udphdr = (struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen);
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip_input: UDP packet to DHCP client port %"U16_F"\n",
- ntohs(udphdr->dest)));
- if (IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(udphdr->dest)) {
- 800e616: 463d mov r5, r7
- return ERR_OK;
- }
- }
- /* packet not for us? */
- if (netif == NULL) {
- 800e618: b91d cbnz r5, 800e622 <ip_input+0x10e>
- #endif /* IP_FORWARD */
- {
- snmp_inc_ipinaddrerrors();
- snmp_inc_ipindiscards();
- }
- pbuf_free(p);
- 800e61a: 4620 mov r0, r4
- 800e61c: f7fc ff52 bl 800b4c4 <pbuf_free>
- return ERR_OK;
- 800e620: e05e b.n 800e6e0 <ip_input+0x1cc>
- }
- /* packet consists of multiple fragments? */
- if ((IPH_OFFSET(iphdr) & PP_HTONS(IP_OFFMASK | IP_MF)) != 0) {
- 800e622: 88f3 ldrh r3, [r6, #6]
- 800e624: f023 03c0 bic.w r3, r3, #192 ; 0xc0
- 800e628: b29b uxth r3, r3
- 800e62a: b133 cbz r3, 800e63a <ip_input+0x126>
- #if IP_REASSEMBLY /* packet fragment reassembly code present? */
- 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",
- 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));
- /* reassemble the packet*/
- p = ip_reass(p);
- 800e62c: 4620 mov r0, r4
- 800e62e: f000 f991 bl 800e954 <ip_reass>
- /* packet not fully reassembled yet? */
- if (p == NULL) {
- 800e632: 4604 mov r4, r0
- 800e634: 2800 cmp r0, #0
- 800e636: d053 beq.n 800e6e0 <ip_input+0x1cc>
- return ERR_OK;
- }
- iphdr = (struct ip_hdr *)p->payload;
- 800e638: 6846 ldr r6, [r0, #4]
- /* send to upper layers */
- LWIP_DEBUGF(IP_DEBUG, ("ip_input: \n"));
- ip_debug_print(p);
- LWIP_DEBUGF(IP_DEBUG, ("ip_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));
- current_netif = inp;
- 800e63a: 4b2e ldr r3, [pc, #184] ; (800e6f4 <ip_input+0x1e0>)
- 800e63c: 601f str r7, [r3, #0]
- current_header = iphdr;
- 800e63e: 4b2e ldr r3, [pc, #184] ; (800e6f8 <ip_input+0x1e4>)
- #if LWIP_RAW
- /* raw input did not eat the packet? */
- if (raw_input(p, inp) == 0)
- 800e640: 4620 mov r0, r4
- 800e642: 4639 mov r1, r7
- LWIP_DEBUGF(IP_DEBUG, ("ip_input: \n"));
- ip_debug_print(p);
- LWIP_DEBUGF(IP_DEBUG, ("ip_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));
- current_netif = inp;
- current_header = iphdr;
- 800e644: 601e str r6, [r3, #0]
- #if LWIP_RAW
- /* raw input did not eat the packet? */
- if (raw_input(p, inp) == 0)
- 800e646: f7fd f8b9 bl 800b7bc <raw_input>
- 800e64a: 2800 cmp r0, #0
- 800e64c: d134 bne.n 800e6b8 <ip_input+0x1a4>
- #endif /* LWIP_RAW */
- {
- switch (IPH_PROTO(iphdr)) {
- 800e64e: 7a73 ldrb r3, [r6, #9]
- 800e650: 2b06 cmp r3, #6
- 800e652: d009 beq.n 800e668 <ip_input+0x154>
- 800e654: 2b11 cmp r3, #17
- 800e656: d002 beq.n 800e65e <ip_input+0x14a>
- 800e658: 2b01 cmp r3, #1
- 800e65a: d10f bne.n 800e67c <ip_input+0x168>
- 800e65c: e009 b.n 800e672 <ip_input+0x15e>
- case IP_PROTO_UDP:
- #if LWIP_UDPLITE
- case IP_PROTO_UDPLITE:
- #endif /* LWIP_UDPLITE */
- snmp_inc_ipindelivers();
- udp_input(p, inp);
- 800e65e: 4620 mov r0, r4
- 800e660: 4639 mov r1, r7
- 800e662: f7ff fb49 bl 800dcf8 <udp_input>
- break;
- 800e666: e027 b.n 800e6b8 <ip_input+0x1a4>
- #endif /* LWIP_UDP */
- #if LWIP_TCP
- case IP_PROTO_TCP:
- snmp_inc_ipindelivers();
- tcp_input(p, inp);
- 800e668: 4620 mov r0, r4
- 800e66a: 4639 mov r1, r7
- 800e66c: f7fe f874 bl 800c758 <tcp_input>
- break;
- 800e670: e022 b.n 800e6b8 <ip_input+0x1a4>
- #endif /* LWIP_TCP */
- #if LWIP_ICMP
- case IP_PROTO_ICMP:
- snmp_inc_ipindelivers();
- icmp_input(p, inp);
- 800e672: 4620 mov r0, r4
- 800e674: 4639 mov r1, r7
- 800e676: f7ff fd5d bl 800e134 <icmp_input>
- break;
- 800e67a: e01d b.n 800e6b8 <ip_input+0x1a4>
- break;
- #endif /* LWIP_IGMP */
- default:
- #if LWIP_ICMP
- /* send ICMP destination protocol unreachable unless is was a broadcast */
- if (!ip_addr_isbroadcast(¤t_iphdr_dest, inp) &&
- 800e67c: 4d1b ldr r5, [pc, #108] ; (800e6ec <ip_input+0x1d8>)
- 800e67e: 4639 mov r1, r7
- 800e680: 6828 ldr r0, [r5, #0]
- 800e682: f7ff fe7e bl 800e382 <ip4_addr_isbroadcast>
- 800e686: b948 cbnz r0, 800e69c <ip_input+0x188>
- !ip_addr_ismulticast(¤t_iphdr_dest)) {
- 800e688: 682b ldr r3, [r5, #0]
- 800e68a: f003 03f0 and.w r3, r3, #240 ; 0xf0
- break;
- #endif /* LWIP_IGMP */
- default:
- #if LWIP_ICMP
- /* send ICMP destination protocol unreachable unless is was a broadcast */
- if (!ip_addr_isbroadcast(¤t_iphdr_dest, inp) &&
- 800e68e: 2be0 cmp r3, #224 ; 0xe0
- 800e690: d004 beq.n 800e69c <ip_input+0x188>
- !ip_addr_ismulticast(¤t_iphdr_dest)) {
- p->payload = iphdr;
- 800e692: 6066 str r6, [r4, #4]
- icmp_dest_unreach(p, ICMP_DUR_PROTO);
- 800e694: 4620 mov r0, r4
- 800e696: 2102 movs r1, #2
- 800e698: f7ff fe16 bl 800e2c8 <icmp_dest_unreach>
- }
- #endif /* LWIP_ICMP */
- pbuf_free(p);
- 800e69c: 4620 mov r0, r4
- 800e69e: f7fc ff11 bl 800b4c4 <pbuf_free>
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Unsupported transport protocol %"U16_F"\n", IPH_PROTO(iphdr)));
- IP_STATS_INC(ip.proterr);
- 800e6a2: 4b11 ldr r3, [pc, #68] ; (800e6e8 <ip_input+0x1d4>)
- 800e6a4: f8b3 2058 ldrh.w r2, [r3, #88] ; 0x58
- 800e6a8: 3201 adds r2, #1
- 800e6aa: f8a3 2058 strh.w r2, [r3, #88] ; 0x58
- IP_STATS_INC(ip.drop);
- 800e6ae: f8b3 204e ldrh.w r2, [r3, #78] ; 0x4e
- 800e6b2: 3201 adds r2, #1
- 800e6b4: f8a3 204e strh.w r2, [r3, #78] ; 0x4e
- snmp_inc_ipinunknownprotos();
- }
- }
- current_netif = NULL;
- 800e6b8: 4a0e ldr r2, [pc, #56] ; (800e6f4 <ip_input+0x1e0>)
- 800e6ba: 2300 movs r3, #0
- 800e6bc: 6013 str r3, [r2, #0]
- current_header = NULL;
- 800e6be: 4a0e ldr r2, [pc, #56] ; (800e6f8 <ip_input+0x1e4>)
- 800e6c0: 6013 str r3, [r2, #0]
- ip_addr_set_any(¤t_iphdr_src);
- 800e6c2: 4a0b ldr r2, [pc, #44] ; (800e6f0 <ip_input+0x1dc>)
- 800e6c4: 6013 str r3, [r2, #0]
- ip_addr_set_any(¤t_iphdr_dest);
- 800e6c6: 4a09 ldr r2, [pc, #36] ; (800e6ec <ip_input+0x1d8>)
- 800e6c8: 6013 str r3, [r2, #0]
- return ERR_OK;
- 800e6ca: e009 b.n 800e6e0 <ip_input+0x1cc>
- *
- * #define LWIP_IP_ACCEPT_UDP_PORT(dst_port) ((dst_port) == PP_NTOHS(12345))
- */
- if (netif == NULL) {
- /* remote port is DHCP server? */
- if (IPH_PROTO(iphdr) == IP_PROTO_UDP) {
- 800e6cc: 7a73 ldrb r3, [r6, #9]
- 800e6ce: 2b11 cmp r3, #17
- 800e6d0: d086 beq.n 800e5e0 <ip_input+0xcc>
- #endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */
- /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */
- #if IP_ACCEPT_LINK_LAYER_ADDRESSING
- /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */
- if (check_ip_src && !ip_addr_isany(¤t_iphdr_src))
- 800e6d2: f8df 801c ldr.w r8, [pc, #28] ; 800e6f0 <ip_input+0x1dc>
- 800e6d6: f8d8 0000 ldr.w r0, [r8]
- 800e6da: 2800 cmp r0, #0
- 800e6dc: d09c beq.n 800e618 <ip_input+0x104>
- 800e6de: e786 b.n 800e5ee <ip_input+0xda>
- current_header = NULL;
- ip_addr_set_any(¤t_iphdr_src);
- ip_addr_set_any(¤t_iphdr_dest);
- return ERR_OK;
- }
- 800e6e0: 2000 movs r0, #0
- 800e6e2: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800e6e6: bf00 nop
- 800e6e8: 20008220 .word 0x20008220
- 800e6ec: 20008364 .word 0x20008364
- 800e6f0: 2000835c .word 0x2000835c
- 800e6f4: 20008360 .word 0x20008360
- 800e6f8: 20008368 .word 0x20008368
- 800e6fc: 20008218 .word 0x20008218
- 0800e700 <ip_output_if>:
- */
- err_t
- ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
- u8_t ttl, u8_t tos,
- u8_t proto, struct netif *netif)
- {
- 800e700: e92d 47f3 stmdb sp!, {r0, r1, r4, r5, r6, r7, r8, r9, sl, lr}
- 800e704: 9f0c ldr r7, [sp, #48] ; 0x30
- 800e706: 4606 mov r6, r0
- 800e708: 4689 mov r9, r1
- 800e70a: 469a mov sl, r3
- LWIP_ASSERT("p->ref == 1", p->ref == 1);
- snmp_inc_ipoutrequests();
- /* Should the IP header be generated or is it already included in p? */
- if (dest != IP_HDRINCL) {
- 800e70c: 4615 mov r5, r2
- 800e70e: 2a00 cmp r2, #0
- 800e710: d039 beq.n 800e786 <ip_output_if+0x86>
- }
- #endif /* CHECKSUM_GEN_IP_INLINE */
- }
- #endif /* IP_OPTIONS_SEND */
- /* generate IP header */
- if (pbuf_header(p, IP_HLEN)) {
- 800e712: 2114 movs r1, #20
- 800e714: f7fc feab bl 800b46e <pbuf_header>
- 800e718: 4680 mov r8, r0
- 800e71a: b138 cbz r0, 800e72c <ip_output_if+0x2c>
- LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip_output: not enough room for IP header in pbuf\n"));
- IP_STATS_INC(ip.err);
- 800e71c: 4b29 ldr r3, [pc, #164] ; (800e7c4 <ip_output_if+0xc4>)
- 800e71e: f8b3 205c ldrh.w r2, [r3, #92] ; 0x5c
- 800e722: 3201 adds r2, #1
- 800e724: f8a3 205c strh.w r2, [r3, #92] ; 0x5c
- snmp_inc_ipoutdiscards();
- return ERR_BUF;
- 800e728: 20fe movs r0, #254 ; 0xfe
- 800e72a: e047 b.n 800e7bc <ip_output_if+0xbc>
- }
- iphdr = (struct ip_hdr *)p->payload;
- 800e72c: 6874 ldr r4, [r6, #4]
- LWIP_ASSERT("check that first pbuf can hold struct ip_hdr",
- (p->len >= sizeof(struct ip_hdr)));
- IPH_TTL_SET(iphdr, ttl);
- IPH_PROTO_SET(iphdr, proto);
- 800e72e: f89d 302c ldrb.w r3, [sp, #44] ; 0x2c
- iphdr = (struct ip_hdr *)p->payload;
- LWIP_ASSERT("check that first pbuf can hold struct ip_hdr",
- (p->len >= sizeof(struct ip_hdr)));
- IPH_TTL_SET(iphdr, ttl);
- 800e732: f884 a008 strb.w sl, [r4, #8]
- IPH_PROTO_SET(iphdr, proto);
- 800e736: 7263 strb r3, [r4, #9]
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += LWIP_MAKE_U16(proto, ttl);
- #endif /* CHECKSUM_GEN_IP_INLINE */
- /* dest cannot be NULL here */
- ip_addr_copy(iphdr->dest, *dest);
- 800e738: 682b ldr r3, [r5, #0]
- 800e73a: 6123 str r3, [r4, #16]
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += ip4_addr_get_u32(&iphdr->dest) & 0xFFFF;
- chk_sum += ip4_addr_get_u32(&iphdr->dest) >> 16;
- #endif /* CHECKSUM_GEN_IP_INLINE */
- IPH_VHL_SET(iphdr, 4, ip_hlen / 4);
- 800e73c: 2345 movs r3, #69 ; 0x45
- 800e73e: 7023 strb r3, [r4, #0]
- IPH_TOS_SET(iphdr, tos);
- 800e740: f89d 3028 ldrb.w r3, [sp, #40] ; 0x28
- 800e744: 7063 strb r3, [r4, #1]
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += LWIP_MAKE_U16(tos, iphdr->_v_hl);
- #endif /* CHECKSUM_GEN_IP_INLINE */
- IPH_LEN_SET(iphdr, htons(p->tot_len));
- 800e746: 8930 ldrh r0, [r6, #8]
- 800e748: f7fb fd4f bl 800a1ea <lwip_htons>
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += iphdr->_len;
- #endif /* CHECKSUM_GEN_IP_INLINE */
- IPH_OFFSET_SET(iphdr, 0);
- 800e74c: f884 8006 strb.w r8, [r4, #6]
- 800e750: f884 8007 strb.w r8, [r4, #7]
- IPH_ID_SET(iphdr, htons(ip_id));
- 800e754: f8df 8070 ldr.w r8, [pc, #112] ; 800e7c8 <ip_output_if+0xc8>
- IPH_VHL_SET(iphdr, 4, ip_hlen / 4);
- IPH_TOS_SET(iphdr, tos);
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += LWIP_MAKE_U16(tos, iphdr->_v_hl);
- #endif /* CHECKSUM_GEN_IP_INLINE */
- IPH_LEN_SET(iphdr, htons(p->tot_len));
- 800e758: 8060 strh r0, [r4, #2]
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += iphdr->_len;
- #endif /* CHECKSUM_GEN_IP_INLINE */
- IPH_OFFSET_SET(iphdr, 0);
- IPH_ID_SET(iphdr, htons(ip_id));
- 800e75a: f8b8 0000 ldrh.w r0, [r8]
- 800e75e: f7fb fd44 bl 800a1ea <lwip_htons>
- 800e762: 80a0 strh r0, [r4, #4]
- #if CHECKSUM_GEN_IP_INLINE
- chk_sum += iphdr->_id;
- #endif /* CHECKSUM_GEN_IP_INLINE */
- ++ip_id;
- 800e764: f8b8 3000 ldrh.w r3, [r8]
- 800e768: 3301 adds r3, #1
- 800e76a: f8a8 3000 strh.w r3, [r8]
- if (ip_addr_isany(src)) {
- 800e76e: f1b9 0f00 cmp.w r9, #0
- 800e772: d002 beq.n 800e77a <ip_output_if+0x7a>
- 800e774: f8d9 3000 ldr.w r3, [r9]
- 800e778: b903 cbnz r3, 800e77c <ip_output_if+0x7c>
- ip_addr_copy(iphdr->src, netif->ip_addr);
- 800e77a: 687b ldr r3, [r7, #4]
- } else {
- /* src cannot be NULL here */
- ip_addr_copy(iphdr->src, *src);
- 800e77c: 60e3 str r3, [r4, #12]
- chk_sum = (chk_sum >> 16) + (chk_sum & 0xFFFF);
- chk_sum = (chk_sum >> 16) + chk_sum;
- chk_sum = ~chk_sum;
- iphdr->_chksum = chk_sum; /* network order */
- #else /* CHECKSUM_GEN_IP_INLINE */
- IPH_CHKSUM_SET(iphdr, 0);
- 800e77e: 2300 movs r3, #0
- 800e780: 72a3 strb r3, [r4, #10]
- 800e782: 72e3 strb r3, [r4, #11]
- 800e784: e004 b.n 800e790 <ip_output_if+0x90>
- #endif
- #endif /* CHECKSUM_GEN_IP_INLINE */
- } else {
- /* IP header already included in p */
- iphdr = (struct ip_hdr *)p->payload;
- ip_addr_copy(dest_addr, iphdr->dest);
- 800e786: 6843 ldr r3, [r0, #4]
- 800e788: ad02 add r5, sp, #8
- 800e78a: 691b ldr r3, [r3, #16]
- 800e78c: f845 3d04 str.w r3, [r5, #-4]!
- dest = &dest_addr;
- }
- IP_STATS_INC(ip.xmit);
- 800e790: 4b0c ldr r3, [pc, #48] ; (800e7c4 <ip_output_if+0xc4>)
- 800e792: f8b3 2048 ldrh.w r2, [r3, #72] ; 0x48
- 800e796: 3201 adds r2, #1
- 800e798: f8a3 2048 strh.w r2, [r3, #72] ; 0x48
- }
- #endif /* LWIP_IGMP */
- #endif /* ENABLE_LOOPBACK */
- #if IP_FRAG
- /* don't fragment if interface has mtu set to 0 [loopif] */
- if (netif->mtu && (p->tot_len > netif->mtu)) {
- 800e79c: 8cbb ldrh r3, [r7, #36] ; 0x24
- 800e79e: b143 cbz r3, 800e7b2 <ip_output_if+0xb2>
- 800e7a0: 8932 ldrh r2, [r6, #8]
- 800e7a2: 429a cmp r2, r3
- 800e7a4: d905 bls.n 800e7b2 <ip_output_if+0xb2>
- return ip_frag(p, netif, dest);
- 800e7a6: 4630 mov r0, r6
- 800e7a8: 4639 mov r1, r7
- 800e7aa: 462a mov r2, r5
- 800e7ac: f000 fa20 bl 800ebf0 <ip_frag>
- 800e7b0: e004 b.n 800e7bc <ip_output_if+0xbc>
- }
- #endif /* IP_FRAG */
- LWIP_DEBUGF(IP_DEBUG, ("netif->output()"));
- return netif->output(netif, p, dest);
- 800e7b2: 697b ldr r3, [r7, #20]
- 800e7b4: 4638 mov r0, r7
- 800e7b6: 4631 mov r1, r6
- 800e7b8: 462a mov r2, r5
- 800e7ba: 4798 blx r3
- }
- 800e7bc: b240 sxtb r0, r0
- 800e7be: e8bd 87fc ldmia.w sp!, {r2, r3, r4, r5, r6, r7, r8, r9, sl, pc}
- 800e7c2: bf00 nop
- 800e7c4: 20008220 .word 0x20008220
- 800e7c8: 20006bb8 .word 0x20006bb8
- 0800e7cc <ip_output>:
- * see ip_output_if() for more return values
- */
- err_t
- ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
- u8_t ttl, u8_t tos, u8_t proto)
- {
- 800e7cc: b5f0 push {r4, r5, r6, r7, lr}
- 800e7ce: 4605 mov r5, r0
- 800e7d0: b085 sub sp, #20
- /* pbufs passed to IP must have a ref-count of 1 as their payload pointer
- gets altered as the packet is passed down the stack */
- LWIP_ASSERT("p->ref == 1", p->ref == 1);
- if ((netif = ip_route(dest)) == NULL) {
- 800e7d2: 4610 mov r0, r2
- * see ip_output_if() for more return values
- */
- err_t
- ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
- u8_t ttl, u8_t tos, u8_t proto)
- {
- 800e7d4: 460f mov r7, r1
- 800e7d6: 4614 mov r4, r2
- 800e7d8: 461e mov r6, r3
- /* pbufs passed to IP must have a ref-count of 1 as their payload pointer
- gets altered as the packet is passed down the stack */
- LWIP_ASSERT("p->ref == 1", p->ref == 1);
- if ((netif = ip_route(dest)) == NULL) {
- 800e7da: f7ff fe73 bl 800e4c4 <ip_route>
- 800e7de: b938 cbnz r0, 800e7f0 <ip_output+0x24>
- LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
- ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
- IP_STATS_INC(ip.rterr);
- 800e7e0: 4b0b ldr r3, [pc, #44] ; (800e810 <ip_output+0x44>)
- 800e7e2: f8b3 2056 ldrh.w r2, [r3, #86] ; 0x56
- 800e7e6: 3201 adds r2, #1
- 800e7e8: f8a3 2056 strh.w r2, [r3, #86] ; 0x56
- return ERR_RTE;
- 800e7ec: 20fc movs r0, #252 ; 0xfc
- 800e7ee: e00c b.n 800e80a <ip_output+0x3e>
- }
- return ip_output_if(p, src, dest, ttl, tos, proto, netif);
- 800e7f0: f89d 3028 ldrb.w r3, [sp, #40] ; 0x28
- 800e7f4: 9002 str r0, [sp, #8]
- 800e7f6: 9300 str r3, [sp, #0]
- 800e7f8: f89d 302c ldrb.w r3, [sp, #44] ; 0x2c
- 800e7fc: 4628 mov r0, r5
- 800e7fe: 9301 str r3, [sp, #4]
- 800e800: 4639 mov r1, r7
- 800e802: 4622 mov r2, r4
- 800e804: 4633 mov r3, r6
- 800e806: f7ff ff7b bl 800e700 <ip_output_if>
- }
- 800e80a: b240 sxtb r0, r0
- 800e80c: b005 add sp, #20
- 800e80e: bdf0 pop {r4, r5, r6, r7, pc}
- 800e810: 20008220 .word 0x20008220
- 0800e814 <ipfrag_free_pbuf_custom>:
- /** Free-callback function to free a 'struct pbuf_custom_ref', called by
- * pbuf_free. */
- static void
- ipfrag_free_pbuf_custom(struct pbuf *p)
- {
- 800e814: b510 push {r4, lr}
- 800e816: 4604 mov r4, r0
- struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref*)p;
- LWIP_ASSERT("pcr != NULL", pcr != NULL);
- LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p);
- if (pcr->original != NULL) {
- 800e818: 6940 ldr r0, [r0, #20]
- 800e81a: b108 cbz r0, 800e820 <ipfrag_free_pbuf_custom+0xc>
- pbuf_free(pcr->original);
- 800e81c: f7fc fe52 bl 800b4c4 <pbuf_free>
- /** Free a struct pbuf_custom_ref */
- static void
- ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p)
- {
- LWIP_ASSERT("p != NULL", p != NULL);
- memp_free(MEMP_FRAG_PBUF, p);
- 800e820: 2006 movs r0, #6
- 800e822: 4621 mov r1, r4
- LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p);
- if (pcr->original != NULL) {
- pbuf_free(pcr->original);
- }
- ip_frag_free_pbuf_custom_ref(pcr);
- }
- 800e824: e8bd 4010 ldmia.w sp!, {r4, lr}
- /** Free a struct pbuf_custom_ref */
- static void
- ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p)
- {
- LWIP_ASSERT("p != NULL", p != NULL);
- memp_free(MEMP_FRAG_PBUF, p);
- 800e828: f7fc bd54 b.w 800b2d4 <memp_free>
- 0800e82c <ip_reass_free_complete_datagram>:
- * @param prev the previous datagram in the linked list
- * @return the number of pbufs freed
- */
- static int
- ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
- {
- 800e82c: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- LWIP_ASSERT("prev->next == ipr", prev->next == ipr);
- }
- snmp_inc_ipreasmfails();
- #if LWIP_ICMP
- iprh = (struct ip_reass_helper *)ipr->p->payload;
- 800e830: 6846 ldr r6, [r0, #4]
- * @param prev the previous datagram in the linked list
- * @return the number of pbufs freed
- */
- static int
- ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
- {
- 800e832: 4604 mov r4, r0
- LWIP_ASSERT("prev->next == ipr", prev->next == ipr);
- }
- snmp_inc_ipreasmfails();
- #if LWIP_ICMP
- iprh = (struct ip_reass_helper *)ipr->p->payload;
- 800e834: 6870 ldr r0, [r6, #4]
- if (iprh->start == 0) {
- 800e836: 8883 ldrh r3, [r0, #4]
- * @param prev the previous datagram in the linked list
- * @return the number of pbufs freed
- */
- static int
- ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
- {
- 800e838: 460f mov r7, r1
- }
- snmp_inc_ipreasmfails();
- #if LWIP_ICMP
- iprh = (struct ip_reass_helper *)ipr->p->payload;
- if (iprh->start == 0) {
- 800e83a: b993 cbnz r3, 800e862 <ip_reass_free_complete_datagram+0x36>
- /* The first fragment was received, send ICMP time exceeded. */
- /* First, de-queue the first pbuf from r->p. */
- p = ipr->p;
- ipr->p = iprh->next_pbuf;
- 800e83c: 6803 ldr r3, [r0, #0]
- /* Then, copy the original header into it. */
- SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
- 800e83e: 2214 movs r2, #20
- iprh = (struct ip_reass_helper *)ipr->p->payload;
- if (iprh->start == 0) {
- /* The first fragment was received, send ICMP time exceeded. */
- /* First, de-queue the first pbuf from r->p. */
- p = ipr->p;
- ipr->p = iprh->next_pbuf;
- 800e840: 6063 str r3, [r4, #4]
- /* Then, copy the original header into it. */
- SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
- 800e842: f104 0108 add.w r1, r4, #8
- 800e846: f7fa fddd bl 8009404 <memcpy>
- icmp_time_exceeded(p, ICMP_TE_FRAG);
- 800e84a: 4630 mov r0, r6
- 800e84c: 2101 movs r1, #1
- 800e84e: f7ff fd3f bl 800e2d0 <icmp_time_exceeded>
- clen = pbuf_clen(p);
- 800e852: 4630 mov r0, r6
- 800e854: f7fc ff0e bl 800b674 <pbuf_clen>
- 800e858: 4605 mov r5, r0
- LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff);
- pbufs_freed += clen;
- pbuf_free(p);
- 800e85a: 4630 mov r0, r6
- 800e85c: f7fc fe32 bl 800b4c4 <pbuf_free>
- 800e860: e000 b.n 800e864 <ip_reass_free_complete_datagram+0x38>
- * @return the number of pbufs freed
- */
- static int
- ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
- {
- u16_t pbufs_freed = 0;
- 800e862: 2500 movs r5, #0
- }
- #endif /* LWIP_ICMP */
- /* First, free all received pbufs. The individual pbufs need to be released
- separately as they have not yet been chained */
- p = ipr->p;
- 800e864: 6866 ldr r6, [r4, #4]
- while (p != NULL) {
- 800e866: e00b b.n 800e880 <ip_reass_free_complete_datagram+0x54>
- struct pbuf *pcur;
- iprh = (struct ip_reass_helper *)p->payload;
- 800e868: 6873 ldr r3, [r6, #4]
- pcur = p;
- /* get the next pointer before freeing */
- p = iprh->next_pbuf;
- clen = pbuf_clen(pcur);
- 800e86a: 4630 mov r0, r6
- while (p != NULL) {
- struct pbuf *pcur;
- iprh = (struct ip_reass_helper *)p->payload;
- pcur = p;
- /* get the next pointer before freeing */
- p = iprh->next_pbuf;
- 800e86c: f8d3 8000 ldr.w r8, [r3]
- clen = pbuf_clen(pcur);
- 800e870: f7fc ff00 bl 800b674 <pbuf_clen>
- LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff);
- pbufs_freed += clen;
- 800e874: 1940 adds r0, r0, r5
- 800e876: b285 uxth r5, r0
- pbuf_free(pcur);
- 800e878: 4630 mov r0, r6
- 800e87a: f7fc fe23 bl 800b4c4 <pbuf_free>
- while (p != NULL) {
- struct pbuf *pcur;
- iprh = (struct ip_reass_helper *)p->payload;
- pcur = p;
- /* get the next pointer before freeing */
- p = iprh->next_pbuf;
- 800e87e: 4646 mov r6, r8
- #endif /* LWIP_ICMP */
- /* First, free all received pbufs. The individual pbufs need to be released
- separately as they have not yet been chained */
- p = ipr->p;
- while (p != NULL) {
- 800e880: 2e00 cmp r6, #0
- 800e882: d1f1 bne.n 800e868 <ip_reass_free_complete_datagram+0x3c>
- static void
- ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
- {
-
- /* dequeue the reass struct */
- if (reassdatagrams == ipr) {
- 800e884: 4b09 ldr r3, [pc, #36] ; (800e8ac <ip_reass_free_complete_datagram+0x80>)
- 800e886: 681a ldr r2, [r3, #0]
- 800e888: 42a2 cmp r2, r4
- /* it was the first in the list */
- reassdatagrams = ipr->next;
- 800e88a: bf0b itete eq
- 800e88c: 6822 ldreq r2, [r4, #0]
- } else {
- /* it wasn't the first, so it must have a valid 'prev' */
- LWIP_ASSERT("sanity check linked list", prev != NULL);
- prev->next = ipr->next;
- 800e88e: 6823 ldrne r3, [r4, #0]
- {
-
- /* dequeue the reass struct */
- if (reassdatagrams == ipr) {
- /* it was the first in the list */
- reassdatagrams = ipr->next;
- 800e890: 601a streq r2, [r3, #0]
- } else {
- /* it wasn't the first, so it must have a valid 'prev' */
- LWIP_ASSERT("sanity check linked list", prev != NULL);
- prev->next = ipr->next;
- 800e892: 603b strne r3, [r7, #0]
- }
- /* now we can free the ip_reass struct */
- memp_free(MEMP_REASSDATA, ipr);
- 800e894: 4621 mov r1, r4
- 800e896: 2005 movs r0, #5
- 800e898: f7fc fd1c bl 800b2d4 <memp_free>
- pbuf_free(pcur);
- }
- /* Then, unchain the struct ip_reassdata from the list and free it. */
- ip_reass_dequeue_datagram(ipr, prev);
- LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= pbufs_freed);
- ip_reass_pbufcount -= pbufs_freed;
- 800e89c: 4b04 ldr r3, [pc, #16] ; (800e8b0 <ip_reass_free_complete_datagram+0x84>)
- 800e89e: 881a ldrh r2, [r3, #0]
- 800e8a0: 1b52 subs r2, r2, r5
- 800e8a2: 801a strh r2, [r3, #0]
- return pbufs_freed;
- }
- 800e8a4: 4628 mov r0, r5
- 800e8a6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800e8aa: bf00 nop
- 800e8ac: 20006bbc .word 0x20006bbc
- 800e8b0: 20006bc0 .word 0x20006bc0
- 0800e8b4 <ip_reass_remove_oldest_datagram>:
- * (used for freeing other datagrams if not enough space)
- * @return the number of pbufs freed
- */
- static int
- ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
- {
- 800e8b4: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- * but don't free the datagram that 'fraghdr' belongs to! */
- do {
- oldest = NULL;
- prev = NULL;
- other_datagrams = 0;
- r = reassdatagrams;
- 800e8b8: 4f1a ldr r7, [pc, #104] ; (800e924 <ip_reass_remove_oldest_datagram+0x70>)
- * (used for freeing other datagrams if not enough space)
- * @return the number of pbufs freed
- */
- static int
- ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
- {
- 800e8ba: 4606 mov r6, r0
- 800e8bc: 4688 mov r8, r1
- /* @todo Can't we simply remove the last datagram in the
- * linked list behind reassdatagrams?
- */
- struct ip_reassdata *r, *oldest, *prev;
- int pbufs_freed = 0, pbufs_freed_current;
- 800e8be: 2500 movs r5, #0
- /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
- * but don't free the datagram that 'fraghdr' belongs to! */
- do {
- oldest = NULL;
- prev = NULL;
- other_datagrams = 0;
- 800e8c0: 2400 movs r4, #0
- r = reassdatagrams;
- 800e8c2: 683b ldr r3, [r7, #0]
- /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
- * but don't free the datagram that 'fraghdr' belongs to! */
- do {
- oldest = NULL;
- prev = NULL;
- 800e8c4: 4621 mov r1, r4
- int other_datagrams;
- /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
- * but don't free the datagram that 'fraghdr' belongs to! */
- do {
- oldest = NULL;
- 800e8c6: 4622 mov r2, r4
- prev = NULL;
- other_datagrams = 0;
- r = reassdatagrams;
- while (r != NULL) {
- 800e8c8: e01d b.n 800e906 <ip_reass_remove_oldest_datagram+0x52>
- if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
- 800e8ca: f8d6 c00c ldr.w ip, [r6, #12]
- 800e8ce: 6958 ldr r0, [r3, #20]
- 800e8d0: 4560 cmp r0, ip
- 800e8d2: d109 bne.n 800e8e8 <ip_reass_remove_oldest_datagram+0x34>
- 800e8d4: f8d6 c010 ldr.w ip, [r6, #16]
- 800e8d8: 6998 ldr r0, [r3, #24]
- 800e8da: 4560 cmp r0, ip
- 800e8dc: d104 bne.n 800e8e8 <ip_reass_remove_oldest_datagram+0x34>
- 800e8de: f8b3 c00c ldrh.w ip, [r3, #12]
- 800e8e2: 88b0 ldrh r0, [r6, #4]
- 800e8e4: 4584 cmp ip, r0
- 800e8e6: d009 beq.n 800e8fc <ip_reass_remove_oldest_datagram+0x48>
- /* Not the same datagram as fraghdr */
- other_datagrams++;
- 800e8e8: 3401 adds r4, #1
- if (oldest == NULL) {
- 800e8ea: b132 cbz r2, 800e8fa <ip_reass_remove_oldest_datagram+0x46>
- oldest = r;
- } else if (r->timer <= oldest->timer) {
- 800e8ec: f893 c01f ldrb.w ip, [r3, #31]
- 800e8f0: 7fd0 ldrb r0, [r2, #31]
- 800e8f2: 4584 cmp ip, r0
- 800e8f4: bf98 it ls
- 800e8f6: 461a movls r2, r3
- 800e8f8: e000 b.n 800e8fc <ip_reass_remove_oldest_datagram+0x48>
- r = reassdatagrams;
- while (r != NULL) {
- if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
- /* Not the same datagram as fraghdr */
- other_datagrams++;
- if (oldest == NULL) {
- 800e8fa: 461a mov r2, r3
- } else if (r->timer <= oldest->timer) {
- /* older than the previous oldest */
- oldest = r;
- }
- }
- if (r->next != NULL) {
- 800e8fc: 6818 ldr r0, [r3, #0]
- 800e8fe: 2800 cmp r0, #0
- 800e900: bf18 it ne
- 800e902: 4619 movne r1, r3
- 800e904: 4603 mov r3, r0
- do {
- oldest = NULL;
- prev = NULL;
- other_datagrams = 0;
- r = reassdatagrams;
- while (r != NULL) {
- 800e906: 2b00 cmp r3, #0
- 800e908: d1df bne.n 800e8ca <ip_reass_remove_oldest_datagram+0x16>
- if (r->next != NULL) {
- prev = r;
- }
- r = r->next;
- }
- if (oldest != NULL) {
- 800e90a: b11a cbz r2, 800e914 <ip_reass_remove_oldest_datagram+0x60>
- pbufs_freed_current = ip_reass_free_complete_datagram(oldest, prev);
- 800e90c: 4610 mov r0, r2
- 800e90e: f7ff ff8d bl 800e82c <ip_reass_free_complete_datagram>
- pbufs_freed += pbufs_freed_current;
- 800e912: 182d adds r5, r5, r0
- }
- } while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1));
- 800e914: 4545 cmp r5, r8
- 800e916: da01 bge.n 800e91c <ip_reass_remove_oldest_datagram+0x68>
- 800e918: 2c01 cmp r4, #1
- 800e91a: dcd1 bgt.n 800e8c0 <ip_reass_remove_oldest_datagram+0xc>
- return pbufs_freed;
- }
- 800e91c: 4628 mov r0, r5
- 800e91e: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800e922: bf00 nop
- 800e924: 20006bbc .word 0x20006bbc
- 0800e928 <ip_reass_tmr>:
- *
- * Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
- */
- void
- ip_reass_tmr(void)
- {
- 800e928: b538 push {r3, r4, r5, lr}
- struct ip_reassdata *r, *prev = NULL;
- r = reassdatagrams;
- 800e92a: 4b09 ldr r3, [pc, #36] ; (800e950 <ip_reass_tmr+0x28>)
- * Should be called every 1000 msec (defined by IP_TMR_INTERVAL).
- */
- void
- ip_reass_tmr(void)
- {
- struct ip_reassdata *r, *prev = NULL;
- 800e92c: 2400 movs r4, #0
- r = reassdatagrams;
- 800e92e: 6818 ldr r0, [r3, #0]
- while (r != NULL) {
- 800e930: e00a b.n 800e948 <ip_reass_tmr+0x20>
- /* Decrement the timer. Once it reaches 0,
- * clean up the incomplete fragment assembly */
- if (r->timer > 0) {
- 800e932: 7fc3 ldrb r3, [r0, #31]
- 800e934: 6805 ldr r5, [r0, #0]
- 800e936: b11b cbz r3, 800e940 <ip_reass_tmr+0x18>
- r->timer--;
- 800e938: 3b01 subs r3, #1
- 800e93a: 77c3 strb r3, [r0, #31]
- LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer dec %"U16_F"\n",(u16_t)r->timer));
- prev = r;
- r = r->next;
- 800e93c: 4604 mov r4, r0
- 800e93e: e002 b.n 800e946 <ip_reass_tmr+0x1e>
- LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n"));
- tmp = r;
- /* get the next pointer before freeing */
- r = r->next;
- /* free the helper struct and all enqueued pbufs */
- ip_reass_free_complete_datagram(tmp, prev);
- 800e940: 4621 mov r1, r4
- 800e942: f7ff ff73 bl 800e82c <ip_reass_free_complete_datagram>
- /* reassembly timed out */
- struct ip_reassdata *tmp;
- LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n"));
- tmp = r;
- /* get the next pointer before freeing */
- r = r->next;
- 800e946: 4628 mov r0, r5
- ip_reass_tmr(void)
- {
- struct ip_reassdata *r, *prev = NULL;
- r = reassdatagrams;
- while (r != NULL) {
- 800e948: 2800 cmp r0, #0
- 800e94a: d1f2 bne.n 800e932 <ip_reass_tmr+0xa>
- r = r->next;
- /* free the helper struct and all enqueued pbufs */
- ip_reass_free_complete_datagram(tmp, prev);
- }
- }
- }
- 800e94c: bd38 pop {r3, r4, r5, pc}
- 800e94e: bf00 nop
- 800e950: 20006bbc .word 0x20006bbc
- 0800e954 <ip_reass>:
- * @param p points to a pbuf chain of the fragment
- * @return NULL if reassembly is incomplete, ? otherwise
- */
- struct pbuf *
- ip_reass(struct pbuf *p)
- {
- 800e954: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- struct ip_reass_helper *iprh;
- u16_t offset, len;
- u8_t clen;
- struct ip_reassdata *ipr_prev = NULL;
- IPFRAG_STATS_INC(ip_frag.recv);
- 800e958: 4ba2 ldr r3, [pc, #648] ; (800ebe4 <ip_reass+0x290>)
- snmp_inc_ipreasmreqds();
- fraghdr = (struct ip_hdr*)p->payload;
- 800e95a: 6845 ldr r5, [r0, #4]
- struct ip_reass_helper *iprh;
- u16_t offset, len;
- u8_t clen;
- struct ip_reassdata *ipr_prev = NULL;
- IPFRAG_STATS_INC(ip_frag.recv);
- 800e95c: 8e5a ldrh r2, [r3, #50] ; 0x32
- 800e95e: 3201 adds r2, #1
- 800e960: 865a strh r2, [r3, #50] ; 0x32
- snmp_inc_ipreasmreqds();
- fraghdr = (struct ip_hdr*)p->payload;
- if ((IPH_HL(fraghdr) * 4) != IP_HLEN) {
- 800e962: 782a ldrb r2, [r5, #0]
- 800e964: f002 020f and.w r2, r2, #15
- 800e968: 2a05 cmp r2, #5
- * @param p points to a pbuf chain of the fragment
- * @return NULL if reassembly is incomplete, ? otherwise
- */
- struct pbuf *
- ip_reass(struct pbuf *p)
- {
- 800e96a: 4606 mov r6, r0
- IPFRAG_STATS_INC(ip_frag.recv);
- snmp_inc_ipreasmreqds();
- fraghdr = (struct ip_hdr*)p->payload;
- if ((IPH_HL(fraghdr) * 4) != IP_HLEN) {
- 800e96c: d005 beq.n 800e97a <ip_reass+0x26>
- LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: IP options currently not supported!\n"));
- IPFRAG_STATS_INC(ip_frag.err);
- 800e96e: f8b3 2044 ldrh.w r2, [r3, #68] ; 0x44
- 800e972: 3201 adds r2, #1
- 800e974: f8a3 2044 strh.w r2, [r3, #68] ; 0x44
- goto nullreturn;
- 800e978: e11d b.n 800ebb6 <ip_reass+0x262>
- }
- offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
- 800e97a: 88e8 ldrh r0, [r5, #6]
- len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
- /* Check if we are allowed to enqueue more datagrams. */
- clen = pbuf_clen(p);
- if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
- 800e97c: 4c9a ldr r4, [pc, #616] ; (800ebe8 <ip_reass+0x294>)
- LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: IP options currently not supported!\n"));
- IPFRAG_STATS_INC(ip_frag.err);
- goto nullreturn;
- }
- offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
- 800e97e: f7fb fc39 bl 800a1f4 <lwip_ntohs>
- 800e982: 4681 mov r9, r0
- len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
- 800e984: 8868 ldrh r0, [r5, #2]
- 800e986: f7fb fc35 bl 800a1f4 <lwip_ntohs>
- 800e98a: 4682 mov sl, r0
- /* Check if we are allowed to enqueue more datagrams. */
- clen = pbuf_clen(p);
- 800e98c: 4630 mov r0, r6
- IPFRAG_STATS_INC(ip_frag.err);
- goto nullreturn;
- }
- offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
- len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
- 800e98e: f895 b000 ldrb.w fp, [r5]
- /* Check if we are allowed to enqueue more datagrams. */
- clen = pbuf_clen(p);
- 800e992: f7fc fe6f bl 800b674 <pbuf_clen>
- if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
- 800e996: 8823 ldrh r3, [r4, #0]
- 800e998: 181b adds r3, r3, r0
- 800e99a: 2b0a cmp r3, #10
- offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
- len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
- /* Check if we are allowed to enqueue more datagrams. */
- clen = pbuf_clen(p);
- 800e99c: 4680 mov r8, r0
- if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
- 800e99e: dd09 ble.n 800e9b4 <ip_reass+0x60>
- #if IP_REASS_FREE_OLDEST
- if (!ip_reass_remove_oldest_datagram(fraghdr, clen) ||
- 800e9a0: 4628 mov r0, r5
- 800e9a2: 4641 mov r1, r8
- 800e9a4: f7ff ff86 bl 800e8b4 <ip_reass_remove_oldest_datagram>
- 800e9a8: b358 cbz r0, 800ea02 <ip_reass+0xae>
- ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS))
- 800e9aa: 8823 ldrh r3, [r4, #0]
- 800e9ac: 4443 add r3, r8
- /* Check if we are allowed to enqueue more datagrams. */
- clen = pbuf_clen(p);
- if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) {
- #if IP_REASS_FREE_OLDEST
- if (!ip_reass_remove_oldest_datagram(fraghdr, clen) ||
- 800e9ae: 2b0a cmp r3, #10
- 800e9b0: dd00 ble.n 800e9b4 <ip_reass+0x60>
- 800e9b2: e026 b.n 800ea02 <ip_reass+0xae>
- }
- }
- /* Look for the datagram the fragment belongs to in the current datagram queue,
- * remembering the previous in the queue for later dequeueing. */
- for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
- 800e9b4: 4b8d ldr r3, [pc, #564] ; (800ebec <ip_reass+0x298>)
- struct ip_hdr *fraghdr;
- struct ip_reassdata *ipr;
- struct ip_reass_helper *iprh;
- u16_t offset, len;
- u8_t clen;
- struct ip_reassdata *ipr_prev = NULL;
- 800e9b6: 2700 movs r7, #0
- }
- }
- /* Look for the datagram the fragment belongs to in the current datagram queue,
- * remembering the previous in the queue for later dequeueing. */
- for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
- 800e9b8: 681c ldr r4, [r3, #0]
- 800e9ba: e019 b.n 800e9f0 <ip_reass+0x9c>
- /* Check if the incoming fragment matches the one currently present
- in the reassembly buffer. If so, we proceed with copying the
- fragment into the buffer. */
- if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) {
- 800e9bc: 68ea ldr r2, [r5, #12]
- 800e9be: 6963 ldr r3, [r4, #20]
- 800e9c0: 4293 cmp r3, r2
- 800e9c2: d113 bne.n 800e9ec <ip_reass+0x98>
- 800e9c4: 692a ldr r2, [r5, #16]
- 800e9c6: 69a3 ldr r3, [r4, #24]
- 800e9c8: 4293 cmp r3, r2
- 800e9ca: d10f bne.n 800e9ec <ip_reass+0x98>
- 800e9cc: 89a2 ldrh r2, [r4, #12]
- 800e9ce: 88ab ldrh r3, [r5, #4]
- 800e9d0: 429a cmp r2, r3
- 800e9d2: d10b bne.n 800e9ec <ip_reass+0x98>
- LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass: matching previous fragment ID=%"X16_F"\n",
- ntohs(IPH_ID(fraghdr))));
- IPFRAG_STATS_INC(ip_frag.cachehit);
- 800e9d4: 4b83 ldr r3, [pc, #524] ; (800ebe4 <ip_reass+0x290>)
- 800e9d6: f8b3 2046 ldrh.w r2, [r3, #70] ; 0x46
- 800e9da: 3201 adds r2, #1
- 800e9dc: f8a3 2046 strh.w r2, [r3, #70] ; 0x46
- /* Bail if unable to enqueue */
- if(ipr == NULL) {
- goto nullreturn;
- }
- } else {
- if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) &&
- 800e9e0: 88e8 ldrh r0, [r5, #6]
- 800e9e2: f7fb fc07 bl 800a1f4 <lwip_ntohs>
- 800e9e6: 04c0 lsls r0, r0, #19
- 800e9e8: d12d bne.n 800ea46 <ip_reass+0xf2>
- 800e9ea: e021 b.n 800ea30 <ip_reass+0xdc>
- 800e9ec: 4627 mov r7, r4
- }
- }
- /* Look for the datagram the fragment belongs to in the current datagram queue,
- * remembering the previous in the queue for later dequeueing. */
- for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) {
- 800e9ee: 6824 ldr r4, [r4, #0]
- 800e9f0: 2c00 cmp r4, #0
- 800e9f2: d1e3 bne.n 800e9bc <ip_reass+0x68>
- 800e9f4: e0e7 b.n 800ebc6 <ip_reass+0x272>
- struct ip_reassdata* ipr;
- /* No matching previous fragment found, allocate a new reassdata struct */
- ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
- if (ipr == NULL) {
- #if IP_REASS_FREE_OLDEST
- if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) {
- 800e9f6: 4628 mov r0, r5
- 800e9f8: 4641 mov r1, r8
- 800e9fa: f7ff ff5b bl 800e8b4 <ip_reass_remove_oldest_datagram>
- 800e9fe: 4540 cmp r0, r8
- 800ea00: da04 bge.n 800ea0c <ip_reass+0xb8>
- ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
- }
- if (ipr == NULL)
- #endif /* IP_REASS_FREE_OLDEST */
- {
- IPFRAG_STATS_INC(ip_frag.memerr);
- 800ea02: 4b78 ldr r3, [pc, #480] ; (800ebe4 <ip_reass+0x290>)
- 800ea04: 8f9a ldrh r2, [r3, #60] ; 0x3c
- 800ea06: 3201 adds r2, #1
- 800ea08: 879a strh r2, [r3, #60] ; 0x3c
- 800ea0a: e0d4 b.n 800ebb6 <ip_reass+0x262>
- /* No matching previous fragment found, allocate a new reassdata struct */
- ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
- if (ipr == NULL) {
- #if IP_REASS_FREE_OLDEST
- if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) {
- ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
- 800ea0c: 2005 movs r0, #5
- 800ea0e: f7fc fc37 bl 800b280 <memp_malloc>
- }
- if (ipr == NULL)
- 800ea12: 4604 mov r4, r0
- 800ea14: 2800 cmp r0, #0
- 800ea16: d0f4 beq.n 800ea02 <ip_reass+0xae>
- IPFRAG_STATS_INC(ip_frag.memerr);
- LWIP_DEBUGF(IP_REASS_DEBUG,("Failed to alloc reassdata struct\n"));
- return NULL;
- }
- }
- memset(ipr, 0, sizeof(struct ip_reassdata));
- 800ea18: 2220 movs r2, #32
- 800ea1a: 4620 mov r0, r4
- 800ea1c: 2100 movs r1, #0
- 800ea1e: f7fa fdab bl 8009578 <memset>
- ipr->timer = IP_REASS_MAXAGE;
- 800ea22: 2303 movs r3, #3
- 800ea24: 77e3 strb r3, [r4, #31]
- /* enqueue the new structure to the front of the list */
- ipr->next = reassdatagrams;
- 800ea26: 4b71 ldr r3, [pc, #452] ; (800ebec <ip_reass+0x298>)
- 800ea28: 681a ldr r2, [r3, #0]
- reassdatagrams = ipr;
- 800ea2a: 601c str r4, [r3, #0]
- }
- memset(ipr, 0, sizeof(struct ip_reassdata));
- ipr->timer = IP_REASS_MAXAGE;
- /* enqueue the new structure to the front of the list */
- ipr->next = reassdatagrams;
- 800ea2c: 6022 str r2, [r4, #0]
- 800ea2e: e004 b.n 800ea3a <ip_reass+0xe6>
- if(ipr == NULL) {
- goto nullreturn;
- }
- } else {
- if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) &&
- ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
- 800ea30: 89e0 ldrh r0, [r4, #14]
- 800ea32: f7fb fbdf bl 800a1f4 <lwip_ntohs>
- /* Bail if unable to enqueue */
- if(ipr == NULL) {
- goto nullreturn;
- }
- } else {
- if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) &&
- 800ea36: 04c0 lsls r0, r0, #19
- 800ea38: d005 beq.n 800ea46 <ip_reass+0xf2>
- ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
- /* ipr->iphdr is not the header from the first fragment, but fraghdr is
- * -> copy fraghdr into ipr->iphdr since we want to have the header
- * of the first fragment (for ICMP time exceeded and later, for copying
- * all options, if supported)*/
- SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN);
- 800ea3a: f104 0008 add.w r0, r4, #8
- 800ea3e: 4629 mov r1, r5
- 800ea40: 2214 movs r2, #20
- 800ea42: f7fa fcdf bl 8009404 <memcpy>
- }
- }
- /* Track the current number of pbufs current 'in-flight', in order to limit
- the number of fragments that may be enqueued at any one time */
- ip_reass_pbufcount += clen;
- 800ea46: 4b68 ldr r3, [pc, #416] ; (800ebe8 <ip_reass+0x294>)
- 800ea48: 881a ldrh r2, [r3, #0]
- 800ea4a: 4490 add r8, r2
- 800ea4c: f8a3 8000 strh.w r8, [r3]
- /* At this point, we have either created a new entry or pointing
- * to an existing one */
- /* check for 'no more fragments', and update queue entry*/
- if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) {
- 800ea50: 88eb ldrh r3, [r5, #6]
- 800ea52: f003 0320 and.w r3, r3, #32
- 800ea56: b29b uxth r3, r3
- 800ea58: b95b cbnz r3, 800ea72 <ip_reass+0x11e>
- ipr->flags |= IP_REASS_FLAG_LASTFRAG;
- 800ea5a: 7fa3 ldrb r3, [r4, #30]
- IPFRAG_STATS_INC(ip_frag.err);
- goto nullreturn;
- }
- offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
- len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
- 800ea5c: f00b 0b0f and.w fp, fp, #15
- 800ea60: ebaa 0a8b sub.w sl, sl, fp, lsl #2
- /* At this point, we have either created a new entry or pointing
- * to an existing one */
- /* check for 'no more fragments', and update queue entry*/
- if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) {
- ipr->flags |= IP_REASS_FLAG_LASTFRAG;
- 800ea64: f043 0301 orr.w r3, r3, #1
- ipr->datagram_len = offset + len;
- 800ea68: eb0a 09c9 add.w r9, sl, r9, lsl #3
- /* At this point, we have either created a new entry or pointing
- * to an existing one */
- /* check for 'no more fragments', and update queue entry*/
- if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) {
- ipr->flags |= IP_REASS_FLAG_LASTFRAG;
- 800ea6c: 77a3 strb r3, [r4, #30]
- ipr->datagram_len = offset + len;
- 800ea6e: f8a4 901c strh.w r9, [r4, #28]
- u16_t offset,len;
- struct ip_hdr *fraghdr;
- int valid = 1;
- /* Extract length and fragment offset from current fragment */
- fraghdr = (struct ip_hdr*)new_p->payload;
- 800ea72: 6875 ldr r5, [r6, #4]
- len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4;
- 800ea74: 8868 ldrh r0, [r5, #2]
- 800ea76: f7fb fbbd bl 800a1f4 <lwip_ntohs>
- 800ea7a: f895 9000 ldrb.w r9, [r5]
- 800ea7e: f009 090f and.w r9, r9, #15
- 800ea82: eba0 0089 sub.w r0, r0, r9, lsl #2
- 800ea86: fa1f f980 uxth.w r9, r0
- offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8;
- 800ea8a: 88e8 ldrh r0, [r5, #6]
- 800ea8c: f7fb fbb2 bl 800a1f4 <lwip_ntohs>
- 800ea90: 04c0 lsls r0, r0, #19
- 800ea92: 0c01 lsrs r1, r0, #16
- /* overwrite the fragment's ip header from the pbuf with our helper struct,
- * and setup the embedded helper structure. */
- /* make sure the struct ip_reass_helper fits into the IP header */
- LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
- sizeof(struct ip_reass_helper) <= IP_HLEN);
- iprh = (struct ip_reass_helper*)new_p->payload;
- 800ea94: 6873 ldr r3, [r6, #4]
- iprh->next_pbuf = NULL;
- iprh->start = offset;
- iprh->end = offset + len;
- 800ea96: 4489 add r9, r1
- * and setup the embedded helper structure. */
- /* make sure the struct ip_reass_helper fits into the IP header */
- LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
- sizeof(struct ip_reass_helper) <= IP_HLEN);
- iprh = (struct ip_reass_helper*)new_p->payload;
- iprh->next_pbuf = NULL;
- 800ea98: 2200 movs r2, #0
- iprh->start = offset;
- iprh->end = offset + len;
- 800ea9a: fa1f f989 uxth.w r9, r9
- * and setup the embedded helper structure. */
- /* make sure the struct ip_reass_helper fits into the IP header */
- LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN",
- sizeof(struct ip_reass_helper) <= IP_HLEN);
- iprh = (struct ip_reass_helper*)new_p->payload;
- iprh->next_pbuf = NULL;
- 800ea9e: 701a strb r2, [r3, #0]
- 800eaa0: 705a strb r2, [r3, #1]
- 800eaa2: 709a strb r2, [r3, #2]
- 800eaa4: 70da strb r2, [r3, #3]
- iprh->start = offset;
- 800eaa6: 8099 strh r1, [r3, #4]
- iprh->end = offset + len;
- 800eaa8: f8a3 9006 strh.w r9, [r3, #6]
- /* Iterate through until we either get to the end of the list (append),
- * or we find on with a larger offset (insert). */
- for (q = ipr->p; q != NULL;) {
- 800eaac: 6865 ldr r5, [r4, #4]
- {
- struct ip_reass_helper *iprh, *iprh_tmp, *iprh_prev=NULL;
- struct pbuf *q;
- u16_t offset,len;
- struct ip_hdr *fraghdr;
- int valid = 1;
- 800eaae: 2001 movs r0, #1
- 800eab0: e01b b.n 800eaea <ip_reass+0x196>
- iprh->end = offset + len;
- /* Iterate through until we either get to the end of the list (append),
- * or we find on with a larger offset (insert). */
- for (q = ipr->p; q != NULL;) {
- iprh_tmp = (struct ip_reass_helper*)q->payload;
- 800eab2: f8d5 c004 ldr.w ip, [r5, #4]
- if (iprh->start < iprh_tmp->start) {
- 800eab6: f8bc 8004 ldrh.w r8, [ip, #4]
- 800eaba: 4541 cmp r1, r8
- 800eabc: d208 bcs.n 800ead0 <ip_reass+0x17c>
- /* the new pbuf should be inserted before this */
- iprh->next_pbuf = q;
- 800eabe: 601d str r5, [r3, #0]
- if (iprh_prev != NULL) {
- 800eac0: b1e2 cbz r2, 800eafc <ip_reass+0x1a8>
- /* not the fragment with the lowest offset */
- #if IP_REASS_CHECK_OVERLAP
- if ((iprh->start < iprh_prev->end) || (iprh->end > iprh_tmp->start)) {
- 800eac2: 88d5 ldrh r5, [r2, #6]
- 800eac4: 428d cmp r5, r1
- 800eac6: d830 bhi.n 800eb2a <ip_reass+0x1d6>
- 800eac8: 45c1 cmp r9, r8
- 800eaca: d82e bhi.n 800eb2a <ip_reass+0x1d6>
- /* fragment overlaps with previous or following, throw away */
- goto freepbuf;
- }
- #endif /* IP_REASS_CHECK_OVERLAP */
- iprh_prev->next_pbuf = new_p;
- 800eacc: 6016 str r6, [r2, #0]
- 800eace: e016 b.n 800eafe <ip_reass+0x1aa>
- } else {
- /* fragment with the lowest offset */
- ipr->p = new_p;
- }
- break;
- } else if(iprh->start == iprh_tmp->start) {
- 800ead0: d02b beq.n 800eb2a <ip_reass+0x1d6>
- /* received the same datagram twice: no need to keep the datagram */
- goto freepbuf;
- #if IP_REASS_CHECK_OVERLAP
- } else if(iprh->start < iprh_tmp->end) {
- 800ead2: f8bc 5006 ldrh.w r5, [ip, #6]
- 800ead6: 428d cmp r5, r1
- 800ead8: d827 bhi.n 800eb2a <ip_reass+0x1d6>
- /* overlap: no need to keep the new datagram */
- goto freepbuf;
- #endif /* IP_REASS_CHECK_OVERLAP */
- } else {
- /* Check if the fragments received so far have no wholes. */
- if (iprh_prev != NULL) {
- 800eada: b11a cbz r2, 800eae4 <ip_reass+0x190>
- if (iprh_prev->end != iprh_tmp->start) {
- 800eadc: 88d2 ldrh r2, [r2, #6]
- /* There is a fragment missing between the current
- * and the previous fragment */
- valid = 0;
- 800eade: 4542 cmp r2, r8
- 800eae0: bf18 it ne
- 800eae2: 2000 movne r0, #0
- }
- }
- }
- q = iprh_tmp->next_pbuf;
- 800eae4: f8dc 5000 ldr.w r5, [ip]
- 800eae8: 4662 mov r2, ip
- iprh->start = offset;
- iprh->end = offset + len;
- /* Iterate through until we either get to the end of the list (append),
- * or we find on with a larger offset (insert). */
- for (q = ipr->p; q != NULL;) {
- 800eaea: 2d00 cmp r5, #0
- 800eaec: d1e1 bne.n 800eab2 <ip_reass+0x15e>
- 800eaee: e072 b.n 800ebd6 <ip_reass+0x282>
- /* this is (for now), the fragment with the highest offset:
- * chain it to the last fragment */
- #if IP_REASS_CHECK_OVERLAP
- LWIP_ASSERT("check fragments don't overlap", iprh_prev->end <= iprh->start);
- #endif /* IP_REASS_CHECK_OVERLAP */
- iprh_prev->next_pbuf = new_p;
- 800eaf0: 6016 str r6, [r2, #0]
- if (iprh_prev->end != iprh->start) {
- 800eaf2: 88d2 ldrh r2, [r2, #6]
- valid = 0;
- 800eaf4: 428a cmp r2, r1
- 800eaf6: bf18 it ne
- 800eaf8: 2000 movne r0, #0
- 800eafa: e000 b.n 800eafe <ip_reass+0x1aa>
- #if IP_REASS_CHECK_OVERLAP
- LWIP_ASSERT("no previous fragment, this must be the first fragment!",
- ipr->p == NULL);
- #endif /* IP_REASS_CHECK_OVERLAP */
- /* this is the first fragment we ever received for this ip datagram */
- ipr->p = new_p;
- 800eafc: 6066 str r6, [r4, #4]
- }
- }
- /* At this point, the validation part begins: */
- /* If we already received the last fragment */
- if ((ipr->flags & IP_REASS_FLAG_LASTFRAG) != 0) {
- 800eafe: 7fa2 ldrb r2, [r4, #30]
- 800eb00: 07d2 lsls r2, r2, #31
- 800eb02: d56b bpl.n 800ebdc <ip_reass+0x288>
- /* and had no wholes so far */
- if (valid) {
- 800eb04: 2800 cmp r0, #0
- 800eb06: d069 beq.n 800ebdc <ip_reass+0x288>
- /* then check if the rest of the fragments is here */
- /* Check if the queue starts with the first datagram */
- if (((struct ip_reass_helper*)ipr->p->payload)->start != 0) {
- 800eb08: 6862 ldr r2, [r4, #4]
- 800eb0a: 6855 ldr r5, [r2, #4]
- 800eb0c: 88aa ldrh r2, [r5, #4]
- 800eb0e: 2a00 cmp r2, #0
- 800eb10: d164 bne.n 800ebdc <ip_reass+0x288>
- valid = 0;
- } else {
- /* and check that there are no wholes after this datagram */
- iprh_prev = iprh;
- q = iprh->next_pbuf;
- 800eb12: 681e ldr r6, [r3, #0]
- 800eb14: e006 b.n 800eb24 <ip_reass+0x1d0>
- while (q != NULL) {
- iprh = (struct ip_reass_helper*)q->payload;
- 800eb16: 6872 ldr r2, [r6, #4]
- if (iprh_prev->end != iprh->start) {
- 800eb18: 88d9 ldrh r1, [r3, #6]
- 800eb1a: 8893 ldrh r3, [r2, #4]
- 800eb1c: 4299 cmp r1, r3
- 800eb1e: d15d bne.n 800ebdc <ip_reass+0x288>
- valid = 0;
- break;
- }
- iprh_prev = iprh;
- q = iprh->next_pbuf;
- 800eb20: 6816 ldr r6, [r2, #0]
- 800eb22: 4613 mov r3, r2
- valid = 0;
- } else {
- /* and check that there are no wholes after this datagram */
- iprh_prev = iprh;
- q = iprh->next_pbuf;
- while (q != NULL) {
- 800eb24: 2e00 cmp r6, #0
- 800eb26: d1f6 bne.n 800eb16 <ip_reass+0x1c2>
- 800eb28: e007 b.n 800eb3a <ip_reass+0x1e6>
- }
- /* If we come here, not all fragments were received, yet! */
- return 0; /* not yet valid! */
- #if IP_REASS_CHECK_OVERLAP
- freepbuf:
- ip_reass_pbufcount -= pbuf_clen(new_p);
- 800eb2a: 4c2f ldr r4, [pc, #188] ; (800ebe8 <ip_reass+0x294>)
- 800eb2c: 4630 mov r0, r6
- 800eb2e: 8825 ldrh r5, [r4, #0]
- 800eb30: f7fc fda0 bl 800b674 <pbuf_clen>
- 800eb34: 1a28 subs r0, r5, r0
- 800eb36: 8020 strh r0, [r4, #0]
- 800eb38: e041 b.n 800ebbe <ip_reass+0x26a>
- /* find the right place to insert this pbuf */
- /* @todo: trim pbufs if fragments are overlapping */
- if (ip_reass_chain_frag_into_datagram_and_validate(ipr, p)) {
- /* the totally last fragment (flag more fragments = 0) was received at least
- * once AND all fragments are received */
- ipr->datagram_len += IP_HLEN;
- 800eb3a: 8ba3 ldrh r3, [r4, #28]
- 800eb3c: 3314 adds r3, #20
- 800eb3e: 83a3 strh r3, [r4, #28]
- /* save the second pbuf before copying the header over the pointer */
- r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
- /* copy the original ip header back to the first pbuf */
- fraghdr = (struct ip_hdr*)(ipr->p->payload);
- SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
- 800eb40: f104 0108 add.w r1, r4, #8
- 800eb44: 2214 movs r2, #20
- 800eb46: 4628 mov r0, r5
- /* the totally last fragment (flag more fragments = 0) was received at least
- * once AND all fragments are received */
- ipr->datagram_len += IP_HLEN;
- /* save the second pbuf before copying the header over the pointer */
- r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
- 800eb48: f8d5 8000 ldr.w r8, [r5]
- /* copy the original ip header back to the first pbuf */
- fraghdr = (struct ip_hdr*)(ipr->p->payload);
- SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
- 800eb4c: f7fa fc5a bl 8009404 <memcpy>
- IPH_LEN_SET(fraghdr, htons(ipr->datagram_len));
- 800eb50: 8ba0 ldrh r0, [r4, #28]
- 800eb52: f7fb fb4a bl 800a1ea <lwip_htons>
- IPH_OFFSET_SET(fraghdr, 0);
- 800eb56: 71ae strb r6, [r5, #6]
- r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf;
- /* copy the original ip header back to the first pbuf */
- fraghdr = (struct ip_hdr*)(ipr->p->payload);
- SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
- IPH_LEN_SET(fraghdr, htons(ipr->datagram_len));
- 800eb58: 8068 strh r0, [r5, #2]
- IPH_OFFSET_SET(fraghdr, 0);
- 800eb5a: 71ee strb r6, [r5, #7]
- IPH_CHKSUM_SET(fraghdr, 0);
- 800eb5c: 72ae strb r6, [r5, #10]
- 800eb5e: 72ee strb r6, [r5, #11]
- /* @todo: do we need to set calculate the correct checksum? */
- IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));
- 800eb60: 4628 mov r0, r5
- 800eb62: 2114 movs r1, #20
- 800eb64: f7ff fbe3 bl 800e32e <inet_chksum>
- 800eb68: 8168 strh r0, [r5, #10]
- p = ipr->p;
- 800eb6a: 6865 ldr r5, [r4, #4]
- /* chain together the pbufs contained within the reass_data list. */
- while(r != NULL) {
- 800eb6c: e00c b.n 800eb88 <ip_reass+0x234>
- iprh = (struct ip_reass_helper*)r->payload;
- 800eb6e: f8d8 6004 ldr.w r6, [r8, #4]
- /* hide the ip header for every succeding fragment */
- pbuf_header(r, -IP_HLEN);
- 800eb72: 4640 mov r0, r8
- 800eb74: f06f 0113 mvn.w r1, #19
- 800eb78: f7fc fc79 bl 800b46e <pbuf_header>
- pbuf_cat(p, r);
- 800eb7c: 4641 mov r1, r8
- 800eb7e: 4628 mov r0, r5
- 800eb80: f7fc fd86 bl 800b690 <pbuf_cat>
- r = iprh->next_pbuf;
- 800eb84: f8d6 8000 ldr.w r8, [r6]
- IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN));
- p = ipr->p;
- /* chain together the pbufs contained within the reass_data list. */
- while(r != NULL) {
- 800eb88: f1b8 0f00 cmp.w r8, #0
- 800eb8c: d1ef bne.n 800eb6e <ip_reass+0x21a>
- static void
- ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
- {
-
- /* dequeue the reass struct */
- if (reassdatagrams == ipr) {
- 800eb8e: 4b17 ldr r3, [pc, #92] ; (800ebec <ip_reass+0x298>)
- 800eb90: 681a ldr r2, [r3, #0]
- 800eb92: 42a2 cmp r2, r4
- /* it was the first in the list */
- reassdatagrams = ipr->next;
- 800eb94: bf0b itete eq
- 800eb96: 6822 ldreq r2, [r4, #0]
- } else {
- /* it wasn't the first, so it must have a valid 'prev' */
- LWIP_ASSERT("sanity check linked list", prev != NULL);
- prev->next = ipr->next;
- 800eb98: 6823 ldrne r3, [r4, #0]
- {
-
- /* dequeue the reass struct */
- if (reassdatagrams == ipr) {
- /* it was the first in the list */
- reassdatagrams = ipr->next;
- 800eb9a: 601a streq r2, [r3, #0]
- } else {
- /* it wasn't the first, so it must have a valid 'prev' */
- LWIP_ASSERT("sanity check linked list", prev != NULL);
- prev->next = ipr->next;
- 800eb9c: 603b strne r3, [r7, #0]
- }
- /* now we can free the ip_reass struct */
- memp_free(MEMP_REASSDATA, ipr);
- 800eb9e: 4621 mov r1, r4
- 800eba0: 2005 movs r0, #5
- }
- /* release the sources allocate for the fragment queue entry */
- ip_reass_dequeue_datagram(ipr, ipr_prev);
- /* and adjust the number of pbufs currently queued for reassembly. */
- ip_reass_pbufcount -= pbuf_clen(p);
- 800eba2: 4c11 ldr r4, [pc, #68] ; (800ebe8 <ip_reass+0x294>)
- LWIP_ASSERT("sanity check linked list", prev != NULL);
- prev->next = ipr->next;
- }
- /* now we can free the ip_reass struct */
- memp_free(MEMP_REASSDATA, ipr);
- 800eba4: f7fc fb96 bl 800b2d4 <memp_free>
- }
- /* release the sources allocate for the fragment queue entry */
- ip_reass_dequeue_datagram(ipr, ipr_prev);
- /* and adjust the number of pbufs currently queued for reassembly. */
- ip_reass_pbufcount -= pbuf_clen(p);
- 800eba8: 4628 mov r0, r5
- 800ebaa: 8826 ldrh r6, [r4, #0]
- 800ebac: f7fc fd62 bl 800b674 <pbuf_clen>
- 800ebb0: 1a30 subs r0, r6, r0
- 800ebb2: 8020 strh r0, [r4, #0]
- /* Return the pbuf chain */
- return p;
- 800ebb4: e013 b.n 800ebde <ip_reass+0x28a>
- LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass_pbufcount: %d out\n", ip_reass_pbufcount));
- return NULL;
- nullreturn:
- LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: nullreturn\n"));
- IPFRAG_STATS_INC(ip_frag.drop);
- 800ebb6: 4b0b ldr r3, [pc, #44] ; (800ebe4 <ip_reass+0x290>)
- 800ebb8: 8eda ldrh r2, [r3, #54] ; 0x36
- 800ebba: 3201 adds r2, #1
- 800ebbc: 86da strh r2, [r3, #54] ; 0x36
- pbuf_free(p);
- 800ebbe: 4630 mov r0, r6
- 800ebc0: f7fc fc80 bl 800b4c4 <pbuf_free>
- 800ebc4: e00a b.n 800ebdc <ip_reass+0x288>
- static struct ip_reassdata*
- ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen)
- {
- struct ip_reassdata* ipr;
- /* No matching previous fragment found, allocate a new reassdata struct */
- ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA);
- 800ebc6: 2005 movs r0, #5
- 800ebc8: f7fc fb5a bl 800b280 <memp_malloc>
- if (ipr == NULL) {
- 800ebcc: 4604 mov r4, r0
- 800ebce: 2800 cmp r0, #0
- 800ebd0: f47f af22 bne.w 800ea18 <ip_reass+0xc4>
- 800ebd4: e70f b.n 800e9f6 <ip_reass+0xa2>
- iprh_prev = iprh_tmp;
- }
- /* If q is NULL, then we made it to the end of the list. Determine what to do now */
- if (q == NULL) {
- if (iprh_prev != NULL) {
- 800ebd6: 2a00 cmp r2, #0
- 800ebd8: d18a bne.n 800eaf0 <ip_reass+0x19c>
- 800ebda: e78f b.n 800eafc <ip_reass+0x1a8>
- /* Return the pbuf chain */
- return p;
- }
- /* the datagram is not (yet?) reassembled completely */
- LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass_pbufcount: %d out\n", ip_reass_pbufcount));
- return NULL;
- 800ebdc: 2500 movs r5, #0
- nullreturn:
- LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass: nullreturn\n"));
- IPFRAG_STATS_INC(ip_frag.drop);
- pbuf_free(p);
- return NULL;
- }
- 800ebde: 4628 mov r0, r5
- 800ebe0: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800ebe4: 20008220 .word 0x20008220
- 800ebe8: 20006bc0 .word 0x20006bc0
- 800ebec: 20006bbc .word 0x20006bbc
- 0800ebf0 <ip_frag>:
- *
- * @return ERR_OK if sent successfully, err_t otherwise
- */
- err_t
- ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
- {
- 800ebf0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- struct ip_hdr *original_iphdr;
- #endif
- struct ip_hdr *iphdr;
- u16_t nfb;
- u16_t left, cop;
- u16_t mtu = netif->mtu;
- 800ebf4: 8c8d ldrh r5, [r1, #36] ; 0x24
- *
- * @return ERR_OK if sent successfully, err_t otherwise
- */
- err_t
- ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
- {
- 800ebf6: b08d sub sp, #52 ; 0x34
- 800ebf8: 468a mov sl, r1
- /* Copy the IP header in it */
- iphdr = (struct ip_hdr *)rambuf->payload;
- SMEMCPY(iphdr, p->payload, IP_HLEN);
- #else /* IP_FRAG_USES_STATIC_BUF */
- original_iphdr = (struct ip_hdr *)p->payload;
- 800ebfa: 6841 ldr r1, [r0, #4]
- *
- * @return ERR_OK if sent successfully, err_t otherwise
- */
- err_t
- ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
- {
- 800ebfc: 920a str r2, [sp, #40] ; 0x28
- /* Copy the IP header in it */
- iphdr = (struct ip_hdr *)rambuf->payload;
- SMEMCPY(iphdr, p->payload, IP_HLEN);
- #else /* IP_FRAG_USES_STATIC_BUF */
- original_iphdr = (struct ip_hdr *)p->payload;
- 800ebfe: 9106 str r1, [sp, #24]
- *
- * @return ERR_OK if sent successfully, err_t otherwise
- */
- err_t
- ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)
- {
- 800ec00: 4604 mov r4, r0
- original_iphdr = (struct ip_hdr *)p->payload;
- iphdr = original_iphdr;
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Save original offset */
- tmp = ntohs(IPH_OFFSET(iphdr));
- 800ec02: 88c8 ldrh r0, [r1, #6]
- 800ec04: f7fb faf6 bl 800a1f4 <lwip_ntohs>
- ofo = tmp & IP_OFFMASK;
- 800ec08: 04c3 lsls r3, r0, #19
- 800ec0a: 0cdb lsrs r3, r3, #19
- omf = tmp & IP_MF;
- left = p->tot_len - IP_HLEN;
- nfb = (mtu - IP_HLEN) / 8;
- 800ec0c: f1a5 0214 sub.w r2, r5, #20
- iphdr = original_iphdr;
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Save original offset */
- tmp = ntohs(IPH_OFFSET(iphdr));
- ofo = tmp & IP_OFFMASK;
- 800ec10: 9304 str r3, [sp, #16]
- omf = tmp & IP_MF;
- left = p->tot_len - IP_HLEN;
- nfb = (mtu - IP_HLEN) / 8;
- 800ec12: 2308 movs r3, #8
- 800ec14: fb92 f3f3 sdiv r3, r2, r3
- 800ec18: b29b uxth r3, r3
- /* Save original offset */
- tmp = ntohs(IPH_OFFSET(iphdr));
- ofo = tmp & IP_OFFMASK;
- omf = tmp & IP_MF;
- left = p->tot_len - IP_HLEN;
- 800ec1a: 8926 ldrh r6, [r4, #8]
- nfb = (mtu - IP_HLEN) / 8;
- 800ec1c: 9307 str r3, [sp, #28]
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Save original offset */
- tmp = ntohs(IPH_OFFSET(iphdr));
- ofo = tmp & IP_OFFMASK;
- omf = tmp & IP_MF;
- 800ec1e: f400 5000 and.w r0, r0, #8192 ; 0x2000
- if (!last) {
- tmp = tmp | IP_MF;
- }
- /* Fill this fragment */
- cop = last ? left : nfb * 8;
- 800ec22: 00db lsls r3, r3, #3
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Save original offset */
- tmp = ntohs(IPH_OFFSET(iphdr));
- ofo = tmp & IP_OFFMASK;
- omf = tmp & IP_MF;
- 800ec24: b280 uxth r0, r0
- left = p->tot_len - IP_HLEN;
- 800ec26: 3e14 subs r6, #20
- if (!last) {
- tmp = tmp | IP_MF;
- }
- /* Fill this fragment */
- cop = last ? left : nfb * 8;
- 800ec28: b29b uxth r3, r3
- left = p->tot_len - IP_HLEN;
- nfb = (mtu - IP_HLEN) / 8;
- while (left) {
- last = (left <= mtu - IP_HLEN);
- 800ec2a: 3d13 subs r5, #19
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Save original offset */
- tmp = ntohs(IPH_OFFSET(iphdr));
- ofo = tmp & IP_OFFMASK;
- omf = tmp & IP_MF;
- 800ec2c: 9008 str r0, [sp, #32]
- left = p->tot_len - IP_HLEN;
- 800ec2e: b2b6 uxth r6, r6
- if (!last) {
- tmp = tmp | IP_MF;
- }
- /* Fill this fragment */
- cop = last ? left : nfb * 8;
- 800ec30: 9309 str r3, [sp, #36] ; 0x24
- u16_t ofo, omf;
- u16_t last;
- u16_t poff = IP_HLEN;
- u16_t tmp;
- #if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF
- u16_t newpbuflen = 0;
- 800ec32: 2700 movs r7, #0
- u16_t nfb;
- u16_t left, cop;
- u16_t mtu = netif->mtu;
- u16_t ofo, omf;
- u16_t last;
- u16_t poff = IP_HLEN;
- 800ec34: f04f 0914 mov.w r9, #20
- left = p->tot_len - IP_HLEN;
- nfb = (mtu - IP_HLEN) / 8;
- while (left) {
- last = (left <= mtu - IP_HLEN);
- 800ec38: 950b str r5, [sp, #44] ; 0x2c
- left = p->tot_len - IP_HLEN;
- nfb = (mtu - IP_HLEN) / 8;
- while (left) {
- 800ec3a: e098 b.n 800ed6e <ip_frag+0x17e>
- last = (left <= mtu - IP_HLEN);
- /* Set new offset and MF flag */
- tmp = omf | (IP_OFFMASK & (ofo));
- 800ec3c: 9a04 ldr r2, [sp, #16]
- 800ec3e: 9b08 ldr r3, [sp, #32]
- if (!last) {
- 800ec40: 990b ldr r1, [sp, #44] ; 0x2c
- while (left) {
- last = (left <= mtu - IP_HLEN);
- /* Set new offset and MF flag */
- tmp = omf | (IP_OFFMASK & (ofo));
- 800ec42: ea4f 4bc2 mov.w fp, r2, lsl #19
- 800ec46: ea43 4bdb orr.w fp, r3, fp, lsr #19
- if (!last) {
- 800ec4a: 42b1 cmp r1, r6
- while (left) {
- last = (left <= mtu - IP_HLEN);
- /* Set new offset and MF flag */
- tmp = omf | (IP_OFFMASK & (ofo));
- 800ec4c: f8cd b014 str.w fp, [sp, #20]
- if (!last) {
- 800ec50: dc05 bgt.n 800ec5e <ip_frag+0x6e>
- tmp = tmp | IP_MF;
- 800ec52: f44b 5200 orr.w r2, fp, #8192 ; 0x2000
- 800ec56: 9205 str r2, [sp, #20]
- }
- /* Fill this fragment */
- cop = last ? left : nfb * 8;
- 800ec58: f8dd b024 ldr.w fp, [sp, #36] ; 0x24
- 800ec5c: e000 b.n 800ec60 <ip_frag+0x70>
- while (left) {
- last = (left <= mtu - IP_HLEN);
- /* Set new offset and MF flag */
- tmp = omf | (IP_OFFMASK & (ofo));
- if (!last) {
- 800ec5e: 46b3 mov fp, r6
- /* When not using a static buffer, create a chain of pbufs.
- * The first will be a PBUF_RAM holding the link and IP header.
- * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged,
- * but limited to the size of an mtu.
- */
- rambuf = pbuf_alloc(PBUF_LINK, IP_HLEN, PBUF_RAM);
- 800ec60: 2002 movs r0, #2
- 800ec62: 2114 movs r1, #20
- 800ec64: 2200 movs r2, #0
- 800ec66: f7fc fc7e bl 800b566 <pbuf_alloc>
- if (rambuf == NULL) {
- 800ec6a: 4605 mov r5, r0
- 800ec6c: 2800 cmp r0, #0
- 800ec6e: f000 8083 beq.w 800ed78 <ip_frag+0x188>
- return ERR_MEM;
- }
- LWIP_ASSERT("this needs a pbuf in one piece!",
- (p->len >= (IP_HLEN)));
- SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN);
- 800ec72: 6840 ldr r0, [r0, #4]
- 800ec74: 9906 ldr r1, [sp, #24]
- 800ec76: 2214 movs r2, #20
- 800ec78: f7fa fbc4 bl 8009404 <memcpy>
- iphdr = (struct ip_hdr *)rambuf->payload;
- /* Can just adjust p directly for needed offset. */
- p->payload = (u8_t *)p->payload + poff;
- 800ec7c: 6863 ldr r3, [r4, #4]
- return ERR_MEM;
- }
- LWIP_ASSERT("this needs a pbuf in one piece!",
- (p->len >= (IP_HLEN)));
- SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN);
- iphdr = (struct ip_hdr *)rambuf->payload;
- 800ec7e: f8d5 8004 ldr.w r8, [r5, #4]
- /* Can just adjust p directly for needed offset. */
- p->payload = (u8_t *)p->payload + poff;
- 800ec82: 444b add r3, r9
- 800ec84: 6063 str r3, [r4, #4]
- p->len -= poff;
- 800ec86: 8963 ldrh r3, [r4, #10]
- 800ec88: ebc9 0903 rsb r9, r9, r3
- 800ec8c: f8a4 900a strh.w r9, [r4, #10]
- left_to_copy = cop;
- 800ec90: 46d9 mov r9, fp
- while (left_to_copy) {
- 800ec92: e03c b.n 800ed0e <ip_frag+0x11e>
- struct pbuf_custom_ref *pcr;
- newpbuflen = (left_to_copy < p->len) ? left_to_copy : p->len;
- 800ec94: 8967 ldrh r7, [r4, #10]
- 800ec96: 45b9 cmp r9, r7
- 800ec98: bf38 it cc
- 800ec9a: 464f movcc r7, r9
- 800ec9c: b2bf uxth r7, r7
- /* Is this pbuf already empty? */
- if (!newpbuflen) {
- 800ec9e: b907 cbnz r7, 800eca2 <ip_frag+0xb2>
- 800eca0: e034 b.n 800ed0c <ip_frag+0x11c>
- #if !LWIP_NETIF_TX_SINGLE_PBUF
- /** Allocate a new struct pbuf_custom_ref */
- static struct pbuf_custom_ref*
- ip_frag_alloc_pbuf_custom_ref(void)
- {
- return (struct pbuf_custom_ref*)memp_malloc(MEMP_FRAG_PBUF);
- 800eca2: 2006 movs r0, #6
- 800eca4: f7fc faec bl 800b280 <memp_malloc>
- if (!newpbuflen) {
- p = p->next;
- continue;
- }
- pcr = ip_frag_alloc_pbuf_custom_ref();
- if (pcr == NULL) {
- 800eca8: 4684 mov ip, r0
- 800ecaa: b900 cbnz r0, 800ecae <ip_frag+0xbe>
- 800ecac: e012 b.n 800ecd4 <ip_frag+0xe4>
- pbuf_free(rambuf);
- return ERR_MEM;
- }
- /* Mirror this pbuf, although we might not need all of it. */
- newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, p->payload, newpbuflen);
- 800ecae: 6863 ldr r3, [r4, #4]
- 800ecb0: f8cd c008 str.w ip, [sp, #8]
- 800ecb4: e88d 0088 stmia.w sp, {r3, r7}
- 800ecb8: 4639 mov r1, r7
- 800ecba: 4663 mov r3, ip
- 800ecbc: 2003 movs r0, #3
- 800ecbe: 2202 movs r2, #2
- 800ecc0: f7fc fbad bl 800b41e <pbuf_alloced_custom>
- if (newpbuf == NULL) {
- 800ecc4: f8dd c008 ldr.w ip, [sp, #8]
- 800ecc8: 4601 mov r1, r0
- 800ecca: b938 cbnz r0, 800ecdc <ip_frag+0xec>
- /** Free a struct pbuf_custom_ref */
- static void
- ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p)
- {
- LWIP_ASSERT("p != NULL", p != NULL);
- memp_free(MEMP_FRAG_PBUF, p);
- 800eccc: 2006 movs r0, #6
- 800ecce: 4661 mov r1, ip
- 800ecd0: f7fc fb00 bl 800b2d4 <memp_free>
- }
- /* Mirror this pbuf, although we might not need all of it. */
- newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, p->payload, newpbuflen);
- if (newpbuf == NULL) {
- ip_frag_free_pbuf_custom_ref(pcr);
- pbuf_free(rambuf);
- 800ecd4: 4628 mov r0, r5
- 800ecd6: f7fc fbf5 bl 800b4c4 <pbuf_free>
- 800ecda: e04d b.n 800ed78 <ip_frag+0x188>
- return ERR_MEM;
- }
- pbuf_ref(p);
- 800ecdc: 4620 mov r0, r4
- 800ecde: 9103 str r1, [sp, #12]
- 800ece0: f8cd c008 str.w ip, [sp, #8]
- 800ece4: f7fc fccf bl 800b686 <pbuf_ref>
- pcr->original = p;
- 800ece8: f8dd c008 ldr.w ip, [sp, #8]
- pcr->pc.custom_free_function = ipfrag_free_pbuf_custom;
- 800ecec: 4b25 ldr r3, [pc, #148] ; (800ed84 <ip_frag+0x194>)
- ip_frag_free_pbuf_custom_ref(pcr);
- pbuf_free(rambuf);
- return ERR_MEM;
- }
- pbuf_ref(p);
- pcr->original = p;
- 800ecee: f8cc 4014 str.w r4, [ip, #20]
- /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain
- * so that it is removed when pbuf_dechain is later called on rambuf.
- */
- pbuf_cat(rambuf, newpbuf);
- left_to_copy -= newpbuflen;
- 800ecf2: ebc7 0909 rsb r9, r7, r9
- pbuf_free(rambuf);
- return ERR_MEM;
- }
- pbuf_ref(p);
- pcr->original = p;
- pcr->pc.custom_free_function = ipfrag_free_pbuf_custom;
- 800ecf6: f8cc 3010 str.w r3, [ip, #16]
- /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain
- * so that it is removed when pbuf_dechain is later called on rambuf.
- */
- pbuf_cat(rambuf, newpbuf);
- 800ecfa: 4628 mov r0, r5
- 800ecfc: 9903 ldr r1, [sp, #12]
- left_to_copy -= newpbuflen;
- 800ecfe: fa1f f989 uxth.w r9, r9
- pcr->pc.custom_free_function = ipfrag_free_pbuf_custom;
- /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain
- * so that it is removed when pbuf_dechain is later called on rambuf.
- */
- pbuf_cat(rambuf, newpbuf);
- 800ed02: f7fc fcc5 bl 800b690 <pbuf_cat>
- left_to_copy -= newpbuflen;
- if (left_to_copy) {
- 800ed06: f1b9 0f00 cmp.w r9, #0
- 800ed0a: d003 beq.n 800ed14 <ip_frag+0x124>
- p = p->next;
- 800ed0c: 6824 ldr r4, [r4, #0]
- /* Can just adjust p directly for needed offset. */
- p->payload = (u8_t *)p->payload + poff;
- p->len -= poff;
- left_to_copy = cop;
- while (left_to_copy) {
- 800ed0e: f1b9 0f00 cmp.w r9, #0
- 800ed12: d1bf bne.n 800ec94 <ip_frag+0xa4>
- poff = newpbuflen;
- #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Correct header */
- IPH_OFFSET_SET(iphdr, htons(tmp));
- 800ed14: 9805 ldr r0, [sp, #20]
- 800ed16: f7fb fa68 bl 800a1ea <lwip_htons>
- 800ed1a: f8a8 0006 strh.w r0, [r8, #6]
- IPH_LEN_SET(iphdr, htons(cop + IP_HLEN));
- 800ed1e: f10b 0014 add.w r0, fp, #20
- 800ed22: b280 uxth r0, r0
- 800ed24: f7fb fa61 bl 800a1ea <lwip_htons>
- IPH_CHKSUM_SET(iphdr, 0);
- 800ed28: 2300 movs r3, #0
- #endif /* LWIP_NETIF_TX_SINGLE_PBUF */
- #endif /* IP_FRAG_USES_STATIC_BUF */
- /* Correct header */
- IPH_OFFSET_SET(iphdr, htons(tmp));
- IPH_LEN_SET(iphdr, htons(cop + IP_HLEN));
- 800ed2a: f8a8 0002 strh.w r0, [r8, #2]
- IPH_CHKSUM_SET(iphdr, 0);
- 800ed2e: f888 300a strb.w r3, [r8, #10]
- 800ed32: f888 300b strb.w r3, [r8, #11]
- IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN));
- 800ed36: 2114 movs r1, #20
- 800ed38: 4640 mov r0, r8
- 800ed3a: f7ff faf8 bl 800e32e <inet_chksum>
- 800ed3e: f8a8 000a strh.w r0, [r8, #10]
- }
- #else /* IP_FRAG_USES_STATIC_BUF */
- /* No need for separate header pbuf - we allowed room for it in rambuf
- * when allocated.
- */
- netif->output(netif, rambuf, dest);
- 800ed42: 4629 mov r1, r5
- 800ed44: f8da 3014 ldr.w r3, [sl, #20]
- 800ed48: 9a0a ldr r2, [sp, #40] ; 0x28
- 800ed4a: 4650 mov r0, sl
- 800ed4c: 4798 blx r3
- IPFRAG_STATS_INC(ip_frag.xmit);
- 800ed4e: 4b0e ldr r3, [pc, #56] ; (800ed88 <ip_frag+0x198>)
- 800ed50: 8e1a ldrh r2, [r3, #48] ; 0x30
- * recreate it next time round the loop. If we're lucky the hardware
- * will have already sent the packet, the free will really free, and
- * there will be zero memory penalty.
- */
-
- pbuf_free(rambuf);
- 800ed52: 4628 mov r0, r5
- #else /* IP_FRAG_USES_STATIC_BUF */
- /* No need for separate header pbuf - we allowed room for it in rambuf
- * when allocated.
- */
- netif->output(netif, rambuf, dest);
- IPFRAG_STATS_INC(ip_frag.xmit);
- 800ed54: 3201 adds r2, #1
- 800ed56: 861a strh r2, [r3, #48] ; 0x30
- * recreate it next time round the loop. If we're lucky the hardware
- * will have already sent the packet, the free will really free, and
- * there will be zero memory penalty.
- */
-
- pbuf_free(rambuf);
- 800ed58: f7fc fbb4 bl 800b4c4 <pbuf_free>
- #endif /* IP_FRAG_USES_STATIC_BUF */
- left -= cop;
- ofo += nfb;
- 800ed5c: 9904 ldr r1, [sp, #16]
- 800ed5e: 9a07 ldr r2, [sp, #28]
- 800ed60: 188b adds r3, r1, r2
- * there will be zero memory penalty.
- */
-
- pbuf_free(rambuf);
- #endif /* IP_FRAG_USES_STATIC_BUF */
- left -= cop;
- 800ed62: ebcb 0606 rsb r6, fp, r6
- ofo += nfb;
- 800ed66: b29b uxth r3, r3
- * there will be zero memory penalty.
- */
-
- pbuf_free(rambuf);
- #endif /* IP_FRAG_USES_STATIC_BUF */
- left -= cop;
- 800ed68: b2b6 uxth r6, r6
- ofo += nfb;
- 800ed6a: 9304 str r3, [sp, #16]
- 800ed6c: 46b9 mov r9, r7
- left = p->tot_len - IP_HLEN;
- nfb = (mtu - IP_HLEN) / 8;
- while (left) {
- 800ed6e: 2e00 cmp r6, #0
- 800ed70: f47f af64 bne.w 800ec3c <ip_frag+0x4c>
- }
- #if IP_FRAG_USES_STATIC_BUF
- pbuf_free(rambuf);
- #endif /* IP_FRAG_USES_STATIC_BUF */
- snmp_inc_ipfragoks();
- return ERR_OK;
- 800ed74: 4630 mov r0, r6
- 800ed76: e000 b.n 800ed7a <ip_frag+0x18a>
- * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged,
- * but limited to the size of an mtu.
- */
- rambuf = pbuf_alloc(PBUF_LINK, IP_HLEN, PBUF_RAM);
- if (rambuf == NULL) {
- return ERR_MEM;
- 800ed78: 20ff movs r0, #255 ; 0xff
- #if IP_FRAG_USES_STATIC_BUF
- pbuf_free(rambuf);
- #endif /* IP_FRAG_USES_STATIC_BUF */
- snmp_inc_ipfragoks();
- return ERR_OK;
- }
- 800ed7a: b240 sxtb r0, r0
- 800ed7c: b00d add sp, #52 ; 0x34
- 800ed7e: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800ed82: bf00 nop
- 800ed84: 0800e815 .word 0x0800e815
- 800ed88: 20008220 .word 0x20008220
- 0800ed8c <etharp_free_entry>:
- #endif /* ARP_QUEUEING */
- /** Clean up ARP table entries */
- static void
- etharp_free_entry(int i)
- {
- 800ed8c: b570 push {r4, r5, r6, lr}
- /* remove from SNMP ARP index tree */
- snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
- /* and empty packet queue */
- if (arp_table[i].q != NULL) {
- 800ed8e: 2614 movs r6, #20
- 800ed90: 4c07 ldr r4, [pc, #28] ; (800edb0 <etharp_free_entry+0x24>)
- 800ed92: 4346 muls r6, r0
- #endif /* ARP_QUEUEING */
- /** Clean up ARP table entries */
- static void
- etharp_free_entry(int i)
- {
- 800ed94: 4605 mov r5, r0
- /* remove from SNMP ARP index tree */
- snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
- /* and empty packet queue */
- if (arp_table[i].q != NULL) {
- 800ed96: 59a0 ldr r0, [r4, r6]
- 800ed98: b118 cbz r0, 800eda2 <etharp_free_entry+0x16>
- /* remove all queued packets */
- LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_free_entry: freeing entry %"U16_F", packet queue %p.\n", (u16_t)i, (void *)(arp_table[i].q)));
- free_etharp_q(arp_table[i].q);
- 800ed9a: f7fc fb93 bl 800b4c4 <pbuf_free>
- arp_table[i].q = NULL;
- 800ed9e: 2300 movs r3, #0
- 800eda0: 51a3 str r3, [r4, r6]
- }
- /* recycle entry for re-use */
- arp_table[i].state = ETHARP_STATE_EMPTY;
- 800eda2: 2314 movs r3, #20
- 800eda4: fb03 4405 mla r4, r3, r5, r4
- 800eda8: 2300 movs r3, #0
- 800edaa: 74a3 strb r3, [r4, #18]
- 800edac: 3410 adds r4, #16
- 800edae: bd70 pop {r4, r5, r6, pc}
- 800edb0: 20006bc4 .word 0x20006bc4
- 0800edb4 <etharp_find_entry>:
- * @return The ARP entry index that matched or is created, ERR_MEM if no
- * entry is found or could be recycled.
- */
- static s8_t
- etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
- {
- 800edb4: e92d 4ff7 stmdb sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- s8_t empty = ARP_TABLE_SIZE;
- u8_t i = 0, age_pending = 0, age_stable = 0;
- /* oldest entry with packets on queue */
- s8_t old_queue = ARP_TABLE_SIZE;
- /* its age */
- u8_t age_queue = 0;
- 800edb8: 2500 movs r5, #0
- {
- s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
- s8_t empty = ARP_TABLE_SIZE;
- u8_t i = 0, age_pending = 0, age_stable = 0;
- /* oldest entry with packets on queue */
- s8_t old_queue = ARP_TABLE_SIZE;
- 800edba: 240a movs r4, #10
- 800edbc: 4a35 ldr r2, [pc, #212] ; (800ee94 <etharp_find_entry+0xe0>)
- * @return The ARP entry index that matched or is created, ERR_MEM if no
- * entry is found or could be recycled.
- */
- static s8_t
- etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
- {
- 800edbe: 9101 str r1, [sp, #4]
- 800edc0: 4606 mov r6, r0
- s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
- s8_t empty = ARP_TABLE_SIZE;
- u8_t i = 0, age_pending = 0, age_stable = 0;
- 800edc2: 46a8 mov r8, r5
- 800edc4: 46aa mov sl, r5
- * 4) remember the oldest pending entry with queued packets (if any)
- * 5) search for a matching IP entry, either pending or stable
- * until 5 matches, or all entries are searched for.
- */
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- 800edc6: 462b mov r3, r5
- */
- static s8_t
- etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
- {
- s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
- s8_t empty = ARP_TABLE_SIZE;
- 800edc8: 4627 mov r7, r4
- * entry is found or could be recycled.
- */
- static s8_t
- etharp_find_entry(ip_addr_t *ipaddr, u8_t flags)
- {
- s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
- 800edca: 46a4 mov ip, r4
- 800edcc: 46a3 mov fp, r4
- */
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- u8_t state = arp_table[i].state;
- /* no empty entry found yet and now we do find one? */
- if ((empty == ARP_TABLE_SIZE) && (state == ETHARP_STATE_EMPTY)) {
- 800edce: 2f0a cmp r7, #10
- * 5) search for a matching IP entry, either pending or stable
- * until 5 matches, or all entries are searched for.
- */
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- u8_t state = arp_table[i].state;
- 800edd0: f892 9012 ldrb.w r9, [r2, #18]
- /* no empty entry found yet and now we do find one? */
- if ((empty == ARP_TABLE_SIZE) && (state == ETHARP_STATE_EMPTY)) {
- 800edd4: d104 bne.n 800ede0 <etharp_find_entry+0x2c>
- 800edd6: f1b9 0f00 cmp.w r9, #0
- 800edda: d104 bne.n 800ede6 <etharp_find_entry+0x32>
- LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_find_entry: found empty entry %"U16_F"\n", (u16_t)i));
- /* remember first empty entry */
- empty = i;
- 800eddc: b2df uxtb r7, r3
- 800edde: e023 b.n 800ee28 <etharp_find_entry+0x74>
- } else if (state != ETHARP_STATE_EMPTY) {
- 800ede0: f1b9 0f00 cmp.w r9, #0
- 800ede4: d020 beq.n 800ee28 <etharp_find_entry+0x74>
- LWIP_ASSERT("state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE",
- state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE);
- /* if given, does IP address match IP address in ARP entry? */
- if (ipaddr && ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
- 800ede6: b12e cbz r6, 800edf4 <etharp_find_entry+0x40>
- 800ede8: 6830 ldr r0, [r6, #0]
- 800edea: 6851 ldr r1, [r2, #4]
- 800edec: 4288 cmp r0, r1
- 800edee: d101 bne.n 800edf4 <etharp_find_entry+0x40>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: found matching entry %"U16_F"\n", (u16_t)i));
- /* found exact IP address match, simply bail out */
- return i;
- 800edf0: 4618 mov r0, r3
- 800edf2: e04b b.n 800ee8c <etharp_find_entry+0xd8>
- }
- /* pending entry? */
- if (state == ETHARP_STATE_PENDING) {
- 800edf4: f1b9 0f01 cmp.w r9, #1
- 800edf8: d10e bne.n 800ee18 <etharp_find_entry+0x64>
- /* pending with queued packets? */
- if (arp_table[i].q != NULL) {
- 800edfa: 6810 ldr r0, [r2, #0]
- if (arp_table[i].ctime >= age_queue) {
- 800edfc: f892 9013 ldrb.w r9, [r2, #19]
- return i;
- }
- /* pending entry? */
- if (state == ETHARP_STATE_PENDING) {
- /* pending with queued packets? */
- if (arp_table[i].q != NULL) {
- 800ee00: b120 cbz r0, 800ee0c <etharp_find_entry+0x58>
- if (arp_table[i].ctime >= age_queue) {
- 800ee02: 45a9 cmp r9, r5
- 800ee04: d310 bcc.n 800ee28 <etharp_find_entry+0x74>
- old_queue = i;
- 800ee06: b2dc uxtb r4, r3
- 800ee08: 464d mov r5, r9
- 800ee0a: e00d b.n 800ee28 <etharp_find_entry+0x74>
- age_queue = arp_table[i].ctime;
- }
- } else
- /* pending without queued packets? */
- {
- if (arp_table[i].ctime >= age_pending) {
- 800ee0c: 45d1 cmp r9, sl
- 800ee0e: d30b bcc.n 800ee28 <etharp_find_entry+0x74>
- old_pending = i;
- 800ee10: fa5f fb83 uxtb.w fp, r3
- 800ee14: 46ca mov sl, r9
- 800ee16: e007 b.n 800ee28 <etharp_find_entry+0x74>
- age_pending = arp_table[i].ctime;
- }
- }
- /* stable entry? */
- } else if (state >= ETHARP_STATE_STABLE) {
- 800ee18: d906 bls.n 800ee28 <etharp_find_entry+0x74>
- /* don't record old_stable for static entries since they never expire */
- if (state < ETHARP_STATE_STATIC)
- #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
- {
- /* remember entry with oldest stable entry in oldest, its age in maxtime */
- if (arp_table[i].ctime >= age_stable) {
- 800ee1a: f892 9013 ldrb.w r9, [r2, #19]
- 800ee1e: 45c1 cmp r9, r8
- old_stable = i;
- 800ee20: bf24 itt cs
- 800ee22: fa5f fc83 uxtbcs.w ip, r3
- 800ee26: 46c8 movcs r8, r9
- * 4) remember the oldest pending entry with queued packets (if any)
- * 5) search for a matching IP entry, either pending or stable
- * until 5 matches, or all entries are searched for.
- */
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- 800ee28: 3301 adds r3, #1
- 800ee2a: b2db uxtb r3, r3
- 800ee2c: 3214 adds r2, #20
- 800ee2e: 2b0a cmp r3, #10
- 800ee30: d1cd bne.n 800edce <etharp_find_entry+0x1a>
- }
- }
- /* { we have no match } => try to create a new entry */
-
- /* don't create new entry, only search? */
- if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) ||
- 800ee32: 9a01 ldr r2, [sp, #4]
- 800ee34: f002 0302 and.w r3, r2, #2
- 800ee38: b2db uxtb r3, r3
- 800ee3a: bb33 cbnz r3, 800ee8a <etharp_find_entry+0xd6>
- 800ee3c: 2f0a cmp r7, #10
- 800ee3e: d102 bne.n 800ee46 <etharp_find_entry+0x92>
- /* or no empty entry found and not allowed to recycle? */
- ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_FLAG_TRY_HARD) == 0))) {
- 800ee40: 07d3 lsls r3, r2, #31
- 800ee42: d402 bmi.n 800ee4a <etharp_find_entry+0x96>
- 800ee44: e021 b.n 800ee8a <etharp_find_entry+0xd6>
- * { ETHARP_FLAG_TRY_HARD is set at this point }
- */
- /* 1) empty entry available? */
- if (empty < ARP_TABLE_SIZE) {
- i = empty;
- 800ee46: b2fc uxtb r4, r7
- 800ee48: e011 b.n 800ee6e <etharp_find_entry+0xba>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting empty entry %"U16_F"\n", (u16_t)i));
- } else {
- /* 2) found recyclable stable entry? */
- if (old_stable < ARP_TABLE_SIZE) {
- 800ee4a: f1bc 0f0a cmp.w ip, #10
- 800ee4e: d002 beq.n 800ee56 <etharp_find_entry+0xa2>
- /* recycle oldest stable*/
- i = old_stable;
- 800ee50: fa5f f48c uxtb.w r4, ip
- 800ee54: e008 b.n 800ee68 <etharp_find_entry+0xb4>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest stable entry %"U16_F"\n", (u16_t)i));
- /* no queued packets should exist on stable entries */
- LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL);
- /* 3) found recyclable pending entry without queued packets? */
- } else if (old_pending < ARP_TABLE_SIZE) {
- 800ee56: f1bb 0f0a cmp.w fp, #10
- 800ee5a: d002 beq.n 800ee62 <etharp_find_entry+0xae>
- /* recycle oldest pending */
- i = old_pending;
- 800ee5c: fa5f f48b uxtb.w r4, fp
- 800ee60: e002 b.n 800ee68 <etharp_find_entry+0xb4>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest pending entry %"U16_F" (without queue)\n", (u16_t)i));
- /* 4) found recyclable pending entry with queued packets? */
- } else if (old_queue < ARP_TABLE_SIZE) {
- 800ee62: 2c0a cmp r4, #10
- 800ee64: d011 beq.n 800ee8a <etharp_find_entry+0xd6>
- /* recycle oldest pending (queued packets are free in etharp_free_entry) */
- i = old_queue;
- 800ee66: b2e4 uxtb r4, r4
- return (s8_t)ERR_MEM;
- }
- /* { empty or recyclable entry found } */
- LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE);
- etharp_free_entry(i);
- 800ee68: 4620 mov r0, r4
- 800ee6a: f7ff ff8f bl 800ed8c <etharp_free_entry>
- 800ee6e: 4b09 ldr r3, [pc, #36] ; (800ee94 <etharp_find_entry+0xe0>)
- LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE);
- LWIP_ASSERT("arp_table[i].state == ETHARP_STATE_EMPTY",
- arp_table[i].state == ETHARP_STATE_EMPTY);
- /* IP address given? */
- if (ipaddr != NULL) {
- 800ee70: b126 cbz r6, 800ee7c <etharp_find_entry+0xc8>
- /* set IP address */
- ip_addr_copy(arp_table[i].ipaddr, *ipaddr);
- 800ee72: 2214 movs r2, #20
- 800ee74: 6831 ldr r1, [r6, #0]
- 800ee76: fb02 3204 mla r2, r2, r4, r3
- 800ee7a: 6051 str r1, [r2, #4]
- }
- arp_table[i].ctime = 0;
- 800ee7c: 2214 movs r2, #20
- 800ee7e: fb02 3304 mla r3, r2, r4, r3
- 800ee82: 2200 movs r2, #0
- 800ee84: 74da strb r2, [r3, #19]
- return (err_t)i;
- 800ee86: 4620 mov r0, r4
- 800ee88: e000 b.n 800ee8c <etharp_find_entry+0xd8>
- /* don't create new entry, only search? */
- if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) ||
- /* or no empty entry found and not allowed to recycle? */
- ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_FLAG_TRY_HARD) == 0))) {
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty entry found and not allowed to recycle\n"));
- return (s8_t)ERR_MEM;
- 800ee8a: 20ff movs r0, #255 ; 0xff
- /* set IP address */
- ip_addr_copy(arp_table[i].ipaddr, *ipaddr);
- }
- arp_table[i].ctime = 0;
- return (err_t)i;
- }
- 800ee8c: b240 sxtb r0, r0
- 800ee8e: e8bd 8ffe ldmia.w sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800ee92: bf00 nop
- 800ee94: 20006bc4 .word 0x20006bc4
- 0800ee98 <etharp_send_ip>:
- * @params dst the destination MAC address to be copied into the ethernet header
- * @return ERR_OK if the packet was sent, any other err_t on failure
- */
- static err_t
- etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
- {
- 800ee98: b5f8 push {r3, r4, r5, r6, r7, lr}
- struct eth_hdr *ethhdr = (struct eth_hdr *)p->payload;
- 800ee9a: 684c ldr r4, [r1, #4]
- * @params dst the destination MAC address to be copied into the ethernet header
- * @return ERR_OK if the packet was sent, any other err_t on failure
- */
- static err_t
- etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
- {
- 800ee9c: 4606 mov r6, r0
- 800ee9e: 460d mov r5, r1
- 800eea0: 4617 mov r7, r2
- struct eth_hdr *ethhdr = (struct eth_hdr *)p->payload;
- LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
- (netif->hwaddr_len == ETHARP_HWADDR_LEN));
- ETHADDR32_COPY(ðhdr->dest, dst);
- 800eea2: 4619 mov r1, r3
- 800eea4: 2206 movs r2, #6
- 800eea6: 4620 mov r0, r4
- 800eea8: f7fa faac bl 8009404 <memcpy>
- ETHADDR16_COPY(ðhdr->src, src);
- 800eeac: 4639 mov r1, r7
- 800eeae: 1da0 adds r0, r4, #6
- 800eeb0: 2206 movs r2, #6
- 800eeb2: f7fa faa7 bl 8009404 <memcpy>
- ethhdr->type = PP_HTONS(ETHTYPE_IP);
- 800eeb6: 2308 movs r3, #8
- 800eeb8: 7323 strb r3, [r4, #12]
- 800eeba: 2300 movs r3, #0
- 800eebc: 7363 strb r3, [r4, #13]
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_send_ip: sending packet %p\n", (void *)p));
- /* send the packet */
- return netif->linkoutput(netif, p);
- 800eebe: 69b3 ldr r3, [r6, #24]
- 800eec0: 4630 mov r0, r6
- 800eec2: 4629 mov r1, r5
- 800eec4: 4798 blx r3
- }
- 800eec6: bdf8 pop {r3, r4, r5, r6, r7, pc}
- 0800eec8 <etharp_tmr>:
- * This function should be called every ETHARP_TMR_INTERVAL milliseconds (5 seconds),
- * in order to expire entries in the ARP table.
- */
- void
- etharp_tmr(void)
- {
- 800eec8: b570 push {r4, r5, r6, lr}
- 800eeca: 4c0d ldr r4, [pc, #52] ; (800ef00 <etharp_tmr+0x38>)
- 800eecc: 2500 movs r5, #0
- etharp_free_entry(i);
- }
- else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING) {
- /* Reset state to stable, so that the next transmitted packet will
- re-send an ARP request. */
- arp_table[i].state = ETHARP_STATE_STABLE;
- 800eece: 2602 movs r6, #2
- LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
- /* remove expired entries from the ARP table */
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- u8_t state = arp_table[i].state;
- if (state != ETHARP_STATE_EMPTY
- 800eed0: 7ca3 ldrb r3, [r4, #18]
- 800eed2: b183 cbz r3, 800eef6 <etharp_tmr+0x2e>
- #if ETHARP_SUPPORT_STATIC_ENTRIES
- && (state != ETHARP_STATE_STATIC)
- #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
- ) {
- arp_table[i].ctime++;
- 800eed4: 7ce2 ldrb r2, [r4, #19]
- 800eed6: 3201 adds r2, #1
- 800eed8: b2d2 uxtb r2, r2
- if ((arp_table[i].ctime >= ARP_MAXAGE) ||
- 800eeda: 2aef cmp r2, #239 ; 0xef
- if (state != ETHARP_STATE_EMPTY
- #if ETHARP_SUPPORT_STATIC_ENTRIES
- && (state != ETHARP_STATE_STATIC)
- #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
- ) {
- arp_table[i].ctime++;
- 800eedc: 74e2 strb r2, [r4, #19]
- if ((arp_table[i].ctime >= ARP_MAXAGE) ||
- 800eede: d803 bhi.n 800eee8 <etharp_tmr+0x20>
- 800eee0: 2b01 cmp r3, #1
- 800eee2: d105 bne.n 800eef0 <etharp_tmr+0x28>
- ((arp_table[i].state == ETHARP_STATE_PENDING) &&
- 800eee4: 2a01 cmp r2, #1
- 800eee6: d906 bls.n 800eef6 <etharp_tmr+0x2e>
- (arp_table[i].ctime >= ARP_MAXPENDING))) {
- /* pending or stable entry has become old! */
- LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired %s entry %"U16_F".\n",
- arp_table[i].state >= ETHARP_STATE_STABLE ? "stable" : "pending", (u16_t)i));
- /* clean up entries that have just been expired */
- etharp_free_entry(i);
- 800eee8: 4628 mov r0, r5
- 800eeea: f7ff ff4f bl 800ed8c <etharp_free_entry>
- 800eeee: e002 b.n 800eef6 <etharp_tmr+0x2e>
- }
- else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING) {
- 800eef0: 2b03 cmp r3, #3
- /* Reset state to stable, so that the next transmitted packet will
- re-send an ARP request. */
- arp_table[i].state = ETHARP_STATE_STABLE;
- 800eef2: bf08 it eq
- 800eef4: 74a6 strbeq r6, [r4, #18]
- 800eef6: 3501 adds r5, #1
- 800eef8: 3414 adds r4, #20
- {
- u8_t i;
- LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n"));
- /* remove expired entries from the ARP table */
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- 800eefa: 2d0a cmp r5, #10
- 800eefc: d1e8 bne.n 800eed0 <etharp_tmr+0x8>
- /* resend an ARP query here? */
- }
- #endif /* ARP_QUEUEING */
- }
- }
- }
- 800eefe: bd70 pop {r4, r5, r6, pc}
- 800ef00: 20006bc4 .word 0x20006bc4
- 0800ef04 <etharp_cleanup_netif>:
- * Remove all ARP table entries of the specified netif.
- *
- * @param netif points to a network interface
- */
- void etharp_cleanup_netif(struct netif *netif)
- {
- 800ef04: b570 push {r4, r5, r6, lr}
- 800ef06: 4d08 ldr r5, [pc, #32] ; (800ef28 <etharp_cleanup_netif+0x24>)
- 800ef08: 4606 mov r6, r0
- 800ef0a: 2400 movs r4, #0
- u8_t i;
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- u8_t state = arp_table[i].state;
- if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) {
- 800ef0c: 7cab ldrb r3, [r5, #18]
- 800ef0e: b12b cbz r3, 800ef1c <etharp_cleanup_netif+0x18>
- 800ef10: 68ab ldr r3, [r5, #8]
- 800ef12: 42b3 cmp r3, r6
- 800ef14: d102 bne.n 800ef1c <etharp_cleanup_netif+0x18>
- etharp_free_entry(i);
- 800ef16: 4620 mov r0, r4
- 800ef18: f7ff ff38 bl 800ed8c <etharp_free_entry>
- 800ef1c: 3401 adds r4, #1
- 800ef1e: 3514 adds r5, #20
- */
- void etharp_cleanup_netif(struct netif *netif)
- {
- u8_t i;
- for (i = 0; i < ARP_TABLE_SIZE; ++i) {
- 800ef20: 2c0a cmp r4, #10
- 800ef22: d1f3 bne.n 800ef0c <etharp_cleanup_netif+0x8>
- u8_t state = arp_table[i].state;
- if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) {
- etharp_free_entry(i);
- }
- }
- }
- 800ef24: bd70 pop {r4, r5, r6, pc}
- 800ef26: bf00 nop
- 800ef28: 20006bc4 .word 0x20006bc4
- 0800ef2c <etharp_request>:
- * ERR_MEM if the ARP packet couldn't be allocated
- * any other err_t on failure
- */
- err_t
- etharp_request(struct netif *netif, ip_addr_t *ipaddr)
- {
- 800ef2c: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
- #endif /* LWIP_AUTOIP */
- LWIP_ASSERT("netif != NULL", netif != NULL);
- /* allocate a pbuf for the outgoing ARP request packet */
- p = pbuf_alloc(PBUF_RAW, SIZEOF_ETHARP_PACKET, PBUF_RAM);
- 800ef30: 2200 movs r2, #0
- * ERR_MEM if the ARP packet couldn't be allocated
- * any other err_t on failure
- */
- err_t
- etharp_request(struct netif *netif, ip_addr_t *ipaddr)
- {
- 800ef32: 4606 mov r6, r0
- 800ef34: 4688 mov r8, r1
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n"));
- return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, ðbroadcast,
- (struct eth_addr *)netif->hwaddr, &netif->ip_addr, ðzero,
- 800ef36: f100 0727 add.w r7, r0, #39 ; 0x27
- 800ef3a: f100 0904 add.w r9, r0, #4
- #endif /* LWIP_AUTOIP */
- LWIP_ASSERT("netif != NULL", netif != NULL);
- /* allocate a pbuf for the outgoing ARP request packet */
- p = pbuf_alloc(PBUF_RAW, SIZEOF_ETHARP_PACKET, PBUF_RAM);
- 800ef3e: 212a movs r1, #42 ; 0x2a
- 800ef40: 2003 movs r0, #3
- 800ef42: f7fc fb10 bl 800b566 <pbuf_alloc>
- /* could allocate a pbuf for an ARP request? */
- if (p == NULL) {
- 800ef46: 4605 mov r5, r0
- 800ef48: b928 cbnz r0, 800ef56 <etharp_request+0x2a>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
- ("etharp_raw: could not allocate pbuf for ARP request.\n"));
- ETHARP_STATS_INC(etharp.memerr);
- 800ef4a: 4b24 ldr r3, [pc, #144] ; (800efdc <etharp_request+0xb0>)
- 800ef4c: 8c9a ldrh r2, [r3, #36] ; 0x24
- 800ef4e: 3201 adds r2, #1
- 800ef50: 849a strh r2, [r3, #36] ; 0x24
- return ERR_MEM;
- 800ef52: 24ff movs r4, #255 ; 0xff
- 800ef54: e03f b.n 800efd6 <etharp_request+0xaa>
- }
- LWIP_ASSERT("check that first pbuf can hold struct etharp_hdr",
- (p->len >= SIZEOF_ETHARP_PACKET));
- ethhdr = (struct eth_hdr *)p->payload;
- 800ef56: 6844 ldr r4, [r0, #4]
- hdr = (struct etharp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n"));
- hdr->opcode = htons(opcode);
- 800ef58: 2001 movs r0, #1
- 800ef5a: f7fb f946 bl 800a1ea <lwip_htons>
- * 'sender IP address' MUST be sent using link-layer broadcast instead of
- * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
- ethdst_hwaddr = ip_addr_islinklocal(ipsrc_addr) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
- #endif /* LWIP_AUTOIP */
- /* Write the ARP MAC-Addresses */
- ETHADDR16_COPY(&hdr->shwaddr, hwsrc_addr);
- 800ef5e: 4639 mov r1, r7
- (p->len >= SIZEOF_ETHARP_PACKET));
- ethhdr = (struct eth_hdr *)p->payload;
- hdr = (struct etharp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n"));
- hdr->opcode = htons(opcode);
- 800ef60: 82a0 strh r0, [r4, #20]
- * 'sender IP address' MUST be sent using link-layer broadcast instead of
- * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
- ethdst_hwaddr = ip_addr_islinklocal(ipsrc_addr) ? (u8_t*)(ethbroadcast.addr) : ethdst_addr->addr;
- #endif /* LWIP_AUTOIP */
- /* Write the ARP MAC-Addresses */
- ETHADDR16_COPY(&hdr->shwaddr, hwsrc_addr);
- 800ef62: 2206 movs r2, #6
- 800ef64: f104 0016 add.w r0, r4, #22
- 800ef68: f7fa fa4c bl 8009404 <memcpy>
- ETHADDR16_COPY(&hdr->dhwaddr, hwdst_addr);
- 800ef6c: f104 0020 add.w r0, r4, #32
- 800ef70: 491b ldr r1, [pc, #108] ; (800efe0 <etharp_request+0xb4>)
- 800ef72: 2206 movs r2, #6
- 800ef74: f7fa fa46 bl 8009404 <memcpy>
- /* Write the Ethernet MAC-Addresses */
- #if LWIP_AUTOIP
- ETHADDR16_COPY(ðhdr->dest, ethdst_hwaddr);
- #else /* LWIP_AUTOIP */
- ETHADDR16_COPY(ðhdr->dest, ethdst_addr);
- 800ef78: 4620 mov r0, r4
- 800ef7a: 491a ldr r1, [pc, #104] ; (800efe4 <etharp_request+0xb8>)
- 800ef7c: 2206 movs r2, #6
- 800ef7e: f7fa fa41 bl 8009404 <memcpy>
- #endif /* LWIP_AUTOIP */
- ETHADDR16_COPY(ðhdr->src, ethsrc_addr);
- 800ef82: 1da0 adds r0, r4, #6
- 800ef84: 4639 mov r1, r7
- 800ef86: 2206 movs r2, #6
- 800ef88: f7fa fa3c bl 8009404 <memcpy>
- /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
- * structure packing. */
- IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr);
- 800ef8c: f104 001c add.w r0, r4, #28
- 800ef90: 4649 mov r1, r9
- 800ef92: 2204 movs r2, #4
- 800ef94: f7fa fa36 bl 8009404 <memcpy>
- IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
- 800ef98: f104 0026 add.w r0, r4, #38 ; 0x26
- 800ef9c: 4641 mov r1, r8
- 800ef9e: 2204 movs r2, #4
- 800efa0: f7fa fa30 bl 8009404 <memcpy>
- hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
- 800efa4: 2300 movs r3, #0
- 800efa6: 2201 movs r2, #1
- 800efa8: 73a3 strb r3, [r4, #14]
- 800efaa: 73e2 strb r2, [r4, #15]
- hdr->proto = PP_HTONS(ETHTYPE_IP);
- 800efac: 7463 strb r3, [r4, #17]
- 800efae: 2208 movs r2, #8
- /* set hwlen and protolen */
- hdr->hwlen = ETHARP_HWADDR_LEN;
- 800efb0: 2306 movs r3, #6
- hdr->protolen = sizeof(ip_addr_t);
- 800efb2: 2104 movs r1, #4
- * structure packing. */
- IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr);
- IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
- hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
- hdr->proto = PP_HTONS(ETHTYPE_IP);
- 800efb4: 7422 strb r2, [r4, #16]
- /* set hwlen and protolen */
- hdr->hwlen = ETHARP_HWADDR_LEN;
- hdr->protolen = sizeof(ip_addr_t);
- 800efb6: 74e1 strb r1, [r4, #19]
- ethhdr->type = PP_HTONS(ETHTYPE_ARP);
- 800efb8: 7322 strb r2, [r4, #12]
- IPADDR2_COPY(&hdr->dipaddr, ipdst_addr);
- hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET);
- hdr->proto = PP_HTONS(ETHTYPE_IP);
- /* set hwlen and protolen */
- hdr->hwlen = ETHARP_HWADDR_LEN;
- 800efba: 74a3 strb r3, [r4, #18]
- hdr->protolen = sizeof(ip_addr_t);
- ethhdr->type = PP_HTONS(ETHTYPE_ARP);
- 800efbc: 7363 strb r3, [r4, #13]
- /* send ARP query */
- result = netif->linkoutput(netif, p);
- 800efbe: 69b3 ldr r3, [r6, #24]
- 800efc0: 4630 mov r0, r6
- 800efc2: 4629 mov r1, r5
- 800efc4: 4798 blx r3
- ETHARP_STATS_INC(etharp.xmit);
- 800efc6: 4b05 ldr r3, [pc, #20] ; (800efdc <etharp_request+0xb0>)
- 800efc8: 8b1a ldrh r2, [r3, #24]
- hdr->hwlen = ETHARP_HWADDR_LEN;
- hdr->protolen = sizeof(ip_addr_t);
- ethhdr->type = PP_HTONS(ETHTYPE_ARP);
- /* send ARP query */
- result = netif->linkoutput(netif, p);
- 800efca: 4604 mov r4, r0
- ETHARP_STATS_INC(etharp.xmit);
- 800efcc: 3201 adds r2, #1
- /* free ARP query packet */
- pbuf_free(p);
- 800efce: 4628 mov r0, r5
- hdr->protolen = sizeof(ip_addr_t);
- ethhdr->type = PP_HTONS(ETHTYPE_ARP);
- /* send ARP query */
- result = netif->linkoutput(netif, p);
- ETHARP_STATS_INC(etharp.xmit);
- 800efd0: 831a strh r2, [r3, #24]
- /* free ARP query packet */
- pbuf_free(p);
- 800efd2: f7fc fa77 bl 800b4c4 <pbuf_free>
- {
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n"));
- return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, ðbroadcast,
- (struct eth_addr *)netif->hwaddr, &netif->ip_addr, ðzero,
- ipaddr, ARP_REQUEST);
- }
- 800efd6: b260 sxtb r0, r4
- 800efd8: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
- 800efdc: 20008220 .word 0x20008220
- 800efe0: 0801188a .word 0x0801188a
- 800efe4: 08011884 .word 0x08011884
- 0800efe8 <etharp_query>:
- * - ERR_ARG Non-unicast address given, those will not appear in ARP cache.
- *
- */
- err_t
- etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
- {
- 800efe8: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- 800efec: 4607 mov r7, r0
- 800efee: 460e mov r6, r1
- struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
- err_t result = ERR_MEM;
- s8_t i; /* ARP entry index */
- /* non-unicast address? */
- if (ip_addr_isbroadcast(ipaddr, netif) ||
- 800eff0: 6808 ldr r0, [r1, #0]
- 800eff2: 4639 mov r1, r7
- * - ERR_ARG Non-unicast address given, those will not appear in ARP cache.
- *
- */
- err_t
- etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
- {
- 800eff4: 4615 mov r5, r2
- struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
- err_t result = ERR_MEM;
- s8_t i; /* ARP entry index */
- /* non-unicast address? */
- if (ip_addr_isbroadcast(ipaddr, netif) ||
- 800eff6: f7ff f9c4 bl 800e382 <ip4_addr_isbroadcast>
- 800effa: 2800 cmp r0, #0
- 800effc: d164 bne.n 800f0c8 <etharp_query+0xe0>
- ip_addr_ismulticast(ipaddr) ||
- 800effe: 6833 ldr r3, [r6, #0]
- 800f000: f003 02f0 and.w r2, r3, #240 ; 0xf0
- struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
- err_t result = ERR_MEM;
- s8_t i; /* ARP entry index */
- /* non-unicast address? */
- if (ip_addr_isbroadcast(ipaddr, netif) ||
- 800f004: 2ae0 cmp r2, #224 ; 0xe0
- 800f006: d05f beq.n 800f0c8 <etharp_query+0xe0>
- ip_addr_ismulticast(ipaddr) ||
- ip_addr_isany(ipaddr)) {
- 800f008: 2b00 cmp r3, #0
- 800f00a: d05d beq.n 800f0c8 <etharp_query+0xe0>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n"));
- return ERR_ARG;
- }
- /* find entry in ARP cache, ask to create entry if queueing packet */
- i = etharp_find_entry(ipaddr, ETHARP_FLAG_TRY_HARD);
- 800f00c: 2101 movs r1, #1
- 800f00e: 4630 mov r0, r6
- 800f010: f7ff fed0 bl 800edb4 <etharp_find_entry>
- /* could not find or create entry? */
- if (i < 0) {
- 800f014: 1e04 subs r4, r0, #0
- 800f016: da06 bge.n 800f026 <etharp_query+0x3e>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not create ARP entry\n"));
- if (q) {
- 800f018: 2d00 cmp r5, #0
- 800f01a: d05a beq.n 800f0d2 <etharp_query+0xea>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: packet dropped\n"));
- ETHARP_STATS_INC(etharp.memerr);
- 800f01c: 4b36 ldr r3, [pc, #216] ; (800f0f8 <etharp_query+0x110>)
- 800f01e: 8c9a ldrh r2, [r3, #36] ; 0x24
- 800f020: 3201 adds r2, #1
- 800f022: 849a strh r2, [r3, #36] ; 0x24
- 800f024: e055 b.n 800f0d2 <etharp_query+0xea>
- }
- return (err_t)i;
- }
- /* mark a fresh entry as pending (we just sent a request) */
- if (arp_table[i].state == ETHARP_STATE_EMPTY) {
- 800f026: 4935 ldr r1, [pc, #212] ; (800f0fc <etharp_query+0x114>)
- 800f028: 2214 movs r2, #20
- 800f02a: fb02 1304 mla r3, r2, r4, r1
- 800f02e: 3310 adds r3, #16
- 800f030: 7898 ldrb r0, [r3, #2]
- 800f032: b908 cbnz r0, 800f038 <etharp_query+0x50>
- arp_table[i].state = ETHARP_STATE_PENDING;
- 800f034: 2001 movs r0, #1
- 800f036: 7098 strb r0, [r3, #2]
- LWIP_ASSERT("arp_table[i].state == PENDING or STABLE",
- ((arp_table[i].state == ETHARP_STATE_PENDING) ||
- (arp_table[i].state >= ETHARP_STATE_STABLE)));
- /* do we have a pending entry? or an implicit query request? */
- if ((arp_table[i].state == ETHARP_STATE_PENDING) || (q == NULL)) {
- 800f038: fb02 1204 mla r2, r2, r4, r1
- 800f03c: 7c93 ldrb r3, [r2, #18]
- 800f03e: 2b01 cmp r3, #1
- 800f040: d000 beq.n 800f044 <etharp_query+0x5c>
- 800f042: b935 cbnz r5, 800f052 <etharp_query+0x6a>
- /* try to resolve it; send out ARP request */
- result = etharp_request(netif, ipaddr);
- 800f044: 4638 mov r0, r7
- 800f046: 4631 mov r1, r6
- 800f048: f7ff ff70 bl 800ef2c <etharp_request>
- 800f04c: 4602 mov r2, r0
- /* ARP request couldn't be sent */
- /* We don't re-send arp request in etharp_tmr, but we still queue packets,
- since this failure could be temporary, and the next packet calling
- etharp_query again could lead to sending the queued packets. */
- }
- if (q == NULL) {
- 800f04e: b90d cbnz r5, 800f054 <etharp_query+0x6c>
- 800f050: e03c b.n 800f0cc <etharp_query+0xe4>
- */
- err_t
- etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
- {
- struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
- err_t result = ERR_MEM;
- 800f052: 22ff movs r2, #255 ; 0xff
- }
- /* packet given? */
- LWIP_ASSERT("q != NULL", q != NULL);
- /* stable entry? */
- if (arp_table[i].state >= ETHARP_STATE_STABLE) {
- 800f054: 2314 movs r3, #20
- 800f056: 4929 ldr r1, [pc, #164] ; (800f0fc <etharp_query+0x114>)
- 800f058: 4363 muls r3, r4
- 800f05a: 18c8 adds r0, r1, r3
- 800f05c: 7c80 ldrb r0, [r0, #18]
- 800f05e: 2801 cmp r0, #1
- 800f060: d90b bls.n 800f07a <etharp_query+0x92>
- /* we have a valid IP->Ethernet address mapping */
- ETHARP_SET_HINT(netif, i);
- 800f062: 4a27 ldr r2, [pc, #156] ; (800f100 <etharp_query+0x118>)
- /* send the packet */
- result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
- 800f064: 18cb adds r3, r1, r3
- /* packet given? */
- LWIP_ASSERT("q != NULL", q != NULL);
- /* stable entry? */
- if (arp_table[i].state >= ETHARP_STATE_STABLE) {
- /* we have a valid IP->Ethernet address mapping */
- ETHARP_SET_HINT(netif, i);
- 800f066: 7014 strb r4, [r2, #0]
- /* send the packet */
- result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
- 800f068: 4638 mov r0, r7
- 800f06a: 4629 mov r1, r5
- 800f06c: f107 0227 add.w r2, r7, #39 ; 0x27
- 800f070: 330c adds r3, #12
- 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));
- result = ERR_MEM;
- }
- }
- return result;
- }
- 800f072: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
- /* stable entry? */
- if (arp_table[i].state >= ETHARP_STATE_STABLE) {
- /* we have a valid IP->Ethernet address mapping */
- ETHARP_SET_HINT(netif, i);
- /* send the packet */
- result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
- 800f076: f7ff bf0f b.w 800ee98 <etharp_send_ip>
- /* pending entry? (either just created or already pending */
- } else if (arp_table[i].state == ETHARP_STATE_PENDING) {
- 800f07a: d129 bne.n 800f0d0 <etharp_query+0xe8>
- 800f07c: 462b mov r3, r5
- 800f07e: e003 b.n 800f088 <etharp_query+0xa0>
- * to copy the whole queue into a new PBUF_RAM (see bug #11400)
- * PBUF_ROMs can be left as they are, since ROM must not get changed. */
- p = q;
- while (p) {
- LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0));
- if(p->type != PBUF_ROM) {
- 800f080: 7b1a ldrb r2, [r3, #12]
- 800f082: 2a01 cmp r2, #1
- 800f084: d128 bne.n 800f0d8 <etharp_query+0xf0>
- copy_needed = 1;
- break;
- }
- p = p->next;
- 800f086: 681b ldr r3, [r3, #0]
- int copy_needed = 0;
- /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but
- * to copy the whole queue into a new PBUF_RAM (see bug #11400)
- * PBUF_ROMs can be left as they are, since ROM must not get changed. */
- p = q;
- while (p) {
- 800f088: 2b00 cmp r3, #0
- 800f08a: d1f9 bne.n 800f080 <etharp_query+0x98>
- 800f08c: e02d b.n 800f0ea <etharp_query+0x102>
- }
- if(copy_needed) {
- /* copy the whole packet into new pbufs */
- p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
- if(p != NULL) {
- if (pbuf_copy(p, q) != ERR_OK) {
- 800f08e: 4629 mov r1, r5
- 800f090: f7fc fb18 bl 800b6c4 <pbuf_copy>
- 800f094: b120 cbz r0, 800f0a0 <etharp_query+0xb8>
- pbuf_free(p);
- 800f096: 4630 mov r0, r6
- 800f098: f7fc fa14 bl 800b4c4 <pbuf_free>
- 800f09c: e00e b.n 800f0bc <etharp_query+0xd4>
- /* referencing the old pbuf is enough */
- p = q;
- pbuf_ref(p);
- }
- /* packet could be taken over? */
- if (p != NULL) {
- 800f09e: 462e mov r6, r5
- 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));
- result = ERR_MEM;
- }
- #else /* ARP_QUEUEING */
- /* always queue one packet per ARP request only, freeing a previously queued packet */
- if (arp_table[i].q != NULL) {
- 800f0a0: 2314 movs r3, #20
- 800f0a2: 4a16 ldr r2, [pc, #88] ; (800f0fc <etharp_query+0x114>)
- 800f0a4: fb03 f104 mul.w r1, r3, r4
- 800f0a8: 4615 mov r5, r2
- 800f0aa: 5850 ldr r0, [r2, r1]
- 800f0ac: 461f mov r7, r3
- 800f0ae: b108 cbz r0, 800f0b4 <etharp_query+0xcc>
- 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));
- pbuf_free(arp_table[i].q);
- 800f0b0: f7fc fa08 bl 800b4c4 <pbuf_free>
- }
- arp_table[i].q = p;
- 800f0b4: 437c muls r4, r7
- 800f0b6: 512e str r6, [r5, r4]
- result = ERR_OK;
- 800f0b8: 2400 movs r4, #0
- 800f0ba: e00a b.n 800f0d2 <etharp_query+0xea>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i));
- #endif /* ARP_QUEUEING */
- } else {
- ETHARP_STATS_INC(etharp.memerr);
- 800f0bc: 4b0e ldr r3, [pc, #56] ; (800f0f8 <etharp_query+0x110>)
- 800f0be: 8c9a ldrh r2, [r3, #36] ; 0x24
- 800f0c0: 3201 adds r2, #1
- 800f0c2: 849a strh r2, [r3, #36] ; 0x24
- 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));
- result = ERR_MEM;
- 800f0c4: 24ff movs r4, #255 ; 0xff
- 800f0c6: e004 b.n 800f0d2 <etharp_query+0xea>
- /* non-unicast address? */
- if (ip_addr_isbroadcast(ipaddr, netif) ||
- ip_addr_ismulticast(ipaddr) ||
- ip_addr_isany(ipaddr)) {
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n"));
- return ERR_ARG;
- 800f0c8: 24f2 movs r4, #242 ; 0xf2
- 800f0ca: e002 b.n 800f0d2 <etharp_query+0xea>
- /* We don't re-send arp request in etharp_tmr, but we still queue packets,
- since this failure could be temporary, and the next packet calling
- etharp_query again could lead to sending the queued packets. */
- }
- if (q == NULL) {
- return result;
- 800f0cc: 4604 mov r4, r0
- 800f0ce: e000 b.n 800f0d2 <etharp_query+0xea>
- /* we have a valid IP->Ethernet address mapping */
- ETHARP_SET_HINT(netif, i);
- /* send the packet */
- result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
- /* pending entry? (either just created or already pending */
- } else if (arp_table[i].state == ETHARP_STATE_PENDING) {
- 800f0d0: 4614 mov r4, r2
- 800f0d2: b260 sxtb r0, r4
- 800f0d4: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- }
- p = p->next;
- }
- if(copy_needed) {
- /* copy the whole packet into new pbufs */
- p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
- 800f0d8: 2003 movs r0, #3
- 800f0da: 8919 ldrh r1, [r3, #8]
- 800f0dc: 2200 movs r2, #0
- 800f0de: f7fc fa42 bl 800b566 <pbuf_alloc>
- if(p != NULL) {
- 800f0e2: 4606 mov r6, r0
- 800f0e4: 2800 cmp r0, #0
- 800f0e6: d1d2 bne.n 800f08e <etharp_query+0xa6>
- 800f0e8: e7e8 b.n 800f0bc <etharp_query+0xd4>
- }
- }
- } else {
- /* referencing the old pbuf is enough */
- p = q;
- pbuf_ref(p);
- 800f0ea: 4628 mov r0, r5
- 800f0ec: f7fc facb bl 800b686 <pbuf_ref>
- }
- /* packet could be taken over? */
- if (p != NULL) {
- 800f0f0: 2d00 cmp r5, #0
- 800f0f2: d1d4 bne.n 800f09e <etharp_query+0xb6>
- 800f0f4: e7e2 b.n 800f0bc <etharp_query+0xd4>
- 800f0f6: bf00 nop
- 800f0f8: 20008220 .word 0x20008220
- 800f0fc: 20006bc4 .word 0x20006bc4
- 800f100: 20006bc2 .word 0x20006bc2
- 0800f104 <etharp_output_to_arp_index>:
- /** Just a small helper function that sends a pbuf to an ethernet address
- * in the arp_table specified by the index 'arp_idx'.
- */
- static err_t
- etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
- {
- 800f104: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
- arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
- /* if arp table entry is about to expire: re-request it,
- but only if its state is ETHARP_STATE_STABLE to prevent flooding the
- network with ARP requests if this address is used frequently. */
- if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
- 800f108: 4b10 ldr r3, [pc, #64] ; (800f14c <etharp_output_to_arp_index+0x48>)
- /** Just a small helper function that sends a pbuf to an ethernet address
- * in the arp_table specified by the index 'arp_idx'.
- */
- static err_t
- etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
- {
- 800f10a: 4615 mov r5, r2
- LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
- arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
- /* if arp table entry is about to expire: re-request it,
- but only if its state is ETHARP_STATE_STABLE to prevent flooding the
- network with ARP requests if this address is used frequently. */
- if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
- 800f10c: 2214 movs r2, #20
- /** Just a small helper function that sends a pbuf to an ethernet address
- * in the arp_table specified by the index 'arp_idx'.
- */
- static err_t
- etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
- {
- 800f10e: 460e mov r6, r1
- LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
- arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
- /* if arp table entry is about to expire: re-request it,
- but only if its state is ETHARP_STATE_STABLE to prevent flooding the
- network with ARP requests if this address is used frequently. */
- if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
- 800f110: fb02 3105 mla r1, r2, r5, r3
- /** Just a small helper function that sends a pbuf to an ethernet address
- * in the arp_table specified by the index 'arp_idx'.
- */
- static err_t
- etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
- {
- 800f114: 4607 mov r7, r0
- LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE",
- arp_table[arp_idx].state >= ETHARP_STATE_STABLE);
- /* if arp table entry is about to expire: re-request it,
- but only if its state is ETHARP_STATE_STABLE to prevent flooding the
- network with ARP requests if this address is used frequently. */
- if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) &&
- 800f116: 7c8a ldrb r2, [r1, #18]
- 800f118: 2a02 cmp r2, #2
- 800f11a: f101 0410 add.w r4, r1, #16
- 800f11e: d108 bne.n 800f132 <etharp_output_to_arp_index+0x2e>
- 800f120: 7cca ldrb r2, [r1, #19]
- 800f122: 2ae3 cmp r2, #227 ; 0xe3
- 800f124: d905 bls.n 800f132 <etharp_output_to_arp_index+0x2e>
- (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED)) {
- if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) {
- 800f126: 3104 adds r1, #4
- 800f128: f7ff ff00 bl 800ef2c <etharp_request>
- 800f12c: b908 cbnz r0, 800f132 <etharp_output_to_arp_index+0x2e>
- arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING;
- 800f12e: 2303 movs r3, #3
- 800f130: 70a3 strb r3, [r4, #2]
- }
- }
-
- return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
- 800f132: 4b06 ldr r3, [pc, #24] ; (800f14c <etharp_output_to_arp_index+0x48>)
- 800f134: 2214 movs r2, #20
- 800f136: fb02 3305 mla r3, r2, r5, r3
- 800f13a: 4638 mov r0, r7
- 800f13c: 4631 mov r1, r6
- 800f13e: f107 0227 add.w r2, r7, #39 ; 0x27
- 800f142: 330c adds r3, #12
- &arp_table[arp_idx].ethaddr);
- }
- 800f144: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
- if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) {
- arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING;
- }
- }
-
- return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
- 800f148: f7ff bea6 b.w 800ee98 <etharp_send_ip>
- 800f14c: 20006bc4 .word 0x20006bc4
- 0800f150 <etharp_output>:
- * - ERR_RTE No route to destination (no gateway to external networks),
- * or the return type of either etharp_query() or etharp_send_ip().
- */
- err_t
- etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
- {
- 800f150: b5f7 push {r0, r1, r2, r4, r5, r6, r7, lr}
- 800f152: 4604 mov r4, r0
- 800f154: 460e mov r6, r1
- LWIP_ASSERT("netif != NULL", netif != NULL);
- LWIP_ASSERT("q != NULL", q != NULL);
- LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL);
- /* make room for Ethernet header - should not fail */
- if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
- 800f156: 4608 mov r0, r1
- 800f158: 210e movs r1, #14
- * - ERR_RTE No route to destination (no gateway to external networks),
- * or the return type of either etharp_query() or etharp_send_ip().
- */
- err_t
- etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
- {
- 800f15a: 4615 mov r5, r2
- LWIP_ASSERT("netif != NULL", netif != NULL);
- LWIP_ASSERT("q != NULL", q != NULL);
- LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL);
- /* make room for Ethernet header - should not fail */
- if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
- 800f15c: f7fc f987 bl 800b46e <pbuf_header>
- 800f160: b128 cbz r0, 800f16e <etharp_output+0x1e>
- /* bail out */
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
- ("etharp_output: could not allocate room for header.\n"));
- LINK_STATS_INC(link.lenerr);
- 800f162: 4b38 ldr r3, [pc, #224] ; (800f244 <etharp_output+0xf4>)
- 800f164: 895a ldrh r2, [r3, #10]
- 800f166: 3201 adds r2, #1
- 800f168: 815a strh r2, [r3, #10]
- return ERR_BUF;
- 800f16a: 20fe movs r0, #254 ; 0xfe
- 800f16c: e068 b.n 800f240 <etharp_output+0xf0>
- /* Determine on destination hardware address. Broadcasts and multicasts
- * are special, other IP addresses are looked up in the ARP table. */
- /* broadcast destination IP address? */
- if (ip_addr_isbroadcast(ipaddr, netif)) {
- 800f16e: 6828 ldr r0, [r5, #0]
- 800f170: 4621 mov r1, r4
- 800f172: f7ff f906 bl 800e382 <ip4_addr_isbroadcast>
- 800f176: 2800 cmp r0, #0
- 800f178: d159 bne.n 800f22e <etharp_output+0xde>
- /* broadcast on Ethernet also */
- dest = (struct eth_addr *)ðbroadcast;
- /* multicast destination IP address? */
- } else if (ip_addr_ismulticast(ipaddr)) {
- 800f17a: 682b ldr r3, [r5, #0]
- 800f17c: f003 02f0 and.w r2, r3, #240 ; 0xf0
- 800f180: 2ae0 cmp r2, #224 ; 0xe0
- 800f182: d114 bne.n 800f1ae <etharp_output+0x5e>
- /* Hash IP multicast address to MAC address.*/
- mcastaddr.addr[0] = LL_MULTICAST_ADDR_0;
- 800f184: 2301 movs r3, #1
- 800f186: f88d 3000 strb.w r3, [sp]
- mcastaddr.addr[1] = LL_MULTICAST_ADDR_1;
- mcastaddr.addr[2] = LL_MULTICAST_ADDR_2;
- 800f18a: 235e movs r3, #94 ; 0x5e
- 800f18c: f88d 3002 strb.w r3, [sp, #2]
- mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f;
- 800f190: 786b ldrb r3, [r5, #1]
- dest = (struct eth_addr *)ðbroadcast;
- /* multicast destination IP address? */
- } else if (ip_addr_ismulticast(ipaddr)) {
- /* Hash IP multicast address to MAC address.*/
- mcastaddr.addr[0] = LL_MULTICAST_ADDR_0;
- mcastaddr.addr[1] = LL_MULTICAST_ADDR_1;
- 800f192: f88d 0001 strb.w r0, [sp, #1]
- mcastaddr.addr[2] = LL_MULTICAST_ADDR_2;
- mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f;
- 800f196: f003 037f and.w r3, r3, #127 ; 0x7f
- 800f19a: f88d 3003 strb.w r3, [sp, #3]
- mcastaddr.addr[4] = ip4_addr3(ipaddr);
- 800f19e: 78ab ldrb r3, [r5, #2]
- 800f1a0: f88d 3004 strb.w r3, [sp, #4]
- mcastaddr.addr[5] = ip4_addr4(ipaddr);
- 800f1a4: 78eb ldrb r3, [r5, #3]
- 800f1a6: f88d 3005 strb.w r3, [sp, #5]
- /* destination Ethernet address is multicast */
- dest = &mcastaddr;
- 800f1aa: 466b mov r3, sp
- 800f1ac: e040 b.n 800f230 <etharp_output+0xe0>
- /* unicast destination IP address? */
- } else {
- s8_t i;
- /* outside local network? if so, this can neither be a global broadcast nor
- a subnet broadcast. */
- if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
- 800f1ae: 6862 ldr r2, [r4, #4]
- 800f1b0: ea83 0102 eor.w r1, r3, r2
- 800f1b4: 68a2 ldr r2, [r4, #8]
- 800f1b6: 4211 tst r1, r2
- 800f1b8: d009 beq.n 800f1ce <etharp_output+0x7e>
- !ip_addr_islinklocal(ipaddr)) {
- 800f1ba: b29b uxth r3, r3
- /* unicast destination IP address? */
- } else {
- s8_t i;
- /* outside local network? if so, this can neither be a global broadcast nor
- a subnet broadcast. */
- if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
- 800f1bc: f64f 62a9 movw r2, #65193 ; 0xfea9
- 800f1c0: 4293 cmp r3, r2
- 800f1c2: d004 beq.n 800f1ce <etharp_output+0x7e>
- router for forwarding". */
- if (!ip_addr_islinklocal(&iphdr->src))
- #endif /* LWIP_AUTOIP */
- {
- /* interface has default gateway? */
- if (!ip_addr_isany(&netif->gw)) {
- 800f1c4: 68e3 ldr r3, [r4, #12]
- 800f1c6: f104 010c add.w r1, r4, #12
- 800f1ca: b90b cbnz r3, 800f1d0 <etharp_output+0x80>
- 800f1cc: e037 b.n 800f23e <etharp_output+0xee>
- /* unicast destination IP address? */
- } else {
- s8_t i;
- /* outside local network? if so, this can neither be a global broadcast nor
- a subnet broadcast. */
- if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
- 800f1ce: 4629 mov r1, r5
- if (netif->addr_hint != NULL) {
- /* per-pcb cached entry was given */
- u8_t etharp_cached_entry = *(netif->addr_hint);
- if (etharp_cached_entry < ARP_TABLE_SIZE) {
- #endif /* LWIP_NETIF_HWADDRHINT */
- if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
- 800f1d0: 4b1d ldr r3, [pc, #116] ; (800f248 <etharp_output+0xf8>)
- 800f1d2: 781a ldrb r2, [r3, #0]
- 800f1d4: 4b1d ldr r3, [pc, #116] ; (800f24c <etharp_output+0xfc>)
- 800f1d6: 2014 movs r0, #20
- 800f1d8: fb00 3302 mla r3, r0, r2, r3
- 800f1dc: 7c98 ldrb r0, [r3, #18]
- 800f1de: 2801 cmp r0, #1
- 800f1e0: d908 bls.n 800f1f4 <etharp_output+0xa4>
- 800f1e2: 6808 ldr r0, [r1, #0]
- 800f1e4: 685b ldr r3, [r3, #4]
- 800f1e6: 4298 cmp r0, r3
- 800f1e8: d104 bne.n 800f1f4 <etharp_output+0xa4>
- (ip_addr_cmp(dst_addr, &arp_table[etharp_cached_entry].ipaddr))) {
- /* the per-pcb-cached entry is stable and the right one! */
- ETHARP_STATS_INC(etharp.cachehit);
- 800f1ea: 4b16 ldr r3, [pc, #88] ; (800f244 <etharp_output+0xf4>)
- 800f1ec: 8dd9 ldrh r1, [r3, #46] ; 0x2e
- 800f1ee: 3101 adds r1, #1
- 800f1f0: 85d9 strh r1, [r3, #46] ; 0x2e
- 800f1f2: e00d b.n 800f210 <etharp_output+0xc0>
- if (netif->addr_hint != NULL) {
- /* per-pcb cached entry was given */
- u8_t etharp_cached_entry = *(netif->addr_hint);
- if (etharp_cached_entry < ARP_TABLE_SIZE) {
- #endif /* LWIP_NETIF_HWADDRHINT */
- if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
- 800f1f4: 2300 movs r3, #0
- * @return
- * - ERR_RTE No route to destination (no gateway to external networks),
- * or the return type of either etharp_query() or etharp_send_ip().
- */
- err_t
- etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
- 800f1f6: 4f15 ldr r7, [pc, #84] ; (800f24c <etharp_output+0xfc>)
- if (netif->addr_hint != NULL) {
- /* per-pcb cached entry was given */
- u8_t etharp_cached_entry = *(netif->addr_hint);
- if (etharp_cached_entry < ARP_TABLE_SIZE) {
- #endif /* LWIP_NETIF_HWADDRHINT */
- if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
- 800f1f8: 461a mov r2, r3
- * @return
- * - ERR_RTE No route to destination (no gateway to external networks),
- * or the return type of either etharp_query() or etharp_send_ip().
- */
- err_t
- etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
- 800f1fa: 18f8 adds r0, r7, r3
- #endif /* LWIP_NETIF_HWADDRHINT */
- /* find stable entry: do this here since this is a critical path for
- throughput and etharp_find_entry() is kind of slow */
- for (i = 0; i < ARP_TABLE_SIZE; i++) {
- if ((arp_table[i].state >= ETHARP_STATE_STABLE) &&
- 800f1fc: 7c85 ldrb r5, [r0, #18]
- 800f1fe: 2d01 cmp r5, #1
- 800f200: d90b bls.n 800f21a <etharp_output+0xca>
- 800f202: 680d ldr r5, [r1, #0]
- 800f204: 6840 ldr r0, [r0, #4]
- 800f206: 4285 cmp r5, r0
- 800f208: d107 bne.n 800f21a <etharp_output+0xca>
- (ip_addr_cmp(dst_addr, &arp_table[i].ipaddr))) {
- /* found an existing, stable entry */
- ETHARP_SET_HINT(netif, i);
- 800f20a: 4b0f ldr r3, [pc, #60] ; (800f248 <etharp_output+0xf8>)
- 800f20c: b2d2 uxtb r2, r2
- 800f20e: 701a strb r2, [r3, #0]
- return etharp_output_to_arp_index(netif, q, i);
- 800f210: 4620 mov r0, r4
- 800f212: 4631 mov r1, r6
- 800f214: f7ff ff76 bl 800f104 <etharp_output_to_arp_index>
- 800f218: e012 b.n 800f240 <etharp_output+0xf0>
- 800f21a: 3314 adds r3, #20
- }
- #endif /* LWIP_NETIF_HWADDRHINT */
- /* find stable entry: do this here since this is a critical path for
- throughput and etharp_find_entry() is kind of slow */
- for (i = 0; i < ARP_TABLE_SIZE; i++) {
- 800f21c: 3201 adds r2, #1
- 800f21e: 2bc8 cmp r3, #200 ; 0xc8
- 800f220: b2d2 uxtb r2, r2
- 800f222: d1ea bne.n 800f1fa <etharp_output+0xaa>
- return etharp_output_to_arp_index(netif, q, i);
- }
- }
- /* no stable entry found, use the (slower) query function:
- queue on destination Ethernet address belonging to ipaddr */
- return etharp_query(netif, dst_addr, q);
- 800f224: 4620 mov r0, r4
- 800f226: 4632 mov r2, r6
- 800f228: f7ff fede bl 800efe8 <etharp_query>
- 800f22c: e008 b.n 800f240 <etharp_output+0xf0>
- * are special, other IP addresses are looked up in the ARP table. */
- /* broadcast destination IP address? */
- if (ip_addr_isbroadcast(ipaddr, netif)) {
- /* broadcast on Ethernet also */
- dest = (struct eth_addr *)ðbroadcast;
- 800f22e: 4b08 ldr r3, [pc, #32] ; (800f250 <etharp_output+0x100>)
- }
- /* continuation for multicast/broadcast destinations */
- /* obtain source Ethernet address of the given interface */
- /* send packet directly on the link */
- return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
- 800f230: 4620 mov r0, r4
- 800f232: 4631 mov r1, r6
- 800f234: f104 0227 add.w r2, r4, #39 ; 0x27
- 800f238: f7ff fe2e bl 800ee98 <etharp_send_ip>
- 800f23c: e000 b.n 800f240 <etharp_output+0xf0>
- /* send to hardware address of default gateway IP address */
- dst_addr = &(netif->gw);
- /* no default gateway available */
- } else {
- /* no route to destination error (default gateway missing) */
- return ERR_RTE;
- 800f23e: 20fc movs r0, #252 ; 0xfc
- /* continuation for multicast/broadcast destinations */
- /* obtain source Ethernet address of the given interface */
- /* send packet directly on the link */
- return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
- }
- 800f240: b240 sxtb r0, r0
- 800f242: bdfe pop {r1, r2, r3, r4, r5, r6, r7, pc}
- 800f244: 20008220 .word 0x20008220
- 800f248: 20006bc2 .word 0x20006bc2
- 800f24c: 20006bc4 .word 0x20006bc4
- 800f250: 08011884 .word 0x08011884
- 0800f254 <ethernet_input>:
- * @param p the recevied packet, p->payload pointing to the ethernet header
- * @param netif the network interface on which the packet was received
- */
- err_t
- ethernet_input(struct pbuf *p, struct netif *netif)
- {
- 800f254: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- u16_t type;
- #if LWIP_ARP || ETHARP_SUPPORT_VLAN
- s16_t ip_hdr_offset = SIZEOF_ETH_HDR;
- #endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */
- if (p->len <= SIZEOF_ETH_HDR) {
- 800f258: 8943 ldrh r3, [r0, #10]
- 800f25a: 2b0e cmp r3, #14
- * @param p the recevied packet, p->payload pointing to the ethernet header
- * @param netif the network interface on which the packet was received
- */
- err_t
- ethernet_input(struct pbuf *p, struct netif *netif)
- {
- 800f25c: b087 sub sp, #28
- 800f25e: 4604 mov r4, r0
- 800f260: 460d mov r5, r1
- u16_t type;
- #if LWIP_ARP || ETHARP_SUPPORT_VLAN
- s16_t ip_hdr_offset = SIZEOF_ETH_HDR;
- #endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */
- if (p->len <= SIZEOF_ETH_HDR) {
- 800f262: d800 bhi.n 800f266 <ethernet_input+0x12>
- 800f264: e0f5 b.n 800f452 <ethernet_input+0x1fe>
- ETHARP_STATS_INC(etharp.drop);
- goto free_and_return;
- }
- /* points to packet payload, which starts with an Ethernet header */
- ethhdr = (struct eth_hdr *)p->payload;
- 800f266: 6840 ldr r0, [r0, #4]
- #if LWIP_ARP_FILTER_NETIF
- netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, htons(type));
- #endif /* LWIP_ARP_FILTER_NETIF*/
- if (ethhdr->dest.addr[0] & 1) {
- 800f268: 7803 ldrb r3, [r0, #0]
- (unsigned)ethhdr->dest.addr[3], (unsigned)ethhdr->dest.addr[4], (unsigned)ethhdr->dest.addr[5],
- (unsigned)ethhdr->src.addr[0], (unsigned)ethhdr->src.addr[1], (unsigned)ethhdr->src.addr[2],
- (unsigned)ethhdr->src.addr[3], (unsigned)ethhdr->src.addr[4], (unsigned)ethhdr->src.addr[5],
- (unsigned)htons(ethhdr->type)));
- type = ethhdr->type;
- 800f26a: 8986 ldrh r6, [r0, #12]
- #if LWIP_ARP_FILTER_NETIF
- netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, htons(type));
- #endif /* LWIP_ARP_FILTER_NETIF*/
- if (ethhdr->dest.addr[0] & 1) {
- 800f26c: 07da lsls r2, r3, #31
- 800f26e: d513 bpl.n 800f298 <ethernet_input+0x44>
- /* this might be a multicast or broadcast packet */
- if (ethhdr->dest.addr[0] == LL_MULTICAST_ADDR_0) {
- 800f270: 2b01 cmp r3, #1
- 800f272: d108 bne.n 800f286 <ethernet_input+0x32>
- if ((ethhdr->dest.addr[1] == LL_MULTICAST_ADDR_1) &&
- 800f274: 7843 ldrb r3, [r0, #1]
- 800f276: b97b cbnz r3, 800f298 <ethernet_input+0x44>
- 800f278: 7883 ldrb r3, [r0, #2]
- 800f27a: 2b5e cmp r3, #94 ; 0x5e
- 800f27c: d10c bne.n 800f298 <ethernet_input+0x44>
- (ethhdr->dest.addr[2] == LL_MULTICAST_ADDR_2)) {
- /* mark the pbuf as link-layer multicast */
- p->flags |= PBUF_FLAG_LLMCAST;
- 800f27e: 7b63 ldrb r3, [r4, #13]
- 800f280: f043 0310 orr.w r3, r3, #16
- 800f284: e007 b.n 800f296 <ethernet_input+0x42>
- }
- } else if (eth_addr_cmp(ðhdr->dest, ðbroadcast)) {
- 800f286: 497a ldr r1, [pc, #488] ; (800f470 <ethernet_input+0x21c>)
- 800f288: 2206 movs r2, #6
- 800f28a: f7fa f889 bl 80093a0 <memcmp>
- 800f28e: b918 cbnz r0, 800f298 <ethernet_input+0x44>
- /* mark the pbuf as link-layer broadcast */
- p->flags |= PBUF_FLAG_LLBCAST;
- 800f290: 7b63 ldrb r3, [r4, #13]
- 800f292: f043 0308 orr.w r3, r3, #8
- 800f296: 7363 strb r3, [r4, #13]
- }
- }
- switch (type) {
- 800f298: 2e08 cmp r6, #8
- 800f29a: d004 beq.n 800f2a6 <ethernet_input+0x52>
- 800f29c: f5b6 6fc1 cmp.w r6, #1544 ; 0x608
- 800f2a0: f040 80d7 bne.w 800f452 <ethernet_input+0x1fe>
- 800f2a4: e014 b.n 800f2d0 <ethernet_input+0x7c>
- #if LWIP_ARP
- /* IP packet? */
- case PP_HTONS(ETHTYPE_IP):
- if (!(netif->flags & NETIF_FLAG_ETHARP)) {
- 800f2a6: f895 302d ldrb.w r3, [r5, #45] ; 0x2d
- 800f2aa: f003 0320 and.w r3, r3, #32
- 800f2ae: b2db uxtb r3, r3
- 800f2b0: 2b00 cmp r3, #0
- 800f2b2: f000 80d5 beq.w 800f460 <ethernet_input+0x20c>
- #if ETHARP_TRUST_IP_MAC
- /* update ARP table */
- etharp_ip_input(netif, p);
- #endif /* ETHARP_TRUST_IP_MAC */
- /* skip Ethernet header */
- if(pbuf_header(p, -ip_hdr_offset)) {
- 800f2b6: 4620 mov r0, r4
- 800f2b8: f06f 010d mvn.w r1, #13
- 800f2bc: f7fc f8d7 bl 800b46e <pbuf_header>
- 800f2c0: 2800 cmp r0, #0
- 800f2c2: f040 80cd bne.w 800f460 <ethernet_input+0x20c>
- LWIP_ASSERT("Can't move over header in packet", 0);
- goto free_and_return;
- } else {
- /* pass to IP layer */
- ip_input(p, netif);
- 800f2c6: 4620 mov r0, r4
- 800f2c8: 4629 mov r1, r5
- 800f2ca: f7ff f923 bl 800e514 <ip_input>
- }
- break;
- 800f2ce: e0ca b.n 800f466 <ethernet_input+0x212>
-
- case PP_HTONS(ETHTYPE_ARP):
- if (!(netif->flags & NETIF_FLAG_ETHARP)) {
- 800f2d0: f895 302d ldrb.w r3, [r5, #45] ; 0x2d
- 800f2d4: f003 0320 and.w r3, r3, #32
- 800f2d8: b2db uxtb r3, r3
- 800f2da: 2b00 cmp r3, #0
- 800f2dc: f000 80c0 beq.w 800f460 <ethernet_input+0x20c>
- LWIP_ERROR("netif != NULL", (netif != NULL), return;);
- /* drop short ARP packets: we have to check for p->len instead of p->tot_len here
- since a struct etharp_hdr is pointed to p->payload, so it musn't be chained! */
- if (p->len < SIZEOF_ETHARP_PACKET) {
- 800f2e0: 8963 ldrh r3, [r4, #10]
- 800f2e2: 2b29 cmp r3, #41 ; 0x29
- 800f2e4: d804 bhi.n 800f2f0 <ethernet_input+0x9c>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING,
- ("etharp_arp_input: packet dropped, too short (%"S16_F"/%"S16_F")\n", p->tot_len,
- (s16_t)SIZEOF_ETHARP_PACKET));
- ETHARP_STATS_INC(etharp.lenerr);
- 800f2e6: 4b63 ldr r3, [pc, #396] ; (800f474 <ethernet_input+0x220>)
- 800f2e8: 8c5a ldrh r2, [r3, #34] ; 0x22
- 800f2ea: 3201 adds r2, #1
- 800f2ec: 845a strh r2, [r3, #34] ; 0x22
- 800f2ee: e0b4 b.n 800f45a <ethernet_input+0x206>
- ETHARP_STATS_INC(etharp.drop);
- pbuf_free(p);
- return;
- }
- ethhdr = (struct eth_hdr *)p->payload;
- 800f2f0: 6866 ldr r6, [r4, #4]
- hdr = (struct etharp_hdr *)(((u8_t*)ethhdr) + SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR);
- }
- #endif /* ETHARP_SUPPORT_VLAN */
- /* RFC 826 "Packet Reception": */
- if ((hdr->hwtype != PP_HTONS(HWTYPE_ETHERNET)) ||
- 800f2f2: 89f3 ldrh r3, [r6, #14]
- 800f2f4: f5b3 7f80 cmp.w r3, #256 ; 0x100
- 800f2f8: f040 80ab bne.w 800f452 <ethernet_input+0x1fe>
- 800f2fc: 7cb3 ldrb r3, [r6, #18]
- 800f2fe: 2b06 cmp r3, #6
- 800f300: f040 80a7 bne.w 800f452 <ethernet_input+0x1fe>
- (hdr->hwlen != ETHARP_HWADDR_LEN) ||
- 800f304: 7cf7 ldrb r7, [r6, #19]
- 800f306: 2f04 cmp r7, #4
- 800f308: f040 80a3 bne.w 800f452 <ethernet_input+0x1fe>
- (hdr->protolen != sizeof(ip_addr_t)) ||
- 800f30c: 8a33 ldrh r3, [r6, #16]
- 800f30e: 2b08 cmp r3, #8
- 800f310: d000 beq.n 800f314 <ethernet_input+0xc0>
- 800f312: e09e b.n 800f452 <ethernet_input+0x1fe>
- ETHARP_STATS_INC(etharp.proterr);
- ETHARP_STATS_INC(etharp.drop);
- pbuf_free(p);
- return;
- }
- ETHARP_STATS_INC(etharp.recv);
- 800f314: 4b57 ldr r3, [pc, #348] ; (800f474 <ethernet_input+0x220>)
- 800f316: 8b5a ldrh r2, [r3, #26]
- autoip_arp_reply(netif, hdr);
- #endif /* LWIP_AUTOIP */
- /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
- * structure packing (not using structure copy which breaks strict-aliasing rules). */
- IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
- 800f318: f106 0a1c add.w sl, r6, #28
- ETHARP_STATS_INC(etharp.proterr);
- ETHARP_STATS_INC(etharp.drop);
- pbuf_free(p);
- return;
- }
- ETHARP_STATS_INC(etharp.recv);
- 800f31c: 3201 adds r2, #1
- 800f31e: 835a strh r2, [r3, #26]
- autoip_arp_reply(netif, hdr);
- #endif /* LWIP_AUTOIP */
- /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
- * structure packing (not using structure copy which breaks strict-aliasing rules). */
- IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
- 800f320: 4651 mov r1, sl
- 800f322: 463a mov r2, r7
- 800f324: a804 add r0, sp, #16
- 800f326: f7fa f86d bl 8009404 <memcpy>
- IPADDR2_COPY(&dipaddr, &hdr->dipaddr);
- 800f32a: f106 0226 add.w r2, r6, #38 ; 0x26
- 800f32e: 9203 str r2, [sp, #12]
- 800f330: 4611 mov r1, r2
- 800f332: a805 add r0, sp, #20
- 800f334: 463a mov r2, r7
- 800f336: f7fa f865 bl 8009404 <memcpy>
- /* this interface is not configured? */
- if (ip_addr_isany(&netif->ip_addr)) {
- 800f33a: 686b ldr r3, [r5, #4]
- 800f33c: b12b cbz r3, 800f34a <ethernet_input+0xf6>
- for_us = 0;
- } else {
- /* ARP packet directed to us? */
- for_us = (u8_t)ip_addr_cmp(&dipaddr, &(netif->ip_addr));
- 800f33e: 9a05 ldr r2, [sp, #20]
- 800f340: 1ad1 subs r1, r2, r3
- 800f342: 424a negs r2, r1
- 800f344: 414a adcs r2, r1
- 800f346: 9201 str r2, [sp, #4]
- 800f348: e000 b.n 800f34c <ethernet_input+0xf8>
- IPADDR2_COPY(&sipaddr, &hdr->sipaddr);
- IPADDR2_COPY(&dipaddr, &hdr->dipaddr);
- /* this interface is not configured? */
- if (ip_addr_isany(&netif->ip_addr)) {
- for_us = 0;
- 800f34a: 9301 str r3, [sp, #4]
- /* ARP message directed to us?
- -> add IP address in ARP cache; assume requester wants to talk to us,
- can result in directly sending the queued packets for this host.
- ARP message not directed to us?
- -> update the source IP address in the cache, if present */
- etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
- 800f34c: 9b01 ldr r3, [sp, #4]
- 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",
- ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
- ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
- ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
- /* non-unicast address? */
- if (ip_addr_isany(ipaddr) ||
- 800f34e: 9804 ldr r0, [sp, #16]
- /* ARP message directed to us?
- -> add IP address in ARP cache; assume requester wants to talk to us,
- can result in directly sending the queued packets for this host.
- ARP message not directed to us?
- -> update the source IP address in the cache, if present */
- etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
- 800f350: f106 0716 add.w r7, r6, #22
- 800f354: 2b00 cmp r3, #0
- 800f356: bf0c ite eq
- 800f358: f04f 0802 moveq.w r8, #2
- 800f35c: f04f 0801 movne.w r8, #1
- case PP_HTONS(ETHTYPE_ARP):
- if (!(netif->flags & NETIF_FLAG_ETHARP)) {
- goto free_and_return;
- }
- /* pass p to ARP module */
- etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p);
- 800f360: f105 0927 add.w r9, r5, #39 ; 0x27
- 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",
- ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
- ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
- ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
- /* non-unicast address? */
- if (ip_addr_isany(ipaddr) ||
- 800f364: 2800 cmp r0, #0
- 800f366: d037 beq.n 800f3d8 <ethernet_input+0x184>
- ip_addr_isbroadcast(ipaddr, netif) ||
- 800f368: 4629 mov r1, r5
- 800f36a: f7ff f80a bl 800e382 <ip4_addr_isbroadcast>
- 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",
- ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
- ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
- ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
- /* non-unicast address? */
- if (ip_addr_isany(ipaddr) ||
- 800f36e: 9002 str r0, [sp, #8]
- 800f370: 2800 cmp r0, #0
- 800f372: d131 bne.n 800f3d8 <ethernet_input+0x184>
- ip_addr_isbroadcast(ipaddr, netif) ||
- ip_addr_ismulticast(ipaddr)) {
- 800f374: 9a04 ldr r2, [sp, #16]
- 800f376: f002 02f0 and.w r2, r2, #240 ; 0xf0
- ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr),
- ethaddr->addr[0], ethaddr->addr[1], ethaddr->addr[2],
- ethaddr->addr[3], ethaddr->addr[4], ethaddr->addr[5]));
- /* non-unicast address? */
- if (ip_addr_isany(ipaddr) ||
- ip_addr_isbroadcast(ipaddr, netif) ||
- 800f37a: 2ae0 cmp r2, #224 ; 0xe0
- 800f37c: d02c beq.n 800f3d8 <ethernet_input+0x184>
- ip_addr_ismulticast(ipaddr)) {
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: will not add non-unicast IP address to ARP cache\n"));
- return ERR_ARG;
- }
- /* find or create ARP entry */
- i = etharp_find_entry(ipaddr, flags);
- 800f37e: a804 add r0, sp, #16
- 800f380: 4641 mov r1, r8
- 800f382: f7ff fd17 bl 800edb4 <etharp_find_entry>
- /* bail out if no entry could be found */
- if (i < 0) {
- 800f386: 2800 cmp r0, #0
- 800f388: db26 blt.n 800f3d8 <ethernet_input+0x184>
- arp_table[i].state = ETHARP_STATE_STATIC;
- } else
- #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
- {
- /* mark it stable */
- arp_table[i].state = ETHARP_STATE_STABLE;
- 800f38a: 4b3b ldr r3, [pc, #236] ; (800f478 <ethernet_input+0x224>)
- 800f38c: f04f 0814 mov.w r8, #20
- 800f390: fb08 f800 mul.w r8, r8, r0
- 800f394: eb03 0208 add.w r2, r3, r8
- 800f398: 2102 movs r1, #2
- /* insert in SNMP ARP index tree */
- snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: updating stable entry %"S16_F"\n", (s16_t)i));
- /* update address */
- ETHADDR32_COPY(&arp_table[i].ethaddr, ethaddr);
- 800f39a: 4610 mov r0, r2
- arp_table[i].state = ETHARP_STATE_STATIC;
- } else
- #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
- {
- /* mark it stable */
- arp_table[i].state = ETHARP_STATE_STABLE;
- 800f39c: 7491 strb r1, [r2, #18]
- 800f39e: f102 0b10 add.w fp, r2, #16
- }
- /* record network interface */
- arp_table[i].netif = netif;
- 800f3a2: 6095 str r5, [r2, #8]
- /* insert in SNMP ARP index tree */
- snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: updating stable entry %"S16_F"\n", (s16_t)i));
- /* update address */
- ETHADDR32_COPY(&arp_table[i].ethaddr, ethaddr);
- 800f3a4: 300c adds r0, #12
- 800f3a6: 2206 movs r2, #6
- 800f3a8: 4639 mov r1, r7
- 800f3aa: 9300 str r3, [sp, #0]
- 800f3ac: f7fa f82a bl 8009404 <memcpy>
- /* reset time stamp */
- arp_table[i].ctime = 0;
- 800f3b0: 9a02 ldr r2, [sp, #8]
- 800f3b2: f88b 2003 strb.w r2, [fp, #3]
- /* get the packet pointer */
- p = q->p;
- /* now queue entry can be freed */
- memp_free(MEMP_ARP_QUEUE, q);
- #else /* ARP_QUEUEING */
- if (arp_table[i].q != NULL) {
- 800f3b6: 9b00 ldr r3, [sp, #0]
- 800f3b8: f853 b008 ldr.w fp, [r3, r8]
- 800f3bc: f1bb 0f00 cmp.w fp, #0
- 800f3c0: d00a beq.n 800f3d8 <ethernet_input+0x184>
- struct pbuf *p = arp_table[i].q;
- arp_table[i].q = NULL;
- 800f3c2: f843 2008 str.w r2, [r3, r8]
- #endif /* ARP_QUEUEING */
- /* send the queued IP packet */
- etharp_send_ip(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr);
- 800f3c6: 4628 mov r0, r5
- 800f3c8: 4659 mov r1, fp
- 800f3ca: 464a mov r2, r9
- 800f3cc: 463b mov r3, r7
- 800f3ce: f7ff fd63 bl 800ee98 <etharp_send_ip>
- /* free the queued IP packet */
- pbuf_free(p);
- 800f3d2: 4658 mov r0, fp
- 800f3d4: f7fc f876 bl 800b4c4 <pbuf_free>
- -> update the source IP address in the cache, if present */
- etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
- for_us ? ETHARP_FLAG_TRY_HARD : ETHARP_FLAG_FIND_ONLY);
- /* now act on the message itself */
- switch (hdr->opcode) {
- 800f3d8: 8ab3 ldrh r3, [r6, #20]
- 800f3da: f5b3 7f80 cmp.w r3, #256 ; 0x100
- 800f3de: d003 beq.n 800f3e8 <ethernet_input+0x194>
- 800f3e0: f5b3 7f00 cmp.w r3, #512 ; 0x200
- 800f3e4: d130 bne.n 800f448 <ethernet_input+0x1f4>
- 800f3e6: e02a b.n 800f43e <ethernet_input+0x1ea>
- * reply. In any case, we time-stamp any existing ARP entry,
- * and possiby send out an IP packet that was queued on it. */
- LWIP_DEBUGF (ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: incoming ARP request\n"));
- /* ARP request for our address? */
- if (for_us) {
- 800f3e8: 9b01 ldr r3, [sp, #4]
- 800f3ea: 2b00 cmp r3, #0
- 800f3ec: d038 beq.n 800f460 <ethernet_input+0x20c>
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: replying to ARP request for our IP address\n"));
- /* Re-use pbuf to send ARP reply.
- Since we are re-using an existing pbuf, we can't call etharp_raw since
- that would allocate a new pbuf. */
- hdr->opcode = htons(ARP_REPLY);
- 800f3ee: 2002 movs r0, #2
- 800f3f0: f7fa fefb bl 800a1ea <lwip_htons>
- 800f3f4: 82b0 strh r0, [r6, #20]
- IPADDR2_COPY(&hdr->dipaddr, &hdr->sipaddr);
- 800f3f6: 4651 mov r1, sl
- 800f3f8: 2204 movs r2, #4
- 800f3fa: 9803 ldr r0, [sp, #12]
- 800f3fc: f7fa f802 bl 8009404 <memcpy>
- IPADDR2_COPY(&hdr->sipaddr, &netif->ip_addr);
- 800f400: 1d29 adds r1, r5, #4
- 800f402: 2204 movs r2, #4
- 800f404: 4650 mov r0, sl
- 800f406: f7f9 fffd bl 8009404 <memcpy>
- * 'sender IP address' MUST be sent using link-layer broadcast instead of
- * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */
- ethdst_hwaddr = ip_addr_islinklocal(&netif->ip_addr) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
- #endif /* LWIP_AUTOIP */
- ETHADDR16_COPY(&hdr->dhwaddr, &hdr->shwaddr);
- 800f40a: 4639 mov r1, r7
- 800f40c: 2206 movs r2, #6
- 800f40e: f106 0020 add.w r0, r6, #32
- 800f412: f7f9 fff7 bl 8009404 <memcpy>
- #if LWIP_AUTOIP
- ETHADDR16_COPY(ðhdr->dest, ethdst_hwaddr);
- #else /* LWIP_AUTOIP */
- ETHADDR16_COPY(ðhdr->dest, &hdr->shwaddr);
- 800f416: 4639 mov r1, r7
- 800f418: 2206 movs r2, #6
- 800f41a: 4630 mov r0, r6
- 800f41c: f7f9 fff2 bl 8009404 <memcpy>
- #endif /* LWIP_AUTOIP */
- ETHADDR16_COPY(&hdr->shwaddr, ethaddr);
- 800f420: 4649 mov r1, r9
- 800f422: 2206 movs r2, #6
- 800f424: 4638 mov r0, r7
- 800f426: f7f9 ffed bl 8009404 <memcpy>
- ETHADDR16_COPY(ðhdr->src, ethaddr);
- 800f42a: 4649 mov r1, r9
- 800f42c: 1db0 adds r0, r6, #6
- 800f42e: 2206 movs r2, #6
- 800f430: f7f9 ffe8 bl 8009404 <memcpy>
- /* hwtype, hwaddr_len, proto, protolen and the type in the ethernet header
- are already correct, we tested that before */
- /* return ARP reply */
- netif->linkoutput(netif, p);
- 800f434: 69ab ldr r3, [r5, #24]
- 800f436: 4628 mov r0, r5
- 800f438: 4621 mov r1, r4
- 800f43a: 4798 blx r3
- 800f43c: e010 b.n 800f460 <ethernet_input+0x20c>
- #if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
- /* DHCP wants to know about ARP replies from any host with an
- * IP address also offered to us by the DHCP server. We do not
- * want to take a duplicate IP address on a single network.
- * @todo How should we handle redundant (fail-over) interfaces? */
- dhcp_arp_reply(netif, &sipaddr);
- 800f43e: 4628 mov r0, r5
- 800f440: a904 add r1, sp, #16
- 800f442: f7fb fba9 bl 800ab98 <dhcp_arp_reply>
- 800f446: e00b b.n 800f460 <ethernet_input+0x20c>
- #endif /* (LWIP_DHCP && DHCP_DOES_ARP_CHECK) */
- break;
- default:
- LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: ARP unknown opcode type %"S16_F"\n", htons(hdr->opcode)));
- ETHARP_STATS_INC(etharp.err);
- 800f448: 4b0a ldr r3, [pc, #40] ; (800f474 <ethernet_input+0x220>)
- 800f44a: 8d9a ldrh r2, [r3, #44] ; 0x2c
- 800f44c: 3201 adds r2, #1
- 800f44e: 859a strh r2, [r3, #44] ; 0x2c
- 800f450: e006 b.n 800f460 <ethernet_input+0x20c>
- pppoe_data_input(netif, p);
- break;
- #endif /* PPPOE_SUPPORT */
- default:
- ETHARP_STATS_INC(etharp.proterr);
- 800f452: 4b08 ldr r3, [pc, #32] ; (800f474 <ethernet_input+0x220>)
- 800f454: 8d1a ldrh r2, [r3, #40] ; 0x28
- 800f456: 3201 adds r2, #1
- 800f458: 851a strh r2, [r3, #40] ; 0x28
- ETHARP_STATS_INC(etharp.drop);
- 800f45a: 8bda ldrh r2, [r3, #30]
- 800f45c: 3201 adds r2, #1
- 800f45e: 83da strh r2, [r3, #30]
- /* This means the pbuf is freed or consumed,
- so the caller doesn't have to free it again */
- return ERR_OK;
- free_and_return:
- pbuf_free(p);
- 800f460: 4620 mov r0, r4
- 800f462: f7fc f82f bl 800b4c4 <pbuf_free>
- return ERR_OK;
- }
- 800f466: 2000 movs r0, #0
- 800f468: b007 add sp, #28
- 800f46a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800f46e: bf00 nop
- 800f470: 08011884 .word 0x08011884
- 800f474: 20008220 .word 0x20008220
- 800f478: 20006bc4 .word 0x20006bc4
- 0800f47c <low_level_output>:
- static err_t low_level_output(struct netif *netif, struct pbuf *p)
- {
- struct pbuf *q;
- int framelength = 0;
- u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
- 800f47c: 4b0a ldr r3, [pc, #40] ; (800f4a8 <low_level_output+0x2c>)
- 800f47e: 681b ldr r3, [r3, #0]
- * to become availale since the stack doesn't retry to send a packet
- * dropped because of memory failure (except for the TCP timers).
- */
- static err_t low_level_output(struct netif *netif, struct pbuf *p)
- {
- 800f480: b570 push {r4, r5, r6, lr}
- struct pbuf *q;
- int framelength = 0;
- u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
- 800f482: 689e ldr r6, [r3, #8]
-
- /* copy frame from pbufs to driver buffers */
- for(q = p; q != NULL; q = q->next)
- 800f484: 460c mov r4, r1
- */
- static err_t low_level_output(struct netif *netif, struct pbuf *p)
- {
- struct pbuf *q;
- int framelength = 0;
- 800f486: 2500 movs r5, #0
- u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
-
- /* copy frame from pbufs to driver buffers */
- for(q = p; q != NULL; q = q->next)
- 800f488: e007 b.n 800f49a <low_level_output+0x1e>
- {
- memcpy((u8_t*)&buffer[framelength], q->payload, q->len);
- 800f48a: 1970 adds r0, r6, r5
- 800f48c: 6861 ldr r1, [r4, #4]
- 800f48e: 8962 ldrh r2, [r4, #10]
- 800f490: f7f9 ffb8 bl 8009404 <memcpy>
- framelength = framelength + q->len;
- 800f494: 8963 ldrh r3, [r4, #10]
- struct pbuf *q;
- int framelength = 0;
- u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
-
- /* copy frame from pbufs to driver buffers */
- for(q = p; q != NULL; q = q->next)
- 800f496: 6824 ldr r4, [r4, #0]
- {
- memcpy((u8_t*)&buffer[framelength], q->payload, q->len);
- framelength = framelength + q->len;
- 800f498: 18ed adds r5, r5, r3
- struct pbuf *q;
- int framelength = 0;
- u8 *buffer = (u8 *)(DMATxDescToSet->Buffer1Addr);
-
- /* copy frame from pbufs to driver buffers */
- for(q = p; q != NULL; q = q->next)
- 800f49a: 2c00 cmp r4, #0
- 800f49c: d1f5 bne.n 800f48a <low_level_output+0xe>
-
- /* Note: padding and CRC for transmitted frame
- are automatically inserted by DMA */
- /* Prepare transmit descriptors to give to DMA*/
- ETH_Prepare_Transmit_Descriptors(framelength);
- 800f49e: b2a8 uxth r0, r5
- 800f4a0: f001 f988 bl 80107b4 <ETH_Prepare_Transmit_Descriptors>
- return ERR_OK;
- }
- 800f4a4: 4620 mov r0, r4
- 800f4a6: bd70 pop {r4, r5, r6, pc}
- 800f4a8: 20008cc0 .word 0x20008cc0
- 0800f4ac <ethernetif_input>:
- * the appropriate input function is called.
- *
- * @param netif the lwip network interface structure for this ethernetif
- */
- err_t ethernetif_input(struct netif *netif)
- {
- 800f4ac: e92d 41ff stmdb sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr}
- 800f4b0: 4607 mov r7, r0
-
-
- p = NULL;
-
- /* get received frame */
- frame = ETH_Get_Received_Frame();
- 800f4b2: a801 add r0, sp, #4
- 800f4b4: f001 f964 bl 8010780 <ETH_Get_Received_Frame>
- /* Obtain the size of the packet and put it into the "len" variable. */
- len = frame.length;
- buffer = (u8 *)frame.buffer;
-
- /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
- 800f4b8: 2003 movs r0, #3
- 800f4ba: f8bd 1004 ldrh.w r1, [sp, #4]
- /* get received frame */
- frame = ETH_Get_Received_Frame();
-
- /* Obtain the size of the packet and put it into the "len" variable. */
- len = frame.length;
- buffer = (u8 *)frame.buffer;
- 800f4be: f8dd 8008 ldr.w r8, [sp, #8]
-
- /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
- 800f4c2: 4602 mov r2, r0
- 800f4c4: f7fc f84f bl 800b566 <pbuf_alloc>
-
- /* copy received frame to pbuf chain */
- if (p != NULL)
- 800f4c8: 4605 mov r5, r0
- 800f4ca: b928 cbnz r0, 800f4d8 <ethernetif_input+0x2c>
- }
- }
-
- /* Release descriptors to DMA */
- /* Check if frame with multiple DMA buffer segments */
- if (DMA_RX_FRAME_infos->Seg_Count > 1)
- 800f4cc: 4b1c ldr r3, [pc, #112] ; (800f540 <ethernetif_input+0x94>)
- 800f4ce: 681b ldr r3, [r3, #0]
- 800f4d0: 689a ldr r2, [r3, #8]
- 800f4d2: 2a01 cmp r2, #1
- 800f4d4: d80e bhi.n 800f4f4 <ethernetif_input+0x48>
- 800f4d6: e012 b.n 800f4fe <ethernetif_input+0x52>
-
- /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
-
- /* copy received frame to pbuf chain */
- if (p != NULL)
- 800f4d8: 4604 mov r4, r0
- 800f4da: 2600 movs r6, #0
- {
- for (q = p; q != NULL; q = q->next)
- {
- memcpy((u8_t*)q->payload, (u8_t*)&buffer[l], q->len);
- 800f4dc: 6860 ldr r0, [r4, #4]
- 800f4de: 8962 ldrh r2, [r4, #10]
- 800f4e0: eb08 0106 add.w r1, r8, r6
- 800f4e4: f7f9 ff8e bl 8009404 <memcpy>
- l = l + q->len;
- 800f4e8: 8963 ldrh r3, [r4, #10]
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
-
- /* copy received frame to pbuf chain */
- if (p != NULL)
- {
- for (q = p; q != NULL; q = q->next)
- 800f4ea: 6824 ldr r4, [r4, #0]
- {
- memcpy((u8_t*)q->payload, (u8_t*)&buffer[l], q->len);
- l = l + q->len;
- 800f4ec: 18f6 adds r6, r6, r3
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
-
- /* copy received frame to pbuf chain */
- if (p != NULL)
- {
- for (q = p; q != NULL; q = q->next)
- 800f4ee: 2c00 cmp r4, #0
- 800f4f0: d1f4 bne.n 800f4dc <ethernetif_input+0x30>
- 800f4f2: e7eb b.n 800f4cc <ethernetif_input+0x20>
-
- /* Release descriptors to DMA */
- /* Check if frame with multiple DMA buffer segments */
- if (DMA_RX_FRAME_infos->Seg_Count > 1)
- {
- DMARxNextDesc = DMA_RX_FRAME_infos->FS_Rx_Desc;
- 800f4f4: 681a ldr r2, [r3, #0]
-
- /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */
- p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
-
- /* copy received frame to pbuf chain */
- if (p != NULL)
- 800f4f6: 2400 movs r4, #0
- }
-
- /* Set Own bit in Rx descriptors: gives the buffers back to DMA */
- for (i=0; i<DMA_RX_FRAME_infos->Seg_Count; i++)
- {
- DMARxNextDesc->Status = ETH_DMARxDesc_OWN;
- 800f4f8: f04f 4000 mov.w r0, #2147483648 ; 0x80000000
- 800f4fc: e004 b.n 800f508 <ethernetif_input+0x5c>
- {
- DMARxNextDesc = DMA_RX_FRAME_infos->FS_Rx_Desc;
- }
- else
- {
- DMARxNextDesc = frame.descriptor;
- 800f4fe: 9a03 ldr r2, [sp, #12]
- 800f500: e7f9 b.n 800f4f6 <ethernetif_input+0x4a>
- }
-
- /* Set Own bit in Rx descriptors: gives the buffers back to DMA */
- for (i=0; i<DMA_RX_FRAME_infos->Seg_Count; i++)
- {
- DMARxNextDesc->Status = ETH_DMARxDesc_OWN;
- 800f502: 6010 str r0, [r2, #0]
- DMARxNextDesc = (ETH_DMADESCTypeDef *)(DMARxNextDesc->Buffer2NextDescAddr);
- 800f504: 68d2 ldr r2, [r2, #12]
- {
- DMARxNextDesc = frame.descriptor;
- }
-
- /* Set Own bit in Rx descriptors: gives the buffers back to DMA */
- for (i=0; i<DMA_RX_FRAME_infos->Seg_Count; i++)
- 800f506: 3401 adds r4, #1
- 800f508: 6899 ldr r1, [r3, #8]
- 800f50a: 428c cmp r4, r1
- 800f50c: d3f9 bcc.n 800f502 <ethernetif_input+0x56>
- DMARxNextDesc->Status = ETH_DMARxDesc_OWN;
- DMARxNextDesc = (ETH_DMADESCTypeDef *)(DMARxNextDesc->Buffer2NextDescAddr);
- }
-
- /* Clear Segment_Count */
- DMA_RX_FRAME_infos->Seg_Count =0;
- 800f50e: 2200 movs r2, #0
- 800f510: 609a str r2, [r3, #8]
-
- /* When Rx Buffer unavailable flag is set: clear it and resume reception */
- if ((ETH->DMASR & ETH_DMASR_RBUS) != (u32)RESET)
- 800f512: 4b0c ldr r3, [pc, #48] ; (800f544 <ethernetif_input+0x98>)
- 800f514: 6959 ldr r1, [r3, #20]
- 800f516: 0609 lsls r1, r1, #24
- 800f518: d502 bpl.n 800f520 <ethernetif_input+0x74>
- {
- /* Clear RBUS ETHERNET DMA flag */
- ETH->DMASR = ETH_DMASR_RBUS;
- 800f51a: 2180 movs r1, #128 ; 0x80
- 800f51c: 6159 str r1, [r3, #20]
- /* Resume DMA reception */
- ETH->DMARPDR = 0;
- 800f51e: 609a str r2, [r3, #8]
- /* move received packet into a new pbuf */
- p = low_level_input(netif);
- /* no packet could be read, silently ignore this */
- if (p == NULL) return ERR_MEM;
- 800f520: b14d cbz r5, 800f536 <ethernetif_input+0x8a>
- /* entry point to the LwIP stack */
- err = netif->input(p, netif);
- 800f522: 693b ldr r3, [r7, #16]
- 800f524: 4628 mov r0, r5
- 800f526: 4639 mov r1, r7
- 800f528: 4798 blx r3
-
- if (err != ERR_OK)
- 800f52a: 4604 mov r4, r0
- 800f52c: b120 cbz r0, 800f538 <ethernetif_input+0x8c>
- {
- LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
- pbuf_free(p);
- 800f52e: 4628 mov r0, r5
- 800f530: f7fb ffc8 bl 800b4c4 <pbuf_free>
- 800f534: e000 b.n 800f538 <ethernetif_input+0x8c>
- /* move received packet into a new pbuf */
- p = low_level_input(netif);
- /* no packet could be read, silently ignore this */
- if (p == NULL) return ERR_MEM;
- 800f536: 24ff movs r4, #255 ; 0xff
- LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
- pbuf_free(p);
- p = NULL;
- }
- return err;
- }
- 800f538: b260 sxtb r0, r4
- 800f53a: b004 add sp, #16
- 800f53c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800f540: 2000ab2c .word 0x2000ab2c
- 800f544: 40029000 .word 0x40029000
- 0800f548 <ethernetif_init>:
- #if LWIP_NETIF_HOSTNAME
- /* Initialize interface hostname */
- netif->hostname = "lwip";
- #endif /* LWIP_NETIF_HOSTNAME */
- netif->name[0] = IFNAME0;
- 800f548: 2373 movs r3, #115 ; 0x73
- * @return ERR_OK if the loopif is initialized
- * ERR_MEM if private data couldn't be allocated
- * any other err_t on error
- */
- err_t ethernetif_init(struct netif *netif)
- {
- 800f54a: b537 push {r0, r1, r2, r4, r5, lr}
- #if LWIP_NETIF_HOSTNAME
- /* Initialize interface hostname */
- netif->hostname = "lwip";
- #endif /* LWIP_NETIF_HOSTNAME */
- netif->name[0] = IFNAME0;
- 800f54c: f880 302e strb.w r3, [r0, #46] ; 0x2e
- netif->name[1] = IFNAME1;
- 800f550: 2374 movs r3, #116 ; 0x74
- 800f552: f880 302f strb.w r3, [r0, #47] ; 0x2f
- /* We directly use etharp_output() here to save a function call.
- * You can instead declare your own function an call etharp_output()
- * from it if you have to do some checks before sending (e.g. if link
- * is available...) */
- netif->output = etharp_output;
- 800f556: 4b23 ldr r3, [pc, #140] ; (800f5e4 <ethernetif_init+0x9c>)
-
- #ifdef CHECKSUM_BY_HARDWARE
- /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
- for(i=0; i<ETH_TXBUFNB; i++)
- {
- ETH_DMATxDescChecksumInsertionConfig(&DMATxDscrTab[i], ETH_DMATxDesc_ChecksumTCPUDPICMPFull);
- 800f558: 4d23 ldr r5, [pc, #140] ; (800f5e8 <ethernetif_init+0xa0>)
- netif->name[1] = IFNAME1;
- /* We directly use etharp_output() here to save a function call.
- * You can instead declare your own function an call etharp_output()
- * from it if you have to do some checks before sending (e.g. if link
- * is available...) */
- netif->output = etharp_output;
- 800f55a: 6143 str r3, [r0, #20]
- netif->linkoutput = low_level_output;
- 800f55c: 4b23 ldr r3, [pc, #140] ; (800f5ec <ethernetif_init+0xa4>)
- 800f55e: 6183 str r3, [r0, #24]
- uint8_t mac[6];
- #ifdef CHECKSUM_BY_HARDWARE
- int i;
- #endif
- /* set MAC hardware address length */
- netif->hwaddr_len = ETHARP_HWADDR_LEN;
- 800f560: 2306 movs r3, #6
- * @return ERR_OK if the loopif is initialized
- * ERR_MEM if private data couldn't be allocated
- * any other err_t on error
- */
- err_t ethernetif_init(struct netif *netif)
- {
- 800f562: 4604 mov r4, r0
- uint8_t mac[6];
- #ifdef CHECKSUM_BY_HARDWARE
- int i;
- #endif
- /* set MAC hardware address length */
- netif->hwaddr_len = ETHARP_HWADDR_LEN;
- 800f564: f880 3026 strb.w r3, [r0, #38] ; 0x26
- /* set MAC hardware address */
-
- SETTINGS_GetMac(mac);
- 800f568: 4668 mov r0, sp
- 800f56a: f000 fa8d bl 800fa88 <SETTINGS_GetMac>
-
- netif->hwaddr[0] = mac[0];
- 800f56e: f89d 3000 ldrb.w r3, [sp]
- 800f572: f884 3027 strb.w r3, [r4, #39] ; 0x27
- netif->hwaddr[1] = mac[1];
- 800f576: f89d 3001 ldrb.w r3, [sp, #1]
- 800f57a: f884 3028 strb.w r3, [r4, #40] ; 0x28
- netif->hwaddr[2] = mac[2];
- 800f57e: f89d 3002 ldrb.w r3, [sp, #2]
- 800f582: f884 3029 strb.w r3, [r4, #41] ; 0x29
- netif->hwaddr[3] = mac[3];
- 800f586: f89d 3003 ldrb.w r3, [sp, #3]
- 800f58a: f884 302a strb.w r3, [r4, #42] ; 0x2a
- netif->hwaddr[4] = mac[4];
- 800f58e: f89d 3004 ldrb.w r3, [sp, #4]
- 800f592: f884 302b strb.w r3, [r4, #43] ; 0x2b
- netif->hwaddr[5] = mac[5];
- 800f596: f89d 3005 ldrb.w r3, [sp, #5]
-
- /* initialize MAC address in ethernet MAC */
- ETH_MACAddressConfig(ETH_MAC_Address0, netif->hwaddr);
- 800f59a: f104 0127 add.w r1, r4, #39 ; 0x27
- netif->hwaddr[0] = mac[0];
- netif->hwaddr[1] = mac[1];
- netif->hwaddr[2] = mac[2];
- netif->hwaddr[3] = mac[3];
- netif->hwaddr[4] = mac[4];
- netif->hwaddr[5] = mac[5];
- 800f59e: f884 302c strb.w r3, [r4, #44] ; 0x2c
-
- /* initialize MAC address in ethernet MAC */
- ETH_MACAddressConfig(ETH_MAC_Address0, netif->hwaddr);
- 800f5a2: 2000 movs r0, #0
- 800f5a4: f001 f8d4 bl 8010750 <ETH_MACAddressConfig>
- /* maximum transfer unit */
- netif->mtu = 1500;
- 800f5a8: f240 53dc movw r3, #1500 ; 0x5dc
- 800f5ac: 84a3 strh r3, [r4, #36] ; 0x24
- /* device capabilities */
- /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */
- netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
- 800f5ae: 2332 movs r3, #50 ; 0x32
- 800f5b0: f884 302d strb.w r3, [r4, #45] ; 0x2d
- /* Initialize Tx Descriptors list: Chain Mode */
- ETH_DMATxDescChainInit(DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB);
- 800f5b4: 480c ldr r0, [pc, #48] ; (800f5e8 <ethernetif_init+0xa0>)
- 800f5b6: 490e ldr r1, [pc, #56] ; (800f5f0 <ethernetif_init+0xa8>)
- 800f5b8: 2205 movs r2, #5
- 800f5ba: f001 f9bf bl 801093c <ETH_DMATxDescChainInit>
- /* Initialize Rx Descriptors list: Chain Mode */
- ETH_DMARxDescChainInit(DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
- 800f5be: 480d ldr r0, [pc, #52] ; (800f5f4 <ethernetif_init+0xac>)
- 800f5c0: 490d ldr r1, [pc, #52] ; (800f5f8 <ethernetif_init+0xb0>)
- 800f5c2: 2205 movs r2, #5
- 800f5c4: f001 f950 bl 8010868 <ETH_DMARxDescChainInit>
-
- #ifdef CHECKSUM_BY_HARDWARE
- /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
- for(i=0; i<ETH_TXBUFNB; i++)
- 800f5c8: 2400 movs r4, #0
- {
- ETH_DMATxDescChecksumInsertionConfig(&DMATxDscrTab[i], ETH_DMATxDesc_ChecksumTCPUDPICMPFull);
- 800f5ca: eb05 1044 add.w r0, r5, r4, lsl #5
- 800f5ce: f44f 0140 mov.w r1, #12582912 ; 0xc00000
- /* Initialize Rx Descriptors list: Chain Mode */
- ETH_DMARxDescChainInit(DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
-
- #ifdef CHECKSUM_BY_HARDWARE
- /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
- for(i=0; i<ETH_TXBUFNB; i++)
- 800f5d2: 3401 adds r4, #1
- {
- ETH_DMATxDescChecksumInsertionConfig(&DMATxDscrTab[i], ETH_DMATxDesc_ChecksumTCPUDPICMPFull);
- 800f5d4: f001 f9d4 bl 8010980 <ETH_DMATxDescChecksumInsertionConfig>
- /* Initialize Rx Descriptors list: Chain Mode */
- ETH_DMARxDescChainInit(DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
-
- #ifdef CHECKSUM_BY_HARDWARE
- /* Enable the TCP, UDP and ICMP checksum insertion for the Tx frames */
- for(i=0; i<ETH_TXBUFNB; i++)
- 800f5d8: 2c05 cmp r4, #5
- 800f5da: d1f6 bne.n 800f5ca <ethernetif_init+0x82>
- #endif
- /* Note: TCP, UDP, ICMP checksum checking for received frame are enabled in DMA config */
- /* Enable MAC and DMA transmission and reception */
- ETH_Start();
- 800f5dc: f001 fa10 bl 8010a00 <ETH_Start>
- /* initialize the hardware */
- low_level_init(netif);
- return ERR_OK;
- }
- 800f5e0: 2000 movs r0, #0
- 800f5e2: bd3e pop {r1, r2, r3, r4, r5, pc}
- 800f5e4: 0800f151 .word 0x0800f151
- 800f5e8: 20008cc4 .word 0x20008cc4
- 800f5ec: 0800f47d .word 0x0800f47d
- 800f5f0: 2000abd0 .word 0x2000abd0
- 800f5f4: 2000ab30 .word 0x2000ab30
- 800f5f8: 20008d64 .word 0x20008d64
- 0800f5fc <CRC_Init>:
- /**
- * @brief
- * @retval
- */
- void CRC_Init(void)
- {
- 800f5fc: b508 push {r3, lr}
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
- 800f5fe: f44f 5080 mov.w r0, #4096 ; 0x1000
- 800f602: 2101 movs r1, #1
- 800f604: f7fa fcc6 bl 8009f94 <RCC_AHB1PeriphClockCmd>
- CRC->CR |= CRC_CR_RESET;
- 800f608: 4b02 ldr r3, [pc, #8] ; (800f614 <CRC_Init+0x18>)
- 800f60a: 689a ldr r2, [r3, #8]
- 800f60c: f042 0201 orr.w r2, r2, #1
- 800f610: 609a str r2, [r3, #8]
- 800f612: bd08 pop {r3, pc}
- 800f614: 40023000 .word 0x40023000
- 0800f618 <CRC_Read>:
- * @retval
- */
- uint32_t CRC_Read(void) {
- uint32_t* ptr = (uint32_t*)USER_FLASH_CRC_ADDRESS;
- return *ptr;
- }
- 800f618: 4b01 ldr r3, [pc, #4] ; (800f620 <CRC_Read+0x8>)
- 800f61a: 6818 ldr r0, [r3, #0]
- 800f61c: 4770 bx lr
- 800f61e: bf00 nop
- 800f620: 0807fffc .word 0x0807fffc
- 0800f624 <CRC_Calcucate>:
- * @retval
- */
- uint32_t CRC_Calcucate(void) {
- uint32_t res;
- /* Reset CRC */
- CRC->CR = ((uint8_t)0x01);
- 800f624: 4a06 ldr r2, [pc, #24] ; (800f640 <CRC_Calcucate+0x1c>)
- for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
- 800f626: 4907 ldr r1, [pc, #28] ; (800f644 <CRC_Calcucate+0x20>)
- * @retval
- */
- uint32_t CRC_Calcucate(void) {
- uint32_t res;
- /* Reset CRC */
- CRC->CR = ((uint8_t)0x01);
- 800f628: 2301 movs r3, #1
- 800f62a: 6093 str r3, [r2, #8]
- for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
- 800f62c: 4b06 ldr r3, [pc, #24] ; (800f648 <CRC_Calcucate+0x24>)
- CRC->DR = *ptr; // добавляем всю прошивку в CRC
- 800f62e: f853 0b04 ldr.w r0, [r3], #4
- */
- uint32_t CRC_Calcucate(void) {
- uint32_t res;
- /* Reset CRC */
- CRC->CR = ((uint8_t)0x01);
- for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
- 800f632: 428b cmp r3, r1
- CRC->DR = *ptr; // добавляем всю прошивку в CRC
- 800f634: 6010 str r0, [r2, #0]
- */
- uint32_t CRC_Calcucate(void) {
- uint32_t res;
- /* Reset CRC */
- CRC->CR = ((uint8_t)0x01);
- for(uint32_t* ptr=(uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS;ptr != (uint32_t*)USER_FLASH_CRC_ADDRESS;ptr++)
- 800f636: d1fa bne.n 800f62e <CRC_Calcucate+0xa>
- CRC->DR = *ptr; // добавляем всю прошивку в CRC
- res = CRC->DR;
- 800f638: 4b01 ldr r3, [pc, #4] ; (800f640 <CRC_Calcucate+0x1c>)
- 800f63a: 6818 ldr r0, [r3, #0]
- return res;
- }
- 800f63c: 4770 bx lr
- 800f63e: bf00 nop
- 800f640: 40023000 .word 0x40023000
- 800f644: 0807fffc .word 0x0807fffc
- 800f648: 08020000 .word 0x08020000
- 0800f64c <FLASH_If_Init>:
- * @param None
- * @retval None
- */
- void FLASH_If_Init(void)
- {
- FLASH_Unlock();
- 800f64c: f7fa bb40 b.w 8009cd0 <FLASH_Unlock>
- 0800f650 <FLASH_If_Erase>:
- FlashAddress = StartSector;
- /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
- be done by word */
-
- if (FlashAddress <= (uint32_t) USER_FLASH_LAST_PAGE_ADDRESS)
- 800f650: 4b14 ldr r3, [pc, #80] ; (800f6a4 <FLASH_If_Erase+0x54>)
- 800f652: 4298 cmp r0, r3
- * @param StartSector: start of user flash area
- * @retval 0: user flash area successfully erased
- * 1: error occurred
- */
- int8_t FLASH_If_Erase(uint32_t StartSector)
- {
- 800f654: b510 push {r4, lr}
- FlashAddress = StartSector;
- /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
- be done by word */
-
- if (FlashAddress <= (uint32_t) USER_FLASH_LAST_PAGE_ADDRESS)
- 800f656: d822 bhi.n 800f69e <FLASH_If_Erase+0x4e>
- {
- FLASH_Unlock();
- GPIOE->ODR ^= WDT_PIN;
- 800f658: 4c13 ldr r4, [pc, #76] ; (800f6a8 <FLASH_If_Erase+0x58>)
- /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
- be done by word */
-
- if (FlashAddress <= (uint32_t) USER_FLASH_LAST_PAGE_ADDRESS)
- {
- FLASH_Unlock();
- 800f65a: f7fa fb39 bl 8009cd0 <FLASH_Unlock>
- GPIOE->ODR ^= WDT_PIN;
- 800f65e: 6963 ldr r3, [r4, #20]
- 800f660: f083 0301 eor.w r3, r3, #1
- 800f664: 6163 str r3, [r4, #20]
- FLASH_EraseSector(FLASH_Sector_5, VoltageRange_3); /* 128 Kbyte */
- 800f666: 2102 movs r1, #2
- 800f668: 2028 movs r0, #40 ; 0x28
- 800f66a: f7fa fbab bl 8009dc4 <FLASH_EraseSector>
- GPIOE->ODR ^= WDT_PIN;
- 800f66e: 6963 ldr r3, [r4, #20]
- 800f670: f083 0301 eor.w r3, r3, #1
- 800f674: 6163 str r3, [r4, #20]
- FLASH_EraseSector(FLASH_Sector_6, VoltageRange_3); /* 128 Kbyte */
- 800f676: 2102 movs r1, #2
- 800f678: 2030 movs r0, #48 ; 0x30
- 800f67a: f7fa fba3 bl 8009dc4 <FLASH_EraseSector>
- GPIOE->ODR ^= WDT_PIN;
- 800f67e: 6963 ldr r3, [r4, #20]
- 800f680: f083 0301 eor.w r3, r3, #1
- 800f684: 6163 str r3, [r4, #20]
- FLASH_EraseSector(FLASH_Sector_7, VoltageRange_3); /* 128 Kbyte */
- 800f686: 2102 movs r1, #2
- 800f688: 2038 movs r0, #56 ; 0x38
- 800f68a: f7fa fb9b bl 8009dc4 <FLASH_EraseSector>
- GPIOE->ODR ^= WDT_PIN;
- 800f68e: 6963 ldr r3, [r4, #20]
- 800f690: f083 0301 eor.w r3, r3, #1
- 800f694: 6163 str r3, [r4, #20]
- FLASH_EraseSector(FLASH_Sector_8, VoltageRange_3); /* 128 Kbyte */
- GPIOE->ODR ^= WDT_PIN;
- FLASH_EraseSector(FLASH_Sector_9, VoltageRange_3); /* 128 Kbyte */
- GPIOE->ODR ^= WDT_PIN;
- }
- FLASH_Lock();
- 800f696: f7fa fb29 bl 8009cec <FLASH_Lock>
- else
- {
- return (1);
- }
- return (0);
- 800f69a: 2000 movs r0, #0
- 800f69c: bd10 pop {r4, pc}
- }
- FLASH_Lock();
- }
- else
- {
- return (1);
- 800f69e: 2001 movs r0, #1
- }
- return (0);
- }
- 800f6a0: bd10 pop {r4, pc}
- 800f6a2: bf00 nop
- 800f6a4: 08060000 .word 0x08060000
- 800f6a8: 40021000 .word 0x40021000
- 0800f6ac <FLASH_If_Write>:
- * @retval 0: Data successfully written to Flash memory
- * 1: Error occurred while writing data in Flash memory
- * 2: Written Data in flash memory is different from expected one
- */
- uint32_t FLASH_If_Write(__IO uint32_t* FlashAddress, uint32_t* Data ,uint16_t DataLength)
- {
- 800f6ac: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- 800f6b0: 4604 mov r4, r0
- 800f6b2: 4690 mov r8, r2
- * @param DataLength: length of data buffer (unit is 32-bit word)
- * @retval 0: Data successfully written to Flash memory
- * 1: Error occurred while writing data in Flash memory
- * 2: Written Data in flash memory is different from expected one
- */
- uint32_t FLASH_If_Write(__IO uint32_t* FlashAddress, uint32_t* Data ,uint16_t DataLength)
- 800f6b4: 1f0e subs r6, r1, #4
- printf("%i", delta);
-
- if ((delta < 1460) && (DataLength != 1))
- DataLength = delta / 4;
- */
- for (i = 0; (i < DataLength) && (*FlashAddress <= (USER_FLASH_END_ADDRESS)); i++)
- 800f6b6: 2500 movs r5, #0
- 800f6b8: 4f10 ldr r7, [pc, #64] ; (800f6fc <FLASH_If_Write+0x50>)
- 800f6ba: e00f b.n 800f6dc <FLASH_If_Write+0x30>
- {
- /* Device voltage range supposed to be [2.7V to 3.6V], the operation will
- be done by word */
- if (FLASH_ProgramWord(*FlashAddress, *(uint32_t*)(Data+i)) == FLASH_COMPLETE)
- 800f6bc: 6820 ldr r0, [r4, #0]
- 800f6be: 6871 ldr r1, [r6, #4]
- 800f6c0: f7fa fb62 bl 8009d88 <FLASH_ProgramWord>
- 800f6c4: 2808 cmp r0, #8
- 800f6c6: d10f bne.n 800f6e8 <FLASH_If_Write+0x3c>
- {
- /* Check the written value */
- if (*(uint32_t*)*FlashAddress != *(uint32_t*)(Data+i))
- 800f6c8: 6823 ldr r3, [r4, #0]
- 800f6ca: 681a ldr r2, [r3, #0]
- 800f6cc: f856 3f04 ldr.w r3, [r6, #4]!
- 800f6d0: 429a cmp r2, r3
- 800f6d2: d10c bne.n 800f6ee <FLASH_If_Write+0x42>
- {
- /* Flash content doesn't match SRAM content */
- return(2);
- }
- /* Increment FLASH destination address */
- *FlashAddress += 4;
- 800f6d4: 6823 ldr r3, [r4, #0]
- 800f6d6: 3304 adds r3, #4
- 800f6d8: 6023 str r3, [r4, #0]
- printf("%i", delta);
-
- if ((delta < 1460) && (DataLength != 1))
- DataLength = delta / 4;
- */
- for (i = 0; (i < DataLength) && (*FlashAddress <= (USER_FLASH_END_ADDRESS)); i++)
- 800f6da: 3501 adds r5, #1
- 800f6dc: 4545 cmp r5, r8
- 800f6de: d209 bcs.n 800f6f4 <FLASH_If_Write+0x48>
- 800f6e0: 6823 ldr r3, [r4, #0]
- 800f6e2: 42bb cmp r3, r7
- 800f6e4: d9ea bls.n 800f6bc <FLASH_If_Write+0x10>
- 800f6e6: e005 b.n 800f6f4 <FLASH_If_Write+0x48>
- *FlashAddress += 4;
- }
- else
- {
- /* Error occurred while writing data in Flash memory */
- return (1);
- 800f6e8: 2001 movs r0, #1
- 800f6ea: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- {
- /* Check the written value */
- if (*(uint32_t*)*FlashAddress != *(uint32_t*)(Data+i))
- {
- /* Flash content doesn't match SRAM content */
- return(2);
- 800f6ee: 2002 movs r0, #2
- 800f6f0: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- /* Error occurred while writing data in Flash memory */
- return (1);
- }
- }
- return (0);
- 800f6f4: 2000 movs r0, #0
- }
- 800f6f6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 800f6fa: bf00 nop
- 800f6fc: 0807ffff .word 0x0807ffff
- 0800f700 <IO_Init>:
- /**
- * @brief Инициализация дискретных входов-выходов
- * @retval
- */
- void IO_Init(void)
- {
- 800f700: b507 push {r0, r1, r2, lr}
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOE, ENABLE);
- 800f702: 2010 movs r0, #16
- 800f704: 2101 movs r1, #1
- 800f706: f7fa fc45 bl 8009f94 <RCC_AHB1PeriphClockCmd>
- /* ----------------------------- Inputs ---------------------------------- */
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
- 800f70a: 2300 movs r3, #0
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- /* BUTTON DEFAULT - " " */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
- 800f70c: a902 add r1, sp, #8
- RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOE, ENABLE);
- /* ----------------------------- Inputs ---------------------------------- */
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
- 800f70e: f88d 3004 strb.w r3, [sp, #4]
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- 800f712: f88d 3005 strb.w r3, [sp, #5]
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800f716: f88d 3006 strb.w r3, [sp, #6]
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- 800f71a: f88d 3007 strb.w r3, [sp, #7]
- /* BUTTON DEFAULT - " " */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
- 800f71e: f44f 6380 mov.w r3, #1024 ; 0x400
- 800f722: f841 3d08 str.w r3, [r1, #-8]!
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- 800f726: 4802 ldr r0, [pc, #8] ; (800f730 <IO_Init+0x30>)
- 800f728: 4669 mov r1, sp
- 800f72a: f7fa fb81 bl 8009e30 <GPIO_Init>
- }
- 800f72e: bd0e pop {r1, r2, r3, pc}
- 800f730: 40021000 .word 0x40021000
- 0800f734 <IO_BtnDefaultPressed>:
- /**
- * @brief Получить состояние кнопки DEFAULT
- */
- bool IO_BtnDefaultPressed(void)
- {
- 800f734: b508 push {r3, lr}
- return !GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_10); // BUTTON DEFAULT
- 800f736: f44f 6180 mov.w r1, #1024 ; 0x400
- 800f73a: 4804 ldr r0, [pc, #16] ; (800f74c <IO_BtnDefaultPressed+0x18>)
- 800f73c: f7fa fbbd bl 8009eba <GPIO_ReadInputDataBit>
- }
- 800f740: f1d0 0001 rsbs r0, r0, #1
- 800f744: bf38 it cc
- 800f746: 2000 movcc r0, #0
- 800f748: bd08 pop {r3, pc}
- 800f74a: bf00 nop
- 800f74c: 40021000 .word 0x40021000
- 0800f750 <LED_On>:
- /**
- * @brief
- */
- void LED_On(LED_NAMES_t led)
- {
- API_LED_On(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
- 800f750: 4a05 ldr r2, [pc, #20] ; (800f768 <LED_On+0x18>)
- 800f752: f852 3030 ldr.w r3, [r2, r0, lsl #3]
- 800f756: eb02 00c0 add.w r0, r2, r0, lsl #3
- * 1 - для включения LED нужно сбросить уровень
- * @retval
- */
- void API_LED_On(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
- {
- if (revers == 0)
- 800f75a: 7981 ldrb r1, [r0, #6]
- /**
- * @brief
- */
- void LED_On(LED_NAMES_t led)
- {
- API_LED_On(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
- 800f75c: 8882 ldrh r2, [r0, #4]
- * 1 - для включения LED нужно сбросить уровень
- * @retval
- */
- void API_LED_On(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
- {
- if (revers == 0)
- 800f75e: b909 cbnz r1, 800f764 <LED_On+0x14>
- port->BSRRL = pin;
- 800f760: 831a strh r2, [r3, #24]
- 800f762: 4770 bx lr
- else
- port->BSRRH = pin;
- 800f764: 835a strh r2, [r3, #26]
- 800f766: 4770 bx lr
- 800f768: 2000837c .word 0x2000837c
- 0800f76c <LED_Off>:
- /**
- * @brief
- */
- void LED_Off(LED_NAMES_t led)
- {
- API_LED_Off(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
- 800f76c: 4a05 ldr r2, [pc, #20] ; (800f784 <LED_Off+0x18>)
- 800f76e: f852 3030 ldr.w r3, [r2, r0, lsl #3]
- 800f772: eb02 00c0 add.w r0, r2, r0, lsl #3
- * 1 - для выключения LED нужно установить уровень
- * @retval
- */
- void API_LED_Off(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
- {
- if (revers == 0)
- 800f776: 7981 ldrb r1, [r0, #6]
- /**
- * @brief
- */
- void LED_Off(LED_NAMES_t led)
- {
- API_LED_Off(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
- 800f778: 8882 ldrh r2, [r0, #4]
- * 1 - для выключения LED нужно установить уровень
- * @retval
- */
- void API_LED_Off(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
- {
- if (revers == 0)
- 800f77a: b909 cbnz r1, 800f780 <LED_Off+0x14>
- port->BSRRH = pin;
- 800f77c: 835a strh r2, [r3, #26]
- 800f77e: 4770 bx lr
- else
- port->BSRRL = pin;
- 800f780: 831a strh r2, [r3, #24]
- 800f782: 4770 bx lr
- 800f784: 2000837c .word 0x2000837c
- 0800f788 <LED_Init>:
- /**
- * @brief
- * @retval
- */
- void LED_Init(void)
- {
- 800f788: b537 push {r0, r1, r2, r4, r5, lr}
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA, ENABLE);
- 800f78a: 2001 movs r0, #1
- 800f78c: 4601 mov r1, r0
- 800f78e: f7fa fc01 bl 8009f94 <RCC_AHB1PeriphClockCmd>
- LEDS[GREEN_STATUS].GPIOx = GPIOA;
- 800f792: 4b10 ldr r3, [pc, #64] ; (800f7d4 <LED_Init+0x4c>)
- 800f794: 4810 ldr r0, [pc, #64] ; (800f7d8 <LED_Init+0x50>)
- LEDS[GREEN_STATUS].GPIO_Pin = GPIO_Pin_3;
- 800f796: 2208 movs r2, #8
- LEDS[GREEN_STATUS].revers = 1;
- 800f798: 2401 movs r4, #1
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA, ENABLE);
- LEDS[GREEN_STATUS].GPIOx = GPIOA;
- LEDS[GREEN_STATUS].GPIO_Pin = GPIO_Pin_3;
- 800f79a: 809a strh r2, [r3, #4]
- LEDS[GREEN_STATUS].revers = 1;
- LEDS[RED_STATUS].GPIOx = GPIOA;
- LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
- 800f79c: 2210 movs r2, #16
- 800f79e: 819a strh r2, [r3, #12]
- {
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA, ENABLE);
- LEDS[GREEN_STATUS].GPIOx = GPIOA;
- 800f7a0: 6018 str r0, [r3, #0]
- LEDS[GREEN_STATUS].GPIO_Pin = GPIO_Pin_3;
- LEDS[GREEN_STATUS].revers = 1;
- 800f7a2: 719c strb r4, [r3, #6]
- LEDS[RED_STATUS].GPIOx = GPIOA;
- 800f7a4: 6098 str r0, [r3, #8]
- LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
- LEDS[RED_STATUS].revers = 1;
- 800f7a6: 739c strb r4, [r3, #14]
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
- 800f7a8: 2318 movs r3, #24
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800f7aa: 2500 movs r5, #0
- LEDS[RED_STATUS].GPIOx = GPIOA;
- LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
- LEDS[RED_STATUS].revers = 1;
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
- 800f7ac: 9300 str r3, [sp, #0]
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- 800f7ae: 4669 mov r1, sp
- LEDS[RED_STATUS].GPIO_Pin = GPIO_Pin_4;
- LEDS[RED_STATUS].revers = 1;
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_4;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 800f7b0: 2302 movs r3, #2
- 800f7b2: f88d 3005 strb.w r3, [sp, #5]
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- 800f7b6: f88d 4004 strb.w r4, [sp, #4]
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800f7ba: f88d 5006 strb.w r5, [sp, #6]
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- 800f7be: f88d 5007 strb.w r5, [sp, #7]
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- 800f7c2: f7fa fb35 bl 8009e30 <GPIO_Init>
- LED_Off(GREEN_STATUS);
- 800f7c6: 4628 mov r0, r5
- 800f7c8: f7ff ffd0 bl 800f76c <LED_Off>
- LED_Off(RED_STATUS);
- 800f7cc: 4620 mov r0, r4
- 800f7ce: f7ff ffcd bl 800f76c <LED_Off>
- }
- 800f7d2: bd3e pop {r1, r2, r3, r4, r5, pc}
- 800f7d4: 2000837c .word 0x2000837c
- 800f7d8: 40020000 .word 0x40020000
- 0800f7dc <LED_Toggle>:
- /**
- * @brief Изменить состояние LED
- */
- void LED_Toggle(LED_NAMES_t led)
- {
- LEDS[led].GPIOx->ODR ^= LEDS[led].GPIO_Pin;
- 800f7dc: 4a04 ldr r2, [pc, #16] ; (800f7f0 <LED_Toggle+0x14>)
- 800f7de: f852 3030 ldr.w r3, [r2, r0, lsl #3]
- 800f7e2: eb02 02c0 add.w r2, r2, r0, lsl #3
- 800f7e6: 6959 ldr r1, [r3, #20]
- 800f7e8: 8892 ldrh r2, [r2, #4]
- 800f7ea: 404a eors r2, r1
- 800f7ec: 615a str r2, [r3, #20]
- 800f7ee: 4770 bx lr
- 800f7f0: 2000837c .word 0x2000837c
- 0800f7f4 <LED_Blinky_Green>:
- /**
- * @brief Мигает зеленым, индикация режима IAPviaETH
- */
- void LED_Blinky_Green(void)
- {
- LED_Toggle(GREEN_STATUS);
- 800f7f4: 2000 movs r0, #0
- 800f7f6: f7ff bff1 b.w 800f7dc <LED_Toggle>
- 800f7fa: 0000 movs r0, r0
- 0800f7fc <SETTINGS_SetBootParamsDef>:
- /**
- * @brief Установить параметры обновления ПО по умолчанию
- */
- void SETTINGS_SetBootParamsDef(void)
- {
- sSettings.bootParams.loadMode = 1;
- 800f7fc: 4b02 ldr r3, [pc, #8] ; (800f808 <SETTINGS_SetBootParamsDef+0xc>)
- 800f7fe: 2201 movs r2, #1
- 800f800: 701a strb r2, [r3, #0]
- sSettings.bootParams.bootTry = 0;
- 800f802: 2200 movs r2, #0
- 800f804: 705a strb r2, [r3, #1]
- 800f806: 4770 bx lr
- 800f808: 2000838c .word 0x2000838c
- 0800f80c <SETTINGS_SetWebParamsDef>:
- /**
- * @brief Установить параметры сетевого подключения по умолчанию
- */
- void SETTINGS_SetWebParamsDef(void)
- {
- 800f80c: b510 push {r4, lr}
- strcpy(sSettings.sWebParams.ip, "192.168.1.2");
- 800f80e: 4c09 ldr r4, [pc, #36] ; (800f834 <SETTINGS_SetWebParamsDef+0x28>)
- 800f810: 4909 ldr r1, [pc, #36] ; (800f838 <SETTINGS_SetWebParamsDef+0x2c>)
- 800f812: 4620 mov r0, r4
- 800f814: f7fa f804 bl 8009820 <strcpy>
- strcpy(sSettings.sWebParams.gate, "192.168.1.1");
- 800f818: 4908 ldr r1, [pc, #32] ; (800f83c <SETTINGS_SetWebParamsDef+0x30>)
- 800f81a: f104 000f add.w r0, r4, #15
- 800f81e: f7f9 ffff bl 8009820 <strcpy>
- strcpy(sSettings.sWebParams.mask, "255.255.255.0");
- 800f822: f104 001e add.w r0, r4, #30
- 800f826: 4906 ldr r1, [pc, #24] ; (800f840 <SETTINGS_SetWebParamsDef+0x34>)
- 800f828: f7f9 fffa bl 8009820 <strcpy>
- sSettings.sWebParams.dhcpEnable = 1;
- 800f82c: 2201 movs r2, #1
- 800f82e: f884 202d strb.w r2, [r4, #45] ; 0x2d
- 800f832: bd10 pop {r4, pc}
- 800f834: 2000838e .word 0x2000838e
- 800f838: 08011890 .word 0x08011890
- 800f83c: 0801189c .word 0x0801189c
- 800f840: 080118a8 .word 0x080118a8
- 0800f844 <SETTINGS_SetTempWebParamsDef>:
- /**
- * @brief Установить временные параметры сетевого подключения по умолчанию
- */
- void SETTINGS_SetTempWebParamsDef(void)
- {
- 800f844: b510 push {r4, lr}
- strcpy(sSettings.sWebTempParams.ip, "192.168.1.2");
- 800f846: 4c09 ldr r4, [pc, #36] ; (800f86c <SETTINGS_SetTempWebParamsDef+0x28>)
- 800f848: 4909 ldr r1, [pc, #36] ; (800f870 <SETTINGS_SetTempWebParamsDef+0x2c>)
- 800f84a: 4620 mov r0, r4
- 800f84c: f7f9 ffe8 bl 8009820 <strcpy>
- strcpy(sSettings.sWebTempParams.gate, "192.168.1.1");
- 800f850: 4908 ldr r1, [pc, #32] ; (800f874 <SETTINGS_SetTempWebParamsDef+0x30>)
- 800f852: f104 000f add.w r0, r4, #15
- 800f856: f7f9 ffe3 bl 8009820 <strcpy>
- strcpy(sSettings.sWebTempParams.mask, "255.255.255.0");
- 800f85a: f104 001e add.w r0, r4, #30
- 800f85e: 4906 ldr r1, [pc, #24] ; (800f878 <SETTINGS_SetTempWebParamsDef+0x34>)
- 800f860: f7f9 ffde bl 8009820 <strcpy>
- sSettings.sWebTempParams.dhcpEnable = 1;
- 800f864: 2201 movs r2, #1
- 800f866: f884 202d strb.w r2, [r4, #45] ; 0x2d
- 800f86a: bd10 pop {r4, pc}
- 800f86c: 200083bc .word 0x200083bc
- 800f870: 08011890 .word 0x08011890
- 800f874: 0801189c .word 0x0801189c
- 800f878: 080118a8 .word 0x080118a8
- 0800f87c <SETTINGS_SetSnmpDef>:
- /**
- * @brief Установить параметры SNMP по умолчанию
- */
- void SETTINGS_SetSnmpDef(void)
- {
- 800f87c: b570 push {r4, r5, r6, lr}
- strcpy(sSettings.sSnmp.sysDescr, "");
- 800f87e: 4c19 ldr r4, [pc, #100] ; (800f8e4 <SETTINGS_SetSnmpDef+0x68>)
- 800f880: 4d19 ldr r5, [pc, #100] ; (800f8e8 <SETTINGS_SetSnmpDef+0x6c>)
- strcpy(sSettings.sSnmp.readCommunity, "public");
- 800f882: 4e1a ldr r6, [pc, #104] ; (800f8ec <SETTINGS_SetSnmpDef+0x70>)
- /**
- * @brief Установить параметры SNMP по умолчанию
- */
- void SETTINGS_SetSnmpDef(void)
- {
- strcpy(sSettings.sSnmp.sysDescr, "");
- 800f884: 4629 mov r1, r5
- 800f886: 4620 mov r0, r4
- 800f888: f7f9 ffca bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.readCommunity, "public");
- 800f88c: 4631 mov r1, r6
- 800f88e: f104 00a0 add.w r0, r4, #160 ; 0xa0
- 800f892: f7f9 ffc5 bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.writeCommunity, "public");
- 800f896: 4631 mov r1, r6
- 800f898: f104 00b4 add.w r0, r4, #180 ; 0xb4
- 800f89c: f7f9 ffc0 bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.sysContact, "");
- 800f8a0: 4629 mov r1, r5
- 800f8a2: f104 00c8 add.w r0, r4, #200 ; 0xc8
- 800f8a6: f7f9 ffbb bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.sysName, "BT-6701");
- 800f8aa: f104 00fa add.w r0, r4, #250 ; 0xfa
- 800f8ae: 4910 ldr r1, [pc, #64] ; (800f8f0 <SETTINGS_SetSnmpDef+0x74>)
- 800f8b0: f7f9 ffb6 bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.sysLocation, "");
- 800f8b4: 4629 mov r1, r5
- strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
- 800f8b6: 4d0f ldr r5, [pc, #60] ; (800f8f4 <SETTINGS_SetSnmpDef+0x78>)
- strcpy(sSettings.sSnmp.sysDescr, "");
- strcpy(sSettings.sSnmp.readCommunity, "public");
- strcpy(sSettings.sSnmp.writeCommunity, "public");
- strcpy(sSettings.sSnmp.sysContact, "");
- strcpy(sSettings.sSnmp.sysName, "BT-6701");
- strcpy(sSettings.sSnmp.sysLocation, "");
- 800f8b8: f504 7087 add.w r0, r4, #270 ; 0x10e
- 800f8bc: f7f9 ffb0 bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
- 800f8c0: 4629 mov r1, r5
- 800f8c2: f504 70be add.w r0, r4, #380 ; 0x17c
- 800f8c6: f7f9 ffab bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.managerIP2, "0.0.0.0");
- 800f8ca: 4629 mov r1, r5
- 800f8cc: f504 70c8 add.w r0, r4, #400 ; 0x190
- 800f8d0: f7f9 ffa6 bl 8009820 <strcpy>
- strcpy(sSettings.sSnmp.managerIP3, "0.0.0.0");
- 800f8d4: f504 70d2 add.w r0, r4, #420 ; 0x1a4
- 800f8d8: 4629 mov r1, r5
- }
- 800f8da: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr}
- strcpy(sSettings.sSnmp.sysContact, "");
- strcpy(sSettings.sSnmp.sysName, "BT-6701");
- strcpy(sSettings.sSnmp.sysLocation, "");
- strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
- strcpy(sSettings.sSnmp.managerIP2, "0.0.0.0");
- strcpy(sSettings.sSnmp.managerIP3, "0.0.0.0");
- 800f8de: f7f9 bf9f b.w 8009820 <strcpy>
- 800f8e2: bf00 nop
- 800f8e4: 200083ea .word 0x200083ea
- 800f8e8: 0801365a .word 0x0801365a
- 800f8ec: 080118b6 .word 0x080118b6
- 800f8f0: 080118bd .word 0x080118bd
- 800f8f4: 080118c5 .word 0x080118c5
- 0800f8f8 <SETTINGS_SetInfoDef>:
- /**
- * @brief Установить Информацию об устройстве по умолчанию
- */
- void SETTINGS_SetInfoDef(void)
- {
- 800f8f8: b510 push {r4, lr}
- strcpy(sSettings.sInfo.productionData, "09.10.2015");
- 800f8fa: 4c0b ldr r4, [pc, #44] ; (800f928 <SETTINGS_SetInfoDef+0x30>)
- 800f8fc: 490b ldr r1, [pc, #44] ; (800f92c <SETTINGS_SetInfoDef+0x34>)
- 800f8fe: 4620 mov r0, r4
- 800f900: f7f9 ff8e bl 8009820 <strcpy>
- strcpy(sSettings.sInfo.mac, DEVICE_MAC);
- 800f904: f104 0028 add.w r0, r4, #40 ; 0x28
- 800f908: 4909 ldr r1, [pc, #36] ; (800f930 <SETTINGS_SetInfoDef+0x38>)
- 800f90a: f7f9 ff89 bl 8009820 <strcpy>
- strcpy(sSettings.sInfo.serialNumber, "KN-03-00003");
- 800f90e: f104 003a add.w r0, r4, #58 ; 0x3a
- 800f912: 4908 ldr r1, [pc, #32] ; (800f934 <SETTINGS_SetInfoDef+0x3c>)
- 800f914: f7f9 ff84 bl 8009820 <strcpy>
- strcpy(sSettings.sInfo.comments, "");
- 800f918: 4907 ldr r1, [pc, #28] ; (800f938 <SETTINGS_SetInfoDef+0x40>)
- 800f91a: f104 004a add.w r0, r4, #74 ; 0x4a
- }
- 800f91e: e8bd 4010 ldmia.w sp!, {r4, lr}
- void SETTINGS_SetInfoDef(void)
- {
- strcpy(sSettings.sInfo.productionData, "09.10.2015");
- strcpy(sSettings.sInfo.mac, DEVICE_MAC);
- strcpy(sSettings.sInfo.serialNumber, "KN-03-00003");
- strcpy(sSettings.sInfo.comments, "");
- 800f922: f7f9 bf7d b.w 8009820 <strcpy>
- 800f926: bf00 nop
- 800f928: 200085a2 .word 0x200085a2
- 800f92c: 080118cd .word 0x080118cd
- 800f930: 080118d8 .word 0x080118d8
- 800f934: 080118ea .word 0x080118ea
- 800f938: 0801365a .word 0x0801365a
- 0800f93c <SETTINGS_ReadFromFlash>:
- */
- void SETTINGS_ReadFromFlash(uint8_t *data, uint32_t size)
- {
- uint32_t baseAddress = SETTINGS_SECTOR;
-
- for (uint32_t i = 0; i < size; i++)
- 800f93c: 2300 movs r3, #0
- 800f93e: e006 b.n 800f94e <SETTINGS_ReadFromFlash+0x12>
- *data++ = (*(uint32_t*)baseAddress++);;
- 800f940: f103 6200 add.w r2, r3, #134217728 ; 0x8000000
- 800f944: f502 4280 add.w r2, r2, #16384 ; 0x4000
- 800f948: 6812 ldr r2, [r2, #0]
- 800f94a: 54c2 strb r2, [r0, r3]
- */
- void SETTINGS_ReadFromFlash(uint8_t *data, uint32_t size)
- {
- uint32_t baseAddress = SETTINGS_SECTOR;
-
- for (uint32_t i = 0; i < size; i++)
- 800f94c: 3301 adds r3, #1
- 800f94e: 428b cmp r3, r1
- 800f950: d1f6 bne.n 800f940 <SETTINGS_ReadFromFlash+0x4>
- *data++ = (*(uint32_t*)baseAddress++);;
- }
- 800f952: 4770 bx lr
- 0800f954 <SETTINGS_EraseFlashSector>:
- */
- void SETTINGS_EraseFlashSector(void)
- {
- FLASH_Status status;
-
- if ((status = FLASH_EraseSector(FLASH_Sector_1, VoltageRange_3)) != FLASH_COMPLETE) {
- 800f954: 2008 movs r0, #8
- 800f956: 2102 movs r1, #2
- 800f958: f7fa ba34 b.w 8009dc4 <FLASH_EraseSector>
- 0800f95c <SETTINGS_GetCRC>:
- /**
- * @brief
- * @retval
- */
- uint32_t SETTINGS_GetCRC(void)
- {
- 800f95c: b508 push {r3, lr}
- CRC_ResetDR();
- 800f95e: f7fa f9a1 bl 8009ca4 <CRC_ResetDR>
- return CRC_CalcBlockCRC((uint32_t*)&sSettings, sizeof(sSettings)/4);
- 800f962: 4803 ldr r0, [pc, #12] ; (800f970 <SETTINGS_GetCRC+0x14>)
- 800f964: 21b9 movs r1, #185 ; 0xb9
- }
- 800f966: e8bd 4008 ldmia.w sp!, {r3, lr}
- * @retval
- */
- uint32_t SETTINGS_GetCRC(void)
- {
- CRC_ResetDR();
- return CRC_CalcBlockCRC((uint32_t*)&sSettings, sizeof(sSettings)/4);
- 800f96a: f7fa b9a1 b.w 8009cb0 <CRC_CalcBlockCRC>
- 800f96e: bf00 nop
- 800f970: 2000838c .word 0x2000838c
- 0800f974 <SETTINGS_WriteToFlash>:
- /**
- * @brief
- */
- void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
- {
- 800f974: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 800f978: 4606 mov r6, r0
- 800f97a: 468a mov sl, r1
- uint32_t baseAddress = SETTINGS_SECTOR;
- uint32_t checkCrc = 0;
- uint32_t crc = SETTINGS_GetCRC();
- 800f97c: f7ff ffee bl 800f95c <SETTINGS_GetCRC>
- /**
- * @brief
- */
- void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
- {
- uint32_t baseAddress = SETTINGS_SECTOR;
- 800f980: 4c17 ldr r4, [pc, #92] ; (800f9e0 <SETTINGS_WriteToFlash+0x6c>)
- uint32_t checkCrc = 0;
- uint32_t crc = SETTINGS_GetCRC();
- 800f982: 4680 mov r8, r0
- 800f984: 2703 movs r7, #3
- FLASH_Status status;
-
- for (uint8_t i = 0; i < 3; i++)
- {
- fAlarm = 0;
- FLASH_Unlock();
- 800f986: f7fa f9a3 bl 8009cd0 <FLASH_Unlock>
- 800f98a: 4635 mov r5, r6
-
- SETTINGS_EraseFlashSector();
- 800f98c: f7ff ffe2 bl 800f954 <SETTINGS_EraseFlashSector>
- }
- /**
- * @brief
- */
- void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
- 800f990: eb04 0b0a add.w fp, r4, sl
- fAlarm = 0;
- FLASH_Unlock();
-
- SETTINGS_EraseFlashSector();
- for (uint32_t i = 0; i < size; i++)
- 800f994: e00a b.n 800f9ac <SETTINGS_WriteToFlash+0x38>
- if ((status = FLASH_ProgramByte(baseAddress++, *data++)) != FLASH_COMPLETE) {
- 800f996: f815 1b01 ldrb.w r1, [r5], #1
- 800f99a: 4620 mov r0, r4
- 800f99c: f7fa f9d8 bl 8009d50 <FLASH_ProgramByte>
- 800f9a0: f104 0901 add.w r9, r4, #1
- 800f9a4: 2808 cmp r0, #8
- 800f9a6: 462e mov r6, r5
- 800f9a8: 464c mov r4, r9
- 800f9aa: d102 bne.n 800f9b2 <SETTINGS_WriteToFlash+0x3e>
- fAlarm = 0;
- FLASH_Unlock();
-
- SETTINGS_EraseFlashSector();
- for (uint32_t i = 0; i < size; i++)
- 800f9ac: 455c cmp r4, fp
- 800f9ae: 462e mov r6, r5
- 800f9b0: d1f1 bne.n 800f996 <SETTINGS_WriteToFlash+0x22>
- if ((status = FLASH_ProgramByte(baseAddress++, *data++)) != FLASH_COMPLETE) {
- DBG printf("FLASH_ProgramByte error: status = %d\r\n", status);
- break;
- }
- if ((status = FLASH_ProgramWord((uint32_t)CRC_ADDRESS, crc)) != FLASH_COMPLETE) {
- 800f9b2: 4641 mov r1, r8
- 800f9b4: 480b ldr r0, [pc, #44] ; (800f9e4 <SETTINGS_WriteToFlash+0x70>)
- 800f9b6: f7fa f9e7 bl 8009d88 <FLASH_ProgramWord>
- DBG printf("FLASH_ProgramWord error: status = %d\r\n", status);
- }
-
- FLASH_Lock();
- 800f9ba: f7fa f997 bl 8009cec <FLASH_Lock>
-
- /* Считываем что записали */
- SETTINGS_ReadFromFlash((uint8_t*)&sSettings, sizeof(sSettings));
- 800f9be: 480a ldr r0, [pc, #40] ; (800f9e8 <SETTINGS_WriteToFlash+0x74>)
- 800f9c0: f44f 7139 mov.w r1, #740 ; 0x2e4
- 800f9c4: f7ff ffba bl 800f93c <SETTINGS_ReadFromFlash>
-
- checkCrc = SETTINGS_GetCRC();
- 800f9c8: f7ff ffc8 bl 800f95c <SETTINGS_GetCRC>
-
- /* Проверяем CRC того что было записано */
- if (checkCrc == crc)
- 800f9cc: 4540 cmp r0, r8
- 800f9ce: d004 beq.n 800f9da <SETTINGS_WriteToFlash+0x66>
- 800f9d0: 3f01 subs r7, #1
- uint32_t checkCrc = 0;
- uint32_t crc = SETTINGS_GetCRC();
- bool fAlarm = 0;
- FLASH_Status status;
-
- for (uint8_t i = 0; i < 3; i++)
- 800f9d2: f017 07ff ands.w r7, r7, #255 ; 0xff
- 800f9d6: d1d6 bne.n 800f986 <SETTINGS_WriteToFlash+0x12>
- 800f9d8: e7fe b.n 800f9d8 <SETTINGS_WriteToFlash+0x64>
- 800f9da: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 800f9de: bf00 nop
- 800f9e0: 08004000 .word 0x08004000
- 800f9e4: 08007f9c .word 0x08007f9c
- 800f9e8: 2000838c .word 0x2000838c
- 0800f9ec <SETTINGS_GetCritSecCRC>:
- /**
- * @brief
- * @retval
- */
- uint32_t SETTINGS_GetCritSecCRC(void)
- {
- 800f9ec: b508 push {r3, lr}
- CRC_ResetDR();
- 800f9ee: f7fa f959 bl 8009ca4 <CRC_ResetDR>
- uint32_t critsec_len = (uint32_t)((uint8_t *)(&sSettings.CritSecCRC) - (uint8_t *)&sSettings) / 4;
- return CRC_CalcBlockCRC((uint32_t *)&sSettings, critsec_len);
- 800f9f2: 4803 ldr r0, [pc, #12] ; (800fa00 <SETTINGS_GetCritSecCRC+0x14>)
- 800f9f4: 21b8 movs r1, #184 ; 0xb8
- }
- 800f9f6: e8bd 4008 ldmia.w sp!, {r3, lr}
- */
- uint32_t SETTINGS_GetCritSecCRC(void)
- {
- CRC_ResetDR();
- uint32_t critsec_len = (uint32_t)((uint8_t *)(&sSettings.CritSecCRC) - (uint8_t *)&sSettings) / 4;
- return CRC_CalcBlockCRC((uint32_t *)&sSettings, critsec_len);
- 800f9fa: f7fa b959 b.w 8009cb0 <CRC_CalcBlockCRC>
- 800f9fe: bf00 nop
- 800fa00: 2000838c .word 0x2000838c
- 0800fa04 <SETTINGS_Save>:
-
- /**
- * @brief Запись структуры настроек во flesh
- */
- void SETTINGS_Save(void)
- {
- 800fa04: b508 push {r3, lr}
- /* Calc critical section CRC and store to the settings structure */
- sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
- 800fa06: f7ff fff1 bl 800f9ec <SETTINGS_GetCritSecCRC>
- 800fa0a: 4b05 ldr r3, [pc, #20] ; (800fa20 <SETTINGS_Save+0x1c>)
- SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
- 800fa0c: f44f 7139 mov.w r1, #740 ; 0x2e4
- * @brief Запись структуры настроек во flesh
- */
- void SETTINGS_Save(void)
- {
- /* Calc critical section CRC and store to the settings structure */
- sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
- 800fa10: f8c3 02e0 str.w r0, [r3, #736] ; 0x2e0
- SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
- 800fa14: 4618 mov r0, r3
- }
- 800fa16: e8bd 4008 ldmia.w sp!, {r3, lr}
- void SETTINGS_Save(void)
- {
- /* Calc critical section CRC and store to the settings structure */
- sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
- SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
- 800fa1a: f7ff bfab b.w 800f974 <SETTINGS_WriteToFlash>
- 800fa1e: bf00 nop
- 800fa20: 2000838c .word 0x2000838c
- 0800fa24 <SETTINGS_SetAllDefault>:
- /**
- * @brief Сброс всех настроек в значения по умолчанию
- */
- void SETTINGS_SetAllDefault(void)
- {
- 800fa24: b510 push {r4, lr}
- /**
- * @brief Установить флаги по умолчанию
- */
- void SETTINGS_SetFlagsDef(void)
- {
- sSettings.sFlags.netsettingsChanged = false;
- 800fa26: 4c09 ldr r4, [pc, #36] ; (800fa4c <SETTINGS_SetAllDefault+0x28>)
- /**
- * @brief Сброс всех настроек в значения по умолчанию
- */
- void SETTINGS_SetAllDefault(void)
- {
- SETTINGS_SetBootParamsDef();
- 800fa28: f7ff fee8 bl 800f7fc <SETTINGS_SetBootParamsDef>
- SETTINGS_SetWebParamsDef();
- 800fa2c: f7ff feee bl 800f80c <SETTINGS_SetWebParamsDef>
- SETTINGS_SetTempWebParamsDef();
- 800fa30: f7ff ff08 bl 800f844 <SETTINGS_SetTempWebParamsDef>
- SETTINGS_SetSnmpDef();
- 800fa34: f7ff ff22 bl 800f87c <SETTINGS_SetSnmpDef>
- SETTINGS_SetInfoDef();
- 800fa38: f7ff ff5e bl 800f8f8 <SETTINGS_SetInfoDef>
- /**
- * @brief Установить флаги по умолчанию
- */
- void SETTINGS_SetFlagsDef(void)
- {
- sSettings.sFlags.netsettingsChanged = false;
- 800fa3c: 2300 movs r3, #0
- 800fa3e: f884 32ce strb.w r3, [r4, #718] ; 0x2ce
- SETTINGS_SetTempWebParamsDef();
- SETTINGS_SetSnmpDef();
- SETTINGS_SetInfoDef();
- SETTINGS_SetFlagsDef();
- sSettings.CritSecCRC = SETTINGS_GetCritSecCRC();
- 800fa42: f7ff ffd3 bl 800f9ec <SETTINGS_GetCritSecCRC>
- 800fa46: f8c4 02e0 str.w r0, [r4, #736] ; 0x2e0
- 800fa4a: bd10 pop {r4, pc}
- 800fa4c: 2000838c .word 0x2000838c
- 0800fa50 <SETTINGS_Load>:
- /**
- * @brief Загрузка структуры настроек из flesh
- */
- void SETTINGS_Load(void)
- {
- 800fa50: b510 push {r4, lr}
- SETTINGS_ReadFromFlash((uint8_t*)&sSettings, sizeof(sSettings));
- 800fa52: 4c0b ldr r4, [pc, #44] ; (800fa80 <SETTINGS_Load+0x30>)
- 800fa54: f44f 7139 mov.w r1, #740 ; 0x2e4
- 800fa58: 4620 mov r0, r4
- 800fa5a: f7ff ff6f bl 800f93c <SETTINGS_ReadFromFlash>
- /* Проверка CRC критической секции сектора настроек.
- * Если CRC не совпадает, скорее всего настройки отсутствуют,
- * прошиваем значения по умолчанию */
- uint32_t crc = SETTINGS_GetCritSecCRC();
- 800fa5e: f7ff ffc5 bl 800f9ec <SETTINGS_GetCritSecCRC>
- if (sSettings.CritSecCRC != crc) {
- 800fa62: f8d4 32e0 ldr.w r3, [r4, #736] ; 0x2e0
- 800fa66: 4283 cmp r3, r0
- 800fa68: d008 beq.n 800fa7c <SETTINGS_Load+0x2c>
- printf("\n\rIAP: Bad critical settings sector CRC. Factory defaults restored.\n\r");
- 800fa6a: 4806 ldr r0, [pc, #24] ; (800fa84 <SETTINGS_Load+0x34>)
- 800fa6c: f001 fe02 bl 8011674 <tfp_printf>
- SETTINGS_SetAllDefault();
- 800fa70: f7ff ffd8 bl 800fa24 <SETTINGS_SetAllDefault>
- SETTINGS_Save();
- }
- }
- 800fa74: e8bd 4010 ldmia.w sp!, {r4, lr}
- uint32_t crc = SETTINGS_GetCritSecCRC();
- if (sSettings.CritSecCRC != crc) {
- printf("\n\rIAP: Bad critical settings sector CRC. Factory defaults restored.\n\r");
- SETTINGS_SetAllDefault();
- SETTINGS_Save();
- 800fa78: f7ff bfc4 b.w 800fa04 <SETTINGS_Save>
- 800fa7c: bd10 pop {r4, pc}
- 800fa7e: bf00 nop
- 800fa80: 2000838c .word 0x2000838c
- 800fa84: 080118f6 .word 0x080118f6
- 0800fa88 <SETTINGS_GetMac>:
- /**
- * @brief Преобразует mac адрес строкового формата в массив uint8_t
- * @param mac - буфер для вывода mac адреса
- */
- void SETTINGS_GetMac(uint8_t *mac)
- {
- 800fa88: b573 push {r0, r1, r4, r5, r6, lr}
- char dummy[2];
- char *macPtr = sSettings.sInfo.mac;
-
- for (uint8_t i = 0; i < 6; i++)
- {
- strncpy(dummy, macPtr+i*3, 2);
- 800fa8a: 4e0b ldr r6, [pc, #44] ; (800fab8 <SETTINGS_GetMac+0x30>)
- /**
- * @brief Преобразует mac адрес строкового формата в массив uint8_t
- * @param mac - буфер для вывода mac адреса
- */
- void SETTINGS_GetMac(uint8_t *mac)
- 800fa8c: 1e45 subs r5, r0, #1
- 800fa8e: 2400 movs r4, #0
- char dummy[2];
- char *macPtr = sSettings.sInfo.mac;
-
- for (uint8_t i = 0; i < 6; i++)
- {
- strncpy(dummy, macPtr+i*3, 2);
- 800fa90: f504 710e add.w r1, r4, #568 ; 0x238
- 800fa94: 1989 adds r1, r1, r6
- 800fa96: 3106 adds r1, #6
- 800fa98: 2202 movs r2, #2
- 800fa9a: a801 add r0, sp, #4
- 800fa9c: f7f9 ff74 bl 8009988 <strncpy>
- mac[i] = (uint8_t)strtol(dummy, NULL, 16);
- 800faa0: 2100 movs r1, #0
- 800faa2: 2210 movs r2, #16
- 800faa4: a801 add r0, sp, #4
- 800faa6: f7fa f843 bl 8009b30 <strtol>
- 800faaa: 3403 adds r4, #3
- void SETTINGS_GetMac(uint8_t *mac)
- {
- char dummy[2];
- char *macPtr = sSettings.sInfo.mac;
-
- for (uint8_t i = 0; i < 6; i++)
- 800faac: 2c12 cmp r4, #18
- {
- strncpy(dummy, macPtr+i*3, 2);
- mac[i] = (uint8_t)strtol(dummy, NULL, 16);
- 800faae: f805 0f01 strb.w r0, [r5, #1]!
- void SETTINGS_GetMac(uint8_t *mac)
- {
- char dummy[2];
- char *macPtr = sSettings.sInfo.mac;
-
- for (uint8_t i = 0; i < 6; i++)
- 800fab2: d1ed bne.n 800fa90 <SETTINGS_GetMac+0x8>
- {
- strncpy(dummy, macPtr+i*3, 2);
- mac[i] = (uint8_t)strtol(dummy, NULL, 16);
- }
- }
- 800fab4: bd7c pop {r2, r3, r4, r5, r6, pc}
- 800fab6: bf00 nop
- 800fab8: 2000838c .word 0x2000838c
- 0800fabc <timer_AddFunction>:
- * @brief Добавить функцию в список вызова.
- * Handler будет вызываться с заданной частотой
- * @retval нет
- */
- void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
- {
- 800fabc: b5f0 push {r4, r5, r6, r7, lr}
- int i;
- for(i = 0; i < TIMER_HANDLERS; i++)
- {
- /* Найдем пустой слот */
- if(!Handlers[i].Handler)
- 800fabe: 4e0c ldr r6, [pc, #48] ; (800faf0 <timer_AddFunction+0x34>)
- */
- void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
- {
- int i;
- for(i = 0; i < TIMER_HANDLERS; i++)
- 800fac0: 2300 movs r3, #0
- /**
- * @brief Добавить функцию в список вызова.
- * Handler будет вызываться с заданной частотой
- * @retval нет
- */
- void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
- 800fac2: 270c movs r7, #12
- 800fac4: fb07 f203 mul.w r2, r7, r3
- int i;
- for(i = 0; i < TIMER_HANDLERS; i++)
- {
- /* Найдем пустой слот */
- if(!Handlers[i].Handler)
- 800fac8: 4c09 ldr r4, [pc, #36] ; (800faf0 <timer_AddFunction+0x34>)
- 800faca: 5995 ldr r5, [r2, r6]
- 800facc: b95d cbnz r5, 800fae6 <timer_AddFunction+0x2a>
- {
- /* Обработчик, частота опроса */
- Handlers[i].Run = true;
- 800face: 18a3 adds r3, r4, r2
- 800fad0: 2601 movs r6, #1
- 800fad2: 721e strb r6, [r3, #8]
- Handlers[i].Fired = false;
- 800fad4: 725d strb r5, [r3, #9]
- Handlers[i].Handler = Handler;
- Handlers[i].Reload = Frequency;
- 800fad6: 80d8 strh r0, [r3, #6]
- Handlers[i].Countdown = Handlers[i].Reload;
- 800fad8: 8098 strh r0, [r3, #4]
- TimerCount++;
- 800fada: 4b06 ldr r3, [pc, #24] ; (800faf4 <timer_AddFunction+0x38>)
- if(!Handlers[i].Handler)
- {
- /* Обработчик, частота опроса */
- Handlers[i].Run = true;
- Handlers[i].Fired = false;
- Handlers[i].Handler = Handler;
- 800fadc: 50a1 str r1, [r4, r2]
- Handlers[i].Reload = Frequency;
- Handlers[i].Countdown = Handlers[i].Reload;
- TimerCount++;
- 800fade: 681a ldr r2, [r3, #0]
- 800fae0: 1992 adds r2, r2, r6
- 800fae2: 601a str r2, [r3, #0]
- return;
- 800fae4: bdf0 pop {r4, r5, r6, r7, pc}
- */
- void timer_AddFunction(uint16_t Frequency, TTimerHandler Handler)
- {
- int i;
- for(i = 0; i < TIMER_HANDLERS; i++)
- 800fae6: 3301 adds r3, #1
- 800fae8: 2b14 cmp r3, #20
- 800faea: d1eb bne.n 800fac4 <timer_AddFunction+0x8>
- 800faec: bdf0 pop {r4, r5, r6, r7, pc}
- 800faee: bf00 nop
- 800faf0: 20006c8c .word 0x20006c8c
- 800faf4: 20006d7c .word 0x20006d7c
- 0800faf8 <timer_Main>:
- * @brief Функция перебора и вызова актуальных задач.
- * Должна вызываться в главном цикле
- * @retval нет
- */
- void timer_Main(void)
- {
- 800faf8: b570 push {r4, r5, r6, lr}
- 800fafa: 4c06 ldr r4, [pc, #24] ; (800fb14 <timer_Main+0x1c>)
- for(i = 0; i < TIMER_HANDLERS; i++)
- {
- /* Если сработало - вызовем */
- if(Handlers[i].Fired)
- {
- Handlers[i].Fired = false;
- 800fafc: 2600 movs r6, #0
- /**
- * @brief Функция перебора и вызова актуальных задач.
- * Должна вызываться в главном цикле
- * @retval нет
- */
- void timer_Main(void)
- 800fafe: f104 05f0 add.w r5, r4, #240 ; 0xf0
- int i;
- for(i = 0; i < TIMER_HANDLERS; i++)
- {
- /* Если сработало - вызовем */
- if(Handlers[i].Fired)
- 800fb02: 7a63 ldrb r3, [r4, #9]
- 800fb04: b113 cbz r3, 800fb0c <timer_Main+0x14>
- {
- Handlers[i].Fired = false;
- 800fb06: 7266 strb r6, [r4, #9]
- Handlers[i].Handler();
- 800fb08: 6823 ldr r3, [r4, #0]
- 800fb0a: 4798 blx r3
- 800fb0c: 340c adds r4, #12
- */
- void timer_Main(void)
- {
- int i;
- for(i = 0; i < TIMER_HANDLERS; i++)
- 800fb0e: 42ac cmp r4, r5
- 800fb10: d1f7 bne.n 800fb02 <timer_Main+0xa>
- {
- Handlers[i].Fired = false;
- Handlers[i].Handler();
- }
- }
- }
- 800fb12: bd70 pop {r4, r5, r6, pc}
- 800fb14: 20006c8c .word 0x20006c8c
- 0800fb18 <Delay_ms>:
- * @brief Задержка в миллисекундах
- * @retval нет
- */
- void Delay_ms(uint32_t nTime)
- {
- TimingDelay = nTime;
- 800fb18: 4b02 ldr r3, [pc, #8] ; (800fb24 <Delay_ms+0xc>)
- 800fb1a: 6018 str r0, [r3, #0]
- while(TimingDelay);
- 800fb1c: 681a ldr r2, [r3, #0]
- 800fb1e: 2a00 cmp r2, #0
- 800fb20: d1fc bne.n 800fb1c <Delay_ms+0x4>
- }
- 800fb22: 4770 bx lr
- 800fb24: 20008670 .word 0x20008670
- 0800fb28 <TimingDelay_Decrement>:
- * @brief Вспомогательная функция для реализации Delay_ms
- * @retval нет
- */
- void TimingDelay_Decrement(void) {
- if (TimingDelay)
- 800fb28: 4b03 ldr r3, [pc, #12] ; (800fb38 <TimingDelay_Decrement+0x10>)
- 800fb2a: 681a ldr r2, [r3, #0]
- 800fb2c: b112 cbz r2, 800fb34 <TimingDelay_Decrement+0xc>
- TimingDelay--;
- 800fb2e: 681a ldr r2, [r3, #0]
- 800fb30: 3a01 subs r2, #1
- 800fb32: 601a str r2, [r3, #0]
- 800fb34: 4770 bx lr
- 800fb36: bf00 nop
- 800fb38: 20008670 .word 0x20008670
- 0800fb3c <SysTick_Handler>:
- /**
- * @brief Обработчик прерывания системного таймера
- * @retval нет
- */
- void SysTick_Handler(void)
- {
- 800fb3c: b508 push {r3, lr}
- int i;
-
- Time_Update();
- 800fb3e: f001 fa37 bl 8010fb0 <Time_Update>
-
- TimingDelay_Decrement();
- 800fb42: f7ff fff1 bl 800fb28 <TimingDelay_Decrement>
- 800fb46: 4b0b ldr r3, [pc, #44] ; (800fb74 <SysTick_Handler+0x38>)
- if(--Handlers[i].Countdown == 0)
- {
- Handlers[i].Countdown = Handlers[i].Reload;
- /* Запишем, что сработало */
- Handlers[i].Fired = true;
- 800fb48: 2001 movs r0, #1
- /**
- * @brief Обработчик прерывания системного таймера
- * @retval нет
- */
- void SysTick_Handler(void)
- 800fb4a: f103 01f0 add.w r1, r3, #240 ; 0xf0
-
- TimingDelay_Decrement();
-
- for(i = 0; i < TIMER_HANDLERS; i++)
- {
- if(Handlers[i].Run)
- 800fb4e: 781a ldrb r2, [r3, #0]
- 800fb50: b15a cbz r2, 800fb6a <SysTick_Handler+0x2e>
- {
- if(--Handlers[i].Countdown == 0)
- 800fb52: f833 2c04 ldrh.w r2, [r3, #-4]
- 800fb56: 3a01 subs r2, #1
- 800fb58: b292 uxth r2, r2
- 800fb5a: f823 2c04 strh.w r2, [r3, #-4]
- 800fb5e: b922 cbnz r2, 800fb6a <SysTick_Handler+0x2e>
- {
- Handlers[i].Countdown = Handlers[i].Reload;
- 800fb60: f833 2c02 ldrh.w r2, [r3, #-2]
- /* Запишем, что сработало */
- Handlers[i].Fired = true;
- 800fb64: 7058 strb r0, [r3, #1]
- {
- if(Handlers[i].Run)
- {
- if(--Handlers[i].Countdown == 0)
- {
- Handlers[i].Countdown = Handlers[i].Reload;
- 800fb66: f823 2c04 strh.w r2, [r3, #-4]
- 800fb6a: 330c adds r3, #12
-
- Time_Update();
-
- TimingDelay_Decrement();
-
- for(i = 0; i < TIMER_HANDLERS; i++)
- 800fb6c: 428b cmp r3, r1
- 800fb6e: d1ee bne.n 800fb4e <SysTick_Handler+0x12>
- /* Запишем, что сработало */
- Handlers[i].Fired = true;
- }
- }
- }
- }
- 800fb70: bd08 pop {r3, pc}
- 800fb72: bf00 nop
- 800fb74: 20006c94 .word 0x20006c94
- 0800fb78 <putc_>:
- #ifdef SWOTRACE
- ITM_SendChar(c);
- #endif
- }
- void putc_(void* p, char c) {
- 800fb78: 4770 bx lr
- 800fb7a: 0000 movs r0, r0
- 0800fb7c <InitUSART>:
- /**
- * @brief
- * @retval
- */
- void InitUSART( void) {
- 800fb7c: b570 push {r4, r5, r6, lr}
- GPIO_InitTypeDef GPIO_InitStructure;
- USART_InitTypeDef USART_InitStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
- 800fb7e: 2002 movs r0, #2
- /**
- * @brief
- * @retval
- */
- void InitUSART( void) {
- 800fb80: b086 sub sp, #24
- GPIO_InitTypeDef GPIO_InitStructure;
- USART_InitTypeDef USART_InitStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
- 800fb82: 2101 movs r1, #1
- 800fb84: f7fa fa06 bl 8009f94 <RCC_AHB1PeriphClockCmd>
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_Init(GPIOB, &GPIO_InitStructure);
- 800fb88: 4d26 ldr r5, [pc, #152] ; (800fc24 <InitUSART+0xa8>)
- GPIO_InitTypeDef GPIO_InitStructure;
- USART_InitTypeDef USART_InitStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
- 800fb8a: 2010 movs r0, #16
- 800fb8c: 2101 movs r1, #1
- 800fb8e: f7fa fa19 bl 8009fc4 <RCC_APB2PeriphClockCmd>
-
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
- 800fb92: 23c0 movs r3, #192 ; 0xc0
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800fb94: 2400 movs r4, #0
- USART_InitTypeDef USART_InitStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
- 800fb96: 9300 str r3, [sp, #0]
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- 800fb98: 2601 movs r6, #1
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 800fb9a: 2302 movs r3, #2
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_Init(GPIOB, &GPIO_InitStructure);
- 800fb9c: 4628 mov r0, r5
- 800fb9e: 4669 mov r1, sp
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 800fba0: f88d 3005 strb.w r3, [sp, #5]
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- 800fba4: f88d 3004 strb.w r3, [sp, #4]
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800fba8: f88d 4006 strb.w r4, [sp, #6]
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- 800fbac: f88d 6007 strb.w r6, [sp, #7]
- GPIO_Init(GPIOB, &GPIO_InitStructure);
- 800fbb0: f7fa f93e bl 8009e30 <GPIO_Init>
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
- 800fbb4: 4628 mov r0, r5
- 800fbb6: 2106 movs r1, #6
- 800fbb8: 2207 movs r2, #7
- 800fbba: f7fa f988 bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
- 800fbbe: 2107 movs r1, #7
- 800fbc0: 460a mov r2, r1
- 800fbc2: 4628 mov r0, r5
- 800fbc4: f7fa f983 bl 8009ece <GPIO_PinAFConfig>
- USART_InitStructure.USART_BaudRate = 115200;
- 800fbc8: f44f 33e1 mov.w r3, #115200 ; 0x1c200
- 800fbcc: 9302 str r3, [sp, #8]
- USART_InitStructure.USART_WordLength = USART_WordLength_9b;
- 800fbce: f44f 5380 mov.w r3, #4096 ; 0x1000
- USART_InitStructure.USART_StopBits = USART_StopBits_1;
- USART_InitStructure.USART_Parity = USART_Parity_Even;
- USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
- USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
- USART_Init(USER_USART, &USART_InitStructure);
- 800fbd2: f5a5 4574 sub.w r5, r5, #62464 ; 0xf400
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
- USART_InitStructure.USART_BaudRate = 115200;
- USART_InitStructure.USART_WordLength = USART_WordLength_9b;
- 800fbd6: f8ad 300c strh.w r3, [sp, #12]
- USART_InitStructure.USART_StopBits = USART_StopBits_1;
- USART_InitStructure.USART_Parity = USART_Parity_Even;
- 800fbda: f44f 6380 mov.w r3, #1024 ; 0x400
- 800fbde: f8ad 3010 strh.w r3, [sp, #16]
- USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
- USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
- USART_Init(USER_USART, &USART_InitStructure);
- 800fbe2: 4628 mov r0, r5
- USART_InitStructure.USART_BaudRate = 115200;
- USART_InitStructure.USART_WordLength = USART_WordLength_9b;
- USART_InitStructure.USART_StopBits = USART_StopBits_1;
- USART_InitStructure.USART_Parity = USART_Parity_Even;
- USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
- USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
- 800fbe4: 230c movs r3, #12
- USART_Init(USER_USART, &USART_InitStructure);
- 800fbe6: a902 add r1, sp, #8
- USART_InitStructure.USART_BaudRate = 115200;
- USART_InitStructure.USART_WordLength = USART_WordLength_9b;
- USART_InitStructure.USART_StopBits = USART_StopBits_1;
- USART_InitStructure.USART_Parity = USART_Parity_Even;
- USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
- USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
- 800fbe8: f8ad 3012 strh.w r3, [sp, #18]
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_USART1);
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_USART1);
- USART_InitStructure.USART_BaudRate = 115200;
- USART_InitStructure.USART_WordLength = USART_WordLength_9b;
- USART_InitStructure.USART_StopBits = USART_StopBits_1;
- 800fbec: f8ad 400e strh.w r4, [sp, #14]
- USART_InitStructure.USART_Parity = USART_Parity_Even;
- USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
- 800fbf0: f8ad 4014 strh.w r4, [sp, #20]
- USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
- USART_Init(USER_USART, &USART_InitStructure);
- 800fbf4: f7fa fa7a bl 800a0ec <USART_Init>
- USART_Cmd(USER_USART, ENABLE);
- 800fbf8: 4628 mov r0, r5
- 800fbfa: 4631 mov r1, r6
- 800fbfc: f7fa fad0 bl 800a1a0 <USART_Cmd>
-
-
- USART_ITConfig(USER_USART, USART_IT_RXNE, DISABLE);
- 800fc00: 4628 mov r0, r5
- 800fc02: 4622 mov r2, r4
- 800fc04: f240 5125 movw r1, #1317 ; 0x525
- 800fc08: f7fa fad6 bl 800a1b8 <USART_ITConfig>
- USART_ITConfig(USER_USART, USART_IT_TXE, DISABLE);
- 800fc0c: 4628 mov r0, r5
- 800fc0e: f240 7127 movw r1, #1831 ; 0x727
- 800fc12: 4622 mov r2, r4
- 800fc14: f7fa fad0 bl 800a1b8 <USART_ITConfig>
- init_printf(NULL, putc_);
- 800fc18: 4620 mov r0, r4
- 800fc1a: 4903 ldr r1, [pc, #12] ; (800fc28 <InitUSART+0xac>)
- 800fc1c: f001 fd20 bl 8011660 <init_printf>
- }
- 800fc20: b006 add sp, #24
- 800fc22: bd70 pop {r4, r5, r6, pc}
- 800fc24: 40020400 .word 0x40020400
- 800fc28: 0800fb79 .word 0x0800fb79
- 0800fc2c <WDG_Init>:
- /**
- * @brief
- * @retval
- */
- void WDG_Init(void)
- {
- 800fc2c: b530 push {r4, r5, lr}
-
- GPIO_InitTypeDef GPIO_InitStructure;
- NVIC_InitTypeDef NVIC_InitStructure;
- TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
- 800fc2e: 2004 movs r0, #4
- /**
- * @brief
- * @retval
- */
- void WDG_Init(void)
- {
- 800fc30: b087 sub sp, #28
-
- GPIO_InitTypeDef GPIO_InitStructure;
- NVIC_InitTypeDef NVIC_InitStructure;
- TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
- 800fc32: 2101 movs r1, #1
- 800fc34: f7fa f9ae bl 8009f94 <RCC_AHB1PeriphClockCmd>
- RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
- 800fc38: 2080 movs r0, #128 ; 0x80
- 800fc3a: 2101 movs r1, #1
- 800fc3c: f7fa f9b6 bl 8009fac <RCC_APB1PeriphClockCmd>
-
- GPIO_InitStructure.GPIO_Pin = WDT_PIN;
- 800fc40: 2401 movs r4, #1
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800fc42: 2500 movs r5, #0
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
- RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = WDT_PIN;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 800fc44: 2302 movs r3, #2
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- GPIO_Init(GPIOC, &GPIO_InitStructure);
- 800fc46: a901 add r1, sp, #4
- 800fc48: 481b ldr r0, [pc, #108] ; (800fcb8 <WDG_Init+0x8c>)
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
- RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = WDT_PIN;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 800fc4a: f88d 3009 strb.w r3, [sp, #9]
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 800fc4e: f88d 500a strb.w r5, [sp, #10]
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- 800fc52: f88d 500b strb.w r5, [sp, #11]
- TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
-
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
- RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM13, ENABLE);
-
- GPIO_InitStructure.GPIO_Pin = WDT_PIN;
- 800fc56: 9401 str r4, [sp, #4]
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- 800fc58: f88d 4008 strb.w r4, [sp, #8]
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- GPIO_Init(GPIOC, &GPIO_InitStructure);
- 800fc5c: f7fa f8e8 bl 8009e30 <GPIO_Init>
-
- NVIC_InitStructure.NVIC_IRQChannel = TIM8_UP_TIM13_IRQn;
- 800fc60: 232c movs r3, #44 ; 0x2c
- 800fc62: f88d 3000 strb.w r3, [sp]
- NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x6;
- NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0;
- NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
- NVIC_Init(&NVIC_InitStructure);
- 800fc66: 4668 mov r0, sp
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
- GPIO_Init(GPIOC, &GPIO_InitStructure);
-
- NVIC_InitStructure.NVIC_IRQChannel = TIM8_UP_TIM13_IRQn;
- NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x6;
- 800fc68: 2306 movs r3, #6
- 800fc6a: f88d 3001 strb.w r3, [sp, #1]
- NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0;
- 800fc6e: f88d 5002 strb.w r5, [sp, #2]
- NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
- 800fc72: f88d 4003 strb.w r4, [sp, #3]
- NVIC_Init(&NVIC_InitStructure);
- 800fc76: f7f9 ffe1 bl 8009c3c <NVIC_Init>
- __STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
- {
- if(IRQn < 0) {
- SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
- else {
- NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
- 800fc7a: 4b10 ldr r3, [pc, #64] ; (800fcbc <WDG_Init+0x90>)
- 800fc7c: 2220 movs r2, #32
- 800fc7e: f883 232c strb.w r2, [r3, #812] ; 0x32c
-
- /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
- TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
- /* Configure timer period to 100ms */
- TIM_TimeBaseStructure.TIM_Period = 1000;
- TIM_TimeBaseStructure.TIM_ClockDivision = 0;
- 800fc82: f8ad 5014 strh.w r5, [sp, #20]
- TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
- 800fc86: f8ad 500e strh.w r5, [sp, #14]
- TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
- 800fc8a: 4d0d ldr r5, [pc, #52] ; (800fcc0 <WDG_Init+0x94>)
- NVIC_Init(&NVIC_InitStructure);
- NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 2);
-
- /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
- TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
- 800fc8c: f241 736f movw r3, #5999 ; 0x176f
- 800fc90: f8ad 300c strh.w r3, [sp, #12]
- /* Configure timer period to 100ms */
- TIM_TimeBaseStructure.TIM_Period = 1000;
- TIM_TimeBaseStructure.TIM_ClockDivision = 0;
- TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
- TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
- 800fc94: 4628 mov r0, r5
- NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 2);
-
- /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
- TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
- /* Configure timer period to 100ms */
- TIM_TimeBaseStructure.TIM_Period = 1000;
- 800fc96: f44f 737a mov.w r3, #1000 ; 0x3e8
- TIM_TimeBaseStructure.TIM_ClockDivision = 0;
- TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
- TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
- 800fc9a: a903 add r1, sp, #12
- NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 2);
-
- /* APB1 Timer clock is 60Mhz, configure timer clock to 10khz (1 update event per 100 us) */
- TIM_TimeBaseStructure.TIM_Prescaler = 6000 - 1;
- /* Configure timer period to 100ms */
- TIM_TimeBaseStructure.TIM_Period = 1000;
- 800fc9c: 9304 str r3, [sp, #16]
- TIM_TimeBaseStructure.TIM_ClockDivision = 0;
- TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
- TIM_TimeBaseInit(TIM13, &TIM_TimeBaseStructure);
- 800fc9e: f7fa f9cf bl 800a040 <TIM_TimeBaseInit>
-
- TIM_Cmd(TIM13, ENABLE);
- 800fca2: 4628 mov r0, r5
- 800fca4: 4621 mov r1, r4
- 800fca6: f7fa fa09 bl 800a0bc <TIM_Cmd>
- TIM_ITConfig(TIM13, TIM_IT_Update, ENABLE);
- 800fcaa: 4628 mov r0, r5
- 800fcac: 4621 mov r1, r4
- 800fcae: 4622 mov r2, r4
- 800fcb0: f7fa fa10 bl 800a0d4 <TIM_ITConfig>
-
- }
- 800fcb4: b007 add sp, #28
- 800fcb6: bd30 pop {r4, r5, pc}
- 800fcb8: 40020800 .word 0x40020800
- 800fcbc: e000e100 .word 0xe000e100
- 800fcc0: 40001c00 .word 0x40001c00
- 0800fcc4 <TIM8_UP_TIM13_IRQHandler>:
- /**
- * @brief Дергаем пином (сброс внешнего WDT)
- * @retval
- */
- void TIM8_UP_TIM13_IRQHandler(void)
- {
- 800fcc4: b508 push {r3, lr}
- TIM_ClearITPendingBit(TIM13, TIM_IT_Update);
- 800fcc6: 4805 ldr r0, [pc, #20] ; (800fcdc <TIM8_UP_TIM13_IRQHandler+0x18>)
- 800fcc8: 2101 movs r1, #1
- 800fcca: f7fa fa0c bl 800a0e6 <TIM_ClearITPendingBit>
- GPIOC->ODR ^= WDT_PIN;
- 800fcce: 4b04 ldr r3, [pc, #16] ; (800fce0 <TIM8_UP_TIM13_IRQHandler+0x1c>)
- 800fcd0: 695a ldr r2, [r3, #20]
- 800fcd2: f082 0201 eor.w r2, r2, #1
- 800fcd6: 615a str r2, [r3, #20]
- 800fcd8: bd08 pop {r3, pc}
- 800fcda: bf00 nop
- 800fcdc: 40001c00 .word 0x40001c00
- 800fce0: 40020800 .word 0x40020800
- 0800fce4 <http_accept>:
- * @param pcb: pointer to a tcp_pcb structure
- * ¶m err: Lwip stack error code
- * @retval err
- */
- static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
- {
- 800fce4: b538 push {r3, r4, r5, lr}
- struct http_state *hs;
- /* Allocate memory for the structure that holds the state of the connection */
- hs = mem_malloc(sizeof(struct http_state));
- 800fce6: 2008 movs r0, #8
- * @param pcb: pointer to a tcp_pcb structure
- * ¶m err: Lwip stack error code
- * @retval err
- */
- static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
- {
- 800fce8: 460c mov r4, r1
- struct http_state *hs;
- /* Allocate memory for the structure that holds the state of the connection */
- hs = mem_malloc(sizeof(struct http_state));
- 800fcea: f7fb fa0f bl 800b10c <mem_malloc>
- if (hs == NULL)
- 800fcee: 4601 mov r1, r0
- 800fcf0: b1a0 cbz r0, 800fd1c <http_accept+0x38>
- {
- return ERR_MEM;
- }
- /* Initialize the structure. */
- hs->file = NULL;
- 800fcf2: 2500 movs r5, #0
- 800fcf4: 6005 str r5, [r0, #0]
- hs->left = 0;
- 800fcf6: 6045 str r5, [r0, #4]
- /* Tell TCP that this is the structure we wish to be passed for our
- callbacks. */
- tcp_arg(pcb, hs);
- 800fcf8: 4620 mov r0, r4
- 800fcfa: f7fb fea5 bl 800ba48 <tcp_arg>
- /* Tell TCP that we wish to be informed of incoming data by a call
- to the http_recv() function. */
- tcp_recv(pcb, http_recv);
- 800fcfe: 4620 mov r0, r4
- 800fd00: 4908 ldr r1, [pc, #32] ; (800fd24 <http_accept+0x40>)
- 800fd02: f7fb fea3 bl 800ba4c <tcp_recv>
- tcp_err(pcb, conn_err);
- 800fd06: 4620 mov r0, r4
- 800fd08: 4907 ldr r1, [pc, #28] ; (800fd28 <http_accept+0x44>)
- 800fd0a: f7fb fea3 bl 800ba54 <tcp_err>
- tcp_poll(pcb, http_poll, 10);
- 800fd0e: 4620 mov r0, r4
- 800fd10: 4906 ldr r1, [pc, #24] ; (800fd2c <http_accept+0x48>)
- 800fd12: 220a movs r2, #10
- 800fd14: f7fb fea3 bl 800ba5e <tcp_poll>
- return ERR_OK;
- 800fd18: 4628 mov r0, r5
- 800fd1a: e000 b.n 800fd1e <http_accept+0x3a>
- /* Allocate memory for the structure that holds the state of the connection */
- hs = mem_malloc(sizeof(struct http_state));
- if (hs == NULL)
- {
- return ERR_MEM;
- 800fd1c: 20ff movs r0, #255 ; 0xff
- tcp_err(pcb, conn_err);
- tcp_poll(pcb, http_poll, 10);
- return ERR_OK;
- }
- 800fd1e: b240 sxtb r0, r0
- 800fd20: bd38 pop {r3, r4, r5, pc}
- 800fd22: bf00 nop
- 800fd24: 0800fe79 .word 0x0800fe79
- 800fd28: 0800fd73 .word 0x0800fd73
- 800fd2c: 0800fd5b .word 0x0800fd5b
- 0800fd30 <send_data>:
- * @param pcb: pointer to a tcp_pcb struct
- * @param hs: pointer to a http_state struct
- * @retval none
- */
- static void send_data(struct tcp_pcb *pcb, struct http_state *hs)
- {
- 800fd30: b538 push {r3, r4, r5, lr}
- err_t err;
- u16_t len;
- /* We cannot send more data than space available in the send
- buffer */
- if (tcp_sndbuf(pcb) < hs->left)
- 800fd32: 684b ldr r3, [r1, #4]
- 800fd34: f8b0 5066 ldrh.w r5, [r0, #102] ; 0x66
- 800fd38: 429d cmp r5, r3
- {
- len = tcp_sndbuf(pcb);
- }
- else
- {
- len = hs->left;
- 800fd3a: bf28 it cs
- 800fd3c: b29d uxthcs r5, r3
- * @param pcb: pointer to a tcp_pcb struct
- * @param hs: pointer to a http_state struct
- * @retval none
- */
- static void send_data(struct tcp_pcb *pcb, struct http_state *hs)
- {
- 800fd3e: 460c mov r4, r1
- }
- else
- {
- len = hs->left;
- }
- err = tcp_write(pcb, hs->file, len, 0);
- 800fd40: 462a mov r2, r5
- 800fd42: 6809 ldr r1, [r1, #0]
- 800fd44: 2300 movs r3, #0
- 800fd46: f7fd fa41 bl 800d1cc <tcp_write>
- if (err == ERR_OK)
- 800fd4a: b928 cbnz r0, 800fd58 <send_data+0x28>
- {
- hs->file += len;
- 800fd4c: 6823 ldr r3, [r4, #0]
- 800fd4e: 195b adds r3, r3, r5
- 800fd50: 6023 str r3, [r4, #0]
- hs->left -= len;
- 800fd52: 6863 ldr r3, [r4, #4]
- 800fd54: 1b5d subs r5, r3, r5
- 800fd56: 6065 str r5, [r4, #4]
- 800fd58: bd38 pop {r3, r4, r5, pc}
- 0800fd5a <http_poll>:
- * @param arg: pointer to an argument to be passed to callback function
- * @param pcb: pointer on tcp_pcb structure
- * @retval err_t
- */
- static err_t http_poll(void *arg, struct tcp_pcb *pcb)
- {
- 800fd5a: b508 push {r3, lr}
- if (arg == NULL)
- 800fd5c: 4603 mov r3, r0
- {
- tcp_close(pcb);
- 800fd5e: 4608 mov r0, r1
- * @param pcb: pointer on tcp_pcb structure
- * @retval err_t
- */
- static err_t http_poll(void *arg, struct tcp_pcb *pcb)
- {
- if (arg == NULL)
- 800fd60: b913 cbnz r3, 800fd68 <http_poll+0xe>
- {
- tcp_close(pcb);
- 800fd62: f7fc f9cb bl 800c0fc <tcp_close>
- 800fd66: e002 b.n 800fd6e <http_poll+0x14>
- }
- else
- {
- send_data(pcb, (struct http_state *)arg);
- 800fd68: 4619 mov r1, r3
- 800fd6a: f7ff ffe1 bl 800fd30 <send_data>
- }
- return ERR_OK;
- }
- 800fd6e: 2000 movs r0, #0
- 800fd70: bd08 pop {r3, pc}
- 0800fd72 <conn_err>:
- static void conn_err(void *arg, err_t err)
- {
- struct http_state *hs;
- hs = arg;
- mem_free(hs);
- 800fd72: f7fb b905 b.w 800af80 <mem_free>
- 800fd76: 0000 movs r0, r0
- 0800fd78 <close_conn>:
- * @param pcb: pointer to a tcp_pcb struct
- * @param hs: pointer to a http_state struct
- * @retval
- */
- static void close_conn(struct tcp_pcb *pcb, struct http_state *hs)
- {
- 800fd78: b538 push {r3, r4, r5, lr}
- 800fd7a: 4604 mov r4, r0
- 800fd7c: 460d mov r5, r1
- tcp_arg(pcb, NULL);
- 800fd7e: 2100 movs r1, #0
- 800fd80: f7fb fe62 bl 800ba48 <tcp_arg>
- tcp_sent(pcb, NULL);
- 800fd84: 4620 mov r0, r4
- 800fd86: 2100 movs r1, #0
- 800fd88: f7fb fe62 bl 800ba50 <tcp_sent>
- tcp_recv(pcb, NULL);
- 800fd8c: 2100 movs r1, #0
- 800fd8e: 4620 mov r0, r4
- 800fd90: f7fb fe5c bl 800ba4c <tcp_recv>
- mem_free(hs);
- 800fd94: 4628 mov r0, r5
- 800fd96: f7fb f8f3 bl 800af80 <mem_free>
- tcp_close(pcb);
- 800fd9a: 4620 mov r0, r4
- 800fd9c: f7fc f9ae bl 800c0fc <tcp_close>
- reqCounter++;
- 800fda0: 4b02 ldr r3, [pc, #8] ; (800fdac <close_conn+0x34>)
- 800fda2: 781a ldrb r2, [r3, #0]
- 800fda4: 3201 adds r2, #1
- 800fda6: 701a strb r2, [r3, #0]
- 800fda8: bd38 pop {r3, r4, r5, pc}
- 800fdaa: bf00 nop
- 800fdac: 20006d82 .word 0x20006d82
- 0800fdb0 <fs_open>:
- * @param name : pointer to a file name
- * @param file : pointer to a fs_file structure
- * @retval 1 if success, 0 if fail
- */
- static int fs_open(char *name, struct fs_file *file)
- {
- 800fdb0: b570 push {r4, r5, r6, lr}
- struct fsdata_file_noconst *f;
- for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
- 800fdb2: 4c09 ldr r4, [pc, #36] ; (800fdd8 <fs_open+0x28>)
- * @param name : pointer to a file name
- * @param file : pointer to a fs_file structure
- * @retval 1 if success, 0 if fail
- */
- static int fs_open(char *name, struct fs_file *file)
- {
- 800fdb4: 4606 mov r6, r0
- 800fdb6: 460d mov r5, r1
- struct fsdata_file_noconst *f;
- for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
- {
- if (!strcmp(name, f->name))
- 800fdb8: 4630 mov r0, r6
- 800fdba: 6861 ldr r1, [r4, #4]
- 800fdbc: f7f9 fc42 bl 8009644 <strcmp>
- 800fdc0: b928 cbnz r0, 800fdce <fs_open+0x1e>
- {
- file->data = f->data;
- 800fdc2: 68a3 ldr r3, [r4, #8]
- 800fdc4: 602b str r3, [r5, #0]
- file->len = f->len;
- 800fdc6: 68e3 ldr r3, [r4, #12]
- return 1;
- 800fdc8: 2001 movs r0, #1
- for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
- {
- if (!strcmp(name, f->name))
- {
- file->data = f->data;
- file->len = f->len;
- 800fdca: 606b str r3, [r5, #4]
- return 1;
- 800fdcc: bd70 pop {r4, r5, r6, pc}
- */
- static int fs_open(char *name, struct fs_file *file)
- {
- struct fsdata_file_noconst *f;
- for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
- 800fdce: 6824 ldr r4, [r4, #0]
- 800fdd0: 2c00 cmp r4, #0
- 800fdd2: d1f1 bne.n 800fdb8 <fs_open+0x8>
- file->data = f->data;
- file->len = f->len;
- return 1;
- }
- }
- return 0;
- 800fdd4: 4620 mov r0, r4
- }
- 800fdd6: bd70 pop {r4, r5, r6, pc}
- 800fdd8: 08012258 .word 0x08012258
- 0800fddc <IAP_HTTP_writedata>:
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- {
- 800fddc: b5f8 push {r3, r4, r5, r6, r7, lr}
- uint32_t count, i=0, j=0;
- /* check if any left bytes from previous packet transfer*/
- /* if it is the case do a concat with new data to create a 32-bit word */
- if (LeftBytes)
- 800fdde: 4b21 ldr r3, [pc, #132] ; (800fe64 <IAP_HTTP_writedata+0x88>)
- 800fde0: 781a ldrb r2, [r3, #0]
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- {
- 800fde2: 4606 mov r6, r0
- 800fde4: 460c mov r4, r1
- uint32_t count, i=0, j=0;
- /* check if any left bytes from previous packet transfer*/
- /* if it is the case do a concat with new data to create a 32-bit word */
- if (LeftBytes)
- 800fde6: b94a cbnz r2, 800fdfc <IAP_HTTP_writedata+0x20>
- 800fde8: e01a b.n 800fe20 <IAP_HTTP_writedata+0x44>
- {
- while(LeftBytes<=3)
- {
- if(len>(j+1))
- 800fdea: 3501 adds r5, #1
- 800fdec: 42ac cmp r4, r5
- * @brief writes received data in flash
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- 800fdee: bf89 itett hi
- 800fdf0: 1977 addhi r7, r6, r5
- {
- LeftBytesTab[LeftBytes++] = *(ptr+j);
- }
- else
- {
- LeftBytesTab[LeftBytes++] = 0xFF;
- 800fdf2: 54c8 strbls r0, [r1, r3]
- {
- while(LeftBytes<=3)
- {
- if(len>(j+1))
- {
- LeftBytesTab[LeftBytes++] = *(ptr+j);
- 800fdf4: f817 7c01 ldrbhi.w r7, [r7, #-1]
- 800fdf8: 54cf strbhi r7, [r1, r3]
- 800fdfa: e002 b.n 800fe02 <IAP_HTTP_writedata+0x26>
- 800fdfc: 491a ldr r1, [pc, #104] ; (800fe68 <IAP_HTTP_writedata+0x8c>)
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- {
- uint32_t count, i=0, j=0;
- /* check if any left bytes from previous packet transfer*/
- /* if it is the case do a concat with new data to create a 32-bit word */
- if (LeftBytes)
- 800fdfe: 2500 movs r5, #0
- {
- LeftBytesTab[LeftBytes++] = *(ptr+j);
- }
- else
- {
- LeftBytesTab[LeftBytes++] = 0xFF;
- 800fe00: 20ff movs r0, #255 ; 0xff
- * @brief writes received data in flash
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- 800fe02: 1953 adds r3, r2, r5
- 800fe04: b2db uxtb r3, r3
- uint32_t count, i=0, j=0;
- /* check if any left bytes from previous packet transfer*/
- /* if it is the case do a concat with new data to create a 32-bit word */
- if (LeftBytes)
- {
- while(LeftBytes<=3)
- 800fe06: 2b03 cmp r3, #3
- 800fe08: d9ef bls.n 800fdea <IAP_HTTP_writedata+0xe>
- 800fe0a: 4f16 ldr r7, [pc, #88] ; (800fe64 <IAP_HTTP_writedata+0x88>)
- {
- LeftBytesTab[LeftBytes++] = 0xFF;
- }
- j++;
- }
- FLASH_If_Write(&FlashWriteAddress, (u32*)(LeftBytesTab),1);
- 800fe0c: 4817 ldr r0, [pc, #92] ; (800fe6c <IAP_HTTP_writedata+0x90>)
- 800fe0e: 4916 ldr r1, [pc, #88] ; (800fe68 <IAP_HTTP_writedata+0x8c>)
- 800fe10: 703b strb r3, [r7, #0]
- 800fe12: 2201 movs r2, #1
- 800fe14: f7ff fc4a bl 800f6ac <FLASH_If_Write>
-
- LeftBytes =0;
- 800fe18: 2300 movs r3, #0
- 800fe1a: 703b strb r3, [r7, #0]
-
- /* update data pointer */
- ptr = (char*)(ptr+j);
- 800fe1c: 1976 adds r6, r6, r5
- len = len -j;
- 800fe1e: 1b64 subs r4, r4, r5
- }
-
- /* write received bytes into flash */
- count = len/4;
- 800fe20: 08a2 lsrs r2, r4, #2
-
- /* check if remaining bytes < 4 */
- i= len%4;
- if (i>0)
- 800fe22: f014 0103 ands.w r1, r4, #3
- 800fe26: d015 beq.n 800fe54 <IAP_HTTP_writedata+0x78>
- {
- if (TotalReceived != size)
- 800fe28: 4b11 ldr r3, [pc, #68] ; (800fe70 <IAP_HTTP_writedata+0x94>)
- 800fe2a: 4812 ldr r0, [pc, #72] ; (800fe74 <IAP_HTTP_writedata+0x98>)
- 800fe2c: 681b ldr r3, [r3, #0]
- 800fe2e: 6800 ldr r0, [r0, #0]
- 800fe30: 4298 cmp r0, r3
- 800fe32: d00e beq.n 800fe52 <IAP_HTTP_writedata+0x76>
- {
- /* store bytes in LeftBytesTab */
- LeftBytes=0;
- 800fe34: 480b ldr r0, [pc, #44] ; (800fe64 <IAP_HTTP_writedata+0x88>)
- for(;i>0;i--)
- LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
- 800fe36: 4d0c ldr r5, [pc, #48] ; (800fe68 <IAP_HTTP_writedata+0x8c>)
- if (i>0)
- {
- if (TotalReceived != size)
- {
- /* store bytes in LeftBytesTab */
- LeftBytes=0;
- 800fe38: 2300 movs r3, #0
- * @brief writes received data in flash
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- 800fe3a: 1a64 subs r4, r4, r1
- if (i>0)
- {
- if (TotalReceived != size)
- {
- /* store bytes in LeftBytesTab */
- LeftBytes=0;
- 800fe3c: 7003 strb r3, [r0, #0]
- * @brief writes received data in flash
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- 800fe3e: 1934 adds r4, r6, r4
- if (TotalReceived != size)
- {
- /* store bytes in LeftBytesTab */
- LeftBytes=0;
- for(;i>0;i--)
- LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
- 800fe40: 5ce7 ldrb r7, [r4, r3]
- * @brief writes received data in flash
- * @param ptr: data pointer
- * @param len: data length
- * @retval none
- */
- void IAP_HTTP_writedata(char * ptr, uint32_t len)
- 800fe42: b2d8 uxtb r0, r3
- 800fe44: 3301 adds r3, #1
- {
- if (TotalReceived != size)
- {
- /* store bytes in LeftBytesTab */
- LeftBytes=0;
- for(;i>0;i--)
- 800fe46: 428b cmp r3, r1
- LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
- 800fe48: 542f strb r7, [r5, r0]
- {
- if (TotalReceived != size)
- {
- /* store bytes in LeftBytesTab */
- LeftBytes=0;
- for(;i>0;i--)
- 800fe4a: d1f9 bne.n 800fe40 <IAP_HTTP_writedata+0x64>
- 800fe4c: 4905 ldr r1, [pc, #20] ; (800fe64 <IAP_HTTP_writedata+0x88>)
- 800fe4e: 700b strb r3, [r1, #0]
- 800fe50: e000 b.n 800fe54 <IAP_HTTP_writedata+0x78>
- LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
- }
- else count++;
- 800fe52: 3201 adds r2, #1
- }
- FLASH_If_Write(&FlashWriteAddress, (u32*)ptr ,count);
- 800fe54: 4805 ldr r0, [pc, #20] ; (800fe6c <IAP_HTTP_writedata+0x90>)
- 800fe56: 4631 mov r1, r6
- 800fe58: b292 uxth r2, r2
- }
- 800fe5a: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr}
- for(;i>0;i--)
- LeftBytesTab[LeftBytes++] = *(char*)(ptr+ len-i);
- }
- else count++;
- }
- FLASH_If_Write(&FlashWriteAddress, (u32*)ptr ,count);
- 800fe5e: f7ff bc25 b.w 800f6ac <FLASH_If_Write>
- 800fe62: bf00 nop
- 800fe64: 20006d94 .word 0x20006d94
- 800fe68: 20006d83 .word 0x20006d83
- 800fe6c: 20006d90 .word 0x20006d90
- 800fe70: 20006da4 .word 0x20006da4
- 800fe74: 20006da0 .word 0x20006da0
- 0800fe78 <http_recv>:
- * @retval err
- */
- /* goback.cgi - возврат в основную прошивку */
- /* upload.cgi - загрузка новой прошивки */
- static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
- {
- 800fe78: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 800fe7c: b087 sub sp, #28
- 800fe7e: 4617 mov r7, r2
- int32_t i, len=0;
- uint32_t DataOffset, FilenameOffset;
- char *data, *ptr, filename[13];
- struct fs_file file = {0, 0};
- 800fe80: 2200 movs r2, #0
- * @retval err
- */
- /* goback.cgi - возврат в основную прошивку */
- /* upload.cgi - загрузка новой прошивки */
- static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
- {
- 800fe82: 4604 mov r4, r0
- 800fe84: 460d mov r5, r1
- int32_t i, len=0;
- uint32_t DataOffset, FilenameOffset;
- char *data, *ptr, filename[13];
- struct fs_file file = {0, 0};
- 800fe86: 9200 str r2, [sp, #0]
- 800fe88: 9201 str r2, [sp, #4]
- hs = arg;
-
-
- if (err == ERR_OK && p != NULL)
- 800fe8a: 2b00 cmp r3, #0
- 800fe8c: f040 820a bne.w 80102a4 <http_recv+0x42c>
- {
- /* Inform TCP that we have taken the data */
- tcp_recved(pcb, p->tot_len);
- 800fe90: 4608 mov r0, r1
- hs = arg;
-
-
- if (err == ERR_OK && p != NULL)
- 800fe92: 2f00 cmp r7, #0
- 800fe94: f000 8203 beq.w 801029e <http_recv+0x426>
- {
- /* Inform TCP that we have taken the data */
- tcp_recved(pcb, p->tot_len);
- 800fe98: 8939 ldrh r1, [r7, #8]
- 800fe9a: f7fb fda1 bl 800b9e0 <tcp_recved>
-
- if (hs->file == NULL)
- 800fe9e: 6823 ldr r3, [r4, #0]
- 800fea0: 2b00 cmp r3, #0
- 800fea2: f040 81ec bne.w 801027e <http_recv+0x406>
- {
- data = p->payload;
- 800fea6: 687e ldr r6, [r7, #4]
- len = p->tot_len;
- 800fea8: f8b7 8008 ldrh.w r8, [r7, #8]
-
- printLen = p->tot_len;
- 800feac: 4b9f ldr r3, [pc, #636] ; (801012c <http_recv+0x2b4>)
- memcpy(printBuf, p->payload , printLen);
- 800feae: 48a0 ldr r0, [pc, #640] ; (8010130 <http_recv+0x2b8>)
- if (hs->file == NULL)
- {
- data = p->payload;
- len = p->tot_len;
-
- printLen = p->tot_len;
- 800feb0: f8a3 8000 strh.w r8, [r3]
- memcpy(printBuf, p->payload , printLen);
- 800feb4: 4631 mov r1, r6
- 800feb6: 4642 mov r2, r8
- 800feb8: f7f9 faa4 bl 8009404 <memcpy>
- //printf(printBuf);
-
- /* process HTTP GET requests */
- if (strncmp(data, "GET /", 5) == 0)
- 800febc: 4630 mov r0, r6
- 800febe: 499d ldr r1, [pc, #628] ; (8010134 <http_recv+0x2bc>)
- 800fec0: 2205 movs r2, #5
- 800fec2: f7f9 fd0b bl 80098dc <strncmp>
- 800fec6: 4681 mov r9, r0
- pbuf_free(p);
- send_data(pcb, hs);
- resetpage = 1;
- tcp_sent(pcb, http_sent);
- }*/
- if (strncmp(data, "GET /upload.css", 15) == 0)
- 800fec8: 4630 mov r0, r6
- printLen = p->tot_len;
- memcpy(printBuf, p->payload , printLen);
- //printf(printBuf);
-
- /* process HTTP GET requests */
- if (strncmp(data, "GET /", 5) == 0)
- 800feca: f1b9 0f00 cmp.w r9, #0
- 800fece: d14e bne.n 800ff6e <http_recv+0xf6>
- pbuf_free(p);
- send_data(pcb, hs);
- resetpage = 1;
- tcp_sent(pcb, http_sent);
- }*/
- if (strncmp(data, "GET /upload.css", 15) == 0)
- 800fed0: 4999 ldr r1, [pc, #612] ; (8010138 <http_recv+0x2c0>)
- 800fed2: 220f movs r2, #15
- 800fed4: f7f9 fd02 bl 80098dc <strncmp>
- 800fed8: b908 cbnz r0, 800fede <http_recv+0x66>
- {
- fs_open("/upload.css", &file);
- 800feda: 4898 ldr r0, [pc, #608] ; (801013c <http_recv+0x2c4>)
- 800fedc: e006 b.n 800feec <http_recv+0x74>
- hs->left = file.len;
- pbuf_free(p);
- send_data(pcb, hs);
- tcp_sent(pcb, http_sent);
- }
- else if (strncmp(data, "GET /upload.js", 14) == 0)
- 800fede: 4630 mov r0, r6
- 800fee0: 4997 ldr r1, [pc, #604] ; (8010140 <http_recv+0x2c8>)
- 800fee2: 220e movs r2, #14
- 800fee4: f7f9 fcfa bl 80098dc <strncmp>
- 800fee8: b998 cbnz r0, 800ff12 <http_recv+0x9a>
- {
- fs_open("/upload.js", &file);
- 800feea: 4896 ldr r0, [pc, #600] ; (8010144 <http_recv+0x2cc>)
- 800feec: 4669 mov r1, sp
- 800feee: f7ff ff5f bl 800fdb0 <fs_open>
- hs->file = file.data;
- 800fef2: 9b00 ldr r3, [sp, #0]
- 800fef4: 6023 str r3, [r4, #0]
- hs->left = file.len;
- 800fef6: 9b01 ldr r3, [sp, #4]
- pbuf_free(p);
- 800fef8: 4638 mov r0, r7
- }
- else if (strncmp(data, "GET /upload.js", 14) == 0)
- {
- fs_open("/upload.js", &file);
- hs->file = file.data;
- hs->left = file.len;
- 800fefa: 6063 str r3, [r4, #4]
- pbuf_free(p);
- 800fefc: f7fb fae2 bl 800b4c4 <pbuf_free>
- send_data(pcb, hs);
- 800ff00: 4628 mov r0, r5
- 800ff02: 4621 mov r1, r4
- 800ff04: f7ff ff14 bl 800fd30 <send_data>
- tcp_sent(pcb, http_sent);
- 800ff08: 4628 mov r0, r5
- 800ff0a: 498f ldr r1, [pc, #572] ; (8010148 <http_recv+0x2d0>)
- 800ff0c: f7fb fda0 bl 800ba50 <tcp_sent>
- 800ff10: e1c8 b.n 80102a4 <http_recv+0x42c>
- }
- /* Возврат в основную прошивку. Сбрасываем флаг loadmode,
- сохраняем настройки и перезагружаемся */
- else if (strncmp(data, "GET /goback.cgi", 15)==0)
- 800ff12: 498e ldr r1, [pc, #568] ; (801014c <http_recv+0x2d4>)
- 800ff14: 4630 mov r0, r6
- 800ff16: 220f movs r2, #15
- 800ff18: f7f9 fce0 bl 80098dc <strncmp>
- 800ff1c: 4601 mov r1, r0
- 800ff1e: b990 cbnz r0, 800ff46 <http_recv+0xce>
- {
- RTC_WriteBackupRegister(RTC_BKP_DR1, 0);
- 800ff20: 2001 movs r0, #1
- 800ff22: f7fa f867 bl 8009ff4 <RTC_WriteBackupRegister>
- /* sSettings.bootParams.loadMode = 0;
- SETTINGS_Save();*/
- Delay_ms(1010);
- 800ff26: f240 30f2 movw r0, #1010 ; 0x3f2
- 800ff2a: f7ff fdf5 bl 800fb18 <Delay_ms>
- This function acts as a special kind of Data Memory Barrier.
- It completes when all explicit memory accesses before this instruction complete.
- */
- __attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void)
- {
- __ASM volatile ("dsb");
- 800ff2e: f3bf 8f4f dsb sy
- //static inline void NVIC_SystemReset(void)
- {
- __DSB(); /* Ensure all outstanding memory accesses included
- buffered write are completed before reset */
- SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
- (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
- 800ff32: 4a87 ldr r2, [pc, #540] ; (8010150 <http_recv+0x2d8>)
- 800ff34: 4b87 ldr r3, [pc, #540] ; (8010154 <http_recv+0x2dc>)
- 800ff36: 68d1 ldr r1, [r2, #12]
- 800ff38: f401 61e0 and.w r1, r1, #1792 ; 0x700
- 800ff3c: 430b orrs r3, r1
- __STATIC_INLINE void NVIC_SystemReset(void)
- //static inline void NVIC_SystemReset(void)
- {
- __DSB(); /* Ensure all outstanding memory accesses included
- buffered write are completed before reset */
- SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
- 800ff3e: 60d3 str r3, [r2, #12]
- 800ff40: f3bf 8f4f dsb sy
- 800ff44: e7fe b.n 800ff44 <http_recv+0xcc>
- NVIC_SystemReset();
- }
- else if (strncmp(data, "GET /favicon.ico", 16) == 0)
- 800ff46: 4630 mov r0, r6
- 800ff48: 4983 ldr r1, [pc, #524] ; (8010158 <http_recv+0x2e0>)
- 800ff4a: 2210 movs r2, #16
- 800ff4c: f7f9 fcc6 bl 80098dc <strncmp>
- 800ff50: b940 cbnz r0, 800ff64 <http_recv+0xec>
- {
- fs_open("/favicon.ico", &file);
- 800ff52: 4882 ldr r0, [pc, #520] ; (801015c <http_recv+0x2e4>)
- 800ff54: 4669 mov r1, sp
- 800ff56: f7ff ff2b bl 800fdb0 <fs_open>
- hs->file = file.data;
- 800ff5a: 9b00 ldr r3, [sp, #0]
- 800ff5c: 6023 str r3, [r4, #0]
- hs->left = file.len;
- 800ff5e: 9b01 ldr r3, [sp, #4]
- 800ff60: 6063 str r3, [r4, #4]
- 800ff62: e7cd b.n 800ff00 <http_recv+0x88>
- tcp_sent(pcb, http_sent);
- }
- else
- {
- /*send the login page (which is the index page) */
- htmlpage = LoginPage;
- 800ff64: 4b7e ldr r3, [pc, #504] ; (8010160 <http_recv+0x2e8>)
- fs_open("/index.html", &file);
- 800ff66: 487f ldr r0, [pc, #508] ; (8010164 <http_recv+0x2ec>)
- tcp_sent(pcb, http_sent);
- }
- else
- {
- /*send the login page (which is the index page) */
- htmlpage = LoginPage;
- 800ff68: f883 9000 strb.w r9, [r3]
- 800ff6c: e7be b.n 800feec <http_recv+0x74>
- tcp_sent(pcb, http_sent);
- }
- }
- #if 1
- /* process POST request for file upload and incoming data packets after POST request*/
- else if ((strncmp(data, "POST /upload.cgi",16) == 0) || (DataFlag >= 1))
- 800ff6e: 497e ldr r1, [pc, #504] ; (8010168 <http_recv+0x2f0>)
- 800ff70: 2210 movs r2, #16
- 800ff72: f7f9 fcb3 bl 80098dc <strncmp>
- 800ff76: b120 cbz r0, 800ff82 <http_recv+0x10a>
- 800ff78: 4b7c ldr r3, [pc, #496] ; (801016c <http_recv+0x2f4>)
- 800ff7a: 681b ldr r3, [r3, #0]
- 800ff7c: 2b00 cmp r3, #0
- 800ff7e: f000 817e beq.w 801027e <http_recv+0x406>
- {
- if (fEraseFlash) {
- 800ff82: f8df 9210 ldr.w r9, [pc, #528] ; 8010194 <http_recv+0x31c>
- 800ff86: f899 3000 ldrb.w r3, [r9]
- 800ff8a: b12b cbz r3, 800ff98 <http_recv+0x120>
- FLASH_If_Erase(USER_FLASH_FIRST_PAGE_ADDRESS);
- 800ff8c: 4878 ldr r0, [pc, #480] ; (8010170 <http_recv+0x2f8>)
- 800ff8e: f7ff fb5f bl 800f650 <FLASH_If_Erase>
- fEraseFlash = false;
- 800ff92: 2300 movs r3, #0
- 800ff94: f889 3000 strb.w r3, [r9]
- }
- DataOffset = 0;
-
- /* POST Packet received */
- if (DataFlag == 0)
- 800ff98: 4b74 ldr r3, [pc, #464] ; (801016c <http_recv+0x2f4>)
- 800ff9a: 681b ldr r3, [r3, #0]
- 800ff9c: 2b00 cmp r3, #0
- 800ff9e: d15e bne.n 801005e <http_recv+0x1e6>
- {
- BrowserFlag = 0;
- 800ffa0: 4a74 ldr r2, [pc, #464] ; (8010174 <http_recv+0x2fc>)
- TotalReceived = 0;
-
- /* parse packet for Content-length field */
- size = Parse_Content_Length(data, p->tot_len);
- 800ffa2: f8b7 a008 ldrh.w sl, [r7, #8]
- DataOffset = 0;
-
- /* POST Packet received */
- if (DataFlag == 0)
- {
- BrowserFlag = 0;
- 800ffa6: 6013 str r3, [r2, #0]
- TotalReceived = 0;
- 800ffa8: 4a73 ldr r2, [pc, #460] ; (8010178 <http_recv+0x300>)
- 800ffaa: 6013 str r3, [r2, #0]
- {
- uint32_t i=0,size=0, S=1;
- int32_t j=0;
- char sizestring[6], *ptr;
-
- ContentLengthOffset =0;
- 800ffac: 4a73 ldr r2, [pc, #460] ; (801017c <http_recv+0x304>)
- /* find Content-Length data in packet buffer */
- for (i=0;i<len;i++)
- 800ffae: 4699 mov r9, r3
- {
- uint32_t i=0,size=0, S=1;
- int32_t j=0;
- char sizestring[6], *ptr;
-
- ContentLengthOffset =0;
- 800ffb0: 6013 str r3, [r2, #0]
- 800ffb2: e00d b.n 800ffd0 <http_recv+0x158>
- /* find Content-Length data in packet buffer */
- for (i=0;i<len;i++)
- {
- if (strncmp ((char*)(data+i), Content_Length, 16)==0)
- 800ffb4: eb06 0009 add.w r0, r6, r9
- 800ffb8: 4971 ldr r1, [pc, #452] ; (8010180 <http_recv+0x308>)
- 800ffba: 2210 movs r2, #16
- 800ffbc: f7f9 fc8e bl 80098dc <strncmp>
- 800ffc0: b920 cbnz r0, 800ffcc <http_recv+0x154>
- {
- ContentLengthOffset = i+16;
- 800ffc2: 4b6e ldr r3, [pc, #440] ; (801017c <http_recv+0x304>)
- 800ffc4: f109 0210 add.w r2, r9, #16
- 800ffc8: 601a str r2, [r3, #0]
- 800ffca: e003 b.n 800ffd4 <http_recv+0x15c>
- char sizestring[6], *ptr;
-
- ContentLengthOffset =0;
- /* find Content-Length data in packet buffer */
- for (i=0;i<len;i++)
- 800ffcc: f109 0901 add.w r9, r9, #1
- 800ffd0: 45d1 cmp r9, sl
- 800ffd2: d3ef bcc.n 800ffb4 <http_recv+0x13c>
- ContentLengthOffset = i+16;
- break;
- }
- }
- /* read Content-Length value */
- if (ContentLengthOffset)
- 800ffd4: 4b69 ldr r3, [pc, #420] ; (801017c <http_recv+0x304>)
- 800ffd6: 681a ldr r2, [r3, #0]
- 800ffd8: 4618 mov r0, r3
- 800ffda: b90a cbnz r2, 800ffe0 <http_recv+0x168>
- * @param len : buffer length
- * @retval size : Content_length in numeric format
- */
- static uint32_t Parse_Content_Length(char *data, uint32_t len)
- {
- uint32_t i=0,size=0, S=1;
- 800ffdc: 2200 movs r2, #0
- 800ffde: e023 b.n 8010028 <http_recv+0x1b0>
- }
- /* read Content-Length value */
- if (ContentLengthOffset)
- {
- i=0;
- ptr = (char*)(data + ContentLengthOffset);
- 800ffe0: eb06 0c02 add.w ip, r6, r2
- }
- }
- /* read Content-Length value */
- if (ContentLengthOffset)
- {
- i=0;
- 800ffe4: 2300 movs r3, #0
- 800ffe6: e004 b.n 800fff2 <http_recv+0x17a>
- ptr = (char*)(data + ContentLengthOffset);
- while(*(ptr+i)!=0x0d)
- {
- sizestring[i] = *(ptr+i);
- 800ffe8: f10d 0e08 add.w lr, sp, #8
- 800ffec: f803 100e strb.w r1, [r3, lr]
- i++;
- 800fff0: 3301 adds r3, #1
- /* read Content-Length value */
- if (ContentLengthOffset)
- {
- i=0;
- ptr = (char*)(data + ContentLengthOffset);
- while(*(ptr+i)!=0x0d)
- 800fff2: f81c 1003 ldrb.w r1, [ip, r3]
- 800fff6: 290d cmp r1, #13
- 800fff8: eb03 0e02 add.w lr, r3, r2
- 800fffc: d1f4 bne.n 800ffe8 <http_recv+0x170>
- 800fffe: f8c0 e000 str.w lr, [r0]
- {
- sizestring[i] = *(ptr+i);
- i++;
- ContentLengthOffset++;
- }
- if (i>0)
- 8010002: 2b00 cmp r3, #0
- 8010004: d0ea beq.n 800ffdc <http_recv+0x164>
- {
- /* transform string data into numeric format */
- for(j=i-1;j>=0;j--)
- 8010006: 3b01 subs r3, #1
- * @param len : buffer length
- * @retval size : Content_length in numeric format
- */
- static uint32_t Parse_Content_Length(char *data, uint32_t len)
- {
- uint32_t i=0,size=0, S=1;
- 8010008: 2101 movs r1, #1
- 801000a: 2200 movs r2, #0
- {
- /* transform string data into numeric format */
- for(j=i-1;j>=0;j--)
- {
- size += (sizestring[j]-0x30)*S;
- S=S*10;
- 801000c: 200a movs r0, #10
- 801000e: e009 b.n 8010024 <http_recv+0x1ac>
- if (i>0)
- {
- /* transform string data into numeric format */
- for(j=i-1;j>=0;j--)
- {
- size += (sizestring[j]-0x30)*S;
- 8010010: f10d 0e08 add.w lr, sp, #8
- 8010014: f813 e00e ldrb.w lr, [r3, lr]
- 8010018: f1ae 0e30 sub.w lr, lr, #48 ; 0x30
- 801001c: fb01 220e mla r2, r1, lr, r2
- ContentLengthOffset++;
- }
- if (i>0)
- {
- /* transform string data into numeric format */
- for(j=i-1;j>=0;j--)
- 8010020: 3b01 subs r3, #1
- {
- size += (sizestring[j]-0x30)*S;
- S=S*10;
- 8010022: 4341 muls r1, r0
- ContentLengthOffset++;
- }
- if (i>0)
- {
- /* transform string data into numeric format */
- for(j=i-1;j>=0;j--)
- 8010024: 2b00 cmp r3, #0
- 8010026: daf3 bge.n 8010010 <http_recv+0x198>
- {
- BrowserFlag = 0;
- TotalReceived = 0;
-
- /* parse packet for Content-length field */
- size = Parse_Content_Length(data, p->tot_len);
- 8010028: 4b56 ldr r3, [pc, #344] ; (8010184 <http_recv+0x30c>)
-
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- 801002a: f04f 0900 mov.w r9, #0
- {
- BrowserFlag = 0;
- TotalReceived = 0;
-
- /* parse packet for Content-length field */
- size = Parse_Content_Length(data, p->tot_len);
- 801002e: 601a str r2, [r3, #0]
-
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- 8010030: e012 b.n 8010058 <http_recv+0x1e0>
- {
- if (strncmp ((char*)(data+i), octet_stream, 13)==0)
- 8010032: eb06 0009 add.w r0, r6, r9
- 8010036: 4954 ldr r1, [pc, #336] ; (8010188 <http_recv+0x310>)
- 8010038: 220d movs r2, #13
- 801003a: f7f9 fc4f bl 80098dc <strncmp>
- 801003e: b948 cbnz r0, 8010054 <http_recv+0x1dc>
-
- }
- /* case of Mozilla Firefox v3.6 : we receive data in the POST packet*/
- else
- {
- TotalReceived = len - (ContentLengthOffset + 4);
- 8010040: 4b4e ldr r3, [pc, #312] ; (801017c <http_recv+0x304>)
- 8010042: 681a ldr r2, [r3, #0]
- 8010044: 4b4c ldr r3, [pc, #304] ; (8010178 <http_recv+0x300>)
- 8010046: ebc2 0208 rsb r2, r2, r8
- 801004a: 3a04 subs r2, #4
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- {
- if (strncmp ((char*)(data+i), octet_stream, 13)==0)
- {
- DataOffset = i + 16;
- 801004c: f109 0a10 add.w sl, r9, #16
-
- }
- /* case of Mozilla Firefox v3.6 : we receive data in the POST packet*/
- else
- {
- TotalReceived = len - (ContentLengthOffset + 4);
- 8010050: 601a str r2, [r3, #0]
- 8010052: e006 b.n 8010062 <http_recv+0x1ea>
-
- /* parse packet for Content-length field */
- size = Parse_Content_Length(data, p->tot_len);
-
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- 8010054: f109 0901 add.w r9, r9, #1
- 8010058: 45c1 cmp r9, r8
- 801005a: dbea blt.n 8010032 <http_recv+0x1ba>
- 801005c: e114 b.n 8010288 <http_recv+0x410>
- if (fEraseFlash) {
- FLASH_If_Erase(USER_FLASH_FIRST_PAGE_ADDRESS);
- fEraseFlash = false;
- }
- DataOffset = 0;
- 801005e: f04f 0a00 mov.w sl, #0
- {
- TotalReceived = len - (ContentLengthOffset + 4);
- }
- }
-
- if (((DataFlag ==1)&&(BrowserFlag==1)) || ((DataFlag ==0)&&(BrowserFlag==0)))
- 8010062: 4b42 ldr r3, [pc, #264] ; (801016c <http_recv+0x2f4>)
- 8010064: 681a ldr r2, [r3, #0]
- 8010066: 2a01 cmp r2, #1
- 8010068: d103 bne.n 8010072 <http_recv+0x1fa>
- 801006a: 4a42 ldr r2, [pc, #264] ; (8010174 <http_recv+0x2fc>)
- 801006c: 6812 ldr r2, [r2, #0]
- 801006e: 2a01 cmp r2, #1
- 8010070: d008 beq.n 8010084 <http_recv+0x20c>
- 8010072: 681b ldr r3, [r3, #0]
- 8010074: 2b00 cmp r3, #0
- 8010076: f040 80ae bne.w 80101d6 <http_recv+0x35e>
- 801007a: 4b3e ldr r3, [pc, #248] ; (8010174 <http_recv+0x2fc>)
- 801007c: 681b ldr r3, [r3, #0]
- 801007e: 2b00 cmp r3, #0
- 8010080: f040 80a9 bne.w 80101d6 <http_recv+0x35e>
- {
- if ((DataFlag ==0)&&(BrowserFlag==0))
- 8010084: 4b39 ldr r3, [pc, #228] ; (801016c <http_recv+0x2f4>)
- 8010086: 6819 ldr r1, [r3, #0]
- 8010088: 461a mov r2, r3
- 801008a: b919 cbnz r1, 8010094 <http_recv+0x21c>
- 801008c: 4939 ldr r1, [pc, #228] ; (8010174 <http_recv+0x2fc>)
- 801008e: 6809 ldr r1, [r1, #0]
- 8010090: b901 cbnz r1, 8010094 <http_recv+0x21c>
- 8010092: e01d b.n 80100d0 <http_recv+0x258>
- {
- DataFlag++;
- }
- else if ((DataFlag ==1)&&(BrowserFlag==1))
- 8010094: 6813 ldr r3, [r2, #0]
- 8010096: 2b01 cmp r3, #1
- 8010098: d11d bne.n 80100d6 <http_recv+0x25e>
- 801009a: 4b36 ldr r3, [pc, #216] ; (8010174 <http_recv+0x2fc>)
- 801009c: 681b ldr r3, [r3, #0]
- 801009e: 2b01 cmp r3, #1
- 80100a0: d119 bne.n 80100d6 <http_recv+0x25e>
- 80100a2: e00c b.n 80100be <http_recv+0x246>
- {
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- {
- if (strncmp ((char*)(data+i), octet_stream, 13)==0)
- 80100a4: eb06 0009 add.w r0, r6, r9
- 80100a8: 4937 ldr r1, [pc, #220] ; (8010188 <http_recv+0x310>)
- 80100aa: 220d movs r2, #13
- 80100ac: f7f9 fc16 bl 80098dc <strncmp>
- 80100b0: b910 cbnz r0, 80100b8 <http_recv+0x240>
- {
- DataOffset = i+16;
- 80100b2: f109 0a10 add.w sl, r9, #16
- break;
- 80100b6: e006 b.n 80100c6 <http_recv+0x24e>
- DataFlag++;
- }
- else if ((DataFlag ==1)&&(BrowserFlag==1))
- {
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- 80100b8: f109 0901 add.w r9, r9, #1
- 80100bc: e001 b.n 80100c2 <http_recv+0x24a>
- {
- if ((DataFlag ==0)&&(BrowserFlag==0))
- {
- DataFlag++;
- }
- else if ((DataFlag ==1)&&(BrowserFlag==1))
- 80100be: f04f 0900 mov.w r9, #0
- {
- /* parse packet for the octet-stream field */
- for (i = 0; i < len; i++)
- 80100c2: 45c1 cmp r9, r8
- 80100c4: dbee blt.n 80100a4 <http_recv+0x22c>
- {
- DataOffset = i+16;
- break;
- }
- }
- TotalReceived += len;
- 80100c6: 4b2c ldr r3, [pc, #176] ; (8010178 <http_recv+0x300>)
- 80100c8: 681a ldr r2, [r3, #0]
- 80100ca: 4442 add r2, r8
- 80100cc: 601a str r2, [r3, #0]
- DataFlag++;
- 80100ce: 4b27 ldr r3, [pc, #156] ; (801016c <http_recv+0x2f4>)
- 80100d0: 681a ldr r2, [r3, #0]
- 80100d2: 3201 adds r2, #1
- 80100d4: 601a str r2, [r3, #0]
- }
-
- /* parse packet for the filename field */
- FilenameOffset = 0;
- for (i = 0; i < len; i++)
- 80100d6: f04f 0900 mov.w r9, #0
- 80100da: e00b b.n 80100f4 <http_recv+0x27c>
- * @param err: LwIP error code
- * @retval err
- */
- /* goback.cgi - возврат в основную прошивку */
- /* upload.cgi - загрузка новой прошивки */
- static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
- 80100dc: eb06 0b09 add.w fp, r6, r9
-
- /* parse packet for the filename field */
- FilenameOffset = 0;
- for (i = 0; i < len; i++)
- {
- if (strncmp ((char*)(data+i), "filename=", 9)==0)
- 80100e0: 4658 mov r0, fp
- 80100e2: 492a ldr r1, [pc, #168] ; (801018c <http_recv+0x314>)
- 80100e4: 2209 movs r2, #9
- 80100e6: f7f9 fbf9 bl 80098dc <strncmp>
- 80100ea: b908 cbnz r0, 80100f0 <http_recv+0x278>
- 80100ec: 4603 mov r3, r0
- 80100ee: e056 b.n 801019e <http_recv+0x326>
- DataFlag++;
- }
-
- /* parse packet for the filename field */
- FilenameOffset = 0;
- for (i = 0; i < len; i++)
- 80100f0: f109 0901 add.w r9, r9, #1
- 80100f4: 45c1 cmp r9, r8
- 80100f6: dbf1 blt.n 80100dc <http_recv+0x264>
- filename[i] = 0x0;
- }
-
- if (i==0)
- {
- htmlpage = FileUploadPage;
- 80100f8: 4b19 ldr r3, [pc, #100] ; (8010160 <http_recv+0x2e8>)
- /* no filename, in this case reload upload page */
- fs_open("/upload.html", &file);
- 80100fa: 4825 ldr r0, [pc, #148] ; (8010190 <http_recv+0x318>)
- filename[i] = 0x0;
- }
-
- if (i==0)
- {
- htmlpage = FileUploadPage;
- 80100fc: 2201 movs r2, #1
- /* no filename, in this case reload upload page */
- fs_open("/upload.html", &file);
- 80100fe: 4669 mov r1, sp
- filename[i] = 0x0;
- }
-
- if (i==0)
- {
- htmlpage = FileUploadPage;
- 8010100: 701a strb r2, [r3, #0]
- /* no filename, in this case reload upload page */
- fs_open("/upload.html", &file);
- 8010102: f7ff fe55 bl 800fdb0 <fs_open>
- hs->file = file.data;
- 8010106: 9b00 ldr r3, [sp, #0]
- 8010108: 6023 str r3, [r4, #0]
- hs->left = file.len;
- 801010a: 9b01 ldr r3, [sp, #4]
- pbuf_free(p);
- 801010c: 4638 mov r0, r7
- {
- htmlpage = FileUploadPage;
- /* no filename, in this case reload upload page */
- fs_open("/upload.html", &file);
- hs->file = file.data;
- hs->left = file.len;
- 801010e: 6063 str r3, [r4, #4]
- pbuf_free(p);
- 8010110: f7fb f9d8 bl 800b4c4 <pbuf_free>
-
- /* send index.html page */
- send_data(pcb, hs);
- 8010114: 4628 mov r0, r5
- 8010116: 4621 mov r1, r4
- 8010118: f7ff fe0a bl 800fd30 <send_data>
-
- /* Tell TCP that we wish be to informed of data that has been
- successfully sent by a call to the http_sent() function. */
- tcp_sent(pcb, http_sent);
- 801011c: 4628 mov r0, r5
- 801011e: 490a ldr r1, [pc, #40] ; (8010148 <http_recv+0x2d0>)
- 8010120: f7fb fc96 bl 800ba50 <tcp_sent>
- DataFlag=0;
- 8010124: 4b11 ldr r3, [pc, #68] ; (801016c <http_recv+0x2f4>)
- 8010126: 2200 movs r2, #0
- 8010128: 601a str r2, [r3, #0]
- 801012a: e0bb b.n 80102a4 <http_recv+0x42c>
- 801012c: 20006d80 .word 0x20006d80
- 8010130: 2000869d .word 0x2000869d
- 8010134: 08013564 .word 0x08013564
- 8010138: 0801356a .word 0x0801356a
- 801013c: 0801356e .word 0x0801356e
- 8010140: 0801357a .word 0x0801357a
- 8010144: 0801357e .word 0x0801357e
- 8010148: 080102e5 .word 0x080102e5
- 801014c: 08013589 .word 0x08013589
- 8010150: e000ed00 .word 0xe000ed00
- 8010154: 05fa0004 .word 0x05fa0004
- 8010158: 08013599 .word 0x08013599
- 801015c: 0801359d .word 0x0801359d
- 8010160: 2000869c .word 0x2000869c
- 8010164: 080135aa .word 0x080135aa
- 8010168: 080135b6 .word 0x080135b6
- 801016c: 20006d9c .word 0x20006d9c
- 8010170: 08020000 .word 0x08020000
- 8010174: 20006d98 .word 0x20006d98
- 8010178: 20006da0 .word 0x20006da0
- 801017c: 20006d88 .word 0x20006d88
- 8010180: 08012231 .word 0x08012231
- 8010184: 20006da4 .word 0x20006da4
- 8010188: 080129a8 .word 0x080129a8
- 801018c: 080135c7 .word 0x080135c7
- 8010190: 080135d1 .word 0x080135d1
- 8010194: 20000114 .word 0x20000114
- i = 0;
- if (FilenameOffset)
- {
- while((*(data+FilenameOffset + i)!=0x22 )&&(i<13))
- {
- filename[i] = *(data+FilenameOffset + i);
- 8010198: a902 add r1, sp, #8
- 801019a: 545a strb r2, [r3, r1]
- i++;
- 801019c: 3301 adds r3, #1
- * @param err: LwIP error code
- * @retval err
- */
- /* goback.cgi - возврат в основную прошивку */
- /* upload.cgi - загрузка новой прошивки */
- static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
- 801019e: eb0b 0203 add.w r2, fp, r3
- }
- }
- i = 0;
- if (FilenameOffset)
- {
- while((*(data+FilenameOffset + i)!=0x22 )&&(i<13))
- 80101a2: 7a92 ldrb r2, [r2, #10]
- 80101a4: 2a22 cmp r2, #34 ; 0x22
- 80101a6: d001 beq.n 80101ac <http_recv+0x334>
- 80101a8: 2b0d cmp r3, #13
- 80101aa: d1f5 bne.n 8010198 <http_recv+0x320>
- {
- filename[i] = *(data+FilenameOffset + i);
- i++;
- }
- filename[i] = 0x0;
- 80101ac: a906 add r1, sp, #24
- 80101ae: 18ca adds r2, r1, r3
- 80101b0: f04f 0900 mov.w r9, #0
- 80101b4: f802 9c10 strb.w r9, [r2, #-16]
- }
-
- if (i==0)
- 80101b8: 2b00 cmp r3, #0
- 80101ba: d09d beq.n 80100f8 <http_recv+0x280>
- return ERR_OK;
- }
- PRINT_USART("\n\r IAP using HTTP \n\r");
- sprintf(debugMsg, "File: %s\n\r",filename);
- 80101bc: aa02 add r2, sp, #8
- 80101be: 493b ldr r1, [pc, #236] ; (80102ac <http_recv+0x434>)
- 80101c0: 483b ldr r0, [pc, #236] ; (80102b0 <http_recv+0x438>)
- 80101c2: f001 fa7d bl 80116c0 <tfp_sprintf>
- PRINT_USART(debugMsg);
- PRINT_USART("State: Erasing...\n\r");
-
- TotalData =0 ;
- 80101c6: 4b3b ldr r3, [pc, #236] ; (80102b4 <http_recv+0x43c>)
- 80101c8: f8c3 9000 str.w r9, [r3]
- /* init flash */
- FLASH_If_Init();
- 80101cc: f7ff fa3e bl 800f64c <FLASH_If_Init>
- /* erase user flash area */
- //FLASH_If_Erase(USER_FLASH_FIRST_PAGE_ADDRESS);
- FlashWriteAddress = USER_FLASH_FIRST_PAGE_ADDRESS;
- 80101d0: 4a39 ldr r2, [pc, #228] ; (80102b8 <http_recv+0x440>)
- 80101d2: 4b3a ldr r3, [pc, #232] ; (80102bc <http_recv+0x444>)
- 80101d4: e002 b.n 80101dc <http_recv+0x364>
- PRINT_USART("\n\rState: Programming..\n\r");
- }
- /* DataFlag >1 => the packet is data only */
- else
- {
- TotalReceived +=len;
- 80101d6: 4b3a ldr r3, [pc, #232] ; (80102c0 <http_recv+0x448>)
- 80101d8: 681a ldr r2, [r3, #0]
- 80101da: 4442 add r2, r8
- 80101dc: 601a str r2, [r3, #0]
-
- ptr = (char*)(data + DataOffset);
- len-= DataOffset;
-
- /* update Total data received counter */
- TotalData +=len;
- 80101de: 4b35 ldr r3, [pc, #212] ; (80102b4 <http_recv+0x43c>)
- 80101e0: 681a ldr r2, [r3, #0]
- {
- TotalReceived +=len;
- }
-
- ptr = (char*)(data + DataOffset);
- len-= DataOffset;
- 80101e2: ebca 0108 rsb r1, sl, r8
-
- /* update Total data received counter */
- TotalData +=len;
- 80101e6: 188a adds r2, r1, r2
- 80101e8: 601a str r2, [r3, #0]
-
- /* check if last data packet */
- if (TotalReceived == size)
- 80101ea: 4b36 ldr r3, [pc, #216] ; (80102c4 <http_recv+0x44c>)
- 80101ec: 4a34 ldr r2, [pc, #208] ; (80102c0 <http_recv+0x448>)
- 80101ee: 681b ldr r3, [r3, #0]
- 80101f0: 6812 ldr r2, [r2, #0]
- 80101f2: 429a cmp r2, r3
- else
- {
- TotalReceived +=len;
- }
-
- ptr = (char*)(data + DataOffset);
- 80101f4: eb06 000a add.w r0, r6, sl
-
- /* update Total data received counter */
- TotalData +=len;
-
- /* check if last data packet */
- if (TotalReceived == size)
- 80101f8: d13d bne.n 8010276 <http_recv+0x3fe>
- }
- len -= i;
- TotalData -= i;
- */
- /* write data in Flash */
- if (len)
- 80101fa: b109 cbz r1, 8010200 <http_recv+0x388>
- IAP_HTTP_writedata(ptr,len);
- 80101fc: f7ff fdee bl 800fddc <IAP_HTTP_writedata>
- DataFlag=0;
- 8010200: 4b31 ldr r3, [pc, #196] ; (80102c8 <http_recv+0x450>)
- htmlpage = UploadDonePage;
- 8010202: 4e32 ldr r6, [pc, #200] ; (80102cc <http_recv+0x454>)
- PRINT_USART("Tot bytes Received:\n\r");
- sprintf(debugMsg, "%d bytes \n\r",TotalData);
- 8010204: 4932 ldr r1, [pc, #200] ; (80102d0 <http_recv+0x458>)
- 8010206: 482a ldr r0, [pc, #168] ; (80102b0 <http_recv+0x438>)
- */
- /* write data in Flash */
- if (len)
- IAP_HTTP_writedata(ptr,len);
- DataFlag=0;
- 8010208: 2200 movs r2, #0
- 801020a: 601a str r2, [r3, #0]
- htmlpage = UploadDonePage;
- PRINT_USART("Tot bytes Received:\n\r");
- sprintf(debugMsg, "%d bytes \n\r",TotalData);
- 801020c: 4b29 ldr r3, [pc, #164] ; (80102b4 <http_recv+0x43c>)
- /* write data in Flash */
- if (len)
- IAP_HTTP_writedata(ptr,len);
- DataFlag=0;
- htmlpage = UploadDonePage;
- 801020e: f04f 0802 mov.w r8, #2
- PRINT_USART("Tot bytes Received:\n\r");
- sprintf(debugMsg, "%d bytes \n\r",TotalData);
- 8010212: 681a ldr r2, [r3, #0]
- /* write data in Flash */
- if (len)
- IAP_HTTP_writedata(ptr,len);
- DataFlag=0;
- htmlpage = UploadDonePage;
- 8010214: f886 8000 strb.w r8, [r6]
- PRINT_USART("Tot bytes Received:\n\r");
- sprintf(debugMsg, "%d bytes \n\r",TotalData);
- 8010218: f001 fa52 bl 80116c0 <tfp_sprintf>
- PRINT_USART(debugMsg);
- PRINT_USART("State: Prog Finished \n\r");
- /* Проверяем CRC */
- if (CRC_Read() == CRC_Calcucate()) {
- 801021c: f7ff f9fc bl 800f618 <CRC_Read>
- 8010220: 4681 mov r9, r0
- 8010222: f7ff f9ff bl 800f624 <CRC_Calcucate>
- 8010226: 4581 cmp r9, r0
- 8010228: d112 bne.n 8010250 <http_recv+0x3d8>
- fs_open("/success.html", &file);
- 801022a: 4669 mov r1, sp
- 801022c: 4829 ldr r0, [pc, #164] ; (80102d4 <http_recv+0x45c>)
- 801022e: f7ff fdbf bl 800fdb0 <fs_open>
- hs->file = file.data;
- 8010232: 9b00 ldr r3, [sp, #0]
- 8010234: 6023 str r3, [r4, #0]
- hs->left = file.len;
- 8010236: 9b01 ldr r3, [sp, #4]
- send_data(pcb, hs);
- 8010238: 4628 mov r0, r5
- /* Проверяем CRC */
- if (CRC_Read() == CRC_Calcucate()) {
- fs_open("/success.html", &file);
- hs->file = file.data;
- hs->left = file.len;
- 801023a: 6063 str r3, [r4, #4]
- send_data(pcb, hs);
- 801023c: 4621 mov r1, r4
- 801023e: f7ff fd77 bl 800fd30 <send_data>
- tcp_sent(pcb, http_sent);
- 8010242: 4628 mov r0, r5
- 8010244: 4924 ldr r1, [pc, #144] ; (80102d8 <http_recv+0x460>)
- 8010246: f7fb fc03 bl 800ba50 <tcp_sent>
- htmlpage = UploadDonePage;
- 801024a: f886 8000 strb.w r8, [r6]
- 801024e: e022 b.n 8010296 <http_recv+0x41e>
- }
- else
- {
- fs_open("/error.html", &file);
- 8010250: 4669 mov r1, sp
- 8010252: 4822 ldr r0, [pc, #136] ; (80102dc <http_recv+0x464>)
- 8010254: f7ff fdac bl 800fdb0 <fs_open>
- hs->file = file.data;
- 8010258: 9b00 ldr r3, [sp, #0]
- 801025a: 6023 str r3, [r4, #0]
- hs->left = file.len;
- 801025c: 9b01 ldr r3, [sp, #4]
- send_data(pcb, hs);
- 801025e: 4628 mov r0, r5
- else
- {
- fs_open("/error.html", &file);
- hs->file = file.data;
- hs->left = file.len;
- 8010260: 6063 str r3, [r4, #4]
- send_data(pcb, hs);
- 8010262: 4621 mov r1, r4
- 8010264: f7ff fd64 bl 800fd30 <send_data>
- tcp_sent(pcb, http_sent);
- 8010268: 4628 mov r0, r5
- 801026a: 491b ldr r1, [pc, #108] ; (80102d8 <http_recv+0x460>)
- 801026c: f7fb fbf0 bl 800ba50 <tcp_sent>
- htmlpage = UploadErrorPage;
- 8010270: 2303 movs r3, #3
- 8010272: 7033 strb r3, [r6, #0]
- 8010274: e00f b.n 8010296 <http_recv+0x41e>
- }
- /* not last data packet */
- else
- {
- /* write data in flash */
- if(len)
- 8010276: b171 cbz r1, 8010296 <http_recv+0x41e>
- IAP_HTTP_writedata(ptr,len);
- 8010278: f7ff fdb0 bl 800fddc <IAP_HTTP_writedata>
- 801027c: e00b b.n 8010296 <http_recv+0x41e>
- else
- {
- /* Bad HTTP requests */
- PRINT_USART("Bad HTTP request\n\r");
- pbuf_free(p);
- 801027e: 4638 mov r0, r7
- 8010280: f7fb f920 bl 800b4c4 <pbuf_free>
- close_conn(pcb, hs);
- 8010284: 4628 mov r0, r5
- 8010286: e00a b.n 801029e <http_recv+0x426>
- }
- }
- /* case of MSIE8 : we do not receive data in the POST packet*/
- if (DataOffset == 0)
- {
- DataFlag++;
- 8010288: 4b0f ldr r3, [pc, #60] ; (80102c8 <http_recv+0x450>)
- 801028a: 681a ldr r2, [r3, #0]
- 801028c: 3201 adds r2, #1
- 801028e: 601a str r2, [r3, #0]
- BrowserFlag = 1;
- 8010290: 4b13 ldr r3, [pc, #76] ; (80102e0 <http_recv+0x468>)
- 8010292: 2201 movs r2, #1
- 8010294: 601a str r2, [r3, #0]
- pbuf_free(p);
- 8010296: 4638 mov r0, r7
- 8010298: f7fb f914 bl 800b4c4 <pbuf_free>
- 801029c: e002 b.n 80102a4 <http_recv+0x42c>
- if (err == ERR_OK && p == NULL)
- {
- /* received empty frame */
- PRINT_USART("Received empty frame\n\r");
- close_conn(pcb, hs);
- 801029e: 4621 mov r1, r4
- 80102a0: f7ff fd6a bl 800fd78 <close_conn>
- }
- return ERR_OK;
- }
- 80102a4: 2000 movs r0, #0
- 80102a6: b007 add sp, #28
- 80102a8: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 80102ac: 080135de .word 0x080135de
- 80102b0: 20008674 .word 0x20008674
- 80102b4: 20006d8c .word 0x20006d8c
- 80102b8: 08020000 .word 0x08020000
- 80102bc: 20006d90 .word 0x20006d90
- 80102c0: 20006da0 .word 0x20006da0
- 80102c4: 20006da4 .word 0x20006da4
- 80102c8: 20006d9c .word 0x20006d9c
- 80102cc: 2000869c .word 0x2000869c
- 80102d0: 080135e9 .word 0x080135e9
- 80102d4: 080135f5 .word 0x080135f5
- 80102d8: 080102e5 .word 0x080102e5
- 80102dc: 08013603 .word 0x08013603
- 80102e0: 20006d98 .word 0x20006d98
- 080102e4 <http_sent>:
- * @param pcb: pointer on tcp_pcb structure
- * @param len
- * @retval err : LwIP error code
- */
- static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
- {
- 80102e4: b508 push {r3, lr}
- 80102e6: 4603 mov r3, r0
- 80102e8: 4608 mov r0, r1
- struct http_state *hs;
- hs = arg;
- if (hs->left > 0)
- 80102ea: 685a ldr r2, [r3, #4]
- send_data(pcb, hs);
- 80102ec: 4619 mov r1, r3
- static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
- {
- struct http_state *hs;
- hs = arg;
- if (hs->left > 0)
- 80102ee: b112 cbz r2, 80102f6 <http_sent+0x12>
- send_data(pcb, hs);
- 80102f0: f7ff fd1e bl 800fd30 <send_data>
- 80102f4: e00d b.n 8010312 <http_sent+0x2e>
- else
- {
- close_conn(pcb, hs);
- 80102f6: f7ff fd3f bl 800fd78 <close_conn>
-
- if (htmlpage == UploadDonePage)
- 80102fa: 4b07 ldr r3, [pc, #28] ; (8010318 <http_sent+0x34>)
- 80102fc: 781b ldrb r3, [r3, #0]
- 80102fe: 2b02 cmp r3, #2
- 8010300: d102 bne.n 8010308 <http_sent+0x24>
- fDoneReset = 1;
- 8010302: 2201 movs r2, #1
- 8010304: 4b05 ldr r3, [pc, #20] ; (801031c <http_sent+0x38>)
- 8010306: e003 b.n 8010310 <http_sent+0x2c>
- else if (htmlpage == UploadErrorPage)
- 8010308: 2b03 cmp r3, #3
- 801030a: d102 bne.n 8010312 <http_sent+0x2e>
- fErrorReset = 1;
- 801030c: 4b04 ldr r3, [pc, #16] ; (8010320 <http_sent+0x3c>)
- 801030e: 2201 movs r2, #1
- 8010310: 701a strb r2, [r3, #0]
- }
- return ERR_OK;
- }
- 8010312: 2000 movs r0, #0
- 8010314: bd08 pop {r3, pc}
- 8010316: bf00 nop
- 8010318: 2000869c .word 0x2000869c
- 801031c: 20006dbc .word 0x20006dbc
- 8010320: 20006dbb .word 0x20006dbb
- 08010324 <IAP_httpd_init>:
- * @brief intialize HTTP webserver
- * @param none
- * @retval none
- */
- void IAP_httpd_init(void)
- {
- 8010324: b510 push {r4, lr}
- struct tcp_pcb *pcb;
- /*create new pcb*/
- pcb = tcp_new();
- 8010326: f7fb fe47 bl 800bfb8 <tcp_new>
- /* bind HTTP traffic to pcb */
- tcp_bind(pcb, IP_ADDR_ANY, 80);
- 801032a: 2250 movs r2, #80 ; 0x50
- */
- void IAP_httpd_init(void)
- {
- struct tcp_pcb *pcb;
- /*create new pcb*/
- pcb = tcp_new();
- 801032c: 4604 mov r4, r0
- /* bind HTTP traffic to pcb */
- tcp_bind(pcb, IP_ADDR_ANY, 80);
- 801032e: 4906 ldr r1, [pc, #24] ; (8010348 <IAP_httpd_init+0x24>)
- 8010330: f7fb fab6 bl 800b8a0 <tcp_bind>
- /* start listening on port 80 */
- pcb = tcp_listen(pcb);
- 8010334: 21ff movs r1, #255 ; 0xff
- 8010336: 4620 mov r0, r4
- 8010338: f7fb faea bl 800b910 <tcp_listen_with_backlog>
- /* define callback function for TCP connection setup */
- tcp_accept(pcb, http_accept);
- 801033c: 4903 ldr r1, [pc, #12] ; (801034c <IAP_httpd_init+0x28>)
- }
- 801033e: e8bd 4010 ldmia.w sp!, {r4, lr}
- /* bind HTTP traffic to pcb */
- tcp_bind(pcb, IP_ADDR_ANY, 80);
- /* start listening on port 80 */
- pcb = tcp_listen(pcb);
- /* define callback function for TCP connection setup */
- tcp_accept(pcb, http_accept);
- 8010342: f7fb bb8a b.w 800ba5a <tcp_accept>
- 8010346: bf00 nop
- 8010348: 08011880 .word 0x08011880
- 801034c: 0800fce5 .word 0x0800fce5
- 08010350 <LwIP_Init>:
- * @brief Initializes the lwIP stack
- * @param None
- * @retval None
- */
- void LwIP_Init(void)
- {
- 8010350: b510 push {r4, lr}
- // mem_init();
- //
- // /* Initializes the memory pools defined by MEMP_NUM_x.*/
- // memp_init();
- if (sSettings.sWebParams.dhcpEnable)
- 8010352: 4c1a ldr r4, [pc, #104] ; (80103bc <LwIP_Init+0x6c>)
- * @brief Initializes the lwIP stack
- * @param None
- * @retval None
- */
- void LwIP_Init(void)
- {
- 8010354: b08c sub sp, #48 ; 0x30
- struct ip_addr ipaddr;
- struct ip_addr netmask;
- struct ip_addr gw;
- char str[20];
- lwip_init();
- 8010356: f7fa fddf bl 800af18 <lwip_init>
- // mem_init();
- //
- // /* Initializes the memory pools defined by MEMP_NUM_x.*/
- // memp_init();
- if (sSettings.sWebParams.dhcpEnable)
- 801035a: f894 302f ldrb.w r3, [r4, #47] ; 0x2f
- 801035e: b123 cbz r3, 801036a <LwIP_Init+0x1a>
- {
- ipaddr.addr = 0;
- 8010360: 2300 movs r3, #0
- 8010362: 9304 str r3, [sp, #16]
- netmask.addr = 0;
- 8010364: 9305 str r3, [sp, #20]
- gw.addr = 0;
- 8010366: 9306 str r3, [sp, #24]
- 8010368: e013 b.n 8010392 <LwIP_Init+0x42>
- }
- else
- {
- sprintf(str, " %s\n\r", sSettings.sWebTempParams.ip);
- 801036a: 4915 ldr r1, [pc, #84] ; (80103c0 <LwIP_Init+0x70>)
- 801036c: f104 0230 add.w r2, r4, #48 ; 0x30
- 8010370: a807 add r0, sp, #28
- 8010372: f001 f9a5 bl 80116c0 <tfp_sprintf>
- PRINT_USART("\n\rStatic IP address \n\r");
- PRINT_USART(str);
-
- ipaddr.addr = ipaddr_addr(sSettings.sWebParams.ip);
- 8010376: 1ca0 adds r0, r4, #2
- 8010378: f7fe f89a bl 800e4b0 <ipaddr_addr>
- 801037c: 9004 str r0, [sp, #16]
- netmask.addr = ipaddr_addr(sSettings.sWebParams.mask);
- 801037e: f104 0020 add.w r0, r4, #32
- 8010382: f7fe f895 bl 800e4b0 <ipaddr_addr>
- 8010386: 9005 str r0, [sp, #20]
- gw.addr = ipaddr_addr(sSettings.sWebParams.gate);
- 8010388: f104 0011 add.w r0, r4, #17
- 801038c: f7fe f890 bl 800e4b0 <ipaddr_addr>
- 8010390: 9006 str r0, [sp, #24]
- }
- netif_add(&netif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, ðernet_input);
- 8010392: 2300 movs r3, #0
- 8010394: 9300 str r3, [sp, #0]
- 8010396: 4b0b ldr r3, [pc, #44] ; (80103c4 <LwIP_Init+0x74>)
- 8010398: 480b ldr r0, [pc, #44] ; (80103c8 <LwIP_Init+0x78>)
- 801039a: 9301 str r3, [sp, #4]
- 801039c: 4b0b ldr r3, [pc, #44] ; (80103cc <LwIP_Init+0x7c>)
- 801039e: a904 add r1, sp, #16
- 80103a0: 9302 str r3, [sp, #8]
- 80103a2: aa05 add r2, sp, #20
- 80103a4: ab06 add r3, sp, #24
- 80103a6: f7fa ffe7 bl 800b378 <netif_add>
- netif_set_default(&netif);
- 80103aa: 4807 ldr r0, [pc, #28] ; (80103c8 <LwIP_Init+0x78>)
- 80103ac: f7fb f812 bl 800b3d4 <netif_set_default>
- netif_set_up(&netif);
- 80103b0: 4805 ldr r0, [pc, #20] ; (80103c8 <LwIP_Init+0x78>)
- 80103b2: f7fb f815 bl 800b3e0 <netif_set_up>
- }
- 80103b6: b00c add sp, #48 ; 0x30
- 80103b8: bd10 pop {r4, pc}
- 80103ba: bf00 nop
- 80103bc: 2000838c .word 0x2000838c
- 80103c0: 080135e3 .word 0x080135e3
- 80103c4: 0800f549 .word 0x0800f549
- 80103c8: 20008c7c .word 0x20008c7c
- 80103cc: 0800f255 .word 0x0800f255
- 080103d0 <LwIP_Pkt_Handle>:
- * @retval None
- */
- void LwIP_Pkt_Handle(void)
- {
- /* Read a received packet from the Ethernet buffers and send it to the lwIP for handling */
- ethernetif_input(&netif);
- 80103d0: 4801 ldr r0, [pc, #4] ; (80103d8 <LwIP_Pkt_Handle+0x8>)
- 80103d2: f7ff b86b b.w 800f4ac <ethernetif_input>
- 80103d6: bf00 nop
- 80103d8: 20008c7c .word 0x20008c7c
- 080103dc <LwIP_DHCP_Process_Handle>:
- * @brief LwIP_DHCP_Process_Handle
- * @param None
- * @retval None
- */
- void LwIP_DHCP_Process_Handle()
- {
- 80103dc: b530 push {r4, r5, lr}
- struct ip_addr ipaddr;
- struct ip_addr netmask;
- struct ip_addr gw;
- switch (DHCP_state)
- 80103de: 4d1c ldr r5, [pc, #112] ; (8010450 <LwIP_DHCP_Process_Handle+0x74>)
- 80103e0: 782b ldrb r3, [r5, #0]
- * @brief LwIP_DHCP_Process_Handle
- * @param None
- * @retval None
- */
- void LwIP_DHCP_Process_Handle()
- {
- 80103e2: b085 sub sp, #20
- struct ip_addr ipaddr;
- struct ip_addr netmask;
- struct ip_addr gw;
- switch (DHCP_state)
- 80103e4: b113 cbz r3, 80103ec <LwIP_DHCP_Process_Handle+0x10>
- 80103e6: 2b01 cmp r3, #1
- 80103e8: d12f bne.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
- 80103ea: e005 b.n 80103f8 <LwIP_DHCP_Process_Handle+0x1c>
- {
- case DHCP_START:
- {
- dhcp_start(&netif);
- 80103ec: 4819 ldr r0, [pc, #100] ; (8010454 <LwIP_DHCP_Process_Handle+0x78>)
- 80103ee: f7fa fd3f bl 800ae70 <dhcp_start>
- DHCP_state = DHCP_WAIT_ADDRESS;
- 80103f2: 2301 movs r3, #1
- 80103f4: 702b strb r3, [r5, #0]
- PRINT_USART("\n\rLooking for DHCP server please wait...\n\r");
- }
- break;
- 80103f6: e028 b.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
- case DHCP_WAIT_ADDRESS:
- {
- ipaddr = netif.ip_addr;
- 80103f8: 4c16 ldr r4, [pc, #88] ; (8010454 <LwIP_DHCP_Process_Handle+0x78>)
- netmask = netif.netmask;
- 80103fa: 68a2 ldr r2, [r4, #8]
- }
- break;
- case DHCP_WAIT_ADDRESS:
- {
- ipaddr = netif.ip_addr;
- 80103fc: 6863 ldr r3, [r4, #4]
- netmask = netif.netmask;
- 80103fe: 9202 str r2, [sp, #8]
- gw = netif.gw;
- 8010400: 68e2 ldr r2, [r4, #12]
- }
- break;
- case DHCP_WAIT_ADDRESS:
- {
- ipaddr = netif.ip_addr;
- 8010402: 9301 str r3, [sp, #4]
- netmask = netif.netmask;
- gw = netif.gw;
- 8010404: 9203 str r2, [sp, #12]
-
- if (ipaddr.addr != 0)
- 8010406: b12b cbz r3, 8010414 <LwIP_DHCP_Process_Handle+0x38>
- {
- DHCP_state = DHCP_ADDRESS_ASSIGNED;
- 8010408: 2302 movs r3, #2
- /* Stop DHCP */
- dhcp_stop(&netif);
- 801040a: 4620 mov r0, r4
- netmask = netif.netmask;
- gw = netif.gw;
-
- if (ipaddr.addr != 0)
- {
- DHCP_state = DHCP_ADDRESS_ASSIGNED;
- 801040c: 702b strb r3, [r5, #0]
- /* Stop DHCP */
- dhcp_stop(&netif);
- 801040e: f7fa fd17 bl 800ae40 <dhcp_stop>
- 8010412: e01a b.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
- PRINT_USART(ipaddr_ntoa(&gw));
- PRINT_USART("\n\r");
- } else {
- /* DHCP timeout */
- if (netif.dhcp->tries > MAX_DHCP_TRIES)
- 8010414: 6a23 ldr r3, [r4, #32]
- 8010416: 7b5b ldrb r3, [r3, #13]
- 8010418: 2b04 cmp r3, #4
- 801041a: d916 bls.n 801044a <LwIP_DHCP_Process_Handle+0x6e>
- {
- DHCP_state = DHCP_TIMEOUT;
- 801041c: 2303 movs r3, #3
- /* Stop DHCP */
- dhcp_stop(&netif);
- 801041e: 4620 mov r0, r4
- } else {
- /* DHCP timeout */
- if (netif.dhcp->tries > MAX_DHCP_TRIES)
- {
- DHCP_state = DHCP_TIMEOUT;
- 8010420: 702b strb r3, [r5, #0]
- /* Stop DHCP */
- dhcp_stop(&netif);
- 8010422: f7fa fd0d bl 800ae40 <dhcp_stop>
- // ipaddr.addr = ipaddr_addr(sSettings.sWebTempParams.ip);
- // netmask.addr = ipaddr_addr(sSettings.sWebTempParams.mask);
- // gw.addr = ipaddr_addr(sSettings.sWebTempParams.gate);
-
- ipaddr.addr = ipaddr_addr("192.168.14.48");
- 8010426: 480c ldr r0, [pc, #48] ; (8010458 <LwIP_DHCP_Process_Handle+0x7c>)
- 8010428: f7fe f842 bl 800e4b0 <ipaddr_addr>
- 801042c: 9001 str r0, [sp, #4]
- netmask.addr = ipaddr_addr("255.255.255.0");
- 801042e: 480b ldr r0, [pc, #44] ; (801045c <LwIP_DHCP_Process_Handle+0x80>)
- 8010430: f7fe f83e bl 800e4b0 <ipaddr_addr>
- 8010434: 9002 str r0, [sp, #8]
- gw.addr = ipaddr_addr("192.168.14.1");
- 8010436: 480a ldr r0, [pc, #40] ; (8010460 <LwIP_DHCP_Process_Handle+0x84>)
- 8010438: f7fe f83a bl 800e4b0 <ipaddr_addr>
- netif_set_addr(&netif, &ipaddr , &netmask, &gw);
- 801043c: a901 add r1, sp, #4
- // netmask.addr = ipaddr_addr(sSettings.sWebTempParams.mask);
- // gw.addr = ipaddr_addr(sSettings.sWebTempParams.gate);
-
- ipaddr.addr = ipaddr_addr("192.168.14.48");
- netmask.addr = ipaddr_addr("255.255.255.0");
- gw.addr = ipaddr_addr("192.168.14.1");
- 801043e: 9003 str r0, [sp, #12]
- netif_set_addr(&netif, &ipaddr , &netmask, &gw);
- 8010440: aa02 add r2, sp, #8
- 8010442: 4620 mov r0, r4
- 8010444: ab03 add r3, sp, #12
- 8010446: f7fa ff89 bl 800b35c <netif_set_addr>
- }
- }
- break;
- default: break;
- }
- }
- 801044a: b005 add sp, #20
- 801044c: bd30 pop {r4, r5, pc}
- 801044e: bf00 nop
- 8010450: 20006da8 .word 0x20006da8
- 8010454: 20008c7c .word 0x20008c7c
- 8010458: 08013624 .word 0x08013624
- 801045c: 080118a8 .word 0x080118a8
- 8010460: 08013632 .word 0x08013632
- 08010464 <LwIP_Periodic_Handle>:
- * @brief LwIP periodic tasks
- * @param localtime the current LocalTime value
- * @retval None
- */
- void LwIP_Periodic_Handle(__IO uint32_t localtime)
- {
- 8010464: b507 push {r0, r1, r2, lr}
- if (sSettings.sWebParams.dhcpEnable)
- 8010466: 4b08 ldr r3, [pc, #32] ; (8010488 <LwIP_Periodic_Handle+0x24>)
- * @brief LwIP periodic tasks
- * @param localtime the current LocalTime value
- * @retval None
- */
- void LwIP_Periodic_Handle(__IO uint32_t localtime)
- {
- 8010468: 9001 str r0, [sp, #4]
- if (sSettings.sWebParams.dhcpEnable)
- 801046a: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
- 801046e: b133 cbz r3, 801047e <LwIP_Periodic_Handle+0x1a>
- {
- /* Fine DHCP periodic process every 500ms */
- if ((DHCP_state != DHCP_ADDRESS_ASSIGNED)&&(DHCP_state != DHCP_TIMEOUT)) {
- 8010470: 4b06 ldr r3, [pc, #24] ; (801048c <LwIP_Periodic_Handle+0x28>)
- 8010472: 781b ldrb r3, [r3, #0]
- 8010474: 3b02 subs r3, #2
- 8010476: 2b01 cmp r3, #1
- 8010478: d901 bls.n 801047e <LwIP_Periodic_Handle+0x1a>
- /* process DHCP state machine */
- LwIP_DHCP_Process_Handle();
- 801047a: f7ff ffaf bl 80103dc <LwIP_DHCP_Process_Handle>
- }
- }
- sys_check_timeouts();
- }
- 801047e: b003 add sp, #12
- 8010480: f85d eb04 ldr.w lr, [sp], #4
- /* process DHCP state machine */
- LwIP_DHCP_Process_Handle();
- }
- }
- sys_check_timeouts();
- 8010484: f7fd bc0e b.w 800dca4 <sys_check_timeouts>
- 8010488: 2000838c .word 0x2000838c
- 801048c: 20006da8 .word 0x20006da8
- 08010490 <ETH_BSP_Config>:
- * @brief ETH_BSP_Config
- * @param None
- * @retval None
- */
- void ETH_BSP_Config(void)
- {
- 8010490: b570 push {r4, r5, r6, lr}
- {
- volatile uint32_t i;
- GPIO_InitTypeDef GPIO_InitStructure;
-
- /* Enable GPIOs clocks */
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB
- 8010492: 2007 movs r0, #7
- * @brief ETH_BSP_Config
- * @param None
- * @retval None
- */
- void ETH_BSP_Config(void)
- {
- 8010494: b0b2 sub sp, #200 ; 0xc8
- {
- volatile uint32_t i;
- GPIO_InitTypeDef GPIO_InitStructure;
-
- /* Enable GPIOs clocks */
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB
- 8010496: 2101 movs r1, #1
- 8010498: f7f9 fd7c bl 8009f94 <RCC_AHB1PeriphClockCmd>
- | RCC_AHB1Periph_GPIOC, ENABLE);
- /* Enable SYSCFG clock */
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
- 801049c: 2101 movs r1, #1
- 801049e: f44f 4080 mov.w r0, #16384 ; 0x4000
- 80104a2: f7f9 fd8f bl 8009fc4 <RCC_APB2PeriphClockCmd>
-
- /* MII/RMII Media interface selection --------------------------------------*/
- SYSCFG_ETH_MediaInterfaceConfig(SYSCFG_ETH_MediaInterface_RMII);
- 80104a6: 2001 movs r0, #1
- 80104a8: f7f9 fdc4 bl 800a034 <SYSCFG_ETH_MediaInterfaceConfig>
- ETH_RST_PIN -------> PE2 - замена на PE13
-
- */
- /* Configure PA1,PA2 and PA7 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
- 80104ac: 2386 movs r3, #134 ; 0x86
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 80104ae: 2400 movs r4, #0
- */
- /* Configure PA1,PA2 and PA7 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- 80104b0: 2502 movs r5, #2
- ETH_RST_PIN -------> PE2 - замена на PE13
-
- */
- /* Configure PA1,PA2 and PA7 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
- 80104b2: 9301 str r3, [sp, #4]
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- 80104b4: 485c ldr r0, [pc, #368] ; (8010628 <ETH_BSP_Config+0x198>)
- */
- /* Configure PA1,PA2 and PA7 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- 80104b6: f88d 5008 strb.w r5, [sp, #8]
-
- */
- /* Configure PA1,PA2 and PA7 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
- 80104ba: 2303 movs r3, #3
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- 80104bc: a901 add r1, sp, #4
-
- */
- /* Configure PA1,PA2 and PA7 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
- 80104be: f88d 3009 strb.w r3, [sp, #9]
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 80104c2: f88d 400a strb.w r4, [sp, #10]
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
- 80104c6: f88d 400b strb.w r4, [sp, #11]
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- 80104ca: f7f9 fcb1 bl 8009e30 <GPIO_Init>
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_ETH);
- 80104ce: 2101 movs r1, #1
- 80104d0: 220b movs r2, #11
- 80104d2: 4855 ldr r0, [pc, #340] ; (8010628 <ETH_BSP_Config+0x198>)
- 80104d4: f7f9 fcfb bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_ETH);
- 80104d8: 220b movs r2, #11
- 80104da: 4853 ldr r0, [pc, #332] ; (8010628 <ETH_BSP_Config+0x198>)
- 80104dc: 4629 mov r1, r5
- 80104de: f7f9 fcf6 bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_ETH);
- 80104e2: 220b movs r2, #11
- 80104e4: 2107 movs r1, #7
- 80104e6: 4850 ldr r0, [pc, #320] ; (8010628 <ETH_BSP_Config+0x198>)
- 80104e8: f7f9 fcf1 bl 8009ece <GPIO_PinAFConfig>
- /* Configure PB10,PB11,PB12 and PB13 */
- GPIO_InitStructure.GPIO_Pin = /* GPIO_Pin_10 | */ GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
- 80104ec: f44f 5360 mov.w r3, #14336 ; 0x3800
- GPIO_Init(GPIOB, &GPIO_InitStructure);
- 80104f0: 484e ldr r0, [pc, #312] ; (801062c <ETH_BSP_Config+0x19c>)
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_ETH);
- /* Configure PB10,PB11,PB12 and PB13 */
- GPIO_InitStructure.GPIO_Pin = /* GPIO_Pin_10 | */ GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
- 80104f2: 9301 str r3, [sp, #4]
- GPIO_Init(GPIOB, &GPIO_InitStructure);
- 80104f4: a901 add r1, sp, #4
- 80104f6: f7f9 fc9b bl 8009e30 <GPIO_Init>
- //GPIO_PinAFConfig(GPIOB, GPIO_PinSource10, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource11, GPIO_AF_ETH);
- 80104fa: 210b movs r1, #11
- 80104fc: 460a mov r2, r1
- 80104fe: 484b ldr r0, [pc, #300] ; (801062c <ETH_BSP_Config+0x19c>)
- 8010500: f7f9 fce5 bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_ETH);
- 8010504: 210c movs r1, #12
- 8010506: 220b movs r2, #11
- 8010508: 4848 ldr r0, [pc, #288] ; (801062c <ETH_BSP_Config+0x19c>)
- 801050a: f7f9 fce0 bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_ETH);
- 801050e: 220b movs r2, #11
- 8010510: 210d movs r1, #13
- 8010512: 4846 ldr r0, [pc, #280] ; (801062c <ETH_BSP_Config+0x19c>)
- 8010514: f7f9 fcdb bl 8009ece <GPIO_PinAFConfig>
- /* Configure PC1, PC4 and PC5 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5;
- 8010518: 2332 movs r3, #50 ; 0x32
- GPIO_Init(GPIOC, &GPIO_InitStructure);
- 801051a: 4845 ldr r0, [pc, #276] ; (8010630 <ETH_BSP_Config+0x1a0>)
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource11, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_ETH);
- /* Configure PC1, PC4 and PC5 */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5;
- 801051c: 9301 str r3, [sp, #4]
- GPIO_Init(GPIOC, &GPIO_InitStructure);
- 801051e: a901 add r1, sp, #4
- 8010520: f7f9 fc86 bl 8009e30 <GPIO_Init>
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource1, GPIO_AF_ETH);
- 8010524: 4842 ldr r0, [pc, #264] ; (8010630 <ETH_BSP_Config+0x1a0>)
- 8010526: 2101 movs r1, #1
- 8010528: 220b movs r2, #11
- 801052a: f7f9 fcd0 bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
- 801052e: 4840 ldr r0, [pc, #256] ; (8010630 <ETH_BSP_Config+0x1a0>)
- 8010530: 2104 movs r1, #4
- 8010532: 220b movs r2, #11
- 8010534: f7f9 fccb bl 8009ece <GPIO_PinAFConfig>
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
- 8010538: 220b movs r2, #11
- 801053a: 483d ldr r0, [pc, #244] ; (8010630 <ETH_BSP_Config+0x1a0>)
- 801053c: 2105 movs r1, #5
- 801053e: f7f9 fcc6 bl 8009ece <GPIO_PinAFConfig>
- /* Configure the PHY RST pin */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
- 8010542: f44f 5600 mov.w r6, #8192 ; 0x2000
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- 8010546: 2301 movs r3, #1
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- 8010548: 483a ldr r0, [pc, #232] ; (8010634 <ETH_BSP_Config+0x1a4>)
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
- /* Configure the PHY RST pin */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- 801054a: f88d 3008 strb.w r3, [sp, #8]
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- 801054e: a901 add r1, sp, #4
- /* Configure the PHY RST pin */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- 8010550: f88d 300b strb.w r3, [sp, #11]
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource1, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
- GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
- /* Configure the PHY RST pin */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
- 8010554: 9601 str r6, [sp, #4]
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- 8010556: f88d 400a strb.w r4, [sp, #10]
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 801055a: f88d 5009 strb.w r5, [sp, #9]
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- 801055e: f7f9 fc67 bl 8009e30 <GPIO_Init>
- GPIO_ResetBits(GPIOE, GPIO_Pin_13);
- 8010562: 4834 ldr r0, [pc, #208] ; (8010634 <ETH_BSP_Config+0x1a4>)
- 8010564: 4631 mov r1, r6
- 8010566: f7f9 fcb0 bl 8009eca <GPIO_ResetBits>
- for (i = 0; i < 20000; i++);
- 801056a: 9400 str r4, [sp, #0]
- 801056c: f644 631f movw r3, #19999 ; 0x4e1f
- 8010570: e002 b.n 8010578 <ETH_BSP_Config+0xe8>
- 8010572: 9a00 ldr r2, [sp, #0]
- 8010574: 3201 adds r2, #1
- 8010576: 9200 str r2, [sp, #0]
- 8010578: 9a00 ldr r2, [sp, #0]
- 801057a: 429a cmp r2, r3
- 801057c: d9f9 bls.n 8010572 <ETH_BSP_Config+0xe2>
- GPIO_SetBits(GPIOE, GPIO_Pin_13);
- 801057e: 482d ldr r0, [pc, #180] ; (8010634 <ETH_BSP_Config+0x1a4>)
- 8010580: f44f 5100 mov.w r1, #8192 ; 0x2000
- 8010584: f7f9 fc9f bl 8009ec6 <GPIO_SetBits>
- for (i = 0; i < 20000; i++);
- 8010588: 2300 movs r3, #0
- 801058a: 9300 str r3, [sp, #0]
- 801058c: f644 631f movw r3, #19999 ; 0x4e1f
- 8010590: e002 b.n 8010598 <ETH_BSP_Config+0x108>
- 8010592: 9a00 ldr r2, [sp, #0]
- 8010594: 3201 adds r2, #1
- 8010596: 9200 str r2, [sp, #0]
- 8010598: 9a00 ldr r2, [sp, #0]
- 801059a: 429a cmp r2, r3
- 801059c: d9f9 bls.n 8010592 <ETH_BSP_Config+0x102>
- static void ETH_MACDMA_Config(void)
- {
- ETH_InitTypeDef ETH_InitStructure;
- /* Enable ETHERNET clock */
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_ETH_MAC | RCC_AHB1Periph_ETH_MAC_Tx |
- 801059e: f04f 6060 mov.w r0, #234881024 ; 0xe000000
- 80105a2: 2101 movs r1, #1
- 80105a4: f7f9 fcf6 bl 8009f94 <RCC_AHB1PeriphClockCmd>
- RCC_AHB1Periph_ETH_MAC_Rx, ENABLE);
- /* Reset ETHERNET on AHB Bus */
- ETH_DeInit();
- 80105a8: f000 f858 bl 801065c <ETH_DeInit>
- /* Software reset */
- ETH_SoftwareReset();
- 80105ac: f000 f9ec bl 8010988 <ETH_SoftwareReset>
- /* Wait for software reset */
- while (ETH_GetSoftwareResetStatus() == SET);
- 80105b0: f000 f9f2 bl 8010998 <ETH_GetSoftwareResetStatus>
- 80105b4: 2801 cmp r0, #1
- 80105b6: d0fb beq.n 80105b0 <ETH_BSP_Config+0x120>
- /* ETHERNET Configuration --------------------------------------------------*/
- /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
- ETH_StructInit(Ð_InitStructure);
- 80105b8: a803 add r0, sp, #12
- 80105ba: f000 f85c bl 8010676 <ETH_StructInit>
- ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
- // ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
- // ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
- ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
- 80105be: 2300 movs r3, #0
- 80105c0: 930a str r3, [sp, #40] ; 0x28
- ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
- ETH_InitStructure.ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;
- 80105c2: 930e str r3, [sp, #56] ; 0x38
- ETH_InitStructure.ETH_ReceiveAll = ETH_ReceiveAll_Disable;
- 80105c4: 9311 str r3, [sp, #68] ; 0x44
- ETH_InitStructure.ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Enable;
- 80105c6: 9314 str r3, [sp, #80] ; 0x50
- ETH_InitStructure.ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
- 80105c8: 9316 str r3, [sp, #88] ; 0x58
- ETH_InitStructure.ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
- 80105ca: 9317 str r3, [sp, #92] ; 0x5c
- ETH_InitStructure.ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
- 80105cc: 9318 str r3, [sp, #96] ; 0x60
- /*------------------------ DMA -----------------------------------*/
-
- /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
- the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
- if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
- ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
- 80105ce: 9323 str r3, [sp, #140] ; 0x8c
- ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
-
- ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
- 80105d0: 9328 str r3, [sp, #160] ; 0xa0
- ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
- 80105d2: 9329 str r3, [sp, #164] ; 0xa4
- ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
- 80105d4: 2304 movs r3, #4
- 80105d6: 932b str r3, [sp, #172] ; 0xac
- ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
- 80105d8: f44f 3380 mov.w r3, #65536 ; 0x10000
- 80105dc: 932d str r3, [sp, #180] ; 0xb4
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- 80105de: f44f 0380 mov.w r3, #4194304 ; 0x400000
- /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
- ETH_StructInit(Ð_InitStructure);
- /* Fill ETH_InitStructure parametrs */
- /*------------------------ MAC -----------------------------------*/
- ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- 80105e2: 2401 movs r4, #1
- //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
- // ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
- // ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
- ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
- ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
- 80105e4: f44f 7200 mov.w r2, #512 ; 0x200
- /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
- the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
- if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
- ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
- ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
- 80105e8: f44f 1100 mov.w r1, #2097152 ; 0x200000
- ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
- ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
- ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
- ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- 80105ec: 932e str r3, [sp, #184] ; 0xb8
- ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- 80105ee: f44f 5300 mov.w r3, #8192 ; 0x2000
- //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
- // ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
- // ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
- ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
- ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
- 80105f2: 920d str r2, [sp, #52] ; 0x34
- /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
- the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
- if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
- ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
- ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
- 80105f4: 9126 str r1, [sp, #152] ; 0x98
-
- /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
- the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
- if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
- ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
- ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- 80105f6: f04f 7200 mov.w r2, #33554432 ; 0x2000000
- ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
- ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
- ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- 80105fa: 932f str r3, [sp, #188] ; 0xbc
- ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
- /* Configure Ethernet */
- EthInitStatus = ETH_Init(Ð_InitStructure, LAN8720_PHY_ADDRESS);
- 80105fc: 4621 mov r1, r4
- ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
- ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
- 80105fe: f44f 4380 mov.w r3, #16384 ; 0x4000
- /* Configure Ethernet */
- EthInitStatus = ETH_Init(Ð_InitStructure, LAN8720_PHY_ADDRESS);
- 8010602: a803 add r0, sp, #12
- ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
- ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
- 8010604: 9331 str r3, [sp, #196] ; 0xc4
-
- /* When we use the Checksum offload feature, we need to enable the Store and Forward mode:
- the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum,
- if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
- ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;
- ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- 8010606: 9224 str r2, [sp, #144] ; 0x90
- ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
-
- ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
- ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
- ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
- ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- 8010608: 922c str r2, [sp, #176] ; 0xb0
- /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
- ETH_StructInit(Ð_InitStructure);
- /* Fill ETH_InitStructure parametrs */
- /*------------------------ MAC -----------------------------------*/
- ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- 801060a: 9403 str r4, [sp, #12]
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
- /* Configure Ethernet */
- EthInitStatus = ETH_Init(Ð_InitStructure, LAN8720_PHY_ADDRESS);
- 801060c: f000 fa5e bl 8010acc <ETH_Init>
- 8010610: 4d09 ldr r5, [pc, #36] ; (8010638 <ETH_BSP_Config+0x1a8>)
- /* Enable the Ethernet Rx Interrupt */
- ETH_DMAITConfig(ETH_DMA_IT_NIS | ETH_DMA_IT_R, ENABLE);
- 8010612: 4621 mov r1, r4
- ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
- /* Configure Ethernet */
- EthInitStatus = ETH_Init(Ð_InitStructure, LAN8720_PHY_ADDRESS);
- 8010614: 6028 str r0, [r5, #0]
- /* Enable the Ethernet Rx Interrupt */
- ETH_DMAITConfig(ETH_DMA_IT_NIS | ETH_DMA_IT_R, ENABLE);
- 8010616: 4809 ldr r0, [pc, #36] ; (801063c <ETH_BSP_Config+0x1ac>)
- 8010618: f000 f9c6 bl 80109a8 <ETH_DMAITConfig>
- //ETH_NVIC_Config();
- /* Configure the Ethernet MAC/DMA */
- ETH_MACDMA_Config();
- if (EthInitStatus == 0) {
- 801061c: 682b ldr r3, [r5, #0]
- 801061e: b903 cbnz r3, 8010622 <ETH_BSP_Config+0x192>
- 8010620: e7fe b.n 8010620 <ETH_BSP_Config+0x190>
- // LCD_DisplayStringLine(Line5, (uint8_t*)" Ethernet Init ");
- // LCD_DisplayStringLine(Line6, (uint8_t*)" failed ");
- // STM_EVAL_LEDOn(LED5);
- while(1);
- }
- }
- 8010622: b032 add sp, #200 ; 0xc8
- 8010624: bd70 pop {r4, r5, r6, pc}
- 8010626: bf00 nop
- 8010628: 40020000 .word 0x40020000
- 801062c: 40020400 .word 0x40020400
- 8010630: 40020800 .word 0x40020800
- 8010634: 40021000 .word 0x40021000
- 8010638: 20006dac .word 0x20006dac
- 801063c: 00010040 .word 0x00010040
- 08010640 <ETH_Delay>:
- * @brief Inserts a delay time.
- * @param nCount: specifies the delay time length.
- * @retval None
- */
- static void ETH_Delay(__IO uint32_t nCount)
- {
- 8010640: b084 sub sp, #16
- __IO uint32_t index = 0;
- 8010642: 2300 movs r3, #0
- * @brief Inserts a delay time.
- * @param nCount: specifies the delay time length.
- * @retval None
- */
- static void ETH_Delay(__IO uint32_t nCount)
- {
- 8010644: 9001 str r0, [sp, #4]
- __IO uint32_t index = 0;
- 8010646: 9303 str r3, [sp, #12]
- for(index = nCount; index != 0; index--)
- 8010648: 9b01 ldr r3, [sp, #4]
- 801064a: e001 b.n 8010650 <ETH_Delay+0x10>
- 801064c: 9b03 ldr r3, [sp, #12]
- 801064e: 3b01 subs r3, #1
- 8010650: 9303 str r3, [sp, #12]
- 8010652: 9b03 ldr r3, [sp, #12]
- 8010654: 2b00 cmp r3, #0
- 8010656: d1f9 bne.n 801064c <ETH_Delay+0xc>
- {
- }
- }
- 8010658: b004 add sp, #16
- 801065a: 4770 bx lr
- 0801065c <ETH_DeInit>:
- * @brief Deinitializes the ETHERNET peripheral registers to their default reset values.
- * @param None
- * @retval None
- */
- void ETH_DeInit(void)
- {
- 801065c: b508 push {r3, lr}
- RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, ENABLE);
- 801065e: 2101 movs r1, #1
- 8010660: f04f 7000 mov.w r0, #33554432 ; 0x2000000
- 8010664: f7f9 fcba bl 8009fdc <RCC_AHB1PeriphResetCmd>
- RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, DISABLE);
- 8010668: f04f 7000 mov.w r0, #33554432 ; 0x2000000
- 801066c: 2100 movs r1, #0
- }
- 801066e: e8bd 4008 ldmia.w sp!, {r3, lr}
- * @retval None
- */
- void ETH_DeInit(void)
- {
- RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, ENABLE);
- RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, DISABLE);
- 8010672: f7f9 bcb3 b.w 8009fdc <RCC_AHB1PeriphResetCmd>
- 08010676 <ETH_StructInit>:
- /* Ethernet interframe gap set to 96 bits */
- ETH_InitStruct->ETH_InterFrameGap = ETH_InterFrameGap_96Bit;
- /* Carrier Sense Enabled in Half-Duplex mode */
- ETH_InitStruct->ETH_CarrierSense = ETH_CarrierSense_Enable;
- /* PHY speed configured to 100Mbit/s */
- ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
- 8010676: f44f 4280 mov.w r2, #16384 ; 0x4000
- 801067a: 6142 str r2, [r0, #20]
- /* Receive own Frames in Half-Duplex mode enabled */
- ETH_InitStruct->ETH_ReceiveOwn = ETH_ReceiveOwn_Enable;
- /* MAC MII loopback disabled */
- ETH_InitStruct->ETH_LoopbackMode = ETH_LoopbackMode_Disable;
- /* Full-Duplex mode selected */
- ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
- 801067c: f44f 6200 mov.w r2, #2048 ; 0x800
- 8010680: 6202 str r2, [r0, #32]
- /* Receive all frames disabled */
- ETH_InitStruct->ETH_ReceiveAll = ETH_ReceiveAll_Disable;
- /* Source address filtering (on the optional MAC addresses) disabled */
- ETH_InitStruct->ETH_SourceAddrFilter = ETH_SourceAddrFilter_Disable;
- /* Do not forward control frames that do not pass the address filtering */
- ETH_InitStruct->ETH_PassControlFrames = ETH_PassControlFrames_BlockAll;
- 8010682: 2240 movs r2, #64 ; 0x40
- 8010684: 6402 str r2, [r0, #64] ; 0x40
- /* Disable reception of Broadcast frames */
- ETH_InitStruct->ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Disable;
- 8010686: 2220 movs r2, #32
- 8010688: 6442 str r2, [r0, #68] ; 0x44
- /* Initialize hash table high and low regs */
- ETH_InitStruct->ETH_HashTableHigh = 0x0;
- ETH_InitStruct->ETH_HashTableLow = 0x0;
- /* Flow control config (flow control disabled)*/
- ETH_InitStruct->ETH_PauseTime = 0x0;
- ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;
- 801068a: 2280 movs r2, #128 ; 0x80
- {
- /* ETH_InitStruct members default value */
- /*------------------------ MAC Configuration ---------------------------*/
-
- /* PHY Auto-negotiation enabled */
- ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- 801068c: 2301 movs r3, #1
- /* Initialize hash table high and low regs */
- ETH_InitStruct->ETH_HashTableHigh = 0x0;
- ETH_InitStruct->ETH_HashTableLow = 0x0;
- /* Flow control config (flow control disabled)*/
- ETH_InitStruct->ETH_PauseTime = 0x0;
- ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;
- 801068e: 6642 str r2, [r0, #100] ; 0x64
- ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;
-
- /*---------------------- DMA Configuration -------------------------------*/
- /* Drops frames with with TCP/IP checksum errors */
- ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
- 8010690: f04f 6280 mov.w r2, #67108864 ; 0x4000000
- {
- /* ETH_InitStruct members default value */
- /*------------------------ MAC Configuration ---------------------------*/
-
- /* PHY Auto-negotiation enabled */
- ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- 8010694: 6003 str r3, [r0, #0]
- ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;
-
- /*---------------------- DMA Configuration -------------------------------*/
- /* Drops frames with with TCP/IP checksum errors */
- ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
- 8010696: f8c0 2080 str.w r2, [r0, #128] ; 0x80
- /*------------------------ MAC Configuration ---------------------------*/
-
- /* PHY Auto-negotiation enabled */
- ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- /* MAC watchdog enabled: cuts-off long frame */
- ETH_InitStruct->ETH_Watchdog = ETH_Watchdog_Enable;
- 801069a: 2300 movs r3, #0
- /*---------------------- DMA Configuration -------------------------------*/
- /* Drops frames with with TCP/IP checksum errors */
- ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
- /* Store and forward mode enabled for receive */
- ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- 801069c: f04f 7200 mov.w r2, #33554432 ; 0x2000000
- /*------------------------ MAC Configuration ---------------------------*/
-
- /* PHY Auto-negotiation enabled */
- ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
- /* MAC watchdog enabled: cuts-off long frame */
- ETH_InitStruct->ETH_Watchdog = ETH_Watchdog_Enable;
- 80106a0: 6043 str r3, [r0, #4]
- /* MAC Jabber enabled in Half-duplex mode */
- ETH_InitStruct->ETH_Jabber = ETH_Jabber_Enable;
- 80106a2: 6083 str r3, [r0, #8]
- /* Ethernet interframe gap set to 96 bits */
- ETH_InitStruct->ETH_InterFrameGap = ETH_InterFrameGap_96Bit;
- 80106a4: 60c3 str r3, [r0, #12]
- /* Carrier Sense Enabled in Half-Duplex mode */
- ETH_InitStruct->ETH_CarrierSense = ETH_CarrierSense_Enable;
- 80106a6: 6103 str r3, [r0, #16]
- /* PHY speed configured to 100Mbit/s */
- ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
- /* Receive own Frames in Half-Duplex mode enabled */
- ETH_InitStruct->ETH_ReceiveOwn = ETH_ReceiveOwn_Enable;
- 80106a8: 6183 str r3, [r0, #24]
- /* MAC MII loopback disabled */
- ETH_InitStruct->ETH_LoopbackMode = ETH_LoopbackMode_Disable;
- 80106aa: 61c3 str r3, [r0, #28]
- /* Full-Duplex mode selected */
- ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
- /* IPv4 and TCP/UDP/ICMP frame Checksum Offload disabled */
- ETH_InitStruct->ETH_ChecksumOffload = ETH_ChecksumOffload_Disable;
- 80106ac: 6243 str r3, [r0, #36] ; 0x24
- /* Retry Transmission enabled for half-duplex mode */
- ETH_InitStruct->ETH_RetryTransmission = ETH_RetryTransmission_Enable;
- 80106ae: 6283 str r3, [r0, #40] ; 0x28
- /* Automatic PAD/CRC strip disabled*/
- ETH_InitStruct->ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;
- 80106b0: 62c3 str r3, [r0, #44] ; 0x2c
- /* half-duplex mode retransmission Backoff time_limit = 10 slot times*/
- ETH_InitStruct->ETH_BackOffLimit = ETH_BackOffLimit_10;
- 80106b2: 6303 str r3, [r0, #48] ; 0x30
- /* half-duplex mode Deferral check disabled */
- ETH_InitStruct->ETH_DeferralCheck = ETH_DeferralCheck_Disable;
- 80106b4: 6343 str r3, [r0, #52] ; 0x34
- /* Receive all frames disabled */
- ETH_InitStruct->ETH_ReceiveAll = ETH_ReceiveAll_Disable;
- 80106b6: 6383 str r3, [r0, #56] ; 0x38
- /* Source address filtering (on the optional MAC addresses) disabled */
- ETH_InitStruct->ETH_SourceAddrFilter = ETH_SourceAddrFilter_Disable;
- 80106b8: 63c3 str r3, [r0, #60] ; 0x3c
- /* Do not forward control frames that do not pass the address filtering */
- ETH_InitStruct->ETH_PassControlFrames = ETH_PassControlFrames_BlockAll;
- /* Disable reception of Broadcast frames */
- ETH_InitStruct->ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Disable;
- /* Normal Destination address filtering (not reverse addressing) */
- ETH_InitStruct->ETH_DestinationAddrFilter = ETH_DestinationAddrFilter_Normal;
- 80106ba: 6483 str r3, [r0, #72] ; 0x48
- /* Promiscuous address filtering mode disabled */
- ETH_InitStruct->ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
- 80106bc: 64c3 str r3, [r0, #76] ; 0x4c
- /* Perfect address filtering for multicast addresses */
- ETH_InitStruct->ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
- 80106be: 6503 str r3, [r0, #80] ; 0x50
- /* Perfect address filtering for unicast addresses */
- ETH_InitStruct->ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
- 80106c0: 6543 str r3, [r0, #84] ; 0x54
- /* Initialize hash table high and low regs */
- ETH_InitStruct->ETH_HashTableHigh = 0x0;
- 80106c2: 6583 str r3, [r0, #88] ; 0x58
- ETH_InitStruct->ETH_HashTableLow = 0x0;
- 80106c4: 65c3 str r3, [r0, #92] ; 0x5c
- /* Flow control config (flow control disabled)*/
- ETH_InitStruct->ETH_PauseTime = 0x0;
- 80106c6: 6603 str r3, [r0, #96] ; 0x60
- ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;
- ETH_InitStruct->ETH_PauseLowThreshold = ETH_PauseLowThreshold_Minus4;
- 80106c8: 6683 str r3, [r0, #104] ; 0x68
- ETH_InitStruct->ETH_UnicastPauseFrameDetect = ETH_UnicastPauseFrameDetect_Disable;
- 80106ca: 66c3 str r3, [r0, #108] ; 0x6c
- ETH_InitStruct->ETH_ReceiveFlowControl = ETH_ReceiveFlowControl_Disable;
- 80106cc: 6703 str r3, [r0, #112] ; 0x70
- ETH_InitStruct->ETH_TransmitFlowControl = ETH_TransmitFlowControl_Disable;
- 80106ce: 6743 str r3, [r0, #116] ; 0x74
- /* VLANtag config (VLAN field not checked) */
- ETH_InitStruct->ETH_VLANTagComparison = ETH_VLANTagComparison_16Bit;
- 80106d0: 6783 str r3, [r0, #120] ; 0x78
- ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;
- 80106d2: 67c3 str r3, [r0, #124] ; 0x7c
- /*---------------------- DMA Configuration -------------------------------*/
- /* Drops frames with with TCP/IP checksum errors */
- ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
- /* Store and forward mode enabled for receive */
- ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- 80106d4: f8c0 2084 str.w r2, [r0, #132] ; 0x84
- ETH_InitStruct->ETH_ReceiveThresholdControl = ETH_ReceiveThresholdControl_64Bytes;
- /* Disable Operate on second frame (transmit a second frame to FIFO without
- waiting status of previous frame*/
- ETH_InitStruct->ETH_SecondFrameOperate = ETH_SecondFrameOperate_Disable;
- /* DMA works on 32-bit aligned start source and destinations addresses */
- ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- 80106d8: f8c0 20a4 str.w r2, [r0, #164] ; 0xa4
- /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
- ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
- 80106dc: f44f 3280 mov.w r2, #65536 ; 0x10000
- 80106e0: f8c0 20a8 str.w r2, [r0, #168] ; 0xa8
- /* DMA transfer max burst length = 32 beats = 32 x 32bits */
- ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- 80106e4: f44f 0280 mov.w r2, #4194304 ; 0x400000
- /* Store and forward mode enabled for receive */
- ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- /* Flush received frame that created FIFO overflow */
- ETH_InitStruct->ETH_FlushReceivedFrame = ETH_FlushReceivedFrame_Enable;
- /* Store and forward mode enabled for transmit */
- ETH_InitStruct->ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
- 80106e8: f44f 1100 mov.w r1, #2097152 ; 0x200000
- /* DMA works on 32-bit aligned start source and destinations addresses */
- ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
- ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
- /* DMA transfer max burst length = 32 beats = 32 x 32bits */
- ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- 80106ec: f8c0 20ac str.w r2, [r0, #172] ; 0xac
- ETH_InitStruct->ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- 80106f0: f44f 5200 mov.w r2, #8192 ; 0x2000
- /* Drops frames with with TCP/IP checksum errors */
- ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable;
- /* Store and forward mode enabled for receive */
- ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;
- /* Flush received frame that created FIFO overflow */
- ETH_InitStruct->ETH_FlushReceivedFrame = ETH_FlushReceivedFrame_Enable;
- 80106f4: f8c0 3088 str.w r3, [r0, #136] ; 0x88
- /* Store and forward mode enabled for transmit */
- ETH_InitStruct->ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;
- 80106f8: f8c0 108c str.w r1, [r0, #140] ; 0x8c
- /* Threshold TXFIFO level set to 64 bytes (used when threshold mode is enabled) */
- ETH_InitStruct->ETH_TransmitThresholdControl = ETH_TransmitThresholdControl_64Bytes;
- 80106fc: f8c0 3090 str.w r3, [r0, #144] ; 0x90
- /* Disable forwarding frames with errors (short frames, CRC,...)*/
- ETH_InitStruct->ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;
- 8010700: f8c0 3094 str.w r3, [r0, #148] ; 0x94
- /* Disable undersized good frames */
- ETH_InitStruct->ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;
- 8010704: f8c0 3098 str.w r3, [r0, #152] ; 0x98
- /* Threshold RXFIFO level set to 64 bytes (used when Cut-through mode is enabled) */
- ETH_InitStruct->ETH_ReceiveThresholdControl = ETH_ReceiveThresholdControl_64Bytes;
- 8010708: f8c0 309c str.w r3, [r0, #156] ; 0x9c
- /* Disable Operate on second frame (transmit a second frame to FIFO without
- waiting status of previous frame*/
- ETH_InitStruct->ETH_SecondFrameOperate = ETH_SecondFrameOperate_Disable;
- 801070c: f8c0 30a0 str.w r3, [r0, #160] ; 0xa0
- ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
- /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
- ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
- /* DMA transfer max burst length = 32 beats = 32 x 32bits */
- ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
- ETH_InitStruct->ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
- 8010710: f8c0 20b0 str.w r2, [r0, #176] ; 0xb0
- /* DMA Ring mode skip length = 0 */
- ETH_InitStruct->ETH_DescriptorSkipLength = 0x0;
- 8010714: f8c0 30b4 str.w r3, [r0, #180] ; 0xb4
- /* Equal priority (round-robin) between transmit and receive DMA engines */
- ETH_InitStruct->ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_1_1;
- 8010718: f8c0 30b8 str.w r3, [r0, #184] ; 0xb8
- 801071c: 4770 bx lr
- 801071e: 0000 movs r0, r0
- 08010720 <ETH_MACTransmissionCmd>:
- * @param NewState: new state of the MAC transmission.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void ETH_MACTransmissionCmd(FunctionalState NewState)
- {
- 8010720: 4b04 ldr r3, [pc, #16] ; (8010734 <ETH_MACTransmissionCmd+0x14>)
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the MAC transmission */
- ETH->MACCR |= ETH_MACCR_TE;
- 8010722: 681a ldr r2, [r3, #0]
- void ETH_MACTransmissionCmd(FunctionalState NewState)
- {
- /* Check the parameters */
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 8010724: b110 cbz r0, 801072c <ETH_MACTransmissionCmd+0xc>
- {
- /* Enable the MAC transmission */
- ETH->MACCR |= ETH_MACCR_TE;
- 8010726: f042 0208 orr.w r2, r2, #8
- 801072a: e001 b.n 8010730 <ETH_MACTransmissionCmd+0x10>
- }
- else
- {
- /* Disable the MAC transmission */
- ETH->MACCR &= ~ETH_MACCR_TE;
- 801072c: f022 0208 bic.w r2, r2, #8
- 8010730: 601a str r2, [r3, #0]
- 8010732: 4770 bx lr
- 8010734: 40028000 .word 0x40028000
- 08010738 <ETH_MACReceptionCmd>:
- * @param NewState: new state of the MAC reception.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void ETH_MACReceptionCmd(FunctionalState NewState)
- {
- 8010738: 4b04 ldr r3, [pc, #16] ; (801074c <ETH_MACReceptionCmd+0x14>)
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the MAC reception */
- ETH->MACCR |= ETH_MACCR_RE;
- 801073a: 681a ldr r2, [r3, #0]
- void ETH_MACReceptionCmd(FunctionalState NewState)
- {
- /* Check the parameters */
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 801073c: b110 cbz r0, 8010744 <ETH_MACReceptionCmd+0xc>
- {
- /* Enable the MAC reception */
- ETH->MACCR |= ETH_MACCR_RE;
- 801073e: f042 0204 orr.w r2, r2, #4
- 8010742: e001 b.n 8010748 <ETH_MACReceptionCmd+0x10>
- }
- else
- {
- /* Disable the MAC reception */
- ETH->MACCR &= ~ETH_MACCR_RE;
- 8010744: f022 0204 bic.w r2, r2, #4
- 8010748: 601a str r2, [r3, #0]
- 801074a: 4770 bx lr
- 801074c: 40028000 .word 0x40028000
- 08010750 <ETH_MACAddressConfig>:
- uint32_t tmpreg;
- /* Check the parameters */
- assert_param(IS_ETH_MAC_ADDRESS0123(MacAddr));
-
- /* Calculate the selected MAC address high register */
- tmpreg = ((uint32_t)Addr[5] << 8) | (uint32_t)Addr[4];
- 8010750: 790b ldrb r3, [r1, #4]
- 8010752: 794a ldrb r2, [r1, #5]
- 8010754: ea43 2202 orr.w r2, r3, r2, lsl #8
- /* Load the selected MAC address high register */
- (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) = tmpreg;
- 8010758: 4b07 ldr r3, [pc, #28] ; (8010778 <ETH_MACAddressConfig+0x28>)
- 801075a: 50c2 str r2, [r0, r3]
- /* Calculate the selected MAC address low register */
- tmpreg = ((uint32_t)Addr[3] << 24) | ((uint32_t)Addr[2] << 16) | ((uint32_t)Addr[1] << 8) | Addr[0];
- 801075c: 788a ldrb r2, [r1, #2]
- 801075e: 78cb ldrb r3, [r1, #3]
- 8010760: 0412 lsls r2, r2, #16
- 8010762: ea42 6203 orr.w r2, r2, r3, lsl #24
- 8010766: 780b ldrb r3, [r1, #0]
- 8010768: 431a orrs r2, r3
- 801076a: 784b ldrb r3, [r1, #1]
- 801076c: ea42 2203 orr.w r2, r2, r3, lsl #8
-
- /* Load the selected MAC address low register */
- (*(__IO uint32_t *) (ETH_MAC_ADDR_LBASE + MacAddr)) = tmpreg;
- 8010770: 4b02 ldr r3, [pc, #8] ; (801077c <ETH_MACAddressConfig+0x2c>)
- 8010772: 50c2 str r2, [r0, r3]
- 8010774: 4770 bx lr
- 8010776: bf00 nop
- 8010778: 40028040 .word 0x40028040
- 801077c: 40028044 .word 0x40028044
- 08010780 <ETH_Get_Received_Frame>:
- {
- uint32_t framelength = 0;
- FrameTypeDef frame = {0,0,0};
-
- /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
- framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
- 8010780: 490a ldr r1, [pc, #40] ; (80107ac <ETH_Get_Received_Frame+0x2c>)
- frame.length = framelength;
-
- /* Get the address of the buffer start address */
- /* Check if more than one segment in the frame */
- if (DMA_RX_FRAME_infos->Seg_Count >1)
- 8010782: 4a0b ldr r2, [pc, #44] ; (80107b0 <ETH_Get_Received_Frame+0x30>)
- {
- uint32_t framelength = 0;
- FrameTypeDef frame = {0,0,0};
-
- /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
- framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
- 8010784: 680b ldr r3, [r1, #0]
- frame.length = framelength;
-
- /* Get the address of the buffer start address */
- /* Check if more than one segment in the frame */
- if (DMA_RX_FRAME_infos->Seg_Count >1)
- 8010786: 6812 ldr r2, [r2, #0]
- /* Chained Mode */
- /* Selects the next DMA Rx descriptor list for next buffer to read */
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
-
- /* Return Frame */
- return (frame);
- 8010788: 6083 str r3, [r0, #8]
- * with polling method only).
- * @param none
- * @retval Structure of type FrameTypeDef
- */
- FrameTypeDef ETH_Get_Received_Frame(void)
- {
- 801078a: b530 push {r4, r5, lr}
- uint32_t framelength = 0;
- FrameTypeDef frame = {0,0,0};
-
- /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
- framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
- 801078c: 681d ldr r5, [r3, #0]
- frame.length = framelength;
-
- /* Get the address of the buffer start address */
- /* Check if more than one segment in the frame */
- if (DMA_RX_FRAME_infos->Seg_Count >1)
- 801078e: 6894 ldr r4, [r2, #8]
- {
- uint32_t framelength = 0;
- FrameTypeDef frame = {0,0,0};
-
- /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
- framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
- 8010790: f3c5 450d ubfx r5, r5, #16, #14
- 8010794: 3d04 subs r5, #4
- frame.length = framelength;
-
- /* Get the address of the buffer start address */
- /* Check if more than one segment in the frame */
- if (DMA_RX_FRAME_infos->Seg_Count >1)
- 8010796: 2c01 cmp r4, #1
- {
- frame.buffer =(DMA_RX_FRAME_infos->FS_Rx_Desc)->Buffer1Addr;
- 8010798: bf8a itet hi
- 801079a: 6812 ldrhi r2, [r2, #0]
- }
- else
- {
- frame.buffer = DMARxDescToGet->Buffer1Addr;
- 801079c: 689a ldrls r2, [r3, #8]
-
- /* Get the address of the buffer start address */
- /* Check if more than one segment in the frame */
- if (DMA_RX_FRAME_infos->Seg_Count >1)
- {
- frame.buffer =(DMA_RX_FRAME_infos->FS_Rx_Desc)->Buffer1Addr;
- 801079e: 6892 ldrhi r2, [r2, #8]
- frame.descriptor = DMARxDescToGet;
-
- /* Update the ETHERNET DMA global Rx descriptor with next Rx descriptor */
- /* Chained Mode */
- /* Selects the next DMA Rx descriptor list for next buffer to read */
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
- 80107a0: 68dc ldr r4, [r3, #12]
-
- /* Return Frame */
- return (frame);
- 80107a2: 6005 str r5, [r0, #0]
- frame.descriptor = DMARxDescToGet;
-
- /* Update the ETHERNET DMA global Rx descriptor with next Rx descriptor */
- /* Chained Mode */
- /* Selects the next DMA Rx descriptor list for next buffer to read */
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
- 80107a4: 600c str r4, [r1, #0]
-
- /* Return Frame */
- return (frame);
- 80107a6: 6042 str r2, [r0, #4]
- }
- 80107a8: bd30 pop {r4, r5, pc}
- 80107aa: bf00 nop
- 80107ac: 20008cbc .word 0x20008cbc
- 80107b0: 2000ab2c .word 0x2000ab2c
- 080107b4 <ETH_Prepare_Transmit_Descriptors>:
- {
- uint32_t buf_count =0, size=0,i=0;
- __IO ETH_DMADESCTypeDef *DMATxNextDesc;
-
- /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
- if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
- 80107b4: 4b29 ldr r3, [pc, #164] ; (801085c <ETH_Prepare_Transmit_Descriptors+0xa8>)
- 80107b6: 681b ldr r3, [r3, #0]
- 80107b8: 681a ldr r2, [r3, #0]
- 80107ba: 2a00 cmp r2, #0
- * @brief Prepares DMA Tx descriptors to transmit an ethernet frame
- * @param FrameLength : length of the frame to send
- * @retval error status
- */
- uint32_t ETH_Prepare_Transmit_Descriptors(u16 FrameLength)
- {
- 80107bc: b5f0 push {r4, r5, r6, r7, lr}
- uint32_t buf_count =0, size=0,i=0;
- __IO ETH_DMADESCTypeDef *DMATxNextDesc;
-
- /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
- if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
- 80107be: db48 blt.n 8010852 <ETH_Prepare_Transmit_Descriptors+0x9e>
- return ETH_ERROR;
- }
-
- DMATxNextDesc = DMATxDescToSet;
-
- if (FrameLength > ETH_TX_BUF_SIZE)
- 80107c0: f240 52f4 movw r2, #1524 ; 0x5f4
- 80107c4: 4290 cmp r0, r2
- 80107c6: d917 bls.n 80107f8 <ETH_Prepare_Transmit_Descriptors+0x44>
- {
- buf_count = FrameLength/ETH_TX_BUF_SIZE;
- 80107c8: fbb0 f4f2 udiv r4, r0, r2
- if (FrameLength%ETH_TX_BUF_SIZE) buf_count++;
- 80107cc: fb02 0214 mls r2, r2, r4, r0
- 80107d0: b292 uxth r2, r2
-
- DMATxNextDesc = DMATxDescToSet;
-
- if (FrameLength > ETH_TX_BUF_SIZE)
- {
- buf_count = FrameLength/ETH_TX_BUF_SIZE;
- 80107d2: b2a1 uxth r1, r4
- if (FrameLength%ETH_TX_BUF_SIZE) buf_count++;
- 80107d4: b10a cbz r2, 80107da <ETH_Prepare_Transmit_Descriptors+0x26>
- 80107d6: 3101 adds r1, #1
- 80107d8: e001 b.n 80107de <ETH_Prepare_Transmit_Descriptors+0x2a>
- }
- else buf_count =1;
-
- if (buf_count ==1)
- 80107da: 2901 cmp r1, #1
- 80107dc: d00c beq.n 80107f8 <ETH_Prepare_Transmit_Descriptors+0x44>
-
- if (i== (buf_count-1))
- {
- /* Setting the last segment bit */
- DMATxNextDesc->Status |= ETH_DMATxDesc_LS;
- size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
- 80107de: 4d20 ldr r5, [pc, #128] ; (8010860 <ETH_Prepare_Transmit_Descriptors+0xac>)
- 80107e0: f200 50f4 addw r0, r0, #1524 ; 0x5f4
- 80107e4: fb05 0501 mla r5, r5, r1, r0
- DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
- 80107e8: 04ed lsls r5, r5, #19
- 80107ea: 0ced lsrs r5, r5, #19
- 80107ec: 461a mov r2, r3
- 80107ee: 2000 movs r0, #0
- /* Setting the first segment bit */
- DMATxDescToSet->Status |= ETH_DMATxDesc_FS;
- }
-
- /* Program size */
- DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
- 80107f0: f240 56f4 movw r6, #1524 ; 0x5f4
-
- if (i== (buf_count-1))
- 80107f4: 1e4f subs r7, r1, #1
- 80107f6: e00c b.n 8010812 <ETH_Prepare_Transmit_Descriptors+0x5e>
- else buf_count =1;
-
- if (buf_count ==1)
- {
- /*set LAST and FIRST segment */
- DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
- 80107f8: 681a ldr r2, [r3, #0]
- /* Set frame size */
- DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
- 80107fa: 04c0 lsls r0, r0, #19
- else buf_count =1;
-
- if (buf_count ==1)
- {
- /*set LAST and FIRST segment */
- DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
- 80107fc: f042 5240 orr.w r2, r2, #805306368 ; 0x30000000
- /* Set frame size */
- DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
- 8010800: 0cc0 lsrs r0, r0, #19
- else buf_count =1;
-
- if (buf_count ==1)
- {
- /*set LAST and FIRST segment */
- DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
- 8010802: 601a str r2, [r3, #0]
- /* Set frame size */
- DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
- 8010804: 6058 str r0, [r3, #4]
- /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
- DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
- 8010806: 681a ldr r2, [r3, #0]
- 8010808: f042 4200 orr.w r2, r2, #2147483648 ; 0x80000000
- 801080c: 601a str r2, [r3, #0]
- DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
- 801080e: 68da ldr r2, [r3, #12]
- 8010810: e014 b.n 801083c <ETH_Prepare_Transmit_Descriptors+0x88>
- }
- else
- {
- for (i=0; i< buf_count; i++)
- {
- if (i==0)
- 8010812: b918 cbnz r0, 801081c <ETH_Prepare_Transmit_Descriptors+0x68>
- {
- /* Setting the first segment bit */
- DMATxDescToSet->Status |= ETH_DMATxDesc_FS;
- 8010814: 681c ldr r4, [r3, #0]
- 8010816: f044 5480 orr.w r4, r4, #268435456 ; 0x10000000
- 801081a: 601c str r4, [r3, #0]
- }
-
- /* Program size */
- DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
-
- if (i== (buf_count-1))
- 801081c: 42b8 cmp r0, r7
- /* Setting the first segment bit */
- DMATxDescToSet->Status |= ETH_DMATxDesc_FS;
- }
-
- /* Program size */
- DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
- 801081e: 6056 str r6, [r2, #4]
-
- if (i== (buf_count-1))
- 8010820: d104 bne.n 801082c <ETH_Prepare_Transmit_Descriptors+0x78>
- {
- /* Setting the last segment bit */
- DMATxNextDesc->Status |= ETH_DMATxDesc_LS;
- 8010822: 6814 ldr r4, [r2, #0]
- 8010824: f044 5400 orr.w r4, r4, #536870912 ; 0x20000000
- 8010828: 6014 str r4, [r2, #0]
- size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
- DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
- 801082a: 6055 str r5, [r2, #4]
- }
-
- /*give back descriptor to DMA */
- DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
- 801082c: 6814 ldr r4, [r2, #0]
- DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
- DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
- }
- else
- {
- for (i=0; i< buf_count; i++)
- 801082e: 3001 adds r0, #1
- size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
- DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
- }
-
- /*give back descriptor to DMA */
- DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
- 8010830: f044 4400 orr.w r4, r4, #2147483648 ; 0x80000000
- 8010834: 6014 str r4, [r2, #0]
- DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
- DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
- }
- else
- {
- for (i=0; i< buf_count; i++)
- 8010836: 4288 cmp r0, r1
- }
-
- /*give back descriptor to DMA */
- DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
-
- DMATxNextDesc = (ETH_DMADESCTypeDef *)(DMATxNextDesc->Buffer2NextDescAddr);
- 8010838: 68d2 ldr r2, [r2, #12]
- DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
- DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
- }
- else
- {
- for (i=0; i< buf_count; i++)
- 801083a: d3ea bcc.n 8010812 <ETH_Prepare_Transmit_Descriptors+0x5e>
- DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
-
- DMATxNextDesc = (ETH_DMADESCTypeDef *)(DMATxNextDesc->Buffer2NextDescAddr);
- /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
- }
- DMATxDescToSet = DMATxNextDesc ;
- 801083c: 4b07 ldr r3, [pc, #28] ; (801085c <ETH_Prepare_Transmit_Descriptors+0xa8>)
- 801083e: 601a str r2, [r3, #0]
- }
-
- /* When Tx Buffer unavailable flag is set: clear it and resume transmission */
- if ((ETH->DMASR & ETH_DMASR_TBUS) != (u32)RESET)
- 8010840: 4b08 ldr r3, [pc, #32] ; (8010864 <ETH_Prepare_Transmit_Descriptors+0xb0>)
- 8010842: 695a ldr r2, [r3, #20]
- 8010844: 0750 lsls r0, r2, #29
- 8010846: d506 bpl.n 8010856 <ETH_Prepare_Transmit_Descriptors+0xa2>
- {
- /* Clear TBUS ETHERNET DMA flag */
- ETH->DMASR = ETH_DMASR_TBUS;
- 8010848: 2204 movs r2, #4
- 801084a: 615a str r2, [r3, #20]
- /* Resume DMA transmission*/
- ETH->DMATPDR = 0;
- 801084c: 2200 movs r2, #0
- 801084e: 605a str r2, [r3, #4]
- 8010850: e001 b.n 8010856 <ETH_Prepare_Transmit_Descriptors+0xa2>
-
- /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
- if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
- {
- /* Return ERROR: OWN bit set */
- return ETH_ERROR;
- 8010852: 2000 movs r0, #0
- 8010854: bdf0 pop {r4, r5, r6, r7, pc}
- /* Resume DMA transmission*/
- ETH->DMATPDR = 0;
- }
-
- /* Return SUCCESS */
- return ETH_SUCCESS;
- 8010856: 2001 movs r0, #1
- }
- 8010858: bdf0 pop {r4, r5, r6, r7, pc}
- 801085a: bf00 nop
- 801085c: 20008cc0 .word 0x20008cc0
- 8010860: fffffa0c .word 0xfffffa0c
- 8010864: 40029000 .word 0x40029000
- 08010868 <ETH_DMARxDescChainInit>:
- {
- uint32_t i = 0;
- ETH_DMADESCTypeDef *DMARxDesc;
-
- /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
- DMARxDescToGet = DMARxDescTab;
- 8010868: 4b11 ldr r3, [pc, #68] ; (80108b0 <ETH_DMARxDescChainInit+0x48>)
- * @param RxBuff: Pointer on the first RxBuffer list
- * @param RxBuffCount: Number of the used Rx desc in the list
- * @retval None
- */
- void ETH_DMARxDescChainInit(ETH_DMADESCTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount)
- {
- 801086a: b5f0 push {r4, r5, r6, r7, lr}
- uint32_t i = 0;
- ETH_DMADESCTypeDef *DMARxDesc;
-
- /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
- DMARxDescToGet = DMARxDescTab;
- 801086c: 6018 str r0, [r3, #0]
- /* Fill each DMARxDesc descriptor with the right values */
- for(i=0; i < RxBuffCount; i++)
- 801086e: 2400 movs r4, #0
- * @param DMARxDescTab: Pointer on the first Rx desc list
- * @param RxBuff: Pointer on the first RxBuffer list
- * @param RxBuffCount: Number of the used Rx desc in the list
- * @retval None
- */
- void ETH_DMARxDescChainInit(ETH_DMADESCTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount)
- 8010870: f100 0320 add.w r3, r0, #32
- for(i=0; i < RxBuffCount; i++)
- {
- /* Get the pointer on the ith member of the Rx Desc list */
- DMARxDesc = DMARxDescTab+i;
- /* Set Own bit of the Rx descriptor Status */
- DMARxDesc->Status = ETH_DMARxDesc_OWN;
- 8010874: f04f 4500 mov.w r5, #2147483648 ; 0x80000000
- /* Set Buffer1 size and Second Address Chained bit */
- DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;
- 8010878: f244 56f4 movw r6, #17908 ; 0x45f4
- /* Set Buffer1 address pointer */
- DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i*ETH_RX_BUF_SIZE]);
-
- /* Initialize the next descriptor with the Next Descriptor Polling Enable */
- if(i < (RxBuffCount-1))
- 801087c: 1e57 subs r7, r2, #1
- ETH_DMADESCTypeDef *DMARxDesc;
-
- /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
- DMARxDescToGet = DMARxDescTab;
- /* Fill each DMARxDesc descriptor with the right values */
- for(i=0; i < RxBuffCount; i++)
- 801087e: e00f b.n 80108a0 <ETH_DMARxDescChainInit+0x38>
-
- /* Initialize the next descriptor with the Next Descriptor Polling Enable */
- if(i < (RxBuffCount-1))
- {
- /* Set next descriptor address register with next descriptor base address */
- DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab+i+1);
- 8010880: 42bc cmp r4, r7
- 8010882: bf2c ite cs
- 8010884: 4684 movcs ip, r0
- 8010886: 469c movcc ip, r3
- DMARxDesc->Status = ETH_DMARxDesc_OWN;
- /* Set Buffer1 size and Second Address Chained bit */
- DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;
- /* Set Buffer1 address pointer */
- DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i*ETH_RX_BUF_SIZE]);
- 8010888: f843 1c18 str.w r1, [r3, #-24]
- for(i=0; i < RxBuffCount; i++)
- {
- /* Get the pointer on the ith member of the Rx Desc list */
- DMARxDesc = DMARxDescTab+i;
- /* Set Own bit of the Rx descriptor Status */
- DMARxDesc->Status = ETH_DMARxDesc_OWN;
- 801088c: f843 5c20 str.w r5, [r3, #-32]
- /* Set Buffer1 size and Second Address Chained bit */
- DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;
- 8010890: f843 6c1c str.w r6, [r3, #-28]
-
- /* Initialize the next descriptor with the Next Descriptor Polling Enable */
- if(i < (RxBuffCount-1))
- {
- /* Set next descriptor address register with next descriptor base address */
- DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab+i+1);
- 8010894: f843 cc14 str.w ip, [r3, #-20]
- ETH_DMADESCTypeDef *DMARxDesc;
-
- /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
- DMARxDescToGet = DMARxDescTab;
- /* Fill each DMARxDesc descriptor with the right values */
- for(i=0; i < RxBuffCount; i++)
- 8010898: 3401 adds r4, #1
- 801089a: 3320 adds r3, #32
- 801089c: f201 51f4 addw r1, r1, #1524 ; 0x5f4
- 80108a0: 4294 cmp r4, r2
- 80108a2: d1ed bne.n 8010880 <ETH_DMARxDescChainInit+0x18>
- DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab);
- }
- }
-
- /* Set Receive Descriptor List Address Register */
- ETH->DMARDLAR = (uint32_t) DMARxDescTab;
- 80108a4: 4b03 ldr r3, [pc, #12] ; (80108b4 <ETH_DMARxDescChainInit+0x4c>)
-
- DMA_RX_FRAME_infos = &RX_Frame_Descriptor;
- 80108a6: 4a04 ldr r2, [pc, #16] ; (80108b8 <ETH_DMARxDescChainInit+0x50>)
- DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab);
- }
- }
-
- /* Set Receive Descriptor List Address Register */
- ETH->DMARDLAR = (uint32_t) DMARxDescTab;
- 80108a8: 60d8 str r0, [r3, #12]
-
- DMA_RX_FRAME_infos = &RX_Frame_Descriptor;
- 80108aa: 4b04 ldr r3, [pc, #16] ; (80108bc <ETH_DMARxDescChainInit+0x54>)
- 80108ac: 601a str r2, [r3, #0]
- 80108ae: bdf0 pop {r4, r5, r6, r7, pc}
- 80108b0: 20008cbc .word 0x20008cbc
- 80108b4: 40029000 .word 0x40029000
- 80108b8: 20008cb0 .word 0x20008cb0
- 80108bc: 2000ab2c .word 0x2000ab2c
- 080108c0 <ETH_CheckFrameReceived>:
- * @retval Returns 1 when a frame is received, 0 if none.
- */
- uint32_t ETH_CheckFrameReceived(void)
- {
- /* check if last segment */
- if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- 80108c0: 4b1c ldr r3, [pc, #112] ; (8010934 <ETH_CheckFrameReceived+0x74>)
- 80108c2: 681b ldr r3, [r3, #0]
- 80108c4: 681a ldr r2, [r3, #0]
- 80108c6: 2a00 cmp r2, #0
- 80108c8: db0a blt.n 80108e0 <ETH_CheckFrameReceived+0x20>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) != (uint32_t)RESET))
- 80108ca: 681a ldr r2, [r3, #0]
- * @retval Returns 1 when a frame is received, 0 if none.
- */
- uint32_t ETH_CheckFrameReceived(void)
- {
- /* check if last segment */
- if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- 80108cc: 05d1 lsls r1, r2, #23
- 80108ce: d507 bpl.n 80108e0 <ETH_CheckFrameReceived+0x20>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) != (uint32_t)RESET))
- {
- DMA_RX_FRAME_infos->LS_Rx_Desc = DMARxDescToGet;
- 80108d0: 4a19 ldr r2, [pc, #100] ; (8010938 <ETH_CheckFrameReceived+0x78>)
- 80108d2: 6812 ldr r2, [r2, #0]
- 80108d4: 6053 str r3, [r2, #4]
- DMA_RX_FRAME_infos->Seg_Count++;
- 80108d6: 6893 ldr r3, [r2, #8]
- 80108d8: 3301 adds r3, #1
- 80108da: 6093 str r3, [r2, #8]
- return 1;
- 80108dc: 2001 movs r0, #1
- 80108de: 4770 bx lr
- }
-
- /* check if first segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- 80108e0: 681a ldr r2, [r3, #0]
- 80108e2: 2a00 cmp r2, #0
- 80108e4: db10 blt.n 8010908 <ETH_CheckFrameReceived+0x48>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
- 80108e6: 681a ldr r2, [r3, #0]
- DMA_RX_FRAME_infos->Seg_Count++;
- return 1;
- }
-
- /* check if first segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- 80108e8: 0592 lsls r2, r2, #22
- 80108ea: d50d bpl.n 8010908 <ETH_CheckFrameReceived+0x48>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
- 80108ec: 6818 ldr r0, [r3, #0]
- return 1;
- }
-
- /* check if first segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
- 80108ee: f410 7080 ands.w r0, r0, #256 ; 0x100
- 80108f2: d109 bne.n 8010908 <ETH_CheckFrameReceived+0x48>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
- {
- DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
- 80108f4: 4a10 ldr r2, [pc, #64] ; (8010938 <ETH_CheckFrameReceived+0x78>)
- 80108f6: 6812 ldr r2, [r2, #0]
- DMA_RX_FRAME_infos->LS_Rx_Desc = NULL;
- DMA_RX_FRAME_infos->Seg_Count = 1;
- 80108f8: 2101 movs r1, #1
- /* check if first segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
- {
- DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
- 80108fa: 6013 str r3, [r2, #0]
- DMA_RX_FRAME_infos->LS_Rx_Desc = NULL;
- 80108fc: 6050 str r0, [r2, #4]
- DMA_RX_FRAME_infos->Seg_Count = 1;
- 80108fe: 6091 str r1, [r2, #8]
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
- 8010900: 68da ldr r2, [r3, #12]
- 8010902: 4b0c ldr r3, [pc, #48] ; (8010934 <ETH_CheckFrameReceived+0x74>)
- 8010904: 601a str r2, [r3, #0]
- 8010906: 4770 bx lr
- }
-
- /* check if intermediate segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- 8010908: 681a ldr r2, [r3, #0]
- 801090a: 2a00 cmp r2, #0
- 801090c: db0f blt.n 801092e <ETH_CheckFrameReceived+0x6e>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
- 801090e: 6818 ldr r0, [r3, #0]
- DMA_RX_FRAME_infos->Seg_Count = 1;
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
- }
-
- /* check if intermediate segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- 8010910: f410 7000 ands.w r0, r0, #512 ; 0x200
- 8010914: d10b bne.n 801092e <ETH_CheckFrameReceived+0x6e>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
- 8010916: 681a ldr r2, [r3, #0]
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
- }
-
- /* check if intermediate segment */
- else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
- ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
- 8010918: f412 7180 ands.w r1, r2, #256 ; 0x100
- 801091c: d108 bne.n 8010930 <ETH_CheckFrameReceived+0x70>
- ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
- {
- (DMA_RX_FRAME_infos->Seg_Count) ++;
- 801091e: 4a06 ldr r2, [pc, #24] ; (8010938 <ETH_CheckFrameReceived+0x78>)
- 8010920: 6812 ldr r2, [r2, #0]
- 8010922: 6890 ldr r0, [r2, #8]
- 8010924: 3001 adds r0, #1
- 8010926: 6090 str r0, [r2, #8]
- DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
- 8010928: 68da ldr r2, [r3, #12]
- 801092a: 4b02 ldr r3, [pc, #8] ; (8010934 <ETH_CheckFrameReceived+0x74>)
- 801092c: 601a str r2, [r3, #0]
- }
- return 0;
- 801092e: 2000 movs r0, #0
- }
- 8010930: 4770 bx lr
- 8010932: bf00 nop
- 8010934: 20008cbc .word 0x20008cbc
- 8010938: 2000ab2c .word 0x2000ab2c
- 0801093c <ETH_DMATxDescChainInit>:
- {
- uint32_t i = 0;
- ETH_DMADESCTypeDef *DMATxDesc;
-
- /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
- DMATxDescToSet = DMATxDescTab;
- 801093c: 4b0e ldr r3, [pc, #56] ; (8010978 <ETH_DMATxDescChainInit+0x3c>)
- * @param TxBuff: Pointer on the first TxBuffer list
- * @param TxBuffCount: Number of the used Tx desc in the list
- * @retval None
- */
- void ETH_DMATxDescChainInit(ETH_DMADESCTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount)
- {
- 801093e: b5f0 push {r4, r5, r6, r7, lr}
- uint32_t i = 0;
- ETH_DMADESCTypeDef *DMATxDesc;
-
- /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
- DMATxDescToSet = DMATxDescTab;
- 8010940: 6018 str r0, [r3, #0]
- /* Fill each DMATxDesc descriptor with the right values */
- for(i=0; i < TxBuffCount; i++)
- 8010942: 2400 movs r4, #0
- * @param DMATxDescTab: Pointer on the first Tx desc list
- * @param TxBuff: Pointer on the first TxBuffer list
- * @param TxBuffCount: Number of the used Tx desc in the list
- * @retval None
- */
- void ETH_DMATxDescChainInit(ETH_DMADESCTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount)
- 8010944: f100 0320 add.w r3, r0, #32
- for(i=0; i < TxBuffCount; i++)
- {
- /* Get the pointer on the ith member of the Tx Desc list */
- DMATxDesc = DMATxDescTab + i;
- /* Set Second Address Chained bit */
- DMATxDesc->Status = ETH_DMATxDesc_TCH;
- 8010948: f44f 1580 mov.w r5, #1048576 ; 0x100000
-
- /* Set Buffer1 address pointer */
- DMATxDesc->Buffer1Addr = (uint32_t)(&TxBuff[i*ETH_TX_BUF_SIZE]);
-
- /* Initialize the next descriptor with the Next Descriptor Polling Enable */
- if(i < (TxBuffCount-1))
- 801094c: 1e56 subs r6, r2, #1
- ETH_DMADESCTypeDef *DMATxDesc;
-
- /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
- DMATxDescToSet = DMATxDescTab;
- /* Fill each DMATxDesc descriptor with the right values */
- for(i=0; i < TxBuffCount; i++)
- 801094e: e00d b.n 801096c <ETH_DMATxDescChainInit+0x30>
-
- /* Initialize the next descriptor with the Next Descriptor Polling Enable */
- if(i < (TxBuffCount-1))
- {
- /* Set next descriptor address register with next descriptor base address */
- DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1);
- 8010950: 42b4 cmp r4, r6
- 8010952: bf2c ite cs
- 8010954: 4607 movcs r7, r0
- 8010956: 461f movcc r7, r3
- DMATxDesc = DMATxDescTab + i;
- /* Set Second Address Chained bit */
- DMATxDesc->Status = ETH_DMATxDesc_TCH;
-
- /* Set Buffer1 address pointer */
- DMATxDesc->Buffer1Addr = (uint32_t)(&TxBuff[i*ETH_TX_BUF_SIZE]);
- 8010958: f843 1c18 str.w r1, [r3, #-24]
- for(i=0; i < TxBuffCount; i++)
- {
- /* Get the pointer on the ith member of the Tx Desc list */
- DMATxDesc = DMATxDescTab + i;
- /* Set Second Address Chained bit */
- DMATxDesc->Status = ETH_DMATxDesc_TCH;
- 801095c: f843 5c20 str.w r5, [r3, #-32]
-
- /* Initialize the next descriptor with the Next Descriptor Polling Enable */
- if(i < (TxBuffCount-1))
- {
- /* Set next descriptor address register with next descriptor base address */
- DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1);
- 8010960: f843 7c14 str.w r7, [r3, #-20]
- ETH_DMADESCTypeDef *DMATxDesc;
-
- /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
- DMATxDescToSet = DMATxDescTab;
- /* Fill each DMATxDesc descriptor with the right values */
- for(i=0; i < TxBuffCount; i++)
- 8010964: 3401 adds r4, #1
- 8010966: 3320 adds r3, #32
- 8010968: f201 51f4 addw r1, r1, #1524 ; 0x5f4
- 801096c: 4294 cmp r4, r2
- 801096e: d1ef bne.n 8010950 <ETH_DMATxDescChainInit+0x14>
- DMATxDesc->Buffer2NextDescAddr = (uint32_t) DMATxDescTab;
- }
- }
-
- /* Set Transmit Desciptor List Address Register */
- ETH->DMATDLAR = (uint32_t) DMATxDescTab;
- 8010970: 4b02 ldr r3, [pc, #8] ; (801097c <ETH_DMATxDescChainInit+0x40>)
- 8010972: 6118 str r0, [r3, #16]
- 8010974: bdf0 pop {r4, r5, r6, r7, pc}
- 8010976: bf00 nop
- 8010978: 20008cc0 .word 0x20008cc0
- 801097c: 40029000 .word 0x40029000
- 08010980 <ETH_DMATxDescChecksumInsertionConfig>:
- {
- /* Check the parameters */
- assert_param(IS_ETH_DMA_TXDESC_CHECKSUM(DMATxDesc_Checksum));
-
- /* Set the selected DMA Tx desc checksum insertion control */
- DMATxDesc->Status |= DMATxDesc_Checksum;
- 8010980: 6803 ldr r3, [r0, #0]
- 8010982: 4319 orrs r1, r3
- 8010984: 6001 str r1, [r0, #0]
- 8010986: 4770 bx lr
- 08010988 <ETH_SoftwareReset>:
- */
- void ETH_SoftwareReset(void)
- {
- /* Set the SWR bit: resets all MAC subsystem internal registers and logic */
- /* After reset all the registers holds their respective reset values */
- ETH->DMABMR |= ETH_DMABMR_SR;
- 8010988: 4b02 ldr r3, [pc, #8] ; (8010994 <ETH_SoftwareReset+0xc>)
- 801098a: 681a ldr r2, [r3, #0]
- 801098c: f042 0201 orr.w r2, r2, #1
- 8010990: 601a str r2, [r3, #0]
- 8010992: 4770 bx lr
- 8010994: 40029000 .word 0x40029000
- 08010998 <ETH_GetSoftwareResetStatus>:
- * @retval The new state of DMA Bus Mode register SR bit (SET or RESET).
- */
- FlagStatus ETH_GetSoftwareResetStatus(void)
- {
- FlagStatus bitstatus = RESET;
- if((ETH->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
- 8010998: 4b02 ldr r3, [pc, #8] ; (80109a4 <ETH_GetSoftwareResetStatus+0xc>)
- 801099a: 6818 ldr r0, [r3, #0]
- else
- {
- bitstatus = RESET;
- }
- return bitstatus;
- }
- 801099c: f000 0001 and.w r0, r0, #1
- 80109a0: 4770 bx lr
- 80109a2: bf00 nop
- 80109a4: 40029000 .word 0x40029000
- 080109a8 <ETH_DMAITConfig>:
- * @param NewState: new state of the specified ETHERNET DMA interrupts.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void ETH_DMAITConfig(uint32_t ETH_DMA_IT, FunctionalState NewState)
- {
- 80109a8: 4b04 ldr r3, [pc, #16] ; (80109bc <ETH_DMAITConfig+0x14>)
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the selected ETHERNET DMA interrupts */
- ETH->DMAIER |= ETH_DMA_IT;
- 80109aa: 69da ldr r2, [r3, #28]
- {
- /* Check the parameters */
- assert_param(IS_ETH_DMA_IT(ETH_DMA_IT));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 80109ac: b109 cbz r1, 80109b2 <ETH_DMAITConfig+0xa>
- {
- /* Enable the selected ETHERNET DMA interrupts */
- ETH->DMAIER |= ETH_DMA_IT;
- 80109ae: 4310 orrs r0, r2
- 80109b0: e001 b.n 80109b6 <ETH_DMAITConfig+0xe>
- }
- else
- {
- /* Disable the selected ETHERNET DMA interrupts */
- ETH->DMAIER &=(~(uint32_t)ETH_DMA_IT);
- 80109b2: ea22 0000 bic.w r0, r2, r0
- 80109b6: 61d8 str r0, [r3, #28]
- 80109b8: 4770 bx lr
- 80109ba: bf00 nop
- 80109bc: 40029000 .word 0x40029000
- 080109c0 <ETH_FlushTransmitFIFO>:
- * @retval None
- */
- void ETH_FlushTransmitFIFO(void)
- {
- /* Set the Flush Transmit FIFO bit */
- ETH->DMAOMR |= ETH_DMAOMR_FTF;
- 80109c0: 4b02 ldr r3, [pc, #8] ; (80109cc <ETH_FlushTransmitFIFO+0xc>)
- 80109c2: 699a ldr r2, [r3, #24]
- 80109c4: f442 1280 orr.w r2, r2, #1048576 ; 0x100000
- 80109c8: 619a str r2, [r3, #24]
- 80109ca: 4770 bx lr
- 80109cc: 40029000 .word 0x40029000
- 080109d0 <ETH_DMATransmissionCmd>:
- * @param NewState: new state of the DMA transmission.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void ETH_DMATransmissionCmd(FunctionalState NewState)
- {
- 80109d0: 4b04 ldr r3, [pc, #16] ; (80109e4 <ETH_DMATransmissionCmd+0x14>)
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the DMA transmission */
- ETH->DMAOMR |= ETH_DMAOMR_ST;
- 80109d2: 699a ldr r2, [r3, #24]
- void ETH_DMATransmissionCmd(FunctionalState NewState)
- {
- /* Check the parameters */
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 80109d4: b110 cbz r0, 80109dc <ETH_DMATransmissionCmd+0xc>
- {
- /* Enable the DMA transmission */
- ETH->DMAOMR |= ETH_DMAOMR_ST;
- 80109d6: f442 5200 orr.w r2, r2, #8192 ; 0x2000
- 80109da: e001 b.n 80109e0 <ETH_DMATransmissionCmd+0x10>
- }
- else
- {
- /* Disable the DMA transmission */
- ETH->DMAOMR &= ~ETH_DMAOMR_ST;
- 80109dc: f422 5200 bic.w r2, r2, #8192 ; 0x2000
- 80109e0: 619a str r2, [r3, #24]
- 80109e2: 4770 bx lr
- 80109e4: 40029000 .word 0x40029000
- 080109e8 <ETH_DMAReceptionCmd>:
- * @param NewState: new state of the DMA reception.
- * This parameter can be: ENABLE or DISABLE.
- * @retval None
- */
- void ETH_DMAReceptionCmd(FunctionalState NewState)
- {
- 80109e8: 4b04 ldr r3, [pc, #16] ; (80109fc <ETH_DMAReceptionCmd+0x14>)
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- {
- /* Enable the DMA reception */
- ETH->DMAOMR |= ETH_DMAOMR_SR;
- 80109ea: 699a ldr r2, [r3, #24]
- void ETH_DMAReceptionCmd(FunctionalState NewState)
- {
- /* Check the parameters */
- assert_param(IS_FUNCTIONAL_STATE(NewState));
-
- if (NewState != DISABLE)
- 80109ec: b110 cbz r0, 80109f4 <ETH_DMAReceptionCmd+0xc>
- {
- /* Enable the DMA reception */
- ETH->DMAOMR |= ETH_DMAOMR_SR;
- 80109ee: f042 0202 orr.w r2, r2, #2
- 80109f2: e001 b.n 80109f8 <ETH_DMAReceptionCmd+0x10>
- }
- else
- {
- /* Disable the DMA reception */
- ETH->DMAOMR &= ~ETH_DMAOMR_SR;
- 80109f4: f022 0202 bic.w r2, r2, #2
- 80109f8: 619a str r2, [r3, #24]
- 80109fa: 4770 bx lr
- 80109fc: 40029000 .word 0x40029000
- 08010a00 <ETH_Start>:
- * @brief Enables ENET MAC and DMA reception/transmission
- * @param None
- * @retval None
- */
- void ETH_Start(void)
- {
- 8010a00: b508 push {r3, lr}
- /* Enable transmit state machine of the MAC for transmission on the MII */
- ETH_MACTransmissionCmd(ENABLE);
- 8010a02: 2001 movs r0, #1
- 8010a04: f7ff fe8c bl 8010720 <ETH_MACTransmissionCmd>
- /* Flush Transmit FIFO */
- ETH_FlushTransmitFIFO();
- 8010a08: f7ff ffda bl 80109c0 <ETH_FlushTransmitFIFO>
- /* Enable receive state machine of the MAC for reception from the MII */
- ETH_MACReceptionCmd(ENABLE);
- 8010a0c: 2001 movs r0, #1
- 8010a0e: f7ff fe93 bl 8010738 <ETH_MACReceptionCmd>
-
- /* Start DMA transmission */
- ETH_DMATransmissionCmd(ENABLE);
- 8010a12: 2001 movs r0, #1
- 8010a14: f7ff ffdc bl 80109d0 <ETH_DMATransmissionCmd>
- /* Start DMA reception */
- ETH_DMAReceptionCmd(ENABLE);
- 8010a18: 2001 movs r0, #1
- }
- 8010a1a: e8bd 4008 ldmia.w sp!, {r3, lr}
- ETH_MACReceptionCmd(ENABLE);
-
- /* Start DMA transmission */
- ETH_DMATransmissionCmd(ENABLE);
- /* Start DMA reception */
- ETH_DMAReceptionCmd(ENABLE);
- 8010a1e: f7ff bfe3 b.w 80109e8 <ETH_DMAReceptionCmd>
- 8010a22: 0000 movs r0, r0
- 08010a24 <ETH_ReadPHYRegister>:
- * @arg More PHY register could be read depending on the used PHY
- * @retval ETH_ERROR: in case of timeout
- * MAC MIIDR register value: Data read from the selected PHY register (correct read )
- */
- uint16_t ETH_ReadPHYRegister(uint16_t PHYAddress, uint16_t PHYReg)
- {
- 8010a24: b082 sub sp, #8
- uint32_t tmpreg = 0;
- __IO uint32_t timeout = 0;
- 8010a26: 2300 movs r3, #0
- 8010a28: 9301 str r3, [sp, #4]
- /* Check the parameters */
- assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
- assert_param(IS_ETH_PHY_REG(PHYReg));
-
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- 8010a2a: 4b11 ldr r3, [pc, #68] ; (8010a70 <ETH_ReadPHYRegister+0x4c>)
- 8010a2c: 691a ldr r2, [r3, #16]
- /* Keep only the CSR Clock Range CR[2:0] bits value */
- tmpreg &= ~MACMIIAR_CR_MASK;
- /* Prepare the MII address register value */
- tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
- 8010a2e: 06c0 lsls r0, r0, #27
- assert_param(IS_ETH_PHY_REG(PHYReg));
-
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- /* Keep only the CSR Clock Range CR[2:0] bits value */
- tmpreg &= ~MACMIIAR_CR_MASK;
- 8010a30: f002 021c and.w r2, r2, #28
- /* Prepare the MII address register value */
- tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
- tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
- 8010a34: 0189 lsls r1, r1, #6
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- /* Keep only the CSR Clock Range CR[2:0] bits value */
- tmpreg &= ~MACMIIAR_CR_MASK;
- /* Prepare the MII address register value */
- tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
- 8010a36: ea42 4210 orr.w r2, r2, r0, lsr #16
- tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
- 8010a3a: f401 61f8 and.w r1, r1, #1984 ; 0x7c0
- tmpreg &= ~ETH_MACMIIAR_MW; /* Set the read mode */
- 8010a3e: 430a orrs r2, r1
- tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
- 8010a40: f042 0201 orr.w r2, r2, #1
- /* Write the result value into the MII Address register */
- ETH->MACMIIAR = tmpreg;
- 8010a44: 611a str r2, [r3, #16]
- /* Check for the Busy flag */
- do
- {
- timeout++;
- tmpreg = ETH->MACMIIAR;
- } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
- 8010a46: 4a0b ldr r2, [pc, #44] ; (8010a74 <ETH_ReadPHYRegister+0x50>)
- /* Write the result value into the MII Address register */
- ETH->MACMIIAR = tmpreg;
- /* Check for the Busy flag */
- do
- {
- timeout++;
- 8010a48: 9901 ldr r1, [sp, #4]
- 8010a4a: 3101 adds r1, #1
- 8010a4c: 9101 str r1, [sp, #4]
- tmpreg = ETH->MACMIIAR;
- 8010a4e: 6919 ldr r1, [r3, #16]
- } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
- 8010a50: 07c9 lsls r1, r1, #31
- 8010a52: d502 bpl.n 8010a5a <ETH_ReadPHYRegister+0x36>
- 8010a54: 9901 ldr r1, [sp, #4]
- 8010a56: 4291 cmp r1, r2
- 8010a58: d9f6 bls.n 8010a48 <ETH_ReadPHYRegister+0x24>
- /* Return ERROR in case of timeout */
- if(timeout == PHY_READ_TO)
- 8010a5a: 4b07 ldr r3, [pc, #28] ; (8010a78 <ETH_ReadPHYRegister+0x54>)
- 8010a5c: 9a01 ldr r2, [sp, #4]
- 8010a5e: 429a cmp r2, r3
- {
- return (uint16_t)ETH_ERROR;
- }
-
- /* Return data register value */
- return (uint16_t)(ETH->MACMIIDR);
- 8010a60: bf1d ittte ne
- 8010a62: 4b03 ldrne r3, [pc, #12] ; (8010a70 <ETH_ReadPHYRegister+0x4c>)
- 8010a64: 6958 ldrne r0, [r3, #20]
- 8010a66: b280 uxthne r0, r0
- tmpreg = ETH->MACMIIAR;
- } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
- /* Return ERROR in case of timeout */
- if(timeout == PHY_READ_TO)
- {
- return (uint16_t)ETH_ERROR;
- 8010a68: 2000 moveq r0, #0
- }
-
- /* Return data register value */
- return (uint16_t)(ETH->MACMIIDR);
- }
- 8010a6a: b002 add sp, #8
- 8010a6c: 4770 bx lr
- 8010a6e: bf00 nop
- 8010a70: 40028000 .word 0x40028000
- 8010a74: 0004fffe .word 0x0004fffe
- 8010a78: 0004ffff .word 0x0004ffff
- 08010a7c <ETH_WritePHYRegister>:
- * @param PHYValue: the value to write
- * @retval ETH_ERROR: in case of timeout
- * ETH_SUCCESS: for correct write
- */
- uint32_t ETH_WritePHYRegister(uint16_t PHYAddress, uint16_t PHYReg, uint16_t PHYValue)
- {
- 8010a7c: b513 push {r0, r1, r4, lr}
- uint32_t tmpreg = 0;
- __IO uint32_t timeout = 0;
- 8010a7e: 2300 movs r3, #0
- 8010a80: 9301 str r3, [sp, #4]
- /* Check the parameters */
- assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
- assert_param(IS_ETH_PHY_REG(PHYReg));
-
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- 8010a82: 4b0f ldr r3, [pc, #60] ; (8010ac0 <ETH_WritePHYRegister+0x44>)
- 8010a84: 691c ldr r4, [r3, #16]
- tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
- tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
- tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */
- tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
- /* Give the value to the MII data register */
- ETH->MACMIIDR = PHYValue;
- 8010a86: 615a str r2, [r3, #20]
- assert_param(IS_ETH_PHY_REG(PHYReg));
-
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- /* Keep only the CSR Clock Range CR[2:0] bits value */
- tmpreg &= ~MACMIIAR_CR_MASK;
- 8010a88: f004 041c and.w r4, r4, #28
- /* Prepare the MII register address value */
- tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
- 8010a8c: f044 0403 orr.w r4, r4, #3
- 8010a90: 06c0 lsls r0, r0, #27
- tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR); /* Set the PHY register address */
- 8010a92: 0189 lsls r1, r1, #6
- 8010a94: ea44 4410 orr.w r4, r4, r0, lsr #16
- 8010a98: f401 61f8 and.w r1, r1, #1984 ; 0x7c0
- tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */
- tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
- 8010a9c: 430c orrs r4, r1
- /* Check for the Busy flag */
- do
- {
- timeout++;
- tmpreg = ETH->MACMIIAR;
- } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_WRITE_TO));
- 8010a9e: 4a09 ldr r2, [pc, #36] ; (8010ac4 <ETH_WritePHYRegister+0x48>)
- tmpreg |= ETH_MACMIIAR_MW; /* Set the write mode */
- tmpreg |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
- /* Give the value to the MII data register */
- ETH->MACMIIDR = PHYValue;
- /* Write the result value into the MII Address register */
- ETH->MACMIIAR = tmpreg;
- 8010aa0: 611c str r4, [r3, #16]
- /* Check for the Busy flag */
- do
- {
- timeout++;
- 8010aa2: 9901 ldr r1, [sp, #4]
- 8010aa4: 3101 adds r1, #1
- 8010aa6: 9101 str r1, [sp, #4]
- tmpreg = ETH->MACMIIAR;
- 8010aa8: 6919 ldr r1, [r3, #16]
- } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_WRITE_TO));
- 8010aaa: 07c8 lsls r0, r1, #31
- 8010aac: d502 bpl.n 8010ab4 <ETH_WritePHYRegister+0x38>
- 8010aae: 9901 ldr r1, [sp, #4]
- 8010ab0: 4291 cmp r1, r2
- 8010ab2: d9f6 bls.n 8010aa2 <ETH_WritePHYRegister+0x26>
- /* Return ERROR in case of timeout */
- if(timeout == PHY_WRITE_TO)
- 8010ab4: 9801 ldr r0, [sp, #4]
- return ETH_ERROR;
- }
-
- /* Return SUCCESS */
- return ETH_SUCCESS;
- }
- 8010ab6: 4b04 ldr r3, [pc, #16] ; (8010ac8 <ETH_WritePHYRegister+0x4c>)
- 8010ab8: 1ac0 subs r0, r0, r3
- 8010aba: bf18 it ne
- 8010abc: 2001 movne r0, #1
- 8010abe: bd1c pop {r2, r3, r4, pc}
- 8010ac0: 40028000 .word 0x40028000
- 8010ac4: 0004fffe .word 0x0004fffe
- 8010ac8: 0004ffff .word 0x0004ffff
- 08010acc <ETH_Init>:
- * @param PHYAddress: external PHY address
- * @retval ETH_ERROR: Ethernet initialization failed
- * ETH_SUCCESS: Ethernet successfully initialized
- */
- uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
- {
- 8010acc: b5f0 push {r4, r5, r6, r7, lr}
- 8010ace: b087 sub sp, #28
- uint32_t RegValue = 0, tmpreg = 0;
- __IO uint32_t i = 0;
- 8010ad0: 2300 movs r3, #0
- assert_param(IS_ETH_DMA_DESC_SKIP_LENGTH(ETH_InitStruct->ETH_DescriptorSkipLength));
- assert_param(IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(ETH_InitStruct->ETH_DMAArbitration));
- /*-------------------------------- MAC Config ------------------------------*/
- /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- 8010ad2: 4f90 ldr r7, [pc, #576] ; (8010d14 <ETH_Init+0x248>)
- * ETH_SUCCESS: Ethernet successfully initialized
- */
- uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
- {
- uint32_t RegValue = 0, tmpreg = 0;
- __IO uint32_t i = 0;
- 8010ad4: 9300 str r3, [sp, #0]
- * @param PHYAddress: external PHY address
- * @retval ETH_ERROR: Ethernet initialization failed
- * ETH_SUCCESS: Ethernet successfully initialized
- */
- uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
- {
- 8010ad6: 4604 mov r4, r0
- uint32_t RegValue = 0, tmpreg = 0;
- __IO uint32_t i = 0;
- RCC_ClocksTypeDef rcc_clocks;
- uint32_t hclk = 60000000;
- __IO uint32_t timeout = 0;
- 8010ad8: 9301 str r3, [sp, #4]
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- /* Clear CSR Clock Range CR[2:0] bits */
- tmpreg &= MACMIIAR_CR_MASK;
- /* Get hclk frequency value */
- RCC_GetClocksFreq(&rcc_clocks);
- 8010ada: a802 add r0, sp, #8
- * @param PHYAddress: external PHY address
- * @retval ETH_ERROR: Ethernet initialization failed
- * ETH_SUCCESS: Ethernet successfully initialized
- */
- uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
- {
- 8010adc: 460e mov r6, r1
- assert_param(IS_ETH_DMA_DESC_SKIP_LENGTH(ETH_InitStruct->ETH_DescriptorSkipLength));
- assert_param(IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(ETH_InitStruct->ETH_DMAArbitration));
- /*-------------------------------- MAC Config ------------------------------*/
- /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- 8010ade: 693d ldr r5, [r7, #16]
- /* Clear CSR Clock Range CR[2:0] bits */
- tmpreg &= MACMIIAR_CR_MASK;
- /* Get hclk frequency value */
- RCC_GetClocksFreq(&rcc_clocks);
- 8010ae0: f7f9 fa12 bl 8009f08 <RCC_GetClocksFreq>
- hclk = rcc_clocks.HCLK_Frequency;
- 8010ae4: 9b03 ldr r3, [sp, #12]
-
- /* Set CR bits depending on hclk value */
- if((hclk >= 20000000)&&(hclk < 35000000))
- 8010ae6: 4a8c ldr r2, [pc, #560] ; (8010d18 <ETH_Init+0x24c>)
- 8010ae8: 498c ldr r1, [pc, #560] ; (8010d1c <ETH_Init+0x250>)
- 8010aea: 189a adds r2, r3, r2
- 8010aec: 428a cmp r2, r1
- /*-------------------------------- MAC Config ------------------------------*/
- /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
- /* Get the ETHERNET MACMIIAR value */
- tmpreg = ETH->MACMIIAR;
- /* Clear CSR Clock Range CR[2:0] bits */
- tmpreg &= MACMIIAR_CR_MASK;
- 8010aee: f025 051c bic.w r5, r5, #28
- /* Get hclk frequency value */
- RCC_GetClocksFreq(&rcc_clocks);
- hclk = rcc_clocks.HCLK_Frequency;
-
- /* Set CR bits depending on hclk value */
- if((hclk >= 20000000)&&(hclk < 35000000))
- 8010af2: d802 bhi.n 8010afa <ETH_Init+0x2e>
- {
- /* CSR Clock Range between 20-35 MHz */
- tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div16;
- 8010af4: f045 0508 orr.w r5, r5, #8
- 8010af8: e015 b.n 8010b26 <ETH_Init+0x5a>
- }
- else if((hclk >= 35000000)&&(hclk < 60000000))
- 8010afa: 4a89 ldr r2, [pc, #548] ; (8010d20 <ETH_Init+0x254>)
- 8010afc: 4989 ldr r1, [pc, #548] ; (8010d24 <ETH_Init+0x258>)
- 8010afe: 189a adds r2, r3, r2
- 8010b00: 428a cmp r2, r1
- 8010b02: d802 bhi.n 8010b0a <ETH_Init+0x3e>
- {
- /* CSR Clock Range between 35-60 MHz */
- tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div26;
- 8010b04: f045 050c orr.w r5, r5, #12
- 8010b08: e00d b.n 8010b26 <ETH_Init+0x5a>
- }
- else if((hclk >= 60000000)&&(hclk < 100000000))
- 8010b0a: 4a87 ldr r2, [pc, #540] ; (8010d28 <ETH_Init+0x25c>)
- 8010b0c: 4987 ldr r1, [pc, #540] ; (8010d2c <ETH_Init+0x260>)
- 8010b0e: 189a adds r2, r3, r2
- 8010b10: 428a cmp r2, r1
- 8010b12: d908 bls.n 8010b26 <ETH_Init+0x5a>
- {
- /* CSR Clock Range between 60-100 MHz */
- tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div42;
- }
- else if((hclk >= 100000000)&&(hclk < 150000000))
- 8010b14: 4a86 ldr r2, [pc, #536] ; (8010d30 <ETH_Init+0x264>)
- 8010b16: 189a adds r2, r3, r2
- 8010b18: 4b86 ldr r3, [pc, #536] ; (8010d34 <ETH_Init+0x268>)
- 8010b1a: 429a cmp r2, r3
- {
- /* CSR Clock Range between 100-150 MHz */
- tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div62;
- 8010b1c: bf94 ite ls
- 8010b1e: f045 0504 orrls.w r5, r5, #4
- }
- else /* ((hclk >= 150000000)&&(hclk <= 168000000)) */
- {
- /* CSR Clock Range between 150-168 MHz */
- tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div102;
- 8010b22: f045 0510 orrhi.w r5, r5, #16
- }
-
- /* Write to ETHERNET MAC MIIAR: Configure the ETHERNET CSR Clock Range */
- ETH->MACMIIAR = (uint32_t)tmpreg;
- 8010b26: 613d str r5, [r7, #16]
- /*-------------------- PHY initialization and configuration ----------------*/
- /* Put the PHY in reset mode */
- if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_Reset)))
- 8010b28: 4630 mov r0, r6
- 8010b2a: 2100 movs r1, #0
- 8010b2c: f44f 4200 mov.w r2, #32768 ; 0x8000
- 8010b30: f7ff ffa4 bl 8010a7c <ETH_WritePHYRegister>
- 8010b34: b908 cbnz r0, 8010b3a <ETH_Init+0x6e>
- {
- /* Return ERROR in case of write timeout */
- return ETH_ERROR;
- 8010b36: 2000 movs r0, #0
- 8010b38: e0e9 b.n 8010d0e <ETH_Init+0x242>
- }
-
- /* Delay to assure PHY reset */
- _eth_delay_(PHY_RESET_DELAY);
- 8010b3a: 487f ldr r0, [pc, #508] ; (8010d38 <ETH_Init+0x26c>)
- 8010b3c: f7ff fd80 bl 8010640 <ETH_Delay>
-
- if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
- 8010b40: 6821 ldr r1, [r4, #0]
- 8010b42: 2900 cmp r1, #0
- 8010b44: d050 beq.n 8010be8 <ETH_Init+0x11c>
- {
- /* We wait for linked status... */
- do
- {
- timeout++;
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
- 8010b46: 4d7d ldr r5, [pc, #500] ; (8010d3c <ETH_Init+0x270>)
- if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
- {
- /* We wait for linked status... */
- do
- {
- timeout++;
- 8010b48: 9b01 ldr r3, [sp, #4]
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
- 8010b4a: 4630 mov r0, r6
- if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
- {
- /* We wait for linked status... */
- do
- {
- timeout++;
- 8010b4c: 3301 adds r3, #1
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
- 8010b4e: 2101 movs r1, #1
- if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
- {
- /* We wait for linked status... */
- do
- {
- timeout++;
- 8010b50: 9301 str r3, [sp, #4]
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
- 8010b52: f7ff ff67 bl 8010a24 <ETH_ReadPHYRegister>
- 8010b56: f000 0004 and.w r0, r0, #4
- 8010b5a: b280 uxth r0, r0
- 8010b5c: b910 cbnz r0, 8010b64 <ETH_Init+0x98>
- 8010b5e: 9b01 ldr r3, [sp, #4]
- 8010b60: 42ab cmp r3, r5
- 8010b62: d9f1 bls.n 8010b48 <ETH_Init+0x7c>
- /* Return ERROR in case of timeout */
- if(timeout == PHY_READ_TO)
- 8010b64: 9a01 ldr r2, [sp, #4]
- 8010b66: 4b76 ldr r3, [pc, #472] ; (8010d40 <ETH_Init+0x274>)
- 8010b68: 429a cmp r2, r3
- 8010b6a: d0e4 beq.n 8010b36 <ETH_Init+0x6a>
- {
- return ETH_ERROR;
- }
- /* Reset Timeout counter */
- timeout = 0;
- 8010b6c: 2100 movs r1, #0
- /* Enable Auto-Negotiation */
- if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_AutoNegotiation)))
- 8010b6e: 4630 mov r0, r6
- 8010b70: f44f 5280 mov.w r2, #4096 ; 0x1000
- {
- return ETH_ERROR;
- }
- /* Reset Timeout counter */
- timeout = 0;
- 8010b74: 9101 str r1, [sp, #4]
- /* Enable Auto-Negotiation */
- if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_AutoNegotiation)))
- 8010b76: f7ff ff81 bl 8010a7c <ETH_WritePHYRegister>
- 8010b7a: 2800 cmp r0, #0
- 8010b7c: d0db beq.n 8010b36 <ETH_Init+0x6a>
- /* Wait until the auto-negotiation will be completed */
- do
- {
- timeout++;
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
- 8010b7e: 4d6f ldr r5, [pc, #444] ; (8010d3c <ETH_Init+0x270>)
- }
- /* Wait until the auto-negotiation will be completed */
- do
- {
- timeout++;
- 8010b80: 9b01 ldr r3, [sp, #4]
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
- 8010b82: 4630 mov r0, r6
- }
- /* Wait until the auto-negotiation will be completed */
- do
- {
- timeout++;
- 8010b84: 3301 adds r3, #1
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
- 8010b86: 2101 movs r1, #1
- }
- /* Wait until the auto-negotiation will be completed */
- do
- {
- timeout++;
- 8010b88: 9301 str r3, [sp, #4]
- } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));
- 8010b8a: f7ff ff4b bl 8010a24 <ETH_ReadPHYRegister>
- 8010b8e: f000 0020 and.w r0, r0, #32
- 8010b92: b280 uxth r0, r0
- 8010b94: b910 cbnz r0, 8010b9c <ETH_Init+0xd0>
- 8010b96: 9b01 ldr r3, [sp, #4]
- 8010b98: 42ab cmp r3, r5
- 8010b9a: d9f1 bls.n 8010b80 <ETH_Init+0xb4>
- /* Return ERROR in case of timeout */
- if(timeout == PHY_READ_TO)
- 8010b9c: 9a01 ldr r2, [sp, #4]
- 8010b9e: 4b68 ldr r3, [pc, #416] ; (8010d40 <ETH_Init+0x274>)
- 8010ba0: 429a cmp r2, r3
- 8010ba2: d0c8 beq.n 8010b36 <ETH_Init+0x6a>
- {
- return ETH_ERROR;
- }
- /* Reset Timeout counter */
- timeout = 0;
- 8010ba4: 2500 movs r5, #0
-
- /* Read the result of the auto-negotiation */
- RegValue = ETH_ReadPHYRegister(PHYAddress, PHY_SR);
- 8010ba6: 211f movs r1, #31
- 8010ba8: 4630 mov r0, r6
- {
- return ETH_ERROR;
- }
- /* Reset Timeout counter */
- timeout = 0;
- 8010baa: 9501 str r5, [sp, #4]
-
- /* Read the result of the auto-negotiation */
- RegValue = ETH_ReadPHYRegister(PHYAddress, PHY_SR);
- 8010bac: f7ff ff3a bl 8010a24 <ETH_ReadPHYRegister>
- switch (RegValue & PHY_DUPLEX_SPEED_STATUS_MASK)
- 8010bb0: f000 001c and.w r0, r0, #28
- 8010bb4: 2808 cmp r0, #8
- 8010bb6: d00b beq.n 8010bd0 <ETH_Init+0x104>
- 8010bb8: d802 bhi.n 8010bc0 <ETH_Init+0xf4>
- 8010bba: 2804 cmp r0, #4
- 8010bbc: d123 bne.n 8010c06 <ETH_Init+0x13a>
- 8010bbe: e010 b.n 8010be2 <ETH_Init+0x116>
- 8010bc0: 280e cmp r0, #14
- 8010bc2: d00a beq.n 8010bda <ETH_Init+0x10e>
- 8010bc4: 2812 cmp r0, #18
- 8010bc6: d11e bne.n 8010c06 <ETH_Init+0x13a>
- {
- case PHY_100BTX_FULL:
- ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
- 8010bc8: f44f 6300 mov.w r3, #2048 ; 0x800
- 8010bcc: 6223 str r3, [r4, #32]
- 8010bce: e000 b.n 8010bd2 <ETH_Init+0x106>
- ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
- break;
- case PHY_100BTX_HALF:
- ETH_InitStruct->ETH_Mode = ETH_Mode_HalfDuplex;
- 8010bd0: 6225 str r5, [r4, #32]
- ETH_InitStruct->ETH_Speed = ETH_Speed_100M;
- 8010bd2: f44f 4380 mov.w r3, #16384 ; 0x4000
- 8010bd6: 6163 str r3, [r4, #20]
- break;
- 8010bd8: e015 b.n 8010c06 <ETH_Init+0x13a>
- case PHY_10M_FULL:
- ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;
- 8010bda: f44f 6300 mov.w r3, #2048 ; 0x800
- 8010bde: 6223 str r3, [r4, #32]
- 8010be0: e000 b.n 8010be4 <ETH_Init+0x118>
- ETH_InitStruct->ETH_Speed = ETH_Speed_10M;
- break;
- case PHY_10M_HALF:
- ETH_InitStruct->ETH_Mode = ETH_Mode_HalfDuplex;
- 8010be2: 6225 str r5, [r4, #32]
- ETH_InitStruct->ETH_Speed = ETH_Speed_10M;
- 8010be4: 6165 str r5, [r4, #20]
- break;
- 8010be6: e00e b.n 8010c06 <ETH_Init+0x13a>
- break;
- }
- }
- else
- {
- if(!ETH_WritePHYRegister(PHYAddress, PHY_BCR, ((uint16_t)(ETH_InitStruct->ETH_Mode >> 3) |
- 8010be8: 6a22 ldr r2, [r4, #32]
- (uint16_t)(ETH_InitStruct->ETH_Speed >> 1))))
- 8010bea: 6963 ldr r3, [r4, #20]
- break;
- }
- }
- else
- {
- if(!ETH_WritePHYRegister(PHYAddress, PHY_BCR, ((uint16_t)(ETH_InitStruct->ETH_Mode >> 3) |
- 8010bec: 08d2 lsrs r2, r2, #3
- 8010bee: ea42 0253 orr.w r2, r2, r3, lsr #1
- 8010bf2: 4630 mov r0, r6
- 8010bf4: b292 uxth r2, r2
- 8010bf6: f7ff ff41 bl 8010a7c <ETH_WritePHYRegister>
- 8010bfa: 2800 cmp r0, #0
- 8010bfc: d09b beq.n 8010b36 <ETH_Init+0x6a>
- {
- /* Return ERROR in case of write timeout */
- return ETH_ERROR;
- }
- /* Delay to assure PHY configuration */
- _eth_delay_(PHY_CONFIG_DELAY);
- 8010bfe: f06f 407f mvn.w r0, #4278190080 ; 0xff000000
- 8010c02: f7ff fd1d bl 8010640 <ETH_Delay>
-
- }
- /*------------------------ ETHERNET MACCR Configuration --------------------*/
- /* Get the ETHERNET MACCR value */
- tmpreg = ETH->MACCR;
- 8010c06: 4b43 ldr r3, [pc, #268] ; (8010d14 <ETH_Init+0x248>)
- /* Clear WD, PCE, PS, TE and RE bits */
- tmpreg &= MACCR_CLEAR_MASK;
- 8010c08: 4a4e ldr r2, [pc, #312] ; (8010d44 <ETH_Init+0x278>)
- _eth_delay_(PHY_CONFIG_DELAY);
-
- }
- /*------------------------ ETHERNET MACCR Configuration --------------------*/
- /* Get the ETHERNET MACCR value */
- tmpreg = ETH->MACCR;
- 8010c0a: 6819 ldr r1, [r3, #0]
- /* Set the IPCO bit according to ETH_ChecksumOffload value */
- /* Set the DR bit according to ETH_RetryTransmission value */
- /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */
- /* Set the BL bit according to ETH_BackOffLimit value */
- /* Set the DC bit according to ETH_DeferralCheck value */
- tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog |
- 8010c0c: 68a0 ldr r0, [r4, #8]
- }
- /*------------------------ ETHERNET MACCR Configuration --------------------*/
- /* Get the ETHERNET MACCR value */
- tmpreg = ETH->MACCR;
- /* Clear WD, PCE, PS, TE and RE bits */
- tmpreg &= MACCR_CLEAR_MASK;
- 8010c0e: 400a ands r2, r1
- /* Set the IPCO bit according to ETH_ChecksumOffload value */
- /* Set the DR bit according to ETH_RetryTransmission value */
- /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */
- /* Set the BL bit according to ETH_BackOffLimit value */
- /* Set the DC bit according to ETH_DeferralCheck value */
- tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog |
- 8010c10: 6861 ldr r1, [r4, #4]
- 8010c12: 4308 orrs r0, r1
- ETH_InitStruct->ETH_Jabber |
- 8010c14: 68e1 ldr r1, [r4, #12]
- 8010c16: 4308 orrs r0, r1
- ETH_InitStruct->ETH_InterFrameGap |
- 8010c18: 6921 ldr r1, [r4, #16]
- 8010c1a: 4308 orrs r0, r1
- ETH_InitStruct->ETH_CarrierSense |
- 8010c1c: 6961 ldr r1, [r4, #20]
- 8010c1e: 4308 orrs r0, r1
- ETH_InitStruct->ETH_Speed |
- 8010c20: 69a1 ldr r1, [r4, #24]
- 8010c22: 4308 orrs r0, r1
- ETH_InitStruct->ETH_ReceiveOwn |
- 8010c24: 69e1 ldr r1, [r4, #28]
- 8010c26: 4308 orrs r0, r1
- ETH_InitStruct->ETH_LoopbackMode |
- 8010c28: 6a21 ldr r1, [r4, #32]
- 8010c2a: 4308 orrs r0, r1
- ETH_InitStruct->ETH_Mode |
- 8010c2c: 6a61 ldr r1, [r4, #36] ; 0x24
- 8010c2e: 4308 orrs r0, r1
- ETH_InitStruct->ETH_ChecksumOffload |
- 8010c30: 6aa1 ldr r1, [r4, #40] ; 0x28
- 8010c32: 4308 orrs r0, r1
- ETH_InitStruct->ETH_RetryTransmission |
- 8010c34: 6ae1 ldr r1, [r4, #44] ; 0x2c
- 8010c36: 4308 orrs r0, r1
- ETH_InitStruct->ETH_AutomaticPadCRCStrip |
- 8010c38: 6b21 ldr r1, [r4, #48] ; 0x30
- 8010c3a: 4308 orrs r0, r1
- /* Set the IPCO bit according to ETH_ChecksumOffload value */
- /* Set the DR bit according to ETH_RetryTransmission value */
- /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */
- /* Set the BL bit according to ETH_BackOffLimit value */
- /* Set the DC bit according to ETH_DeferralCheck value */
- tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog |
- 8010c3c: 6b61 ldr r1, [r4, #52] ; 0x34
- 8010c3e: 4301 orrs r1, r0
- 8010c40: 430a orrs r2, r1
- ETH_InitStruct->ETH_RetryTransmission |
- ETH_InitStruct->ETH_AutomaticPadCRCStrip |
- ETH_InitStruct->ETH_BackOffLimit |
- ETH_InitStruct->ETH_DeferralCheck);
- /* Write to ETHERNET MACCR */
- ETH->MACCR = (uint32_t)tmpreg;
- 8010c42: 601a str r2, [r3, #0]
- /* Set the DAIF bit according to ETH_DestinationAddrFilter value */
- /* Set the PR bit according to ETH_PromiscuousMode value */
- /* Set the PM, HMC and HPF bits according to ETH_MulticastFramesFilter value */
- /* Set the HUC and HPF bits according to ETH_UnicastFramesFilter value */
- /* Write to ETHERNET MACFFR */
- ETH->MACFFR = (uint32_t)(ETH_InitStruct->ETH_ReceiveAll |
- 8010c44: 6ba2 ldr r2, [r4, #56] ; 0x38
- 8010c46: 6be1 ldr r1, [r4, #60] ; 0x3c
- 8010c48: 4311 orrs r1, r2
- ETH_InitStruct->ETH_SourceAddrFilter |
- 8010c4a: 6c22 ldr r2, [r4, #64] ; 0x40
- 8010c4c: 4311 orrs r1, r2
- ETH_InitStruct->ETH_PassControlFrames |
- 8010c4e: 6c62 ldr r2, [r4, #68] ; 0x44
- 8010c50: 4311 orrs r1, r2
- ETH_InitStruct->ETH_BroadcastFramesReception |
- 8010c52: 6ca2 ldr r2, [r4, #72] ; 0x48
- 8010c54: 4311 orrs r1, r2
- ETH_InitStruct->ETH_DestinationAddrFilter |
- 8010c56: 6ce2 ldr r2, [r4, #76] ; 0x4c
- 8010c58: 4311 orrs r1, r2
- ETH_InitStruct->ETH_PromiscuousMode |
- 8010c5a: 6d22 ldr r2, [r4, #80] ; 0x50
- 8010c5c: 4311 orrs r1, r2
- /* Set the DAIF bit according to ETH_DestinationAddrFilter value */
- /* Set the PR bit according to ETH_PromiscuousMode value */
- /* Set the PM, HMC and HPF bits according to ETH_MulticastFramesFilter value */
- /* Set the HUC and HPF bits according to ETH_UnicastFramesFilter value */
- /* Write to ETHERNET MACFFR */
- ETH->MACFFR = (uint32_t)(ETH_InitStruct->ETH_ReceiveAll |
- 8010c5e: 6d62 ldr r2, [r4, #84] ; 0x54
- 8010c60: 430a orrs r2, r1
- 8010c62: 605a str r2, [r3, #4]
- ETH_InitStruct->ETH_PromiscuousMode |
- ETH_InitStruct->ETH_MulticastFramesFilter |
- ETH_InitStruct->ETH_UnicastFramesFilter);
- /*--------------- ETHERNET MACHTHR and MACHTLR Configuration ---------------*/
- /* Write to ETHERNET MACHTHR */
- ETH->MACHTHR = (uint32_t)ETH_InitStruct->ETH_HashTableHigh;
- 8010c64: 6da2 ldr r2, [r4, #88] ; 0x58
- 8010c66: 609a str r2, [r3, #8]
- /* Write to ETHERNET MACHTLR */
- ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
- 8010c68: 6de2 ldr r2, [r4, #92] ; 0x5c
- 8010c6a: 60da str r2, [r3, #12]
- /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
- /* Set the PLT bit according to ETH_PauseLowThreshold value */
- /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
- /* Set the RFE bit according to ETH_ReceiveFlowControl value */
- /* Set the TFE bit according to ETH_TransmitFlowControl value */
- tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) |
- 8010c6c: 6e62 ldr r2, [r4, #100] ; 0x64
- 8010c6e: 6ea1 ldr r1, [r4, #104] ; 0x68
- ETH->MACHTHR = (uint32_t)ETH_InitStruct->ETH_HashTableHigh;
- /* Write to ETHERNET MACHTLR */
- ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
- /*----------------------- ETHERNET MACFCR Configuration --------------------*/
- /* Get the ETHERNET MACFCR value */
- tmpreg = ETH->MACFCR;
- 8010c70: 6998 ldr r0, [r3, #24]
- /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
- /* Set the PLT bit according to ETH_PauseLowThreshold value */
- /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
- /* Set the RFE bit according to ETH_ReceiveFlowControl value */
- /* Set the TFE bit according to ETH_TransmitFlowControl value */
- tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) |
- 8010c72: 4311 orrs r1, r2
- ETH_InitStruct->ETH_ZeroQuantaPause |
- 8010c74: 6ee2 ldr r2, [r4, #108] ; 0x6c
- 8010c76: 4311 orrs r1, r2
- ETH_InitStruct->ETH_PauseLowThreshold |
- 8010c78: 6f22 ldr r2, [r4, #112] ; 0x70
- 8010c7a: 4311 orrs r1, r2
- ETH_InitStruct->ETH_UnicastPauseFrameDetect |
- 8010c7c: 6f62 ldr r2, [r4, #116] ; 0x74
- 8010c7e: 4311 orrs r1, r2
- ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
- /*----------------------- ETHERNET MACFCR Configuration --------------------*/
- /* Get the ETHERNET MACFCR value */
- tmpreg = ETH->MACFCR;
- /* Clear xx bits */
- tmpreg &= MACFCR_CLEAR_MASK;
- 8010c80: f64f 7241 movw r2, #65345 ; 0xff41
- 8010c84: 4002 ands r2, r0
- /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
- /* Set the PLT bit according to ETH_PauseLowThreshold value */
- /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
- /* Set the RFE bit according to ETH_ReceiveFlowControl value */
- /* Set the TFE bit according to ETH_TransmitFlowControl value */
- tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) |
- 8010c86: 430a orrs r2, r1
- 8010c88: 6e21 ldr r1, [r4, #96] ; 0x60
- 8010c8a: ea42 4101 orr.w r1, r2, r1, lsl #16
- ETH_InitStruct->ETH_PauseLowThreshold |
- ETH_InitStruct->ETH_UnicastPauseFrameDetect |
- ETH_InitStruct->ETH_ReceiveFlowControl |
- ETH_InitStruct->ETH_TransmitFlowControl);
- /* Write to ETHERNET MACFCR */
- ETH->MACFCR = (uint32_t)tmpreg;
- 8010c8e: 6199 str r1, [r3, #24]
- /*----------------------- ETHERNET MACVLANTR Configuration -----------------*/
- /* Set the ETV bit according to ETH_VLANTagComparison value */
- /* Set the VL bit according to ETH_VLANTagIdentifier value */
- ETH->MACVLANTR = (uint32_t)(ETH_InitStruct->ETH_VLANTagComparison |
- 8010c90: 6fe1 ldr r1, [r4, #124] ; 0x7c
- 8010c92: 6fa2 ldr r2, [r4, #120] ; 0x78
- 8010c94: 430a orrs r2, r1
- 8010c96: 61da str r2, [r3, #28]
- ETH_InitStruct->ETH_VLANTagIdentifier);
-
- /*-------------------------------- DMA Config ------------------------------*/
- /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
- /* Get the ETHERNET DMAOMR value */
- tmpreg = ETH->DMAOMR;
- 8010c98: f503 5380 add.w r3, r3, #4096 ; 0x1000
- /* Clear xx bits */
- tmpreg &= DMAOMR_CLEAR_MASK;
- 8010c9c: 4a2a ldr r2, [pc, #168] ; (8010d48 <ETH_Init+0x27c>)
- ETH_InitStruct->ETH_VLANTagIdentifier);
-
- /*-------------------------------- DMA Config ------------------------------*/
- /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
- /* Get the ETHERNET DMAOMR value */
- tmpreg = ETH->DMAOMR;
- 8010c9e: 6999 ldr r1, [r3, #24]
- /* Set the TTC bit according to ETH_TransmitThresholdControl value */
- /* Set the FEF bit according to ETH_ForwardErrorFrames value */
- /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
- /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
- /* Set the OSF bit according to ETH_SecondFrameOperate value */
- tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame |
- 8010ca0: f8d4 0084 ldr.w r0, [r4, #132] ; 0x84
- /*-------------------------------- DMA Config ------------------------------*/
- /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
- /* Get the ETHERNET DMAOMR value */
- tmpreg = ETH->DMAOMR;
- /* Clear xx bits */
- tmpreg &= DMAOMR_CLEAR_MASK;
- 8010ca4: 400a ands r2, r1
- /* Set the TTC bit according to ETH_TransmitThresholdControl value */
- /* Set the FEF bit according to ETH_ForwardErrorFrames value */
- /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
- /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
- /* Set the OSF bit according to ETH_SecondFrameOperate value */
- tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame |
- 8010ca6: f8d4 1080 ldr.w r1, [r4, #128] ; 0x80
- 8010caa: 4308 orrs r0, r1
- ETH_InitStruct->ETH_ReceiveStoreForward |
- 8010cac: f8d4 1088 ldr.w r1, [r4, #136] ; 0x88
- 8010cb0: 4308 orrs r0, r1
- ETH_InitStruct->ETH_FlushReceivedFrame |
- 8010cb2: f8d4 108c ldr.w r1, [r4, #140] ; 0x8c
- 8010cb6: 4308 orrs r0, r1
- ETH_InitStruct->ETH_TransmitStoreForward |
- 8010cb8: f8d4 1090 ldr.w r1, [r4, #144] ; 0x90
- 8010cbc: 4308 orrs r0, r1
- ETH_InitStruct->ETH_TransmitThresholdControl |
- 8010cbe: f8d4 1094 ldr.w r1, [r4, #148] ; 0x94
- 8010cc2: 4308 orrs r0, r1
- ETH_InitStruct->ETH_ForwardErrorFrames |
- 8010cc4: f8d4 1098 ldr.w r1, [r4, #152] ; 0x98
- 8010cc8: 4308 orrs r0, r1
- ETH_InitStruct->ETH_ForwardUndersizedGoodFrames |
- 8010cca: f8d4 109c ldr.w r1, [r4, #156] ; 0x9c
- 8010cce: 4308 orrs r0, r1
- /* Set the TTC bit according to ETH_TransmitThresholdControl value */
- /* Set the FEF bit according to ETH_ForwardErrorFrames value */
- /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
- /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
- /* Set the OSF bit according to ETH_SecondFrameOperate value */
- tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame |
- 8010cd0: f8d4 10a0 ldr.w r1, [r4, #160] ; 0xa0
- 8010cd4: 4301 orrs r1, r0
- 8010cd6: 430a orrs r2, r1
- ETH_InitStruct->ETH_ForwardErrorFrames |
- ETH_InitStruct->ETH_ForwardUndersizedGoodFrames |
- ETH_InitStruct->ETH_ReceiveThresholdControl |
- ETH_InitStruct->ETH_SecondFrameOperate);
- /* Write to ETHERNET DMAOMR */
- ETH->DMAOMR = (uint32_t)tmpreg;
- 8010cd8: 619a str r2, [r3, #24]
- /* Set the FB bit according to ETH_FixedBurst value */
- /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
- /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
- /* Set the DSL bit according to ETH_DesciptorSkipLength value */
- /* Set the PR and DA bits according to ETH_DMAArbitration value */
- ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats |
- 8010cda: f8d4 20a8 ldr.w r2, [r4, #168] ; 0xa8
- 8010cde: f8d4 10a4 ldr.w r1, [r4, #164] ; 0xa4
- 8010ce2: 4311 orrs r1, r2
- ETH_InitStruct->ETH_FixedBurst |
- ETH_InitStruct->ETH_RxDMABurstLength | /* !! if 4xPBL is selected for Tx or Rx it is applied for the other */
- 8010ce4: f8d4 20ac ldr.w r2, [r4, #172] ; 0xac
- /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
- /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
- /* Set the DSL bit according to ETH_DesciptorSkipLength value */
- /* Set the PR and DA bits according to ETH_DMAArbitration value */
- ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats |
- ETH_InitStruct->ETH_FixedBurst |
- 8010ce8: f441 0100 orr.w r1, r1, #8388608 ; 0x800000
- ETH_InitStruct->ETH_RxDMABurstLength | /* !! if 4xPBL is selected for Tx or Rx it is applied for the other */
- 8010cec: 4311 orrs r1, r2
- ETH_InitStruct->ETH_TxDMABurstLength |
- 8010cee: f8d4 20b0 ldr.w r2, [r4, #176] ; 0xb0
- 8010cf2: 4311 orrs r1, r2
- (ETH_InitStruct->ETH_DescriptorSkipLength << 2) |
- 8010cf4: f8d4 20b8 ldr.w r2, [r4, #184] ; 0xb8
- 8010cf8: 430a orrs r2, r1
- 8010cfa: f8d4 10b4 ldr.w r1, [r4, #180] ; 0xb4
- /* Set the FB bit according to ETH_FixedBurst value */
- /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
- /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
- /* Set the DSL bit according to ETH_DesciptorSkipLength value */
- /* Set the PR and DA bits according to ETH_DMAArbitration value */
- ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats |
- 8010cfe: ea42 0281 orr.w r2, r2, r1, lsl #2
- 8010d02: 601a str r2, [r3, #0]
- ETH_InitStruct->ETH_DMAArbitration |
- ETH_DMABMR_USP); /* Enable use of separate PBL for Rx and Tx */
-
- #ifdef USE_ENHANCED_DMA_DESCRIPTORS
- /* Enable the Enhanced DMA descriptors */
- ETH->DMABMR |= ETH_DMABMR_EDE;
- 8010d04: 681a ldr r2, [r3, #0]
- 8010d06: f042 0280 orr.w r2, r2, #128 ; 0x80
- 8010d0a: 601a str r2, [r3, #0]
- #endif /* USE_ENHANCED_DMA_DESCRIPTORS */
-
- /* Return Ethernet configuration success */
- return ETH_SUCCESS;
- 8010d0c: 2001 movs r0, #1
- }
- 8010d0e: b007 add sp, #28
- 8010d10: bdf0 pop {r4, r5, r6, r7, pc}
- 8010d12: bf00 nop
- 8010d14: 40028000 .word 0x40028000
- 8010d18: feced300 .word 0xfeced300
- 8010d1c: 00e4e1bf .word 0x00e4e1bf
- 8010d20: fde9f140 .word 0xfde9f140
- 8010d24: 017d783f .word 0x017d783f
- 8010d28: fc6c7900 .word 0xfc6c7900
- 8010d2c: 026259ff .word 0x026259ff
- 8010d30: fa0a1f00 .word 0xfa0a1f00
- 8010d34: 02faf07f .word 0x02faf07f
- 8010d38: 000fffff .word 0x000fffff
- 8010d3c: 0004fffe .word 0x0004fffe
- 8010d40: 0004ffff .word 0x0004ffff
- 8010d44: ff20810f .word 0xff20810f
- 8010d48: f8de3f23 .word 0xf8de3f23
- 08010d4c <NVIC_SystemReset>:
- 8010d4c: f3bf 8f4f dsb sy
- (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
- 8010d50: 4a04 ldr r2, [pc, #16] ; (8010d64 <NVIC_SystemReset+0x18>)
- 8010d52: 4b05 ldr r3, [pc, #20] ; (8010d68 <NVIC_SystemReset+0x1c>)
- 8010d54: 68d1 ldr r1, [r2, #12]
- 8010d56: f401 61e0 and.w r1, r1, #1792 ; 0x700
- 8010d5a: 430b orrs r3, r1
- __STATIC_INLINE void NVIC_SystemReset(void)
- //static inline void NVIC_SystemReset(void)
- {
- __DSB(); /* Ensure all outstanding memory accesses included
- buffered write are completed before reset */
- SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
- 8010d5c: 60d3 str r3, [r2, #12]
- 8010d5e: f3bf 8f4f dsb sy
- 8010d62: e7fe b.n 8010d62 <NVIC_SystemReset+0x16>
- 8010d64: e000ed00 .word 0xe000ed00
- 8010d68: 05fa0004 .word 0x05fa0004
- 08010d6c <UpdateTimeout_Handler>:
- void UpdateTimeout_Handler(void)
- {
- static char lcdbuf[32] = {0};
- static uint8_t time = UPDATE_TIMEOUT;
- if ((fUpload) || (fInvalidFw)) return;
- 8010d6c: 4b07 ldr r3, [pc, #28] ; (8010d8c <UpdateTimeout_Handler+0x20>)
- 8010d6e: 781b ldrb r3, [r3, #0]
- 8010d70: b953 cbnz r3, 8010d88 <UpdateTimeout_Handler+0x1c>
- 8010d72: 4b07 ldr r3, [pc, #28] ; (8010d90 <UpdateTimeout_Handler+0x24>)
- 8010d74: 781b ldrb r3, [r3, #0]
- 8010d76: b93b cbnz r3, 8010d88 <UpdateTimeout_Handler+0x1c>
- if (time == 0) {
- 8010d78: 4b06 ldr r3, [pc, #24] ; (8010d94 <UpdateTimeout_Handler+0x28>)
- 8010d7a: 781a ldrb r2, [r3, #0]
- 8010d7c: b912 cbnz r2, 8010d84 <UpdateTimeout_Handler+0x18>
- UpdateTimeoutFlag = true;
- 8010d7e: 2201 movs r2, #1
- 8010d80: 4b05 ldr r3, [pc, #20] ; (8010d98 <UpdateTimeout_Handler+0x2c>)
- 8010d82: e000 b.n 8010d86 <UpdateTimeout_Handler+0x1a>
- }
- else {
- time--;
- 8010d84: 3a01 subs r2, #1
- 8010d86: 701a strb r2, [r3, #0]
- 8010d88: 4770 bx lr
- 8010d8a: bf00 nop
- 8010d8c: 20006db0 .word 0x20006db0
- 8010d90: 20006dc4 .word 0x20006dc4
- 8010d94: 20000115 .word 0x20000115
- 8010d98: 20006db9 .word 0x20006db9
- 08010d9c <main>:
- extern SETTINGS_t sSettings;
- void UpdateTimeout_Handler(void);
- void main(void)
- {
- 8010d9c: b570 push {r4, r5, r6, lr}
- uint8_t bootTry;
- uint8_t loadMode;
- WDG_Init();
- 8010d9e: f7fe ff45 bl 800fc2c <WDG_Init>
- IO_Init();
- 8010da2: f7fe fcad bl 800f700 <IO_Init>
- InitUSART();
- 8010da6: f7fe fee9 bl 800fb7c <InitUSART>
- /* Enable PWR peripheral clock */
- RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
- 8010daa: 2101 movs r1, #1
- 8010dac: f04f 5080 mov.w r0, #268435456 ; 0x10000000
- 8010db0: f7f9 f8fc bl 8009fac <RCC_APB1PeriphClockCmd>
- /* Allow access to BKP Domain */
- PWR_BackupAccessCmd(ENABLE);
- 8010db4: 2001 movs r0, #1
- 8010db6: f7f9 f8a1 bl 8009efc <PWR_BackupAccessCmd>
- /* Включаем тактирование модуля CRC */
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
- 8010dba: 2101 movs r1, #1
- 8010dbc: f44f 5080 mov.w r0, #4096 ; 0x1000
- 8010dc0: f7f9 f8e8 bl 8009f94 <RCC_AHB1PeriphClockCmd>
-
- /* Проверка флага, определяющего состояние устройства. */
- /* Флаг установлен - работает Bootloader */
- /* Флаг сброшен - запускается основная программа */
- SETTINGS_Load();
- 8010dc4: f7fe fe44 bl 800fa50 <SETTINGS_Load>
-
- /* Проверка флага bootTry. Если флаг установлен, значит произошел сбой в
- основной прошивке. Нужно загружать bootloader и ждать обновления ПО */
- /* TODO remove if tested */
- //bootTry = sSettings.bootParams.bootTry;
- loadMode = RTC_ReadBackupRegister(RTC_BKP_DR1);
- 8010dc8: 2001 movs r0, #1
- 8010dca: f7f9 f923 bl 800a014 <RTC_ReadBackupRegister>
- 8010dce: b2c5 uxtb r5, r0
- bootTry = RTC_ReadBackupRegister(RTC_BKP_DR2);
- 8010dd0: 2002 movs r0, #2
- 8010dd2: f7f9 f91f bl 800a014 <RTC_ReadBackupRegister>
- 8010dd6: b2c4 uxtb r4, r0
- printf("loadMode: %d\r\nbootTry: %d\r\n", loadMode, bootTry);
- 8010dd8: 4629 mov r1, r5
- 8010dda: 485f ldr r0, [pc, #380] ; (8010f58 <main+0x1bc>)
- 8010ddc: 4622 mov r2, r4
- 8010dde: f000 fc49 bl 8011674 <tfp_printf>
-
- if (bootTry > 1)
- 8010de2: 2c01 cmp r4, #1
- 8010de4: d91a bls.n 8010e1c <main+0x80>
- {
- bootTry--;
- 8010de6: 1e61 subs r1, r4, #1
- RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
- 8010de8: 2002 movs r0, #2
- 8010dea: b2c9 uxtb r1, r1
- 8010dec: f7f9 f902 bl 8009ff4 <RTC_WriteBackupRegister>
- /* Check if valid stack address (RAM address) then jump to user application */
- if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
- 8010df0: 4a5a ldr r2, [pc, #360] ; (8010f5c <main+0x1c0>)
- 8010df2: 4b5b ldr r3, [pc, #364] ; (8010f60 <main+0x1c4>)
- 8010df4: 6811 ldr r1, [r2, #0]
- 8010df6: 400b ands r3, r1
- 8010df8: f1b3 5f00 cmp.w r3, #536870912 ; 0x20000000
- 8010dfc: d10a bne.n 8010e14 <main+0x78>
- {
- JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
- 8010dfe: 4b59 ldr r3, [pc, #356] ; (8010f64 <main+0x1c8>)
- 8010e00: 4959 ldr r1, [pc, #356] ; (8010f68 <main+0x1cc>)
- 8010e02: 681b ldr r3, [r3, #0]
- 8010e04: 600b str r3, [r1, #0]
- Jump_To_App = (pFunction) JumpAdd;
- 8010e06: 4959 ldr r1, [pc, #356] ; (8010f6c <main+0x1d0>)
- __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
- 8010e08: 6812 ldr r2, [r2, #0]
- /* Check if valid stack address (RAM address) then jump to user application */
- if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
- {
- JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
- Jump_To_App = (pFunction) JumpAdd;
- 8010e0a: 600b str r3, [r1, #0]
- \param [in] topOfMainStack Main Stack Pointer value to set
- */
- __attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
- {
- __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp");
- 8010e0c: f382 8808 msr MSP, r2
- __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
- Jump_To_App();
- 8010e10: 4798 blx r3
- 8010e12: e00f b.n 8010e34 <main+0x98>
- }
- else {
- /* Флеш пустая, нечего загружать, висим в аварийном режиме */
- fInvalidFw = 1;
- 8010e14: 4b56 ldr r3, [pc, #344] ; (8010f70 <main+0x1d4>)
- 8010e16: 2201 movs r2, #1
- 8010e18: 701a strb r2, [r3, #0]
- 8010e1a: e00b b.n 8010e34 <main+0x98>
- PRINT_USART("\n\rFW empty. Started bootloader\n\r");
- }
- }
- else if (bootTry == 1)
- 8010e1c: d10a bne.n 8010e34 <main+0x98>
- {
- fBootFailed = 1;
- 8010e1e: 4b55 ldr r3, [pc, #340] ; (8010f74 <main+0x1d8>)
- PRINT_USART("\n\rFW boot failed. Started bootloader\n\r");
- bootTry = 0;
- loadMode = 1;
- RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
- 8010e20: 2002 movs r0, #2
- 8010e22: 2100 movs r1, #0
- PRINT_USART("\n\rFW empty. Started bootloader\n\r");
- }
- }
- else if (bootTry == 1)
- {
- fBootFailed = 1;
- 8010e24: 701c strb r4, [r3, #0]
- PRINT_USART("\n\rFW boot failed. Started bootloader\n\r");
- bootTry = 0;
- loadMode = 1;
- RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
- 8010e26: f7f9 f8e5 bl 8009ff4 <RTC_WriteBackupRegister>
- RTC_WriteBackupRegister(RTC_BKP_DR1, loadMode);
- 8010e2a: 4620 mov r0, r4
- 8010e2c: 4621 mov r1, r4
- 8010e2e: f7f9 f8e1 bl 8009ff4 <RTC_WriteBackupRegister>
- 8010e32: e018 b.n 8010e66 <main+0xca>
- }
- /* Флаг не установлен прыгаем на основную программу */
- if (loadMode == 0)
- 8010e34: b9bd cbnz r5, 8010e66 <main+0xca>
- {
- printf("Run main FW\n\r");
- 8010e36: 4850 ldr r0, [pc, #320] ; (8010f78 <main+0x1dc>)
- 8010e38: f000 fc1c bl 8011674 <tfp_printf>
- //printf("*(__IO uint32_t*)(USER_FLASH_FIRST_PAGE_ADDRESS + 4) = 0x%X\n\r", *(__IO uint32_t*)(USER_FLASH_FIRST_PAGE_ADDRESS + 4));
- /* Set bootTry flag every time to ensure that
- * IAP will starts again if FW is corrupted */
- bootTry = BOOT_TRY;
- RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
- 8010e3c: 2106 movs r1, #6
- 8010e3e: 2002 movs r0, #2
- 8010e40: f7f9 f8d8 bl 8009ff4 <RTC_WriteBackupRegister>
- /* Check if valid stack address (RAM address) then jump to user application */
- if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
- 8010e44: 4a45 ldr r2, [pc, #276] ; (8010f5c <main+0x1c0>)
- 8010e46: 4b46 ldr r3, [pc, #280] ; (8010f60 <main+0x1c4>)
- 8010e48: 6811 ldr r1, [r2, #0]
- 8010e4a: 400b ands r3, r1
- 8010e4c: f1b3 5f00 cmp.w r3, #536870912 ; 0x20000000
- 8010e50: d109 bne.n 8010e66 <main+0xca>
- {
- /* Jump to user application */
- JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
- 8010e52: 4b44 ldr r3, [pc, #272] ; (8010f64 <main+0x1c8>)
- 8010e54: 4944 ldr r1, [pc, #272] ; (8010f68 <main+0x1cc>)
- 8010e56: 681b ldr r3, [r3, #0]
- 8010e58: 600b str r3, [r1, #0]
- Jump_To_App = (pFunction) JumpAdd;
- 8010e5a: 4944 ldr r1, [pc, #272] ; (8010f6c <main+0x1d0>)
- /* Initialize user application's Stack Pointer */
- __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
- 8010e5c: 6812 ldr r2, [r2, #0]
- /* Check if valid stack address (RAM address) then jump to user application */
- if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
- {
- /* Jump to user application */
- JumpAdd = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
- Jump_To_App = (pFunction) JumpAdd;
- 8010e5e: 600b str r3, [r1, #0]
- 8010e60: f382 8808 msr MSP, r2
- /* Initialize user application's Stack Pointer */
- __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
- Jump_To_App();
- 8010e64: 4798 blx r3
- */
- __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
- {
- if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
- SysTick->LOAD = ticks - 1; /* set reload register */
- 8010e66: 4b45 ldr r3, [pc, #276] ; (8010f7c <main+0x1e0>)
- 8010e68: 4a45 ldr r2, [pc, #276] ; (8010f80 <main+0x1e4>)
- 8010e6a: 605a str r2, [r3, #4]
- \param [in] priority Priority to set.
- */
- __STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
- {
- if(IRQn < 0) {
- SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
- 8010e6c: 4a45 ldr r2, [pc, #276] ; (8010f84 <main+0x1e8>)
- 8010e6e: 21f0 movs r1, #240 ; 0xf0
- 8010e70: f882 1023 strb.w r1, [r2, #35] ; 0x23
- {
- if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
- SysTick->LOAD = ticks - 1; /* set reload register */
- NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
- SysTick->VAL = 0; /* Load the SysTick Counter Value */
- 8010e74: 2200 movs r2, #0
- 8010e76: 609a str r2, [r3, #8]
- SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
- 8010e78: 2207 movs r2, #7
- 8010e7a: 601a str r2, [r3, #0]
- }
-
- /* Загружается Bootloader... */
-
- SysTick_Config(120000);
- LED_Init();
- 8010e7c: f7fe fc84 bl 800f788 <LED_Init>
- PRINT_USART("\n\rBootloader starting... \n\r");
- LED_On(RED_STATUS);
- 8010e80: 2001 movs r0, #1
- 8010e82: f7fe fc65 bl 800f750 <LED_On>
- ETH_BSP_Config();
- 8010e86: f7ff fb03 bl 8010490 <ETH_BSP_Config>
- LwIP_Init();
- 8010e8a: f7ff fa61 bl 8010350 <LwIP_Init>
- IAP_httpd_init();
- 8010e8e: f7ff fa49 bl 8010324 <IAP_httpd_init>
- CRC_Init();
- 8010e92: f7fe fbb3 bl 800f5fc <CRC_Init>
- //Если нажата DEF начинаем обновление с sd
- if (IO_BtnDefaultPressed())
- 8010e96: f7fe fc4d bl 800f734 <IO_BtnDefaultPressed>
- 8010e9a: b938 cbnz r0, 8010eac <main+0x110>
- {
- // IAPviaETH = false;
- // timer_AddFunction(500, &LED_Blinky_Yellow);
- // SD_NVIC_Init();
- } else {
- IAPviaETH = true;
- 8010e9c: 4b3a ldr r3, [pc, #232] ; (8010f88 <main+0x1ec>)
- timer_AddFunction(500, &LED_Blinky_Green);
- 8010e9e: 493b ldr r1, [pc, #236] ; (8010f8c <main+0x1f0>)
- {
- // IAPviaETH = false;
- // timer_AddFunction(500, &LED_Blinky_Yellow);
- // SD_NVIC_Init();
- } else {
- IAPviaETH = true;
- 8010ea0: 2201 movs r2, #1
- timer_AddFunction(500, &LED_Blinky_Green);
- 8010ea2: f44f 70fa mov.w r0, #500 ; 0x1f4
- {
- // IAPviaETH = false;
- // timer_AddFunction(500, &LED_Blinky_Yellow);
- // SD_NVIC_Init();
- } else {
- IAPviaETH = true;
- 8010ea6: 701a strb r2, [r3, #0]
- timer_AddFunction(500, &LED_Blinky_Green);
- 8010ea8: f7fe fe08 bl 800fabc <timer_AddFunction>
- }
-
- /* Check if valid stack address (RAM address) */
- if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000) {
- 8010eac: 4b2b ldr r3, [pc, #172] ; (8010f5c <main+0x1c0>)
- 8010eae: 681a ldr r2, [r3, #0]
- 8010eb0: 4b2b ldr r3, [pc, #172] ; (8010f60 <main+0x1c4>)
- 8010eb2: 4013 ands r3, r2
- 8010eb4: f1b3 5f00 cmp.w r3, #536870912 ; 0x20000000
- 8010eb8: d105 bne.n 8010ec6 <main+0x12a>
- timer_AddFunction(1000, &UpdateTimeout_Handler);
- 8010eba: f44f 707a mov.w r0, #1000 ; 0x3e8
- 8010ebe: 4934 ldr r1, [pc, #208] ; (8010f90 <main+0x1f4>)
- 8010ec0: f7fe fdfc bl 800fabc <timer_AddFunction>
- 8010ec4: e002 b.n 8010ecc <main+0x130>
- }
- else {
- /* Флеш пустая, нечего загружать, висим в аварийном режиме */
- fInvalidFw = 1;
- 8010ec6: 4b2a ldr r3, [pc, #168] ; (8010f70 <main+0x1d4>)
- 8010ec8: 2201 movs r2, #1
- 8010eca: 701a strb r2, [r3, #0]
- while (1)
- {
- timer_Main();
- if (IAPviaETH) { // Обновление по ETH
- 8010ecc: 4c2e ldr r4, [pc, #184] ; (8010f88 <main+0x1ec>)
- {
- /* process received ethernet packet */
- LwIP_Pkt_Handle();
- }
- /* handle periodic timers for LwIP */
- LwIP_Periodic_Handle(LocalTime);
- 8010ece: 4d31 ldr r5, [pc, #196] ; (8010f94 <main+0x1f8>)
-
- if (fDoneReset)
- 8010ed0: 4e31 ldr r6, [pc, #196] ; (8010f98 <main+0x1fc>)
- }
- while (1)
- {
- timer_Main();
- 8010ed2: f7fe fe11 bl 800faf8 <timer_Main>
- if (IAPviaETH) { // Обновление по ETH
- 8010ed6: 7823 ldrb r3, [r4, #0]
- 8010ed8: b333 cbz r3, 8010f28 <main+0x18c>
- /* check if any packet received */
- if (ETH_CheckFrameReceived())
- 8010eda: f7ff fcf1 bl 80108c0 <ETH_CheckFrameReceived>
- 8010ede: b108 cbz r0, 8010ee4 <main+0x148>
- {
- /* process received ethernet packet */
- LwIP_Pkt_Handle();
- 8010ee0: f7ff fa76 bl 80103d0 <LwIP_Pkt_Handle>
- }
- /* handle periodic timers for LwIP */
- LwIP_Periodic_Handle(LocalTime);
- 8010ee4: 6828 ldr r0, [r5, #0]
- 8010ee6: f7ff fabd bl 8010464 <LwIP_Periodic_Handle>
-
- if (fDoneReset)
- 8010eea: 7833 ldrb r3, [r6, #0]
- 8010eec: b18b cbz r3, 8010f12 <main+0x176>
- {
- resetCounter++;
- 8010eee: 4a2b ldr r2, [pc, #172] ; (8010f9c <main+0x200>)
- 8010ef0: 6813 ldr r3, [r2, #0]
- 8010ef2: 3301 adds r3, #1
- 8010ef4: 6013 str r3, [r2, #0]
- if (resetCounter > 100000)
- 8010ef6: 4a2a ldr r2, [pc, #168] ; (8010fa0 <main+0x204>)
- 8010ef8: 4293 cmp r3, r2
- 8010efa: d90a bls.n 8010f12 <main+0x176>
- {
- loadMode = 0;
- bootTry = BOOT_TRY;
- RTC_WriteBackupRegister(RTC_BKP_DR1, loadMode);
- 8010efc: 2001 movs r0, #1
- 8010efe: 2100 movs r1, #0
- 8010f00: f7f9 f878 bl 8009ff4 <RTC_WriteBackupRegister>
- RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
- 8010f04: 2002 movs r0, #2
- 8010f06: 2106 movs r1, #6
- 8010f08: f7f9 f874 bl 8009ff4 <RTC_WriteBackupRegister>
- /* Set FW update flag */
- RTC_WriteBackupRegister(RTC_BKP_DR3, 1);
- 8010f0c: 2003 movs r0, #3
- 8010f0e: 2101 movs r1, #1
- 8010f10: e01e b.n 8010f50 <main+0x1b4>
- NVIC_SystemReset();
- }
- }
- if (fErrorReset)
- 8010f12: 4b24 ldr r3, [pc, #144] ; (8010fa4 <main+0x208>)
- 8010f14: 781b ldrb r3, [r3, #0]
- 8010f16: b13b cbz r3, 8010f28 <main+0x18c>
- {
- resetCounter++;
- 8010f18: 4a20 ldr r2, [pc, #128] ; (8010f9c <main+0x200>)
- 8010f1a: 6813 ldr r3, [r2, #0]
- 8010f1c: 3301 adds r3, #1
- 8010f1e: 6013 str r3, [r2, #0]
- if (resetCounter > 100000) {
- 8010f20: 4a1f ldr r2, [pc, #124] ; (8010fa0 <main+0x204>)
- 8010f22: 4293 cmp r3, r2
- 8010f24: d900 bls.n 8010f28 <main+0x18c>
- 8010f26: e015 b.n 8010f54 <main+0x1b8>
- }
- }
- }
- //Если нажата DEF переходим в основную прошивку
- if (IO_BtnDefaultPressed() || UpdateTimeoutFlag)
- 8010f28: f7fe fc04 bl 800f734 <IO_BtnDefaultPressed>
- 8010f2c: b918 cbnz r0, 8010f36 <main+0x19a>
- 8010f2e: 4b1e ldr r3, [pc, #120] ; (8010fa8 <main+0x20c>)
- 8010f30: 781b ldrb r3, [r3, #0]
- 8010f32: 2b00 cmp r3, #0
- 8010f34: d0cd beq.n 8010ed2 <main+0x136>
- {
- if (!fUpload && ((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) != 0xFFFFFFFF)) {
- 8010f36: 4b1d ldr r3, [pc, #116] ; (8010fac <main+0x210>)
- 8010f38: 7819 ldrb r1, [r3, #0]
- 8010f3a: 2900 cmp r1, #0
- 8010f3c: d1c9 bne.n 8010ed2 <main+0x136>
- 8010f3e: 4b07 ldr r3, [pc, #28] ; (8010f5c <main+0x1c0>)
- 8010f40: 681b ldr r3, [r3, #0]
- 8010f42: 3301 adds r3, #1
- 8010f44: d0c5 beq.n 8010ed2 <main+0x136>
- PRINT_USART("\n\rUpdate timeout... Return to main FW\n\r");
- loadMode = 0;
- bootTry = BOOT_TRY;
- RTC_WriteBackupRegister(RTC_BKP_DR1, loadMode);
- 8010f46: 2001 movs r0, #1
- 8010f48: f7f9 f854 bl 8009ff4 <RTC_WriteBackupRegister>
- RTC_WriteBackupRegister(RTC_BKP_DR2, bootTry);
- 8010f4c: 2002 movs r0, #2
- 8010f4e: 2106 movs r1, #6
- 8010f50: f7f9 f850 bl 8009ff4 <RTC_WriteBackupRegister>
- NVIC_SystemReset();
- 8010f54: f7ff fefa bl 8010d4c <NVIC_SystemReset>
- 8010f58: 0801363f .word 0x0801363f
- 8010f5c: 08020000 .word 0x08020000
- 8010f60: 2ffe0000 .word 0x2ffe0000
- 8010f64: 08020004 .word 0x08020004
- 8010f68: 2000c998 .word 0x2000c998
- 8010f6c: 2000c994 .word 0x2000c994
- 8010f70: 20006dc4 .word 0x20006dc4
- 8010f74: 20006dba .word 0x20006dba
- 8010f78: 0801365b .word 0x0801365b
- 8010f7c: e000e010 .word 0xe000e010
- 8010f80: 0001d4bf .word 0x0001d4bf
- 8010f84: e000ed00 .word 0xe000ed00
- 8010f88: 20006db8 .word 0x20006db8
- 8010f8c: 0800f7f5 .word 0x0800f7f5
- 8010f90: 08010d6d .word 0x08010d6d
- 8010f94: 20006db4 .word 0x20006db4
- 8010f98: 20006dbc .word 0x20006dbc
- 8010f9c: 20006dc0 .word 0x20006dc0
- 8010fa0: 000186a0 .word 0x000186a0
- 8010fa4: 20006dbb .word 0x20006dbb
- 8010fa8: 20006db9 .word 0x20006db9
- 8010fac: 20006db0 .word 0x20006db0
- 08010fb0 <Time_Update>:
- * @param None
- * @retval None
- */
- void Time_Update(void)
- {
- LocalTime += SYSTEMTICK_PERIOD_MS;
- 8010fb0: 4b02 ldr r3, [pc, #8] ; (8010fbc <Time_Update+0xc>)
- 8010fb2: 681a ldr r2, [r3, #0]
- 8010fb4: 3201 adds r2, #1
- 8010fb6: 601a str r2, [r3, #0]
- 8010fb8: 4770 bx lr
- 8010fba: bf00 nop
- 8010fbc: 20006db4 .word 0x20006db4
- 08010fc0 <sys_now>:
- /**
- * @brief
- */
- u32_t sys_now(void) {
- return LocalTime;
- 8010fc0: 4b01 ldr r3, [pc, #4] ; (8010fc8 <sys_now+0x8>)
- 8010fc2: 6818 ldr r0, [r3, #0]
- }
- 8010fc4: 4770 bx lr
- 8010fc6: bf00 nop
- 8010fc8: 20006db4 .word 0x20006db4
- 08010fcc <NMI_Handler>:
- * @brief This function handles NMI exception.
- * @param None
- * @retval None
- */
- void NMI_Handler(void)
- {
- 8010fcc: 4770 bx lr
- 08010fce <HardFault_Handler>:
- * @brief This function handles Hard Fault exception.
- * @param None
- * @retval None
- */
- void HardFault_Handler(void)
- {
- 8010fce: e7fe b.n 8010fce <HardFault_Handler>
- 08010fd0 <MemManage_Handler>:
- * @brief This function handles Memory Manage exception.
- * @param None
- * @retval None
- */
- void MemManage_Handler(void)
- {
- 8010fd0: e7fe b.n 8010fd0 <MemManage_Handler>
- 08010fd2 <BusFault_Handler>:
- * @brief This function handles Bus Fault exception.
- * @param None
- * @retval None
- */
- void BusFault_Handler(void)
- {
- 8010fd2: e7fe b.n 8010fd2 <BusFault_Handler>
- 08010fd4 <UsageFault_Handler>:
- * @brief This function handles Usage Fault exception.
- * @param None
- * @retval None
- */
- void UsageFault_Handler(void)
- {
- 8010fd4: e7fe b.n 8010fd4 <UsageFault_Handler>
- 08010fd6 <DebugMon_Handler>:
- * @brief This function handles Debug Monitor exception.
- * @param None
- * @retval None
- */
- void DebugMon_Handler(void)
- {
- 8010fd6: 4770 bx lr
- 08010fd8 <ulli2a>:
- #ifdef PRINTF_LONG_LONG_SUPPORT
- static void _TFP_GCC_NO_INLINE_ ulli2a(
- unsigned long long int num, struct param *p)
- {
- 8010fd8: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
- int n = 0;
- unsigned long long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 8010fdc: 68d3 ldr r3, [r2, #12]
- static void _TFP_GCC_NO_INLINE_ ulli2a(
- unsigned long long int num, struct param *p)
- {
- int n = 0;
- unsigned long long int d = 1;
- char *bf = p->bf;
- 8010fde: f8d2 b010 ldr.w fp, [r2, #16]
- #ifdef PRINTF_LONG_LONG_SUPPORT
- static void _TFP_GCC_NO_INLINE_ ulli2a(
- unsigned long long int num, struct param *p)
- {
- 8010fe2: 4681 mov r9, r0
- 8010fe4: 468a mov sl, r1
- 8010fe6: 4690 mov r8, r2
- int n = 0;
- unsigned long long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 8010fe8: 461e mov r6, r3
- 8010fea: 2700 movs r7, #0
- #ifdef PRINTF_LONG_LONG_SUPPORT
- static void _TFP_GCC_NO_INLINE_ ulli2a(
- unsigned long long int num, struct param *p)
- {
- int n = 0;
- unsigned long long int d = 1;
- 8010fec: 2401 movs r4, #1
- 8010fee: 2500 movs r5, #0
- char *bf = p->bf;
- while (num / d >= p->base)
- 8010ff0: e006 b.n 8011000 <ulli2a+0x28>
- d *= p->base;
- 8010ff2: fb04 f307 mul.w r3, r4, r7
- 8010ff6: fb06 3305 mla r3, r6, r5, r3
- 8010ffa: fba4 4506 umull r4, r5, r4, r6
- 8010ffe: 195d adds r5, r3, r5
- unsigned long long int num, struct param *p)
- {
- int n = 0;
- unsigned long long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 8011000: 4648 mov r0, r9
- 8011002: 4651 mov r1, sl
- 8011004: 4622 mov r2, r4
- 8011006: 462b mov r3, r5
- 8011008: f7f7 fcd8 bl 80089bc <__aeabi_uldivmod>
- 801100c: 42b9 cmp r1, r7
- 801100e: bf08 it eq
- 8011010: 42b0 cmpeq r0, r6
- 8011012: d2ee bcs.n 8010ff2 <ulli2a+0x1a>
- 8011014: 2600 movs r6, #0
- 8011016: e02d b.n 8011074 <ulli2a+0x9c>
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- 8011018: 4622 mov r2, r4
- 801101a: 462b mov r3, r5
- 801101c: 4648 mov r0, r9
- 801101e: 4651 mov r1, sl
- 8011020: f7f7 fccc bl 80089bc <__aeabi_uldivmod>
- num %= d;
- 8011024: 4651 mov r1, sl
- 8011026: 4622 mov r2, r4
- 8011028: 462b mov r3, r5
- unsigned long long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- 801102a: 4607 mov r7, r0
- num %= d;
- 801102c: 4648 mov r0, r9
- 801102e: f7f7 fcc5 bl 80089bc <__aeabi_uldivmod>
- d /= p->base;
- 8011032: 4620 mov r0, r4
- 8011034: 4629 mov r1, r5
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- num %= d;
- 8011036: 4691 mov r9, r2
- 8011038: 469a mov sl, r3
- d /= p->base;
- 801103a: f8d8 200c ldr.w r2, [r8, #12]
- 801103e: 2300 movs r3, #0
- 8011040: f7f7 fcbc bl 80089bc <__aeabi_uldivmod>
- 8011044: 4604 mov r4, r0
- 8011046: 460d mov r5, r1
- if (n || dgt > 0 || d == 0) {
- 8011048: b926 cbnz r6, 8011054 <ulli2a+0x7c>
- 801104a: 2f00 cmp r7, #0
- 801104c: dc02 bgt.n 8011054 <ulli2a+0x7c>
- 801104e: ea54 0305 orrs.w r3, r4, r5
- 8011052: d1e1 bne.n 8011018 <ulli2a+0x40>
- *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
- 8011054: 2f09 cmp r7, #9
- 8011056: b2fa uxtb r2, r7
- 8011058: dd07 ble.n 801106a <ulli2a+0x92>
- 801105a: f898 3000 ldrb.w r3, [r8]
- 801105e: f013 0f04 tst.w r3, #4
- 8011062: bf0c ite eq
- 8011064: 2357 moveq r3, #87 ; 0x57
- 8011066: 2337 movne r3, #55 ; 0x37
- 8011068: e000 b.n 801106c <ulli2a+0x94>
- 801106a: 2330 movs r3, #48 ; 0x30
- 801106c: 189b adds r3, r3, r2
- 801106e: f80b 3b01 strb.w r3, [fp], #1
- ++n;
- 8011072: 3601 adds r6, #1
- int n = 0;
- unsigned long long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- 8011074: ea54 0305 orrs.w r3, r4, r5
- 8011078: d1ce bne.n 8011018 <ulli2a+0x40>
- if (n || dgt > 0 || d == 0) {
- *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
- ++n;
- }
- }
- *bf = 0;
- 801107a: 2300 movs r3, #0
- 801107c: f88b 3000 strb.w r3, [fp]
- 8011080: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 08011084 <uli2a>:
- }
- #endif
- #ifdef PRINTF_LONG_SUPPORT
- static void uli2a(unsigned long int num, struct param *p)
- {
- 8011084: b570 push {r4, r5, r6, lr}
- int n = 0;
- unsigned long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 8011086: 68ca ldr r2, [r1, #12]
- #ifdef PRINTF_LONG_SUPPORT
- static void uli2a(unsigned long int num, struct param *p)
- {
- int n = 0;
- unsigned long int d = 1;
- char *bf = p->bf;
- 8011088: 690c ldr r4, [r1, #16]
- #ifdef PRINTF_LONG_SUPPORT
- static void uli2a(unsigned long int num, struct param *p)
- {
- int n = 0;
- unsigned long int d = 1;
- 801108a: 2301 movs r3, #1
- char *bf = p->bf;
- while (num / d >= p->base)
- 801108c: e000 b.n 8011090 <uli2a+0xc>
- d *= p->base;
- 801108e: 4353 muls r3, r2
- static void uli2a(unsigned long int num, struct param *p)
- {
- int n = 0;
- unsigned long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 8011090: fbb0 f5f3 udiv r5, r0, r3
- 8011094: 4295 cmp r5, r2
- 8011096: d2fa bcs.n 801108e <uli2a+0xa>
- 8011098: 2500 movs r5, #0
- 801109a: e01a b.n 80110d2 <uli2a+0x4e>
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- num %= d;
- d /= p->base;
- 801109c: 68ce ldr r6, [r1, #12]
- unsigned long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- 801109e: fbb0 f2f3 udiv r2, r0, r3
- num %= d;
- 80110a2: fb03 0012 mls r0, r3, r2, r0
- d /= p->base;
- 80110a6: fbb3 f3f6 udiv r3, r3, r6
- if (n || dgt > 0 || d == 0) {
- 80110aa: b91d cbnz r5, 80110b4 <uli2a+0x30>
- 80110ac: 2a00 cmp r2, #0
- 80110ae: dc01 bgt.n 80110b4 <uli2a+0x30>
- 80110b0: 2b00 cmp r3, #0
- 80110b2: d1f3 bne.n 801109c <uli2a+0x18>
- *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
- 80110b4: 2a09 cmp r2, #9
- 80110b6: b2d6 uxtb r6, r2
- 80110b8: dd06 ble.n 80110c8 <uli2a+0x44>
- 80110ba: 780a ldrb r2, [r1, #0]
- 80110bc: f012 0f04 tst.w r2, #4
- 80110c0: bf0c ite eq
- 80110c2: 2257 moveq r2, #87 ; 0x57
- 80110c4: 2237 movne r2, #55 ; 0x37
- 80110c6: e000 b.n 80110ca <uli2a+0x46>
- 80110c8: 2230 movs r2, #48 ; 0x30
- 80110ca: 1992 adds r2, r2, r6
- 80110cc: f804 2b01 strb.w r2, [r4], #1
- ++n;
- 80110d0: 3501 adds r5, #1
- int n = 0;
- unsigned long int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- 80110d2: 2b00 cmp r3, #0
- 80110d4: d1e2 bne.n 801109c <uli2a+0x18>
- if (n || dgt > 0 || d == 0) {
- *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
- ++n;
- }
- }
- *bf = 0;
- 80110d6: 7023 strb r3, [r4, #0]
- 80110d8: bd70 pop {r4, r5, r6, pc}
- 080110da <ui2a>:
- uli2a(num, p);
- }
- #endif
- static void ui2a(unsigned int num, struct param *p)
- {
- 80110da: b570 push {r4, r5, r6, lr}
- int n = 0;
- unsigned int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 80110dc: 68ca ldr r2, [r1, #12]
- static void ui2a(unsigned int num, struct param *p)
- {
- int n = 0;
- unsigned int d = 1;
- char *bf = p->bf;
- 80110de: 690c ldr r4, [r1, #16]
- #endif
- static void ui2a(unsigned int num, struct param *p)
- {
- int n = 0;
- unsigned int d = 1;
- 80110e0: 2301 movs r3, #1
- char *bf = p->bf;
- while (num / d >= p->base)
- 80110e2: e000 b.n 80110e6 <ui2a+0xc>
- d *= p->base;
- 80110e4: 4353 muls r3, r2
- static void ui2a(unsigned int num, struct param *p)
- {
- int n = 0;
- unsigned int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- 80110e6: fbb0 f5f3 udiv r5, r0, r3
- 80110ea: 4295 cmp r5, r2
- 80110ec: d2fa bcs.n 80110e4 <ui2a+0xa>
- 80110ee: 2500 movs r5, #0
- 80110f0: e01a b.n 8011128 <ui2a+0x4e>
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- num %= d;
- d /= p->base;
- 80110f2: 68ce ldr r6, [r1, #12]
- unsigned int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- int dgt = num / d;
- 80110f4: fbb0 f2f3 udiv r2, r0, r3
- num %= d;
- 80110f8: fb03 0012 mls r0, r3, r2, r0
- d /= p->base;
- 80110fc: fbb3 f3f6 udiv r3, r3, r6
- if (n || dgt > 0 || d == 0) {
- 8011100: b91d cbnz r5, 801110a <ui2a+0x30>
- 8011102: 2a00 cmp r2, #0
- 8011104: dc01 bgt.n 801110a <ui2a+0x30>
- 8011106: 2b00 cmp r3, #0
- 8011108: d1f3 bne.n 80110f2 <ui2a+0x18>
- *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
- 801110a: 2a09 cmp r2, #9
- 801110c: b2d6 uxtb r6, r2
- 801110e: dd06 ble.n 801111e <ui2a+0x44>
- 8011110: 780a ldrb r2, [r1, #0]
- 8011112: f012 0f04 tst.w r2, #4
- 8011116: bf0c ite eq
- 8011118: 2257 moveq r2, #87 ; 0x57
- 801111a: 2237 movne r2, #55 ; 0x37
- 801111c: e000 b.n 8011120 <ui2a+0x46>
- 801111e: 2230 movs r2, #48 ; 0x30
- 8011120: 1992 adds r2, r2, r6
- 8011122: f804 2b01 strb.w r2, [r4], #1
- ++n;
- 8011126: 3501 adds r5, #1
- int n = 0;
- unsigned int d = 1;
- char *bf = p->bf;
- while (num / d >= p->base)
- d *= p->base;
- while (d != 0) {
- 8011128: 2b00 cmp r3, #0
- 801112a: d1e2 bne.n 80110f2 <ui2a+0x18>
- if (n || dgt > 0 || d == 0) {
- *bf++ = dgt + (dgt < 10 ? '0' : (p->uc ? 'A' : 'a') - 10);
- ++n;
- }
- }
- *bf = 0;
- 801112c: 7023 strb r3, [r4, #0]
- 801112e: bd70 pop {r4, r5, r6, pc}
- 08011130 <putchw>:
- }
- static void putchw(void *putp, putcf putf, struct param *p)
- {
- 8011130: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
- char ch;
- int n = p->width;
- char *bf = p->bf;
- 8011134: 6913 ldr r3, [r2, #16]
- }
- static void putchw(void *putp, putcf putf, struct param *p)
- {
- char ch;
- int n = p->width;
- 8011136: 6854 ldr r4, [r2, #4]
- }
- static void putchw(void *putp, putcf putf, struct param *p)
- {
- 8011138: 4606 mov r6, r0
- 801113a: 460f mov r7, r1
- 801113c: 4615 mov r5, r2
- char ch;
- int n = p->width;
- char *bf = p->bf;
- /* Number of filling characters */
- while (*bf++ && n > 0)
- 801113e: e000 b.n 8011142 <putchw+0x12>
- n--;
- 8011140: 3c01 subs r4, #1
- char ch;
- int n = p->width;
- char *bf = p->bf;
- /* Number of filling characters */
- while (*bf++ && n > 0)
- 8011142: f813 2b01 ldrb.w r2, [r3], #1
- 8011146: b912 cbnz r2, 801114e <putchw+0x1e>
- n--;
- if (p->sign)
- 8011148: 7a2b ldrb r3, [r5, #8]
- 801114a: b91b cbnz r3, 8011154 <putchw+0x24>
- 801114c: e003 b.n 8011156 <putchw+0x26>
- char ch;
- int n = p->width;
- char *bf = p->bf;
- /* Number of filling characters */
- while (*bf++ && n > 0)
- 801114e: 2c00 cmp r4, #0
- 8011150: dcf6 bgt.n 8011140 <putchw+0x10>
- 8011152: e7f9 b.n 8011148 <putchw+0x18>
- n--;
- if (p->sign)
- n--;
- 8011154: 3c01 subs r4, #1
- if (p->alt && p->base == 16)
- 8011156: 782b ldrb r3, [r5, #0]
- 8011158: 0799 lsls r1, r3, #30
- 801115a: d507 bpl.n 801116c <putchw+0x3c>
- 801115c: 68eb ldr r3, [r5, #12]
- 801115e: 2b10 cmp r3, #16
- 8011160: d101 bne.n 8011166 <putchw+0x36>
- n -= 2;
- 8011162: 3c02 subs r4, #2
- 8011164: e002 b.n 801116c <putchw+0x3c>
- else if (p->alt && p->base == 8)
- 8011166: 2b08 cmp r3, #8
- n--;
- 8011168: bf08 it eq
- 801116a: 3c01 subeq r4, #1
- /* Fill with space to align to the right, before alternate or sign */
- if (!p->lz && !p->align_left) {
- 801116c: 782b ldrb r3, [r5, #0]
- 801116e: f013 0f09 tst.w r3, #9
- 8011172: d10d bne.n 8011190 <putchw+0x60>
- 8011174: 46a0 mov r8, r4
- 8011176: e004 b.n 8011182 <putchw+0x52>
- while (n-- > 0)
- putf(putp, ' ');
- 8011178: 4630 mov r0, r6
- 801117a: 2120 movs r1, #32
- 801117c: 47b8 blx r7
- 801117e: f108 38ff add.w r8, r8, #4294967295
- else if (p->alt && p->base == 8)
- n--;
- /* Fill with space to align to the right, before alternate or sign */
- if (!p->lz && !p->align_left) {
- while (n-- > 0)
- 8011182: f1b8 0f00 cmp.w r8, #0
- 8011186: dcf7 bgt.n 8011178 <putchw+0x48>
- return neg ? -fvalue : fvalue;
- }
- static void putchw(void *putp, putcf putf, struct param *p)
- 8011188: 1e63 subs r3, r4, #1
- 801118a: ea24 74e4 bic.w r4, r4, r4, asr #31
- 801118e: 1b1c subs r4, r3, r4
- while (n-- > 0)
- putf(putp, ' ');
- }
- /* print sign */
- if (p->sign)
- 8011190: 7a29 ldrb r1, [r5, #8]
- 8011192: b109 cbz r1, 8011198 <putchw+0x68>
- putf(putp, p->sign);
- 8011194: 4630 mov r0, r6
- 8011196: 47b8 blx r7
- /* Alternate */
- if (p->alt && p->base == 16) {
- 8011198: 782b ldrb r3, [r5, #0]
- 801119a: 079a lsls r2, r3, #30
- 801119c: d512 bpl.n 80111c4 <putchw+0x94>
- 801119e: 68eb ldr r3, [r5, #12]
- 80111a0: 2b10 cmp r3, #16
- 80111a2: d10a bne.n 80111ba <putchw+0x8a>
- putf(putp, '0');
- 80111a4: 2130 movs r1, #48 ; 0x30
- 80111a6: 4630 mov r0, r6
- 80111a8: 47b8 blx r7
- putf(putp, (p->uc ? 'X' : 'x'));
- 80111aa: 782b ldrb r3, [r5, #0]
- 80111ac: f013 0f04 tst.w r3, #4
- 80111b0: 4630 mov r0, r6
- 80111b2: bf0c ite eq
- 80111b4: 2178 moveq r1, #120 ; 0x78
- 80111b6: 2158 movne r1, #88 ; 0x58
- 80111b8: e003 b.n 80111c2 <putchw+0x92>
- } else if (p->alt && p->base == 8) {
- 80111ba: 2b08 cmp r3, #8
- 80111bc: d102 bne.n 80111c4 <putchw+0x94>
- putf(putp, '0');
- 80111be: 4630 mov r0, r6
- 80111c0: 2130 movs r1, #48 ; 0x30
- 80111c2: 47b8 blx r7
- }
- /* Fill with zeros, after alternate or sign */
- if (p->lz) {
- 80111c4: 782b ldrb r3, [r5, #0]
- 80111c6: 07db lsls r3, r3, #31
- 80111c8: d50d bpl.n 80111e6 <putchw+0xb6>
- 80111ca: 46a0 mov r8, r4
- 80111cc: e004 b.n 80111d8 <putchw+0xa8>
- while (n-- > 0)
- putf(putp, '0');
- 80111ce: 4630 mov r0, r6
- 80111d0: 2130 movs r1, #48 ; 0x30
- 80111d2: 47b8 blx r7
- 80111d4: f108 38ff add.w r8, r8, #4294967295
- putf(putp, '0');
- }
- /* Fill with zeros, after alternate or sign */
- if (p->lz) {
- while (n-- > 0)
- 80111d8: f1b8 0f00 cmp.w r8, #0
- 80111dc: dcf7 bgt.n 80111ce <putchw+0x9e>
- return neg ? -fvalue : fvalue;
- }
- static void putchw(void *putp, putcf putf, struct param *p)
- 80111de: 1e63 subs r3, r4, #1
- 80111e0: ea24 74e4 bic.w r4, r4, r4, asr #31
- 80111e4: 1b1c subs r4, r3, r4
- while (n-- > 0)
- putf(putp, '0');
- }
- /* Put actual buffer */
- bf = p->bf;
- 80111e6: f8d5 8010 ldr.w r8, [r5, #16]
- while ((ch = *bf++))
- 80111ea: e001 b.n 80111f0 <putchw+0xc0>
- putf(putp, ch);
- 80111ec: 4630 mov r0, r6
- 80111ee: 47b8 blx r7
- putf(putp, '0');
- }
- /* Put actual buffer */
- bf = p->bf;
- while ((ch = *bf++))
- 80111f0: f818 1b01 ldrb.w r1, [r8], #1
- 80111f4: 2900 cmp r1, #0
- 80111f6: d1f9 bne.n 80111ec <putchw+0xbc>
- putf(putp, ch);
- /* Fill with space to align to the left, after string */
- if (!p->lz && p->align_left) {
- 80111f8: 782b ldrb r3, [r5, #0]
- 80111fa: f003 0309 and.w r3, r3, #9
- 80111fe: 2b08 cmp r3, #8
- 8011200: d106 bne.n 8011210 <putchw+0xe0>
- 8011202: e003 b.n 801120c <putchw+0xdc>
- while (n-- > 0)
- putf(putp, ' ');
- 8011204: 4630 mov r0, r6
- 8011206: 2120 movs r1, #32
- 8011208: 47b8 blx r7
- 801120a: 3c01 subs r4, #1
- while ((ch = *bf++))
- putf(putp, ch);
- /* Fill with space to align to the left, after string */
- if (!p->lz && p->align_left) {
- while (n-- > 0)
- 801120c: 2c00 cmp r4, #0
- 801120e: dcf9 bgt.n 8011204 <putchw+0xd4>
- 8011210: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
- 08011214 <_vsprintf_putcf>:
- };
- static void _vsprintf_putcf(void *p, char c)
- {
- struct _vsprintf_putcf_data *data = (struct _vsprintf_putcf_data*)p;
- data->dest[data->num_chars++] = c;
- 8011214: e890 000c ldmia.w r0, {r2, r3}
- 8011218: 54d1 strb r1, [r2, r3]
- 801121a: 3301 adds r3, #1
- 801121c: 6043 str r3, [r0, #4]
- 801121e: 4770 bx lr
- 08011220 <tfp_format>:
- putf(putp, ' ');
- }
- }
- void tfp_format(void *putp, putcf putf, const char *fmt, va_list va)
- {
- 8011220: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
- 8011224: b09b sub sp, #108 ; 0x6c
- 8011226: 4617 mov r7, r2
- char bf[23]; /* long = 64b on some architectures */
- #else
- char bf[12]; /* int = 32b on some architectures */
- #endif
- char ch;
- p.bf = bf;
- 8011228: aa04 add r2, sp, #16
- putf(putp, ' ');
- }
- }
- void tfp_format(void *putp, putcf putf, const char *fmt, va_list va)
- {
- 801122a: 4605 mov r5, r0
- 801122c: 460e mov r6, r1
- 801122e: 461c mov r4, r3
- char bf[23]; /* long = 64b on some architectures */
- #else
- char bf[12]; /* int = 32b on some architectures */
- #endif
- char ch;
- p.bf = bf;
- 8011230: 920e str r2, [sp, #56] ; 0x38
- while ((ch = *(fmt++))) {
- 8011232: e208 b.n 8011646 <tfp_format+0x426>
- if (ch != '%') {
- 8011234: 2925 cmp r1, #37 ; 0x25
- 8011236: d000 beq.n 801123a <tfp_format+0x1a>
- 8011238: e13a b.n 80114b0 <tfp_format+0x290>
- #endif
- /* Init parameter struct */
- p.lz = 0;
- p.alt = 0;
- p.width = 0;
- p.align_left = 0;
- 801123a: f89d 2028 ldrb.w r2, [sp, #40] ; 0x28
- char lng = 0; /* 1 for long, 2 for long long */
- #endif
- /* Init parameter struct */
- p.lz = 0;
- p.alt = 0;
- p.width = 0;
- 801123e: 2300 movs r3, #0
- p.align_left = 0;
- 8011240: f002 02fc and.w r2, r2, #252 ; 0xfc
- 8011244: f363 02c3 bfi r2, r3, #3, #1
- 8011248: f88d 2028 strb.w r2, [sp, #40] ; 0x28
- p.sign = 0;
- p.prec = 2;
- 801124c: 2102 movs r1, #2
- } else {
- #ifdef PRINTF_LONG_SUPPORT
- char lng = 0; /* 1 for long, 2 for long long */
- #endif
- /* Init parameter struct */
- p.lz = 0;
- 801124e: b2d2 uxtb r2, r2
- 8011250: f002 0c01 and.w ip, r2, #1
- 8011254: f3c2 0040 ubfx r0, r2, #1, #1
- p.alt = 0;
- p.width = 0;
- 8011258: 930b str r3, [sp, #44] ; 0x2c
- p.align_left = 0;
- p.sign = 0;
- 801125a: f88d 3030 strb.w r3, [sp, #48] ; 0x30
- p.prec = 2;
- 801125e: f88d 103c strb.w r1, [sp, #60] ; 0x3c
- 8011262: f3c2 02c0 ubfx r2, r2, #3, #1
- /* Flags */
- while ((ch = *(fmt++))) {
- 8011266: e012 b.n 801128e <tfp_format+0x6e>
- switch (ch) {
- 8011268: 292d cmp r1, #45 ; 0x2d
- 801126a: d00f beq.n 801128c <tfp_format+0x6c>
- 801126c: d804 bhi.n 8011278 <tfp_format+0x58>
- 801126e: 2923 cmp r1, #35 ; 0x23
- 8011270: d008 beq.n 8011284 <tfp_format+0x64>
- 8011272: 292b cmp r1, #43 ; 0x2b
- 8011274: d10f bne.n 8011296 <tfp_format+0x76>
- 8011276: e007 b.n 8011288 <tfp_format+0x68>
- 8011278: 2930 cmp r1, #48 ; 0x30
- 801127a: d000 beq.n 801127e <tfp_format+0x5e>
- 801127c: e00b b.n 8011296 <tfp_format+0x76>
- case '-':
- p.align_left = 1;
- continue;
- case '0':
- p.lz = 1;
- 801127e: f04f 0c01 mov.w ip, #1
- continue;
- 8011282: e004 b.n 801128e <tfp_format+0x6e>
- case '#':
- p.alt = 1;
- 8011284: 2001 movs r0, #1
- continue;
- 8011286: e002 b.n 801128e <tfp_format+0x6e>
- case '+':
- p.sign = 1;
- 8011288: 2301 movs r3, #1
- continue;
- 801128a: e000 b.n 801128e <tfp_format+0x6e>
- /* Flags */
- while ((ch = *(fmt++))) {
- switch (ch) {
- case '-':
- p.align_left = 1;
- 801128c: 2201 movs r2, #1
- p.align_left = 0;
- p.sign = 0;
- p.prec = 2;
- /* Flags */
- while ((ch = *(fmt++))) {
- 801128e: f817 1b01 ldrb.w r1, [r7], #1
- 8011292: 2900 cmp r1, #0
- 8011294: d1e8 bne.n 8011268 <tfp_format+0x48>
- 8011296: f89d 8028 ldrb.w r8, [sp, #40] ; 0x28
- 801129a: f88d 3030 strb.w r3, [sp, #48] ; 0x30
- 801129e: f36c 0800 bfi r8, ip, #0, #1
- 80112a2: 46c4 mov ip, r8
- 80112a4: f360 0c41 bfi ip, r0, #1, #1
- 80112a8: 4660 mov r0, ip
- }
- break;
- }
- /* Width */
- if (ch >= '0' && ch <= '9') {
- 80112aa: f1a1 0330 sub.w r3, r1, #48 ; 0x30
- 80112ae: f362 00c3 bfi r0, r2, #3, #1
- 80112b2: 2b09 cmp r3, #9
- 80112b4: f88d 0028 strb.w r0, [sp, #40] ; 0x28
- 80112b8: d81d bhi.n 80112f6 <tfp_format+0xd6>
- 80112ba: e004 b.n 80112c6 <tfp_format+0xa6>
- unsigned int num = 0;
- int digit;
- while ((digit = a2d(ch)) >= 0) {
- if (digit > base)
- break;
- num = num * base + digit;
- 80112bc: fb00 3202 mla r2, r0, r2, r3
- ch = *p++;
- 80112c0: f817 1b01 ldrb.w r1, [r7], #1
- 80112c4: e001 b.n 80112ca <tfp_format+0xaa>
- }
- break;
- }
- /* Width */
- if (ch >= '0' && ch <= '9') {
- 80112c6: 2200 movs r2, #0
- unsigned int num = 0;
- int digit;
- while ((digit = a2d(ch)) >= 0) {
- if (digit > base)
- break;
- num = num * base + digit;
- 80112c8: 200a movs r0, #10
- ui2a(num, p);
- }
- static int a2d(char ch)
- {
- if (ch >= '0' && ch <= '9')
- 80112ca: f1a1 0330 sub.w r3, r1, #48 ; 0x30
- 80112ce: fa5f fc83 uxtb.w ip, r3
- 80112d2: f1bc 0f09 cmp.w ip, #9
- 80112d6: d9f1 bls.n 80112bc <tfp_format+0x9c>
- return ch - '0';
- else if (ch >= 'a' && ch <= 'f')
- 80112d8: f1a1 0361 sub.w r3, r1, #97 ; 0x61
- 80112dc: 2b05 cmp r3, #5
- 80112de: d802 bhi.n 80112e6 <tfp_format+0xc6>
- return ch - 'a' + 10;
- 80112e0: f1a1 0357 sub.w r3, r1, #87 ; 0x57
- 80112e4: e1b5 b.n 8011652 <tfp_format+0x432>
- else if (ch >= 'A' && ch <= 'F')
- 80112e6: f1a1 0341 sub.w r3, r1, #65 ; 0x41
- 80112ea: 2b05 cmp r3, #5
- 80112ec: d802 bhi.n 80112f4 <tfp_format+0xd4>
- return ch - 'A' + 10;
- 80112ee: f1a1 0337 sub.w r3, r1, #55 ; 0x37
- 80112f2: e1ae b.n 8011652 <tfp_format+0x432>
- break;
- num = num * base + digit;
- ch = *p++;
- }
- *src = p;
- *nump = num;
- 80112f4: 920b str r2, [sp, #44] ; 0x2c
- }
- /* We accept 'x.y' format but don't support it completely:
- * we ignore the 'y' digit => this ignores 0-fill
- * size and makes it == width (ie. 'x') */
- if (ch == '.') {
- 80112f6: 292e cmp r1, #46 ; 0x2e
- 80112f8: d10e bne.n 8011318 <tfp_format+0xf8>
- //p.lz = 1; /* zero-padding */
- /* ignore actual 0-fill size: */
- ch = *(fmt++);
- if (ch >= '0' && ch <= '9')
- 80112fa: 783a ldrb r2, [r7, #0]
- 80112fc: 3a30 subs r2, #48 ; 0x30
- 80112fe: b2d2 uxtb r2, r2
- * we ignore the 'y' digit => this ignores 0-fill
- * size and makes it == width (ie. 'x') */
- if (ch == '.') {
- //p.lz = 1; /* zero-padding */
- /* ignore actual 0-fill size: */
- ch = *(fmt++);
- 8011300: 1c7b adds r3, r7, #1
- if (ch >= '0' && ch <= '9')
- 8011302: 2a09 cmp r2, #9
- p.prec = ch - '0';
- 8011304: bf98 it ls
- 8011306: f88d 203c strbls.w r2, [sp, #60] ; 0x3c
- do
- {
- ch = *(fmt++);
- 801130a: f813 1b01 ldrb.w r1, [r3], #1
- } while (ch >= '0' && ch <= '9');
- 801130e: f1a1 0230 sub.w r2, r1, #48 ; 0x30
- 8011312: 2a09 cmp r2, #9
- ch = *(fmt++);
- if (ch >= '0' && ch <= '9')
- p.prec = ch - '0';
- do
- {
- ch = *(fmt++);
- 8011314: 461f mov r7, r3
- } while (ch >= '0' && ch <= '9');
- 8011316: d9f8 bls.n 801130a <tfp_format+0xea>
- }
- #ifdef PRINTF_SIZE_T_SUPPORT
- # ifdef PRINTF_LONG_SUPPORT
- if (ch == 'z') {
- 8011318: 297a cmp r1, #122 ; 0x7a
- 801131a: d102 bne.n 8011322 <tfp_format+0x102>
- ch = *(fmt++);
- 801131c: f817 1b01 ldrb.w r1, [r7], #1
- 8011320: e005 b.n 801132e <tfp_format+0x10e>
- } else
- # endif
- #endif
- #ifdef PRINTF_LONG_SUPPORT
- if (ch == 'l') {
- 8011322: 296c cmp r1, #108 ; 0x6c
- 8011324: d109 bne.n 801133a <tfp_format+0x11a>
- ch = *(fmt++);
- 8011326: 7839 ldrb r1, [r7, #0]
- lng = 1;
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (ch == 'l') {
- 8011328: 296c cmp r1, #108 ; 0x6c
- 801132a: d002 beq.n 8011332 <tfp_format+0x112>
- # endif
- #endif
- #ifdef PRINTF_LONG_SUPPORT
- if (ch == 'l') {
- ch = *(fmt++);
- 801132c: 3701 adds r7, #1
- lng = 1;
- 801132e: 2301 movs r3, #1
- 8011330: e004 b.n 801133c <tfp_format+0x11c>
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (ch == 'l') {
- ch = *(fmt++);
- 8011332: 7879 ldrb r1, [r7, #1]
- lng = 2;
- 8011334: 2302 movs r3, #2
- if (ch == 'l') {
- ch = *(fmt++);
- lng = 1;
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (ch == 'l') {
- ch = *(fmt++);
- 8011336: 3702 adds r7, #2
- 8011338: e000 b.n 801133c <tfp_format+0x11c>
- while ((ch = *(fmt++))) {
- if (ch != '%') {
- putf(putp, ch);
- } else {
- #ifdef PRINTF_LONG_SUPPORT
- char lng = 0; /* 1 for long, 2 for long long */
- 801133a: 2300 movs r3, #0
- lng = 2;
- }
- #endif
- }
- #endif
- switch (ch) {
- 801133c: 2969 cmp r1, #105 ; 0x69
- 801133e: d036 beq.n 80113ae <tfp_format+0x18e>
- 8011340: d816 bhi.n 8011370 <tfp_format+0x150>
- 8011342: 2963 cmp r1, #99 ; 0x63
- 8011344: f000 80a1 beq.w 801148a <tfp_format+0x26a>
- 8011348: d80c bhi.n 8011364 <tfp_format+0x144>
- 801134a: 2946 cmp r1, #70 ; 0x46
- 801134c: f000 80b3 beq.w 80114b6 <tfp_format+0x296>
- 8011350: d806 bhi.n 8011360 <tfp_format+0x140>
- 8011352: 2900 cmp r1, #0
- 8011354: f000 8181 beq.w 801165a <tfp_format+0x43a>
- 8011358: 2925 cmp r1, #37 ; 0x25
- 801135a: f040 8174 bne.w 8011646 <tfp_format+0x426>
- 801135e: e0a7 b.n 80114b0 <tfp_format+0x290>
- 8011360: 2958 cmp r1, #88 ; 0x58
- 8011362: e012 b.n 801138a <tfp_format+0x16a>
- 8011364: 2964 cmp r1, #100 ; 0x64
- 8011366: d022 beq.n 80113ae <tfp_format+0x18e>
- 8011368: 2966 cmp r1, #102 ; 0x66
- 801136a: f040 816c bne.w 8011646 <tfp_format+0x426>
- 801136e: e0a2 b.n 80114b6 <tfp_format+0x296>
- 8011370: 2973 cmp r1, #115 ; 0x73
- 8011372: f000 8090 beq.w 8011496 <tfp_format+0x276>
- 8011376: d805 bhi.n 8011384 <tfp_format+0x164>
- 8011378: 296f cmp r1, #111 ; 0x6f
- 801137a: d078 beq.n 801146e <tfp_format+0x24e>
- 801137c: 2970 cmp r1, #112 ; 0x70
- 801137e: f040 8162 bne.w 8011646 <tfp_format+0x426>
- 8011382: e040 b.n 8011406 <tfp_format+0x1e6>
- 8011384: 2975 cmp r1, #117 ; 0x75
- 8011386: d003 beq.n 8011390 <tfp_format+0x170>
- 8011388: 2978 cmp r1, #120 ; 0x78
- 801138a: f040 815c bne.w 8011646 <tfp_format+0x426>
- 801138e: e041 b.n 8011414 <tfp_format+0x1f4>
- case 0:
- goto abort;
- case 'u':
- p.base = 10;
- 8011390: 220a movs r2, #10
- #ifdef PRINTF_LONG_SUPPORT
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- 8011392: 2b02 cmp r3, #2
- #endif
- switch (ch) {
- case 0:
- goto abort;
- case 'u':
- p.base = 10;
- 8011394: 920d str r2, [sp, #52] ; 0x34
- #ifdef PRINTF_LONG_SUPPORT
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- 8011396: d107 bne.n 80113a8 <tfp_format+0x188>
- ulli2a(va_arg(va, unsigned long long int), &p);
- 8011398: 3407 adds r4, #7
- 801139a: f024 0307 bic.w r3, r4, #7
- 801139e: f103 0408 add.w r4, r3, #8
- 80113a2: e9d3 0100 ldrd r0, r1, [r3]
- 80113a6: e017 b.n 80113d8 <tfp_format+0x1b8>
- else
- #endif
- if (1 == lng)
- uli2a(va_arg(va, unsigned long int), &p);
- 80113a8: 6820 ldr r0, [r4, #0]
- 80113aa: a90a add r1, sp, #40 ; 0x28
- 80113ac: e04f b.n 801144e <tfp_format+0x22e>
- ui2a(va_arg(va, unsigned int), &p);
- putchw(putp, putf, &p);
- break;
- case 'd':
- case 'i':
- p.base = 10;
- 80113ae: 220a movs r2, #10
- #ifdef PRINTF_LONG_SUPPORT
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- 80113b0: 2b02 cmp r3, #2
- ui2a(va_arg(va, unsigned int), &p);
- putchw(putp, putf, &p);
- break;
- case 'd':
- case 'i':
- p.base = 10;
- 80113b2: 920d str r2, [sp, #52] ; 0x34
- #ifdef PRINTF_LONG_SUPPORT
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- 80113b4: d112 bne.n 80113dc <tfp_format+0x1bc>
- lli2a(va_arg(va, long long int), &p);
- 80113b6: 3407 adds r4, #7
- 80113b8: f024 0307 bic.w r3, r4, #7
- 80113bc: e9d3 0100 ldrd r0, r1, [r3]
- 80113c0: f103 0408 add.w r4, r3, #8
- *bf = 0;
- }
- static void lli2a(long long int num, struct param *p)
- {
- if (num < 0) {
- 80113c4: 2800 cmp r0, #0
- 80113c6: f171 0300 sbcs.w r3, r1, #0
- 80113ca: da05 bge.n 80113d8 <tfp_format+0x1b8>
- num = -num;
- p->sign = '-';
- 80113cc: 232d movs r3, #45 ; 0x2d
- }
- static void lli2a(long long int num, struct param *p)
- {
- if (num < 0) {
- num = -num;
- 80113ce: 4240 negs r0, r0
- 80113d0: eb61 0141 sbc.w r1, r1, r1, lsl #1
- p->sign = '-';
- 80113d4: f88d 3030 strb.w r3, [sp, #48] ; 0x30
- }
- ulli2a(num, p);
- 80113d8: aa0a add r2, sp, #40 ; 0x28
- 80113da: e033 b.n 8011444 <tfp_format+0x224>
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- lli2a(va_arg(va, long long int), &p);
- else
- #endif
- if (1 == lng)
- 80113dc: 2b01 cmp r3, #1
- li2a(va_arg(va, long int), &p);
- 80113de: 6820 ldr r0, [r4, #0]
- 80113e0: f104 0804 add.w r8, r4, #4
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- lli2a(va_arg(va, long long int), &p);
- else
- #endif
- if (1 == lng)
- 80113e4: d107 bne.n 80113f6 <tfp_format+0x1d6>
- *bf = 0;
- }
- static void li2a(long num, struct param *p)
- {
- if (num < 0) {
- 80113e6: 2800 cmp r0, #0
- 80113e8: da03 bge.n 80113f2 <tfp_format+0x1d2>
- num = -num;
- p->sign = '-';
- 80113ea: 232d movs r3, #45 ; 0x2d
- }
- static void li2a(long num, struct param *p)
- {
- if (num < 0) {
- num = -num;
- 80113ec: 4240 negs r0, r0
- p->sign = '-';
- 80113ee: f88d 3030 strb.w r3, [sp, #48] ; 0x30
- }
- uli2a(num, p);
- 80113f2: a90a add r1, sp, #40 ; 0x28
- 80113f4: e02f b.n 8011456 <tfp_format+0x236>
- *bf = 0;
- }
- static void i2a(int num, struct param *p)
- {
- if (num < 0) {
- 80113f6: 2800 cmp r0, #0
- 80113f8: da03 bge.n 8011402 <tfp_format+0x1e2>
- num = -num;
- p->sign = '-';
- 80113fa: 232d movs r3, #45 ; 0x2d
- }
- static void i2a(int num, struct param *p)
- {
- if (num < 0) {
- num = -num;
- 80113fc: 4240 negs r0, r0
- p->sign = '-';
- 80113fe: f88d 3030 strb.w r3, [sp, #48] ; 0x30
- }
- ui2a(num, p);
- 8011402: a90a add r1, sp, #40 ; 0x28
- 8011404: e02a b.n 801145c <tfp_format+0x23c>
- i2a(va_arg(va, int), &p);
- putchw(putp, putf, &p);
- break;
- #ifdef SIZEOF_POINTER
- case 'p':
- p.alt = 1;
- 8011406: f89d 3028 ldrb.w r3, [sp, #40] ; 0x28
- 801140a: f043 0302 orr.w r3, r3, #2
- 801140e: f88d 3028 strb.w r3, [sp, #40] ; 0x28
- # if defined(SIZEOF_INT) && SIZEOF_POINTER <= SIZEOF_INT
- lng = 0;
- 8011412: 2300 movs r3, #0
- lng = 2;
- # endif
- #endif
- case 'x':
- case 'X':
- p.base = 16;
- 8011414: 2210 movs r2, #16
- p.uc = (ch == 'X')?1:0;
- 8011416: f1b1 0e58 subs.w lr, r1, #88 ; 0x58
- 801141a: f1de 0100 rsbs r1, lr, #0
- 801141e: f89d 0028 ldrb.w r0, [sp, #40] ; 0x28
- lng = 2;
- # endif
- #endif
- case 'x':
- case 'X':
- p.base = 16;
- 8011422: 920d str r2, [sp, #52] ; 0x34
- p.uc = (ch == 'X')?1:0;
- 8011424: eb51 010e adcs.w r1, r1, lr
- 8011428: aa1a add r2, sp, #104 ; 0x68
- 801142a: f361 0082 bfi r0, r1, #2, #1
- #ifdef PRINTF_LONG_SUPPORT
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- 801142e: 2b02 cmp r3, #2
- # endif
- #endif
- case 'x':
- case 'X':
- p.base = 16;
- p.uc = (ch == 'X')?1:0;
- 8011430: f802 0d40 strb.w r0, [r2, #-64]!
- #ifdef PRINTF_LONG_SUPPORT
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- 8011434: d109 bne.n 801144a <tfp_format+0x22a>
- ulli2a(va_arg(va, unsigned long long int), &p);
- 8011436: 3407 adds r4, #7
- 8011438: f024 0307 bic.w r3, r4, #7
- 801143c: e9d3 0100 ldrd r0, r1, [r3]
- 8011440: f103 0408 add.w r4, r3, #8
- 8011444: f7ff fdc8 bl 8010fd8 <ulli2a>
- 8011448: e00b b.n 8011462 <tfp_format+0x242>
- else
- #endif
- if (1 == lng)
- uli2a(va_arg(va, unsigned long int), &p);
- 801144a: 6820 ldr r0, [r4, #0]
- 801144c: 4611 mov r1, r2
- #ifdef PRINTF_LONG_LONG_SUPPORT
- if (2 == lng)
- ulli2a(va_arg(va, unsigned long long int), &p);
- else
- #endif
- if (1 == lng)
- 801144e: 2b01 cmp r3, #1
- 8011450: f104 0804 add.w r8, r4, #4
- 8011454: d102 bne.n 801145c <tfp_format+0x23c>
- uli2a(va_arg(va, unsigned long int), &p);
- 8011456: f7ff fe15 bl 8011084 <uli2a>
- 801145a: e001 b.n 8011460 <tfp_format+0x240>
- else
- #endif
- ui2a(va_arg(va, unsigned int), &p);
- 801145c: f7ff fe3d bl 80110da <ui2a>
- 8011460: 4644 mov r4, r8
- putchw(putp, putf, &p);
- 8011462: 4628 mov r0, r5
- 8011464: 4631 mov r1, r6
- 8011466: aa0a add r2, sp, #40 ; 0x28
- 8011468: f7ff fe62 bl 8011130 <putchw>
- break;
- 801146c: e0eb b.n 8011646 <tfp_format+0x426>
- case 'o':
- p.base = 8;
- 801146e: 2308 movs r3, #8
- ui2a(va_arg(va, unsigned int), &p);
- 8011470: 6820 ldr r0, [r4, #0]
- #endif
- ui2a(va_arg(va, unsigned int), &p);
- putchw(putp, putf, &p);
- break;
- case 'o':
- p.base = 8;
- 8011472: 930d str r3, [sp, #52] ; 0x34
- ui2a(va_arg(va, unsigned int), &p);
- 8011474: a90a add r1, sp, #40 ; 0x28
- 8011476: f7ff fe30 bl 80110da <ui2a>
- putchw(putp, putf, &p);
- 801147a: 4628 mov r0, r5
- 801147c: 4631 mov r1, r6
- 801147e: aa0a add r2, sp, #40 ; 0x28
- ui2a(va_arg(va, unsigned int), &p);
- putchw(putp, putf, &p);
- break;
- case 'o':
- p.base = 8;
- ui2a(va_arg(va, unsigned int), &p);
- 8011480: f104 0804 add.w r8, r4, #4
- putchw(putp, putf, &p);
- 8011484: f7ff fe54 bl 8011130 <putchw>
- 8011488: e010 b.n 80114ac <tfp_format+0x28c>
- break;
- case 'c':
- putf(putp, (char)(va_arg(va, int)));
- 801148a: 4628 mov r0, r5
- 801148c: 7821 ldrb r1, [r4, #0]
- 801148e: f104 0804 add.w r8, r4, #4
- 8011492: 47b0 blx r6
- 8011494: e00a b.n 80114ac <tfp_format+0x28c>
- break;
- case 's':
- p.bf = va_arg(va, char *);
- 8011496: 6823 ldr r3, [r4, #0]
- putchw(putp, putf, &p);
- 8011498: aa0a add r2, sp, #40 ; 0x28
- 801149a: 4628 mov r0, r5
- 801149c: 4631 mov r1, r6
- break;
- case 'c':
- putf(putp, (char)(va_arg(va, int)));
- break;
- case 's':
- p.bf = va_arg(va, char *);
- 801149e: 930e str r3, [sp, #56] ; 0x38
- putchw(putp, putf, &p);
- 80114a0: f7ff fe46 bl 8011130 <putchw>
- p.bf = bf;
- 80114a4: aa04 add r2, sp, #16
- break;
- case 'c':
- putf(putp, (char)(va_arg(va, int)));
- break;
- case 's':
- p.bf = va_arg(va, char *);
- 80114a6: f104 0804 add.w r8, r4, #4
- putchw(putp, putf, &p);
- p.bf = bf;
- 80114aa: 920e str r2, [sp, #56] ; 0x38
- break;
- case 'c':
- putf(putp, (char)(va_arg(va, int)));
- break;
- case 's':
- p.bf = va_arg(va, char *);
- 80114ac: 4644 mov r4, r8
- putchw(putp, putf, &p);
- p.bf = bf;
- break;
- 80114ae: e0ca b.n 8011646 <tfp_format+0x426>
- case '%':
- putf(putp, ch);
- 80114b0: 4628 mov r0, r5
- 80114b2: 47b0 blx r6
- break;
- 80114b4: e0c7 b.n 8011646 <tfp_format+0x426>
- case 'f':
- case 'F':
- fval = va_arg(va, double);
- 80114b6: 3407 adds r4, #7
- 80114b8: f024 0307 bic.w r3, r4, #7
- 80114bc: f103 0408 add.w r4, r3, #8
- 80114c0: e893 0404 ldmia.w r3, {r2, sl}
- 80114c4: 9200 str r2, [sp, #0]
- sign = 0;
- if (fval < 0)
- 80114c6: 4610 mov r0, r2
- 80114c8: 4651 mov r1, sl
- 80114ca: 2200 movs r2, #0
- 80114cc: 2300 movs r3, #0
- 80114ce: f7f7 fa25 bl 800891c <__aeabi_dcmplt>
- 80114d2: b138 cbz r0, 80114e4 <tfp_format+0x2c4>
- {
- sign = 1;
- p.width--;
- 80114d4: 9b0b ldr r3, [sp, #44] ; 0x2c
- 80114d6: 3b01 subs r3, #1
- 80114d8: 930b str r3, [sp, #44] ; 0x2c
- fval = - fval;
- 80114da: f10a 4a00 add.w sl, sl, #2147483648 ; 0x80000000
- case 'F':
- fval = va_arg(va, double);
- sign = 0;
- if (fval < 0)
- {
- sign = 1;
- 80114de: f04f 0b01 mov.w fp, #1
- 80114e2: e009 b.n 80114f8 <tfp_format+0x2d8>
- p.width--;
- fval = - fval;
- }
- else if (p.sign) {
- 80114e4: f89d 3030 ldrb.w r3, [sp, #48] ; 0x30
- 80114e8: b12b cbz r3, 80114f6 <tfp_format+0x2d6>
- sign = 2;
- p.width--;
- 80114ea: 9b0b ldr r3, [sp, #44] ; 0x2c
- 80114ec: 3b01 subs r3, #1
- 80114ee: 930b str r3, [sp, #44] ; 0x2c
- sign = 1;
- p.width--;
- fval = - fval;
- }
- else if (p.sign) {
- sign = 2;
- 80114f0: f04f 0b02 mov.w fp, #2
- 80114f4: e000 b.n 80114f8 <tfp_format+0x2d8>
- putf(putp, ch);
- break;
- case 'f':
- case 'F':
- fval = va_arg(va, double);
- sign = 0;
- 80114f6: 469b mov fp, r3
- else if (p.sign) {
- sign = 2;
- p.width--;
- }
- fpart = (int)fval;
- 80114f8: 4651 mov r1, sl
- 80114fa: 9800 ldr r0, [sp, #0]
- 80114fc: f7f7 fa36 bl 800896c <__aeabi_d2iz>
- fiter = 0;
- 8011500: 2200 movs r2, #0
- else if (p.sign) {
- sign = 2;
- p.width--;
- }
- fpart = (int)fval;
- 8011502: 9001 str r0, [sp, #4]
- 8011504: 4680 mov r8, r0
- fiter = 0;
- while (fpart != 0)
- {
- temp_buffer[fiter++] = fpart % 10;
- 8011506: 210a movs r1, #10
- }
- fpart = (int)fval;
- fiter = 0;
- while (fpart != 0)
- 8011508: e008 b.n 801151c <tfp_format+0x2fc>
- {
- temp_buffer[fiter++] = fpart % 10;
- 801150a: fb98 f0f1 sdiv r0, r8, r1
- 801150e: ab10 add r3, sp, #64 ; 0x40
- 8011510: fb01 8810 mls r8, r1, r0, r8
- 8011514: f843 8022 str.w r8, [r3, r2, lsl #2]
- 8011518: 3201 adds r2, #1
- fpart = fpart / 10;
- 801151a: 4680 mov r8, r0
- }
- fpart = (int)fval;
- fiter = 0;
- while (fpart != 0)
- 801151c: f1b8 0f00 cmp.w r8, #0
- 8011520: d1f3 bne.n 801150a <tfp_format+0x2ea>
- temp_buffer[fiter++] = fpart % 10;
- fpart = fpart / 10;
- }
- fiter--;
- if (fiter == -1)
- 8011522: f102 39ff add.w r9, r2, #4294967295
- 8011526: b912 cbnz r2, 801152e <tfp_format+0x30e>
- p.width--;
- 8011528: 9a0b ldr r2, [sp, #44] ; 0x2c
- 801152a: 3a01 subs r2, #1
- 801152c: 920b str r2, [sp, #44] ; 0x2c
- /* Leading zeros */
- if (p.lz) {
- 801152e: f89d 2028 ldrb.w r2, [sp, #40] ; 0x28
- 8011532: 07d0 lsls r0, r2, #31
- 8011534: d51b bpl.n 801156e <tfp_format+0x34e>
- if (sign == 1)
- 8011536: f1bb 0f01 cmp.w fp, #1
- 801153a: d102 bne.n 8011542 <tfp_format+0x322>
- putf(putp, '-');
- 801153c: 4628 mov r0, r5
- 801153e: 212d movs r1, #45 ; 0x2d
- 8011540: e007 b.n 8011552 <tfp_format+0x332>
- else if (sign == 2)
- 8011542: f1bb 0f02 cmp.w fp, #2
- 8011546: d105 bne.n 8011554 <tfp_format+0x334>
- putf(putp, '+');
- 8011548: 4628 mov r0, r5
- 801154a: 212b movs r1, #43 ; 0x2b
- 801154c: e001 b.n 8011552 <tfp_format+0x332>
- while (p.width-- > p.prec + fiter + 2)
- {
- putf(putp, '0');
- 801154e: 4628 mov r0, r5
- 8011550: 2130 movs r1, #48 ; 0x30
- 8011552: 47b0 blx r6
- if (sign == 1)
- putf(putp, '-');
- else if (sign == 2)
- putf(putp, '+');
- while (p.width-- > p.prec + fiter + 2)
- 8011554: f89d 203c ldrb.w r2, [sp, #60] ; 0x3c
- 8011558: 9b0b ldr r3, [sp, #44] ; 0x2c
- 801155a: 444a add r2, r9
- 801155c: 3202 adds r2, #2
- 801155e: 1e59 subs r1, r3, #1
- 8011560: 4293 cmp r3, r2
- 8011562: 910b str r1, [sp, #44] ; 0x2c
- 8011564: dcf3 bgt.n 801154e <tfp_format+0x32e>
- 8011566: e017 b.n 8011598 <tfp_format+0x378>
- else
- {
- while (p.width-- > p.prec + fiter + 2)
- {
- putf(putp, ' ');
- 8011568: 4628 mov r0, r5
- 801156a: 2120 movs r1, #32
- 801156c: 47b0 blx r6
- }
- }
- else
- {
- while (p.width-- > p.prec + fiter + 2)
- 801156e: f89d 103c ldrb.w r1, [sp, #60] ; 0x3c
- 8011572: 9a0b ldr r2, [sp, #44] ; 0x2c
- 8011574: 4449 add r1, r9
- 8011576: 3102 adds r1, #2
- 8011578: 1e50 subs r0, r2, #1
- 801157a: 428a cmp r2, r1
- 801157c: 900b str r0, [sp, #44] ; 0x2c
- 801157e: dcf3 bgt.n 8011568 <tfp_format+0x348>
- {
- putf(putp, ' ');
- }
- if (sign == 1)
- 8011580: f1bb 0f01 cmp.w fp, #1
- 8011584: d102 bne.n 801158c <tfp_format+0x36c>
- putf(putp, '-');
- 8011586: 4628 mov r0, r5
- 8011588: 212d movs r1, #45 ; 0x2d
- 801158a: e004 b.n 8011596 <tfp_format+0x376>
- else if (sign == 2)
- 801158c: f1bb 0f02 cmp.w fp, #2
- 8011590: d102 bne.n 8011598 <tfp_format+0x378>
- putf(putp, '+');
- 8011592: 4628 mov r0, r5
- 8011594: 212b movs r1, #43 ; 0x2b
- 8011596: 47b0 blx r6
- }
- if (fiter == -1)
- 8011598: f1b9 3fff cmp.w r9, #4294967295
- 801159c: d102 bne.n 80115a4 <tfp_format+0x384>
- putf(putp, '0');
- 801159e: 4628 mov r0, r5
- 80115a0: 2130 movs r1, #48 ; 0x30
- 80115a2: e007 b.n 80115b4 <tfp_format+0x394>
- while (fiter > -1)
- {
- putf(putp, '0' + (temp_buffer[fiter--]));
- 80115a4: ab10 add r3, sp, #64 ; 0x40
- 80115a6: 4628 mov r0, r5
- 80115a8: f853 1029 ldr.w r1, [r3, r9, lsl #2]
- 80115ac: 3130 adds r1, #48 ; 0x30
- 80115ae: f109 39ff add.w r9, r9, #4294967295
- 80115b2: b2c9 uxtb r1, r1
- 80115b4: 47b0 blx r6
- }
- if (fiter == -1)
- putf(putp, '0');
- while (fiter > -1)
- 80115b6: f1b9 3fff cmp.w r9, #4294967295
- 80115ba: d1f3 bne.n 80115a4 <tfp_format+0x384>
- {
- putf(putp, '0' + (temp_buffer[fiter--]));
- }
- putf(putp, '.');
- 80115bc: 4628 mov r0, r5
- 80115be: 212e movs r1, #46 ; 0x2e
- 80115c0: 47b0 blx r6
- ffactor = 1;
- 80115c2: f04f 0901 mov.w r9, #1
- while (p.prec-- > 0)
- 80115c6: e01d b.n 8011604 <tfp_format+0x3e4>
- {
- ffactor *= 10;
- 80115c8: 230a movs r3, #10
- fpart = (int)((fval - (int)fval)*ffactor);
- 80115ca: 9801 ldr r0, [sp, #4]
- putf(putp, '.');
- ffactor = 1;
- while (p.prec-- > 0)
- {
- ffactor *= 10;
- 80115cc: fb03 f909 mul.w r9, r3, r9
- fpart = (int)((fval - (int)fval)*ffactor);
- 80115d0: f7f6 fecc bl 800836c <__aeabi_i2d>
- 80115d4: 4602 mov r2, r0
- 80115d6: 460b mov r3, r1
- 80115d8: 9800 ldr r0, [sp, #0]
- 80115da: 4651 mov r1, sl
- 80115dc: f7f6 fd78 bl 80080d0 <__aeabi_dsub>
- 80115e0: e9cd 0102 strd r0, r1, [sp, #8]
- 80115e4: 4648 mov r0, r9
- 80115e6: f7f6 fec1 bl 800836c <__aeabi_i2d>
- 80115ea: 4602 mov r2, r0
- 80115ec: 460b mov r3, r1
- 80115ee: e9dd 0102 ldrd r0, r1, [sp, #8]
- 80115f2: f7f6 ff21 bl 8008438 <__aeabi_dmul>
- 80115f6: f7f7 f9b9 bl 800896c <__aeabi_d2iz>
- if (fpart == 0)
- 80115fa: 4680 mov r8, r0
- 80115fc: b910 cbnz r0, 8011604 <tfp_format+0x3e4>
- putf(putp, '0');
- 80115fe: 4628 mov r0, r5
- 8011600: 2130 movs r1, #48 ; 0x30
- 8011602: 47b0 blx r6
- putf(putp, '0' + (temp_buffer[fiter--]));
- }
- putf(putp, '.');
- ffactor = 1;
- while (p.prec-- > 0)
- 8011604: f89d 303c ldrb.w r3, [sp, #60] ; 0x3c
- 8011608: 1e5a subs r2, r3, #1
- 801160a: f88d 203c strb.w r2, [sp, #60] ; 0x3c
- 801160e: 2b00 cmp r3, #0
- 8011610: d1da bne.n 80115c8 <tfp_format+0x3a8>
- putf(putp, '0');
- }
- fiter = 0;
- while (fpart != 0)
- {
- temp_buffer[fiter++] = fpart % 10;
- 8011612: 220a movs r2, #10
- 8011614: e008 b.n 8011628 <tfp_format+0x408>
- 8011616: fb98 f1f2 sdiv r1, r8, r2
- 801161a: a810 add r0, sp, #64 ; 0x40
- 801161c: fb02 8811 mls r8, r2, r1, r8
- 8011620: f840 8023 str.w r8, [r0, r3, lsl #2]
- 8011624: 3301 adds r3, #1
- fpart = fpart / 10;
- 8011626: 4688 mov r8, r1
- fpart = (int)((fval - (int)fval)*ffactor);
- if (fpart == 0)
- putf(putp, '0');
- }
- fiter = 0;
- while (fpart != 0)
- 8011628: f1b8 0f00 cmp.w r8, #0
- 801162c: d1f3 bne.n 8011616 <tfp_format+0x3f6>
- 801162e: 4698 mov r8, r3
- temp_buffer[fiter++] = fpart % 10;
- fpart = fpart / 10;
- }
- fiter--;
- while (fiter > -1)
- 8011630: e006 b.n 8011640 <tfp_format+0x420>
- {
- putf(putp, '0' + (temp_buffer[fiter--]));
- 8011632: ab10 add r3, sp, #64 ; 0x40
- 8011634: 4628 mov r0, r5
- 8011636: f853 1028 ldr.w r1, [r3, r8, lsl #2]
- 801163a: 3130 adds r1, #48 ; 0x30
- 801163c: b2c9 uxtb r1, r1
- 801163e: 47b0 blx r6
- temp_buffer[fiter++] = fpart % 10;
- fpart = fpart / 10;
- }
- fiter--;
- while (fiter > -1)
- 8011640: f118 38ff adds.w r8, r8, #4294967295
- 8011644: d2f5 bcs.n 8011632 <tfp_format+0x412>
- char bf[12]; /* int = 32b on some architectures */
- #endif
- char ch;
- p.bf = bf;
- while ((ch = *(fmt++))) {
- 8011646: f817 1b01 ldrb.w r1, [r7], #1
- 801164a: 2900 cmp r1, #0
- 801164c: f47f adf2 bne.w 8011234 <tfp_format+0x14>
- 8011650: e003 b.n 801165a <tfp_format+0x43a>
- {
- const char *p = *src;
- unsigned int num = 0;
- int digit;
- while ((digit = a2d(ch)) >= 0) {
- if (digit > base)
- 8011652: 2b0a cmp r3, #10
- 8011654: f77f ae32 ble.w 80112bc <tfp_format+0x9c>
- 8011658: e64c b.n 80112f4 <tfp_format+0xd4>
- break;
- }
- }
- }
- abort:;
- }
- 801165a: b01b add sp, #108 ; 0x6c
- 801165c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
- 08011660 <init_printf>:
- static putcf stdout_putf;
- static void *stdout_putp;
- void init_printf(void *putp, putcf putf)
- {
- stdout_putf = putf;
- 8011660: 4b02 ldr r3, [pc, #8] ; (801166c <init_printf+0xc>)
- 8011662: 6019 str r1, [r3, #0]
- stdout_putp = putp;
- 8011664: 4b02 ldr r3, [pc, #8] ; (8011670 <init_printf+0x10>)
- 8011666: 6018 str r0, [r3, #0]
- 8011668: 4770 bx lr
- 801166a: bf00 nop
- 801166c: 20006dc8 .word 0x20006dc8
- 8011670: 20006dcc .word 0x20006dcc
- 08011674 <tfp_printf>:
- }
- void tfp_printf(char *fmt, ...)
- {
- 8011674: b40f push {r0, r1, r2, r3}
- 8011676: b507 push {r0, r1, r2, lr}
- va_list va;
- va_start(va, fmt);
- tfp_format(stdout_putp, stdout_putf, fmt, va);
- 8011678: 4906 ldr r1, [pc, #24] ; (8011694 <tfp_printf+0x20>)
- stdout_putf = putf;
- stdout_putp = putp;
- }
- void tfp_printf(char *fmt, ...)
- {
- 801167a: ab04 add r3, sp, #16
- va_list va;
- va_start(va, fmt);
- tfp_format(stdout_putp, stdout_putf, fmt, va);
- 801167c: 6808 ldr r0, [r1, #0]
- 801167e: 4906 ldr r1, [pc, #24] ; (8011698 <tfp_printf+0x24>)
- stdout_putf = putf;
- stdout_putp = putp;
- }
- void tfp_printf(char *fmt, ...)
- {
- 8011680: f853 2b04 ldr.w r2, [r3], #4
- va_list va;
- va_start(va, fmt);
- tfp_format(stdout_putp, stdout_putf, fmt, va);
- 8011684: 6809 ldr r1, [r1, #0]
- }
- void tfp_printf(char *fmt, ...)
- {
- va_list va;
- va_start(va, fmt);
- 8011686: 9301 str r3, [sp, #4]
- tfp_format(stdout_putp, stdout_putf, fmt, va);
- 8011688: f7ff fdca bl 8011220 <tfp_format>
- va_end(va);
- }
- 801168c: e8bd 400e ldmia.w sp!, {r1, r2, r3, lr}
- 8011690: b004 add sp, #16
- 8011692: 4770 bx lr
- 8011694: 20006dcc .word 0x20006dcc
- 8011698: 20006dc8 .word 0x20006dc8
- 0801169c <tfp_vsprintf>:
- struct _vsprintf_putcf_data *data = (struct _vsprintf_putcf_data*)p;
- data->dest[data->num_chars++] = c;
- }
- int tfp_vsprintf(char *str, const char *format, va_list ap)
- {
- 801169c: b537 push {r0, r1, r2, r4, r5, lr}
- 801169e: 460d mov r5, r1
- 80116a0: 4613 mov r3, r2
- struct _vsprintf_putcf_data data;
- data.dest = str;
- 80116a2: 9000 str r0, [sp, #0]
- data.num_chars = 0;
- 80116a4: 2400 movs r4, #0
- tfp_format(&data, _vsprintf_putcf, format, ap);
- 80116a6: 4668 mov r0, sp
- 80116a8: 462a mov r2, r5
- 80116aa: 4904 ldr r1, [pc, #16] ; (80116bc <tfp_vsprintf+0x20>)
- int tfp_vsprintf(char *str, const char *format, va_list ap)
- {
- struct _vsprintf_putcf_data data;
- data.dest = str;
- data.num_chars = 0;
- 80116ac: 9401 str r4, [sp, #4]
- tfp_format(&data, _vsprintf_putcf, format, ap);
- 80116ae: f7ff fdb7 bl 8011220 <tfp_format>
- data.dest[data.num_chars] = '\0';
- 80116b2: e89d 000c ldmia.w sp, {r2, r3}
- 80116b6: 54d4 strb r4, [r2, r3]
- return data.num_chars;
- }
- 80116b8: 9801 ldr r0, [sp, #4]
- 80116ba: bd3e pop {r1, r2, r3, r4, r5, pc}
- 80116bc: 08011215 .word 0x08011215
- 080116c0 <tfp_sprintf>:
- int tfp_sprintf(char *str, const char *format, ...)
- {
- 80116c0: b40e push {r1, r2, r3}
- 80116c2: b503 push {r0, r1, lr}
- 80116c4: aa03 add r2, sp, #12
- 80116c6: f852 1b04 ldr.w r1, [r2], #4
- va_list ap;
- int retval;
- va_start(ap, format);
- 80116ca: 9201 str r2, [sp, #4]
- retval = tfp_vsprintf(str, format, ap);
- 80116cc: f7ff ffe6 bl 801169c <tfp_vsprintf>
- va_end(ap);
- return retval;
- }
- 80116d0: e8bd 400c ldmia.w sp!, {r2, r3, lr}
- 80116d4: b003 add sp, #12
- 80116d6: 4770 bx lr
- 080116d8 <Reset_Handler>:
- .weak Reset_Handler
- .type Reset_Handler, %function
- Reset_Handler:
- /* Copy the data segment initializers from flash to SRAM */
- movs r1, #0
- 80116d8: 2100 movs r1, #0
- b LoopCopyDataInit
- 80116da: f000 b804 b.w 80116e6 <LoopCopyDataInit>
- 080116de <CopyDataInit>:
- CopyDataInit:
- ldr r3, =_sidata
- 80116de: 4b0d ldr r3, [pc, #52] ; (8011714 <LoopFillZerobss+0x16>)
- ldr r3, [r3, r1]
- 80116e0: 585b ldr r3, [r3, r1]
- str r3, [r0, r1]
- 80116e2: 5043 str r3, [r0, r1]
- adds r1, r1, #4
- 80116e4: 3104 adds r1, #4
- 080116e6 <LoopCopyDataInit>:
-
- LoopCopyDataInit:
- ldr r0, =_sdata
- 80116e6: 480c ldr r0, [pc, #48] ; (8011718 <LoopFillZerobss+0x1a>)
- ldr r3, =_edata
- 80116e8: 4b0c ldr r3, [pc, #48] ; (801171c <LoopFillZerobss+0x1e>)
- adds r2, r0, r1
- 80116ea: 1842 adds r2, r0, r1
- cmp r2, r3
- 80116ec: 429a cmp r2, r3
- bcc CopyDataInit
- 80116ee: f4ff aff6 bcc.w 80116de <CopyDataInit>
- ldr r2, =_sbss
- 80116f2: 4a0b ldr r2, [pc, #44] ; (8011720 <LoopFillZerobss+0x22>)
- b LoopFillZerobss
- 80116f4: f000 b803 b.w 80116fe <LoopFillZerobss>
- 080116f8 <FillZerobss>:
- /* Zero fill the bss segment. */
- FillZerobss:
- movs r3, #0
- 80116f8: 2300 movs r3, #0
- str r3, [r2], #4
- 80116fa: f842 3b04 str.w r3, [r2], #4
- 080116fe <LoopFillZerobss>:
-
- LoopFillZerobss:
- ldr r3, = _ebss
- 80116fe: 4b09 ldr r3, [pc, #36] ; (8011724 <LoopFillZerobss+0x26>)
- cmp r2, r3
- 8011700: 429a cmp r2, r3
- bcc FillZerobss
- 8011702: f4ff aff9 bcc.w 80116f8 <FillZerobss>
- /* Call the clock system intitialization function.*/
- bl SystemInit
- 8011706: f7f8 fa21 bl 8009b4c <SystemInit>
- /* Call static constructors */
- bl __libc_init_array
- 801170a: f7f7 fe1d bl 8009348 <__libc_init_array>
- /* Call the application's entry point.*/
- bl main
- 801170e: f7ff fb45 bl 8010d9c <main>
- bx lr
- 8011712: 4770 bx lr
- /* Copy the data segment initializers from flash to SRAM */
- movs r1, #0
- b LoopCopyDataInit
- CopyDataInit:
- ldr r3, =_sidata
- 8011714: 08013698 .word 0x08013698
- ldr r3, [r3, r1]
- str r3, [r0, r1]
- adds r1, r1, #4
-
- LoopCopyDataInit:
- ldr r0, =_sdata
- 8011718: 20000000 .word 0x20000000
- ldr r3, =_edata
- 801171c: 20000118 .word 0x20000118
- adds r2, r0, r1
- cmp r2, r3
- bcc CopyDataInit
- ldr r2, =_sbss
- 8011720: 20000118 .word 0x20000118
- FillZerobss:
- movs r3, #0
- str r3, [r2], #4
-
- LoopFillZerobss:
- ldr r3, = _ebss
- 8011724: 2000c99c .word 0x2000c99c
- 08011728 <ADC_IRQHandler>:
- * @retval None
- */
- .section .text.Default_Handler,"ax",%progbits
- Default_Handler:
- Infinite_Loop:
- b Infinite_Loop
- 8011728: f7ff bffe b.w 8011728 <ADC_IRQHandler>
- 0801172c <_ctype_>:
- 801172c: 2000 2020 2020 2020 2020 2828 2828 2028 . (((((
- 801173c: 2020 2020 2020 2020 2020 2020 2020 2020
- 801174c: 8820 1010 1010 1010 1010 1010 1010 1010 ...............
- 801175c: 0410 0404 0404 0404 0404 1004 1010 1010 ................
- 801176c: 1010 4141 4141 4141 0101 0101 0101 0101 ..AAAAAA........
- 801177c: 0101 0101 0101 0101 0101 0101 1010 1010 ................
- 801178c: 1010 4242 4242 4242 0202 0202 0202 0202 ..BBBBBB........
- 801179c: 0202 0202 0202 0202 0202 0202 1010 1010 ................
- 80117ac: 0020 0000 0000 0000 0000 0000 0000 0000 ...............
- 80117bc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 80117cc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 80117dc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 80117ec: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 80117fc: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 801180c: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 801181c: 0000 0000 0000 0000 0000 0000 0000 0000 ................
- 801182c: 0000 0000 ....
- 08011830 <memp_num>:
- 8011830: 0004 0006 000a 0005 0019 0005 000f 000a ................
- 8011840: 0032 000f 2...
- 08011844 <memp_sizes>:
- 8011844: 001c 0020 0094 001c 0010 0020 0018 0010 .. ....... .....
- 8011854: 0010 0614 ....
- 08011858 <tcp_pcb_lists>:
- 8011858: 8344 2000 834c 2000 833c 2000 8350 2000 D.. L.. <.. P..
- 08011868 <tcp_backoff>:
- 8011868: 0201 0403 0605 0707 0707 0707 0307 .............
- 08011875 <tcp_persist_backoff>:
- 8011875: 0603 180c 6030 ff78 ....0`x
- 0801187c <ip_addr_broadcast>:
- 801187c: ffff ffff ....
- 08011880 <ip_addr_any>:
- 8011880: 0000 0000 ....
- 08011884 <ethbroadcast>:
- 8011884: ffff ffff ffff ......
- 0801188a <ethzero>:
- 801188a: 0000 0000 0000 3931 2e32 3631 2e38 2e31 ......192.168.1.
- 801189a: 0032 3931 2e32 3631 2e38 2e31 0031 3532 2.192.168.1.1.25
- 80118aa: 2e35 3532 2e35 3532 2e35 0030 7570 6c62 5.255.255.0.publ
- 80118ba: 6369 4200 2d54 3736 3130 3000 302e 302e ic.BT-6701.0.0.0
- 80118ca: 302e 3000 2e39 3031 322e 3130 0035 4345 .0.09.10.2015.EC
- 80118da: 342d 2d43 4434 302d 2d30 3030 302d 0041 -4C-4D-00-00-0A.
- 80118ea: 4e4b 302d 2d33 3030 3030 0033 0d0a 4149 KN-03-00003...IA
- 80118fa: 3a50 4220 6461 6320 6972 6974 6163 206c P: Bad critical
- 801190a: 6573 7474 6e69 7367 7320 6365 6f74 2072 settings sector
- 801191a: 5243 2e43 4620 6361 6f74 7972 6420 6665 CRC. Factory def
- 801192a: 7561 746c 2073 6572 7473 726f 6465 0a2e aults restored..
- 801193a: 000d ..
- 0801193c <data__upload_css>:
- 801193c: 752f 6c70 616f 2e64 7363 0073 5448 5054 /upload.css.HTTP
- 801194c: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
- 801195c: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
- 801196c: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
- 801197c: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
- 801198c: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
- 801199c: 6e65 2d74 7974 6570 203a 6574 7478 632f ent-type: text/c
- 80119ac: 7373 0a0d 6f43 746e 6e65 2d74 6e45 6f63 ss..Content-Enco
- 80119bc: 6964 676e 203a 7a67 7069 0a0d 0a0d 8b1f ding: gzip......
- 80119cc: 0008 0000 0000 0b04 58b5 6f5b 38a4 fe16 .........X[o.8..
- 80119dc: ac2b 96a2 2d3a a9a0 54aa 012a 6b75 4667 +...:-...T*.ukgF
- 80119ec: d23d bb48 3b6f 514f 0c1e f018 6c06 4d84 =.H.o;OQ.....l.M
- 80119fc: d2a5 ff0c 8f7d e06f a2aa 912a ab46 44ee ....}.o...*.F..D
- 8011a0c: f8e4 f9f6 f39c 8b9d 7ebf 87f9 5947 a0d7 .........~..GY..
- 8011a1c: fc9a 61c4 b9c6 dfb7 5184 f6b8 f2fe fdfe ...a.....Q......
- 8011a2c: 7fc7 7fbc 0c91 8e53 afe1 8892 b090 d3af ......S.........
- 8011a3c: ef5c d7cb 7e2f f2ca a1b7 5d41 6849 8d1c \.../~....A]Ih..
- 8011a4c: fc5f 971a e698 80be d5ff a2d0 273c 84b4 _...........<'..
- 8011a5c: b081 3520 b3fe 19ad fdca a290 8a7d 3f3a .. 5........}.:?
- 8011a6c: d5ec 41df 8701 bcfb e14f 1da7 c65a 2089 ...A....O...Z..
- 8011a7c: c68c ae1d 2091 3c7b 64de a7ac 6722 d4af ..... {<.d.."g..
- 8011a8c: 530f 0741 0f81 0022 25b0 018d c099 48dd .SA..."..%.....H
- 8011a9c: d29a 3b9c aca4 71cb 0707 a256 87a9 5182 ...;...q..V....Q
- 8011aac: 1411 21a8 5bf5 11cc 01e5 1dc7 9229 15e0 ...!.[......)...
- 8011abc: 2fa7 0444 276a b70e 500e dffe 8b9e 1578 ./D.j'...P....x.
- 8011acc: 9f45 a092 17e1 5246 bd94 1d94 c9a0 8c83 E.....FR........
- 8011adc: acd5 6f8b 3c7e f8fc f7f5 d255 1a10 9854 ...o~<....U...T.
- 8011aec: 9594 7788 a8eb 8c3d 2b4a ce66 b366 5119 ...w..=.J+f.f..Q
- 8011afc: 4827 6356 711f 6392 c73f 9102 fb9a 2905 'HVc.q.c?......)
- 8011b0c: d433 dbca cfca c3be c17e 5c18 afc8 8230 3.......~..\..0.
- 8011b1c: f85b 3c95 f5ac 441b dfa8 da60 a0fb 9f38 [..<...D..`...8.
- 8011b2c: 4ce3 e0ad 037d 7f6a 721b dbc2 bd1a 69c5 .L..}.j..r.....i
- 8011b3c: b2cd 1197 39f5 7e61 e886 711e edbf d958 .....9a~...q..X.
- 8011b4c: ce61 3dfd ca9c 99a6 d684 e284 2d40 f648 a..=........@-H.
- 8011b5c: 4258 b543 68d1 388a a396 a37a 3298 f9f1 XBC..h.8..z..2..
- 8011b6c: 0329 762d e6ac b7cf 16d3 5194 989c 471b ).-v.......Q...G
- 8011b7c: 53e3 f245 d31c 5f67 06e0 08b0 347c 446f .SE...g_....|4oD
- 8011b8c: 99c3 44e2 d607 5168 f607 511b e08c 7b46 ...D..hQ...Q..F{
- 8011b9c: 4e50 315c 3380 5eb0 0848 4460 a694 93dd PN\1.3.^H.`D....
- 8011bac: a220 cfc6 b2c6 ca41 6084 bc4d 0f6a 0e5e .....A..`M.j.^.
- 8011bbc: 389f 531f b59f 6b42 038a 5a4e b36a 1abf .8.S..Bk..NZj...
- 8011bcc: 447b 98d1 5417 b8cb ab78 4c71 7804 364f {D...T..x.qL.xO6
- 8011bdc: 2b56 0423 8807 b8d7 4119 2f9d 3183 145a V+#......A./.1Z.
- 8011bec: c945 3a8c 29be f00a f061 e53e 4182 688e E..:.)..a.>..A.h
- 8011bfc: bb89 e0d0 7296 b223 5157 b6a2 d223 4742 .....r#.WQ..#.BG
- 8011c0c: 8cd3 9a6c 5ac7 bf4c 7987 5ac7 e0e9 6081 ..l..ZL..y.Z...`
- 8011c1c: 5965 6763 3f43 3cbc ecc3 6ae5 0e17 312c eYcgC?.<...j..,1
- 8011c2c: 0d58 c80c d081 0186 c5d2 87e3 d3e8 4968 X.............hI
- 8011c3c: 78a6 a4a1 edbb 44a7 8379 e635 8745 e490 .x.....Dy.5.E...
- 8011c4c: ac14 838d 0b70 82ba c09d ca22 4114 56b8 ....p....."..A.V
- 8011c5c: 7d92 dca9 ee25 87c0 076f c969 66a2 b1af .}..%...o.i..f..
- 8011c6c: 8df6 3b51 8db8 2b14 78dc 9277 5528 4c37 ..Q;...+.xw.(U7L
- 8011c7c: 5b27 a65a 10ec 3800 3819 eba4 8f81 d580 '[Z....8.8......
- 8011c8c: c00f f64b 7e53 8d2c 8b2d 16c7 2528 0e49 ..K.S~,.-...(%I.
- 8011c9c: 868e 4466 17a8 cc6c 1018 25f1 81cd d824 ..fD..l....%..$.
- 8011cac: a8e7 8f69 4582 28c3 ff03 b0cc 7d3f b325 ..i..E.(....?}%.
- 8011cbc: 00d2 98fd 70f6 ea79 da13 c2f6 4071 035c .....py.....q@\.
- 8011ccc: e73d 6d33 5460 638b 2b42 3f88 d122 663e =.3m`T.cB+.?".>f
- 8011cdc: d2fe 656e d19d ed78 781d 3ead 8661 27bd ..ne..x..x.>a..'
- 8011cec: a49c b635 0327 e14f 1d28 150d 649d d518 ..5.'.O.(....d..
- 8011cfc: 37a6 64d8 f408 c014 f127 e2d6 5a6f acfc .7.d....'...oZ..
- 8011d0c: 6b31 4411 2c07 248e d860 8886 c1e7 031a 1k.D.,.$`.......
- 8011d1c: 2db5 c046 0cd6 7ac7 927d 1df5 d887 32d7 .-F....z}......2
- 8011d2c: 82a2 96af 413e 4218 2e80 f67f 639d e127 ....>A.B.....c'.
- 8011d3c: 1660 b8e5 7d40 462d 5507 e156 05ec 77ec `...@}-F.UV....w
- 8011d4c: a284 1043 66c6 8e10 7579 5f80 0874 6867 ..C..f..yu._t.gh
- 8011d5c: c179 8e9c f39c df69 b8a4 8e7b 7b63 4263 y.....i...{.c{cB
- 8011d6c: ee29 de02 4c42 8a37 36bc 821b f1d5 eb6c )...BL7..6....l.
- 8011d7c: cacf 9ccb 1c95 98d4 8b55 fa77 5e7b a53e ........U.w.{^>.
- 8011d8c: c733 d254 0be9 eb82 d5dc 41b4 df30 0b54 3.T........A0.T.
- 8011d9c: c802 1916 17ae 7b2e 4169 338e 41d6 6672 .......{iA.3.Arf
- 8011dac: c974 544d 51f4 8387 4d6f 4025 81b8 e120 t.MT.Q..oM%@.. .
- 8011dbc: f785 5632 e178 7e0e 9627 de1c 3dba 2624 ..2Vx..~'....=$&
- 8011dcc: cb71 ceb8 4d59 8f72 1a93 c842 a428 d957 q...YMr...B.(.W.
- 8011ddc: 2fe0 a929 09ea 5d33 e1a6 b51a c71c 431c ./)...3].......C
- 8011dec: 8136 33cc e29a 7062 3252 7564 4038 669f 6..3..bpR2du8@.f
- 8011dfc: 87f3 d2ca 6be1 7527 0dd6 24af 5517 78fc .....k'u...$.U.x
- 8011e0c: cf3f 238b 194f 2c30 c87b 539d d33e 7339 ?..#O.0,{..S>.9s
- 8011e1c: 23f2 236f 9863 f39e afbd 9a87 1170 24e8 .#o#c.......p..$
- 8011e2c: b4a3 47a0 a83c 4c6a b421 f982 141e 2627 ...G<.jL!.....'&
- 8011e3c: 98f5 e4d2 8e97 1aa0 d082 a054 c2a8 2664 ..........T...d&
- 8011e4c: 2f75 6641 9990 e44d d9b8 eddd 0fb6 568f u/Af..M........V
- 8011e5c: e181 0efd 0a74 c9f9 a7a9 a28e b399 9cf3 ....t...........
- 8011e6c: 6cd3 5309 4514 e162 ebc9 5dd8 86a5 0e94 .l.S.Eb....]....
- 8011e7c: d740 7310 042b 0a09 22b4 b40d 9f85 4cae @..s+....".....L
- 8011e8c: e7d1 97c8 c2ff f6d5 2dd6 e6f0 6590 bf62 .........-...eb.
- 8011e9c: fc53 78e9 9064 c5ce 4a1e e8c1 a4c0 6644 S..xd....J....Df
- 8011eac: 2898 54e9 1529 2859 04d1 7230 b0a2 7804 .(.T).Y(..0r...x
- 8011ebc: 8c12 2612 441d c1bc 5016 026f 6331 b754 ...&.D...Po.1cT.
- 8011ecc: fa15 c46c a2df 1b5b 9d3d f520 8f7f 408d ..l...[.=. ....@
- 8011edc: 9938 0aba f596 503c 45d1 e087 f973 27e4 8.....<P.E..s..'
- 8011eec: 7c50 42d8 8556 f010 a82c 4cd8 d4a6 b805 P|.BV...,..L....
- 8011efc: b666 6d52 5140 f583 619e a0cd b712 4831 f.Rm@Q...a....1H
- 8011f0c: d3d9 5bc9 6892 4eee 70ab a93b 0376 9546 ...[.h.N.p;.v.F.
- 8011f1c: 79ee afba 9ee1 b8aa 3334 366f 1d9b 774a .y......43o6..Jw
- 8011f2c: 8396 5632 1cf7 7e54 8954 9026 91fc 6b88 ..2V..T~T.&....k
- 8011f3c: 985c 6f68 9990 a97b d202 ec04 8369 8a13 \.ho..{.....i...
- 8011f4c: 9b82 9a25 eb99 0907 facc 65b7 f5ad 4d5a ..%........e..ZM
- 8011f5c: c52a f545 2ccb c592 4abc 13ae 8f7b 5f0a *.E..,...J..{.._
- 8011f6c: 3abb cadc 6462 5525 7c73 ebbe e16b c423 .:..bd%Us|..k.#.
- 8011f7c: 13ab 81cd b5e4 0222 aa43 4280 3201 c4af ......".C..B.2..
- 8011f8c: 5a75 353e 1950 c0d7 a3db a99c 0c5b 67d6 uZ>5P.......[..g
- 8011f9c: 2055 484b 7668 441a db49 86cb 5187 c0e0 U KHhv.DI....Q..
- 8011fac: 11a5 a29b e87a a063 9197 8005 f8ca 36ba ....z.c........6
- 8011fbc: 905a e0f2 784c 3826 bc8b 714e 6a7e a563 Z...Lx&8..Nq~jc.
- 8011fcc: d0cf 75a6 0c55 993b 06df 59fd c9e4 1652 ...uU.;....Y..R.
- 8011fdc: ae68 854a ef00 96a1 1ae3 d1b1 3408 d018 h.J..........4..
- 8011fec: 4079 889d 65f3 deca 6f6f 04a7 04e7 e322 y@...e..oo....".
- 8011ffc: 533f 5260 5b7f 87f6 5bf7 540d e817 62a1 ?S`R.[...[.T...b
- 801200c: 029e 6a6b d8f1 cc91 a69f 7728 1ba6 3389 ..kj......(w...3
- 801201c: 7f5d 2d4e 6e8a 3c41 1151 d89a c5b6 491a ].N-.nA<Q......I
- 801202c: bdf3 7c83 43a5 0aad 32a6 da76 0199 0a2b ...|.C...2v...+.
- 801203c: 9148 0071 a7be 3af1 9c58 dd4f cd15 64dd H.q....:X.O....d
- 801204c: d2a2 9cc3 7584 e7d1 1cb6 8bb6 b191 3cfd .....u.........<
- 801205c: 1fe2 d7d3 9bee 4e4b 182b 95c1 c5c6 8e51 ......KN+.....Q.
- 801206c: 369d 32f5 0db2 fdb2 0ccd 127f 6ba9 a47c .6.2.........k|.
- 801207c: 319f 9688 afc1 3df1 5b46 97eb ea66 b7fa .1.....=F[..f...
- 801208c: c3ed ddc3 f831 2723 20b5 d726 6a5d e6ca ....1.#'. &.]j..
- 801209c: 73c1 d3f4 d2d8 e76d 6bc1 cd0b 1dfd cd2d .s....m..k....-.
- 80120ac: d13c a56d de51 5e2c e942 9e8c 369f 2e0f <.m.Q.,^B....6..
- 80120bc: 74e1 af46 d52e 2f48 d9b0 12aa 2c9e bea0 .tF...H/.....,..
- 80120cc: ff04 779d 6c55 e3b7 fb16 d37b 9234 6677 ...wUl....{.4.wf
- 80120dc: dbd9 37bc 63ed 699b 7d42 1890 6fae bee9 ...7.c.iB}...o..
- 80120ec: 3aff f2bb edc7 0ee6 a768 b7f2 b22d bbf2 .:......h...-...
- 80120fc: b14d da41 2f41 1e3e dcb8 93d2 b5ec 079d M.A.A/>.........
- 801210c: 2701 d916 8737 8977 11f5 d9d8 26e3 675a .'..7.w......&Zg
- 801211c: b027 b651 5c7e 58eb df6a 8e3c 6569 62ee '.Q.~\.Xj.<.ie.b
- 801212c: d685 0ee6 89de e71b 9bb7 1686 39ae 398f .............9.9
- 801213c: 7a9e 9a72 2e7e 5f72 6664 5c57 2e96 9be0 .zr.~.r_dfW\....
- 801214c: 9c97 9c03 16c7 3a10 6783 9d10 ebb1 d25c .......:.g....\.
- 801215c: ba37 2548 6173 cef3 c974 cdf9 ebac afbe 7.H%sa..t.......
- 801216c: d927 5c7b cadf d8f8 933b b12e 1ae8 9001 '.{\....;.......
- 801217c: 07aa f316 13d7 313c 6f4e f614 c0bd 323e ......<1No....>2
- 801218c: 37e8 40e0 5856 3803 7a9b 54f0 7f29 2e7a .7.@VX.8.z.T).z.
- 801219c: c82e 4a01 dd08 c83e 13a2 51ea 3b5d 37aa ...J..>....Q];.7
- 80121ac: 535d ab39 33ef bbde ccad 6dc3 13f2 f46a ]S9..3.....m..j.
- 80121bc: 1f1c 31e0 e578 3dbc 385f bed6 ab52 ef93 ...1x..=_8..R...
- 80121cc: f5e0 6a78 656a 38fb d715 7bab fb48 d0b6 ..xjje.8...{H...
- 80121dc: 6f82 e3d3 14de ca11 f0ef 8e42 c956 03ef .o........B.V...
- 80121ec: 977d 7683 4c9d 6e6f 75aa 67fd 7383 3c82 }..v.Lon.u.g.s.<
- 80121fc: eb46 8f37 1d67 d4c6 3443 3ef7 e837 2810 F.7.g...C4.>7..(
- 801220c: 78d5 eef1 a1fe dc3d b60e 7667 3b35 369e .x....=...gv5;.6
- 801221c: f0c7 6850 e64b 53c8 806f ffe3 6300 b80c ..PhK..So....c..
- 801222c: 3acc 0018 4300 .:...
- 08012231 <Content_Length>:
- 8012231: 6f43 746e 6e65 2d74 654c 676e 6874 203a Content-Length:
- 8012241: 0000 9400 ...
- 08012244 <file__index_html>:
- 8012244: 2994 0801 226c 0801 2278 0801 071a 0000 .)..l"..x"......
- 8012254: 0001 0000 ....
- 08012258 <file__upload_js>:
- 8012258: 3610 0801 314d 0801 3159 0801 03f7 0000 .6..M1..Y1......
- 8012268: 0001 0000 ....
- 0801226c <data__index_html>:
- 801226c: 692f 646e 7865 682e 6d74 006c 5448 5054 /index.html.HTTP
- 801227c: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
- 801228c: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
- 801229c: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
- 80122ac: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
- 80122bc: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
- 80122cc: 6e65 2d74 7974 6570 203a 6574 7478 682f ent-type: text/h
- 80122dc: 6d74 0d6c 0d0a 3c0a 4421 434f 5954 4550 tml....<!DOCTYPE
- 80122ec: 6820 6d74 3e6c 683c 6d74 206c 616c 676e html><html lang
- 80122fc: 223d 3e22 683c 6165 3e64 6d3c 7465 2061 =""><head><meta
- 801230c: 6863 7261 6573 3d74 7522 6674 382d 3e22 charset="utf-8">
- 801231c: 6d3c 7465 2061 7468 7074 652d 7571 7669 <meta http-equiv
- 801232c: 223d 2d58 4155 432d 6d6f 6170 6974 6c62 ="X-UA-Compatibl
- 801233c: 2265 6320 6e6f 6574 746e 223d 4549 653d e" content="IE=e
- 801234c: 6764 2265 3c3e 656d 6174 6e20 6d61 3d65 dge"><meta name=
- 801235c: 7622 6569 7077 726f 2274 6320 6e6f 6574 "viewport" conte
- 801236c: 746e 223d 6977 7464 3d68 6564 6976 6563 nt="width=device
- 801237c: 772d 6469 6874 692c 696e 6974 6c61 732d -width,initial-s
- 801238c: 6163 656c 313d 6d2c 7861 6d69 6d75 732d cale=1,maximum-s
- 801239c: 6163 656c 313d 752c 6573 2d72 6373 6c61 cale=1,user-scal
- 80123ac: 6261 656c 303d 3e22 6c3c 6e69 206b 6572 able=0"><link re
- 80123bc: 3d6c 7322 7974 656c 6873 6565 2274 6820 l="stylesheet" h
- 80123cc: 6572 3d66 7522 6c70 616f 2e64 7363 2273 ref="upload.css"
- 80123dc: 3c3e 6974 6c74 3e65 9ed0 b1d0 bdd0 bed0 ><title>........
- 80123ec: b2d0 bbd0 b5d0 bdd0 b8d0 b5d0 d020 d1bf ............ ...
- 80123fc: d080 d1be d088 d0b8 d0b2 d0ba 3cb8 742f .............</t
- 801240c: 7469 656c 3c3e 682f 6165 3e64 623c 646f itle></head><bod
- 801241c: 3e79 6e3c 7661 6320 616c 7373 223d 616e y><nav class="na
- 801242c: 6276 7261 3e22 2f3c 616e 3e76 643c 7669 vbar"></nav><div
- 801243c: 6920 3d64 6322 756f 746e 772d 6172 2270 id="count-wrap"
- 801244c: 3c3e 6964 2076 6469 223d 6f63 6e75 6474 ><div id="countd
- 801245c: 776f 226e 3c3e 3e70 9ad0 bed0 bdd0 82d1 own"><p>........
- 801246c: 80d1 bed0 bbd0 bbd0 b5d0 80d1 d020 d1b1 ............ ...
- 801247c: d083 d0b4 d1b5 2082 bfd0 b5d0 80d1 b5d0 ....... ........
- 801248c: b7d0 b0d0 b3d0 80d1 83d1 b6d0 b5d0 bdd0 ................
- 801249c: d120 d087 d1b5 d080 d0b5 20b7 733c 6170 .......... <spa
- 80124ac: 206e 6469 223d 6f63 6e75 2d74 756e 626d n id="count-numb
- 80124bc: 7265 3e22 3c35 732f 6170 3e6e d120 d081 er">5</span> ...
- 80124cc: d0b5 d1ba d083 d0bd 2eb4 2f3c 3e70 2f3c ..........</p></
- 80124dc: 6964 3e76 2f3c 6964 3e76 643c 7669 6320 div></div><div c
- 80124ec: 616c 7373 223d 7277 7061 6570 2272 3c3e lass="wrapper"><
- 80124fc: 3168 d03e d09e d0b1 d0bd d0be d0b2 d0bb h1>.............
- 801250c: d0b5 d0bd d0b8 20b5 bfd0 80d1 bed0 88d1 ....... ........
- 801251c: b8d0 b2d0 bad0 b8d0 2f3c 3168 3c3e 6f66 ........</h1><fo
- 801252c: 6d72 6120 7463 6f69 3d6e 2f22 7075 6f6c rm action="/uplo
- 801253c: 6461 632e 6967 2022 656d 6874 646f 223d ad.cgi" method="
- 801254c: 6f70 7473 2022 6e65 7463 7079 3d65 6d22 post" enctype="m
- 801255c: 6c75 6974 6170 7472 662f 726f 2d6d 6164 ultipart/form-da
- 801256c: 6174 2022 6e6f 7573 6d62 7469 223d 6572 ta" onsubmit="re
- 801257c: 7574 6e72 5620 6c61 6469 7461 2865 6874 turn Validate(th
- 801258c: 7369 2229 3c3e 6964 2076 6c63 7361 3d73 is)"><div class=
- 801259c: 7522 6c70 616f 2d64 6f66 6d72 3e22 643c "upload-form"><d
- 80125ac: 7669 6320 616c 7373 223d 7567 6469 2265 iv class="guide"
- 80125bc: 3c3e 3e70 94d0 bbd0 8fd1 d020 d0be d0b1 ><p>...... .....
- 80125cc: d0bd d0be d0b2 d0bb d0b5 d0bd d1b8 208f ...............
- 80125dc: bfd0 80d1 bed0 88d1 b8d0 b2d0 bad0 b8d0 ................
- 80125ec: d020 d0bd d0b5 d0be d1b1 d085 d0be d0b4 ...............
- 80125fc: d0b8 d0bc 3abe 2f3c 3e70 6f3c 3e6c 6c3c .....:</p><ol><l
- 801260c: 3e69 a1d0 bad0 bed0 bfd0 b8d0 80d1 bed0 i>..............
- 801261c: b2d0 b0d0 82d1 8cd1 d020 d0bd 20b0 bad0 ........ .... ..
- 801262c: bed0 bcd0 bfd0 8cd1 8ed1 82d1 b5d0 80d1 ................
- 801263c: d020 d0b8 d0bb 20b8 b2d0 bdd0 b5d0 88d1 ...... ........
- 801264c: bdd0 b8d0 b9d0 d020 d0bd d1be d081 d1b8 ...... .........
- 801265c: d082 d0b5 d1bb 2c8c d120 d084 d0b0 d0b9 ......., .......
- 801266c: 20bb bfd0 80d1 bed0 88d1 b8d0 b2d0 bad0 . ..............
- 801267c: b8d0 d120 2081 80d1 b0d0 81d1 88d1 b8d0 .. .. ..........
- 801268c: 80d1 b5d0 bdd0 b8d0 b5d0 bcd0 2a20 622e ............ *.b
- 801269c: 6e69 2f3c 696c 3c3e 696c d03e d0a3 d0ba in</li><li>.....
- 80126ac: d0b0 d0b7 d1b0 d182 208c bfd0 83d1 82d1 ......... ......
- 80126bc: 8cd1 d020 20ba 84d1 b0d0 b9d0 bbd0 83d1 .. .. ..........
- 80126cc: d020 d1bf d080 d1be d088 d0b8 d0b2 d0ba ...............
- 80126dc: 3cb8 6c2f 3e69 6c3c 3e69 9dd0 b0d0 b6d0 .</li><li>......
- 80126ec: b0d0 82d1 8cd1 d020 d0ba d0bd d0be d0bf ...... .........
- 80126fc: d1ba 2083 d022 d097 d0b0 d1b3 d180 d083 ... "...........
- 801270c: d0b7 d1b8 d182 228c 2f3c 696c 3c3e 6f2f ......."</li></o
- 801271c: 3e6c 703c d03e d094 d1bb 208f b2d0 bed0 l><p>...... ....
- 801272c: b7d0 b2d0 80d1 b0d0 82d1 b0d0 d020 20b2 ............ ..
- 801273c: bed0 81d1 bdd0 bed0 b2d0 bdd0 bed0 b9d0 ................
- 801274c: d020 d0b8 d1bd d082 d1b5 d180 d084 d0b5 ...............
- 801275c: d1b9 2081 bad0 bed0 bdd0 82d1 80d1 bed0 ... ............
- 801276c: bbd0 bbd0 b5d0 80d1 b0d0 d020 d0bd d0b0 .......... .....
- 801277c: d0b6 d0bc d1b8 d082 20b5 d022 d19e d082 ......... ".....
- 801278c: d0bc d0b5 d0bd d1b8 d182 228c 2f3c 3e70 ..........."</p>
- 801279c: 2f3c 6964 3e76 643c 7669 6320 616c 7373 </div><div class
- 80127ac: 223d 7075 6f6c 6461 772d 6172 7070 7265 ="upload-wrapper
- 80127bc: 3e22 693c 706e 7475 6920 3d64 7522 6c70 "><input id="upl
- 80127cc: 616f 4664 6c69 2265 7020 616c 6563 6f68 oadFile" placeho
- 80127dc: 646c 7265 223d a4d0 b0d0 b9d0 bbd0 2022 lder="........"
- 80127ec: 6964 6173 6c62 6465 223d 6964 6173 6c62 disabled="disabl
- 80127fc: 6465 2022 6c63 7361 3d73 6622 6c69 2d65 ed" class="file-
- 801280c: 616e 656d 3e22 643c 7669 6320 616c 7373 name"><div class
- 801281c: 223d 6966 656c 7055 6f6c 6461 6220 6e74 ="fileUpload btn
- 801282c: 6220 6e74 702d 6972 616d 7972 3e22 733c btn-primary"><s
- 801283c: 6170 3e6e 92d0 8bd1 b1d0 bed0 80d1 2f3c pan>..........</
- 801284c: 7073 6e61 203e 693c 706e 7475 6920 3d64 span> <input id=
- 801285c: 7522 6c70 616f 4264 6e74 2022 7974 6570 "uploadBtn" type
- 801286c: 223d 6966 656c 2022 6c63 7361 3d73 7522 ="file" class="u
- 801287c: 6c70 616f 2264 6e20 6d61 3d65 6422 7461 pload" name="dat
- 801288c: 6661 6c69 2265 3c3e 642f 7669 3c3e 642f afile"></div></d
- 801289c: 7669 3c3e 642f 7669 3c3e 6e69 7570 2074 iv></div><input
- 80128ac: 6c63 7361 3d73 6222 6e74 6220 6e74 702d class="btn btn-p
- 80128bc: 6972 616d 7972 2022 7974 6570 223d 7573 rimary" type="su
- 80128cc: 6d62 7469 2022 6176 756c 3d65 d022 d097 bmit" value="...
- 80128dc: d0b0 d1b3 d180 d083 d0b7 d1b8 d182 228c ..............."
- 80128ec: 203e 693c 706e 7475 6320 616c 7373 223d > <input class="
- 80128fc: 7462 206e 7462 2d6e 6164 676e 7265 2022 btn btn-danger"
- 801290c: 7974 6570 223d 7562 7474 6e6f 2022 6176 type="button" va
- 801291c: 756c 3d65 d022 d19e d082 d0bc d0b5 d0bd lue="...........
- 801292c: d1b8 d182 228c 6920 3d64 6722 626f 6361 ....." id="gobac
- 801293c: 226b 3c3e 662f 726f 3e6d 733c 7263 7069 k"></form><scrip
- 801294c: 2074 7974 6570 223d 6574 7478 6a2f 7661 t type="text/jav
- 801295c: 7361 7263 7069 2274 7320 6372 223d 7075 ascript" src="up
- 801296c: 6f6c 6461 6a2e 2273 3c3e 732f 7263 7069 load.js"></scrip
- 801297c: 3e74 2f3c 6964 3e76 2f3c 6f62 7964 3c3e t></div></body><
- 801298c: 682f 6d74 3e6c 0000 /html>..
- 08012994 <file__error_html>:
- 8012994: 0000 0000 29b6 0801 29c2 0801 03bd 0000 .....)...)......
- 80129a4: 0001 0000 ....
- 080129a8 <octet_stream>:
- 80129a8: 636f 6574 2d74 7473 6572 6d61 000d octet-stream..
- 080129b6 <data__error_html>:
- 80129b6: 652f 7272 726f 682e 6d74 006c 5448 5054 /error.html.HTTP
- 80129c6: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
- 80129d6: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
- 80129e6: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
- 80129f6: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
- 8012a06: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
- 8012a16: 6e65 2d74 7974 6570 203a 6574 7478 682f ent-type: text/h
- 8012a26: 6d74 0d6c 0d0a 3c0a 4421 434f 5954 4550 tml....<!DOCTYPE
- 8012a36: 6820 6d74 3e6c 683c 6d74 206c 616c 676e html><html lang
- 8012a46: 223d 3e22 683c 6165 3e64 6d3c 7465 2061 =""><head><meta
- 8012a56: 6863 7261 6573 3d74 7522 6674 382d 3e22 charset="utf-8">
- 8012a66: 6d3c 7465 2061 7468 7074 652d 7571 7669 <meta http-equiv
- 8012a76: 223d 2d58 4155 432d 6d6f 6170 6974 6c62 ="X-UA-Compatibl
- 8012a86: 2265 6320 6e6f 6574 746e 223d 4549 653d e" content="IE=e
- 8012a96: 6764 2265 3c3e 656d 6174 6e20 6d61 3d65 dge"><meta name=
- 8012aa6: 7622 6569 7077 726f 2274 6320 6e6f 6574 "viewport" conte
- 8012ab6: 746e 223d 6977 7464 3d68 6564 6976 6563 nt="width=device
- 8012ac6: 772d 6469 6874 692c 696e 6974 6c61 732d -width,initial-s
- 8012ad6: 6163 656c 313d 6d2c 7861 6d69 6d75 732d cale=1,maximum-s
- 8012ae6: 6163 656c 313d 752c 6573 2d72 6373 6c61 cale=1,user-scal
- 8012af6: 6261 656c 303d 3e22 6c3c 6e69 206b 6572 able=0"><link re
- 8012b06: 3d6c 7322 7974 656c 6873 6565 2274 6820 l="stylesheet" h
- 8012b16: 6572 3d66 7522 6c70 616f 2e64 7363 2273 ref="upload.css"
- 8012b26: 3c3e 6974 6c74 3e65 9ed0 88d1 b8d0 b1d0 ><title>........
- 8012b36: bad0 b0d0 d020 d0be d0b1 d0bd d0be d0b2 .... ...........
- 8012b46: d0bb d0b5 d0bd d1b8 3c8f 742f 7469 656c .........</title
- 8012b56: 3c3e 682f 6165 3e64 623c 646f 3e79 6e3c ></head><body><n
- 8012b66: 7661 6320 616c 7373 223d 616e 6276 7261 av class="navbar
- 8012b76: 3e22 2f3c 616e 3e76 643c 7669 6320 616c "></nav><div cla
- 8012b86: 7373 223d 7277 7061 6570 2272 3c3e 3168 ss="wrapper"><h1
- 8012b96: d03e d09e d0b1 d0bd d0be d0b2 d0bb d0b5 >...............
- 8012ba6: d0bd d0b8 20b5 bfd0 80d1 bed0 88d1 b8d0 ..... ..........
- 8012bb6: b2d0 bad0 b8d0 2f3c 3168 3c3e 6964 2076 ......</h1><div
- 8012bc6: 6c63 7361 3d73 7522 6c70 616f 2d64 6f66 class="upload-fo
- 8012bd6: 6d72 3e22 643c 7669 6320 616c 7373 223d rm"><div class="
- 8012be6: 7567 6469 2265 7320 7974 656c 223d 6574 guide" style="te
- 8012bf6: 7478 612d 696c 6e67 633a 6e65 6574 2272 xt-align:center"
- 8012c06: 3c3e 2070 7473 6c79 3d65 6322 6c6f 726f ><p style="color
- 8012c16: 233a 3964 3335 6634 3e22 623c d03e d19f :#d9534f"><b>...
- 8012c26: d080 20b8 bed0 b1d0 bdd0 bed0 b2d0 bbd0 ... ............
- 8012c36: b5d0 bdd0 b8d0 b8d0 d020 d1bf d080 d0be ........ .......
- 8012c46: d1b3 d080 d0b0 d0bc d0bc d0bd d0be d0b3 ................
- 8012c56: 20be bed0 b1d0 b5d0 81d1 bfd0 b5d0 87d1 . ..............
- 8012c66: b5d0 bdd0 b8d0 8fd1 d020 d0b2 d0be d0b7 ........ .......
- 8012c76: d0bd d0b8 d0ba d0bb 20b0 bed0 88d1 b8d0 ......... ......
- 8012c86: b1d0 bad0 b0d0 3c2e 622f 3c3e 7262 d03e .......</b><br>.
- 8012c96: d09f d0be d0b6 d0b0 d1bb d083 d1b9 d181 ................
- 8012ca6: d082 2cb0 d020 d0bf d0be d1bf d080 d0be ..., ...........
- 8012cb6: d1b1 d083 d1b9 d082 20b5 b5d0 89d1 91d1 ......... ......
- 8012cc6: d120 d080 d0b0 20b7 87d1 b5d0 80d1 b5d0 ...... ........
- 8012cd6: b7d0 3c20 7073 6e61 6920 3d64 6322 756f .. <span id="cou
- 8012ce6: 746e 6e2d 6d75 6562 2272 353e 2f3c 7073 nt-number">5</sp
- 8012cf6: 6e61 203e 81d1 b5d0 bad0 83d1 bdd0 b4d0 an> ............
- 8012d06: 2f3c 3e70 2f3c 6964 3e76 2f3c 6964 3e76 </p></div></div>
- 8012d16: 733c 7263 7069 2074 7974 6570 223d 6574 <script type="te
- 8012d26: 7478 6a2f 7661 7361 7263 7069 2274 7320 xt/javascript" s
- 8012d36: 6372 223d 7075 6f6c 6461 6a2e 2273 3c3e rc="upload.js"><
- 8012d46: 732f 7263 7069 3e74 733c 7263 7069 3e74 /script><script>
- 8012d56: 6f63 6e75 6474 776f 286e 3b29 2f3c 6373 countdown();</sc
- 8012d66: 6972 7470 3c3e 642f 7669 3c3e 622f 646f ript></div></bod
- 8012d76: 3e79 2f3c 7468 6c6d 2f3e y></html>
- 08012d7f <data__success_html>:
- 8012d7f: 732f 6375 6563 7373 682e 6d74 006c 0000 /success.html...
- 8012d8f: 5448 5054 312f 302e 3220 3030 4f20 0d4b HTTP/1.0 200 OK.
- 8012d9f: 530a 7265 6576 3a72 6c20 4977 2f50 2e31 .Server: lwIP/1.
- 8012daf: 2e33 2031 6828 7474 3a70 2f2f 6173 6176 3.1 (http://sava
- 8012dbf: 6e6e 6861 6e2e 6e6f 6e67 2e75 726f 2f67 nnah.nongnu.org/
- 8012dcf: 7270 6a6f 6365 7374 6c2f 6977 2970 0a0d projects/lwip)..
- 8012ddf: 6f43 746e 6e65 2d74 7974 6570 203a 6574 Content-type: te
- 8012def: 7478 682f 6d74 0d6c 0d0a 3c0a 4421 434f xt/html....<!DOC
- 8012dff: 5954 4550 6820 6d74 3e6c 683c 6d74 206c TYPE html><html
- 8012e0f: 616c 676e 223d 3e22 683c 6165 3e64 6d3c lang=""><head><m
- 8012e1f: 7465 2061 6863 7261 6573 3d74 7522 6674 eta charset="utf
- 8012e2f: 382d 3e22 6d3c 7465 2061 7468 7074 652d -8"><meta http-e
- 8012e3f: 7571 7669 223d 2d58 4155 432d 6d6f 6170 quiv="X-UA-Compa
- 8012e4f: 6974 6c62 2265 6320 6e6f 6574 746e 223d tible" content="
- 8012e5f: 4549 653d 6764 2265 3c3e 656d 6174 6e20 IE=edge"><meta n
- 8012e6f: 6d61 3d65 7622 6569 7077 726f 2274 6320 ame="viewport" c
- 8012e7f: 6e6f 6574 746e 223d 6977 7464 3d68 6564 ontent="width=de
- 8012e8f: 6976 6563 772d 6469 6874 692c 696e 6974 vice-width,initi
- 8012e9f: 6c61 732d 6163 656c 313d 6d2c 7861 6d69 al-scale=1,maxim
- 8012eaf: 6d75 732d 6163 656c 313d 752c 6573 2d72 um-scale=1,user-
- 8012ebf: 6373 6c61 6261 656c 303d 3e22 6c3c 6e69 scalable=0"><lin
- 8012ecf: 206b 6572 3d6c 7322 7974 656c 6873 6565 k rel="styleshee
- 8012edf: 2274 6820 6572 3d66 7522 6c70 616f 2e64 t" href="upload.
- 8012eef: 7363 2273 3c3e 6974 6c74 3e65 a3d0 81d1 css"><title>....
- 8012eff: bfd0 b5d0 88d1 bdd0 bed0 b5d0 d020 d0be ............ ...
- 8012f0f: d0b1 d0bd d0be d0b2 d0bb d0b5 d0bd d0b8 ................
- 8012f1f: 3cb5 742f 7469 656c 3c3e 682f 6165 3e64 .</title></head>
- 8012f2f: 623c 646f 3e79 6e3c 7661 6320 616c 7373 <body><nav class
- 8012f3f: 223d 616e 6276 7261 3e22 2f3c 616e 3e76 ="navbar"></nav>
- 8012f4f: 643c 7669 6320 616c 7373 223d 7277 7061 <div class="wrap
- 8012f5f: 6570 2272 3c3e 3168 d03e d09e d0b1 d0bd per"><h1>.......
- 8012f6f: d0be d0b2 d0bb d0b5 d0bd d0b8 20b5 bfd0 ............. ..
- 8012f7f: 80d1 bed0 88d1 b8d0 b2d0 bad0 b8d0 2f3c ..............</
- 8012f8f: 3168 3c3e 6964 2076 6c63 7361 3d73 7522 h1><div class="u
- 8012f9f: 6c70 616f 2d64 6f66 6d72 3e22 643c 7669 pload-form"><div
- 8012faf: 6320 616c 7373 223d 7567 6469 2265 7320 class="guide" s
- 8012fbf: 7974 656c 223d 6574 7478 612d 696c 6e67 tyle="text-align
- 8012fcf: 633a 6e65 6574 2272 3c3e 2070 7473 6c79 :center"><p styl
- 8012fdf: 3d65 6322 6c6f 726f 233a 3333 4343 3030 e="color:#33CC00
- 8012fef: 3e22 623c d03e d09e d0b1 d0bd d0be d0b2 "><b>...........
- 8012fff: d0bb d0b5 d0bd d0b8 20b5 bfd0 80d1 bed0 ......... ......
- 801300f: b3d0 80d1 b0d0 bcd0 bcd0 bdd0 bed0 b3d0 ................
- 801301f: bed0 d020 d0be d0b1 d1b5 d081 d0bf d1b5 .. .............
- 801302f: d087 d0b5 d0bd d1b8 208f 83d1 81d1 bfd0 ......... ......
- 801303f: b5d0 88d1 bdd0 bed0 d020 d0b7 d0b0 d0b2 ........ .......
- 801304f: d1b5 d180 d088 d0b5 d0bd 2ebe 2f3c 3e62 ............</b>
- 801305f: 623c 3e72 9ad0 bed0 bdd0 82d1 80d1 bed0 <br>............
- 801306f: bbd0 bbd0 b5d0 80d1 d020 d1b1 d083 d0b4 ........ .......
- 801307f: d1b5 2082 bfd0 b5d0 80d1 b5d0 b7d0 b0d0 ... ............
- 801308f: b3d0 80d1 83d1 b6d0 b5d0 bdd0 d120 d087 ............ ...
- 801309f: d1b5 d080 d0b5 20b7 733c 6170 206e 6469 ....... <span id
- 80130af: 223d 6f63 6e75 2d74 756e 626d 7265 3e22 ="count-number">
- 80130bf: 3c35 732f 6170 3e6e d120 d081 d0b5 d1ba 5</span> .......
- 80130cf: d083 d0bd 3cb4 702f 3c3e 642f 7669 3c3e .....</p></div><
- 80130df: 642f 7669 3c3e 6373 6972 7470 7420 7079 /div><script typ
- 80130ef: 3d65 7422 7865 2f74 616a 6176 6373 6972 e="text/javascri
- 80130ff: 7470 2022 7273 3d63 7522 6c70 616f 2e64 pt" src="upload.
- 801310f: 736a 3e22 2f3c 6373 6972 7470 3c3e 6373 js"></script><sc
- 801311f: 6972 7470 633e 756f 746e 6f64 6e77 2928 ript>countdown()
- 801312f: 3c3b 732f 7263 7069 3e74 2f3c 6964 3e76 ;</script></div>
- 801313f: 2f3c 6f62 7964 3c3e 682f 6d74 3e6c </body></html>
- 0801314d <data__upload_js>:
- 801314d: 752f 6c70 616f 2e64 736a 0000 5448 5054 /upload.js..HTTP
- 801315d: 312f 302e 3220 3030 4f20 0d4b 530a 7265 /1.0 200 OK..Ser
- 801316d: 6576 3a72 6c20 4977 2f50 2e31 2e33 2031 ver: lwIP/1.3.1
- 801317d: 6828 7474 3a70 2f2f 6173 6176 6e6e 6861 (http://savannah
- 801318d: 6e2e 6e6f 6e67 2e75 726f 2f67 7270 6a6f .nongnu.org/proj
- 801319d: 6365 7374 6c2f 6977 2970 0a0d 6f43 746e ects/lwip)..Cont
- 80131ad: 6e65 2d74 7974 6570 203a 7061 6c70 6369 ent-type: applic
- 80131bd: 7461 6f69 2f6e 2d78 616a 6176 6373 6972 ation/x-javascri
- 80131cd: 7470 0a0d 6f43 746e 6e65 2d74 6e45 6f63 pt..Content-Enco
- 80131dd: 6964 676e 203a 7a67 7069 0a0d 0a0d 8b1f ding: gzip......
- 80131ed: 0008 0000 0000 0b04 54b5 6ae1 46dc 7e10 .........T.j.F.~
- 80131fd: bd95 1825 cb09 99ea 2812 b756 2ea6 6269 ..%......(V...ib
- 801320d: db88 8e10 3012 aca6 a356 adbb bb75 6957 .....0..V...u.Wi
- 801321d: ee75 0e61 73e2 0b4a 140d 02fa d3fd 3007 u.a..sJ........0
- 801322d: 6ea1 24ec 67be 7dd8 cea3 749e 1c8e 9f9a .n.$.g.}...t....
- 801323d: 21fd ed21 eccc f37c 37cd d793 184a 15a9 .!!...|..7..J...
- 801324d: 17b9 f0f0 04b4 9753 648a d45a 5063 1e26 ......S..dZ.cP&.
- 801325d: 7982 8050 dcff ed9b e867 cf31 fed7 d742 .yP.....g.1...B.
- 801326d: 64ca 44fa e105 94e9 8497 fbb3 0549 5f66 .d.D........I.f_
- 801327d: 2819 bca7 d608 688e 6f6e 66dd 6f8c 046c .(.....hno.f.ol.
- 801328d: 5227 5861 685c 7dc1 78e2 4254 e8ce 3427 'RaX\h.}.xTB..'4
- 801329d: f88c fd17 0d8d b5be 7d15 3f2c 255d 52dd .........},?]%.R
- 80132ad: 38f5 9285 b186 0a54 47ca 8383 8cc7 7c47 .8....T..G....G|
- 80132bd: 6d1e a7c3 801d fd88 87ab befb 0f2a 8d2f .m..........*./.
- 80132cd: d244 a0e0 9d43 7172 8b1c a4a1 6888 4837 D...C.rq.....h7H
- 80132dd: d099 972a 38e5 f6a0 f70f 711b f6e7 bd95 ..*..8.....q....
- 80132ed: cf74 a5ed f1bd bfbf 85b8 125d b3f7 e25d t.........]...].
- 80132fd: 15c7 973e 75a4 71b8 6ee7 5ee1 33ba 3bf7 ..>..u.q.n.^.3.;
- 801330d: 111e 3874 37b3 8976 ff56 26be 0af6 406f ..t8.7v.V..&..o@
- 801331d: f77f bddc dbc0 ddae 2ed9 2996 e618 fb41 ...........)..A.
- 801332d: fb6b 930a b85c 0f85 d85c 3e77 7f9f 1a62 k...\...\.w>..b.
- 801333d: a4ee d7ac d28f 35dd cf59 1e0e 323f f266 .......5Y...?2f.
- 801334d: 7e14 a1ac bb32 8d3f 118b 32fe 2705 aee4 .~..2.?....2.'..
- 801335d: a769 fa6b 3b12 853b df67 3fa6 3080 3d01 i.k..;;.g..?.0.=
- 801336d: a290 95d4 4dce 63ec 8306 8827 75a5 f58f .....M.c..'..u..
- 801337d: 5404 1f40 183e 88d0 bd47 7bfe 0543 0b2a .T@.>...G..{C.*.
- 801338d: 7f42 33b4 32d5 bc23 d280 a204 f3c3 bc77 B..3.2#.......w.
- 801339d: 1990 e037 ce99 1975 d8ac bc66 9da3 6f6a ..7...u...f...jo
- 80133ad: e036 6fc3 18f8 2a02 a4d5 2b36 fa12 f889 6..o...*..6+....
- 80133bd: 8d3c 500b 3343 c44a 66e6 a7d3 a58c e287 <..PC3J..f......
- 80133cd: 0228 dbd6 644e d01e 165c 6d80 62ca 9b33 (...Nd..\..m.b3.
- 80133dd: 7840 478a ff7d 8fe7 36ab 6c38 d5f5 a340 @x.G}....68l..@.
- 80133ed: cff6 2ba6 bec4 4821 85fb b6bd dd6f f139 ...+..!H....o.9.
- 80133fd: fadc bed6 93c1 f8d7 20dc 9f08 c225 1e44 ......... ..%.D.
- 801340d: be72 f5be 7fb0 2b14 eac4 e7d3 7d8c 628f r......+.....}.b
- 801341d: d996 98d7 17cf 9e10 4c62 ba3f b417 422a ........bL?...*B
- 801342d: 8a11 5782 b795 ffb1 dd3c 24a4 1593 0b4f ...W....<..$..O.
- 801343d: 68c8 9692 8fc0 78e7 0f71 443e 57fd 9483 .h.....xq.>D.W..
- 801344d: cdd0 431c 6856 4751 f617 8a2d 6fe8 8b2f ...CVhQG..-..o/.
- 801345d: ac88 72d4 7ee6 1145 c4ae 1689 e294 9795 ...r.~E.........
- 801346d: 3bd9 e054 58ba 417b 6230 9189 78ff 121d .;T..X{A0b...x..
- 801347d: e514 a572 af30 05ea 758a 1781 917b f4a2 ..r.0....u..{...
- 801348d: cbdc 721d 3988 56ef 0089 908e de9e 7cf6 ...r.9.V.......|
- 801349d: 70de ebdb 3dcf 4647 418e 26d7 9db9 ad4f .p...=GF.A.&..O.
- 80134ad: bac6 60ae a7ac 3ac0 2f03 e00a a0e5 0e71 ...`...:./....q.
- 80134bd: a0da 6a30 183f 896e adb5 8313 a1db d89d ..0j?.n.........
- 80134cd: 80ce b8e2 c6e0 5e40 c19b 293f 04f9 af19 ......@^..?)....
- 80134dd: accc 1880 9d59 7c14 68c6 ab8a 98e4 9efa ....Y..|.h......
- 80134ed: eedc 8fa4 dd3a 047a 8861 e30b b833 ce1f ....:.z.a...3...
- 80134fd: ed57 4bbf a300 7bfb e24f 2a54 749a aa9b W..K...{O.T*.t..
- 801350d: 2895 38a4 96ee 59ca 2e07 de8d c157 57ff .(.8...Y....W..W
- 801351d: 88e4 9eaa 9a14 7b67 6146 08b1 c46c f0d5 ......g{Fa..l...
- 801352d: 134e 9b6e c1f4 6f12 bd03 31a2 d512 035d N.n....o...1..].
- 801353d: 2333 3559 b533 ff56 f93c 5417 58c3 1a63 3#Y53.V.<..T.Xc.
- 801354d: 0006 4400 ...
- 08013550 <file__success_html>:
- 8013550: 2244 0801 2d7f 0801 2d8f 0801 03be 0000 D"...-...-......
- 8013560: 0001 0000 4547 2054 002f 4547 2054 752f ....GET /.GET /u
- 8013570: 6c70 616f 2e64 7363 0073 4547 2054 752f pload.css.GET /u
- 8013580: 6c70 616f 2e64 736a 4700 5445 2f20 6f67 pload.js.GET /go
- 8013590: 6162 6b63 632e 6967 4700 5445 2f20 6166 back.cgi.GET /fa
- 80135a0: 6976 6f63 2e6e 6369 006f 692f 646e 7865 vicon.ico./index
- 80135b0: 682e 6d74 006c 4f50 5453 2f20 7075 6f6c .html.POST /uplo
- 80135c0: 6461 632e 6967 6600 6c69 6e65 6d61 3d65 ad.cgi.filename=
- 80135d0: 2f00 7075 6f6c 6461 682e 6d74 006c 6946 ./upload.html.Fi
- 80135e0: 656c 203a 7325 0d0a 2500 2064 7962 6574 le: %s...%d byte
- 80135f0: 2073 0d0a 2f00 7573 6363 7365 2e73 7468 s .../success.ht
- 8013600: 6c6d 2f00 7265 6f72 2e72 7468 6c6d 0000 ml./error.html..
- 08013610 <file__upload_css>:
- 8013610: 3550 0801 193c 0801 1948 0801 08e9 0000 P5..<...H.......
- 8013620: 0001 0000 3931 2e32 3631 2e38 3431 342e ....192.168.14.4
- 8013630: 0038 3931 2e32 3631 2e38 3431 312e 6c00 8.192.168.14.1.l
- 8013640: 616f 4d64 646f 3a65 2520 0d64 620a 6f6f oadMode: %d..boo
- 8013650: 5474 7972 203a 6425 0a0d 5200 6e75 6d20 tTry: %d...Run m
- 8013660: 6961 206e 5746 0d0a 0000 0000 0043 0000 ain FW......C...
- 08013670 <_init>:
- 8013670: b5f8 push {r3, r4, r5, r6, r7, lr}
- 8013672: bf00 nop
- 8013674: bcf8 pop {r3, r4, r5, r6, r7}
- 8013676: bc08 pop {r3}
- 8013678: 469e mov lr, r3
- 801367a: 4770 bx lr
- 0801367c <_fini>:
- 801367c: b5f8 push {r3, r4, r5, r6, r7, lr}
- 801367e: bf00 nop
- 8013680: bcf8 pop {r3, r4, r5, r6, r7}
- 8013682: bc08 pop {r3}
- 8013684: 469e mov lr, r3
- 8013686: 4770 bx lr
|