hello_world.objdump 272 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330
  1. hello_world.elf: file format elf32-littlenios2
  2. hello_world.elf
  3. architecture: nios2:r1, flags 0x00000112:
  4. EXEC_P, HAS_SYMS, D_PAGED
  5. start address 0x00040230
  6. Program Header:
  7. LOAD off 0x00001000 vaddr 0x00040000 paddr 0x00040000 align 2**12
  8. filesz 0x00000020 memsz 0x00000020 flags r-x
  9. LOAD off 0x00001020 vaddr 0x00040020 paddr 0x00040020 align 2**12
  10. filesz 0x00005770 memsz 0x00005770 flags r-x
  11. LOAD off 0x00006790 vaddr 0x00045790 paddr 0x000471fc align 2**12
  12. filesz 0x00001a6c memsz 0x00001a6c flags rw-
  13. LOAD off 0x00008c68 vaddr 0x00048c68 paddr 0x00048c68 align 2**12
  14. filesz 0x00000000 memsz 0x00000154 flags rw-
  15. Sections:
  16. Idx Name Size VMA LMA File off Algn
  17. 0 .entry 00000020 00040000 00040000 00001000 2**5
  18. CONTENTS, ALLOC, LOAD, READONLY, CODE
  19. 1 .exceptions 00000210 00040020 00040020 00001020 2**2
  20. CONTENTS, ALLOC, LOAD, READONLY, CODE
  21. 2 .text 00005518 00040230 00040230 00001230 2**2
  22. CONTENTS, ALLOC, LOAD, READONLY, CODE
  23. 3 .rodata 00000048 00045748 00045748 00006748 2**2
  24. CONTENTS, ALLOC, LOAD, READONLY, DATA
  25. 4 .rwdata 00001a6c 00045790 000471fc 00006790 2**2
  26. CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
  27. 5 .bss 00000154 00048c68 00048c68 00008c68 2**2
  28. ALLOC, SMALL_DATA
  29. 6 .onchip_memory2 00000000 00048dbc 00048dbc 000081fc 2**0
  30. CONTENTS
  31. 7 .comment 00000023 00000000 00000000 000081fc 2**0
  32. CONTENTS, READONLY
  33. 8 .debug_aranges 00000a10 00000000 00000000 00008220 2**3
  34. CONTENTS, READONLY, DEBUGGING
  35. 9 .debug_info 000162ac 00000000 00000000 00008c30 2**0
  36. CONTENTS, READONLY, DEBUGGING
  37. 10 .debug_abbrev 00005eed 00000000 00000000 0001eedc 2**0
  38. CONTENTS, READONLY, DEBUGGING
  39. 11 .debug_line 00006881 00000000 00000000 00024dc9 2**0
  40. CONTENTS, READONLY, DEBUGGING
  41. 12 .debug_frame 00001534 00000000 00000000 0002b64c 2**2
  42. CONTENTS, READONLY, DEBUGGING
  43. 13 .debug_str 00002748 00000000 00000000 0002cb80 2**0
  44. CONTENTS, READONLY, DEBUGGING
  45. 14 .debug_loc 00004ada 00000000 00000000 0002f2c8 2**0
  46. CONTENTS, READONLY, DEBUGGING
  47. 15 .debug_alt_sim_info 00000010 00000000 00000000 00033da4 2**2
  48. CONTENTS, READONLY, DEBUGGING
  49. 16 .debug_ranges 00000680 00000000 00000000 00033db8 2**3
  50. CONTENTS, READONLY, DEBUGGING
  51. 17 .thread_model 00000003 00000000 00000000 0003689a 2**0
  52. CONTENTS, READONLY
  53. 18 .cpu 00000005 00000000 00000000 0003689d 2**0
  54. CONTENTS, READONLY
  55. 19 .qsys 00000001 00000000 00000000 000368a2 2**0
  56. CONTENTS, READONLY
  57. 20 .simulation_enabled 00000001 00000000 00000000 000368a3 2**0
  58. CONTENTS, READONLY
  59. 21 .stderr_dev 00000009 00000000 00000000 000368a4 2**0
  60. CONTENTS, READONLY
  61. 22 .stdin_dev 00000009 00000000 00000000 000368ad 2**0
  62. CONTENTS, READONLY
  63. 23 .stdout_dev 00000009 00000000 00000000 000368b6 2**0
  64. CONTENTS, READONLY
  65. 24 .sopc_system_name 00000008 00000000 00000000 000368bf 2**0
  66. CONTENTS, READONLY
  67. 25 .quartus_project_dir 00000036 00000000 00000000 000368c7 2**0
  68. CONTENTS, READONLY
  69. 26 .jdi 00004769 00000000 00000000 000368fd 2**0
  70. CONTENTS, READONLY
  71. 27 .sopcinfo 00033a1b 00000000 00000000 0003b066 2**0
  72. CONTENTS, READONLY
  73. SYMBOL TABLE:
  74. 00040000 l d .entry 00000000 .entry
  75. 00040020 l d .exceptions 00000000 .exceptions
  76. 00040230 l d .text 00000000 .text
  77. 00045748 l d .rodata 00000000 .rodata
  78. 00045790 l d .rwdata 00000000 .rwdata
  79. 00048c68 l d .bss 00000000 .bss
  80. 00048dbc l d .onchip_memory2 00000000 .onchip_memory2
  81. 00000000 l d .comment 00000000 .comment
  82. 00000000 l d .debug_aranges 00000000 .debug_aranges
  83. 00000000 l d .debug_info 00000000 .debug_info
  84. 00000000 l d .debug_abbrev 00000000 .debug_abbrev
  85. 00000000 l d .debug_line 00000000 .debug_line
  86. 00000000 l d .debug_frame 00000000 .debug_frame
  87. 00000000 l d .debug_str 00000000 .debug_str
  88. 00000000 l d .debug_loc 00000000 .debug_loc
  89. 00000000 l d .debug_alt_sim_info 00000000 .debug_alt_sim_info
  90. 00000000 l d .debug_ranges 00000000 .debug_ranges
  91. 00000000 l df *ABS* 00000000 ../hello_world_bsp//obj/HAL/src/crt0.o
  92. 00040268 l .text 00000000 alt_after_alt_main
  93. 00000000 l df *ABS* 00000000 alt_irq_handler.c
  94. 00000000 l df *ABS* 00000000 alt_instruction_exception_entry.c
  95. 00000000 l df *ABS* 00000000 hello_world.c
  96. 00000000 l df *ABS* 00000000 puts.c
  97. 00000000 l df *ABS* 00000000 strlen.c
  98. 00000000 l df *ABS* 00000000 findfp.c
  99. 00040414 l F .text 00000008 __fp_unlock
  100. 00040428 l F .text 0000019c __sinit.part.1
  101. 000405c4 l F .text 00000008 __fp_lock
  102. 00000000 l df *ABS* 00000000 fvwrite.c
  103. 00000000 l df *ABS* 00000000 fwalk.c
  104. 00000000 l df *ABS* 00000000 impure.c
  105. 00045790 l O .rwdata 00000424 impure_data
  106. 00000000 l df *ABS* 00000000 mallocr.c
  107. 00000000 l df *ABS* 00000000 memchr.c
  108. 00000000 l df *ABS* 00000000 memcpy.c
  109. 00000000 l df *ABS* 00000000 memmove.c
  110. 00000000 l df *ABS* 00000000 memset.c
  111. 00000000 l df *ABS* 00000000 mallocr.c
  112. 00000000 l df *ABS* 00000000 sbrkr.c
  113. 00000000 l df *ABS* 00000000 stdio.c
  114. 00000000 l df *ABS* 00000000 writer.c
  115. 00000000 l df *ABS* 00000000 wsetup.c
  116. 00000000 l df *ABS* 00000000 closer.c
  117. 00000000 l df *ABS* 00000000 fclose.c
  118. 00000000 l df *ABS* 00000000 fflush.c
  119. 00000000 l df *ABS* 00000000 mallocr.c
  120. 00000000 l df *ABS* 00000000 int_errno.c
  121. 00000000 l df *ABS* 00000000 lseekr.c
  122. 00000000 l df *ABS* 00000000 makebuf.c
  123. 00000000 l df *ABS* 00000000 readr.c
  124. 00000000 l df *ABS* 00000000 fstatr.c
  125. 00000000 l df *ABS* 00000000 isattyr.c
  126. 00000000 l df *ABS* 00000000 lib2-divmod.c
  127. 00000000 l df *ABS* 00000000 lib2-mul.c
  128. 00000000 l df *ABS* 00000000 alt_close.c
  129. 000430b4 l F .text 0000003c alt_get_errno
  130. 00000000 l df *ABS* 00000000 alt_dev.c
  131. 000431c8 l F .text 0000002c alt_dev_null_write
  132. 00000000 l df *ABS* 00000000 alt_errno.c
  133. 00000000 l df *ABS* 00000000 alt_fstat.c
  134. 000431f4 l F .text 0000003c alt_get_errno
  135. 00000000 l df *ABS* 00000000 alt_isatty.c
  136. 000432e8 l F .text 0000003c alt_get_errno
  137. 00000000 l df *ABS* 00000000 alt_load.c
  138. 000433d0 l F .text 00000068 alt_load_section
  139. 00000000 l df *ABS* 00000000 alt_lseek.c
  140. 000434bc l F .text 0000003c alt_get_errno
  141. 00000000 l df *ABS* 00000000 alt_main.c
  142. 00000000 l df *ABS* 00000000 alt_malloc_lock.c
  143. 00000000 l df *ABS* 00000000 alt_read.c
  144. 00043698 l F .text 0000003c alt_get_errno
  145. 00000000 l df *ABS* 00000000 alt_release_fd.c
  146. 00000000 l df *ABS* 00000000 alt_sbrk.c
  147. 000471ec l O .rwdata 00000004 heap_end
  148. 00000000 l df *ABS* 00000000 alt_write.c
  149. 0004390c l F .text 0000003c alt_get_errno
  150. 00000000 l df *ABS* 00000000 alt_sys_init.c
  151. 00043a48 l F .text 00000034 alt_dev_reg
  152. 00046164 l O .rwdata 00001060 jtag_uart
  153. 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_fd.c
  154. 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_init.c
  155. 00043d20 l F .text 0000020c altera_avalon_jtag_uart_irq
  156. 00043f2c l F .text 000000a0 altera_avalon_jtag_uart_timeout
  157. 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_ioctl.c
  158. 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_read.c
  159. 00000000 l df *ABS* 00000000 altera_avalon_jtag_uart_write.c
  160. 00000000 l df *ABS* 00000000 alt_alarm_start.c
  161. 00000000 l df *ABS* 00000000 alt_dcache_flush_all.c
  162. 00000000 l df *ABS* 00000000 alt_dev_llist_insert.c
  163. 000446b0 l F .text 0000003c alt_get_errno
  164. 00000000 l df *ABS* 00000000 alt_do_ctors.c
  165. 00000000 l df *ABS* 00000000 alt_do_dtors.c
  166. 00000000 l df *ABS* 00000000 alt_icache_flush_all.c
  167. 00000000 l df *ABS* 00000000 alt_iic.c
  168. 00000000 l df *ABS* 00000000 alt_iic_isr_register.c
  169. 00000000 l df *ABS* 00000000 alt_io_redirect.c
  170. 00044b10 l F .text 000000e4 alt_open_fd
  171. 00000000 l df *ABS* 00000000 alt_irq_vars.c
  172. 00000000 l df *ABS* 00000000 alt_open.c
  173. 00044c70 l F .text 0000003c alt_get_errno
  174. 00044cac l F .text 000000ec alt_file_locked
  175. 00000000 l df *ABS* 00000000 alt_tick.c
  176. 00000000 l df *ABS* 00000000 altera_nios2_gen2_irq.c
  177. 00000000 l df *ABS* 00000000 alt_find_dev.c
  178. 00000000 l df *ABS* 00000000 alt_find_file.c
  179. 00000000 l df *ABS* 00000000 alt_get_fd.c
  180. 00000000 l df *ABS* 00000000 atexit.c
  181. 00000000 l df *ABS* 00000000 exit.c
  182. 00000000 l df *ABS* 00000000 memcmp.c
  183. 00000000 l df *ABS* 00000000 __atexit.c
  184. 00000000 l df *ABS* 00000000 __call_atexit.c
  185. 00000000 l df *ABS* 00000000 alt_exit.c
  186. 00048c90 g O .bss 00000004 alt_instruction_exception_handler
  187. 00042e84 g F .text 00000054 _isatty_r
  188. 000435d4 g F .text 0000007c alt_main
  189. 000402a8 g F .text 000000c0 _puts_r
  190. 00048cbc g O .bss 00000100 alt_irq
  191. 00042bac g F .text 00000060 _lseek_r
  192. 000471fc g *ABS* 00000000 __flash_rwdata_start
  193. 00048dbc g *ABS* 00000000 __alt_heap_start
  194. 00042160 g F .text 0000005c __sseek
  195. 00040774 g F .text 00000010 __sinit
  196. 000405cc g F .text 00000078 __sfmoreglue
  197. 00043674 g F .text 00000024 __malloc_unlock
  198. 0004184c g F .text 0000015c memmove
  199. 0004075c g F .text 00000018 _cleanup
  200. 00045098 g F .text 00000024 altera_nios2_gen2_irq_init
  201. 00040000 g F .entry 0000000c __reset
  202. 00040020 g *ABS* 00000000 __flash_exceptions_start
  203. 00042e28 g F .text 0000005c _fstat_r
  204. 00048c74 g O .bss 00000004 errno
  205. 000420dc g F .text 00000008 __seofread
  206. 00048c7c g O .bss 00000004 alt_argv
  207. 0004f1c4 g *ABS* 00000000 _gp
  208. 00045fe4 g O .rwdata 00000180 alt_fd_list
  209. 000450bc g F .text 00000090 alt_find_dev
  210. 00041704 g F .text 00000148 memcpy
  211. 0004041c g F .text 0000000c _cleanup_r
  212. 00044bf4 g F .text 0000007c alt_io_redirect
  213. 00045748 g *ABS* 00000000 __DTOR_END__
  214. 00040368 g F .text 00000014 puts
  215. 00045318 g F .text 0000009c alt_exception_cause_generated_bad_addr
  216. 00044124 g F .text 0000021c altera_avalon_jtag_uart_read
  217. 00042fd0 g F .text 00000064 .hidden __udivsi3
  218. 00043324 g F .text 000000ac isatty
  219. 00048c70 g O .bss 00000004 __malloc_top_pad
  220. 000407c4 g F .text 000004c8 __sfvwrite_r
  221. 00042034 g F .text 00000054 _sbrk_r
  222. 00042dc8 g F .text 00000060 _read_r
  223. 000471e4 g O .rwdata 00000004 alt_max_fd
  224. 000423cc g F .text 000000f0 _fclose_r
  225. 00042748 g F .text 00000030 fflush
  226. 00048c6c g O .bss 00000004 __malloc_max_sbrked_mem
  227. 000434f8 g F .text 000000dc lseek
  228. 000471c4 g O .rwdata 00000004 _global_impure_ptr
  229. 00041ad0 g F .text 00000564 _realloc_r
  230. 00048dbc g *ABS* 00000000 __bss_end
  231. 00044a20 g F .text 000000f0 alt_iic_isr_register
  232. 00044f90 g F .text 00000108 alt_tick
  233. 00040794 g F .text 00000018 __fp_lock_all
  234. 000449d4 g F .text 0000004c alt_ic_irq_enabled
  235. 00044ef4 g F .text 0000009c alt_alarm_stop
  236. 00048c84 g O .bss 00000004 alt_irq_active
  237. 000400fc g F .exceptions 000000d4 alt_irq_handler
  238. 00045fbc g O .rwdata 00000028 alt_dev_null
  239. 00044690 g F .text 00000020 alt_dcache_flush_all
  240. 000471fc g *ABS* 00000000 __ram_rwdata_end
  241. 000471dc g O .rwdata 00000008 alt_dev_list
  242. 00043948 g F .text 00000100 write
  243. 00045790 g *ABS* 00000000 __ram_rodata_end
  244. 00043230 g F .text 000000b8 fstat
  245. 00043034 g F .text 00000058 .hidden __umodsi3
  246. 00048dbc g *ABS* 00000000 end
  247. 00043c60 g F .text 000000c0 altera_avalon_jtag_uart_init
  248. 000401d0 g F .exceptions 00000060 alt_instruction_exception_entry
  249. 00045748 g *ABS* 00000000 __CTOR_LIST__
  250. 00072000 g *ABS* 00000000 __alt_stack_pointer
  251. 00044340 g F .text 00000224 altera_avalon_jtag_uart_write
  252. 00040784 g F .text 00000004 __sfp_lock_acquire
  253. 00041620 g F .text 000000e4 memchr
  254. 0004289c g F .text 00000310 _free_r
  255. 00045594 g F .text 00000180 __call_exitprocs
  256. 000471cc g O .rwdata 00000004 __malloc_sbrk_base
  257. 00040230 g F .text 0000003c _start
  258. 00048c88 g O .bss 00000004 _alt_tick_rate
  259. 00048c8c g O .bss 00000004 _alt_nticks
  260. 000436d4 g F .text 00000104 read
  261. 00043ab4 g F .text 00000048 alt_sys_init
  262. 0004547c g F .text 00000118 __register_exitproc
  263. 00043fcc g F .text 00000068 altera_avalon_jtag_uart_close
  264. 0004308c g F .text 00000028 .hidden __mulsi3
  265. 00045790 g *ABS* 00000000 __ram_rwdata_start
  266. 00045748 g *ABS* 00000000 __ram_rodata_start
  267. 00048c94 g O .bss 00000028 __malloc_current_mallinfo
  268. 00043afc g F .text 00000060 altera_avalon_jtag_uart_read_fd
  269. 00045254 g F .text 000000c4 alt_get_fd
  270. 00042378 g F .text 00000054 _close_r
  271. 00045400 g F .text 0000007c memcmp
  272. 00043bbc g F .text 00000050 altera_avalon_jtag_uart_close_fd
  273. 00048dbc g *ABS* 00000000 __alt_stack_base
  274. 00043c0c g F .text 00000054 altera_avalon_jtag_uart_ioctl_fd
  275. 00042224 g F .text 00000154 __swsetup_r
  276. 00040644 g F .text 00000118 __sfp
  277. 00045bb4 g O .rwdata 00000408 __malloc_av_
  278. 00040790 g F .text 00000004 __sinit_lock_release
  279. 00042088 g F .text 00000054 __sread
  280. 0004514c g F .text 00000108 alt_find_file
  281. 000446ec g F .text 000000a4 alt_dev_llist_insert
  282. 00043650 g F .text 00000024 __malloc_lock
  283. 0004385c g F .text 000000b0 sbrk
  284. 000426ec g F .text 0000005c _fflush_r
  285. 00048c68 g *ABS* 00000000 __bss_start
  286. 000419a8 g F .text 00000128 memset
  287. 0004026c g F .text 0000003c main
  288. 00048c80 g O .bss 00000004 alt_envp
  289. 00048c68 g O .bss 00000004 __malloc_max_total_mem
  290. 00043b5c g F .text 00000060 altera_avalon_jtag_uart_write_fd
  291. 000421bc g F .text 00000008 __sclose
  292. 00072000 g *ABS* 00000000 __alt_heap_limit
  293. 000424bc g F .text 00000014 fclose
  294. 00040e14 g F .text 0000080c _malloc_r
  295. 000471e8 g O .rwdata 00000004 alt_errno
  296. 00040c8c g F .text 000000c4 _fwalk
  297. 00042ed8 g F .text 00000084 .hidden __divsi3
  298. 00042778 g F .text 00000124 _malloc_trim_r
  299. 00045748 g *ABS* 00000000 __CTOR_END__
  300. 00045748 g *ABS* 00000000 __flash_rodata_start
  301. 00045748 g *ABS* 00000000 __DTOR_LIST__
  302. 00043a7c g F .text 00000038 alt_irq_init
  303. 000437d8 g F .text 00000084 alt_release_fd
  304. 000453b4 g F .text 00000014 atexit
  305. 000421c4 g F .text 00000060 _write_r
  306. 000471c8 g O .rwdata 00000004 _impure_ptr
  307. 00048c78 g O .bss 00000004 alt_argc
  308. 000424d0 g F .text 0000021c __sflush_r
  309. 000447f0 g F .text 00000060 _do_dtors
  310. 00040020 g .exceptions 00000000 alt_irq_entry
  311. 000407ac g F .text 00000018 __fp_unlock_all
  312. 000471d4 g O .rwdata 00000008 alt_fs_list
  313. 00040020 g *ABS* 00000000 __ram_exceptions_start
  314. 00040000 g *ABS* 00000000 __alt_mem_onchip_memory2
  315. 00044870 g F .text 00000050 alt_ic_isr_register
  316. 000471fc g *ABS* 00000000 _edata
  317. 00048dbc g *ABS* 00000000 _end
  318. 00040230 g *ABS* 00000000 __ram_exceptions_end
  319. 00044034 g F .text 000000f0 altera_avalon_jtag_uart_ioctl
  320. 00044948 g F .text 0000008c alt_ic_irq_disable
  321. 000420e4 g F .text 0000007c __swrite
  322. 000471d0 g O .rwdata 00000004 __malloc_trim_threshold
  323. 000453c8 g F .text 00000038 exit
  324. 00040d50 g F .text 000000c4 _fwalk_reent
  325. 00042f5c g F .text 00000074 .hidden __modsi3
  326. 00072000 g *ABS* 00000000 __alt_data_end
  327. 00040020 g F .exceptions 00000000 alt_exception
  328. 00040788 g F .text 00000004 __sfp_lock_release
  329. 00045714 g F .text 00000034 _exit
  330. 00044564 g F .text 0000012c alt_alarm_start
  331. 00042c0c g F .text 000001bc __smakebuf_r
  332. 0004037c g F .text 00000098 strlen
  333. 00044d98 g F .text 0000015c open
  334. 00044850 g F .text 00000020 alt_icache_flush_all
  335. 000471f0 g O .rwdata 00000004 alt_priority_mask
  336. 000448c0 g F .text 00000088 alt_ic_irq_enable
  337. 000471f4 g O .rwdata 00000008 alt_alarm_list
  338. 00044790 g F .text 00000060 _do_ctors
  339. 000430f0 g F .text 000000d8 close
  340. 00043438 g F .text 00000084 alt_load
  341. 0004078c g F .text 00000004 __sinit_lock_acquire
  342. Disassembly of section .entry:
  343. 00040000 <__reset>:
  344. * Jump to the _start entry point in the .text section if reset code
  345. * is allowed or if optimizing for RTL simulation.
  346. */
  347. #if defined(ALT_ALLOW_CODE_AT_RESET) || defined(ALT_SIM_OPTIMIZE)
  348. /* Jump to the _start entry point in the .text section. */
  349. movhi r1, %hi(_start)
  350. 40000: 00400134 movhi at,4
  351. ori r1, r1, %lo(_start)
  352. 40004: 08408c14 ori at,at,560
  353. jmp r1
  354. 40008: 0800683a jmp at
  355. ...
  356. Disassembly of section .exceptions:
  357. 00040020 <alt_exception>:
  358. #else /* ALT_EXCEPTION_STACK disabled */
  359. /*
  360. * Reserve space on normal stack for registers about to be pushed.
  361. */
  362. addi sp, sp, -76
  363. 40020: deffed04 addi sp,sp,-76
  364. * documentation for details).
  365. *
  366. * Leave a gap in the stack frame at 4(sp) for the muldiv handler to
  367. * store zero into.
  368. */
  369. stw ra, 0(sp)
  370. 40024: dfc00015 stw ra,0(sp)
  371. stw r1, 8(sp)
  372. 40028: d8400215 stw at,8(sp)
  373. stw r2, 12(sp)
  374. 4002c: d8800315 stw r2,12(sp)
  375. stw r3, 16(sp)
  376. 40030: d8c00415 stw r3,16(sp)
  377. stw r4, 20(sp)
  378. 40034: d9000515 stw r4,20(sp)
  379. stw r5, 24(sp)
  380. 40038: d9400615 stw r5,24(sp)
  381. stw r6, 28(sp)
  382. 4003c: d9800715 stw r6,28(sp)
  383. stw r7, 32(sp)
  384. 40040: d9c00815 stw r7,32(sp)
  385. rdctl r5, estatus /* Read early to avoid usage stall */
  386. 40044: 000b307a rdctl r5,estatus
  387. stw r8, 36(sp)
  388. 40048: da000915 stw r8,36(sp)
  389. stw r9, 40(sp)
  390. 4004c: da400a15 stw r9,40(sp)
  391. stw r10, 44(sp)
  392. 40050: da800b15 stw r10,44(sp)
  393. stw r11, 48(sp)
  394. 40054: dac00c15 stw r11,48(sp)
  395. stw r12, 52(sp)
  396. 40058: db000d15 stw r12,52(sp)
  397. stw r13, 56(sp)
  398. 4005c: db400e15 stw r13,56(sp)
  399. stw r14, 60(sp)
  400. 40060: db800f15 stw r14,60(sp)
  401. stw r15, 64(sp)
  402. 40064: dbc01015 stw r15,64(sp)
  403. /*
  404. * ea-4 contains the address of the instruction being executed
  405. * when the exception occured. For interrupt exceptions, we will
  406. * will be re-issue the isntruction. Store it in 72(sp)
  407. */
  408. stw r5, 68(sp) /* estatus */
  409. 40068: d9401115 stw r5,68(sp)
  410. addi r15, ea, -4 /* instruction that caused exception */
  411. 4006c: ebffff04 addi r15,ea,-4
  412. stw r15, 72(sp)
  413. 40070: dbc01215 stw r15,72(sp)
  414. #else
  415. /*
  416. * Test to see if the exception was a software exception or caused
  417. * by an external interrupt, and vector accordingly.
  418. */
  419. rdctl r4, ipending
  420. 40074: 0009313a rdctl r4,ipending
  421. andi r2, r5, 1
  422. 40078: 2880004c andi r2,r5,1
  423. beq r2, zero, .Lnot_irq
  424. 4007c: 10000326 beq r2,zero,4008c <alt_exception+0x6c>
  425. beq r4, zero, .Lnot_irq
  426. 40080: 20000226 beq r4,zero,4008c <alt_exception+0x6c>
  427. /*
  428. * Now that all necessary registers have been preserved, call
  429. * alt_irq_handler() to process the interrupts.
  430. */
  431. call alt_irq_handler
  432. 40084: 00400fc0 call 400fc <alt_irq_handler>
  433. .section .exceptions.irqreturn, "xa"
  434. br .Lexception_exit
  435. 40088: 00000706 br 400a8 <alt_exception+0x88>
  436. * upon completion, so we write ea (address of instruction *after*
  437. * the one where the exception occured) into 72(sp). The actual
  438. * instruction that caused the exception is written in r2, which these
  439. * handlers will utilize.
  440. */
  441. stw ea, 72(sp) /* EA is PC+4 so will skip over instruction causing exception */
  442. 4008c: df401215 stw ea,72(sp)
  443. .Lunknown_16bit:
  444. addi.n r4, r4, 2 /* Need PC+2 to skip over instruction causing exception */
  445. stw r4, 72(sp)
  446. #else /* CDX is not Enabled and all instructions are 32bits */
  447. ldw r2, -4(ea) /* Instruction value that caused exception */
  448. 40090: e8bfff17 ldw r2,-4(ea)
  449. * debugger is present) or go into an infinite loop since the
  450. * handling behavior is undefined; in that case we will not return here.
  451. */
  452. /* Load exception-causing address as first argument (r4) */
  453. addi r4, ea, -4
  454. 40094: e93fff04 addi r4,ea,-4
  455. /* Call the instruction-exception entry */
  456. call alt_instruction_exception_entry
  457. 40098: 00401d00 call 401d0 <alt_instruction_exception_entry>
  458. * instruction
  459. *
  460. * Return code was 0: Skip. The instruction after the exception is
  461. * already stored in 72(sp).
  462. */
  463. bne r2, r0, .Lexception_exit
  464. 4009c: 1000021e bne r2,zero,400a8 <alt_exception+0x88>
  465. /*
  466. * Otherwise, modify 72(sp) to re-issue the instruction that caused the
  467. * exception.
  468. */
  469. addi r15, ea, -4 /* instruction that caused exception */
  470. 400a0: ebffff04 addi r15,ea,-4
  471. stw r15, 72(sp)
  472. 400a4: dbc01215 stw r15,72(sp)
  473. /*
  474. * Restore the saved registers, so that all general purpose registers
  475. * have been restored to their state at the time the interrupt occured.
  476. */
  477. ldw r5, 68(sp)
  478. 400a8: d9401117 ldw r5,68(sp)
  479. ldw ea, 72(sp) /* This becomes the PC once eret is executed */
  480. 400ac: df401217 ldw ea,72(sp)
  481. ldw ra, 0(sp)
  482. 400b0: dfc00017 ldw ra,0(sp)
  483. wrctl estatus, r5
  484. 400b4: 2801707a wrctl estatus,r5
  485. ldw r1, 8(sp)
  486. 400b8: d8400217 ldw at,8(sp)
  487. ldw r2, 12(sp)
  488. 400bc: d8800317 ldw r2,12(sp)
  489. ldw r3, 16(sp)
  490. 400c0: d8c00417 ldw r3,16(sp)
  491. ldw r4, 20(sp)
  492. 400c4: d9000517 ldw r4,20(sp)
  493. ldw r5, 24(sp)
  494. 400c8: d9400617 ldw r5,24(sp)
  495. ldw r6, 28(sp)
  496. 400cc: d9800717 ldw r6,28(sp)
  497. ldw r7, 32(sp)
  498. 400d0: d9c00817 ldw r7,32(sp)
  499. #if defined(ALT_EXCEPTION_STACK) && defined(ALT_STACK_CHECK)
  500. ldw et, %gprel(alt_exception_old_stack_limit)(gp)
  501. #endif
  502. ldw r8, 36(sp)
  503. 400d4: da000917 ldw r8,36(sp)
  504. ldw r9, 40(sp)
  505. 400d8: da400a17 ldw r9,40(sp)
  506. ldw r10, 44(sp)
  507. 400dc: da800b17 ldw r10,44(sp)
  508. ldw r11, 48(sp)
  509. 400e0: dac00c17 ldw r11,48(sp)
  510. ldw r12, 52(sp)
  511. 400e4: db000d17 ldw r12,52(sp)
  512. ldw r13, 56(sp)
  513. 400e8: db400e17 ldw r13,56(sp)
  514. ldw r14, 60(sp)
  515. 400ec: db800f17 ldw r14,60(sp)
  516. ldw r15, 64(sp)
  517. 400f0: dbc01017 ldw r15,64(sp)
  518. stw et, %gprel(alt_stack_limit_value)(gp)
  519. stw zero, %gprel(alt_exception_old_stack_limit)(gp)
  520. #endif /* ALT_STACK_CHECK */
  521. ldw sp, 76(sp)
  522. #else /* ALT_EXCEPTION_STACK disabled */
  523. addi sp, sp, 76
  524. 400f4: dec01304 addi sp,sp,76
  525. /*
  526. * Return to the interrupted instruction.
  527. */
  528. eret
  529. 400f8: ef80083a eret
  530. 000400fc <alt_irq_handler>:
  531. * instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined.
  532. */
  533. void alt_irq_handler (void) __attribute__ ((section (".exceptions")));
  534. void alt_irq_handler (void)
  535. {
  536. 400fc: defff904 addi sp,sp,-28
  537. 40100: dfc00615 stw ra,24(sp)
  538. 40104: df000515 stw fp,20(sp)
  539. 40108: df000504 addi fp,sp,20
  540. /*
  541. * Notify the operating system that we are at interrupt level.
  542. */
  543. ALT_OS_INT_ENTER();
  544. 4010c: 0001883a nop
  545. #ifndef NIOS2_EIC_PRESENT
  546. static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void)
  547. {
  548. alt_u32 active;
  549. NIOS2_READ_IPENDING (active);
  550. 40110: 0005313a rdctl r2,ipending
  551. 40114: e0bffe15 stw r2,-8(fp)
  552. return active;
  553. 40118: e0bffe17 ldw r2,-8(fp)
  554. * Consider the case where the high priority interupt is asserted during
  555. * the interrupt entry sequence for a lower priority interrupt to see why
  556. * this is the case.
  557. */
  558. active = alt_irq_pending ();
  559. 4011c: e0bffb15 stw r2,-20(fp)
  560. do
  561. {
  562. i = 0;
  563. 40120: e03ffd15 stw zero,-12(fp)
  564. mask = 1;
  565. 40124: 00800044 movi r2,1
  566. 40128: e0bffc15 stw r2,-16(fp)
  567. * called to clear the interrupt condition.
  568. */
  569. do
  570. {
  571. if (active & mask)
  572. 4012c: e0fffb17 ldw r3,-20(fp)
  573. 40130: e0bffc17 ldw r2,-16(fp)
  574. 40134: 1884703a and r2,r3,r2
  575. 40138: 10001426 beq r2,zero,4018c <alt_irq_handler+0x90>
  576. {
  577. #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT
  578. alt_irq[i].handler(alt_irq[i].context);
  579. 4013c: 00800174 movhi r2,5
  580. 40140: 10a32f04 addi r2,r2,-29508
  581. 40144: e0fffd17 ldw r3,-12(fp)
  582. 40148: 180690fa slli r3,r3,3
  583. 4014c: 10c5883a add r2,r2,r3
  584. 40150: 10c00017 ldw r3,0(r2)
  585. 40154: 00800174 movhi r2,5
  586. 40158: 10a32f04 addi r2,r2,-29508
  587. 4015c: e13ffd17 ldw r4,-12(fp)
  588. 40160: 200890fa slli r4,r4,3
  589. 40164: 1105883a add r2,r2,r4
  590. 40168: 10800104 addi r2,r2,4
  591. 4016c: 10800017 ldw r2,0(r2)
  592. 40170: 1009883a mov r4,r2
  593. 40174: 183ee83a callr r3
  594. #else
  595. alt_irq[i].handler(alt_irq[i].context, i);
  596. #endif
  597. break;
  598. 40178: 0001883a nop
  599. #ifndef NIOS2_EIC_PRESENT
  600. static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_irq_pending (void)
  601. {
  602. alt_u32 active;
  603. NIOS2_READ_IPENDING (active);
  604. 4017c: 0005313a rdctl r2,ipending
  605. 40180: e0bfff15 stw r2,-4(fp)
  606. return active;
  607. 40184: e0bfff17 ldw r2,-4(fp)
  608. 40188: 00000706 br 401a8 <alt_irq_handler+0xac>
  609. }
  610. mask <<= 1;
  611. 4018c: e0bffc17 ldw r2,-16(fp)
  612. 40190: 1085883a add r2,r2,r2
  613. 40194: e0bffc15 stw r2,-16(fp)
  614. i++;
  615. 40198: e0bffd17 ldw r2,-12(fp)
  616. 4019c: 10800044 addi r2,r2,1
  617. 401a0: e0bffd15 stw r2,-12(fp)
  618. } while (1);
  619. 401a4: 003fe106 br 4012c <alt_irq_handler+0x30>
  620. active = alt_irq_pending ();
  621. 401a8: e0bffb15 stw r2,-20(fp)
  622. } while (active);
  623. 401ac: e0bffb17 ldw r2,-20(fp)
  624. 401b0: 103fdb1e bne r2,zero,40120 <alt_irq_handler+0x24>
  625. /*
  626. * Notify the operating system that interrupt processing is complete.
  627. */
  628. ALT_OS_INT_EXIT();
  629. 401b4: 0001883a nop
  630. }
  631. 401b8: 0001883a nop
  632. 401bc: e037883a mov sp,fp
  633. 401c0: dfc00117 ldw ra,4(sp)
  634. 401c4: df000017 ldw fp,0(sp)
  635. 401c8: dec00204 addi sp,sp,8
  636. 401cc: f800283a ret
  637. 000401d0 <alt_instruction_exception_entry>:
  638. * that handler if it has been registered. Absent a handler, it will
  639. * break break or hang as discussed below.
  640. */
  641. int
  642. alt_instruction_exception_entry (alt_u32 exception_pc)
  643. {
  644. 401d0: defffb04 addi sp,sp,-20
  645. 401d4: dfc00415 stw ra,16(sp)
  646. 401d8: df000315 stw fp,12(sp)
  647. 401dc: df000304 addi fp,sp,12
  648. 401e0: e13fff15 stw r4,-4(fp)
  649. cause = ( (cause & NIOS2_EXCEPTION_REG_CAUSE_MASK) >>
  650. NIOS2_EXCEPTION_REG_CAUSE_OFST );
  651. NIOS2_READ_BADADDR(badaddr);
  652. #else
  653. cause = NIOS2_EXCEPTION_CAUSE_NOT_PRESENT;
  654. 401e4: 00bfffc4 movi r2,-1
  655. 401e8: e0bffd15 stw r2,-12(fp)
  656. badaddr = 0;
  657. 401ec: e03ffe15 stw zero,-8(fp)
  658. #endif /* NIOS2_HAS_EXTRA_EXCEPTION_INFO */
  659. if(alt_instruction_exception_handler) {
  660. 401f0: d0a6b317 ldw r2,-25908(gp)
  661. 401f4: 10000726 beq r2,zero,40214 <alt_instruction_exception_entry+0x44>
  662. * Call handler. Its return value indicates whether the exception-causing
  663. * instruction should be re-issued. The code that called us,
  664. * alt_eceptions_entry.S, will look at this value and adjust the ea
  665. * register as necessary
  666. */
  667. return alt_instruction_exception_handler(cause, exception_pc, badaddr);
  668. 401f8: d0a6b317 ldw r2,-25908(gp)
  669. 401fc: e0fffd17 ldw r3,-12(fp)
  670. 40200: e1bffe17 ldw r6,-8(fp)
  671. 40204: e17fff17 ldw r5,-4(fp)
  672. 40208: 1809883a mov r4,r3
  673. 4020c: 103ee83a callr r2
  674. 40210: 00000206 br 4021c <alt_instruction_exception_entry+0x4c>
  675. * (a peripheral which negates its interrupt output before its
  676. * interrupt handler has been executed will cause spurious interrupts)
  677. */
  678. else {
  679. #ifdef NIOS2_HAS_DEBUG_STUB
  680. NIOS2_BREAK();
  681. 40214: 003da03a break 0
  682. ;
  683. #endif /* NIOS2_HAS_DEBUG_STUB */
  684. }
  685. /* We should not get here. Remove compiler warning. */
  686. return NIOS2_EXCEPTION_RETURN_REISSUE_INST;
  687. 40218: 0005883a mov r2,zero
  688. }
  689. 4021c: e037883a mov sp,fp
  690. 40220: dfc00117 ldw ra,4(sp)
  691. 40224: df000017 ldw fp,0(sp)
  692. 40228: dec00204 addi sp,sp,8
  693. 4022c: f800283a ret
  694. Disassembly of section .text:
  695. 00040230 <_start>:
  696. /*
  697. * Now that the caches are initialized, set up the stack pointer and global pointer.
  698. * The values provided by the linker are assumed to be correctly aligned.
  699. */
  700. movhi sp, %hi(__alt_stack_pointer)
  701. 40230: 06c001f4 movhi sp,7
  702. ori sp, sp, %lo(__alt_stack_pointer)
  703. 40234: dec80014 ori sp,sp,8192
  704. movhi gp, %hi(_gp)
  705. 40238: 06800134 movhi gp,4
  706. ori gp, gp, %lo(_gp)
  707. 4023c: d6bc7114 ori gp,gp,61892
  708. */
  709. #ifndef ALT_SIM_OPTIMIZE
  710. /* Log that the BSS is about to be cleared. */
  711. ALT_LOG_PUTS(alt_log_msg_bss)
  712. movhi r2, %hi(__bss_start)
  713. 40240: 00800134 movhi r2,4
  714. ori r2, r2, %lo(__bss_start)
  715. 40244: 10a31a14 ori r2,r2,35944
  716. movhi r3, %hi(__bss_end)
  717. 40248: 00c00134 movhi r3,4
  718. ori r3, r3, %lo(__bss_end)
  719. 4024c: 18e36f14 ori r3,r3,36284
  720. beq r2, r3, 1f
  721. 40250: 10c00326 beq r2,r3,40260 <_start+0x30>
  722. 0:
  723. stw zero, (r2)
  724. 40254: 10000015 stw zero,0(r2)
  725. addi r2, r2, 4
  726. 40258: 10800104 addi r2,r2,4
  727. bltu r2, r3, 0b
  728. 4025c: 10fffd36 bltu r2,r3,40254 <_start+0x24>
  729. * section aren't defined until alt_load() has been called).
  730. */
  731. mov et, zero
  732. #endif
  733. call alt_load
  734. 40260: 00434380 call 43438 <alt_load>
  735. /* Log that alt_main is about to be called. */
  736. ALT_LOG_PUTS(alt_log_msg_alt_main)
  737. /* Call the C entry point. It should never return. */
  738. call alt_main
  739. 40264: 00435d40 call 435d4 <alt_main>
  740. 00040268 <alt_after_alt_main>:
  741. /* Wait in infinite loop in case alt_main does return. */
  742. alt_after_alt_main:
  743. br alt_after_alt_main
  744. 40268: 003fff06 br 40268 <alt_after_alt_main>
  745. 0004026c <main>:
  746. #include <stdio.h>
  747. #include "altera_avalon_pio_regs.h"
  748. #include <system.h>
  749. int main()
  750. {
  751. 4026c: defffd04 addi sp,sp,-12
  752. 40270: dfc00215 stw ra,8(sp)
  753. 40274: df000115 stw fp,4(sp)
  754. 40278: df000104 addi fp,sp,4
  755. printf("Hello from Nios II!\n");
  756. 4027c: 01000134 movhi r4,4
  757. 40280: 2115d204 addi r4,r4,22344
  758. 40284: 00403680 call 40368 <puts>
  759. int count = 0;
  760. 40288: e03fff15 stw zero,-4(fp)
  761. while(1) {
  762. //printf("%d\n", count);
  763. IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED_BASE, count++);
  764. 4028c: e0ffff17 ldw r3,-4(fp)
  765. 40290: 18800044 addi r2,r3,1
  766. 40294: e0bfff15 stw r2,-4(fp)
  767. 40298: 00800234 movhi r2,8
  768. 4029c: 10840404 addi r2,r2,4112
  769. 402a0: 10c00035 stwio r3,0(r2)
  770. //for(int i=0; i<100000; i++) {
  771. //}
  772. }
  773. 402a4: 003ff906 br 4028c <main+0x20>
  774. 000402a8 <_puts_r>:
  775. 402a8: defff604 addi sp,sp,-40
  776. 402ac: dc000715 stw r16,28(sp)
  777. 402b0: 2021883a mov r16,r4
  778. 402b4: 2809883a mov r4,r5
  779. 402b8: dc400815 stw r17,32(sp)
  780. 402bc: dfc00915 stw ra,36(sp)
  781. 402c0: 2823883a mov r17,r5
  782. 402c4: 004037c0 call 4037c <strlen>
  783. 402c8: 10c00044 addi r3,r2,1
  784. 402cc: d8800115 stw r2,4(sp)
  785. 402d0: 00800134 movhi r2,4
  786. 402d4: 1095d704 addi r2,r2,22364
  787. 402d8: d8800215 stw r2,8(sp)
  788. 402dc: 00800044 movi r2,1
  789. 402e0: d8800315 stw r2,12(sp)
  790. 402e4: 00800084 movi r2,2
  791. 402e8: dc400015 stw r17,0(sp)
  792. 402ec: d8c00615 stw r3,24(sp)
  793. 402f0: dec00415 stw sp,16(sp)
  794. 402f4: d8800515 stw r2,20(sp)
  795. 402f8: 80000226 beq r16,zero,40304 <_puts_r+0x5c>
  796. 402fc: 80800e17 ldw r2,56(r16)
  797. 40300: 10001426 beq r2,zero,40354 <_puts_r+0xac>
  798. 40304: 81400217 ldw r5,8(r16)
  799. 40308: 2880030b ldhu r2,12(r5)
  800. 4030c: 10c8000c andi r3,r2,8192
  801. 40310: 1800061e bne r3,zero,4032c <_puts_r+0x84>
  802. 40314: 29001917 ldw r4,100(r5)
  803. 40318: 00f7ffc4 movi r3,-8193
  804. 4031c: 10880014 ori r2,r2,8192
  805. 40320: 20c6703a and r3,r4,r3
  806. 40324: 2880030d sth r2,12(r5)
  807. 40328: 28c01915 stw r3,100(r5)
  808. 4032c: d9800404 addi r6,sp,16
  809. 40330: 8009883a mov r4,r16
  810. 40334: 00407c40 call 407c4 <__sfvwrite_r>
  811. 40338: 1000091e bne r2,zero,40360 <_puts_r+0xb8>
  812. 4033c: 00800284 movi r2,10
  813. 40340: dfc00917 ldw ra,36(sp)
  814. 40344: dc400817 ldw r17,32(sp)
  815. 40348: dc000717 ldw r16,28(sp)
  816. 4034c: dec00a04 addi sp,sp,40
  817. 40350: f800283a ret
  818. 40354: 8009883a mov r4,r16
  819. 40358: 00407740 call 40774 <__sinit>
  820. 4035c: 003fe906 br 40304 <_puts_r+0x5c>
  821. 40360: 00bfffc4 movi r2,-1
  822. 40364: 003ff606 br 40340 <_puts_r+0x98>
  823. 00040368 <puts>:
  824. 40368: 00800134 movhi r2,4
  825. 4036c: 109c7204 addi r2,r2,29128
  826. 40370: 200b883a mov r5,r4
  827. 40374: 11000017 ldw r4,0(r2)
  828. 40378: 00402a81 jmpi 402a8 <_puts_r>
  829. 0004037c <strlen>:
  830. 4037c: 208000cc andi r2,r4,3
  831. 40380: 10002026 beq r2,zero,40404 <strlen+0x88>
  832. 40384: 20800007 ldb r2,0(r4)
  833. 40388: 10002026 beq r2,zero,4040c <strlen+0x90>
  834. 4038c: 2005883a mov r2,r4
  835. 40390: 00000206 br 4039c <strlen+0x20>
  836. 40394: 10c00007 ldb r3,0(r2)
  837. 40398: 18001826 beq r3,zero,403fc <strlen+0x80>
  838. 4039c: 10800044 addi r2,r2,1
  839. 403a0: 10c000cc andi r3,r2,3
  840. 403a4: 183ffb1e bne r3,zero,40394 <strlen+0x18>
  841. 403a8: 10c00017 ldw r3,0(r2)
  842. 403ac: 01ffbff4 movhi r7,65279
  843. 403b0: 39ffbfc4 addi r7,r7,-257
  844. 403b4: 00ca303a nor r5,zero,r3
  845. 403b8: 01a02074 movhi r6,32897
  846. 403bc: 19c7883a add r3,r3,r7
  847. 403c0: 31a02004 addi r6,r6,-32640
  848. 403c4: 1946703a and r3,r3,r5
  849. 403c8: 1986703a and r3,r3,r6
  850. 403cc: 1800091e bne r3,zero,403f4 <strlen+0x78>
  851. 403d0: 10800104 addi r2,r2,4
  852. 403d4: 10c00017 ldw r3,0(r2)
  853. 403d8: 19cb883a add r5,r3,r7
  854. 403dc: 00c6303a nor r3,zero,r3
  855. 403e0: 28c6703a and r3,r5,r3
  856. 403e4: 1986703a and r3,r3,r6
  857. 403e8: 183ff926 beq r3,zero,403d0 <strlen+0x54>
  858. 403ec: 00000106 br 403f4 <strlen+0x78>
  859. 403f0: 10800044 addi r2,r2,1
  860. 403f4: 10c00007 ldb r3,0(r2)
  861. 403f8: 183ffd1e bne r3,zero,403f0 <strlen+0x74>
  862. 403fc: 1105c83a sub r2,r2,r4
  863. 40400: f800283a ret
  864. 40404: 2005883a mov r2,r4
  865. 40408: 003fe706 br 403a8 <strlen+0x2c>
  866. 4040c: 0005883a mov r2,zero
  867. 40410: f800283a ret
  868. 00040414 <__fp_unlock>:
  869. 40414: 0005883a mov r2,zero
  870. 40418: f800283a ret
  871. 0004041c <_cleanup_r>:
  872. 4041c: 01400134 movhi r5,4
  873. 40420: 2948f304 addi r5,r5,9164
  874. 40424: 0040d501 jmpi 40d50 <_fwalk_reent>
  875. 00040428 <__sinit.part.1>:
  876. 40428: defff704 addi sp,sp,-36
  877. 4042c: 00c00134 movhi r3,4
  878. 40430: dfc00815 stw ra,32(sp)
  879. 40434: ddc00715 stw r23,28(sp)
  880. 40438: dd800615 stw r22,24(sp)
  881. 4043c: dd400515 stw r21,20(sp)
  882. 40440: dd000415 stw r20,16(sp)
  883. 40444: dcc00315 stw r19,12(sp)
  884. 40448: dc800215 stw r18,8(sp)
  885. 4044c: dc400115 stw r17,4(sp)
  886. 40450: dc000015 stw r16,0(sp)
  887. 40454: 18c10704 addi r3,r3,1052
  888. 40458: 24000117 ldw r16,4(r4)
  889. 4045c: 20c00f15 stw r3,60(r4)
  890. 40460: 2080bb04 addi r2,r4,748
  891. 40464: 00c000c4 movi r3,3
  892. 40468: 20c0b915 stw r3,740(r4)
  893. 4046c: 2080ba15 stw r2,744(r4)
  894. 40470: 2000b815 stw zero,736(r4)
  895. 40474: 05c00204 movi r23,8
  896. 40478: 00800104 movi r2,4
  897. 4047c: 2025883a mov r18,r4
  898. 40480: b80d883a mov r6,r23
  899. 40484: 81001704 addi r4,r16,92
  900. 40488: 000b883a mov r5,zero
  901. 4048c: 80000015 stw zero,0(r16)
  902. 40490: 80000115 stw zero,4(r16)
  903. 40494: 80000215 stw zero,8(r16)
  904. 40498: 8080030d sth r2,12(r16)
  905. 4049c: 80001915 stw zero,100(r16)
  906. 404a0: 8000038d sth zero,14(r16)
  907. 404a4: 80000415 stw zero,16(r16)
  908. 404a8: 80000515 stw zero,20(r16)
  909. 404ac: 80000615 stw zero,24(r16)
  910. 404b0: 00419a80 call 419a8 <memset>
  911. 404b4: 05800134 movhi r22,4
  912. 404b8: 94400217 ldw r17,8(r18)
  913. 404bc: 05400134 movhi r21,4
  914. 404c0: 05000134 movhi r20,4
  915. 404c4: 04c00134 movhi r19,4
  916. 404c8: b5882204 addi r22,r22,8328
  917. 404cc: ad483904 addi r21,r21,8420
  918. 404d0: a5085804 addi r20,r20,8544
  919. 404d4: 9cc86f04 addi r19,r19,8636
  920. 404d8: 85800815 stw r22,32(r16)
  921. 404dc: 85400915 stw r21,36(r16)
  922. 404e0: 85000a15 stw r20,40(r16)
  923. 404e4: 84c00b15 stw r19,44(r16)
  924. 404e8: 84000715 stw r16,28(r16)
  925. 404ec: 00800284 movi r2,10
  926. 404f0: 8880030d sth r2,12(r17)
  927. 404f4: 00800044 movi r2,1
  928. 404f8: b80d883a mov r6,r23
  929. 404fc: 89001704 addi r4,r17,92
  930. 40500: 000b883a mov r5,zero
  931. 40504: 88000015 stw zero,0(r17)
  932. 40508: 88000115 stw zero,4(r17)
  933. 4050c: 88000215 stw zero,8(r17)
  934. 40510: 88001915 stw zero,100(r17)
  935. 40514: 8880038d sth r2,14(r17)
  936. 40518: 88000415 stw zero,16(r17)
  937. 4051c: 88000515 stw zero,20(r17)
  938. 40520: 88000615 stw zero,24(r17)
  939. 40524: 00419a80 call 419a8 <memset>
  940. 40528: 94000317 ldw r16,12(r18)
  941. 4052c: 00800484 movi r2,18
  942. 40530: 8c400715 stw r17,28(r17)
  943. 40534: 8d800815 stw r22,32(r17)
  944. 40538: 8d400915 stw r21,36(r17)
  945. 4053c: 8d000a15 stw r20,40(r17)
  946. 40540: 8cc00b15 stw r19,44(r17)
  947. 40544: 8080030d sth r2,12(r16)
  948. 40548: 00800084 movi r2,2
  949. 4054c: 80000015 stw zero,0(r16)
  950. 40550: 80000115 stw zero,4(r16)
  951. 40554: 80000215 stw zero,8(r16)
  952. 40558: 80001915 stw zero,100(r16)
  953. 4055c: 8080038d sth r2,14(r16)
  954. 40560: 80000415 stw zero,16(r16)
  955. 40564: 80000515 stw zero,20(r16)
  956. 40568: 80000615 stw zero,24(r16)
  957. 4056c: b80d883a mov r6,r23
  958. 40570: 000b883a mov r5,zero
  959. 40574: 81001704 addi r4,r16,92
  960. 40578: 00419a80 call 419a8 <memset>
  961. 4057c: 00800044 movi r2,1
  962. 40580: 84000715 stw r16,28(r16)
  963. 40584: 85800815 stw r22,32(r16)
  964. 40588: 85400915 stw r21,36(r16)
  965. 4058c: 85000a15 stw r20,40(r16)
  966. 40590: 84c00b15 stw r19,44(r16)
  967. 40594: 90800e15 stw r2,56(r18)
  968. 40598: dfc00817 ldw ra,32(sp)
  969. 4059c: ddc00717 ldw r23,28(sp)
  970. 405a0: dd800617 ldw r22,24(sp)
  971. 405a4: dd400517 ldw r21,20(sp)
  972. 405a8: dd000417 ldw r20,16(sp)
  973. 405ac: dcc00317 ldw r19,12(sp)
  974. 405b0: dc800217 ldw r18,8(sp)
  975. 405b4: dc400117 ldw r17,4(sp)
  976. 405b8: dc000017 ldw r16,0(sp)
  977. 405bc: dec00904 addi sp,sp,36
  978. 405c0: f800283a ret
  979. 000405c4 <__fp_lock>:
  980. 405c4: 0005883a mov r2,zero
  981. 405c8: f800283a ret
  982. 000405cc <__sfmoreglue>:
  983. 405cc: defffc04 addi sp,sp,-16
  984. 405d0: dc800215 stw r18,8(sp)
  985. 405d4: 2825883a mov r18,r5
  986. 405d8: dc000015 stw r16,0(sp)
  987. 405dc: 01401a04 movi r5,104
  988. 405e0: 2021883a mov r16,r4
  989. 405e4: 913fffc4 addi r4,r18,-1
  990. 405e8: dfc00315 stw ra,12(sp)
  991. 405ec: dc400115 stw r17,4(sp)
  992. 405f0: 004308c0 call 4308c <__mulsi3>
  993. 405f4: 8009883a mov r4,r16
  994. 405f8: 11401d04 addi r5,r2,116
  995. 405fc: 1023883a mov r17,r2
  996. 40600: 0040e140 call 40e14 <_malloc_r>
  997. 40604: 1021883a mov r16,r2
  998. 40608: 10000726 beq r2,zero,40628 <__sfmoreglue+0x5c>
  999. 4060c: 11000304 addi r4,r2,12
  1000. 40610: 10000015 stw zero,0(r2)
  1001. 40614: 14800115 stw r18,4(r2)
  1002. 40618: 11000215 stw r4,8(r2)
  1003. 4061c: 89801a04 addi r6,r17,104
  1004. 40620: 000b883a mov r5,zero
  1005. 40624: 00419a80 call 419a8 <memset>
  1006. 40628: 8005883a mov r2,r16
  1007. 4062c: dfc00317 ldw ra,12(sp)
  1008. 40630: dc800217 ldw r18,8(sp)
  1009. 40634: dc400117 ldw r17,4(sp)
  1010. 40638: dc000017 ldw r16,0(sp)
  1011. 4063c: dec00404 addi sp,sp,16
  1012. 40640: f800283a ret
  1013. 00040644 <__sfp>:
  1014. 40644: defffb04 addi sp,sp,-20
  1015. 40648: dc000015 stw r16,0(sp)
  1016. 4064c: 04000134 movhi r16,4
  1017. 40650: 841c7104 addi r16,r16,29124
  1018. 40654: dcc00315 stw r19,12(sp)
  1019. 40658: 2027883a mov r19,r4
  1020. 4065c: 81000017 ldw r4,0(r16)
  1021. 40660: dfc00415 stw ra,16(sp)
  1022. 40664: dc800215 stw r18,8(sp)
  1023. 40668: 20800e17 ldw r2,56(r4)
  1024. 4066c: dc400115 stw r17,4(sp)
  1025. 40670: 1000021e bne r2,zero,4067c <__sfp+0x38>
  1026. 40674: 00404280 call 40428 <__sinit.part.1>
  1027. 40678: 81000017 ldw r4,0(r16)
  1028. 4067c: 2480b804 addi r18,r4,736
  1029. 40680: 047fffc4 movi r17,-1
  1030. 40684: 91000117 ldw r4,4(r18)
  1031. 40688: 94000217 ldw r16,8(r18)
  1032. 4068c: 213fffc4 addi r4,r4,-1
  1033. 40690: 20000a16 blt r4,zero,406bc <__sfp+0x78>
  1034. 40694: 8080030f ldh r2,12(r16)
  1035. 40698: 10000c26 beq r2,zero,406cc <__sfp+0x88>
  1036. 4069c: 80c01d04 addi r3,r16,116
  1037. 406a0: 00000206 br 406ac <__sfp+0x68>
  1038. 406a4: 18bfe60f ldh r2,-104(r3)
  1039. 406a8: 10000826 beq r2,zero,406cc <__sfp+0x88>
  1040. 406ac: 213fffc4 addi r4,r4,-1
  1041. 406b0: 1c3ffd04 addi r16,r3,-12
  1042. 406b4: 18c01a04 addi r3,r3,104
  1043. 406b8: 247ffa1e bne r4,r17,406a4 <__sfp+0x60>
  1044. 406bc: 90800017 ldw r2,0(r18)
  1045. 406c0: 10001d26 beq r2,zero,40738 <__sfp+0xf4>
  1046. 406c4: 1025883a mov r18,r2
  1047. 406c8: 003fee06 br 40684 <__sfp+0x40>
  1048. 406cc: 00bfffc4 movi r2,-1
  1049. 406d0: 8080038d sth r2,14(r16)
  1050. 406d4: 00800044 movi r2,1
  1051. 406d8: 8080030d sth r2,12(r16)
  1052. 406dc: 80001915 stw zero,100(r16)
  1053. 406e0: 80000015 stw zero,0(r16)
  1054. 406e4: 80000215 stw zero,8(r16)
  1055. 406e8: 80000115 stw zero,4(r16)
  1056. 406ec: 80000415 stw zero,16(r16)
  1057. 406f0: 80000515 stw zero,20(r16)
  1058. 406f4: 80000615 stw zero,24(r16)
  1059. 406f8: 01800204 movi r6,8
  1060. 406fc: 000b883a mov r5,zero
  1061. 40700: 81001704 addi r4,r16,92
  1062. 40704: 00419a80 call 419a8 <memset>
  1063. 40708: 8005883a mov r2,r16
  1064. 4070c: 80000c15 stw zero,48(r16)
  1065. 40710: 80000d15 stw zero,52(r16)
  1066. 40714: 80001115 stw zero,68(r16)
  1067. 40718: 80001215 stw zero,72(r16)
  1068. 4071c: dfc00417 ldw ra,16(sp)
  1069. 40720: dcc00317 ldw r19,12(sp)
  1070. 40724: dc800217 ldw r18,8(sp)
  1071. 40728: dc400117 ldw r17,4(sp)
  1072. 4072c: dc000017 ldw r16,0(sp)
  1073. 40730: dec00504 addi sp,sp,20
  1074. 40734: f800283a ret
  1075. 40738: 01400104 movi r5,4
  1076. 4073c: 9809883a mov r4,r19
  1077. 40740: 00405cc0 call 405cc <__sfmoreglue>
  1078. 40744: 90800015 stw r2,0(r18)
  1079. 40748: 103fde1e bne r2,zero,406c4 <__sfp+0x80>
  1080. 4074c: 00800304 movi r2,12
  1081. 40750: 98800015 stw r2,0(r19)
  1082. 40754: 0005883a mov r2,zero
  1083. 40758: 003ff006 br 4071c <__sfp+0xd8>
  1084. 0004075c <_cleanup>:
  1085. 4075c: 00800134 movhi r2,4
  1086. 40760: 109c7104 addi r2,r2,29124
  1087. 40764: 11000017 ldw r4,0(r2)
  1088. 40768: 01400134 movhi r5,4
  1089. 4076c: 2948f304 addi r5,r5,9164
  1090. 40770: 0040d501 jmpi 40d50 <_fwalk_reent>
  1091. 00040774 <__sinit>:
  1092. 40774: 20800e17 ldw r2,56(r4)
  1093. 40778: 10000126 beq r2,zero,40780 <__sinit+0xc>
  1094. 4077c: f800283a ret
  1095. 40780: 00404281 jmpi 40428 <__sinit.part.1>
  1096. 00040784 <__sfp_lock_acquire>:
  1097. 40784: f800283a ret
  1098. 00040788 <__sfp_lock_release>:
  1099. 40788: f800283a ret
  1100. 0004078c <__sinit_lock_acquire>:
  1101. 4078c: f800283a ret
  1102. 00040790 <__sinit_lock_release>:
  1103. 40790: f800283a ret
  1104. 00040794 <__fp_lock_all>:
  1105. 40794: 00800134 movhi r2,4
  1106. 40798: 109c7204 addi r2,r2,29128
  1107. 4079c: 11000017 ldw r4,0(r2)
  1108. 407a0: 01400134 movhi r5,4
  1109. 407a4: 29417104 addi r5,r5,1476
  1110. 407a8: 0040c8c1 jmpi 40c8c <_fwalk>
  1111. 000407ac <__fp_unlock_all>:
  1112. 407ac: 00800134 movhi r2,4
  1113. 407b0: 109c7204 addi r2,r2,29128
  1114. 407b4: 11000017 ldw r4,0(r2)
  1115. 407b8: 01400134 movhi r5,4
  1116. 407bc: 29410504 addi r5,r5,1044
  1117. 407c0: 0040c8c1 jmpi 40c8c <_fwalk>
  1118. 000407c4 <__sfvwrite_r>:
  1119. 407c4: 30800217 ldw r2,8(r6)
  1120. 407c8: 10006726 beq r2,zero,40968 <__sfvwrite_r+0x1a4>
  1121. 407cc: 28c0030b ldhu r3,12(r5)
  1122. 407d0: defff404 addi sp,sp,-48
  1123. 407d4: dd400715 stw r21,28(sp)
  1124. 407d8: dd000615 stw r20,24(sp)
  1125. 407dc: dc000215 stw r16,8(sp)
  1126. 407e0: dfc00b15 stw ra,44(sp)
  1127. 407e4: df000a15 stw fp,40(sp)
  1128. 407e8: ddc00915 stw r23,36(sp)
  1129. 407ec: dd800815 stw r22,32(sp)
  1130. 407f0: dcc00515 stw r19,20(sp)
  1131. 407f4: dc800415 stw r18,16(sp)
  1132. 407f8: dc400315 stw r17,12(sp)
  1133. 407fc: 1880020c andi r2,r3,8
  1134. 40800: 2821883a mov r16,r5
  1135. 40804: 202b883a mov r21,r4
  1136. 40808: 3029883a mov r20,r6
  1137. 4080c: 10002726 beq r2,zero,408ac <__sfvwrite_r+0xe8>
  1138. 40810: 28800417 ldw r2,16(r5)
  1139. 40814: 10002526 beq r2,zero,408ac <__sfvwrite_r+0xe8>
  1140. 40818: 1880008c andi r2,r3,2
  1141. 4081c: a4400017 ldw r17,0(r20)
  1142. 40820: 10002a26 beq r2,zero,408cc <__sfvwrite_r+0x108>
  1143. 40824: 05a00034 movhi r22,32768
  1144. 40828: 0027883a mov r19,zero
  1145. 4082c: 0025883a mov r18,zero
  1146. 40830: b5bf0004 addi r22,r22,-1024
  1147. 40834: 980d883a mov r6,r19
  1148. 40838: a809883a mov r4,r21
  1149. 4083c: 90004626 beq r18,zero,40958 <__sfvwrite_r+0x194>
  1150. 40840: 900f883a mov r7,r18
  1151. 40844: b480022e bgeu r22,r18,40850 <__sfvwrite_r+0x8c>
  1152. 40848: 01e00034 movhi r7,32768
  1153. 4084c: 39ff0004 addi r7,r7,-1024
  1154. 40850: 80800917 ldw r2,36(r16)
  1155. 40854: 81400717 ldw r5,28(r16)
  1156. 40858: 103ee83a callr r2
  1157. 4085c: 00805a0e bge zero,r2,409c8 <__sfvwrite_r+0x204>
  1158. 40860: a0c00217 ldw r3,8(r20)
  1159. 40864: 98a7883a add r19,r19,r2
  1160. 40868: 90a5c83a sub r18,r18,r2
  1161. 4086c: 1885c83a sub r2,r3,r2
  1162. 40870: a0800215 stw r2,8(r20)
  1163. 40874: 103fef1e bne r2,zero,40834 <__sfvwrite_r+0x70>
  1164. 40878: 0005883a mov r2,zero
  1165. 4087c: dfc00b17 ldw ra,44(sp)
  1166. 40880: df000a17 ldw fp,40(sp)
  1167. 40884: ddc00917 ldw r23,36(sp)
  1168. 40888: dd800817 ldw r22,32(sp)
  1169. 4088c: dd400717 ldw r21,28(sp)
  1170. 40890: dd000617 ldw r20,24(sp)
  1171. 40894: dcc00517 ldw r19,20(sp)
  1172. 40898: dc800417 ldw r18,16(sp)
  1173. 4089c: dc400317 ldw r17,12(sp)
  1174. 408a0: dc000217 ldw r16,8(sp)
  1175. 408a4: dec00c04 addi sp,sp,48
  1176. 408a8: f800283a ret
  1177. 408ac: 800b883a mov r5,r16
  1178. 408b0: a809883a mov r4,r21
  1179. 408b4: 00422240 call 42224 <__swsetup_r>
  1180. 408b8: 1000ee1e bne r2,zero,40c74 <__sfvwrite_r+0x4b0>
  1181. 408bc: 80c0030b ldhu r3,12(r16)
  1182. 408c0: a4400017 ldw r17,0(r20)
  1183. 408c4: 1880008c andi r2,r3,2
  1184. 408c8: 103fd61e bne r2,zero,40824 <__sfvwrite_r+0x60>
  1185. 408cc: 1880004c andi r2,r3,1
  1186. 408d0: 1000421e bne r2,zero,409dc <__sfvwrite_r+0x218>
  1187. 408d4: 0039883a mov fp,zero
  1188. 408d8: 0025883a mov r18,zero
  1189. 408dc: 90001a26 beq r18,zero,40948 <__sfvwrite_r+0x184>
  1190. 408e0: 1880800c andi r2,r3,512
  1191. 408e4: 84c00217 ldw r19,8(r16)
  1192. 408e8: 10002126 beq r2,zero,40970 <__sfvwrite_r+0x1ac>
  1193. 408ec: 982f883a mov r23,r19
  1194. 408f0: 94c09636 bltu r18,r19,40b4c <__sfvwrite_r+0x388>
  1195. 408f4: 1881200c andi r2,r3,1152
  1196. 408f8: 1000a11e bne r2,zero,40b80 <__sfvwrite_r+0x3bc>
  1197. 408fc: 81000017 ldw r4,0(r16)
  1198. 40900: b80d883a mov r6,r23
  1199. 40904: e00b883a mov r5,fp
  1200. 40908: 004184c0 call 4184c <memmove>
  1201. 4090c: 80c00217 ldw r3,8(r16)
  1202. 40910: 81000017 ldw r4,0(r16)
  1203. 40914: 9005883a mov r2,r18
  1204. 40918: 1ce7c83a sub r19,r3,r19
  1205. 4091c: 25cf883a add r7,r4,r23
  1206. 40920: 84c00215 stw r19,8(r16)
  1207. 40924: 81c00015 stw r7,0(r16)
  1208. 40928: a0c00217 ldw r3,8(r20)
  1209. 4092c: e0b9883a add fp,fp,r2
  1210. 40930: 90a5c83a sub r18,r18,r2
  1211. 40934: 18a7c83a sub r19,r3,r2
  1212. 40938: a4c00215 stw r19,8(r20)
  1213. 4093c: 983fce26 beq r19,zero,40878 <__sfvwrite_r+0xb4>
  1214. 40940: 80c0030b ldhu r3,12(r16)
  1215. 40944: 903fe61e bne r18,zero,408e0 <__sfvwrite_r+0x11c>
  1216. 40948: 8f000017 ldw fp,0(r17)
  1217. 4094c: 8c800117 ldw r18,4(r17)
  1218. 40950: 8c400204 addi r17,r17,8
  1219. 40954: 003fe106 br 408dc <__sfvwrite_r+0x118>
  1220. 40958: 8cc00017 ldw r19,0(r17)
  1221. 4095c: 8c800117 ldw r18,4(r17)
  1222. 40960: 8c400204 addi r17,r17,8
  1223. 40964: 003fb306 br 40834 <__sfvwrite_r+0x70>
  1224. 40968: 0005883a mov r2,zero
  1225. 4096c: f800283a ret
  1226. 40970: 81000017 ldw r4,0(r16)
  1227. 40974: 80800417 ldw r2,16(r16)
  1228. 40978: 11005a36 bltu r2,r4,40ae4 <__sfvwrite_r+0x320>
  1229. 4097c: 85c00517 ldw r23,20(r16)
  1230. 40980: 95c05836 bltu r18,r23,40ae4 <__sfvwrite_r+0x320>
  1231. 40984: 00a00034 movhi r2,32768
  1232. 40988: 10bfffc4 addi r2,r2,-1
  1233. 4098c: 9009883a mov r4,r18
  1234. 40990: 1480012e bgeu r2,r18,40998 <__sfvwrite_r+0x1d4>
  1235. 40994: 1009883a mov r4,r2
  1236. 40998: b80b883a mov r5,r23
  1237. 4099c: 0042ed80 call 42ed8 <__divsi3>
  1238. 409a0: b80b883a mov r5,r23
  1239. 409a4: 1009883a mov r4,r2
  1240. 409a8: 004308c0 call 4308c <__mulsi3>
  1241. 409ac: 81400717 ldw r5,28(r16)
  1242. 409b0: 80c00917 ldw r3,36(r16)
  1243. 409b4: 100f883a mov r7,r2
  1244. 409b8: e00d883a mov r6,fp
  1245. 409bc: a809883a mov r4,r21
  1246. 409c0: 183ee83a callr r3
  1247. 409c4: 00bfd816 blt zero,r2,40928 <__sfvwrite_r+0x164>
  1248. 409c8: 8080030b ldhu r2,12(r16)
  1249. 409cc: 10801014 ori r2,r2,64
  1250. 409d0: 8080030d sth r2,12(r16)
  1251. 409d4: 00bfffc4 movi r2,-1
  1252. 409d8: 003fa806 br 4087c <__sfvwrite_r+0xb8>
  1253. 409dc: 0027883a mov r19,zero
  1254. 409e0: 0011883a mov r8,zero
  1255. 409e4: 0039883a mov fp,zero
  1256. 409e8: 0025883a mov r18,zero
  1257. 409ec: 90001f26 beq r18,zero,40a6c <__sfvwrite_r+0x2a8>
  1258. 409f0: 40005a26 beq r8,zero,40b5c <__sfvwrite_r+0x398>
  1259. 409f4: 982d883a mov r22,r19
  1260. 409f8: 94c0012e bgeu r18,r19,40a00 <__sfvwrite_r+0x23c>
  1261. 409fc: 902d883a mov r22,r18
  1262. 40a00: 81000017 ldw r4,0(r16)
  1263. 40a04: 80800417 ldw r2,16(r16)
  1264. 40a08: b02f883a mov r23,r22
  1265. 40a0c: 81c00517 ldw r7,20(r16)
  1266. 40a10: 1100032e bgeu r2,r4,40a20 <__sfvwrite_r+0x25c>
  1267. 40a14: 80c00217 ldw r3,8(r16)
  1268. 40a18: 38c7883a add r3,r7,r3
  1269. 40a1c: 1d801816 blt r3,r22,40a80 <__sfvwrite_r+0x2bc>
  1270. 40a20: b1c03e16 blt r22,r7,40b1c <__sfvwrite_r+0x358>
  1271. 40a24: 80800917 ldw r2,36(r16)
  1272. 40a28: 81400717 ldw r5,28(r16)
  1273. 40a2c: e00d883a mov r6,fp
  1274. 40a30: da000115 stw r8,4(sp)
  1275. 40a34: a809883a mov r4,r21
  1276. 40a38: 103ee83a callr r2
  1277. 40a3c: 102f883a mov r23,r2
  1278. 40a40: da000117 ldw r8,4(sp)
  1279. 40a44: 00bfe00e bge zero,r2,409c8 <__sfvwrite_r+0x204>
  1280. 40a48: 9de7c83a sub r19,r19,r23
  1281. 40a4c: 98001f26 beq r19,zero,40acc <__sfvwrite_r+0x308>
  1282. 40a50: a0800217 ldw r2,8(r20)
  1283. 40a54: e5f9883a add fp,fp,r23
  1284. 40a58: 95e5c83a sub r18,r18,r23
  1285. 40a5c: 15efc83a sub r23,r2,r23
  1286. 40a60: a5c00215 stw r23,8(r20)
  1287. 40a64: b83f8426 beq r23,zero,40878 <__sfvwrite_r+0xb4>
  1288. 40a68: 903fe11e bne r18,zero,409f0 <__sfvwrite_r+0x22c>
  1289. 40a6c: 8f000017 ldw fp,0(r17)
  1290. 40a70: 8c800117 ldw r18,4(r17)
  1291. 40a74: 0011883a mov r8,zero
  1292. 40a78: 8c400204 addi r17,r17,8
  1293. 40a7c: 003fdb06 br 409ec <__sfvwrite_r+0x228>
  1294. 40a80: 180d883a mov r6,r3
  1295. 40a84: e00b883a mov r5,fp
  1296. 40a88: da000115 stw r8,4(sp)
  1297. 40a8c: d8c00015 stw r3,0(sp)
  1298. 40a90: 004184c0 call 4184c <memmove>
  1299. 40a94: d8c00017 ldw r3,0(sp)
  1300. 40a98: 80800017 ldw r2,0(r16)
  1301. 40a9c: 800b883a mov r5,r16
  1302. 40aa0: a809883a mov r4,r21
  1303. 40aa4: 10c5883a add r2,r2,r3
  1304. 40aa8: 80800015 stw r2,0(r16)
  1305. 40aac: d8c00015 stw r3,0(sp)
  1306. 40ab0: 00426ec0 call 426ec <_fflush_r>
  1307. 40ab4: d8c00017 ldw r3,0(sp)
  1308. 40ab8: da000117 ldw r8,4(sp)
  1309. 40abc: 103fc21e bne r2,zero,409c8 <__sfvwrite_r+0x204>
  1310. 40ac0: 182f883a mov r23,r3
  1311. 40ac4: 9de7c83a sub r19,r19,r23
  1312. 40ac8: 983fe11e bne r19,zero,40a50 <__sfvwrite_r+0x28c>
  1313. 40acc: 800b883a mov r5,r16
  1314. 40ad0: a809883a mov r4,r21
  1315. 40ad4: 00426ec0 call 426ec <_fflush_r>
  1316. 40ad8: 103fbb1e bne r2,zero,409c8 <__sfvwrite_r+0x204>
  1317. 40adc: 0011883a mov r8,zero
  1318. 40ae0: 003fdb06 br 40a50 <__sfvwrite_r+0x28c>
  1319. 40ae4: 94c0012e bgeu r18,r19,40aec <__sfvwrite_r+0x328>
  1320. 40ae8: 9027883a mov r19,r18
  1321. 40aec: 980d883a mov r6,r19
  1322. 40af0: e00b883a mov r5,fp
  1323. 40af4: 004184c0 call 4184c <memmove>
  1324. 40af8: 80800217 ldw r2,8(r16)
  1325. 40afc: 80c00017 ldw r3,0(r16)
  1326. 40b00: 14c5c83a sub r2,r2,r19
  1327. 40b04: 1cc7883a add r3,r3,r19
  1328. 40b08: 80800215 stw r2,8(r16)
  1329. 40b0c: 80c00015 stw r3,0(r16)
  1330. 40b10: 10004326 beq r2,zero,40c20 <__sfvwrite_r+0x45c>
  1331. 40b14: 9805883a mov r2,r19
  1332. 40b18: 003f8306 br 40928 <__sfvwrite_r+0x164>
  1333. 40b1c: b00d883a mov r6,r22
  1334. 40b20: e00b883a mov r5,fp
  1335. 40b24: da000115 stw r8,4(sp)
  1336. 40b28: 004184c0 call 4184c <memmove>
  1337. 40b2c: 80800217 ldw r2,8(r16)
  1338. 40b30: 80c00017 ldw r3,0(r16)
  1339. 40b34: da000117 ldw r8,4(sp)
  1340. 40b38: 1585c83a sub r2,r2,r22
  1341. 40b3c: 1dad883a add r22,r3,r22
  1342. 40b40: 80800215 stw r2,8(r16)
  1343. 40b44: 85800015 stw r22,0(r16)
  1344. 40b48: 003fbf06 br 40a48 <__sfvwrite_r+0x284>
  1345. 40b4c: 81000017 ldw r4,0(r16)
  1346. 40b50: 9027883a mov r19,r18
  1347. 40b54: 902f883a mov r23,r18
  1348. 40b58: 003f6906 br 40900 <__sfvwrite_r+0x13c>
  1349. 40b5c: 900d883a mov r6,r18
  1350. 40b60: 01400284 movi r5,10
  1351. 40b64: e009883a mov r4,fp
  1352. 40b68: 00416200 call 41620 <memchr>
  1353. 40b6c: 10003e26 beq r2,zero,40c68 <__sfvwrite_r+0x4a4>
  1354. 40b70: 10800044 addi r2,r2,1
  1355. 40b74: 1727c83a sub r19,r2,fp
  1356. 40b78: 02000044 movi r8,1
  1357. 40b7c: 003f9d06 br 409f4 <__sfvwrite_r+0x230>
  1358. 40b80: 80800517 ldw r2,20(r16)
  1359. 40b84: 81400417 ldw r5,16(r16)
  1360. 40b88: 81c00017 ldw r7,0(r16)
  1361. 40b8c: 10a7883a add r19,r2,r2
  1362. 40b90: 9885883a add r2,r19,r2
  1363. 40b94: 1026d7fa srli r19,r2,31
  1364. 40b98: 396dc83a sub r22,r7,r5
  1365. 40b9c: b1000044 addi r4,r22,1
  1366. 40ba0: 9885883a add r2,r19,r2
  1367. 40ba4: 1027d07a srai r19,r2,1
  1368. 40ba8: 2485883a add r2,r4,r18
  1369. 40bac: 980d883a mov r6,r19
  1370. 40bb0: 9880022e bgeu r19,r2,40bbc <__sfvwrite_r+0x3f8>
  1371. 40bb4: 1027883a mov r19,r2
  1372. 40bb8: 100d883a mov r6,r2
  1373. 40bbc: 18c1000c andi r3,r3,1024
  1374. 40bc0: 18001c26 beq r3,zero,40c34 <__sfvwrite_r+0x470>
  1375. 40bc4: 300b883a mov r5,r6
  1376. 40bc8: a809883a mov r4,r21
  1377. 40bcc: 0040e140 call 40e14 <_malloc_r>
  1378. 40bd0: 102f883a mov r23,r2
  1379. 40bd4: 10002926 beq r2,zero,40c7c <__sfvwrite_r+0x4b8>
  1380. 40bd8: 81400417 ldw r5,16(r16)
  1381. 40bdc: b00d883a mov r6,r22
  1382. 40be0: 1009883a mov r4,r2
  1383. 40be4: 00417040 call 41704 <memcpy>
  1384. 40be8: 8080030b ldhu r2,12(r16)
  1385. 40bec: 00fedfc4 movi r3,-1153
  1386. 40bf0: 10c4703a and r2,r2,r3
  1387. 40bf4: 10802014 ori r2,r2,128
  1388. 40bf8: 8080030d sth r2,12(r16)
  1389. 40bfc: bd89883a add r4,r23,r22
  1390. 40c00: 9d8fc83a sub r7,r19,r22
  1391. 40c04: 85c00415 stw r23,16(r16)
  1392. 40c08: 84c00515 stw r19,20(r16)
  1393. 40c0c: 81000015 stw r4,0(r16)
  1394. 40c10: 9027883a mov r19,r18
  1395. 40c14: 81c00215 stw r7,8(r16)
  1396. 40c18: 902f883a mov r23,r18
  1397. 40c1c: 003f3806 br 40900 <__sfvwrite_r+0x13c>
  1398. 40c20: 800b883a mov r5,r16
  1399. 40c24: a809883a mov r4,r21
  1400. 40c28: 00426ec0 call 426ec <_fflush_r>
  1401. 40c2c: 103fb926 beq r2,zero,40b14 <__sfvwrite_r+0x350>
  1402. 40c30: 003f6506 br 409c8 <__sfvwrite_r+0x204>
  1403. 40c34: a809883a mov r4,r21
  1404. 40c38: 0041ad00 call 41ad0 <_realloc_r>
  1405. 40c3c: 102f883a mov r23,r2
  1406. 40c40: 103fee1e bne r2,zero,40bfc <__sfvwrite_r+0x438>
  1407. 40c44: 81400417 ldw r5,16(r16)
  1408. 40c48: a809883a mov r4,r21
  1409. 40c4c: 004289c0 call 4289c <_free_r>
  1410. 40c50: 8080030b ldhu r2,12(r16)
  1411. 40c54: 00ffdfc4 movi r3,-129
  1412. 40c58: 1884703a and r2,r3,r2
  1413. 40c5c: 00c00304 movi r3,12
  1414. 40c60: a8c00015 stw r3,0(r21)
  1415. 40c64: 003f5906 br 409cc <__sfvwrite_r+0x208>
  1416. 40c68: 94c00044 addi r19,r18,1
  1417. 40c6c: 02000044 movi r8,1
  1418. 40c70: 003f6006 br 409f4 <__sfvwrite_r+0x230>
  1419. 40c74: 00bfffc4 movi r2,-1
  1420. 40c78: 003f0006 br 4087c <__sfvwrite_r+0xb8>
  1421. 40c7c: 00800304 movi r2,12
  1422. 40c80: a8800015 stw r2,0(r21)
  1423. 40c84: 8080030b ldhu r2,12(r16)
  1424. 40c88: 003f5006 br 409cc <__sfvwrite_r+0x208>
  1425. 00040c8c <_fwalk>:
  1426. 40c8c: defff704 addi sp,sp,-36
  1427. 40c90: dd000415 stw r20,16(sp)
  1428. 40c94: dfc00815 stw ra,32(sp)
  1429. 40c98: ddc00715 stw r23,28(sp)
  1430. 40c9c: dd800615 stw r22,24(sp)
  1431. 40ca0: dd400515 stw r21,20(sp)
  1432. 40ca4: dcc00315 stw r19,12(sp)
  1433. 40ca8: dc800215 stw r18,8(sp)
  1434. 40cac: dc400115 stw r17,4(sp)
  1435. 40cb0: dc000015 stw r16,0(sp)
  1436. 40cb4: 2500b804 addi r20,r4,736
  1437. 40cb8: a0002326 beq r20,zero,40d48 <_fwalk+0xbc>
  1438. 40cbc: 282b883a mov r21,r5
  1439. 40cc0: 002f883a mov r23,zero
  1440. 40cc4: 05800044 movi r22,1
  1441. 40cc8: 04ffffc4 movi r19,-1
  1442. 40ccc: a4400117 ldw r17,4(r20)
  1443. 40cd0: a4800217 ldw r18,8(r20)
  1444. 40cd4: 8c7fffc4 addi r17,r17,-1
  1445. 40cd8: 88000d16 blt r17,zero,40d10 <_fwalk+0x84>
  1446. 40cdc: 94000304 addi r16,r18,12
  1447. 40ce0: 94800384 addi r18,r18,14
  1448. 40ce4: 8080000b ldhu r2,0(r16)
  1449. 40ce8: 8c7fffc4 addi r17,r17,-1
  1450. 40cec: 813ffd04 addi r4,r16,-12
  1451. 40cf0: b080042e bgeu r22,r2,40d04 <_fwalk+0x78>
  1452. 40cf4: 9080000f ldh r2,0(r18)
  1453. 40cf8: 14c00226 beq r2,r19,40d04 <_fwalk+0x78>
  1454. 40cfc: a83ee83a callr r21
  1455. 40d00: b8aeb03a or r23,r23,r2
  1456. 40d04: 84001a04 addi r16,r16,104
  1457. 40d08: 94801a04 addi r18,r18,104
  1458. 40d0c: 8cfff51e bne r17,r19,40ce4 <_fwalk+0x58>
  1459. 40d10: a5000017 ldw r20,0(r20)
  1460. 40d14: a03fed1e bne r20,zero,40ccc <_fwalk+0x40>
  1461. 40d18: b805883a mov r2,r23
  1462. 40d1c: dfc00817 ldw ra,32(sp)
  1463. 40d20: ddc00717 ldw r23,28(sp)
  1464. 40d24: dd800617 ldw r22,24(sp)
  1465. 40d28: dd400517 ldw r21,20(sp)
  1466. 40d2c: dd000417 ldw r20,16(sp)
  1467. 40d30: dcc00317 ldw r19,12(sp)
  1468. 40d34: dc800217 ldw r18,8(sp)
  1469. 40d38: dc400117 ldw r17,4(sp)
  1470. 40d3c: dc000017 ldw r16,0(sp)
  1471. 40d40: dec00904 addi sp,sp,36
  1472. 40d44: f800283a ret
  1473. 40d48: 002f883a mov r23,zero
  1474. 40d4c: 003ff206 br 40d18 <_fwalk+0x8c>
  1475. 00040d50 <_fwalk_reent>:
  1476. 40d50: defff704 addi sp,sp,-36
  1477. 40d54: dd000415 stw r20,16(sp)
  1478. 40d58: dfc00815 stw ra,32(sp)
  1479. 40d5c: ddc00715 stw r23,28(sp)
  1480. 40d60: dd800615 stw r22,24(sp)
  1481. 40d64: dd400515 stw r21,20(sp)
  1482. 40d68: dcc00315 stw r19,12(sp)
  1483. 40d6c: dc800215 stw r18,8(sp)
  1484. 40d70: dc400115 stw r17,4(sp)
  1485. 40d74: dc000015 stw r16,0(sp)
  1486. 40d78: 2500b804 addi r20,r4,736
  1487. 40d7c: a0002326 beq r20,zero,40e0c <_fwalk_reent+0xbc>
  1488. 40d80: 282b883a mov r21,r5
  1489. 40d84: 2027883a mov r19,r4
  1490. 40d88: 002f883a mov r23,zero
  1491. 40d8c: 05800044 movi r22,1
  1492. 40d90: 04bfffc4 movi r18,-1
  1493. 40d94: a4400117 ldw r17,4(r20)
  1494. 40d98: a4000217 ldw r16,8(r20)
  1495. 40d9c: 8c7fffc4 addi r17,r17,-1
  1496. 40da0: 88000c16 blt r17,zero,40dd4 <_fwalk_reent+0x84>
  1497. 40da4: 84000304 addi r16,r16,12
  1498. 40da8: 8080000b ldhu r2,0(r16)
  1499. 40dac: 8c7fffc4 addi r17,r17,-1
  1500. 40db0: 817ffd04 addi r5,r16,-12
  1501. 40db4: b080052e bgeu r22,r2,40dcc <_fwalk_reent+0x7c>
  1502. 40db8: 8080008f ldh r2,2(r16)
  1503. 40dbc: 9809883a mov r4,r19
  1504. 40dc0: 14800226 beq r2,r18,40dcc <_fwalk_reent+0x7c>
  1505. 40dc4: a83ee83a callr r21
  1506. 40dc8: b8aeb03a or r23,r23,r2
  1507. 40dcc: 84001a04 addi r16,r16,104
  1508. 40dd0: 8cbff51e bne r17,r18,40da8 <_fwalk_reent+0x58>
  1509. 40dd4: a5000017 ldw r20,0(r20)
  1510. 40dd8: a03fee1e bne r20,zero,40d94 <_fwalk_reent+0x44>
  1511. 40ddc: b805883a mov r2,r23
  1512. 40de0: dfc00817 ldw ra,32(sp)
  1513. 40de4: ddc00717 ldw r23,28(sp)
  1514. 40de8: dd800617 ldw r22,24(sp)
  1515. 40dec: dd400517 ldw r21,20(sp)
  1516. 40df0: dd000417 ldw r20,16(sp)
  1517. 40df4: dcc00317 ldw r19,12(sp)
  1518. 40df8: dc800217 ldw r18,8(sp)
  1519. 40dfc: dc400117 ldw r17,4(sp)
  1520. 40e00: dc000017 ldw r16,0(sp)
  1521. 40e04: dec00904 addi sp,sp,36
  1522. 40e08: f800283a ret
  1523. 40e0c: 002f883a mov r23,zero
  1524. 40e10: 003ff206 br 40ddc <_fwalk_reent+0x8c>
  1525. 00040e14 <_malloc_r>:
  1526. 40e14: defff504 addi sp,sp,-44
  1527. 40e18: dc800315 stw r18,12(sp)
  1528. 40e1c: dfc00a15 stw ra,40(sp)
  1529. 40e20: df000915 stw fp,36(sp)
  1530. 40e24: ddc00815 stw r23,32(sp)
  1531. 40e28: dd800715 stw r22,28(sp)
  1532. 40e2c: dd400615 stw r21,24(sp)
  1533. 40e30: dd000515 stw r20,20(sp)
  1534. 40e34: dcc00415 stw r19,16(sp)
  1535. 40e38: dc400215 stw r17,8(sp)
  1536. 40e3c: dc000115 stw r16,4(sp)
  1537. 40e40: 288002c4 addi r2,r5,11
  1538. 40e44: 00c00584 movi r3,22
  1539. 40e48: 2025883a mov r18,r4
  1540. 40e4c: 18807f2e bgeu r3,r2,4104c <_malloc_r+0x238>
  1541. 40e50: 047ffe04 movi r17,-8
  1542. 40e54: 1462703a and r17,r2,r17
  1543. 40e58: 8800a316 blt r17,zero,410e8 <_malloc_r+0x2d4>
  1544. 40e5c: 8940a236 bltu r17,r5,410e8 <_malloc_r+0x2d4>
  1545. 40e60: 00436500 call 43650 <__malloc_lock>
  1546. 40e64: 00807dc4 movi r2,503
  1547. 40e68: 1441e92e bgeu r2,r17,41610 <_malloc_r+0x7fc>
  1548. 40e6c: 8804d27a srli r2,r17,9
  1549. 40e70: 1000a126 beq r2,zero,410f8 <_malloc_r+0x2e4>
  1550. 40e74: 00c00104 movi r3,4
  1551. 40e78: 18811e36 bltu r3,r2,412f4 <_malloc_r+0x4e0>
  1552. 40e7c: 8804d1ba srli r2,r17,6
  1553. 40e80: 12000e44 addi r8,r2,57
  1554. 40e84: 11c00e04 addi r7,r2,56
  1555. 40e88: 4209883a add r4,r8,r8
  1556. 40e8c: 04c00134 movhi r19,4
  1557. 40e90: 2109883a add r4,r4,r4
  1558. 40e94: 9cd6ed04 addi r19,r19,23476
  1559. 40e98: 2109883a add r4,r4,r4
  1560. 40e9c: 9909883a add r4,r19,r4
  1561. 40ea0: 24000117 ldw r16,4(r4)
  1562. 40ea4: 213ffe04 addi r4,r4,-8
  1563. 40ea8: 24009726 beq r4,r16,41108 <_malloc_r+0x2f4>
  1564. 40eac: 80800117 ldw r2,4(r16)
  1565. 40eb0: 01bfff04 movi r6,-4
  1566. 40eb4: 014003c4 movi r5,15
  1567. 40eb8: 1184703a and r2,r2,r6
  1568. 40ebc: 1447c83a sub r3,r2,r17
  1569. 40ec0: 28c00716 blt r5,r3,40ee0 <_malloc_r+0xcc>
  1570. 40ec4: 1800920e bge r3,zero,41110 <_malloc_r+0x2fc>
  1571. 40ec8: 84000317 ldw r16,12(r16)
  1572. 40ecc: 24008e26 beq r4,r16,41108 <_malloc_r+0x2f4>
  1573. 40ed0: 80800117 ldw r2,4(r16)
  1574. 40ed4: 1184703a and r2,r2,r6
  1575. 40ed8: 1447c83a sub r3,r2,r17
  1576. 40edc: 28fff90e bge r5,r3,40ec4 <_malloc_r+0xb0>
  1577. 40ee0: 3809883a mov r4,r7
  1578. 40ee4: 01800134 movhi r6,4
  1579. 40ee8: 9c000417 ldw r16,16(r19)
  1580. 40eec: 3196ed04 addi r6,r6,23476
  1581. 40ef0: 32000204 addi r8,r6,8
  1582. 40ef4: 82013426 beq r16,r8,413c8 <_malloc_r+0x5b4>
  1583. 40ef8: 80c00117 ldw r3,4(r16)
  1584. 40efc: 00bfff04 movi r2,-4
  1585. 40f00: 188e703a and r7,r3,r2
  1586. 40f04: 3c45c83a sub r2,r7,r17
  1587. 40f08: 00c003c4 movi r3,15
  1588. 40f0c: 18811f16 blt r3,r2,4138c <_malloc_r+0x578>
  1589. 40f10: 32000515 stw r8,20(r6)
  1590. 40f14: 32000415 stw r8,16(r6)
  1591. 40f18: 10007f0e bge r2,zero,41118 <_malloc_r+0x304>
  1592. 40f1c: 00807fc4 movi r2,511
  1593. 40f20: 11c0fd36 bltu r2,r7,41318 <_malloc_r+0x504>
  1594. 40f24: 3806d0fa srli r3,r7,3
  1595. 40f28: 01c00044 movi r7,1
  1596. 40f2c: 30800117 ldw r2,4(r6)
  1597. 40f30: 19400044 addi r5,r3,1
  1598. 40f34: 294b883a add r5,r5,r5
  1599. 40f38: 1807d0ba srai r3,r3,2
  1600. 40f3c: 294b883a add r5,r5,r5
  1601. 40f40: 294b883a add r5,r5,r5
  1602. 40f44: 298b883a add r5,r5,r6
  1603. 40f48: 38c6983a sll r3,r7,r3
  1604. 40f4c: 29c00017 ldw r7,0(r5)
  1605. 40f50: 2a7ffe04 addi r9,r5,-8
  1606. 40f54: 1886b03a or r3,r3,r2
  1607. 40f58: 82400315 stw r9,12(r16)
  1608. 40f5c: 81c00215 stw r7,8(r16)
  1609. 40f60: 30c00115 stw r3,4(r6)
  1610. 40f64: 2c000015 stw r16,0(r5)
  1611. 40f68: 3c000315 stw r16,12(r7)
  1612. 40f6c: 2005d0ba srai r2,r4,2
  1613. 40f70: 01400044 movi r5,1
  1614. 40f74: 288a983a sll r5,r5,r2
  1615. 40f78: 19406f36 bltu r3,r5,41138 <_malloc_r+0x324>
  1616. 40f7c: 28c4703a and r2,r5,r3
  1617. 40f80: 10000a1e bne r2,zero,40fac <_malloc_r+0x198>
  1618. 40f84: 00bfff04 movi r2,-4
  1619. 40f88: 294b883a add r5,r5,r5
  1620. 40f8c: 2088703a and r4,r4,r2
  1621. 40f90: 28c4703a and r2,r5,r3
  1622. 40f94: 21000104 addi r4,r4,4
  1623. 40f98: 1000041e bne r2,zero,40fac <_malloc_r+0x198>
  1624. 40f9c: 294b883a add r5,r5,r5
  1625. 40fa0: 28c4703a and r2,r5,r3
  1626. 40fa4: 21000104 addi r4,r4,4
  1627. 40fa8: 103ffc26 beq r2,zero,40f9c <_malloc_r+0x188>
  1628. 40fac: 02bfff04 movi r10,-4
  1629. 40fb0: 024003c4 movi r9,15
  1630. 40fb4: 21800044 addi r6,r4,1
  1631. 40fb8: 318d883a add r6,r6,r6
  1632. 40fbc: 318d883a add r6,r6,r6
  1633. 40fc0: 318d883a add r6,r6,r6
  1634. 40fc4: 998d883a add r6,r19,r6
  1635. 40fc8: 333ffe04 addi r12,r6,-8
  1636. 40fcc: 2017883a mov r11,r4
  1637. 40fd0: 31800104 addi r6,r6,4
  1638. 40fd4: 34000017 ldw r16,0(r6)
  1639. 40fd8: 31fffd04 addi r7,r6,-12
  1640. 40fdc: 81c0041e bne r16,r7,40ff0 <_malloc_r+0x1dc>
  1641. 40fe0: 0000fb06 br 413d0 <_malloc_r+0x5bc>
  1642. 40fe4: 1801030e bge r3,zero,413f4 <_malloc_r+0x5e0>
  1643. 40fe8: 84000317 ldw r16,12(r16)
  1644. 40fec: 81c0f826 beq r16,r7,413d0 <_malloc_r+0x5bc>
  1645. 40ff0: 80800117 ldw r2,4(r16)
  1646. 40ff4: 1284703a and r2,r2,r10
  1647. 40ff8: 1447c83a sub r3,r2,r17
  1648. 40ffc: 48fff90e bge r9,r3,40fe4 <_malloc_r+0x1d0>
  1649. 41000: 80800317 ldw r2,12(r16)
  1650. 41004: 81000217 ldw r4,8(r16)
  1651. 41008: 89400054 ori r5,r17,1
  1652. 4100c: 81400115 stw r5,4(r16)
  1653. 41010: 20800315 stw r2,12(r4)
  1654. 41014: 11000215 stw r4,8(r2)
  1655. 41018: 8463883a add r17,r16,r17
  1656. 4101c: 9c400515 stw r17,20(r19)
  1657. 41020: 9c400415 stw r17,16(r19)
  1658. 41024: 18800054 ori r2,r3,1
  1659. 41028: 88800115 stw r2,4(r17)
  1660. 4102c: 8a000315 stw r8,12(r17)
  1661. 41030: 8a000215 stw r8,8(r17)
  1662. 41034: 88e3883a add r17,r17,r3
  1663. 41038: 88c00015 stw r3,0(r17)
  1664. 4103c: 9009883a mov r4,r18
  1665. 41040: 00436740 call 43674 <__malloc_unlock>
  1666. 41044: 80800204 addi r2,r16,8
  1667. 41048: 00001b06 br 410b8 <_malloc_r+0x2a4>
  1668. 4104c: 04400404 movi r17,16
  1669. 41050: 89402536 bltu r17,r5,410e8 <_malloc_r+0x2d4>
  1670. 41054: 00436500 call 43650 <__malloc_lock>
  1671. 41058: 00800184 movi r2,6
  1672. 4105c: 01000084 movi r4,2
  1673. 41060: 04c00134 movhi r19,4
  1674. 41064: 1085883a add r2,r2,r2
  1675. 41068: 9cd6ed04 addi r19,r19,23476
  1676. 4106c: 1085883a add r2,r2,r2
  1677. 41070: 9885883a add r2,r19,r2
  1678. 41074: 14000117 ldw r16,4(r2)
  1679. 41078: 10fffe04 addi r3,r2,-8
  1680. 4107c: 80c0d926 beq r16,r3,413e4 <_malloc_r+0x5d0>
  1681. 41080: 80c00117 ldw r3,4(r16)
  1682. 41084: 81000317 ldw r4,12(r16)
  1683. 41088: 00bfff04 movi r2,-4
  1684. 4108c: 1884703a and r2,r3,r2
  1685. 41090: 81400217 ldw r5,8(r16)
  1686. 41094: 8085883a add r2,r16,r2
  1687. 41098: 10c00117 ldw r3,4(r2)
  1688. 4109c: 29000315 stw r4,12(r5)
  1689. 410a0: 21400215 stw r5,8(r4)
  1690. 410a4: 18c00054 ori r3,r3,1
  1691. 410a8: 10c00115 stw r3,4(r2)
  1692. 410ac: 9009883a mov r4,r18
  1693. 410b0: 00436740 call 43674 <__malloc_unlock>
  1694. 410b4: 80800204 addi r2,r16,8
  1695. 410b8: dfc00a17 ldw ra,40(sp)
  1696. 410bc: df000917 ldw fp,36(sp)
  1697. 410c0: ddc00817 ldw r23,32(sp)
  1698. 410c4: dd800717 ldw r22,28(sp)
  1699. 410c8: dd400617 ldw r21,24(sp)
  1700. 410cc: dd000517 ldw r20,20(sp)
  1701. 410d0: dcc00417 ldw r19,16(sp)
  1702. 410d4: dc800317 ldw r18,12(sp)
  1703. 410d8: dc400217 ldw r17,8(sp)
  1704. 410dc: dc000117 ldw r16,4(sp)
  1705. 410e0: dec00b04 addi sp,sp,44
  1706. 410e4: f800283a ret
  1707. 410e8: 00800304 movi r2,12
  1708. 410ec: 90800015 stw r2,0(r18)
  1709. 410f0: 0005883a mov r2,zero
  1710. 410f4: 003ff006 br 410b8 <_malloc_r+0x2a4>
  1711. 410f8: 01002004 movi r4,128
  1712. 410fc: 02001004 movi r8,64
  1713. 41100: 01c00fc4 movi r7,63
  1714. 41104: 003f6106 br 40e8c <_malloc_r+0x78>
  1715. 41108: 4009883a mov r4,r8
  1716. 4110c: 003f7506 br 40ee4 <_malloc_r+0xd0>
  1717. 41110: 81000317 ldw r4,12(r16)
  1718. 41114: 003fde06 br 41090 <_malloc_r+0x27c>
  1719. 41118: 81c5883a add r2,r16,r7
  1720. 4111c: 11400117 ldw r5,4(r2)
  1721. 41120: 9009883a mov r4,r18
  1722. 41124: 29400054 ori r5,r5,1
  1723. 41128: 11400115 stw r5,4(r2)
  1724. 4112c: 00436740 call 43674 <__malloc_unlock>
  1725. 41130: 80800204 addi r2,r16,8
  1726. 41134: 003fe006 br 410b8 <_malloc_r+0x2a4>
  1727. 41138: 9c000217 ldw r16,8(r19)
  1728. 4113c: 00bfff04 movi r2,-4
  1729. 41140: 85800117 ldw r22,4(r16)
  1730. 41144: b0ac703a and r22,r22,r2
  1731. 41148: b4400336 bltu r22,r17,41158 <_malloc_r+0x344>
  1732. 4114c: b445c83a sub r2,r22,r17
  1733. 41150: 00c003c4 movi r3,15
  1734. 41154: 18805d16 blt r3,r2,412cc <_malloc_r+0x4b8>
  1735. 41158: 05c00134 movhi r23,4
  1736. 4115c: 00800174 movhi r2,5
  1737. 41160: 10a31c04 addi r2,r2,-29584
  1738. 41164: bddc7304 addi r23,r23,29132
  1739. 41168: 15400017 ldw r21,0(r2)
  1740. 4116c: b8c00017 ldw r3,0(r23)
  1741. 41170: 00bfffc4 movi r2,-1
  1742. 41174: 858d883a add r6,r16,r22
  1743. 41178: 8d6b883a add r21,r17,r21
  1744. 4117c: 1880ea26 beq r3,r2,41528 <_malloc_r+0x714>
  1745. 41180: ad4403c4 addi r21,r21,4111
  1746. 41184: 00bc0004 movi r2,-4096
  1747. 41188: a8aa703a and r21,r21,r2
  1748. 4118c: a80b883a mov r5,r21
  1749. 41190: 9009883a mov r4,r18
  1750. 41194: d9800015 stw r6,0(sp)
  1751. 41198: 00420340 call 42034 <_sbrk_r>
  1752. 4119c: 1029883a mov r20,r2
  1753. 411a0: 00bfffc4 movi r2,-1
  1754. 411a4: d9800017 ldw r6,0(sp)
  1755. 411a8: a080e826 beq r20,r2,4154c <_malloc_r+0x738>
  1756. 411ac: a180a636 bltu r20,r6,41448 <_malloc_r+0x634>
  1757. 411b0: 07000174 movhi fp,5
  1758. 411b4: e7232504 addi fp,fp,-29548
  1759. 411b8: e0800017 ldw r2,0(fp)
  1760. 411bc: a887883a add r3,r21,r2
  1761. 411c0: e0c00015 stw r3,0(fp)
  1762. 411c4: 3500e626 beq r6,r20,41560 <_malloc_r+0x74c>
  1763. 411c8: b9000017 ldw r4,0(r23)
  1764. 411cc: 00bfffc4 movi r2,-1
  1765. 411d0: 2080ee26 beq r4,r2,4158c <_malloc_r+0x778>
  1766. 411d4: a185c83a sub r2,r20,r6
  1767. 411d8: 10c5883a add r2,r2,r3
  1768. 411dc: e0800015 stw r2,0(fp)
  1769. 411e0: a0c001cc andi r3,r20,7
  1770. 411e4: 1800bc26 beq r3,zero,414d8 <_malloc_r+0x6c4>
  1771. 411e8: a0e9c83a sub r20,r20,r3
  1772. 411ec: 00840204 movi r2,4104
  1773. 411f0: a5000204 addi r20,r20,8
  1774. 411f4: 10c7c83a sub r3,r2,r3
  1775. 411f8: a545883a add r2,r20,r21
  1776. 411fc: 1083ffcc andi r2,r2,4095
  1777. 41200: 18abc83a sub r21,r3,r2
  1778. 41204: a80b883a mov r5,r21
  1779. 41208: 9009883a mov r4,r18
  1780. 4120c: 00420340 call 42034 <_sbrk_r>
  1781. 41210: 00ffffc4 movi r3,-1
  1782. 41214: 10c0e126 beq r2,r3,4159c <_malloc_r+0x788>
  1783. 41218: 1505c83a sub r2,r2,r20
  1784. 4121c: 1545883a add r2,r2,r21
  1785. 41220: 10800054 ori r2,r2,1
  1786. 41224: e0c00017 ldw r3,0(fp)
  1787. 41228: 9d000215 stw r20,8(r19)
  1788. 4122c: a0800115 stw r2,4(r20)
  1789. 41230: a8c7883a add r3,r21,r3
  1790. 41234: e0c00015 stw r3,0(fp)
  1791. 41238: 84c00e26 beq r16,r19,41274 <_malloc_r+0x460>
  1792. 4123c: 018003c4 movi r6,15
  1793. 41240: 3580a72e bgeu r6,r22,414e0 <_malloc_r+0x6cc>
  1794. 41244: 81400117 ldw r5,4(r16)
  1795. 41248: 013ffe04 movi r4,-8
  1796. 4124c: b0bffd04 addi r2,r22,-12
  1797. 41250: 1104703a and r2,r2,r4
  1798. 41254: 2900004c andi r4,r5,1
  1799. 41258: 2088b03a or r4,r4,r2
  1800. 4125c: 81000115 stw r4,4(r16)
  1801. 41260: 01400144 movi r5,5
  1802. 41264: 8089883a add r4,r16,r2
  1803. 41268: 21400115 stw r5,4(r4)
  1804. 4126c: 21400215 stw r5,8(r4)
  1805. 41270: 3080cd36 bltu r6,r2,415a8 <_malloc_r+0x794>
  1806. 41274: 00800174 movhi r2,5
  1807. 41278: 10a31b04 addi r2,r2,-29588
  1808. 4127c: 11000017 ldw r4,0(r2)
  1809. 41280: 20c0012e bgeu r4,r3,41288 <_malloc_r+0x474>
  1810. 41284: 10c00015 stw r3,0(r2)
  1811. 41288: 00800174 movhi r2,5
  1812. 4128c: 10a31a04 addi r2,r2,-29592
  1813. 41290: 11000017 ldw r4,0(r2)
  1814. 41294: 9c000217 ldw r16,8(r19)
  1815. 41298: 20c0012e bgeu r4,r3,412a0 <_malloc_r+0x48c>
  1816. 4129c: 10c00015 stw r3,0(r2)
  1817. 412a0: 80c00117 ldw r3,4(r16)
  1818. 412a4: 00bfff04 movi r2,-4
  1819. 412a8: 1886703a and r3,r3,r2
  1820. 412ac: 1c45c83a sub r2,r3,r17
  1821. 412b0: 1c400236 bltu r3,r17,412bc <_malloc_r+0x4a8>
  1822. 412b4: 00c003c4 movi r3,15
  1823. 412b8: 18800416 blt r3,r2,412cc <_malloc_r+0x4b8>
  1824. 412bc: 9009883a mov r4,r18
  1825. 412c0: 00436740 call 43674 <__malloc_unlock>
  1826. 412c4: 0005883a mov r2,zero
  1827. 412c8: 003f7b06 br 410b8 <_malloc_r+0x2a4>
  1828. 412cc: 88c00054 ori r3,r17,1
  1829. 412d0: 80c00115 stw r3,4(r16)
  1830. 412d4: 8463883a add r17,r16,r17
  1831. 412d8: 10800054 ori r2,r2,1
  1832. 412dc: 9c400215 stw r17,8(r19)
  1833. 412e0: 88800115 stw r2,4(r17)
  1834. 412e4: 9009883a mov r4,r18
  1835. 412e8: 00436740 call 43674 <__malloc_unlock>
  1836. 412ec: 80800204 addi r2,r16,8
  1837. 412f0: 003f7106 br 410b8 <_malloc_r+0x2a4>
  1838. 412f4: 00c00504 movi r3,20
  1839. 412f8: 18804a2e bgeu r3,r2,41424 <_malloc_r+0x610>
  1840. 412fc: 00c01504 movi r3,84
  1841. 41300: 18806e36 bltu r3,r2,414bc <_malloc_r+0x6a8>
  1842. 41304: 8804d33a srli r2,r17,12
  1843. 41308: 12001bc4 addi r8,r2,111
  1844. 4130c: 11c01b84 addi r7,r2,110
  1845. 41310: 4209883a add r4,r8,r8
  1846. 41314: 003edd06 br 40e8c <_malloc_r+0x78>
  1847. 41318: 3804d27a srli r2,r7,9
  1848. 4131c: 00c00104 movi r3,4
  1849. 41320: 1880442e bgeu r3,r2,41434 <_malloc_r+0x620>
  1850. 41324: 00c00504 movi r3,20
  1851. 41328: 18808136 bltu r3,r2,41530 <_malloc_r+0x71c>
  1852. 4132c: 11401704 addi r5,r2,92
  1853. 41330: 10c016c4 addi r3,r2,91
  1854. 41334: 294b883a add r5,r5,r5
  1855. 41338: 294b883a add r5,r5,r5
  1856. 4133c: 294b883a add r5,r5,r5
  1857. 41340: 994b883a add r5,r19,r5
  1858. 41344: 28800017 ldw r2,0(r5)
  1859. 41348: 01800134 movhi r6,4
  1860. 4134c: 297ffe04 addi r5,r5,-8
  1861. 41350: 3196ed04 addi r6,r6,23476
  1862. 41354: 28806526 beq r5,r2,414ec <_malloc_r+0x6d8>
  1863. 41358: 01bfff04 movi r6,-4
  1864. 4135c: 10c00117 ldw r3,4(r2)
  1865. 41360: 1986703a and r3,r3,r6
  1866. 41364: 38c0022e bgeu r7,r3,41370 <_malloc_r+0x55c>
  1867. 41368: 10800217 ldw r2,8(r2)
  1868. 4136c: 28bffb1e bne r5,r2,4135c <_malloc_r+0x548>
  1869. 41370: 11400317 ldw r5,12(r2)
  1870. 41374: 98c00117 ldw r3,4(r19)
  1871. 41378: 81400315 stw r5,12(r16)
  1872. 4137c: 80800215 stw r2,8(r16)
  1873. 41380: 2c000215 stw r16,8(r5)
  1874. 41384: 14000315 stw r16,12(r2)
  1875. 41388: 003ef806 br 40f6c <_malloc_r+0x158>
  1876. 4138c: 88c00054 ori r3,r17,1
  1877. 41390: 80c00115 stw r3,4(r16)
  1878. 41394: 8463883a add r17,r16,r17
  1879. 41398: 34400515 stw r17,20(r6)
  1880. 4139c: 34400415 stw r17,16(r6)
  1881. 413a0: 10c00054 ori r3,r2,1
  1882. 413a4: 8a000315 stw r8,12(r17)
  1883. 413a8: 8a000215 stw r8,8(r17)
  1884. 413ac: 88c00115 stw r3,4(r17)
  1885. 413b0: 88a3883a add r17,r17,r2
  1886. 413b4: 88800015 stw r2,0(r17)
  1887. 413b8: 9009883a mov r4,r18
  1888. 413bc: 00436740 call 43674 <__malloc_unlock>
  1889. 413c0: 80800204 addi r2,r16,8
  1890. 413c4: 003f3c06 br 410b8 <_malloc_r+0x2a4>
  1891. 413c8: 30c00117 ldw r3,4(r6)
  1892. 413cc: 003ee706 br 40f6c <_malloc_r+0x158>
  1893. 413d0: 5ac00044 addi r11,r11,1
  1894. 413d4: 588000cc andi r2,r11,3
  1895. 413d8: 31800204 addi r6,r6,8
  1896. 413dc: 103efd1e bne r2,zero,40fd4 <_malloc_r+0x1c0>
  1897. 413e0: 00002406 br 41474 <_malloc_r+0x660>
  1898. 413e4: 14000317 ldw r16,12(r2)
  1899. 413e8: 143f251e bne r2,r16,41080 <_malloc_r+0x26c>
  1900. 413ec: 21000084 addi r4,r4,2
  1901. 413f0: 003ebc06 br 40ee4 <_malloc_r+0xd0>
  1902. 413f4: 8085883a add r2,r16,r2
  1903. 413f8: 10c00117 ldw r3,4(r2)
  1904. 413fc: 81000317 ldw r4,12(r16)
  1905. 41400: 81400217 ldw r5,8(r16)
  1906. 41404: 18c00054 ori r3,r3,1
  1907. 41408: 10c00115 stw r3,4(r2)
  1908. 4140c: 29000315 stw r4,12(r5)
  1909. 41410: 21400215 stw r5,8(r4)
  1910. 41414: 9009883a mov r4,r18
  1911. 41418: 00436740 call 43674 <__malloc_unlock>
  1912. 4141c: 80800204 addi r2,r16,8
  1913. 41420: 003f2506 br 410b8 <_malloc_r+0x2a4>
  1914. 41424: 12001704 addi r8,r2,92
  1915. 41428: 11c016c4 addi r7,r2,91
  1916. 4142c: 4209883a add r4,r8,r8
  1917. 41430: 003e9606 br 40e8c <_malloc_r+0x78>
  1918. 41434: 3804d1ba srli r2,r7,6
  1919. 41438: 11400e44 addi r5,r2,57
  1920. 4143c: 10c00e04 addi r3,r2,56
  1921. 41440: 294b883a add r5,r5,r5
  1922. 41444: 003fbc06 br 41338 <_malloc_r+0x524>
  1923. 41448: 84ff5926 beq r16,r19,411b0 <_malloc_r+0x39c>
  1924. 4144c: 00800134 movhi r2,4
  1925. 41450: 1096ed04 addi r2,r2,23476
  1926. 41454: 14000217 ldw r16,8(r2)
  1927. 41458: 00bfff04 movi r2,-4
  1928. 4145c: 80c00117 ldw r3,4(r16)
  1929. 41460: 1886703a and r3,r3,r2
  1930. 41464: 003f9106 br 412ac <_malloc_r+0x498>
  1931. 41468: 60800217 ldw r2,8(r12)
  1932. 4146c: 213fffc4 addi r4,r4,-1
  1933. 41470: 1300651e bne r2,r12,41608 <_malloc_r+0x7f4>
  1934. 41474: 208000cc andi r2,r4,3
  1935. 41478: 633ffe04 addi r12,r12,-8
  1936. 4147c: 103ffa1e bne r2,zero,41468 <_malloc_r+0x654>
  1937. 41480: 98800117 ldw r2,4(r19)
  1938. 41484: 0146303a nor r3,zero,r5
  1939. 41488: 1884703a and r2,r3,r2
  1940. 4148c: 98800115 stw r2,4(r19)
  1941. 41490: 294b883a add r5,r5,r5
  1942. 41494: 117f2836 bltu r2,r5,41138 <_malloc_r+0x324>
  1943. 41498: 283f2726 beq r5,zero,41138 <_malloc_r+0x324>
  1944. 4149c: 2886703a and r3,r5,r2
  1945. 414a0: 5809883a mov r4,r11
  1946. 414a4: 183ec31e bne r3,zero,40fb4 <_malloc_r+0x1a0>
  1947. 414a8: 294b883a add r5,r5,r5
  1948. 414ac: 2886703a and r3,r5,r2
  1949. 414b0: 21000104 addi r4,r4,4
  1950. 414b4: 183ffc26 beq r3,zero,414a8 <_malloc_r+0x694>
  1951. 414b8: 003ebe06 br 40fb4 <_malloc_r+0x1a0>
  1952. 414bc: 00c05504 movi r3,340
  1953. 414c0: 18801236 bltu r3,r2,4150c <_malloc_r+0x6f8>
  1954. 414c4: 8804d3fa srli r2,r17,15
  1955. 414c8: 12001e04 addi r8,r2,120
  1956. 414cc: 11c01dc4 addi r7,r2,119
  1957. 414d0: 4209883a add r4,r8,r8
  1958. 414d4: 003e6d06 br 40e8c <_malloc_r+0x78>
  1959. 414d8: 00c40004 movi r3,4096
  1960. 414dc: 003f4606 br 411f8 <_malloc_r+0x3e4>
  1961. 414e0: 00800044 movi r2,1
  1962. 414e4: a0800115 stw r2,4(r20)
  1963. 414e8: 003f7406 br 412bc <_malloc_r+0x4a8>
  1964. 414ec: 1805d0ba srai r2,r3,2
  1965. 414f0: 01c00044 movi r7,1
  1966. 414f4: 30c00117 ldw r3,4(r6)
  1967. 414f8: 388e983a sll r7,r7,r2
  1968. 414fc: 2805883a mov r2,r5
  1969. 41500: 38c6b03a or r3,r7,r3
  1970. 41504: 30c00115 stw r3,4(r6)
  1971. 41508: 003f9b06 br 41378 <_malloc_r+0x564>
  1972. 4150c: 00c15504 movi r3,1364
  1973. 41510: 18801a36 bltu r3,r2,4157c <_malloc_r+0x768>
  1974. 41514: 8804d4ba srli r2,r17,18
  1975. 41518: 12001f44 addi r8,r2,125
  1976. 4151c: 11c01f04 addi r7,r2,124
  1977. 41520: 4209883a add r4,r8,r8
  1978. 41524: 003e5906 br 40e8c <_malloc_r+0x78>
  1979. 41528: ad400404 addi r21,r21,16
  1980. 4152c: 003f1706 br 4118c <_malloc_r+0x378>
  1981. 41530: 00c01504 movi r3,84
  1982. 41534: 18802336 bltu r3,r2,415c4 <_malloc_r+0x7b0>
  1983. 41538: 3804d33a srli r2,r7,12
  1984. 4153c: 11401bc4 addi r5,r2,111
  1985. 41540: 10c01b84 addi r3,r2,110
  1986. 41544: 294b883a add r5,r5,r5
  1987. 41548: 003f7b06 br 41338 <_malloc_r+0x524>
  1988. 4154c: 9c000217 ldw r16,8(r19)
  1989. 41550: 00bfff04 movi r2,-4
  1990. 41554: 80c00117 ldw r3,4(r16)
  1991. 41558: 1886703a and r3,r3,r2
  1992. 4155c: 003f5306 br 412ac <_malloc_r+0x498>
  1993. 41560: 3083ffcc andi r2,r6,4095
  1994. 41564: 103f181e bne r2,zero,411c8 <_malloc_r+0x3b4>
  1995. 41568: 99000217 ldw r4,8(r19)
  1996. 4156c: b545883a add r2,r22,r21
  1997. 41570: 10800054 ori r2,r2,1
  1998. 41574: 20800115 stw r2,4(r4)
  1999. 41578: 003f3e06 br 41274 <_malloc_r+0x460>
  2000. 4157c: 01003f84 movi r4,254
  2001. 41580: 02001fc4 movi r8,127
  2002. 41584: 01c01f84 movi r7,126
  2003. 41588: 003e4006 br 40e8c <_malloc_r+0x78>
  2004. 4158c: 00800134 movhi r2,4
  2005. 41590: 109c7304 addi r2,r2,29132
  2006. 41594: 15000015 stw r20,0(r2)
  2007. 41598: 003f1106 br 411e0 <_malloc_r+0x3cc>
  2008. 4159c: 00800044 movi r2,1
  2009. 415a0: 002b883a mov r21,zero
  2010. 415a4: 003f1f06 br 41224 <_malloc_r+0x410>
  2011. 415a8: 81400204 addi r5,r16,8
  2012. 415ac: 9009883a mov r4,r18
  2013. 415b0: 004289c0 call 4289c <_free_r>
  2014. 415b4: 00800174 movhi r2,5
  2015. 415b8: 10a32504 addi r2,r2,-29548
  2016. 415bc: 10c00017 ldw r3,0(r2)
  2017. 415c0: 003f2c06 br 41274 <_malloc_r+0x460>
  2018. 415c4: 00c05504 movi r3,340
  2019. 415c8: 18800536 bltu r3,r2,415e0 <_malloc_r+0x7cc>
  2020. 415cc: 3804d3fa srli r2,r7,15
  2021. 415d0: 11401e04 addi r5,r2,120
  2022. 415d4: 10c01dc4 addi r3,r2,119
  2023. 415d8: 294b883a add r5,r5,r5
  2024. 415dc: 003f5606 br 41338 <_malloc_r+0x524>
  2025. 415e0: 00c15504 movi r3,1364
  2026. 415e4: 18800536 bltu r3,r2,415fc <_malloc_r+0x7e8>
  2027. 415e8: 3804d4ba srli r2,r7,18
  2028. 415ec: 11401f44 addi r5,r2,125
  2029. 415f0: 10c01f04 addi r3,r2,124
  2030. 415f4: 294b883a add r5,r5,r5
  2031. 415f8: 003f4f06 br 41338 <_malloc_r+0x524>
  2032. 415fc: 01403f84 movi r5,254
  2033. 41600: 00c01f84 movi r3,126
  2034. 41604: 003f4c06 br 41338 <_malloc_r+0x524>
  2035. 41608: 98800117 ldw r2,4(r19)
  2036. 4160c: 003fa006 br 41490 <_malloc_r+0x67c>
  2037. 41610: 8808d0fa srli r4,r17,3
  2038. 41614: 20800044 addi r2,r4,1
  2039. 41618: 1085883a add r2,r2,r2
  2040. 4161c: 003e9006 br 41060 <_malloc_r+0x24c>
  2041. 00041620 <memchr>:
  2042. 41620: 208000cc andi r2,r4,3
  2043. 41624: 280f883a mov r7,r5
  2044. 41628: 10003426 beq r2,zero,416fc <memchr+0xdc>
  2045. 4162c: 30bfffc4 addi r2,r6,-1
  2046. 41630: 30001a26 beq r6,zero,4169c <memchr+0x7c>
  2047. 41634: 20c00003 ldbu r3,0(r4)
  2048. 41638: 29803fcc andi r6,r5,255
  2049. 4163c: 30c0051e bne r6,r3,41654 <memchr+0x34>
  2050. 41640: 00001806 br 416a4 <memchr+0x84>
  2051. 41644: 10001526 beq r2,zero,4169c <memchr+0x7c>
  2052. 41648: 20c00003 ldbu r3,0(r4)
  2053. 4164c: 10bfffc4 addi r2,r2,-1
  2054. 41650: 30c01426 beq r6,r3,416a4 <memchr+0x84>
  2055. 41654: 21000044 addi r4,r4,1
  2056. 41658: 20c000cc andi r3,r4,3
  2057. 4165c: 183ff91e bne r3,zero,41644 <memchr+0x24>
  2058. 41660: 020000c4 movi r8,3
  2059. 41664: 40801136 bltu r8,r2,416ac <memchr+0x8c>
  2060. 41668: 10000c26 beq r2,zero,4169c <memchr+0x7c>
  2061. 4166c: 20c00003 ldbu r3,0(r4)
  2062. 41670: 29403fcc andi r5,r5,255
  2063. 41674: 28c00b26 beq r5,r3,416a4 <memchr+0x84>
  2064. 41678: 20c00044 addi r3,r4,1
  2065. 4167c: 39803fcc andi r6,r7,255
  2066. 41680: 2089883a add r4,r4,r2
  2067. 41684: 00000306 br 41694 <memchr+0x74>
  2068. 41688: 18c00044 addi r3,r3,1
  2069. 4168c: 197fffc3 ldbu r5,-1(r3)
  2070. 41690: 31400526 beq r6,r5,416a8 <memchr+0x88>
  2071. 41694: 1805883a mov r2,r3
  2072. 41698: 20fffb1e bne r4,r3,41688 <memchr+0x68>
  2073. 4169c: 0005883a mov r2,zero
  2074. 416a0: f800283a ret
  2075. 416a4: 2005883a mov r2,r4
  2076. 416a8: f800283a ret
  2077. 416ac: 28c03fcc andi r3,r5,255
  2078. 416b0: 1812923a slli r9,r3,8
  2079. 416b4: 02ffbff4 movhi r11,65279
  2080. 416b8: 02a02074 movhi r10,32897
  2081. 416bc: 48d2b03a or r9,r9,r3
  2082. 416c0: 4806943a slli r3,r9,16
  2083. 416c4: 5affbfc4 addi r11,r11,-257
  2084. 416c8: 52a02004 addi r10,r10,-32640
  2085. 416cc: 48d2b03a or r9,r9,r3
  2086. 416d0: 20c00017 ldw r3,0(r4)
  2087. 416d4: 48c6f03a xor r3,r9,r3
  2088. 416d8: 1acd883a add r6,r3,r11
  2089. 416dc: 00c6303a nor r3,zero,r3
  2090. 416e0: 30c6703a and r3,r6,r3
  2091. 416e4: 1a86703a and r3,r3,r10
  2092. 416e8: 183fe01e bne r3,zero,4166c <memchr+0x4c>
  2093. 416ec: 10bfff04 addi r2,r2,-4
  2094. 416f0: 21000104 addi r4,r4,4
  2095. 416f4: 40bff636 bltu r8,r2,416d0 <memchr+0xb0>
  2096. 416f8: 003fdb06 br 41668 <memchr+0x48>
  2097. 416fc: 3005883a mov r2,r6
  2098. 41700: 003fd706 br 41660 <memchr+0x40>
  2099. 00041704 <memcpy>:
  2100. 41704: defffd04 addi sp,sp,-12
  2101. 41708: dfc00215 stw ra,8(sp)
  2102. 4170c: dc400115 stw r17,4(sp)
  2103. 41710: dc000015 stw r16,0(sp)
  2104. 41714: 00c003c4 movi r3,15
  2105. 41718: 2005883a mov r2,r4
  2106. 4171c: 1980452e bgeu r3,r6,41834 <memcpy+0x130>
  2107. 41720: 2906b03a or r3,r5,r4
  2108. 41724: 18c000cc andi r3,r3,3
  2109. 41728: 1800441e bne r3,zero,4183c <memcpy+0x138>
  2110. 4172c: 347ffc04 addi r17,r6,-16
  2111. 41730: 8822d13a srli r17,r17,4
  2112. 41734: 28c00104 addi r3,r5,4
  2113. 41738: 23400104 addi r13,r4,4
  2114. 4173c: 8820913a slli r16,r17,4
  2115. 41740: 2b000204 addi r12,r5,8
  2116. 41744: 22c00204 addi r11,r4,8
  2117. 41748: 84000504 addi r16,r16,20
  2118. 4174c: 2a800304 addi r10,r5,12
  2119. 41750: 22400304 addi r9,r4,12
  2120. 41754: 2c21883a add r16,r5,r16
  2121. 41758: 2811883a mov r8,r5
  2122. 4175c: 200f883a mov r7,r4
  2123. 41760: 41000017 ldw r4,0(r8)
  2124. 41764: 1fc00017 ldw ra,0(r3)
  2125. 41768: 63c00017 ldw r15,0(r12)
  2126. 4176c: 39000015 stw r4,0(r7)
  2127. 41770: 53800017 ldw r14,0(r10)
  2128. 41774: 6fc00015 stw ra,0(r13)
  2129. 41778: 5bc00015 stw r15,0(r11)
  2130. 4177c: 4b800015 stw r14,0(r9)
  2131. 41780: 18c00404 addi r3,r3,16
  2132. 41784: 39c00404 addi r7,r7,16
  2133. 41788: 42000404 addi r8,r8,16
  2134. 4178c: 6b400404 addi r13,r13,16
  2135. 41790: 63000404 addi r12,r12,16
  2136. 41794: 5ac00404 addi r11,r11,16
  2137. 41798: 52800404 addi r10,r10,16
  2138. 4179c: 4a400404 addi r9,r9,16
  2139. 417a0: 1c3fef1e bne r3,r16,41760 <memcpy+0x5c>
  2140. 417a4: 89c00044 addi r7,r17,1
  2141. 417a8: 380e913a slli r7,r7,4
  2142. 417ac: 310003cc andi r4,r6,15
  2143. 417b0: 02c000c4 movi r11,3
  2144. 417b4: 11c7883a add r3,r2,r7
  2145. 417b8: 29cb883a add r5,r5,r7
  2146. 417bc: 5900212e bgeu r11,r4,41844 <memcpy+0x140>
  2147. 417c0: 1813883a mov r9,r3
  2148. 417c4: 2811883a mov r8,r5
  2149. 417c8: 200f883a mov r7,r4
  2150. 417cc: 42800017 ldw r10,0(r8)
  2151. 417d0: 4a400104 addi r9,r9,4
  2152. 417d4: 39ffff04 addi r7,r7,-4
  2153. 417d8: 4abfff15 stw r10,-4(r9)
  2154. 417dc: 42000104 addi r8,r8,4
  2155. 417e0: 59fffa36 bltu r11,r7,417cc <memcpy+0xc8>
  2156. 417e4: 213fff04 addi r4,r4,-4
  2157. 417e8: 2008d0ba srli r4,r4,2
  2158. 417ec: 318000cc andi r6,r6,3
  2159. 417f0: 21000044 addi r4,r4,1
  2160. 417f4: 2109883a add r4,r4,r4
  2161. 417f8: 2109883a add r4,r4,r4
  2162. 417fc: 1907883a add r3,r3,r4
  2163. 41800: 290b883a add r5,r5,r4
  2164. 41804: 30000626 beq r6,zero,41820 <memcpy+0x11c>
  2165. 41808: 198d883a add r6,r3,r6
  2166. 4180c: 29c00003 ldbu r7,0(r5)
  2167. 41810: 18c00044 addi r3,r3,1
  2168. 41814: 29400044 addi r5,r5,1
  2169. 41818: 19ffffc5 stb r7,-1(r3)
  2170. 4181c: 19bffb1e bne r3,r6,4180c <memcpy+0x108>
  2171. 41820: dfc00217 ldw ra,8(sp)
  2172. 41824: dc400117 ldw r17,4(sp)
  2173. 41828: dc000017 ldw r16,0(sp)
  2174. 4182c: dec00304 addi sp,sp,12
  2175. 41830: f800283a ret
  2176. 41834: 2007883a mov r3,r4
  2177. 41838: 003ff206 br 41804 <memcpy+0x100>
  2178. 4183c: 2007883a mov r3,r4
  2179. 41840: 003ff106 br 41808 <memcpy+0x104>
  2180. 41844: 200d883a mov r6,r4
  2181. 41848: 003fee06 br 41804 <memcpy+0x100>
  2182. 0004184c <memmove>:
  2183. 4184c: 2005883a mov r2,r4
  2184. 41850: 29000b2e bgeu r5,r4,41880 <memmove+0x34>
  2185. 41854: 298f883a add r7,r5,r6
  2186. 41858: 21c0092e bgeu r4,r7,41880 <memmove+0x34>
  2187. 4185c: 2187883a add r3,r4,r6
  2188. 41860: 198bc83a sub r5,r3,r6
  2189. 41864: 30004826 beq r6,zero,41988 <memmove+0x13c>
  2190. 41868: 39ffffc4 addi r7,r7,-1
  2191. 4186c: 39000003 ldbu r4,0(r7)
  2192. 41870: 18ffffc4 addi r3,r3,-1
  2193. 41874: 19000005 stb r4,0(r3)
  2194. 41878: 28fffb1e bne r5,r3,41868 <memmove+0x1c>
  2195. 4187c: f800283a ret
  2196. 41880: 00c003c4 movi r3,15
  2197. 41884: 1980412e bgeu r3,r6,4198c <memmove+0x140>
  2198. 41888: 2886b03a or r3,r5,r2
  2199. 4188c: 18c000cc andi r3,r3,3
  2200. 41890: 1800401e bne r3,zero,41994 <memmove+0x148>
  2201. 41894: 33fffc04 addi r15,r6,-16
  2202. 41898: 781ed13a srli r15,r15,4
  2203. 4189c: 28c00104 addi r3,r5,4
  2204. 418a0: 13400104 addi r13,r2,4
  2205. 418a4: 781c913a slli r14,r15,4
  2206. 418a8: 2b000204 addi r12,r5,8
  2207. 418ac: 12c00204 addi r11,r2,8
  2208. 418b0: 73800504 addi r14,r14,20
  2209. 418b4: 2a800304 addi r10,r5,12
  2210. 418b8: 12400304 addi r9,r2,12
  2211. 418bc: 2b9d883a add r14,r5,r14
  2212. 418c0: 2811883a mov r8,r5
  2213. 418c4: 100f883a mov r7,r2
  2214. 418c8: 41000017 ldw r4,0(r8)
  2215. 418cc: 39c00404 addi r7,r7,16
  2216. 418d0: 18c00404 addi r3,r3,16
  2217. 418d4: 393ffc15 stw r4,-16(r7)
  2218. 418d8: 193ffc17 ldw r4,-16(r3)
  2219. 418dc: 6b400404 addi r13,r13,16
  2220. 418e0: 5ac00404 addi r11,r11,16
  2221. 418e4: 693ffc15 stw r4,-16(r13)
  2222. 418e8: 61000017 ldw r4,0(r12)
  2223. 418ec: 4a400404 addi r9,r9,16
  2224. 418f0: 42000404 addi r8,r8,16
  2225. 418f4: 593ffc15 stw r4,-16(r11)
  2226. 418f8: 51000017 ldw r4,0(r10)
  2227. 418fc: 63000404 addi r12,r12,16
  2228. 41900: 52800404 addi r10,r10,16
  2229. 41904: 493ffc15 stw r4,-16(r9)
  2230. 41908: 1bbfef1e bne r3,r14,418c8 <memmove+0x7c>
  2231. 4190c: 79000044 addi r4,r15,1
  2232. 41910: 2008913a slli r4,r4,4
  2233. 41914: 328003cc andi r10,r6,15
  2234. 41918: 02c000c4 movi r11,3
  2235. 4191c: 1107883a add r3,r2,r4
  2236. 41920: 290b883a add r5,r5,r4
  2237. 41924: 5a801e2e bgeu r11,r10,419a0 <memmove+0x154>
  2238. 41928: 1813883a mov r9,r3
  2239. 4192c: 2811883a mov r8,r5
  2240. 41930: 500f883a mov r7,r10
  2241. 41934: 41000017 ldw r4,0(r8)
  2242. 41938: 4a400104 addi r9,r9,4
  2243. 4193c: 39ffff04 addi r7,r7,-4
  2244. 41940: 493fff15 stw r4,-4(r9)
  2245. 41944: 42000104 addi r8,r8,4
  2246. 41948: 59fffa36 bltu r11,r7,41934 <memmove+0xe8>
  2247. 4194c: 513fff04 addi r4,r10,-4
  2248. 41950: 2008d0ba srli r4,r4,2
  2249. 41954: 318000cc andi r6,r6,3
  2250. 41958: 21000044 addi r4,r4,1
  2251. 4195c: 2109883a add r4,r4,r4
  2252. 41960: 2109883a add r4,r4,r4
  2253. 41964: 1907883a add r3,r3,r4
  2254. 41968: 290b883a add r5,r5,r4
  2255. 4196c: 30000b26 beq r6,zero,4199c <memmove+0x150>
  2256. 41970: 198d883a add r6,r3,r6
  2257. 41974: 29c00003 ldbu r7,0(r5)
  2258. 41978: 18c00044 addi r3,r3,1
  2259. 4197c: 29400044 addi r5,r5,1
  2260. 41980: 19ffffc5 stb r7,-1(r3)
  2261. 41984: 19bffb1e bne r3,r6,41974 <memmove+0x128>
  2262. 41988: f800283a ret
  2263. 4198c: 1007883a mov r3,r2
  2264. 41990: 003ff606 br 4196c <memmove+0x120>
  2265. 41994: 1007883a mov r3,r2
  2266. 41998: 003ff506 br 41970 <memmove+0x124>
  2267. 4199c: f800283a ret
  2268. 419a0: 500d883a mov r6,r10
  2269. 419a4: 003ff106 br 4196c <memmove+0x120>
  2270. 000419a8 <memset>:
  2271. 419a8: 20c000cc andi r3,r4,3
  2272. 419ac: 2005883a mov r2,r4
  2273. 419b0: 18004426 beq r3,zero,41ac4 <memset+0x11c>
  2274. 419b4: 31ffffc4 addi r7,r6,-1
  2275. 419b8: 30004026 beq r6,zero,41abc <memset+0x114>
  2276. 419bc: 2813883a mov r9,r5
  2277. 419c0: 200d883a mov r6,r4
  2278. 419c4: 2007883a mov r3,r4
  2279. 419c8: 00000406 br 419dc <memset+0x34>
  2280. 419cc: 3a3fffc4 addi r8,r7,-1
  2281. 419d0: 31800044 addi r6,r6,1
  2282. 419d4: 38003926 beq r7,zero,41abc <memset+0x114>
  2283. 419d8: 400f883a mov r7,r8
  2284. 419dc: 18c00044 addi r3,r3,1
  2285. 419e0: 32400005 stb r9,0(r6)
  2286. 419e4: 1a0000cc andi r8,r3,3
  2287. 419e8: 403ff81e bne r8,zero,419cc <memset+0x24>
  2288. 419ec: 010000c4 movi r4,3
  2289. 419f0: 21c02d2e bgeu r4,r7,41aa8 <memset+0x100>
  2290. 419f4: 29003fcc andi r4,r5,255
  2291. 419f8: 200c923a slli r6,r4,8
  2292. 419fc: 3108b03a or r4,r6,r4
  2293. 41a00: 200c943a slli r6,r4,16
  2294. 41a04: 218cb03a or r6,r4,r6
  2295. 41a08: 010003c4 movi r4,15
  2296. 41a0c: 21c0182e bgeu r4,r7,41a70 <memset+0xc8>
  2297. 41a10: 3b3ffc04 addi r12,r7,-16
  2298. 41a14: 6018d13a srli r12,r12,4
  2299. 41a18: 1a000104 addi r8,r3,4
  2300. 41a1c: 1ac00204 addi r11,r3,8
  2301. 41a20: 6008913a slli r4,r12,4
  2302. 41a24: 1a800304 addi r10,r3,12
  2303. 41a28: 1813883a mov r9,r3
  2304. 41a2c: 21000504 addi r4,r4,20
  2305. 41a30: 1909883a add r4,r3,r4
  2306. 41a34: 49800015 stw r6,0(r9)
  2307. 41a38: 41800015 stw r6,0(r8)
  2308. 41a3c: 59800015 stw r6,0(r11)
  2309. 41a40: 51800015 stw r6,0(r10)
  2310. 41a44: 42000404 addi r8,r8,16
  2311. 41a48: 4a400404 addi r9,r9,16
  2312. 41a4c: 5ac00404 addi r11,r11,16
  2313. 41a50: 52800404 addi r10,r10,16
  2314. 41a54: 413ff71e bne r8,r4,41a34 <memset+0x8c>
  2315. 41a58: 63000044 addi r12,r12,1
  2316. 41a5c: 6018913a slli r12,r12,4
  2317. 41a60: 39c003cc andi r7,r7,15
  2318. 41a64: 010000c4 movi r4,3
  2319. 41a68: 1b07883a add r3,r3,r12
  2320. 41a6c: 21c00e2e bgeu r4,r7,41aa8 <memset+0x100>
  2321. 41a70: 1813883a mov r9,r3
  2322. 41a74: 3811883a mov r8,r7
  2323. 41a78: 010000c4 movi r4,3
  2324. 41a7c: 49800015 stw r6,0(r9)
  2325. 41a80: 423fff04 addi r8,r8,-4
  2326. 41a84: 4a400104 addi r9,r9,4
  2327. 41a88: 223ffc36 bltu r4,r8,41a7c <memset+0xd4>
  2328. 41a8c: 393fff04 addi r4,r7,-4
  2329. 41a90: 2008d0ba srli r4,r4,2
  2330. 41a94: 39c000cc andi r7,r7,3
  2331. 41a98: 21000044 addi r4,r4,1
  2332. 41a9c: 2109883a add r4,r4,r4
  2333. 41aa0: 2109883a add r4,r4,r4
  2334. 41aa4: 1907883a add r3,r3,r4
  2335. 41aa8: 38000526 beq r7,zero,41ac0 <memset+0x118>
  2336. 41aac: 19cf883a add r7,r3,r7
  2337. 41ab0: 19400005 stb r5,0(r3)
  2338. 41ab4: 18c00044 addi r3,r3,1
  2339. 41ab8: 38fffd1e bne r7,r3,41ab0 <memset+0x108>
  2340. 41abc: f800283a ret
  2341. 41ac0: f800283a ret
  2342. 41ac4: 2007883a mov r3,r4
  2343. 41ac8: 300f883a mov r7,r6
  2344. 41acc: 003fc706 br 419ec <memset+0x44>
  2345. 00041ad0 <_realloc_r>:
  2346. 41ad0: defff604 addi sp,sp,-40
  2347. 41ad4: dc800215 stw r18,8(sp)
  2348. 41ad8: dfc00915 stw ra,36(sp)
  2349. 41adc: df000815 stw fp,32(sp)
  2350. 41ae0: ddc00715 stw r23,28(sp)
  2351. 41ae4: dd800615 stw r22,24(sp)
  2352. 41ae8: dd400515 stw r21,20(sp)
  2353. 41aec: dd000415 stw r20,16(sp)
  2354. 41af0: dcc00315 stw r19,12(sp)
  2355. 41af4: dc400115 stw r17,4(sp)
  2356. 41af8: dc000015 stw r16,0(sp)
  2357. 41afc: 3025883a mov r18,r6
  2358. 41b00: 2800b726 beq r5,zero,41de0 <_realloc_r+0x310>
  2359. 41b04: 282b883a mov r21,r5
  2360. 41b08: 2029883a mov r20,r4
  2361. 41b0c: 00436500 call 43650 <__malloc_lock>
  2362. 41b10: a8bfff17 ldw r2,-4(r21)
  2363. 41b14: 043fff04 movi r16,-4
  2364. 41b18: 90c002c4 addi r3,r18,11
  2365. 41b1c: 01000584 movi r4,22
  2366. 41b20: acfffe04 addi r19,r21,-8
  2367. 41b24: 1420703a and r16,r2,r16
  2368. 41b28: 20c0332e bgeu r4,r3,41bf8 <_realloc_r+0x128>
  2369. 41b2c: 047ffe04 movi r17,-8
  2370. 41b30: 1c62703a and r17,r3,r17
  2371. 41b34: 8807883a mov r3,r17
  2372. 41b38: 88005816 blt r17,zero,41c9c <_realloc_r+0x1cc>
  2373. 41b3c: 8c805736 bltu r17,r18,41c9c <_realloc_r+0x1cc>
  2374. 41b40: 80c0300e bge r16,r3,41c04 <_realloc_r+0x134>
  2375. 41b44: 07000134 movhi fp,4
  2376. 41b48: e716ed04 addi fp,fp,23476
  2377. 41b4c: e1c00217 ldw r7,8(fp)
  2378. 41b50: 9c09883a add r4,r19,r16
  2379. 41b54: 22000117 ldw r8,4(r4)
  2380. 41b58: 21c06326 beq r4,r7,41ce8 <_realloc_r+0x218>
  2381. 41b5c: 017fff84 movi r5,-2
  2382. 41b60: 414a703a and r5,r8,r5
  2383. 41b64: 214b883a add r5,r4,r5
  2384. 41b68: 29800117 ldw r6,4(r5)
  2385. 41b6c: 3180004c andi r6,r6,1
  2386. 41b70: 30003f26 beq r6,zero,41c70 <_realloc_r+0x1a0>
  2387. 41b74: 1080004c andi r2,r2,1
  2388. 41b78: 10008326 beq r2,zero,41d88 <_realloc_r+0x2b8>
  2389. 41b7c: 900b883a mov r5,r18
  2390. 41b80: a009883a mov r4,r20
  2391. 41b84: 0040e140 call 40e14 <_malloc_r>
  2392. 41b88: 1025883a mov r18,r2
  2393. 41b8c: 10011e26 beq r2,zero,42008 <_realloc_r+0x538>
  2394. 41b90: a93fff17 ldw r4,-4(r21)
  2395. 41b94: 10fffe04 addi r3,r2,-8
  2396. 41b98: 00bfff84 movi r2,-2
  2397. 41b9c: 2084703a and r2,r4,r2
  2398. 41ba0: 9885883a add r2,r19,r2
  2399. 41ba4: 1880ee26 beq r3,r2,41f60 <_realloc_r+0x490>
  2400. 41ba8: 81bfff04 addi r6,r16,-4
  2401. 41bac: 00800904 movi r2,36
  2402. 41bb0: 1180b836 bltu r2,r6,41e94 <_realloc_r+0x3c4>
  2403. 41bb4: 00c004c4 movi r3,19
  2404. 41bb8: 19809636 bltu r3,r6,41e14 <_realloc_r+0x344>
  2405. 41bbc: 9005883a mov r2,r18
  2406. 41bc0: a807883a mov r3,r21
  2407. 41bc4: 19000017 ldw r4,0(r3)
  2408. 41bc8: 11000015 stw r4,0(r2)
  2409. 41bcc: 19000117 ldw r4,4(r3)
  2410. 41bd0: 11000115 stw r4,4(r2)
  2411. 41bd4: 18c00217 ldw r3,8(r3)
  2412. 41bd8: 10c00215 stw r3,8(r2)
  2413. 41bdc: a80b883a mov r5,r21
  2414. 41be0: a009883a mov r4,r20
  2415. 41be4: 004289c0 call 4289c <_free_r>
  2416. 41be8: a009883a mov r4,r20
  2417. 41bec: 00436740 call 43674 <__malloc_unlock>
  2418. 41bf0: 9005883a mov r2,r18
  2419. 41bf4: 00001206 br 41c40 <_realloc_r+0x170>
  2420. 41bf8: 00c00404 movi r3,16
  2421. 41bfc: 1823883a mov r17,r3
  2422. 41c00: 003fce06 br 41b3c <_realloc_r+0x6c>
  2423. 41c04: a825883a mov r18,r21
  2424. 41c08: 8445c83a sub r2,r16,r17
  2425. 41c0c: 00c003c4 movi r3,15
  2426. 41c10: 18802636 bltu r3,r2,41cac <_realloc_r+0x1dc>
  2427. 41c14: 99800117 ldw r6,4(r19)
  2428. 41c18: 9c07883a add r3,r19,r16
  2429. 41c1c: 3180004c andi r6,r6,1
  2430. 41c20: 3420b03a or r16,r6,r16
  2431. 41c24: 9c000115 stw r16,4(r19)
  2432. 41c28: 18800117 ldw r2,4(r3)
  2433. 41c2c: 10800054 ori r2,r2,1
  2434. 41c30: 18800115 stw r2,4(r3)
  2435. 41c34: a009883a mov r4,r20
  2436. 41c38: 00436740 call 43674 <__malloc_unlock>
  2437. 41c3c: 9005883a mov r2,r18
  2438. 41c40: dfc00917 ldw ra,36(sp)
  2439. 41c44: df000817 ldw fp,32(sp)
  2440. 41c48: ddc00717 ldw r23,28(sp)
  2441. 41c4c: dd800617 ldw r22,24(sp)
  2442. 41c50: dd400517 ldw r21,20(sp)
  2443. 41c54: dd000417 ldw r20,16(sp)
  2444. 41c58: dcc00317 ldw r19,12(sp)
  2445. 41c5c: dc800217 ldw r18,8(sp)
  2446. 41c60: dc400117 ldw r17,4(sp)
  2447. 41c64: dc000017 ldw r16,0(sp)
  2448. 41c68: dec00a04 addi sp,sp,40
  2449. 41c6c: f800283a ret
  2450. 41c70: 017fff04 movi r5,-4
  2451. 41c74: 414a703a and r5,r8,r5
  2452. 41c78: 814d883a add r6,r16,r5
  2453. 41c7c: 30c01f16 blt r6,r3,41cfc <_realloc_r+0x22c>
  2454. 41c80: 20800317 ldw r2,12(r4)
  2455. 41c84: 20c00217 ldw r3,8(r4)
  2456. 41c88: a825883a mov r18,r21
  2457. 41c8c: 3021883a mov r16,r6
  2458. 41c90: 18800315 stw r2,12(r3)
  2459. 41c94: 10c00215 stw r3,8(r2)
  2460. 41c98: 003fdb06 br 41c08 <_realloc_r+0x138>
  2461. 41c9c: 00800304 movi r2,12
  2462. 41ca0: a0800015 stw r2,0(r20)
  2463. 41ca4: 0005883a mov r2,zero
  2464. 41ca8: 003fe506 br 41c40 <_realloc_r+0x170>
  2465. 41cac: 98c00117 ldw r3,4(r19)
  2466. 41cb0: 9c4b883a add r5,r19,r17
  2467. 41cb4: 11000054 ori r4,r2,1
  2468. 41cb8: 18c0004c andi r3,r3,1
  2469. 41cbc: 1c62b03a or r17,r3,r17
  2470. 41cc0: 9c400115 stw r17,4(r19)
  2471. 41cc4: 29000115 stw r4,4(r5)
  2472. 41cc8: 2885883a add r2,r5,r2
  2473. 41ccc: 10c00117 ldw r3,4(r2)
  2474. 41cd0: 29400204 addi r5,r5,8
  2475. 41cd4: a009883a mov r4,r20
  2476. 41cd8: 18c00054 ori r3,r3,1
  2477. 41cdc: 10c00115 stw r3,4(r2)
  2478. 41ce0: 004289c0 call 4289c <_free_r>
  2479. 41ce4: 003fd306 br 41c34 <_realloc_r+0x164>
  2480. 41ce8: 017fff04 movi r5,-4
  2481. 41cec: 414a703a and r5,r8,r5
  2482. 41cf0: 89800404 addi r6,r17,16
  2483. 41cf4: 8151883a add r8,r16,r5
  2484. 41cf8: 4180590e bge r8,r6,41e60 <_realloc_r+0x390>
  2485. 41cfc: 1080004c andi r2,r2,1
  2486. 41d00: 103f9e1e bne r2,zero,41b7c <_realloc_r+0xac>
  2487. 41d04: adbffe17 ldw r22,-8(r21)
  2488. 41d08: 00bfff04 movi r2,-4
  2489. 41d0c: 9dadc83a sub r22,r19,r22
  2490. 41d10: b1800117 ldw r6,4(r22)
  2491. 41d14: 3084703a and r2,r6,r2
  2492. 41d18: 20002026 beq r4,zero,41d9c <_realloc_r+0x2cc>
  2493. 41d1c: 80af883a add r23,r16,r2
  2494. 41d20: b96f883a add r23,r23,r5
  2495. 41d24: 21c05f26 beq r4,r7,41ea4 <_realloc_r+0x3d4>
  2496. 41d28: b8c01c16 blt r23,r3,41d9c <_realloc_r+0x2cc>
  2497. 41d2c: 20800317 ldw r2,12(r4)
  2498. 41d30: 20c00217 ldw r3,8(r4)
  2499. 41d34: 81bfff04 addi r6,r16,-4
  2500. 41d38: 01000904 movi r4,36
  2501. 41d3c: 18800315 stw r2,12(r3)
  2502. 41d40: 10c00215 stw r3,8(r2)
  2503. 41d44: b0c00217 ldw r3,8(r22)
  2504. 41d48: b0800317 ldw r2,12(r22)
  2505. 41d4c: b4800204 addi r18,r22,8
  2506. 41d50: 18800315 stw r2,12(r3)
  2507. 41d54: 10c00215 stw r3,8(r2)
  2508. 41d58: 21801b36 bltu r4,r6,41dc8 <_realloc_r+0x2f8>
  2509. 41d5c: 008004c4 movi r2,19
  2510. 41d60: 1180352e bgeu r2,r6,41e38 <_realloc_r+0x368>
  2511. 41d64: a8800017 ldw r2,0(r21)
  2512. 41d68: b0800215 stw r2,8(r22)
  2513. 41d6c: a8800117 ldw r2,4(r21)
  2514. 41d70: b0800315 stw r2,12(r22)
  2515. 41d74: 008006c4 movi r2,27
  2516. 41d78: 11807f36 bltu r2,r6,41f78 <_realloc_r+0x4a8>
  2517. 41d7c: b0800404 addi r2,r22,16
  2518. 41d80: ad400204 addi r21,r21,8
  2519. 41d84: 00002d06 br 41e3c <_realloc_r+0x36c>
  2520. 41d88: adbffe17 ldw r22,-8(r21)
  2521. 41d8c: 00bfff04 movi r2,-4
  2522. 41d90: 9dadc83a sub r22,r19,r22
  2523. 41d94: b1000117 ldw r4,4(r22)
  2524. 41d98: 2084703a and r2,r4,r2
  2525. 41d9c: b03f7726 beq r22,zero,41b7c <_realloc_r+0xac>
  2526. 41da0: 80af883a add r23,r16,r2
  2527. 41da4: b8ff7516 blt r23,r3,41b7c <_realloc_r+0xac>
  2528. 41da8: b0800317 ldw r2,12(r22)
  2529. 41dac: b0c00217 ldw r3,8(r22)
  2530. 41db0: 81bfff04 addi r6,r16,-4
  2531. 41db4: 01000904 movi r4,36
  2532. 41db8: 18800315 stw r2,12(r3)
  2533. 41dbc: 10c00215 stw r3,8(r2)
  2534. 41dc0: b4800204 addi r18,r22,8
  2535. 41dc4: 21bfe52e bgeu r4,r6,41d5c <_realloc_r+0x28c>
  2536. 41dc8: a80b883a mov r5,r21
  2537. 41dcc: 9009883a mov r4,r18
  2538. 41dd0: 004184c0 call 4184c <memmove>
  2539. 41dd4: b821883a mov r16,r23
  2540. 41dd8: b027883a mov r19,r22
  2541. 41ddc: 003f8a06 br 41c08 <_realloc_r+0x138>
  2542. 41de0: 300b883a mov r5,r6
  2543. 41de4: dfc00917 ldw ra,36(sp)
  2544. 41de8: df000817 ldw fp,32(sp)
  2545. 41dec: ddc00717 ldw r23,28(sp)
  2546. 41df0: dd800617 ldw r22,24(sp)
  2547. 41df4: dd400517 ldw r21,20(sp)
  2548. 41df8: dd000417 ldw r20,16(sp)
  2549. 41dfc: dcc00317 ldw r19,12(sp)
  2550. 41e00: dc800217 ldw r18,8(sp)
  2551. 41e04: dc400117 ldw r17,4(sp)
  2552. 41e08: dc000017 ldw r16,0(sp)
  2553. 41e0c: dec00a04 addi sp,sp,40
  2554. 41e10: 0040e141 jmpi 40e14 <_malloc_r>
  2555. 41e14: a8c00017 ldw r3,0(r21)
  2556. 41e18: 90c00015 stw r3,0(r18)
  2557. 41e1c: a8c00117 ldw r3,4(r21)
  2558. 41e20: 90c00115 stw r3,4(r18)
  2559. 41e24: 00c006c4 movi r3,27
  2560. 41e28: 19804536 bltu r3,r6,41f40 <_realloc_r+0x470>
  2561. 41e2c: 90800204 addi r2,r18,8
  2562. 41e30: a8c00204 addi r3,r21,8
  2563. 41e34: 003f6306 br 41bc4 <_realloc_r+0xf4>
  2564. 41e38: 9005883a mov r2,r18
  2565. 41e3c: a8c00017 ldw r3,0(r21)
  2566. 41e40: b821883a mov r16,r23
  2567. 41e44: b027883a mov r19,r22
  2568. 41e48: 10c00015 stw r3,0(r2)
  2569. 41e4c: a8c00117 ldw r3,4(r21)
  2570. 41e50: 10c00115 stw r3,4(r2)
  2571. 41e54: a8c00217 ldw r3,8(r21)
  2572. 41e58: 10c00215 stw r3,8(r2)
  2573. 41e5c: 003f6a06 br 41c08 <_realloc_r+0x138>
  2574. 41e60: 9c67883a add r19,r19,r17
  2575. 41e64: 4445c83a sub r2,r8,r17
  2576. 41e68: e4c00215 stw r19,8(fp)
  2577. 41e6c: 10800054 ori r2,r2,1
  2578. 41e70: 98800115 stw r2,4(r19)
  2579. 41e74: a8bfff17 ldw r2,-4(r21)
  2580. 41e78: a009883a mov r4,r20
  2581. 41e7c: 1080004c andi r2,r2,1
  2582. 41e80: 1462b03a or r17,r2,r17
  2583. 41e84: ac7fff15 stw r17,-4(r21)
  2584. 41e88: 00436740 call 43674 <__malloc_unlock>
  2585. 41e8c: a805883a mov r2,r21
  2586. 41e90: 003f6b06 br 41c40 <_realloc_r+0x170>
  2587. 41e94: a80b883a mov r5,r21
  2588. 41e98: 9009883a mov r4,r18
  2589. 41e9c: 004184c0 call 4184c <memmove>
  2590. 41ea0: 003f4e06 br 41bdc <_realloc_r+0x10c>
  2591. 41ea4: 89000404 addi r4,r17,16
  2592. 41ea8: b93fbc16 blt r23,r4,41d9c <_realloc_r+0x2cc>
  2593. 41eac: b0800317 ldw r2,12(r22)
  2594. 41eb0: b0c00217 ldw r3,8(r22)
  2595. 41eb4: 81bfff04 addi r6,r16,-4
  2596. 41eb8: 01000904 movi r4,36
  2597. 41ebc: 18800315 stw r2,12(r3)
  2598. 41ec0: 10c00215 stw r3,8(r2)
  2599. 41ec4: b4800204 addi r18,r22,8
  2600. 41ec8: 21804336 bltu r4,r6,41fd8 <_realloc_r+0x508>
  2601. 41ecc: 008004c4 movi r2,19
  2602. 41ed0: 11803f2e bgeu r2,r6,41fd0 <_realloc_r+0x500>
  2603. 41ed4: a8800017 ldw r2,0(r21)
  2604. 41ed8: b0800215 stw r2,8(r22)
  2605. 41edc: a8800117 ldw r2,4(r21)
  2606. 41ee0: b0800315 stw r2,12(r22)
  2607. 41ee4: 008006c4 movi r2,27
  2608. 41ee8: 11803f36 bltu r2,r6,41fe8 <_realloc_r+0x518>
  2609. 41eec: b0800404 addi r2,r22,16
  2610. 41ef0: ad400204 addi r21,r21,8
  2611. 41ef4: a8c00017 ldw r3,0(r21)
  2612. 41ef8: 10c00015 stw r3,0(r2)
  2613. 41efc: a8c00117 ldw r3,4(r21)
  2614. 41f00: 10c00115 stw r3,4(r2)
  2615. 41f04: a8c00217 ldw r3,8(r21)
  2616. 41f08: 10c00215 stw r3,8(r2)
  2617. 41f0c: b447883a add r3,r22,r17
  2618. 41f10: bc45c83a sub r2,r23,r17
  2619. 41f14: e0c00215 stw r3,8(fp)
  2620. 41f18: 10800054 ori r2,r2,1
  2621. 41f1c: 18800115 stw r2,4(r3)
  2622. 41f20: b0800117 ldw r2,4(r22)
  2623. 41f24: a009883a mov r4,r20
  2624. 41f28: 1080004c andi r2,r2,1
  2625. 41f2c: 1462b03a or r17,r2,r17
  2626. 41f30: b4400115 stw r17,4(r22)
  2627. 41f34: 00436740 call 43674 <__malloc_unlock>
  2628. 41f38: 9005883a mov r2,r18
  2629. 41f3c: 003f4006 br 41c40 <_realloc_r+0x170>
  2630. 41f40: a8c00217 ldw r3,8(r21)
  2631. 41f44: 90c00215 stw r3,8(r18)
  2632. 41f48: a8c00317 ldw r3,12(r21)
  2633. 41f4c: 90c00315 stw r3,12(r18)
  2634. 41f50: 30801126 beq r6,r2,41f98 <_realloc_r+0x4c8>
  2635. 41f54: 90800404 addi r2,r18,16
  2636. 41f58: a8c00404 addi r3,r21,16
  2637. 41f5c: 003f1906 br 41bc4 <_realloc_r+0xf4>
  2638. 41f60: 90ffff17 ldw r3,-4(r18)
  2639. 41f64: 00bfff04 movi r2,-4
  2640. 41f68: a825883a mov r18,r21
  2641. 41f6c: 1884703a and r2,r3,r2
  2642. 41f70: 80a1883a add r16,r16,r2
  2643. 41f74: 003f2406 br 41c08 <_realloc_r+0x138>
  2644. 41f78: a8800217 ldw r2,8(r21)
  2645. 41f7c: b0800415 stw r2,16(r22)
  2646. 41f80: a8800317 ldw r2,12(r21)
  2647. 41f84: b0800515 stw r2,20(r22)
  2648. 41f88: 31000a26 beq r6,r4,41fb4 <_realloc_r+0x4e4>
  2649. 41f8c: b0800604 addi r2,r22,24
  2650. 41f90: ad400404 addi r21,r21,16
  2651. 41f94: 003fa906 br 41e3c <_realloc_r+0x36c>
  2652. 41f98: a9000417 ldw r4,16(r21)
  2653. 41f9c: 90800604 addi r2,r18,24
  2654. 41fa0: a8c00604 addi r3,r21,24
  2655. 41fa4: 91000415 stw r4,16(r18)
  2656. 41fa8: a9000517 ldw r4,20(r21)
  2657. 41fac: 91000515 stw r4,20(r18)
  2658. 41fb0: 003f0406 br 41bc4 <_realloc_r+0xf4>
  2659. 41fb4: a8c00417 ldw r3,16(r21)
  2660. 41fb8: ad400604 addi r21,r21,24
  2661. 41fbc: b0800804 addi r2,r22,32
  2662. 41fc0: b0c00615 stw r3,24(r22)
  2663. 41fc4: a8ffff17 ldw r3,-4(r21)
  2664. 41fc8: b0c00715 stw r3,28(r22)
  2665. 41fcc: 003f9b06 br 41e3c <_realloc_r+0x36c>
  2666. 41fd0: 9005883a mov r2,r18
  2667. 41fd4: 003fc706 br 41ef4 <_realloc_r+0x424>
  2668. 41fd8: a80b883a mov r5,r21
  2669. 41fdc: 9009883a mov r4,r18
  2670. 41fe0: 004184c0 call 4184c <memmove>
  2671. 41fe4: 003fc906 br 41f0c <_realloc_r+0x43c>
  2672. 41fe8: a8800217 ldw r2,8(r21)
  2673. 41fec: b0800415 stw r2,16(r22)
  2674. 41ff0: a8800317 ldw r2,12(r21)
  2675. 41ff4: b0800515 stw r2,20(r22)
  2676. 41ff8: 31000726 beq r6,r4,42018 <_realloc_r+0x548>
  2677. 41ffc: b0800604 addi r2,r22,24
  2678. 42000: ad400404 addi r21,r21,16
  2679. 42004: 003fbb06 br 41ef4 <_realloc_r+0x424>
  2680. 42008: a009883a mov r4,r20
  2681. 4200c: 00436740 call 43674 <__malloc_unlock>
  2682. 42010: 0005883a mov r2,zero
  2683. 42014: 003f0a06 br 41c40 <_realloc_r+0x170>
  2684. 42018: a8c00417 ldw r3,16(r21)
  2685. 4201c: ad400604 addi r21,r21,24
  2686. 42020: b0800804 addi r2,r22,32
  2687. 42024: b0c00615 stw r3,24(r22)
  2688. 42028: a8ffff17 ldw r3,-4(r21)
  2689. 4202c: b0c00715 stw r3,28(r22)
  2690. 42030: 003fb006 br 41ef4 <_realloc_r+0x424>
  2691. 00042034 <_sbrk_r>:
  2692. 42034: defffd04 addi sp,sp,-12
  2693. 42038: dc000015 stw r16,0(sp)
  2694. 4203c: 04000174 movhi r16,5
  2695. 42040: dc400115 stw r17,4(sp)
  2696. 42044: 84231d04 addi r16,r16,-29580
  2697. 42048: 2023883a mov r17,r4
  2698. 4204c: 2809883a mov r4,r5
  2699. 42050: dfc00215 stw ra,8(sp)
  2700. 42054: 80000015 stw zero,0(r16)
  2701. 42058: 004385c0 call 4385c <sbrk>
  2702. 4205c: 00ffffc4 movi r3,-1
  2703. 42060: 10c00526 beq r2,r3,42078 <_sbrk_r+0x44>
  2704. 42064: dfc00217 ldw ra,8(sp)
  2705. 42068: dc400117 ldw r17,4(sp)
  2706. 4206c: dc000017 ldw r16,0(sp)
  2707. 42070: dec00304 addi sp,sp,12
  2708. 42074: f800283a ret
  2709. 42078: 80c00017 ldw r3,0(r16)
  2710. 4207c: 183ff926 beq r3,zero,42064 <_sbrk_r+0x30>
  2711. 42080: 88c00015 stw r3,0(r17)
  2712. 42084: 003ff706 br 42064 <_sbrk_r+0x30>
  2713. 00042088 <__sread>:
  2714. 42088: defffe04 addi sp,sp,-8
  2715. 4208c: dc000015 stw r16,0(sp)
  2716. 42090: 2821883a mov r16,r5
  2717. 42094: 2940038f ldh r5,14(r5)
  2718. 42098: dfc00115 stw ra,4(sp)
  2719. 4209c: 0042dc80 call 42dc8 <_read_r>
  2720. 420a0: 10000716 blt r2,zero,420c0 <__sread+0x38>
  2721. 420a4: 80c01417 ldw r3,80(r16)
  2722. 420a8: 1887883a add r3,r3,r2
  2723. 420ac: 80c01415 stw r3,80(r16)
  2724. 420b0: dfc00117 ldw ra,4(sp)
  2725. 420b4: dc000017 ldw r16,0(sp)
  2726. 420b8: dec00204 addi sp,sp,8
  2727. 420bc: f800283a ret
  2728. 420c0: 80c0030b ldhu r3,12(r16)
  2729. 420c4: 18fbffcc andi r3,r3,61439
  2730. 420c8: 80c0030d sth r3,12(r16)
  2731. 420cc: dfc00117 ldw ra,4(sp)
  2732. 420d0: dc000017 ldw r16,0(sp)
  2733. 420d4: dec00204 addi sp,sp,8
  2734. 420d8: f800283a ret
  2735. 000420dc <__seofread>:
  2736. 420dc: 0005883a mov r2,zero
  2737. 420e0: f800283a ret
  2738. 000420e4 <__swrite>:
  2739. 420e4: 2880030b ldhu r2,12(r5)
  2740. 420e8: defffb04 addi sp,sp,-20
  2741. 420ec: dcc00315 stw r19,12(sp)
  2742. 420f0: dc800215 stw r18,8(sp)
  2743. 420f4: dc400115 stw r17,4(sp)
  2744. 420f8: dc000015 stw r16,0(sp)
  2745. 420fc: dfc00415 stw ra,16(sp)
  2746. 42100: 10c0400c andi r3,r2,256
  2747. 42104: 2821883a mov r16,r5
  2748. 42108: 2023883a mov r17,r4
  2749. 4210c: 3025883a mov r18,r6
  2750. 42110: 3827883a mov r19,r7
  2751. 42114: 18000526 beq r3,zero,4212c <__swrite+0x48>
  2752. 42118: 2940038f ldh r5,14(r5)
  2753. 4211c: 01c00084 movi r7,2
  2754. 42120: 000d883a mov r6,zero
  2755. 42124: 0042bac0 call 42bac <_lseek_r>
  2756. 42128: 8080030b ldhu r2,12(r16)
  2757. 4212c: 8140038f ldh r5,14(r16)
  2758. 42130: 10bbffcc andi r2,r2,61439
  2759. 42134: 980f883a mov r7,r19
  2760. 42138: 900d883a mov r6,r18
  2761. 4213c: 8809883a mov r4,r17
  2762. 42140: 8080030d sth r2,12(r16)
  2763. 42144: dfc00417 ldw ra,16(sp)
  2764. 42148: dcc00317 ldw r19,12(sp)
  2765. 4214c: dc800217 ldw r18,8(sp)
  2766. 42150: dc400117 ldw r17,4(sp)
  2767. 42154: dc000017 ldw r16,0(sp)
  2768. 42158: dec00504 addi sp,sp,20
  2769. 4215c: 00421c41 jmpi 421c4 <_write_r>
  2770. 00042160 <__sseek>:
  2771. 42160: defffe04 addi sp,sp,-8
  2772. 42164: dc000015 stw r16,0(sp)
  2773. 42168: 2821883a mov r16,r5
  2774. 4216c: 2940038f ldh r5,14(r5)
  2775. 42170: dfc00115 stw ra,4(sp)
  2776. 42174: 0042bac0 call 42bac <_lseek_r>
  2777. 42178: 00ffffc4 movi r3,-1
  2778. 4217c: 10c00826 beq r2,r3,421a0 <__sseek+0x40>
  2779. 42180: 80c0030b ldhu r3,12(r16)
  2780. 42184: 80801415 stw r2,80(r16)
  2781. 42188: 18c40014 ori r3,r3,4096
  2782. 4218c: 80c0030d sth r3,12(r16)
  2783. 42190: dfc00117 ldw ra,4(sp)
  2784. 42194: dc000017 ldw r16,0(sp)
  2785. 42198: dec00204 addi sp,sp,8
  2786. 4219c: f800283a ret
  2787. 421a0: 80c0030b ldhu r3,12(r16)
  2788. 421a4: 18fbffcc andi r3,r3,61439
  2789. 421a8: 80c0030d sth r3,12(r16)
  2790. 421ac: dfc00117 ldw ra,4(sp)
  2791. 421b0: dc000017 ldw r16,0(sp)
  2792. 421b4: dec00204 addi sp,sp,8
  2793. 421b8: f800283a ret
  2794. 000421bc <__sclose>:
  2795. 421bc: 2940038f ldh r5,14(r5)
  2796. 421c0: 00423781 jmpi 42378 <_close_r>
  2797. 000421c4 <_write_r>:
  2798. 421c4: defffd04 addi sp,sp,-12
  2799. 421c8: 2805883a mov r2,r5
  2800. 421cc: dc000015 stw r16,0(sp)
  2801. 421d0: 04000174 movhi r16,5
  2802. 421d4: dc400115 stw r17,4(sp)
  2803. 421d8: 300b883a mov r5,r6
  2804. 421dc: 84231d04 addi r16,r16,-29580
  2805. 421e0: 2023883a mov r17,r4
  2806. 421e4: 380d883a mov r6,r7
  2807. 421e8: 1009883a mov r4,r2
  2808. 421ec: dfc00215 stw ra,8(sp)
  2809. 421f0: 80000015 stw zero,0(r16)
  2810. 421f4: 00439480 call 43948 <write>
  2811. 421f8: 00ffffc4 movi r3,-1
  2812. 421fc: 10c00526 beq r2,r3,42214 <_write_r+0x50>
  2813. 42200: dfc00217 ldw ra,8(sp)
  2814. 42204: dc400117 ldw r17,4(sp)
  2815. 42208: dc000017 ldw r16,0(sp)
  2816. 4220c: dec00304 addi sp,sp,12
  2817. 42210: f800283a ret
  2818. 42214: 80c00017 ldw r3,0(r16)
  2819. 42218: 183ff926 beq r3,zero,42200 <_write_r+0x3c>
  2820. 4221c: 88c00015 stw r3,0(r17)
  2821. 42220: 003ff706 br 42200 <_write_r+0x3c>
  2822. 00042224 <__swsetup_r>:
  2823. 42224: 00800134 movhi r2,4
  2824. 42228: defffd04 addi sp,sp,-12
  2825. 4222c: 109c7204 addi r2,r2,29128
  2826. 42230: dc400115 stw r17,4(sp)
  2827. 42234: 2023883a mov r17,r4
  2828. 42238: 11000017 ldw r4,0(r2)
  2829. 4223c: dc000015 stw r16,0(sp)
  2830. 42240: dfc00215 stw ra,8(sp)
  2831. 42244: 2821883a mov r16,r5
  2832. 42248: 20000226 beq r4,zero,42254 <__swsetup_r+0x30>
  2833. 4224c: 20800e17 ldw r2,56(r4)
  2834. 42250: 10003126 beq r2,zero,42318 <__swsetup_r+0xf4>
  2835. 42254: 8080030b ldhu r2,12(r16)
  2836. 42258: 10c0020c andi r3,r2,8
  2837. 4225c: 1009883a mov r4,r2
  2838. 42260: 18000f26 beq r3,zero,422a0 <__swsetup_r+0x7c>
  2839. 42264: 80c00417 ldw r3,16(r16)
  2840. 42268: 18001526 beq r3,zero,422c0 <__swsetup_r+0x9c>
  2841. 4226c: 1100004c andi r4,r2,1
  2842. 42270: 20001c1e bne r4,zero,422e4 <__swsetup_r+0xc0>
  2843. 42274: 1080008c andi r2,r2,2
  2844. 42278: 1000291e bne r2,zero,42320 <__swsetup_r+0xfc>
  2845. 4227c: 80800517 ldw r2,20(r16)
  2846. 42280: 80800215 stw r2,8(r16)
  2847. 42284: 18001c26 beq r3,zero,422f8 <__swsetup_r+0xd4>
  2848. 42288: 0005883a mov r2,zero
  2849. 4228c: dfc00217 ldw ra,8(sp)
  2850. 42290: dc400117 ldw r17,4(sp)
  2851. 42294: dc000017 ldw r16,0(sp)
  2852. 42298: dec00304 addi sp,sp,12
  2853. 4229c: f800283a ret
  2854. 422a0: 2080040c andi r2,r4,16
  2855. 422a4: 10002e26 beq r2,zero,42360 <__swsetup_r+0x13c>
  2856. 422a8: 2080010c andi r2,r4,4
  2857. 422ac: 10001e1e bne r2,zero,42328 <__swsetup_r+0x104>
  2858. 422b0: 80c00417 ldw r3,16(r16)
  2859. 422b4: 20800214 ori r2,r4,8
  2860. 422b8: 8080030d sth r2,12(r16)
  2861. 422bc: 183feb1e bne r3,zero,4226c <__swsetup_r+0x48>
  2862. 422c0: 1100a00c andi r4,r2,640
  2863. 422c4: 01408004 movi r5,512
  2864. 422c8: 217fe826 beq r4,r5,4226c <__swsetup_r+0x48>
  2865. 422cc: 800b883a mov r5,r16
  2866. 422d0: 8809883a mov r4,r17
  2867. 422d4: 0042c0c0 call 42c0c <__smakebuf_r>
  2868. 422d8: 8080030b ldhu r2,12(r16)
  2869. 422dc: 80c00417 ldw r3,16(r16)
  2870. 422e0: 003fe206 br 4226c <__swsetup_r+0x48>
  2871. 422e4: 80800517 ldw r2,20(r16)
  2872. 422e8: 80000215 stw zero,8(r16)
  2873. 422ec: 0085c83a sub r2,zero,r2
  2874. 422f0: 80800615 stw r2,24(r16)
  2875. 422f4: 183fe41e bne r3,zero,42288 <__swsetup_r+0x64>
  2876. 422f8: 80c0030b ldhu r3,12(r16)
  2877. 422fc: 0005883a mov r2,zero
  2878. 42300: 1900200c andi r4,r3,128
  2879. 42304: 203fe126 beq r4,zero,4228c <__swsetup_r+0x68>
  2880. 42308: 18c01014 ori r3,r3,64
  2881. 4230c: 80c0030d sth r3,12(r16)
  2882. 42310: 00bfffc4 movi r2,-1
  2883. 42314: 003fdd06 br 4228c <__swsetup_r+0x68>
  2884. 42318: 00407740 call 40774 <__sinit>
  2885. 4231c: 003fcd06 br 42254 <__swsetup_r+0x30>
  2886. 42320: 0005883a mov r2,zero
  2887. 42324: 003fd606 br 42280 <__swsetup_r+0x5c>
  2888. 42328: 81400c17 ldw r5,48(r16)
  2889. 4232c: 28000626 beq r5,zero,42348 <__swsetup_r+0x124>
  2890. 42330: 80801004 addi r2,r16,64
  2891. 42334: 28800326 beq r5,r2,42344 <__swsetup_r+0x120>
  2892. 42338: 8809883a mov r4,r17
  2893. 4233c: 004289c0 call 4289c <_free_r>
  2894. 42340: 8100030b ldhu r4,12(r16)
  2895. 42344: 80000c15 stw zero,48(r16)
  2896. 42348: 80c00417 ldw r3,16(r16)
  2897. 4234c: 00bff6c4 movi r2,-37
  2898. 42350: 1108703a and r4,r2,r4
  2899. 42354: 80000115 stw zero,4(r16)
  2900. 42358: 80c00015 stw r3,0(r16)
  2901. 4235c: 003fd506 br 422b4 <__swsetup_r+0x90>
  2902. 42360: 00800244 movi r2,9
  2903. 42364: 88800015 stw r2,0(r17)
  2904. 42368: 20801014 ori r2,r4,64
  2905. 4236c: 8080030d sth r2,12(r16)
  2906. 42370: 00bfffc4 movi r2,-1
  2907. 42374: 003fc506 br 4228c <__swsetup_r+0x68>
  2908. 00042378 <_close_r>:
  2909. 42378: defffd04 addi sp,sp,-12
  2910. 4237c: dc000015 stw r16,0(sp)
  2911. 42380: 04000174 movhi r16,5
  2912. 42384: dc400115 stw r17,4(sp)
  2913. 42388: 84231d04 addi r16,r16,-29580
  2914. 4238c: 2023883a mov r17,r4
  2915. 42390: 2809883a mov r4,r5
  2916. 42394: dfc00215 stw ra,8(sp)
  2917. 42398: 80000015 stw zero,0(r16)
  2918. 4239c: 00430f00 call 430f0 <close>
  2919. 423a0: 00ffffc4 movi r3,-1
  2920. 423a4: 10c00526 beq r2,r3,423bc <_close_r+0x44>
  2921. 423a8: dfc00217 ldw ra,8(sp)
  2922. 423ac: dc400117 ldw r17,4(sp)
  2923. 423b0: dc000017 ldw r16,0(sp)
  2924. 423b4: dec00304 addi sp,sp,12
  2925. 423b8: f800283a ret
  2926. 423bc: 80c00017 ldw r3,0(r16)
  2927. 423c0: 183ff926 beq r3,zero,423a8 <_close_r+0x30>
  2928. 423c4: 88c00015 stw r3,0(r17)
  2929. 423c8: 003ff706 br 423a8 <_close_r+0x30>
  2930. 000423cc <_fclose_r>:
  2931. 423cc: 28003926 beq r5,zero,424b4 <_fclose_r+0xe8>
  2932. 423d0: defffc04 addi sp,sp,-16
  2933. 423d4: dc400115 stw r17,4(sp)
  2934. 423d8: dc000015 stw r16,0(sp)
  2935. 423dc: dfc00315 stw ra,12(sp)
  2936. 423e0: dc800215 stw r18,8(sp)
  2937. 423e4: 2023883a mov r17,r4
  2938. 423e8: 2821883a mov r16,r5
  2939. 423ec: 20000226 beq r4,zero,423f8 <_fclose_r+0x2c>
  2940. 423f0: 20800e17 ldw r2,56(r4)
  2941. 423f4: 10002726 beq r2,zero,42494 <_fclose_r+0xc8>
  2942. 423f8: 8080030f ldh r2,12(r16)
  2943. 423fc: 1000071e bne r2,zero,4241c <_fclose_r+0x50>
  2944. 42400: 0005883a mov r2,zero
  2945. 42404: dfc00317 ldw ra,12(sp)
  2946. 42408: dc800217 ldw r18,8(sp)
  2947. 4240c: dc400117 ldw r17,4(sp)
  2948. 42410: dc000017 ldw r16,0(sp)
  2949. 42414: dec00404 addi sp,sp,16
  2950. 42418: f800283a ret
  2951. 4241c: 800b883a mov r5,r16
  2952. 42420: 8809883a mov r4,r17
  2953. 42424: 00424d00 call 424d0 <__sflush_r>
  2954. 42428: 1025883a mov r18,r2
  2955. 4242c: 80800b17 ldw r2,44(r16)
  2956. 42430: 10000426 beq r2,zero,42444 <_fclose_r+0x78>
  2957. 42434: 81400717 ldw r5,28(r16)
  2958. 42438: 8809883a mov r4,r17
  2959. 4243c: 103ee83a callr r2
  2960. 42440: 10001616 blt r2,zero,4249c <_fclose_r+0xd0>
  2961. 42444: 8080030b ldhu r2,12(r16)
  2962. 42448: 1080200c andi r2,r2,128
  2963. 4244c: 1000151e bne r2,zero,424a4 <_fclose_r+0xd8>
  2964. 42450: 81400c17 ldw r5,48(r16)
  2965. 42454: 28000526 beq r5,zero,4246c <_fclose_r+0xa0>
  2966. 42458: 80801004 addi r2,r16,64
  2967. 4245c: 28800226 beq r5,r2,42468 <_fclose_r+0x9c>
  2968. 42460: 8809883a mov r4,r17
  2969. 42464: 004289c0 call 4289c <_free_r>
  2970. 42468: 80000c15 stw zero,48(r16)
  2971. 4246c: 81401117 ldw r5,68(r16)
  2972. 42470: 28000326 beq r5,zero,42480 <_fclose_r+0xb4>
  2973. 42474: 8809883a mov r4,r17
  2974. 42478: 004289c0 call 4289c <_free_r>
  2975. 4247c: 80001115 stw zero,68(r16)
  2976. 42480: 00407840 call 40784 <__sfp_lock_acquire>
  2977. 42484: 8000030d sth zero,12(r16)
  2978. 42488: 00407880 call 40788 <__sfp_lock_release>
  2979. 4248c: 9005883a mov r2,r18
  2980. 42490: 003fdc06 br 42404 <_fclose_r+0x38>
  2981. 42494: 00407740 call 40774 <__sinit>
  2982. 42498: 003fd706 br 423f8 <_fclose_r+0x2c>
  2983. 4249c: 04bfffc4 movi r18,-1
  2984. 424a0: 003fe806 br 42444 <_fclose_r+0x78>
  2985. 424a4: 81400417 ldw r5,16(r16)
  2986. 424a8: 8809883a mov r4,r17
  2987. 424ac: 004289c0 call 4289c <_free_r>
  2988. 424b0: 003fe706 br 42450 <_fclose_r+0x84>
  2989. 424b4: 0005883a mov r2,zero
  2990. 424b8: f800283a ret
  2991. 000424bc <fclose>:
  2992. 424bc: 00800134 movhi r2,4
  2993. 424c0: 109c7204 addi r2,r2,29128
  2994. 424c4: 200b883a mov r5,r4
  2995. 424c8: 11000017 ldw r4,0(r2)
  2996. 424cc: 00423cc1 jmpi 423cc <_fclose_r>
  2997. 000424d0 <__sflush_r>:
  2998. 424d0: 2880030b ldhu r2,12(r5)
  2999. 424d4: defffb04 addi sp,sp,-20
  3000. 424d8: dcc00315 stw r19,12(sp)
  3001. 424dc: dc400115 stw r17,4(sp)
  3002. 424e0: dfc00415 stw ra,16(sp)
  3003. 424e4: dc800215 stw r18,8(sp)
  3004. 424e8: dc000015 stw r16,0(sp)
  3005. 424ec: 10c0020c andi r3,r2,8
  3006. 424f0: 2823883a mov r17,r5
  3007. 424f4: 2027883a mov r19,r4
  3008. 424f8: 1800311e bne r3,zero,425c0 <__sflush_r+0xf0>
  3009. 424fc: 28c00117 ldw r3,4(r5)
  3010. 42500: 10820014 ori r2,r2,2048
  3011. 42504: 2880030d sth r2,12(r5)
  3012. 42508: 00c04b0e bge zero,r3,42638 <__sflush_r+0x168>
  3013. 4250c: 8a000a17 ldw r8,40(r17)
  3014. 42510: 40002326 beq r8,zero,425a0 <__sflush_r+0xd0>
  3015. 42514: 9c000017 ldw r16,0(r19)
  3016. 42518: 10c4000c andi r3,r2,4096
  3017. 4251c: 98000015 stw zero,0(r19)
  3018. 42520: 18004826 beq r3,zero,42644 <__sflush_r+0x174>
  3019. 42524: 89801417 ldw r6,80(r17)
  3020. 42528: 10c0010c andi r3,r2,4
  3021. 4252c: 18000626 beq r3,zero,42548 <__sflush_r+0x78>
  3022. 42530: 88c00117 ldw r3,4(r17)
  3023. 42534: 88800c17 ldw r2,48(r17)
  3024. 42538: 30cdc83a sub r6,r6,r3
  3025. 4253c: 10000226 beq r2,zero,42548 <__sflush_r+0x78>
  3026. 42540: 88800f17 ldw r2,60(r17)
  3027. 42544: 308dc83a sub r6,r6,r2
  3028. 42548: 89400717 ldw r5,28(r17)
  3029. 4254c: 000f883a mov r7,zero
  3030. 42550: 9809883a mov r4,r19
  3031. 42554: 403ee83a callr r8
  3032. 42558: 00ffffc4 movi r3,-1
  3033. 4255c: 10c04426 beq r2,r3,42670 <__sflush_r+0x1a0>
  3034. 42560: 88c0030b ldhu r3,12(r17)
  3035. 42564: 89000417 ldw r4,16(r17)
  3036. 42568: 88000115 stw zero,4(r17)
  3037. 4256c: 197dffcc andi r5,r3,63487
  3038. 42570: 8940030d sth r5,12(r17)
  3039. 42574: 89000015 stw r4,0(r17)
  3040. 42578: 18c4000c andi r3,r3,4096
  3041. 4257c: 18002c1e bne r3,zero,42630 <__sflush_r+0x160>
  3042. 42580: 89400c17 ldw r5,48(r17)
  3043. 42584: 9c000015 stw r16,0(r19)
  3044. 42588: 28000526 beq r5,zero,425a0 <__sflush_r+0xd0>
  3045. 4258c: 88801004 addi r2,r17,64
  3046. 42590: 28800226 beq r5,r2,4259c <__sflush_r+0xcc>
  3047. 42594: 9809883a mov r4,r19
  3048. 42598: 004289c0 call 4289c <_free_r>
  3049. 4259c: 88000c15 stw zero,48(r17)
  3050. 425a0: 0005883a mov r2,zero
  3051. 425a4: dfc00417 ldw ra,16(sp)
  3052. 425a8: dcc00317 ldw r19,12(sp)
  3053. 425ac: dc800217 ldw r18,8(sp)
  3054. 425b0: dc400117 ldw r17,4(sp)
  3055. 425b4: dc000017 ldw r16,0(sp)
  3056. 425b8: dec00504 addi sp,sp,20
  3057. 425bc: f800283a ret
  3058. 425c0: 2c800417 ldw r18,16(r5)
  3059. 425c4: 903ff626 beq r18,zero,425a0 <__sflush_r+0xd0>
  3060. 425c8: 2c000017 ldw r16,0(r5)
  3061. 425cc: 108000cc andi r2,r2,3
  3062. 425d0: 2c800015 stw r18,0(r5)
  3063. 425d4: 84a1c83a sub r16,r16,r18
  3064. 425d8: 1000131e bne r2,zero,42628 <__sflush_r+0x158>
  3065. 425dc: 28800517 ldw r2,20(r5)
  3066. 425e0: 88800215 stw r2,8(r17)
  3067. 425e4: 04000316 blt zero,r16,425f4 <__sflush_r+0x124>
  3068. 425e8: 003fed06 br 425a0 <__sflush_r+0xd0>
  3069. 425ec: 90a5883a add r18,r18,r2
  3070. 425f0: 043feb0e bge zero,r16,425a0 <__sflush_r+0xd0>
  3071. 425f4: 88800917 ldw r2,36(r17)
  3072. 425f8: 89400717 ldw r5,28(r17)
  3073. 425fc: 800f883a mov r7,r16
  3074. 42600: 900d883a mov r6,r18
  3075. 42604: 9809883a mov r4,r19
  3076. 42608: 103ee83a callr r2
  3077. 4260c: 80a1c83a sub r16,r16,r2
  3078. 42610: 00bff616 blt zero,r2,425ec <__sflush_r+0x11c>
  3079. 42614: 88c0030b ldhu r3,12(r17)
  3080. 42618: 00bfffc4 movi r2,-1
  3081. 4261c: 18c01014 ori r3,r3,64
  3082. 42620: 88c0030d sth r3,12(r17)
  3083. 42624: 003fdf06 br 425a4 <__sflush_r+0xd4>
  3084. 42628: 0005883a mov r2,zero
  3085. 4262c: 003fec06 br 425e0 <__sflush_r+0x110>
  3086. 42630: 88801415 stw r2,80(r17)
  3087. 42634: 003fd206 br 42580 <__sflush_r+0xb0>
  3088. 42638: 28c00f17 ldw r3,60(r5)
  3089. 4263c: 00ffb316 blt zero,r3,4250c <__sflush_r+0x3c>
  3090. 42640: 003fd706 br 425a0 <__sflush_r+0xd0>
  3091. 42644: 89400717 ldw r5,28(r17)
  3092. 42648: 000d883a mov r6,zero
  3093. 4264c: 01c00044 movi r7,1
  3094. 42650: 9809883a mov r4,r19
  3095. 42654: 403ee83a callr r8
  3096. 42658: 100d883a mov r6,r2
  3097. 4265c: 00bfffc4 movi r2,-1
  3098. 42660: 30801426 beq r6,r2,426b4 <__sflush_r+0x1e4>
  3099. 42664: 8880030b ldhu r2,12(r17)
  3100. 42668: 8a000a17 ldw r8,40(r17)
  3101. 4266c: 003fae06 br 42528 <__sflush_r+0x58>
  3102. 42670: 98c00017 ldw r3,0(r19)
  3103. 42674: 183fba26 beq r3,zero,42560 <__sflush_r+0x90>
  3104. 42678: 01000744 movi r4,29
  3105. 4267c: 19000626 beq r3,r4,42698 <__sflush_r+0x1c8>
  3106. 42680: 01000584 movi r4,22
  3107. 42684: 19000426 beq r3,r4,42698 <__sflush_r+0x1c8>
  3108. 42688: 88c0030b ldhu r3,12(r17)
  3109. 4268c: 18c01014 ori r3,r3,64
  3110. 42690: 88c0030d sth r3,12(r17)
  3111. 42694: 003fc306 br 425a4 <__sflush_r+0xd4>
  3112. 42698: 8880030b ldhu r2,12(r17)
  3113. 4269c: 88c00417 ldw r3,16(r17)
  3114. 426a0: 88000115 stw zero,4(r17)
  3115. 426a4: 10bdffcc andi r2,r2,63487
  3116. 426a8: 8880030d sth r2,12(r17)
  3117. 426ac: 88c00015 stw r3,0(r17)
  3118. 426b0: 003fb306 br 42580 <__sflush_r+0xb0>
  3119. 426b4: 98800017 ldw r2,0(r19)
  3120. 426b8: 103fea26 beq r2,zero,42664 <__sflush_r+0x194>
  3121. 426bc: 00c00744 movi r3,29
  3122. 426c0: 10c00226 beq r2,r3,426cc <__sflush_r+0x1fc>
  3123. 426c4: 00c00584 movi r3,22
  3124. 426c8: 10c0031e bne r2,r3,426d8 <__sflush_r+0x208>
  3125. 426cc: 9c000015 stw r16,0(r19)
  3126. 426d0: 0005883a mov r2,zero
  3127. 426d4: 003fb306 br 425a4 <__sflush_r+0xd4>
  3128. 426d8: 88c0030b ldhu r3,12(r17)
  3129. 426dc: 3005883a mov r2,r6
  3130. 426e0: 18c01014 ori r3,r3,64
  3131. 426e4: 88c0030d sth r3,12(r17)
  3132. 426e8: 003fae06 br 425a4 <__sflush_r+0xd4>
  3133. 000426ec <_fflush_r>:
  3134. 426ec: defffd04 addi sp,sp,-12
  3135. 426f0: dc000115 stw r16,4(sp)
  3136. 426f4: dfc00215 stw ra,8(sp)
  3137. 426f8: 2021883a mov r16,r4
  3138. 426fc: 20000226 beq r4,zero,42708 <_fflush_r+0x1c>
  3139. 42700: 20800e17 ldw r2,56(r4)
  3140. 42704: 10000c26 beq r2,zero,42738 <_fflush_r+0x4c>
  3141. 42708: 2880030f ldh r2,12(r5)
  3142. 4270c: 1000051e bne r2,zero,42724 <_fflush_r+0x38>
  3143. 42710: 0005883a mov r2,zero
  3144. 42714: dfc00217 ldw ra,8(sp)
  3145. 42718: dc000117 ldw r16,4(sp)
  3146. 4271c: dec00304 addi sp,sp,12
  3147. 42720: f800283a ret
  3148. 42724: 8009883a mov r4,r16
  3149. 42728: dfc00217 ldw ra,8(sp)
  3150. 4272c: dc000117 ldw r16,4(sp)
  3151. 42730: dec00304 addi sp,sp,12
  3152. 42734: 00424d01 jmpi 424d0 <__sflush_r>
  3153. 42738: d9400015 stw r5,0(sp)
  3154. 4273c: 00407740 call 40774 <__sinit>
  3155. 42740: d9400017 ldw r5,0(sp)
  3156. 42744: 003ff006 br 42708 <_fflush_r+0x1c>
  3157. 00042748 <fflush>:
  3158. 42748: 20000526 beq r4,zero,42760 <fflush+0x18>
  3159. 4274c: 00800134 movhi r2,4
  3160. 42750: 109c7204 addi r2,r2,29128
  3161. 42754: 200b883a mov r5,r4
  3162. 42758: 11000017 ldw r4,0(r2)
  3163. 4275c: 00426ec1 jmpi 426ec <_fflush_r>
  3164. 42760: 00800134 movhi r2,4
  3165. 42764: 109c7104 addi r2,r2,29124
  3166. 42768: 11000017 ldw r4,0(r2)
  3167. 4276c: 01400134 movhi r5,4
  3168. 42770: 2949bb04 addi r5,r5,9964
  3169. 42774: 0040d501 jmpi 40d50 <_fwalk_reent>
  3170. 00042778 <_malloc_trim_r>:
  3171. 42778: defffb04 addi sp,sp,-20
  3172. 4277c: dcc00315 stw r19,12(sp)
  3173. 42780: 04c00134 movhi r19,4
  3174. 42784: dc800215 stw r18,8(sp)
  3175. 42788: dc400115 stw r17,4(sp)
  3176. 4278c: dc000015 stw r16,0(sp)
  3177. 42790: dfc00415 stw ra,16(sp)
  3178. 42794: 2821883a mov r16,r5
  3179. 42798: 9cd6ed04 addi r19,r19,23476
  3180. 4279c: 2025883a mov r18,r4
  3181. 427a0: 00436500 call 43650 <__malloc_lock>
  3182. 427a4: 98800217 ldw r2,8(r19)
  3183. 427a8: 14400117 ldw r17,4(r2)
  3184. 427ac: 00bfff04 movi r2,-4
  3185. 427b0: 88a2703a and r17,r17,r2
  3186. 427b4: 8c21c83a sub r16,r17,r16
  3187. 427b8: 8403fbc4 addi r16,r16,4079
  3188. 427bc: 8020d33a srli r16,r16,12
  3189. 427c0: 0083ffc4 movi r2,4095
  3190. 427c4: 843fffc4 addi r16,r16,-1
  3191. 427c8: 8020933a slli r16,r16,12
  3192. 427cc: 1400060e bge r2,r16,427e8 <_malloc_trim_r+0x70>
  3193. 427d0: 000b883a mov r5,zero
  3194. 427d4: 9009883a mov r4,r18
  3195. 427d8: 00420340 call 42034 <_sbrk_r>
  3196. 427dc: 98c00217 ldw r3,8(r19)
  3197. 427e0: 1c47883a add r3,r3,r17
  3198. 427e4: 10c00a26 beq r2,r3,42810 <_malloc_trim_r+0x98>
  3199. 427e8: 9009883a mov r4,r18
  3200. 427ec: 00436740 call 43674 <__malloc_unlock>
  3201. 427f0: 0005883a mov r2,zero
  3202. 427f4: dfc00417 ldw ra,16(sp)
  3203. 427f8: dcc00317 ldw r19,12(sp)
  3204. 427fc: dc800217 ldw r18,8(sp)
  3205. 42800: dc400117 ldw r17,4(sp)
  3206. 42804: dc000017 ldw r16,0(sp)
  3207. 42808: dec00504 addi sp,sp,20
  3208. 4280c: f800283a ret
  3209. 42810: 040bc83a sub r5,zero,r16
  3210. 42814: 9009883a mov r4,r18
  3211. 42818: 00420340 call 42034 <_sbrk_r>
  3212. 4281c: 00ffffc4 movi r3,-1
  3213. 42820: 10c00d26 beq r2,r3,42858 <_malloc_trim_r+0xe0>
  3214. 42824: 00c00174 movhi r3,5
  3215. 42828: 18e32504 addi r3,r3,-29548
  3216. 4282c: 18800017 ldw r2,0(r3)
  3217. 42830: 99000217 ldw r4,8(r19)
  3218. 42834: 8c23c83a sub r17,r17,r16
  3219. 42838: 8c400054 ori r17,r17,1
  3220. 4283c: 1421c83a sub r16,r2,r16
  3221. 42840: 24400115 stw r17,4(r4)
  3222. 42844: 9009883a mov r4,r18
  3223. 42848: 1c000015 stw r16,0(r3)
  3224. 4284c: 00436740 call 43674 <__malloc_unlock>
  3225. 42850: 00800044 movi r2,1
  3226. 42854: 003fe706 br 427f4 <_malloc_trim_r+0x7c>
  3227. 42858: 000b883a mov r5,zero
  3228. 4285c: 9009883a mov r4,r18
  3229. 42860: 00420340 call 42034 <_sbrk_r>
  3230. 42864: 99000217 ldw r4,8(r19)
  3231. 42868: 014003c4 movi r5,15
  3232. 4286c: 1107c83a sub r3,r2,r4
  3233. 42870: 28ffdd0e bge r5,r3,427e8 <_malloc_trim_r+0x70>
  3234. 42874: 01400134 movhi r5,4
  3235. 42878: 295c7304 addi r5,r5,29132
  3236. 4287c: 29400017 ldw r5,0(r5)
  3237. 42880: 18c00054 ori r3,r3,1
  3238. 42884: 20c00115 stw r3,4(r4)
  3239. 42888: 00c00174 movhi r3,5
  3240. 4288c: 1145c83a sub r2,r2,r5
  3241. 42890: 18e32504 addi r3,r3,-29548
  3242. 42894: 18800015 stw r2,0(r3)
  3243. 42898: 003fd306 br 427e8 <_malloc_trim_r+0x70>
  3244. 0004289c <_free_r>:
  3245. 4289c: 28004126 beq r5,zero,429a4 <_free_r+0x108>
  3246. 428a0: defffd04 addi sp,sp,-12
  3247. 428a4: dc400115 stw r17,4(sp)
  3248. 428a8: dc000015 stw r16,0(sp)
  3249. 428ac: 2023883a mov r17,r4
  3250. 428b0: 2821883a mov r16,r5
  3251. 428b4: dfc00215 stw ra,8(sp)
  3252. 428b8: 00436500 call 43650 <__malloc_lock>
  3253. 428bc: 81ffff17 ldw r7,-4(r16)
  3254. 428c0: 00bfff84 movi r2,-2
  3255. 428c4: 01000134 movhi r4,4
  3256. 428c8: 81bffe04 addi r6,r16,-8
  3257. 428cc: 3884703a and r2,r7,r2
  3258. 428d0: 2116ed04 addi r4,r4,23476
  3259. 428d4: 308b883a add r5,r6,r2
  3260. 428d8: 2a400117 ldw r9,4(r5)
  3261. 428dc: 22000217 ldw r8,8(r4)
  3262. 428e0: 00ffff04 movi r3,-4
  3263. 428e4: 48c6703a and r3,r9,r3
  3264. 428e8: 2a005726 beq r5,r8,42a48 <_free_r+0x1ac>
  3265. 428ec: 28c00115 stw r3,4(r5)
  3266. 428f0: 39c0004c andi r7,r7,1
  3267. 428f4: 3800091e bne r7,zero,4291c <_free_r+0x80>
  3268. 428f8: 823ffe17 ldw r8,-8(r16)
  3269. 428fc: 22400204 addi r9,r4,8
  3270. 42900: 320dc83a sub r6,r6,r8
  3271. 42904: 31c00217 ldw r7,8(r6)
  3272. 42908: 1205883a add r2,r2,r8
  3273. 4290c: 3a406526 beq r7,r9,42aa4 <_free_r+0x208>
  3274. 42910: 32000317 ldw r8,12(r6)
  3275. 42914: 3a000315 stw r8,12(r7)
  3276. 42918: 41c00215 stw r7,8(r8)
  3277. 4291c: 28cf883a add r7,r5,r3
  3278. 42920: 39c00117 ldw r7,4(r7)
  3279. 42924: 39c0004c andi r7,r7,1
  3280. 42928: 38003a26 beq r7,zero,42a14 <_free_r+0x178>
  3281. 4292c: 10c00054 ori r3,r2,1
  3282. 42930: 30c00115 stw r3,4(r6)
  3283. 42934: 3087883a add r3,r6,r2
  3284. 42938: 18800015 stw r2,0(r3)
  3285. 4293c: 00c07fc4 movi r3,511
  3286. 42940: 18801936 bltu r3,r2,429a8 <_free_r+0x10c>
  3287. 42944: 1004d0fa srli r2,r2,3
  3288. 42948: 01c00044 movi r7,1
  3289. 4294c: 21400117 ldw r5,4(r4)
  3290. 42950: 10c00044 addi r3,r2,1
  3291. 42954: 18c7883a add r3,r3,r3
  3292. 42958: 1005d0ba srai r2,r2,2
  3293. 4295c: 18c7883a add r3,r3,r3
  3294. 42960: 18c7883a add r3,r3,r3
  3295. 42964: 1907883a add r3,r3,r4
  3296. 42968: 3884983a sll r2,r7,r2
  3297. 4296c: 19c00017 ldw r7,0(r3)
  3298. 42970: 1a3ffe04 addi r8,r3,-8
  3299. 42974: 1144b03a or r2,r2,r5
  3300. 42978: 32000315 stw r8,12(r6)
  3301. 4297c: 31c00215 stw r7,8(r6)
  3302. 42980: 20800115 stw r2,4(r4)
  3303. 42984: 19800015 stw r6,0(r3)
  3304. 42988: 39800315 stw r6,12(r7)
  3305. 4298c: 8809883a mov r4,r17
  3306. 42990: dfc00217 ldw ra,8(sp)
  3307. 42994: dc400117 ldw r17,4(sp)
  3308. 42998: dc000017 ldw r16,0(sp)
  3309. 4299c: dec00304 addi sp,sp,12
  3310. 429a0: 00436741 jmpi 43674 <__malloc_unlock>
  3311. 429a4: f800283a ret
  3312. 429a8: 100ad27a srli r5,r2,9
  3313. 429ac: 00c00104 movi r3,4
  3314. 429b0: 19404a36 bltu r3,r5,42adc <_free_r+0x240>
  3315. 429b4: 100ad1ba srli r5,r2,6
  3316. 429b8: 28c00e44 addi r3,r5,57
  3317. 429bc: 18c7883a add r3,r3,r3
  3318. 429c0: 29400e04 addi r5,r5,56
  3319. 429c4: 18c7883a add r3,r3,r3
  3320. 429c8: 18c7883a add r3,r3,r3
  3321. 429cc: 1909883a add r4,r3,r4
  3322. 429d0: 20c00017 ldw r3,0(r4)
  3323. 429d4: 01c00134 movhi r7,4
  3324. 429d8: 213ffe04 addi r4,r4,-8
  3325. 429dc: 39d6ed04 addi r7,r7,23476
  3326. 429e0: 20c04426 beq r4,r3,42af4 <_free_r+0x258>
  3327. 429e4: 01ffff04 movi r7,-4
  3328. 429e8: 19400117 ldw r5,4(r3)
  3329. 429ec: 29ca703a and r5,r5,r7
  3330. 429f0: 1140022e bgeu r2,r5,429fc <_free_r+0x160>
  3331. 429f4: 18c00217 ldw r3,8(r3)
  3332. 429f8: 20fffb1e bne r4,r3,429e8 <_free_r+0x14c>
  3333. 429fc: 19000317 ldw r4,12(r3)
  3334. 42a00: 31000315 stw r4,12(r6)
  3335. 42a04: 30c00215 stw r3,8(r6)
  3336. 42a08: 21800215 stw r6,8(r4)
  3337. 42a0c: 19800315 stw r6,12(r3)
  3338. 42a10: 003fde06 br 4298c <_free_r+0xf0>
  3339. 42a14: 29c00217 ldw r7,8(r5)
  3340. 42a18: 10c5883a add r2,r2,r3
  3341. 42a1c: 00c00134 movhi r3,4
  3342. 42a20: 18d6ef04 addi r3,r3,23484
  3343. 42a24: 38c03b26 beq r7,r3,42b14 <_free_r+0x278>
  3344. 42a28: 2a000317 ldw r8,12(r5)
  3345. 42a2c: 11400054 ori r5,r2,1
  3346. 42a30: 3087883a add r3,r6,r2
  3347. 42a34: 3a000315 stw r8,12(r7)
  3348. 42a38: 41c00215 stw r7,8(r8)
  3349. 42a3c: 31400115 stw r5,4(r6)
  3350. 42a40: 18800015 stw r2,0(r3)
  3351. 42a44: 003fbd06 br 4293c <_free_r+0xa0>
  3352. 42a48: 39c0004c andi r7,r7,1
  3353. 42a4c: 10c5883a add r2,r2,r3
  3354. 42a50: 3800071e bne r7,zero,42a70 <_free_r+0x1d4>
  3355. 42a54: 81fffe17 ldw r7,-8(r16)
  3356. 42a58: 31cdc83a sub r6,r6,r7
  3357. 42a5c: 30c00317 ldw r3,12(r6)
  3358. 42a60: 31400217 ldw r5,8(r6)
  3359. 42a64: 11c5883a add r2,r2,r7
  3360. 42a68: 28c00315 stw r3,12(r5)
  3361. 42a6c: 19400215 stw r5,8(r3)
  3362. 42a70: 10c00054 ori r3,r2,1
  3363. 42a74: 30c00115 stw r3,4(r6)
  3364. 42a78: 00c00134 movhi r3,4
  3365. 42a7c: 18dc7404 addi r3,r3,29136
  3366. 42a80: 18c00017 ldw r3,0(r3)
  3367. 42a84: 21800215 stw r6,8(r4)
  3368. 42a88: 10ffc036 bltu r2,r3,4298c <_free_r+0xf0>
  3369. 42a8c: 00800174 movhi r2,5
  3370. 42a90: 10a31c04 addi r2,r2,-29584
  3371. 42a94: 11400017 ldw r5,0(r2)
  3372. 42a98: 8809883a mov r4,r17
  3373. 42a9c: 00427780 call 42778 <_malloc_trim_r>
  3374. 42aa0: 003fba06 br 4298c <_free_r+0xf0>
  3375. 42aa4: 28c9883a add r4,r5,r3
  3376. 42aa8: 21000117 ldw r4,4(r4)
  3377. 42aac: 2100004c andi r4,r4,1
  3378. 42ab0: 2000391e bne r4,zero,42b98 <_free_r+0x2fc>
  3379. 42ab4: 29c00217 ldw r7,8(r5)
  3380. 42ab8: 29000317 ldw r4,12(r5)
  3381. 42abc: 1885883a add r2,r3,r2
  3382. 42ac0: 10c00054 ori r3,r2,1
  3383. 42ac4: 39000315 stw r4,12(r7)
  3384. 42ac8: 21c00215 stw r7,8(r4)
  3385. 42acc: 30c00115 stw r3,4(r6)
  3386. 42ad0: 308d883a add r6,r6,r2
  3387. 42ad4: 30800015 stw r2,0(r6)
  3388. 42ad8: 003fac06 br 4298c <_free_r+0xf0>
  3389. 42adc: 00c00504 movi r3,20
  3390. 42ae0: 19401536 bltu r3,r5,42b38 <_free_r+0x29c>
  3391. 42ae4: 28c01704 addi r3,r5,92
  3392. 42ae8: 18c7883a add r3,r3,r3
  3393. 42aec: 294016c4 addi r5,r5,91
  3394. 42af0: 003fb406 br 429c4 <_free_r+0x128>
  3395. 42af4: 280bd0ba srai r5,r5,2
  3396. 42af8: 00c00044 movi r3,1
  3397. 42afc: 38800117 ldw r2,4(r7)
  3398. 42b00: 194a983a sll r5,r3,r5
  3399. 42b04: 2007883a mov r3,r4
  3400. 42b08: 2884b03a or r2,r5,r2
  3401. 42b0c: 38800115 stw r2,4(r7)
  3402. 42b10: 003fbb06 br 42a00 <_free_r+0x164>
  3403. 42b14: 21800515 stw r6,20(r4)
  3404. 42b18: 21800415 stw r6,16(r4)
  3405. 42b1c: 10c00054 ori r3,r2,1
  3406. 42b20: 31c00315 stw r7,12(r6)
  3407. 42b24: 31c00215 stw r7,8(r6)
  3408. 42b28: 30c00115 stw r3,4(r6)
  3409. 42b2c: 308d883a add r6,r6,r2
  3410. 42b30: 30800015 stw r2,0(r6)
  3411. 42b34: 003f9506 br 4298c <_free_r+0xf0>
  3412. 42b38: 00c01504 movi r3,84
  3413. 42b3c: 19400536 bltu r3,r5,42b54 <_free_r+0x2b8>
  3414. 42b40: 100ad33a srli r5,r2,12
  3415. 42b44: 28c01bc4 addi r3,r5,111
  3416. 42b48: 18c7883a add r3,r3,r3
  3417. 42b4c: 29401b84 addi r5,r5,110
  3418. 42b50: 003f9c06 br 429c4 <_free_r+0x128>
  3419. 42b54: 00c05504 movi r3,340
  3420. 42b58: 19400536 bltu r3,r5,42b70 <_free_r+0x2d4>
  3421. 42b5c: 100ad3fa srli r5,r2,15
  3422. 42b60: 28c01e04 addi r3,r5,120
  3423. 42b64: 18c7883a add r3,r3,r3
  3424. 42b68: 29401dc4 addi r5,r5,119
  3425. 42b6c: 003f9506 br 429c4 <_free_r+0x128>
  3426. 42b70: 00c15504 movi r3,1364
  3427. 42b74: 19400536 bltu r3,r5,42b8c <_free_r+0x2f0>
  3428. 42b78: 100ad4ba srli r5,r2,18
  3429. 42b7c: 28c01f44 addi r3,r5,125
  3430. 42b80: 18c7883a add r3,r3,r3
  3431. 42b84: 29401f04 addi r5,r5,124
  3432. 42b88: 003f8e06 br 429c4 <_free_r+0x128>
  3433. 42b8c: 00c03f84 movi r3,254
  3434. 42b90: 01401f84 movi r5,126
  3435. 42b94: 003f8b06 br 429c4 <_free_r+0x128>
  3436. 42b98: 10c00054 ori r3,r2,1
  3437. 42b9c: 30c00115 stw r3,4(r6)
  3438. 42ba0: 308d883a add r6,r6,r2
  3439. 42ba4: 30800015 stw r2,0(r6)
  3440. 42ba8: 003f7806 br 4298c <_free_r+0xf0>
  3441. 00042bac <_lseek_r>:
  3442. 42bac: defffd04 addi sp,sp,-12
  3443. 42bb0: 2805883a mov r2,r5
  3444. 42bb4: dc000015 stw r16,0(sp)
  3445. 42bb8: 04000174 movhi r16,5
  3446. 42bbc: dc400115 stw r17,4(sp)
  3447. 42bc0: 300b883a mov r5,r6
  3448. 42bc4: 84231d04 addi r16,r16,-29580
  3449. 42bc8: 2023883a mov r17,r4
  3450. 42bcc: 380d883a mov r6,r7
  3451. 42bd0: 1009883a mov r4,r2
  3452. 42bd4: dfc00215 stw ra,8(sp)
  3453. 42bd8: 80000015 stw zero,0(r16)
  3454. 42bdc: 00434f80 call 434f8 <lseek>
  3455. 42be0: 00ffffc4 movi r3,-1
  3456. 42be4: 10c00526 beq r2,r3,42bfc <_lseek_r+0x50>
  3457. 42be8: dfc00217 ldw ra,8(sp)
  3458. 42bec: dc400117 ldw r17,4(sp)
  3459. 42bf0: dc000017 ldw r16,0(sp)
  3460. 42bf4: dec00304 addi sp,sp,12
  3461. 42bf8: f800283a ret
  3462. 42bfc: 80c00017 ldw r3,0(r16)
  3463. 42c00: 183ff926 beq r3,zero,42be8 <_lseek_r+0x3c>
  3464. 42c04: 88c00015 stw r3,0(r17)
  3465. 42c08: 003ff706 br 42be8 <_lseek_r+0x3c>
  3466. 00042c0c <__smakebuf_r>:
  3467. 42c0c: 2880030b ldhu r2,12(r5)
  3468. 42c10: 10c0008c andi r3,r2,2
  3469. 42c14: 1800411e bne r3,zero,42d1c <__smakebuf_r+0x110>
  3470. 42c18: deffec04 addi sp,sp,-80
  3471. 42c1c: dc000f15 stw r16,60(sp)
  3472. 42c20: 2821883a mov r16,r5
  3473. 42c24: 2940038f ldh r5,14(r5)
  3474. 42c28: dc401015 stw r17,64(sp)
  3475. 42c2c: dfc01315 stw ra,76(sp)
  3476. 42c30: dcc01215 stw r19,72(sp)
  3477. 42c34: dc801115 stw r18,68(sp)
  3478. 42c38: 2023883a mov r17,r4
  3479. 42c3c: 28001c16 blt r5,zero,42cb0 <__smakebuf_r+0xa4>
  3480. 42c40: d80d883a mov r6,sp
  3481. 42c44: 0042e280 call 42e28 <_fstat_r>
  3482. 42c48: 10001816 blt r2,zero,42cac <__smakebuf_r+0xa0>
  3483. 42c4c: d8800117 ldw r2,4(sp)
  3484. 42c50: 00e00014 movui r3,32768
  3485. 42c54: 10bc000c andi r2,r2,61440
  3486. 42c58: 14c80020 cmpeqi r19,r2,8192
  3487. 42c5c: 10c03726 beq r2,r3,42d3c <__smakebuf_r+0x130>
  3488. 42c60: 80c0030b ldhu r3,12(r16)
  3489. 42c64: 18c20014 ori r3,r3,2048
  3490. 42c68: 80c0030d sth r3,12(r16)
  3491. 42c6c: 00c80004 movi r3,8192
  3492. 42c70: 10c0521e bne r2,r3,42dbc <__smakebuf_r+0x1b0>
  3493. 42c74: 8140038f ldh r5,14(r16)
  3494. 42c78: 8809883a mov r4,r17
  3495. 42c7c: 0042e840 call 42e84 <_isatty_r>
  3496. 42c80: 10004c26 beq r2,zero,42db4 <__smakebuf_r+0x1a8>
  3497. 42c84: 8080030b ldhu r2,12(r16)
  3498. 42c88: 80c010c4 addi r3,r16,67
  3499. 42c8c: 80c00015 stw r3,0(r16)
  3500. 42c90: 10800054 ori r2,r2,1
  3501. 42c94: 8080030d sth r2,12(r16)
  3502. 42c98: 00800044 movi r2,1
  3503. 42c9c: 80c00415 stw r3,16(r16)
  3504. 42ca0: 80800515 stw r2,20(r16)
  3505. 42ca4: 04810004 movi r18,1024
  3506. 42ca8: 00000706 br 42cc8 <__smakebuf_r+0xbc>
  3507. 42cac: 8080030b ldhu r2,12(r16)
  3508. 42cb0: 10c0200c andi r3,r2,128
  3509. 42cb4: 18001f1e bne r3,zero,42d34 <__smakebuf_r+0x128>
  3510. 42cb8: 04810004 movi r18,1024
  3511. 42cbc: 10820014 ori r2,r2,2048
  3512. 42cc0: 8080030d sth r2,12(r16)
  3513. 42cc4: 0027883a mov r19,zero
  3514. 42cc8: 900b883a mov r5,r18
  3515. 42ccc: 8809883a mov r4,r17
  3516. 42cd0: 0040e140 call 40e14 <_malloc_r>
  3517. 42cd4: 10002c26 beq r2,zero,42d88 <__smakebuf_r+0x17c>
  3518. 42cd8: 80c0030b ldhu r3,12(r16)
  3519. 42cdc: 01000134 movhi r4,4
  3520. 42ce0: 21010704 addi r4,r4,1052
  3521. 42ce4: 89000f15 stw r4,60(r17)
  3522. 42ce8: 18c02014 ori r3,r3,128
  3523. 42cec: 80c0030d sth r3,12(r16)
  3524. 42cf0: 80800015 stw r2,0(r16)
  3525. 42cf4: 80800415 stw r2,16(r16)
  3526. 42cf8: 84800515 stw r18,20(r16)
  3527. 42cfc: 98001a1e bne r19,zero,42d68 <__smakebuf_r+0x15c>
  3528. 42d00: dfc01317 ldw ra,76(sp)
  3529. 42d04: dcc01217 ldw r19,72(sp)
  3530. 42d08: dc801117 ldw r18,68(sp)
  3531. 42d0c: dc401017 ldw r17,64(sp)
  3532. 42d10: dc000f17 ldw r16,60(sp)
  3533. 42d14: dec01404 addi sp,sp,80
  3534. 42d18: f800283a ret
  3535. 42d1c: 288010c4 addi r2,r5,67
  3536. 42d20: 28800015 stw r2,0(r5)
  3537. 42d24: 28800415 stw r2,16(r5)
  3538. 42d28: 00800044 movi r2,1
  3539. 42d2c: 28800515 stw r2,20(r5)
  3540. 42d30: f800283a ret
  3541. 42d34: 04801004 movi r18,64
  3542. 42d38: 003fe006 br 42cbc <__smakebuf_r+0xb0>
  3543. 42d3c: 81000a17 ldw r4,40(r16)
  3544. 42d40: 00c00134 movhi r3,4
  3545. 42d44: 18c85804 addi r3,r3,8544
  3546. 42d48: 20ffc51e bne r4,r3,42c60 <__smakebuf_r+0x54>
  3547. 42d4c: 8080030b ldhu r2,12(r16)
  3548. 42d50: 04810004 movi r18,1024
  3549. 42d54: 84801315 stw r18,76(r16)
  3550. 42d58: 1484b03a or r2,r2,r18
  3551. 42d5c: 8080030d sth r2,12(r16)
  3552. 42d60: 0027883a mov r19,zero
  3553. 42d64: 003fd806 br 42cc8 <__smakebuf_r+0xbc>
  3554. 42d68: 8140038f ldh r5,14(r16)
  3555. 42d6c: 8809883a mov r4,r17
  3556. 42d70: 0042e840 call 42e84 <_isatty_r>
  3557. 42d74: 103fe226 beq r2,zero,42d00 <__smakebuf_r+0xf4>
  3558. 42d78: 8080030b ldhu r2,12(r16)
  3559. 42d7c: 10800054 ori r2,r2,1
  3560. 42d80: 8080030d sth r2,12(r16)
  3561. 42d84: 003fde06 br 42d00 <__smakebuf_r+0xf4>
  3562. 42d88: 8080030b ldhu r2,12(r16)
  3563. 42d8c: 10c0800c andi r3,r2,512
  3564. 42d90: 183fdb1e bne r3,zero,42d00 <__smakebuf_r+0xf4>
  3565. 42d94: 10800094 ori r2,r2,2
  3566. 42d98: 80c010c4 addi r3,r16,67
  3567. 42d9c: 8080030d sth r2,12(r16)
  3568. 42da0: 00800044 movi r2,1
  3569. 42da4: 80c00015 stw r3,0(r16)
  3570. 42da8: 80c00415 stw r3,16(r16)
  3571. 42dac: 80800515 stw r2,20(r16)
  3572. 42db0: 003fd306 br 42d00 <__smakebuf_r+0xf4>
  3573. 42db4: 04810004 movi r18,1024
  3574. 42db8: 003fc306 br 42cc8 <__smakebuf_r+0xbc>
  3575. 42dbc: 0027883a mov r19,zero
  3576. 42dc0: 04810004 movi r18,1024
  3577. 42dc4: 003fc006 br 42cc8 <__smakebuf_r+0xbc>
  3578. 00042dc8 <_read_r>:
  3579. 42dc8: defffd04 addi sp,sp,-12
  3580. 42dcc: 2805883a mov r2,r5
  3581. 42dd0: dc000015 stw r16,0(sp)
  3582. 42dd4: 04000174 movhi r16,5
  3583. 42dd8: dc400115 stw r17,4(sp)
  3584. 42ddc: 300b883a mov r5,r6
  3585. 42de0: 84231d04 addi r16,r16,-29580
  3586. 42de4: 2023883a mov r17,r4
  3587. 42de8: 380d883a mov r6,r7
  3588. 42dec: 1009883a mov r4,r2
  3589. 42df0: dfc00215 stw ra,8(sp)
  3590. 42df4: 80000015 stw zero,0(r16)
  3591. 42df8: 00436d40 call 436d4 <read>
  3592. 42dfc: 00ffffc4 movi r3,-1
  3593. 42e00: 10c00526 beq r2,r3,42e18 <_read_r+0x50>
  3594. 42e04: dfc00217 ldw ra,8(sp)
  3595. 42e08: dc400117 ldw r17,4(sp)
  3596. 42e0c: dc000017 ldw r16,0(sp)
  3597. 42e10: dec00304 addi sp,sp,12
  3598. 42e14: f800283a ret
  3599. 42e18: 80c00017 ldw r3,0(r16)
  3600. 42e1c: 183ff926 beq r3,zero,42e04 <_read_r+0x3c>
  3601. 42e20: 88c00015 stw r3,0(r17)
  3602. 42e24: 003ff706 br 42e04 <_read_r+0x3c>
  3603. 00042e28 <_fstat_r>:
  3604. 42e28: defffd04 addi sp,sp,-12
  3605. 42e2c: 2805883a mov r2,r5
  3606. 42e30: dc000015 stw r16,0(sp)
  3607. 42e34: 04000174 movhi r16,5
  3608. 42e38: dc400115 stw r17,4(sp)
  3609. 42e3c: 84231d04 addi r16,r16,-29580
  3610. 42e40: 2023883a mov r17,r4
  3611. 42e44: 300b883a mov r5,r6
  3612. 42e48: 1009883a mov r4,r2
  3613. 42e4c: dfc00215 stw ra,8(sp)
  3614. 42e50: 80000015 stw zero,0(r16)
  3615. 42e54: 00432300 call 43230 <fstat>
  3616. 42e58: 00ffffc4 movi r3,-1
  3617. 42e5c: 10c00526 beq r2,r3,42e74 <_fstat_r+0x4c>
  3618. 42e60: dfc00217 ldw ra,8(sp)
  3619. 42e64: dc400117 ldw r17,4(sp)
  3620. 42e68: dc000017 ldw r16,0(sp)
  3621. 42e6c: dec00304 addi sp,sp,12
  3622. 42e70: f800283a ret
  3623. 42e74: 80c00017 ldw r3,0(r16)
  3624. 42e78: 183ff926 beq r3,zero,42e60 <_fstat_r+0x38>
  3625. 42e7c: 88c00015 stw r3,0(r17)
  3626. 42e80: 003ff706 br 42e60 <_fstat_r+0x38>
  3627. 00042e84 <_isatty_r>:
  3628. 42e84: defffd04 addi sp,sp,-12
  3629. 42e88: dc000015 stw r16,0(sp)
  3630. 42e8c: 04000174 movhi r16,5
  3631. 42e90: dc400115 stw r17,4(sp)
  3632. 42e94: 84231d04 addi r16,r16,-29580
  3633. 42e98: 2023883a mov r17,r4
  3634. 42e9c: 2809883a mov r4,r5
  3635. 42ea0: dfc00215 stw ra,8(sp)
  3636. 42ea4: 80000015 stw zero,0(r16)
  3637. 42ea8: 00433240 call 43324 <isatty>
  3638. 42eac: 00ffffc4 movi r3,-1
  3639. 42eb0: 10c00526 beq r2,r3,42ec8 <_isatty_r+0x44>
  3640. 42eb4: dfc00217 ldw ra,8(sp)
  3641. 42eb8: dc400117 ldw r17,4(sp)
  3642. 42ebc: dc000017 ldw r16,0(sp)
  3643. 42ec0: dec00304 addi sp,sp,12
  3644. 42ec4: f800283a ret
  3645. 42ec8: 80c00017 ldw r3,0(r16)
  3646. 42ecc: 183ff926 beq r3,zero,42eb4 <_isatty_r+0x30>
  3647. 42ed0: 88c00015 stw r3,0(r17)
  3648. 42ed4: 003ff706 br 42eb4 <_isatty_r+0x30>
  3649. 00042ed8 <__divsi3>:
  3650. 42ed8: 20001b16 blt r4,zero,42f48 <__divsi3+0x70>
  3651. 42edc: 000f883a mov r7,zero
  3652. 42ee0: 28001616 blt r5,zero,42f3c <__divsi3+0x64>
  3653. 42ee4: 200d883a mov r6,r4
  3654. 42ee8: 29001a2e bgeu r5,r4,42f54 <__divsi3+0x7c>
  3655. 42eec: 00800804 movi r2,32
  3656. 42ef0: 00c00044 movi r3,1
  3657. 42ef4: 00000106 br 42efc <__divsi3+0x24>
  3658. 42ef8: 10000d26 beq r2,zero,42f30 <__divsi3+0x58>
  3659. 42efc: 294b883a add r5,r5,r5
  3660. 42f00: 10bfffc4 addi r2,r2,-1
  3661. 42f04: 18c7883a add r3,r3,r3
  3662. 42f08: 293ffb36 bltu r5,r4,42ef8 <__divsi3+0x20>
  3663. 42f0c: 0005883a mov r2,zero
  3664. 42f10: 18000726 beq r3,zero,42f30 <__divsi3+0x58>
  3665. 42f14: 0005883a mov r2,zero
  3666. 42f18: 31400236 bltu r6,r5,42f24 <__divsi3+0x4c>
  3667. 42f1c: 314dc83a sub r6,r6,r5
  3668. 42f20: 10c4b03a or r2,r2,r3
  3669. 42f24: 1806d07a srli r3,r3,1
  3670. 42f28: 280ad07a srli r5,r5,1
  3671. 42f2c: 183ffa1e bne r3,zero,42f18 <__divsi3+0x40>
  3672. 42f30: 38000126 beq r7,zero,42f38 <__divsi3+0x60>
  3673. 42f34: 0085c83a sub r2,zero,r2
  3674. 42f38: f800283a ret
  3675. 42f3c: 014bc83a sub r5,zero,r5
  3676. 42f40: 39c0005c xori r7,r7,1
  3677. 42f44: 003fe706 br 42ee4 <__divsi3+0xc>
  3678. 42f48: 0109c83a sub r4,zero,r4
  3679. 42f4c: 01c00044 movi r7,1
  3680. 42f50: 003fe306 br 42ee0 <__divsi3+0x8>
  3681. 42f54: 00c00044 movi r3,1
  3682. 42f58: 003fee06 br 42f14 <__divsi3+0x3c>
  3683. 00042f5c <__modsi3>:
  3684. 42f5c: 20001716 blt r4,zero,42fbc <__modsi3+0x60>
  3685. 42f60: 000f883a mov r7,zero
  3686. 42f64: 2005883a mov r2,r4
  3687. 42f68: 28001216 blt r5,zero,42fb4 <__modsi3+0x58>
  3688. 42f6c: 2900162e bgeu r5,r4,42fc8 <__modsi3+0x6c>
  3689. 42f70: 01800804 movi r6,32
  3690. 42f74: 00c00044 movi r3,1
  3691. 42f78: 00000106 br 42f80 <__modsi3+0x24>
  3692. 42f7c: 30000a26 beq r6,zero,42fa8 <__modsi3+0x4c>
  3693. 42f80: 294b883a add r5,r5,r5
  3694. 42f84: 31bfffc4 addi r6,r6,-1
  3695. 42f88: 18c7883a add r3,r3,r3
  3696. 42f8c: 293ffb36 bltu r5,r4,42f7c <__modsi3+0x20>
  3697. 42f90: 18000526 beq r3,zero,42fa8 <__modsi3+0x4c>
  3698. 42f94: 1806d07a srli r3,r3,1
  3699. 42f98: 11400136 bltu r2,r5,42fa0 <__modsi3+0x44>
  3700. 42f9c: 1145c83a sub r2,r2,r5
  3701. 42fa0: 280ad07a srli r5,r5,1
  3702. 42fa4: 183ffb1e bne r3,zero,42f94 <__modsi3+0x38>
  3703. 42fa8: 38000126 beq r7,zero,42fb0 <__modsi3+0x54>
  3704. 42fac: 0085c83a sub r2,zero,r2
  3705. 42fb0: f800283a ret
  3706. 42fb4: 014bc83a sub r5,zero,r5
  3707. 42fb8: 003fec06 br 42f6c <__modsi3+0x10>
  3708. 42fbc: 0109c83a sub r4,zero,r4
  3709. 42fc0: 01c00044 movi r7,1
  3710. 42fc4: 003fe706 br 42f64 <__modsi3+0x8>
  3711. 42fc8: 00c00044 movi r3,1
  3712. 42fcc: 003ff106 br 42f94 <__modsi3+0x38>
  3713. 00042fd0 <__udivsi3>:
  3714. 42fd0: 200d883a mov r6,r4
  3715. 42fd4: 2900152e bgeu r5,r4,4302c <__udivsi3+0x5c>
  3716. 42fd8: 28001416 blt r5,zero,4302c <__udivsi3+0x5c>
  3717. 42fdc: 00800804 movi r2,32
  3718. 42fe0: 00c00044 movi r3,1
  3719. 42fe4: 00000206 br 42ff0 <__udivsi3+0x20>
  3720. 42fe8: 10000e26 beq r2,zero,43024 <__udivsi3+0x54>
  3721. 42fec: 28000516 blt r5,zero,43004 <__udivsi3+0x34>
  3722. 42ff0: 294b883a add r5,r5,r5
  3723. 42ff4: 10bfffc4 addi r2,r2,-1
  3724. 42ff8: 18c7883a add r3,r3,r3
  3725. 42ffc: 293ffa36 bltu r5,r4,42fe8 <__udivsi3+0x18>
  3726. 43000: 18000826 beq r3,zero,43024 <__udivsi3+0x54>
  3727. 43004: 0005883a mov r2,zero
  3728. 43008: 31400236 bltu r6,r5,43014 <__udivsi3+0x44>
  3729. 4300c: 314dc83a sub r6,r6,r5
  3730. 43010: 10c4b03a or r2,r2,r3
  3731. 43014: 1806d07a srli r3,r3,1
  3732. 43018: 280ad07a srli r5,r5,1
  3733. 4301c: 183ffa1e bne r3,zero,43008 <__udivsi3+0x38>
  3734. 43020: f800283a ret
  3735. 43024: 0005883a mov r2,zero
  3736. 43028: f800283a ret
  3737. 4302c: 00c00044 movi r3,1
  3738. 43030: 003ff406 br 43004 <__udivsi3+0x34>
  3739. 00043034 <__umodsi3>:
  3740. 43034: 2005883a mov r2,r4
  3741. 43038: 2900122e bgeu r5,r4,43084 <__umodsi3+0x50>
  3742. 4303c: 28001116 blt r5,zero,43084 <__umodsi3+0x50>
  3743. 43040: 01800804 movi r6,32
  3744. 43044: 00c00044 movi r3,1
  3745. 43048: 00000206 br 43054 <__umodsi3+0x20>
  3746. 4304c: 30000c26 beq r6,zero,43080 <__umodsi3+0x4c>
  3747. 43050: 28000516 blt r5,zero,43068 <__umodsi3+0x34>
  3748. 43054: 294b883a add r5,r5,r5
  3749. 43058: 31bfffc4 addi r6,r6,-1
  3750. 4305c: 18c7883a add r3,r3,r3
  3751. 43060: 293ffa36 bltu r5,r4,4304c <__umodsi3+0x18>
  3752. 43064: 18000626 beq r3,zero,43080 <__umodsi3+0x4c>
  3753. 43068: 1806d07a srli r3,r3,1
  3754. 4306c: 11400136 bltu r2,r5,43074 <__umodsi3+0x40>
  3755. 43070: 1145c83a sub r2,r2,r5
  3756. 43074: 280ad07a srli r5,r5,1
  3757. 43078: 183ffb1e bne r3,zero,43068 <__umodsi3+0x34>
  3758. 4307c: f800283a ret
  3759. 43080: f800283a ret
  3760. 43084: 00c00044 movi r3,1
  3761. 43088: 003ff706 br 43068 <__umodsi3+0x34>
  3762. 0004308c <__mulsi3>:
  3763. 4308c: 0005883a mov r2,zero
  3764. 43090: 20000726 beq r4,zero,430b0 <__mulsi3+0x24>
  3765. 43094: 20c0004c andi r3,r4,1
  3766. 43098: 2008d07a srli r4,r4,1
  3767. 4309c: 18000126 beq r3,zero,430a4 <__mulsi3+0x18>
  3768. 430a0: 1145883a add r2,r2,r5
  3769. 430a4: 294b883a add r5,r5,r5
  3770. 430a8: 203ffa1e bne r4,zero,43094 <__mulsi3+0x8>
  3771. 430ac: f800283a ret
  3772. 430b0: f800283a ret
  3773. 000430b4 <alt_get_errno>:
  3774. #undef errno
  3775. extern int errno;
  3776. static ALT_INLINE int* alt_get_errno(void)
  3777. {
  3778. 430b4: defffe04 addi sp,sp,-8
  3779. 430b8: dfc00115 stw ra,4(sp)
  3780. 430bc: df000015 stw fp,0(sp)
  3781. 430c0: d839883a mov fp,sp
  3782. return ((alt_errno) ? alt_errno() : &errno);
  3783. 430c4: d0a00917 ldw r2,-32732(gp)
  3784. 430c8: 10000326 beq r2,zero,430d8 <alt_get_errno+0x24>
  3785. 430cc: d0a00917 ldw r2,-32732(gp)
  3786. 430d0: 103ee83a callr r2
  3787. 430d4: 00000106 br 430dc <alt_get_errno+0x28>
  3788. 430d8: d0a6ac04 addi r2,gp,-25936
  3789. }
  3790. 430dc: e037883a mov sp,fp
  3791. 430e0: dfc00117 ldw ra,4(sp)
  3792. 430e4: df000017 ldw fp,0(sp)
  3793. 430e8: dec00204 addi sp,sp,8
  3794. 430ec: f800283a ret
  3795. 000430f0 <close>:
  3796. *
  3797. * ALT_CLOSE is mapped onto the close() system call in alt_syscall.h
  3798. */
  3799. int ALT_CLOSE (int fildes)
  3800. {
  3801. 430f0: defffb04 addi sp,sp,-20
  3802. 430f4: dfc00415 stw ra,16(sp)
  3803. 430f8: df000315 stw fp,12(sp)
  3804. 430fc: df000304 addi fp,sp,12
  3805. 43100: e13fff15 stw r4,-4(fp)
  3806. * A common error case is that when the file descriptor was created, the call
  3807. * to open() failed resulting in a negative file descriptor. This is trapped
  3808. * below so that we don't try and process an invalid file descriptor.
  3809. */
  3810. fd = (fildes < 0) ? NULL : &alt_fd_list[fildes];
  3811. 43104: e0bfff17 ldw r2,-4(fp)
  3812. 43108: 10000816 blt r2,zero,4312c <close+0x3c>
  3813. 4310c: 01400304 movi r5,12
  3814. 43110: e13fff17 ldw r4,-4(fp)
  3815. 43114: 004308c0 call 4308c <__mulsi3>
  3816. 43118: 1007883a mov r3,r2
  3817. 4311c: 00800134 movhi r2,4
  3818. 43120: 1097f904 addi r2,r2,24548
  3819. 43124: 1885883a add r2,r3,r2
  3820. 43128: 00000106 br 43130 <close+0x40>
  3821. 4312c: 0005883a mov r2,zero
  3822. 43130: e0bffd15 stw r2,-12(fp)
  3823. if (fd)
  3824. 43134: e0bffd17 ldw r2,-12(fp)
  3825. 43138: 10001926 beq r2,zero,431a0 <close+0xb0>
  3826. /*
  3827. * If the associated file system/device has a close function, call it so
  3828. * that any necessary cleanup code can run.
  3829. */
  3830. rval = (fd->dev->close) ? fd->dev->close(fd) : 0;
  3831. 4313c: e0bffd17 ldw r2,-12(fp)
  3832. 43140: 10800017 ldw r2,0(r2)
  3833. 43144: 10800417 ldw r2,16(r2)
  3834. 43148: 10000626 beq r2,zero,43164 <close+0x74>
  3835. 4314c: e0bffd17 ldw r2,-12(fp)
  3836. 43150: 10800017 ldw r2,0(r2)
  3837. 43154: 10800417 ldw r2,16(r2)
  3838. 43158: e13ffd17 ldw r4,-12(fp)
  3839. 4315c: 103ee83a callr r2
  3840. 43160: 00000106 br 43168 <close+0x78>
  3841. 43164: 0005883a mov r2,zero
  3842. 43168: e0bffe15 stw r2,-8(fp)
  3843. /* Free the file descriptor structure and return. */
  3844. alt_release_fd (fildes);
  3845. 4316c: e13fff17 ldw r4,-4(fp)
  3846. 43170: 00437d80 call 437d8 <alt_release_fd>
  3847. if (rval < 0)
  3848. 43174: e0bffe17 ldw r2,-8(fp)
  3849. 43178: 1000070e bge r2,zero,43198 <close+0xa8>
  3850. {
  3851. ALT_ERRNO = -rval;
  3852. 4317c: 00430b40 call 430b4 <alt_get_errno>
  3853. 43180: 1007883a mov r3,r2
  3854. 43184: e0bffe17 ldw r2,-8(fp)
  3855. 43188: 0085c83a sub r2,zero,r2
  3856. 4318c: 18800015 stw r2,0(r3)
  3857. return -1;
  3858. 43190: 00bfffc4 movi r2,-1
  3859. 43194: 00000706 br 431b4 <close+0xc4>
  3860. }
  3861. return 0;
  3862. 43198: 0005883a mov r2,zero
  3863. 4319c: 00000506 br 431b4 <close+0xc4>
  3864. }
  3865. else
  3866. {
  3867. ALT_ERRNO = EBADFD;
  3868. 431a0: 00430b40 call 430b4 <alt_get_errno>
  3869. 431a4: 1007883a mov r3,r2
  3870. 431a8: 00801444 movi r2,81
  3871. 431ac: 18800015 stw r2,0(r3)
  3872. return -1;
  3873. 431b0: 00bfffc4 movi r2,-1
  3874. }
  3875. }
  3876. 431b4: e037883a mov sp,fp
  3877. 431b8: dfc00117 ldw ra,4(sp)
  3878. 431bc: df000017 ldw fp,0(sp)
  3879. 431c0: dec00204 addi sp,sp,8
  3880. 431c4: f800283a ret
  3881. 000431c8 <alt_dev_null_write>:
  3882. * by the alt_dev_null device. It simple discards all data passed to it, and
  3883. * indicates that the data has been successfully transmitted.
  3884. */
  3885. static int alt_dev_null_write (alt_fd* fd, const char* ptr, int len)
  3886. {
  3887. 431c8: defffc04 addi sp,sp,-16
  3888. 431cc: df000315 stw fp,12(sp)
  3889. 431d0: df000304 addi fp,sp,12
  3890. 431d4: e13ffd15 stw r4,-12(fp)
  3891. 431d8: e17ffe15 stw r5,-8(fp)
  3892. 431dc: e1bfff15 stw r6,-4(fp)
  3893. return len;
  3894. 431e0: e0bfff17 ldw r2,-4(fp)
  3895. }
  3896. 431e4: e037883a mov sp,fp
  3897. 431e8: df000017 ldw fp,0(sp)
  3898. 431ec: dec00104 addi sp,sp,4
  3899. 431f0: f800283a ret
  3900. 000431f4 <alt_get_errno>:
  3901. #undef errno
  3902. extern int errno;
  3903. static ALT_INLINE int* alt_get_errno(void)
  3904. {
  3905. 431f4: defffe04 addi sp,sp,-8
  3906. 431f8: dfc00115 stw ra,4(sp)
  3907. 431fc: df000015 stw fp,0(sp)
  3908. 43200: d839883a mov fp,sp
  3909. return ((alt_errno) ? alt_errno() : &errno);
  3910. 43204: d0a00917 ldw r2,-32732(gp)
  3911. 43208: 10000326 beq r2,zero,43218 <alt_get_errno+0x24>
  3912. 4320c: d0a00917 ldw r2,-32732(gp)
  3913. 43210: 103ee83a callr r2
  3914. 43214: 00000106 br 4321c <alt_get_errno+0x28>
  3915. 43218: d0a6ac04 addi r2,gp,-25936
  3916. }
  3917. 4321c: e037883a mov sp,fp
  3918. 43220: dfc00117 ldw ra,4(sp)
  3919. 43224: df000017 ldw fp,0(sp)
  3920. 43228: dec00204 addi sp,sp,8
  3921. 4322c: f800283a ret
  3922. 00043230 <fstat>:
  3923. }
  3924. #else /* !ALT_USE_DIRECT_DRIVERS */
  3925. int ALT_FSTAT (int file, struct stat *st)
  3926. {
  3927. 43230: defffb04 addi sp,sp,-20
  3928. 43234: dfc00415 stw ra,16(sp)
  3929. 43238: df000315 stw fp,12(sp)
  3930. 4323c: df000304 addi fp,sp,12
  3931. 43240: e13ffe15 stw r4,-8(fp)
  3932. 43244: e17fff15 stw r5,-4(fp)
  3933. * A common error case is that when the file descriptor was created, the call
  3934. * to open() failed resulting in a negative file descriptor. This is trapped
  3935. * below so that we don't try and process an invalid file descriptor.
  3936. */
  3937. fd = (file < 0) ? NULL : &alt_fd_list[file];
  3938. 43248: e0bffe17 ldw r2,-8(fp)
  3939. 4324c: 10000816 blt r2,zero,43270 <fstat+0x40>
  3940. 43250: 01400304 movi r5,12
  3941. 43254: e13ffe17 ldw r4,-8(fp)
  3942. 43258: 004308c0 call 4308c <__mulsi3>
  3943. 4325c: 1007883a mov r3,r2
  3944. 43260: 00800134 movhi r2,4
  3945. 43264: 1097f904 addi r2,r2,24548
  3946. 43268: 1885883a add r2,r3,r2
  3947. 4326c: 00000106 br 43274 <fstat+0x44>
  3948. 43270: 0005883a mov r2,zero
  3949. 43274: e0bffd15 stw r2,-12(fp)
  3950. if (fd)
  3951. 43278: e0bffd17 ldw r2,-12(fp)
  3952. 4327c: 10001026 beq r2,zero,432c0 <fstat+0x90>
  3953. {
  3954. /* Call the drivers fstat() function to fill out the "st" structure. */
  3955. if (fd->dev->fstat)
  3956. 43280: e0bffd17 ldw r2,-12(fp)
  3957. 43284: 10800017 ldw r2,0(r2)
  3958. 43288: 10800817 ldw r2,32(r2)
  3959. 4328c: 10000726 beq r2,zero,432ac <fstat+0x7c>
  3960. {
  3961. return fd->dev->fstat(fd, st);
  3962. 43290: e0bffd17 ldw r2,-12(fp)
  3963. 43294: 10800017 ldw r2,0(r2)
  3964. 43298: 10800817 ldw r2,32(r2)
  3965. 4329c: e17fff17 ldw r5,-4(fp)
  3966. 432a0: e13ffd17 ldw r4,-12(fp)
  3967. 432a4: 103ee83a callr r2
  3968. 432a8: 00000a06 br 432d4 <fstat+0xa4>
  3969. * device.
  3970. */
  3971. else
  3972. {
  3973. st->st_mode = _IFCHR;
  3974. 432ac: e0bfff17 ldw r2,-4(fp)
  3975. 432b0: 00c80004 movi r3,8192
  3976. 432b4: 10c00115 stw r3,4(r2)
  3977. return 0;
  3978. 432b8: 0005883a mov r2,zero
  3979. 432bc: 00000506 br 432d4 <fstat+0xa4>
  3980. }
  3981. }
  3982. else
  3983. {
  3984. ALT_ERRNO = EBADFD;
  3985. 432c0: 00431f40 call 431f4 <alt_get_errno>
  3986. 432c4: 1007883a mov r3,r2
  3987. 432c8: 00801444 movi r2,81
  3988. 432cc: 18800015 stw r2,0(r3)
  3989. return -1;
  3990. 432d0: 00bfffc4 movi r2,-1
  3991. }
  3992. }
  3993. 432d4: e037883a mov sp,fp
  3994. 432d8: dfc00117 ldw ra,4(sp)
  3995. 432dc: df000017 ldw fp,0(sp)
  3996. 432e0: dec00204 addi sp,sp,8
  3997. 432e4: f800283a ret
  3998. 000432e8 <alt_get_errno>:
  3999. #undef errno
  4000. extern int errno;
  4001. static ALT_INLINE int* alt_get_errno(void)
  4002. {
  4003. 432e8: defffe04 addi sp,sp,-8
  4004. 432ec: dfc00115 stw ra,4(sp)
  4005. 432f0: df000015 stw fp,0(sp)
  4006. 432f4: d839883a mov fp,sp
  4007. return ((alt_errno) ? alt_errno() : &errno);
  4008. 432f8: d0a00917 ldw r2,-32732(gp)
  4009. 432fc: 10000326 beq r2,zero,4330c <alt_get_errno+0x24>
  4010. 43300: d0a00917 ldw r2,-32732(gp)
  4011. 43304: 103ee83a callr r2
  4012. 43308: 00000106 br 43310 <alt_get_errno+0x28>
  4013. 4330c: d0a6ac04 addi r2,gp,-25936
  4014. }
  4015. 43310: e037883a mov sp,fp
  4016. 43314: dfc00117 ldw ra,4(sp)
  4017. 43318: df000017 ldw fp,0(sp)
  4018. 4331c: dec00204 addi sp,sp,8
  4019. 43320: f800283a ret
  4020. 00043324 <isatty>:
  4021. *
  4022. * ALT_ISATTY is mapped onto the isatty() system call in alt_syscall.h
  4023. */
  4024. int ALT_ISATTY (int file)
  4025. {
  4026. 43324: deffed04 addi sp,sp,-76
  4027. 43328: dfc01215 stw ra,72(sp)
  4028. 4332c: df001115 stw fp,68(sp)
  4029. 43330: df001104 addi fp,sp,68
  4030. 43334: e13fff15 stw r4,-4(fp)
  4031. * A common error case is that when the file descriptor was created, the call
  4032. * to open() failed resulting in a negative file descriptor. This is trapped
  4033. * below so that we don't try and process an invalid file descriptor.
  4034. */
  4035. fd = (file < 0) ? NULL : &alt_fd_list[file];
  4036. 43338: e0bfff17 ldw r2,-4(fp)
  4037. 4333c: 10000816 blt r2,zero,43360 <isatty+0x3c>
  4038. 43340: 01400304 movi r5,12
  4039. 43344: e13fff17 ldw r4,-4(fp)
  4040. 43348: 004308c0 call 4308c <__mulsi3>
  4041. 4334c: 1007883a mov r3,r2
  4042. 43350: 00800134 movhi r2,4
  4043. 43354: 1097f904 addi r2,r2,24548
  4044. 43358: 1885883a add r2,r3,r2
  4045. 4335c: 00000106 br 43364 <isatty+0x40>
  4046. 43360: 0005883a mov r2,zero
  4047. 43364: e0bfef15 stw r2,-68(fp)
  4048. if (fd)
  4049. 43368: e0bfef17 ldw r2,-68(fp)
  4050. 4336c: 10000e26 beq r2,zero,433a8 <isatty+0x84>
  4051. /*
  4052. * If a device driver does not provide an fstat() function, then it is
  4053. * treated as a terminal device by default.
  4054. */
  4055. if (!fd->dev->fstat)
  4056. 43370: e0bfef17 ldw r2,-68(fp)
  4057. 43374: 10800017 ldw r2,0(r2)
  4058. 43378: 10800817 ldw r2,32(r2)
  4059. 4337c: 1000021e bne r2,zero,43388 <isatty+0x64>
  4060. {
  4061. return 1;
  4062. 43380: 00800044 movi r2,1
  4063. 43384: 00000d06 br 433bc <isatty+0x98>
  4064. * this is called so that the device can identify itself.
  4065. */
  4066. else
  4067. {
  4068. fstat (file, &stat);
  4069. 43388: e0bff004 addi r2,fp,-64
  4070. 4338c: 100b883a mov r5,r2
  4071. 43390: e13fff17 ldw r4,-4(fp)
  4072. 43394: 00432300 call 43230 <fstat>
  4073. return (stat.st_mode == _IFCHR) ? 1 : 0;
  4074. 43398: e0bff117 ldw r2,-60(fp)
  4075. 4339c: 10880020 cmpeqi r2,r2,8192
  4076. 433a0: 10803fcc andi r2,r2,255
  4077. 433a4: 00000506 br 433bc <isatty+0x98>
  4078. }
  4079. }
  4080. else
  4081. {
  4082. ALT_ERRNO = EBADFD;
  4083. 433a8: 00432e80 call 432e8 <alt_get_errno>
  4084. 433ac: 1007883a mov r3,r2
  4085. 433b0: 00801444 movi r2,81
  4086. 433b4: 18800015 stw r2,0(r3)
  4087. return 0;
  4088. 433b8: 0005883a mov r2,zero
  4089. }
  4090. }
  4091. 433bc: e037883a mov sp,fp
  4092. 433c0: dfc00117 ldw ra,4(sp)
  4093. 433c4: df000017 ldw fp,0(sp)
  4094. 433c8: dec00204 addi sp,sp,8
  4095. 433cc: f800283a ret
  4096. 000433d0 <alt_load_section>:
  4097. */
  4098. static void ALT_INLINE alt_load_section (alt_u32* from,
  4099. alt_u32* to,
  4100. alt_u32* end)
  4101. {
  4102. 433d0: defffc04 addi sp,sp,-16
  4103. 433d4: df000315 stw fp,12(sp)
  4104. 433d8: df000304 addi fp,sp,12
  4105. 433dc: e13ffd15 stw r4,-12(fp)
  4106. 433e0: e17ffe15 stw r5,-8(fp)
  4107. 433e4: e1bfff15 stw r6,-4(fp)
  4108. if (to != from)
  4109. 433e8: e0fffe17 ldw r3,-8(fp)
  4110. 433ec: e0bffd17 ldw r2,-12(fp)
  4111. 433f0: 18800c26 beq r3,r2,43424 <alt_load_section+0x54>
  4112. {
  4113. while( to != end )
  4114. 433f4: 00000806 br 43418 <alt_load_section+0x48>
  4115. {
  4116. *to++ = *from++;
  4117. 433f8: e0bffe17 ldw r2,-8(fp)
  4118. 433fc: 10c00104 addi r3,r2,4
  4119. 43400: e0fffe15 stw r3,-8(fp)
  4120. 43404: e0fffd17 ldw r3,-12(fp)
  4121. 43408: 19000104 addi r4,r3,4
  4122. 4340c: e13ffd15 stw r4,-12(fp)
  4123. 43410: 18c00017 ldw r3,0(r3)
  4124. 43414: 10c00015 stw r3,0(r2)
  4125. alt_u32* to,
  4126. alt_u32* end)
  4127. {
  4128. if (to != from)
  4129. {
  4130. while( to != end )
  4131. 43418: e0fffe17 ldw r3,-8(fp)
  4132. 4341c: e0bfff17 ldw r2,-4(fp)
  4133. 43420: 18bff51e bne r3,r2,433f8 <alt_load_section+0x28>
  4134. {
  4135. *to++ = *from++;
  4136. }
  4137. }
  4138. }
  4139. 43424: 0001883a nop
  4140. 43428: e037883a mov sp,fp
  4141. 4342c: df000017 ldw fp,0(sp)
  4142. 43430: dec00104 addi sp,sp,4
  4143. 43434: f800283a ret
  4144. 00043438 <alt_load>:
  4145. * there is no bootloader, so this application is responsible for loading to
  4146. * RAM any sections that are required.
  4147. */
  4148. void alt_load (void)
  4149. {
  4150. 43438: defffe04 addi sp,sp,-8
  4151. 4343c: dfc00115 stw ra,4(sp)
  4152. 43440: df000015 stw fp,0(sp)
  4153. 43444: d839883a mov fp,sp
  4154. /*
  4155. * Copy the .rwdata section.
  4156. */
  4157. alt_load_section (&__flash_rwdata_start,
  4158. 43448: 01800134 movhi r6,4
  4159. 4344c: 319c7f04 addi r6,r6,29180
  4160. 43450: 01400134 movhi r5,4
  4161. 43454: 2955e404 addi r5,r5,22416
  4162. 43458: 01000134 movhi r4,4
  4163. 4345c: 211c7f04 addi r4,r4,29180
  4164. 43460: 00433d00 call 433d0 <alt_load_section>
  4165. /*
  4166. * Copy the exception handler.
  4167. */
  4168. alt_load_section (&__flash_exceptions_start,
  4169. 43464: 01800134 movhi r6,4
  4170. 43468: 31808c04 addi r6,r6,560
  4171. 4346c: 01400134 movhi r5,4
  4172. 43470: 29400804 addi r5,r5,32
  4173. 43474: 01000134 movhi r4,4
  4174. 43478: 21000804 addi r4,r4,32
  4175. 4347c: 00433d00 call 433d0 <alt_load_section>
  4176. /*
  4177. * Copy the .rodata section.
  4178. */
  4179. alt_load_section (&__flash_rodata_start,
  4180. 43480: 01800134 movhi r6,4
  4181. 43484: 3195e404 addi r6,r6,22416
  4182. 43488: 01400134 movhi r5,4
  4183. 4348c: 2955d204 addi r5,r5,22344
  4184. 43490: 01000134 movhi r4,4
  4185. 43494: 2115d204 addi r4,r4,22344
  4186. 43498: 00433d00 call 433d0 <alt_load_section>
  4187. /*
  4188. * Now ensure that the caches are in synch.
  4189. */
  4190. alt_dcache_flush_all();
  4191. 4349c: 00446900 call 44690 <alt_dcache_flush_all>
  4192. alt_icache_flush_all();
  4193. 434a0: 00448500 call 44850 <alt_icache_flush_all>
  4194. }
  4195. 434a4: 0001883a nop
  4196. 434a8: e037883a mov sp,fp
  4197. 434ac: dfc00117 ldw ra,4(sp)
  4198. 434b0: df000017 ldw fp,0(sp)
  4199. 434b4: dec00204 addi sp,sp,8
  4200. 434b8: f800283a ret
  4201. 000434bc <alt_get_errno>:
  4202. #undef errno
  4203. extern int errno;
  4204. static ALT_INLINE int* alt_get_errno(void)
  4205. {
  4206. 434bc: defffe04 addi sp,sp,-8
  4207. 434c0: dfc00115 stw ra,4(sp)
  4208. 434c4: df000015 stw fp,0(sp)
  4209. 434c8: d839883a mov fp,sp
  4210. return ((alt_errno) ? alt_errno() : &errno);
  4211. 434cc: d0a00917 ldw r2,-32732(gp)
  4212. 434d0: 10000326 beq r2,zero,434e0 <alt_get_errno+0x24>
  4213. 434d4: d0a00917 ldw r2,-32732(gp)
  4214. 434d8: 103ee83a callr r2
  4215. 434dc: 00000106 br 434e4 <alt_get_errno+0x28>
  4216. 434e0: d0a6ac04 addi r2,gp,-25936
  4217. }
  4218. 434e4: e037883a mov sp,fp
  4219. 434e8: dfc00117 ldw ra,4(sp)
  4220. 434ec: df000017 ldw fp,0(sp)
  4221. 434f0: dec00204 addi sp,sp,8
  4222. 434f4: f800283a ret
  4223. 000434f8 <lseek>:
  4224. * ALT_LSEEK is mapped onto the lseek() system call in alt_syscall.h
  4225. *
  4226. */
  4227. off_t ALT_LSEEK (int file, off_t ptr, int dir)
  4228. {
  4229. 434f8: defff904 addi sp,sp,-28
  4230. 434fc: dfc00615 stw ra,24(sp)
  4231. 43500: df000515 stw fp,20(sp)
  4232. 43504: df000504 addi fp,sp,20
  4233. 43508: e13ffd15 stw r4,-12(fp)
  4234. 4350c: e17ffe15 stw r5,-8(fp)
  4235. 43510: e1bfff15 stw r6,-4(fp)
  4236. alt_fd* fd;
  4237. off_t rc = 0;
  4238. 43514: e03ffb15 stw zero,-20(fp)
  4239. * A common error case is that when the file descriptor was created, the call
  4240. * to open() failed resulting in a negative file descriptor. This is trapped
  4241. * below so that we don't try and process an invalid file descriptor.
  4242. */
  4243. fd = (file < 0) ? NULL : &alt_fd_list[file];
  4244. 43518: e0bffd17 ldw r2,-12(fp)
  4245. 4351c: 10000816 blt r2,zero,43540 <lseek+0x48>
  4246. 43520: 01400304 movi r5,12
  4247. 43524: e13ffd17 ldw r4,-12(fp)
  4248. 43528: 004308c0 call 4308c <__mulsi3>
  4249. 4352c: 1007883a mov r3,r2
  4250. 43530: 00800134 movhi r2,4
  4251. 43534: 1097f904 addi r2,r2,24548
  4252. 43538: 1885883a add r2,r3,r2
  4253. 4353c: 00000106 br 43544 <lseek+0x4c>
  4254. 43540: 0005883a mov r2,zero
  4255. 43544: e0bffc15 stw r2,-16(fp)
  4256. if (fd)
  4257. 43548: e0bffc17 ldw r2,-16(fp)
  4258. 4354c: 10001026 beq r2,zero,43590 <lseek+0x98>
  4259. /*
  4260. * If the device driver provides an implementation of the lseek() function,
  4261. * then call that to process the request.
  4262. */
  4263. if (fd->dev->lseek)
  4264. 43550: e0bffc17 ldw r2,-16(fp)
  4265. 43554: 10800017 ldw r2,0(r2)
  4266. 43558: 10800717 ldw r2,28(r2)
  4267. 4355c: 10000926 beq r2,zero,43584 <lseek+0x8c>
  4268. {
  4269. rc = fd->dev->lseek(fd, ptr, dir);
  4270. 43560: e0bffc17 ldw r2,-16(fp)
  4271. 43564: 10800017 ldw r2,0(r2)
  4272. 43568: 10800717 ldw r2,28(r2)
  4273. 4356c: e1bfff17 ldw r6,-4(fp)
  4274. 43570: e17ffe17 ldw r5,-8(fp)
  4275. 43574: e13ffc17 ldw r4,-16(fp)
  4276. 43578: 103ee83a callr r2
  4277. 4357c: e0bffb15 stw r2,-20(fp)
  4278. 43580: 00000506 br 43598 <lseek+0xa0>
  4279. * Otherwise return an error.
  4280. */
  4281. else
  4282. {
  4283. rc = -ENOTSUP;
  4284. 43584: 00bfde84 movi r2,-134
  4285. 43588: e0bffb15 stw r2,-20(fp)
  4286. 4358c: 00000206 br 43598 <lseek+0xa0>
  4287. }
  4288. }
  4289. else
  4290. {
  4291. rc = -EBADFD;
  4292. 43590: 00bfebc4 movi r2,-81
  4293. 43594: e0bffb15 stw r2,-20(fp)
  4294. }
  4295. if (rc < 0)
  4296. 43598: e0bffb17 ldw r2,-20(fp)
  4297. 4359c: 1000070e bge r2,zero,435bc <lseek+0xc4>
  4298. {
  4299. ALT_ERRNO = -rc;
  4300. 435a0: 00434bc0 call 434bc <alt_get_errno>
  4301. 435a4: 1007883a mov r3,r2
  4302. 435a8: e0bffb17 ldw r2,-20(fp)
  4303. 435ac: 0085c83a sub r2,zero,r2
  4304. 435b0: 18800015 stw r2,0(r3)
  4305. rc = -1;
  4306. 435b4: 00bfffc4 movi r2,-1
  4307. 435b8: e0bffb15 stw r2,-20(fp)
  4308. }
  4309. return rc;
  4310. 435bc: e0bffb17 ldw r2,-20(fp)
  4311. }
  4312. 435c0: e037883a mov sp,fp
  4313. 435c4: dfc00117 ldw ra,4(sp)
  4314. 435c8: df000017 ldw fp,0(sp)
  4315. 435cc: dec00204 addi sp,sp,8
  4316. 435d0: f800283a ret
  4317. 000435d4 <alt_main>:
  4318. * devices/filesystems/components in the system; and call the entry point for
  4319. * the users application, i.e. main().
  4320. */
  4321. void alt_main (void)
  4322. {
  4323. 435d4: defffd04 addi sp,sp,-12
  4324. 435d8: dfc00215 stw ra,8(sp)
  4325. 435dc: df000115 stw fp,4(sp)
  4326. 435e0: df000104 addi fp,sp,4
  4327. #endif
  4328. /* ALT LOG - please see HAL/sys/alt_log_printf.h for details */
  4329. ALT_LOG_PRINT_BOOT("[alt_main.c] Entering alt_main, calling alt_irq_init.\r\n");
  4330. /* Initialize the interrupt controller. */
  4331. alt_irq_init (NULL);
  4332. 435e4: 0009883a mov r4,zero
  4333. 435e8: 0043a7c0 call 43a7c <alt_irq_init>
  4334. /* Initialize the operating system */
  4335. ALT_LOG_PRINT_BOOT("[alt_main.c] Done alt_irq_init, calling alt_os_init.\r\n");
  4336. ALT_OS_INIT();
  4337. 435ec: 0001883a nop
  4338. ALT_LOG_PRINT_BOOT("[alt_main.c] Done OS Init, calling alt_sem_create.\r\n");
  4339. ALT_SEM_CREATE (&alt_fd_list_lock, 1);
  4340. /* Initialize the device drivers/software components. */
  4341. ALT_LOG_PRINT_BOOT("[alt_main.c] Calling alt_sys_init.\r\n");
  4342. alt_sys_init();
  4343. 435f0: 0043ab40 call 43ab4 <alt_sys_init>
  4344. * devices be present (not equal to /dev/null) and if direct drivers
  4345. * aren't being used.
  4346. */
  4347. ALT_LOG_PRINT_BOOT("[alt_main.c] Redirecting IO.\r\n");
  4348. alt_io_redirect(ALT_STDOUT, ALT_STDIN, ALT_STDERR);
  4349. 435f4: 01800134 movhi r6,4
  4350. 435f8: 3195dc04 addi r6,r6,22384
  4351. 435fc: 01400134 movhi r5,4
  4352. 43600: 2955dc04 addi r5,r5,22384
  4353. 43604: 01000134 movhi r4,4
  4354. 43608: 2115dc04 addi r4,r4,22384
  4355. 4360c: 0044bf40 call 44bf4 <alt_io_redirect>
  4356. /*
  4357. * Call the C++ constructors
  4358. */
  4359. ALT_LOG_PRINT_BOOT("[alt_main.c] Calling C++ constructors.\r\n");
  4360. _do_ctors ();
  4361. 43610: 00447900 call 44790 <_do_ctors>
  4362. * redefined as _exit()). This is in the interest of reducing code footprint,
  4363. * in that the atexit() overhead is removed when it's not needed.
  4364. */
  4365. ALT_LOG_PRINT_BOOT("[alt_main.c] Calling atexit.\r\n");
  4366. atexit (_do_dtors);
  4367. 43614: 01000134 movhi r4,4
  4368. 43618: 2111fc04 addi r4,r4,18416
  4369. 4361c: 00453b40 call 453b4 <atexit>
  4370. ALT_LOG_PRINT_BOOT("[alt_main.c] Calling main.\r\n");
  4371. #ifdef ALT_NO_EXIT
  4372. main (alt_argc, alt_argv, alt_envp);
  4373. #else
  4374. result = main (alt_argc, alt_argv, alt_envp);
  4375. 43620: d0a6ad17 ldw r2,-25932(gp)
  4376. 43624: d0e6ae17 ldw r3,-25928(gp)
  4377. 43628: d126af17 ldw r4,-25924(gp)
  4378. 4362c: 200d883a mov r6,r4
  4379. 43630: 180b883a mov r5,r3
  4380. 43634: 1009883a mov r4,r2
  4381. 43638: 004026c0 call 4026c <main>
  4382. 4363c: e0bfff15 stw r2,-4(fp)
  4383. close(STDOUT_FILENO);
  4384. 43640: 01000044 movi r4,1
  4385. 43644: 00430f00 call 430f0 <close>
  4386. exit (result);
  4387. 43648: e13fff17 ldw r4,-4(fp)
  4388. 4364c: 00453c80 call 453c8 <exit>
  4389. 00043650 <__malloc_lock>:
  4390. * configuration is single threaded, so there is nothing to do here. Note that
  4391. * this requires that malloc is never called by an interrupt service routine.
  4392. */
  4393. void __malloc_lock ( struct _reent *_r )
  4394. {
  4395. 43650: defffe04 addi sp,sp,-8
  4396. 43654: df000115 stw fp,4(sp)
  4397. 43658: df000104 addi fp,sp,4
  4398. 4365c: e13fff15 stw r4,-4(fp)
  4399. }
  4400. 43660: 0001883a nop
  4401. 43664: e037883a mov sp,fp
  4402. 43668: df000017 ldw fp,0(sp)
  4403. 4366c: dec00104 addi sp,sp,4
  4404. 43670: f800283a ret
  4405. 00043674 <__malloc_unlock>:
  4406. /*
  4407. *
  4408. */
  4409. void __malloc_unlock ( struct _reent *_r )
  4410. {
  4411. 43674: defffe04 addi sp,sp,-8
  4412. 43678: df000115 stw fp,4(sp)
  4413. 4367c: df000104 addi fp,sp,4
  4414. 43680: e13fff15 stw r4,-4(fp)
  4415. }
  4416. 43684: 0001883a nop
  4417. 43688: e037883a mov sp,fp
  4418. 4368c: df000017 ldw fp,0(sp)
  4419. 43690: dec00104 addi sp,sp,4
  4420. 43694: f800283a ret
  4421. 00043698 <alt_get_errno>:
  4422. #undef errno
  4423. extern int errno;
  4424. static ALT_INLINE int* alt_get_errno(void)
  4425. {
  4426. 43698: defffe04 addi sp,sp,-8
  4427. 4369c: dfc00115 stw ra,4(sp)
  4428. 436a0: df000015 stw fp,0(sp)
  4429. 436a4: d839883a mov fp,sp
  4430. return ((alt_errno) ? alt_errno() : &errno);
  4431. 436a8: d0a00917 ldw r2,-32732(gp)
  4432. 436ac: 10000326 beq r2,zero,436bc <alt_get_errno+0x24>
  4433. 436b0: d0a00917 ldw r2,-32732(gp)
  4434. 436b4: 103ee83a callr r2
  4435. 436b8: 00000106 br 436c0 <alt_get_errno+0x28>
  4436. 436bc: d0a6ac04 addi r2,gp,-25936
  4437. }
  4438. 436c0: e037883a mov sp,fp
  4439. 436c4: dfc00117 ldw ra,4(sp)
  4440. 436c8: df000017 ldw fp,0(sp)
  4441. 436cc: dec00204 addi sp,sp,8
  4442. 436d0: f800283a ret
  4443. 000436d4 <read>:
  4444. }
  4445. #else /* !ALT_USE_DIRECT_DRIVERS */
  4446. int ALT_READ (int file, void *ptr, size_t len)
  4447. {
  4448. 436d4: defff904 addi sp,sp,-28
  4449. 436d8: dfc00615 stw ra,24(sp)
  4450. 436dc: df000515 stw fp,20(sp)
  4451. 436e0: df000504 addi fp,sp,20
  4452. 436e4: e13ffd15 stw r4,-12(fp)
  4453. 436e8: e17ffe15 stw r5,-8(fp)
  4454. 436ec: e1bfff15 stw r6,-4(fp)
  4455. * A common error case is that when the file descriptor was created, the call
  4456. * to open() failed resulting in a negative file descriptor. This is trapped
  4457. * below so that we don't try and process an invalid file descriptor.
  4458. */
  4459. fd = (file < 0) ? NULL : &alt_fd_list[file];
  4460. 436f0: e0bffd17 ldw r2,-12(fp)
  4461. 436f4: 10000816 blt r2,zero,43718 <read+0x44>
  4462. 436f8: 01400304 movi r5,12
  4463. 436fc: e13ffd17 ldw r4,-12(fp)
  4464. 43700: 004308c0 call 4308c <__mulsi3>
  4465. 43704: 1007883a mov r3,r2
  4466. 43708: 00800134 movhi r2,4
  4467. 4370c: 1097f904 addi r2,r2,24548
  4468. 43710: 1885883a add r2,r3,r2
  4469. 43714: 00000106 br 4371c <read+0x48>
  4470. 43718: 0005883a mov r2,zero
  4471. 4371c: e0bffb15 stw r2,-20(fp)
  4472. if (fd)
  4473. 43720: e0bffb17 ldw r2,-20(fp)
  4474. 43724: 10002226 beq r2,zero,437b0 <read+0xdc>
  4475. * If the file has not been opened with read access, or if the driver does
  4476. * not provide an implementation of read(), generate an error. Otherwise
  4477. * call the drivers read() function to process the request.
  4478. */
  4479. if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) &&
  4480. 43728: e0bffb17 ldw r2,-20(fp)
  4481. 4372c: 10800217 ldw r2,8(r2)
  4482. 43730: 108000cc andi r2,r2,3
  4483. 43734: 10800060 cmpeqi r2,r2,1
  4484. 43738: 1000181e bne r2,zero,4379c <read+0xc8>
  4485. (fd->dev->read))
  4486. 4373c: e0bffb17 ldw r2,-20(fp)
  4487. 43740: 10800017 ldw r2,0(r2)
  4488. 43744: 10800517 ldw r2,20(r2)
  4489. * If the file has not been opened with read access, or if the driver does
  4490. * not provide an implementation of read(), generate an error. Otherwise
  4491. * call the drivers read() function to process the request.
  4492. */
  4493. if (((fd->fd_flags & O_ACCMODE) != O_WRONLY) &&
  4494. 43748: 10001426 beq r2,zero,4379c <read+0xc8>
  4495. (fd->dev->read))
  4496. {
  4497. if ((rval = fd->dev->read(fd, ptr, len)) < 0)
  4498. 4374c: e0bffb17 ldw r2,-20(fp)
  4499. 43750: 10800017 ldw r2,0(r2)
  4500. 43754: 10800517 ldw r2,20(r2)
  4501. 43758: e0ffff17 ldw r3,-4(fp)
  4502. 4375c: 180d883a mov r6,r3
  4503. 43760: e17ffe17 ldw r5,-8(fp)
  4504. 43764: e13ffb17 ldw r4,-20(fp)
  4505. 43768: 103ee83a callr r2
  4506. 4376c: e0bffc15 stw r2,-16(fp)
  4507. 43770: e0bffc17 ldw r2,-16(fp)
  4508. 43774: 1000070e bge r2,zero,43794 <read+0xc0>
  4509. {
  4510. ALT_ERRNO = -rval;
  4511. 43778: 00436980 call 43698 <alt_get_errno>
  4512. 4377c: 1007883a mov r3,r2
  4513. 43780: e0bffc17 ldw r2,-16(fp)
  4514. 43784: 0085c83a sub r2,zero,r2
  4515. 43788: 18800015 stw r2,0(r3)
  4516. return -1;
  4517. 4378c: 00bfffc4 movi r2,-1
  4518. 43790: 00000c06 br 437c4 <read+0xf0>
  4519. }
  4520. return rval;
  4521. 43794: e0bffc17 ldw r2,-16(fp)
  4522. 43798: 00000a06 br 437c4 <read+0xf0>
  4523. }
  4524. else
  4525. {
  4526. ALT_ERRNO = EACCES;
  4527. 4379c: 00436980 call 43698 <alt_get_errno>
  4528. 437a0: 1007883a mov r3,r2
  4529. 437a4: 00800344 movi r2,13
  4530. 437a8: 18800015 stw r2,0(r3)
  4531. 437ac: 00000406 br 437c0 <read+0xec>
  4532. }
  4533. }
  4534. else
  4535. {
  4536. ALT_ERRNO = EBADFD;
  4537. 437b0: 00436980 call 43698 <alt_get_errno>
  4538. 437b4: 1007883a mov r3,r2
  4539. 437b8: 00801444 movi r2,81
  4540. 437bc: 18800015 stw r2,0(r3)
  4541. }
  4542. return -1;
  4543. 437c0: 00bfffc4 movi r2,-1
  4544. }
  4545. 437c4: e037883a mov sp,fp
  4546. 437c8: dfc00117 ldw ra,4(sp)
  4547. 437cc: df000017 ldw fp,0(sp)
  4548. 437d0: dec00204 addi sp,sp,8
  4549. 437d4: f800283a ret
  4550. 000437d8 <alt_release_fd>:
  4551. * File descriptors correcponding to standard in, standard out and standard
  4552. * error cannont be released backed to the pool. They are always reserved.
  4553. */
  4554. void alt_release_fd (int fd)
  4555. {
  4556. 437d8: defffc04 addi sp,sp,-16
  4557. 437dc: dfc00315 stw ra,12(sp)
  4558. 437e0: df000215 stw fp,8(sp)
  4559. 437e4: dc000115 stw r16,4(sp)
  4560. 437e8: df000204 addi fp,sp,8
  4561. 437ec: e13ffe15 stw r4,-8(fp)
  4562. if (fd > 2)
  4563. 437f0: e0bffe17 ldw r2,-8(fp)
  4564. 437f4: 108000d0 cmplti r2,r2,3
  4565. 437f8: 1000111e bne r2,zero,43840 <alt_release_fd+0x68>
  4566. {
  4567. alt_fd_list[fd].fd_flags = 0;
  4568. 437fc: 04000134 movhi r16,4
  4569. 43800: 8417f904 addi r16,r16,24548
  4570. 43804: e0bffe17 ldw r2,-8(fp)
  4571. 43808: 01400304 movi r5,12
  4572. 4380c: 1009883a mov r4,r2
  4573. 43810: 004308c0 call 4308c <__mulsi3>
  4574. 43814: 8085883a add r2,r16,r2
  4575. 43818: 10800204 addi r2,r2,8
  4576. 4381c: 10000015 stw zero,0(r2)
  4577. alt_fd_list[fd].dev = 0;
  4578. 43820: 04000134 movhi r16,4
  4579. 43824: 8417f904 addi r16,r16,24548
  4580. 43828: e0bffe17 ldw r2,-8(fp)
  4581. 4382c: 01400304 movi r5,12
  4582. 43830: 1009883a mov r4,r2
  4583. 43834: 004308c0 call 4308c <__mulsi3>
  4584. 43838: 8085883a add r2,r16,r2
  4585. 4383c: 10000015 stw zero,0(r2)
  4586. }
  4587. }
  4588. 43840: 0001883a nop
  4589. 43844: e6ffff04 addi sp,fp,-4
  4590. 43848: dfc00217 ldw ra,8(sp)
  4591. 4384c: df000117 ldw fp,4(sp)
  4592. 43850: dc000017 ldw r16,0(sp)
  4593. 43854: dec00304 addi sp,sp,12
  4594. 43858: f800283a ret
  4595. 0004385c <sbrk>:
  4596. #endif
  4597. caddr_t ALT_SBRK (int incr) __attribute__ ((no_instrument_function ));
  4598. caddr_t ALT_SBRK (int incr)
  4599. {
  4600. 4385c: defff904 addi sp,sp,-28
  4601. 43860: df000615 stw fp,24(sp)
  4602. 43864: df000604 addi fp,sp,24
  4603. 43868: e13fff15 stw r4,-4(fp)
  4604. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  4605. alt_irq_disable_all (void)
  4606. {
  4607. alt_irq_context context;
  4608. NIOS2_READ_STATUS (context);
  4609. 4386c: 0005303a rdctl r2,status
  4610. 43870: e0bffe15 stw r2,-8(fp)
  4611. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  4612. 43874: e0fffe17 ldw r3,-8(fp)
  4613. 43878: 00bfff84 movi r2,-2
  4614. 4387c: 1884703a and r2,r3,r2
  4615. 43880: 1001703a wrctl status,r2
  4616. return context;
  4617. 43884: e0bffe17 ldw r2,-8(fp)
  4618. alt_irq_context context;
  4619. char *prev_heap_end;
  4620. context = alt_irq_disable_all();
  4621. 43888: e0bffb15 stw r2,-20(fp)
  4622. /* Always return data aligned on a word boundary */
  4623. heap_end = (char *)(((unsigned int)heap_end + 3) & ~3);
  4624. 4388c: d0a00a17 ldw r2,-32728(gp)
  4625. 43890: 10c000c4 addi r3,r2,3
  4626. 43894: 00bfff04 movi r2,-4
  4627. 43898: 1884703a and r2,r3,r2
  4628. 4389c: d0a00a15 stw r2,-32728(gp)
  4629. if (((heap_end + incr) - __alt_heap_start) > ALT_MAX_HEAP_BYTES) {
  4630. alt_irq_enable_all(context);
  4631. return (caddr_t)-1;
  4632. }
  4633. #else
  4634. if ((heap_end + incr) > __alt_heap_limit) {
  4635. 438a0: d0e00a17 ldw r3,-32728(gp)
  4636. 438a4: e0bfff17 ldw r2,-4(fp)
  4637. 438a8: 1887883a add r3,r3,r2
  4638. 438ac: 008001f4 movhi r2,7
  4639. 438b0: 10880004 addi r2,r2,8192
  4640. 438b4: 10c0062e bgeu r2,r3,438d0 <sbrk+0x74>
  4641. 438b8: e0bffb17 ldw r2,-20(fp)
  4642. 438bc: e0bffa15 stw r2,-24(fp)
  4643. status &= ~NIOS2_STATUS_PIE_MSK;
  4644. status |= (context & NIOS2_STATUS_PIE_MSK);
  4645. NIOS2_WRITE_STATUS (status);
  4646. #else
  4647. NIOS2_WRITE_STATUS (context);
  4648. 438c0: e0bffa17 ldw r2,-24(fp)
  4649. 438c4: 1001703a wrctl status,r2
  4650. alt_irq_enable_all(context);
  4651. return (caddr_t)-1;
  4652. 438c8: 00bfffc4 movi r2,-1
  4653. 438cc: 00000b06 br 438fc <sbrk+0xa0>
  4654. }
  4655. #endif
  4656. prev_heap_end = heap_end;
  4657. 438d0: d0a00a17 ldw r2,-32728(gp)
  4658. 438d4: e0bffd15 stw r2,-12(fp)
  4659. heap_end += incr;
  4660. 438d8: d0e00a17 ldw r3,-32728(gp)
  4661. 438dc: e0bfff17 ldw r2,-4(fp)
  4662. 438e0: 1885883a add r2,r3,r2
  4663. 438e4: d0a00a15 stw r2,-32728(gp)
  4664. 438e8: e0bffb17 ldw r2,-20(fp)
  4665. 438ec: e0bffc15 stw r2,-16(fp)
  4666. 438f0: e0bffc17 ldw r2,-16(fp)
  4667. 438f4: 1001703a wrctl status,r2
  4668. #endif
  4669. alt_irq_enable_all(context);
  4670. return (caddr_t) prev_heap_end;
  4671. 438f8: e0bffd17 ldw r2,-12(fp)
  4672. }
  4673. 438fc: e037883a mov sp,fp
  4674. 43900: df000017 ldw fp,0(sp)
  4675. 43904: dec00104 addi sp,sp,4
  4676. 43908: f800283a ret
  4677. 0004390c <alt_get_errno>:
  4678. #undef errno
  4679. extern int errno;
  4680. static ALT_INLINE int* alt_get_errno(void)
  4681. {
  4682. 4390c: defffe04 addi sp,sp,-8
  4683. 43910: dfc00115 stw ra,4(sp)
  4684. 43914: df000015 stw fp,0(sp)
  4685. 43918: d839883a mov fp,sp
  4686. return ((alt_errno) ? alt_errno() : &errno);
  4687. 4391c: d0a00917 ldw r2,-32732(gp)
  4688. 43920: 10000326 beq r2,zero,43930 <alt_get_errno+0x24>
  4689. 43924: d0a00917 ldw r2,-32732(gp)
  4690. 43928: 103ee83a callr r2
  4691. 4392c: 00000106 br 43934 <alt_get_errno+0x28>
  4692. 43930: d0a6ac04 addi r2,gp,-25936
  4693. }
  4694. 43934: e037883a mov sp,fp
  4695. 43938: dfc00117 ldw ra,4(sp)
  4696. 4393c: df000017 ldw fp,0(sp)
  4697. 43940: dec00204 addi sp,sp,8
  4698. 43944: f800283a ret
  4699. 00043948 <write>:
  4700. }
  4701. #else /* !ALT_USE_DIRECT_DRIVERS */
  4702. int ALT_WRITE (int file, const void *ptr, size_t len)
  4703. {
  4704. 43948: defff904 addi sp,sp,-28
  4705. 4394c: dfc00615 stw ra,24(sp)
  4706. 43950: df000515 stw fp,20(sp)
  4707. 43954: df000504 addi fp,sp,20
  4708. 43958: e13ffd15 stw r4,-12(fp)
  4709. 4395c: e17ffe15 stw r5,-8(fp)
  4710. 43960: e1bfff15 stw r6,-4(fp)
  4711. * A common error case is that when the file descriptor was created, the call
  4712. * to open() failed resulting in a negative file descriptor. This is trapped
  4713. * below so that we don't try and process an invalid file descriptor.
  4714. */
  4715. fd = (file < 0) ? NULL : &alt_fd_list[file];
  4716. 43964: e0bffd17 ldw r2,-12(fp)
  4717. 43968: 10000816 blt r2,zero,4398c <write+0x44>
  4718. 4396c: 01400304 movi r5,12
  4719. 43970: e13ffd17 ldw r4,-12(fp)
  4720. 43974: 004308c0 call 4308c <__mulsi3>
  4721. 43978: 1007883a mov r3,r2
  4722. 4397c: 00800134 movhi r2,4
  4723. 43980: 1097f904 addi r2,r2,24548
  4724. 43984: 1885883a add r2,r3,r2
  4725. 43988: 00000106 br 43990 <write+0x48>
  4726. 4398c: 0005883a mov r2,zero
  4727. 43990: e0bffb15 stw r2,-20(fp)
  4728. if (fd)
  4729. 43994: e0bffb17 ldw r2,-20(fp)
  4730. 43998: 10002126 beq r2,zero,43a20 <write+0xd8>
  4731. * If the file has not been opened with write access, or if the driver does
  4732. * not provide an implementation of write(), generate an error. Otherwise
  4733. * call the drivers write() function to process the request.
  4734. */
  4735. if (((fd->fd_flags & O_ACCMODE) != O_RDONLY) && fd->dev->write)
  4736. 4399c: e0bffb17 ldw r2,-20(fp)
  4737. 439a0: 10800217 ldw r2,8(r2)
  4738. 439a4: 108000cc andi r2,r2,3
  4739. 439a8: 10001826 beq r2,zero,43a0c <write+0xc4>
  4740. 439ac: e0bffb17 ldw r2,-20(fp)
  4741. 439b0: 10800017 ldw r2,0(r2)
  4742. 439b4: 10800617 ldw r2,24(r2)
  4743. 439b8: 10001426 beq r2,zero,43a0c <write+0xc4>
  4744. {
  4745. /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */
  4746. ALT_LOG_WRITE_FUNCTION(ptr,len);
  4747. if ((rval = fd->dev->write(fd, ptr, len)) < 0)
  4748. 439bc: e0bffb17 ldw r2,-20(fp)
  4749. 439c0: 10800017 ldw r2,0(r2)
  4750. 439c4: 10800617 ldw r2,24(r2)
  4751. 439c8: e0ffff17 ldw r3,-4(fp)
  4752. 439cc: 180d883a mov r6,r3
  4753. 439d0: e17ffe17 ldw r5,-8(fp)
  4754. 439d4: e13ffb17 ldw r4,-20(fp)
  4755. 439d8: 103ee83a callr r2
  4756. 439dc: e0bffc15 stw r2,-16(fp)
  4757. 439e0: e0bffc17 ldw r2,-16(fp)
  4758. 439e4: 1000070e bge r2,zero,43a04 <write+0xbc>
  4759. {
  4760. ALT_ERRNO = -rval;
  4761. 439e8: 004390c0 call 4390c <alt_get_errno>
  4762. 439ec: 1007883a mov r3,r2
  4763. 439f0: e0bffc17 ldw r2,-16(fp)
  4764. 439f4: 0085c83a sub r2,zero,r2
  4765. 439f8: 18800015 stw r2,0(r3)
  4766. return -1;
  4767. 439fc: 00bfffc4 movi r2,-1
  4768. 43a00: 00000c06 br 43a34 <write+0xec>
  4769. }
  4770. return rval;
  4771. 43a04: e0bffc17 ldw r2,-16(fp)
  4772. 43a08: 00000a06 br 43a34 <write+0xec>
  4773. }
  4774. else
  4775. {
  4776. ALT_ERRNO = EACCES;
  4777. 43a0c: 004390c0 call 4390c <alt_get_errno>
  4778. 43a10: 1007883a mov r3,r2
  4779. 43a14: 00800344 movi r2,13
  4780. 43a18: 18800015 stw r2,0(r3)
  4781. 43a1c: 00000406 br 43a30 <write+0xe8>
  4782. }
  4783. }
  4784. else
  4785. {
  4786. ALT_ERRNO = EBADFD;
  4787. 43a20: 004390c0 call 4390c <alt_get_errno>
  4788. 43a24: 1007883a mov r3,r2
  4789. 43a28: 00801444 movi r2,81
  4790. 43a2c: 18800015 stw r2,0(r3)
  4791. }
  4792. return -1;
  4793. 43a30: 00bfffc4 movi r2,-1
  4794. }
  4795. 43a34: e037883a mov sp,fp
  4796. 43a38: dfc00117 ldw ra,4(sp)
  4797. 43a3c: df000017 ldw fp,0(sp)
  4798. 43a40: dec00204 addi sp,sp,8
  4799. 43a44: f800283a ret
  4800. 00043a48 <alt_dev_reg>:
  4801. */
  4802. extern int alt_fs_reg (alt_dev* dev);
  4803. static ALT_INLINE int alt_dev_reg (alt_dev* dev)
  4804. {
  4805. 43a48: defffd04 addi sp,sp,-12
  4806. 43a4c: dfc00215 stw ra,8(sp)
  4807. 43a50: df000115 stw fp,4(sp)
  4808. 43a54: df000104 addi fp,sp,4
  4809. 43a58: e13fff15 stw r4,-4(fp)
  4810. extern alt_llist alt_dev_list;
  4811. return alt_dev_llist_insert ((alt_dev_llist*) dev, &alt_dev_list);
  4812. 43a5c: d1600604 addi r5,gp,-32744
  4813. 43a60: e13fff17 ldw r4,-4(fp)
  4814. 43a64: 00446ec0 call 446ec <alt_dev_llist_insert>
  4815. }
  4816. 43a68: e037883a mov sp,fp
  4817. 43a6c: dfc00117 ldw ra,4(sp)
  4818. 43a70: df000017 ldw fp,0(sp)
  4819. 43a74: dec00204 addi sp,sp,8
  4820. 43a78: f800283a ret
  4821. 00043a7c <alt_irq_init>:
  4822. * The "base" parameter is ignored and only
  4823. * present for backwards-compatibility.
  4824. */
  4825. void alt_irq_init ( const void* base )
  4826. {
  4827. 43a7c: defffd04 addi sp,sp,-12
  4828. 43a80: dfc00215 stw ra,8(sp)
  4829. 43a84: df000115 stw fp,4(sp)
  4830. 43a88: df000104 addi fp,sp,4
  4831. 43a8c: e13fff15 stw r4,-4(fp)
  4832. ALTERA_NIOS2_GEN2_IRQ_INIT ( NIOS2, nios2);
  4833. 43a90: 00450980 call 45098 <altera_nios2_gen2_irq_init>
  4834. * alt_irq_cpu_enable_interrupts() enables the CPU to start taking interrupts.
  4835. */
  4836. static ALT_INLINE void ALT_ALWAYS_INLINE
  4837. alt_irq_cpu_enable_interrupts (void)
  4838. {
  4839. NIOS2_WRITE_STATUS(NIOS2_STATUS_PIE_MSK
  4840. 43a94: 00800044 movi r2,1
  4841. 43a98: 1001703a wrctl status,r2
  4842. alt_irq_cpu_enable_interrupts();
  4843. }
  4844. 43a9c: 0001883a nop
  4845. 43aa0: e037883a mov sp,fp
  4846. 43aa4: dfc00117 ldw ra,4(sp)
  4847. 43aa8: df000017 ldw fp,0(sp)
  4848. 43aac: dec00204 addi sp,sp,8
  4849. 43ab0: f800283a ret
  4850. 00043ab4 <alt_sys_init>:
  4851. * Initialize the non-interrupt controller devices.
  4852. * Called after alt_irq_init().
  4853. */
  4854. void alt_sys_init( void )
  4855. {
  4856. 43ab4: defffe04 addi sp,sp,-8
  4857. 43ab8: dfc00115 stw ra,4(sp)
  4858. 43abc: df000015 stw fp,0(sp)
  4859. 43ac0: d839883a mov fp,sp
  4860. ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart);
  4861. 43ac4: 000d883a mov r6,zero
  4862. 43ac8: 000b883a mov r5,zero
  4863. 43acc: 01000134 movhi r4,4
  4864. 43ad0: 21186304 addi r4,r4,24972
  4865. 43ad4: 0043c600 call 43c60 <altera_avalon_jtag_uart_init>
  4866. 43ad8: 01000134 movhi r4,4
  4867. 43adc: 21185904 addi r4,r4,24932
  4868. 43ae0: 0043a480 call 43a48 <alt_dev_reg>
  4869. }
  4870. 43ae4: 0001883a nop
  4871. 43ae8: e037883a mov sp,fp
  4872. 43aec: dfc00117 ldw ra,4(sp)
  4873. 43af0: df000017 ldw fp,0(sp)
  4874. 43af4: dec00204 addi sp,sp,8
  4875. 43af8: f800283a ret
  4876. 00043afc <altera_avalon_jtag_uart_read_fd>:
  4877. *
  4878. */
  4879. int
  4880. altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space)
  4881. {
  4882. 43afc: defffa04 addi sp,sp,-24
  4883. 43b00: dfc00515 stw ra,20(sp)
  4884. 43b04: df000415 stw fp,16(sp)
  4885. 43b08: df000404 addi fp,sp,16
  4886. 43b0c: e13ffd15 stw r4,-12(fp)
  4887. 43b10: e17ffe15 stw r5,-8(fp)
  4888. 43b14: e1bfff15 stw r6,-4(fp)
  4889. altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;
  4890. 43b18: e0bffd17 ldw r2,-12(fp)
  4891. 43b1c: 10800017 ldw r2,0(r2)
  4892. 43b20: e0bffc15 stw r2,-16(fp)
  4893. return altera_avalon_jtag_uart_read(&dev->state, buffer, space,
  4894. 43b24: e0bffc17 ldw r2,-16(fp)
  4895. 43b28: 10c00a04 addi r3,r2,40
  4896. 43b2c: e0bffd17 ldw r2,-12(fp)
  4897. 43b30: 10800217 ldw r2,8(r2)
  4898. 43b34: 100f883a mov r7,r2
  4899. 43b38: e1bfff17 ldw r6,-4(fp)
  4900. 43b3c: e17ffe17 ldw r5,-8(fp)
  4901. 43b40: 1809883a mov r4,r3
  4902. 43b44: 00441240 call 44124 <altera_avalon_jtag_uart_read>
  4903. fd->fd_flags);
  4904. }
  4905. 43b48: e037883a mov sp,fp
  4906. 43b4c: dfc00117 ldw ra,4(sp)
  4907. 43b50: df000017 ldw fp,0(sp)
  4908. 43b54: dec00204 addi sp,sp,8
  4909. 43b58: f800283a ret
  4910. 00043b5c <altera_avalon_jtag_uart_write_fd>:
  4911. int
  4912. altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space)
  4913. {
  4914. 43b5c: defffa04 addi sp,sp,-24
  4915. 43b60: dfc00515 stw ra,20(sp)
  4916. 43b64: df000415 stw fp,16(sp)
  4917. 43b68: df000404 addi fp,sp,16
  4918. 43b6c: e13ffd15 stw r4,-12(fp)
  4919. 43b70: e17ffe15 stw r5,-8(fp)
  4920. 43b74: e1bfff15 stw r6,-4(fp)
  4921. altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;
  4922. 43b78: e0bffd17 ldw r2,-12(fp)
  4923. 43b7c: 10800017 ldw r2,0(r2)
  4924. 43b80: e0bffc15 stw r2,-16(fp)
  4925. return altera_avalon_jtag_uart_write(&dev->state, buffer, space,
  4926. 43b84: e0bffc17 ldw r2,-16(fp)
  4927. 43b88: 10c00a04 addi r3,r2,40
  4928. 43b8c: e0bffd17 ldw r2,-12(fp)
  4929. 43b90: 10800217 ldw r2,8(r2)
  4930. 43b94: 100f883a mov r7,r2
  4931. 43b98: e1bfff17 ldw r6,-4(fp)
  4932. 43b9c: e17ffe17 ldw r5,-8(fp)
  4933. 43ba0: 1809883a mov r4,r3
  4934. 43ba4: 00443400 call 44340 <altera_avalon_jtag_uart_write>
  4935. fd->fd_flags);
  4936. }
  4937. 43ba8: e037883a mov sp,fp
  4938. 43bac: dfc00117 ldw ra,4(sp)
  4939. 43bb0: df000017 ldw fp,0(sp)
  4940. 43bb4: dec00204 addi sp,sp,8
  4941. 43bb8: f800283a ret
  4942. 00043bbc <altera_avalon_jtag_uart_close_fd>:
  4943. #ifndef ALTERA_AVALON_JTAG_UART_SMALL
  4944. int
  4945. altera_avalon_jtag_uart_close_fd(alt_fd* fd)
  4946. {
  4947. 43bbc: defffc04 addi sp,sp,-16
  4948. 43bc0: dfc00315 stw ra,12(sp)
  4949. 43bc4: df000215 stw fp,8(sp)
  4950. 43bc8: df000204 addi fp,sp,8
  4951. 43bcc: e13fff15 stw r4,-4(fp)
  4952. altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;
  4953. 43bd0: e0bfff17 ldw r2,-4(fp)
  4954. 43bd4: 10800017 ldw r2,0(r2)
  4955. 43bd8: e0bffe15 stw r2,-8(fp)
  4956. return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags);
  4957. 43bdc: e0bffe17 ldw r2,-8(fp)
  4958. 43be0: 10c00a04 addi r3,r2,40
  4959. 43be4: e0bfff17 ldw r2,-4(fp)
  4960. 43be8: 10800217 ldw r2,8(r2)
  4961. 43bec: 100b883a mov r5,r2
  4962. 43bf0: 1809883a mov r4,r3
  4963. 43bf4: 0043fcc0 call 43fcc <altera_avalon_jtag_uart_close>
  4964. }
  4965. 43bf8: e037883a mov sp,fp
  4966. 43bfc: dfc00117 ldw ra,4(sp)
  4967. 43c00: df000017 ldw fp,0(sp)
  4968. 43c04: dec00204 addi sp,sp,8
  4969. 43c08: f800283a ret
  4970. 00043c0c <altera_avalon_jtag_uart_ioctl_fd>:
  4971. int
  4972. altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg)
  4973. {
  4974. 43c0c: defffa04 addi sp,sp,-24
  4975. 43c10: dfc00515 stw ra,20(sp)
  4976. 43c14: df000415 stw fp,16(sp)
  4977. 43c18: df000404 addi fp,sp,16
  4978. 43c1c: e13ffd15 stw r4,-12(fp)
  4979. 43c20: e17ffe15 stw r5,-8(fp)
  4980. 43c24: e1bfff15 stw r6,-4(fp)
  4981. altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;
  4982. 43c28: e0bffd17 ldw r2,-12(fp)
  4983. 43c2c: 10800017 ldw r2,0(r2)
  4984. 43c30: e0bffc15 stw r2,-16(fp)
  4985. return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg);
  4986. 43c34: e0bffc17 ldw r2,-16(fp)
  4987. 43c38: 10800a04 addi r2,r2,40
  4988. 43c3c: e1bfff17 ldw r6,-4(fp)
  4989. 43c40: e17ffe17 ldw r5,-8(fp)
  4990. 43c44: 1009883a mov r4,r2
  4991. 43c48: 00440340 call 44034 <altera_avalon_jtag_uart_ioctl>
  4992. }
  4993. 43c4c: e037883a mov sp,fp
  4994. 43c50: dfc00117 ldw ra,4(sp)
  4995. 43c54: df000017 ldw fp,0(sp)
  4996. 43c58: dec00204 addi sp,sp,8
  4997. 43c5c: f800283a ret
  4998. 00043c60 <altera_avalon_jtag_uart_init>:
  4999. * Return 1 on sucessful IRQ register and 0 on failure.
  5000. */
  5001. void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp,
  5002. int irq_controller_id, int irq)
  5003. {
  5004. 43c60: defffa04 addi sp,sp,-24
  5005. 43c64: dfc00515 stw ra,20(sp)
  5006. 43c68: df000415 stw fp,16(sp)
  5007. 43c6c: df000404 addi fp,sp,16
  5008. 43c70: e13ffd15 stw r4,-12(fp)
  5009. 43c74: e17ffe15 stw r5,-8(fp)
  5010. 43c78: e1bfff15 stw r6,-4(fp)
  5011. ALT_FLAG_CREATE(&sp->events, 0);
  5012. ALT_SEM_CREATE(&sp->read_lock, 1);
  5013. ALT_SEM_CREATE(&sp->write_lock, 1);
  5014. /* enable read interrupts at the device */
  5015. sp->irq_enable = ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK;
  5016. 43c7c: e0bffd17 ldw r2,-12(fp)
  5017. 43c80: 00c00044 movi r3,1
  5018. 43c84: 10c00815 stw r3,32(r2)
  5019. IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable);
  5020. 43c88: e0bffd17 ldw r2,-12(fp)
  5021. 43c8c: 10800017 ldw r2,0(r2)
  5022. 43c90: 10800104 addi r2,r2,4
  5023. 43c94: 1007883a mov r3,r2
  5024. 43c98: e0bffd17 ldw r2,-12(fp)
  5025. 43c9c: 10800817 ldw r2,32(r2)
  5026. 43ca0: 18800035 stwio r2,0(r3)
  5027. /* register the interrupt handler */
  5028. #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT
  5029. alt_ic_isr_register(irq_controller_id, irq, altera_avalon_jtag_uart_irq,
  5030. 43ca4: e0bffe17 ldw r2,-8(fp)
  5031. 43ca8: e0ffff17 ldw r3,-4(fp)
  5032. 43cac: d8000015 stw zero,0(sp)
  5033. 43cb0: e1fffd17 ldw r7,-12(fp)
  5034. 43cb4: 01800134 movhi r6,4
  5035. 43cb8: 318f4804 addi r6,r6,15648
  5036. 43cbc: 180b883a mov r5,r3
  5037. 43cc0: 1009883a mov r4,r2
  5038. 43cc4: 00448700 call 44870 <alt_ic_isr_register>
  5039. #else
  5040. alt_irq_register(irq, sp, altera_avalon_jtag_uart_irq);
  5041. #endif
  5042. /* Register an alarm to go off every second to check for presence of host */
  5043. sp->host_inactive = 0;
  5044. 43cc8: e0bffd17 ldw r2,-12(fp)
  5045. 43ccc: 10000915 stw zero,36(r2)
  5046. if (alt_alarm_start(&sp->alarm, alt_ticks_per_second(),
  5047. 43cd0: e0bffd17 ldw r2,-12(fp)
  5048. 43cd4: 10800204 addi r2,r2,8
  5049. * Obtain the system clock rate in ticks/s.
  5050. */
  5051. static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_ticks_per_second (void)
  5052. {
  5053. return _alt_tick_rate;
  5054. 43cd8: d0e6b117 ldw r3,-25916(gp)
  5055. 43cdc: e1fffd17 ldw r7,-12(fp)
  5056. 43ce0: 01800134 movhi r6,4
  5057. 43ce4: 318fcb04 addi r6,r6,16172
  5058. 43ce8: 180b883a mov r5,r3
  5059. 43cec: 1009883a mov r4,r2
  5060. 43cf0: 00445640 call 44564 <alt_alarm_start>
  5061. 43cf4: 1000040e bge r2,zero,43d08 <altera_avalon_jtag_uart_init+0xa8>
  5062. &altera_avalon_jtag_uart_timeout, sp) < 0)
  5063. {
  5064. /* If we can't set the alarm then record "don't know if host present"
  5065. * and behave as though the host is present.
  5066. */
  5067. sp->timeout = INT_MAX;
  5068. 43cf8: e0fffd17 ldw r3,-12(fp)
  5069. 43cfc: 00a00034 movhi r2,32768
  5070. 43d00: 10bfffc4 addi r2,r2,-1
  5071. 43d04: 18800115 stw r2,4(r3)
  5072. }
  5073. /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */
  5074. ALT_LOG_JTAG_UART_ALARM_REGISTER(sp, sp->base);
  5075. }
  5076. 43d08: 0001883a nop
  5077. 43d0c: e037883a mov sp,fp
  5078. 43d10: dfc00117 ldw ra,4(sp)
  5079. 43d14: df000017 ldw fp,0(sp)
  5080. 43d18: dec00204 addi sp,sp,8
  5081. 43d1c: f800283a ret
  5082. 00043d20 <altera_avalon_jtag_uart_irq>:
  5083. #ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT
  5084. static void altera_avalon_jtag_uart_irq(void* context)
  5085. #else
  5086. static void altera_avalon_jtag_uart_irq(void* context, alt_u32 id)
  5087. #endif
  5088. {
  5089. 43d20: defff804 addi sp,sp,-32
  5090. 43d24: df000715 stw fp,28(sp)
  5091. 43d28: df000704 addi fp,sp,28
  5092. 43d2c: e13fff15 stw r4,-4(fp)
  5093. altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state*) context;
  5094. 43d30: e0bfff17 ldw r2,-4(fp)
  5095. 43d34: e0bffb15 stw r2,-20(fp)
  5096. unsigned int base = sp->base;
  5097. 43d38: e0bffb17 ldw r2,-20(fp)
  5098. 43d3c: 10800017 ldw r2,0(r2)
  5099. 43d40: e0bffc15 stw r2,-16(fp)
  5100. /* ALT_LOG - see altera_hal/HAL/inc/sys/alt_log_printf.h */
  5101. ALT_LOG_JTAG_UART_ISR_FUNCTION(base, sp);
  5102. for ( ; ; )
  5103. {
  5104. unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base);
  5105. 43d44: e0bffc17 ldw r2,-16(fp)
  5106. 43d48: 10800104 addi r2,r2,4
  5107. 43d4c: 10800037 ldwio r2,0(r2)
  5108. 43d50: e0bffd15 stw r2,-12(fp)
  5109. /* Return once nothing more to do */
  5110. if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0)
  5111. 43d54: e0bffd17 ldw r2,-12(fp)
  5112. 43d58: 1080c00c andi r2,r2,768
  5113. 43d5c: 10006d26 beq r2,zero,43f14 <altera_avalon_jtag_uart_irq+0x1f4>
  5114. break;
  5115. if (control & ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK)
  5116. 43d60: e0bffd17 ldw r2,-12(fp)
  5117. 43d64: 1080400c andi r2,r2,256
  5118. 43d68: 10003526 beq r2,zero,43e40 <altera_avalon_jtag_uart_irq+0x120>
  5119. {
  5120. /* process a read irq. Start by assuming that there is data in the
  5121. * receive FIFO (otherwise why would we have been interrupted?)
  5122. */
  5123. unsigned int data = 1 << ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST;
  5124. 43d6c: 00800074 movhi r2,1
  5125. 43d70: e0bff915 stw r2,-28(fp)
  5126. for ( ; ; )
  5127. {
  5128. /* Check whether there is space in the buffer. If not then we must not
  5129. * read any characters from the buffer as they will be lost.
  5130. */
  5131. unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5132. 43d74: e0bffb17 ldw r2,-20(fp)
  5133. 43d78: 10800a17 ldw r2,40(r2)
  5134. 43d7c: 10800044 addi r2,r2,1
  5135. 43d80: 1081ffcc andi r2,r2,2047
  5136. 43d84: e0bffe15 stw r2,-8(fp)
  5137. if (next == sp->rx_out)
  5138. 43d88: e0bffb17 ldw r2,-20(fp)
  5139. 43d8c: 10c00b17 ldw r3,44(r2)
  5140. 43d90: e0bffe17 ldw r2,-8(fp)
  5141. 43d94: 18801526 beq r3,r2,43dec <altera_avalon_jtag_uart_irq+0xcc>
  5142. break;
  5143. /* Try to remove a character from the FIFO and find out whether there
  5144. * are any more characters remaining.
  5145. */
  5146. data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base);
  5147. 43d98: e0bffc17 ldw r2,-16(fp)
  5148. 43d9c: 10800037 ldwio r2,0(r2)
  5149. 43da0: e0bff915 stw r2,-28(fp)
  5150. if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0)
  5151. 43da4: e0bff917 ldw r2,-28(fp)
  5152. 43da8: 10a0000c andi r2,r2,32768
  5153. 43dac: 10001126 beq r2,zero,43df4 <altera_avalon_jtag_uart_irq+0xd4>
  5154. break;
  5155. sp->rx_buf[sp->rx_in] = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST;
  5156. 43db0: e0bffb17 ldw r2,-20(fp)
  5157. 43db4: 10800a17 ldw r2,40(r2)
  5158. 43db8: e0fff917 ldw r3,-28(fp)
  5159. 43dbc: 1809883a mov r4,r3
  5160. 43dc0: e0fffb17 ldw r3,-20(fp)
  5161. 43dc4: 1885883a add r2,r3,r2
  5162. 43dc8: 10800e04 addi r2,r2,56
  5163. 43dcc: 11000005 stb r4,0(r2)
  5164. sp->rx_in = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5165. 43dd0: e0bffb17 ldw r2,-20(fp)
  5166. 43dd4: 10800a17 ldw r2,40(r2)
  5167. 43dd8: 10800044 addi r2,r2,1
  5168. 43ddc: 10c1ffcc andi r3,r2,2047
  5169. 43de0: e0bffb17 ldw r2,-20(fp)
  5170. 43de4: 10c00a15 stw r3,40(r2)
  5171. /* Post an event to notify jtag_uart_read that a character has been read */
  5172. ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET);
  5173. }
  5174. 43de8: 003fe206 br 43d74 <altera_avalon_jtag_uart_irq+0x54>
  5175. /* Check whether there is space in the buffer. If not then we must not
  5176. * read any characters from the buffer as they will be lost.
  5177. */
  5178. unsigned int next = (sp->rx_in + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5179. if (next == sp->rx_out)
  5180. break;
  5181. 43dec: 0001883a nop
  5182. 43df0: 00000106 br 43df8 <altera_avalon_jtag_uart_irq+0xd8>
  5183. * are any more characters remaining.
  5184. */
  5185. data = IORD_ALTERA_AVALON_JTAG_UART_DATA(base);
  5186. if ((data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) == 0)
  5187. break;
  5188. 43df4: 0001883a nop
  5189. /* Post an event to notify jtag_uart_read that a character has been read */
  5190. ALT_FLAG_POST (sp->events, ALT_JTAG_UART_READ_RDY, OS_FLAG_SET);
  5191. }
  5192. if (data & ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK)
  5193. 43df8: e0bff917 ldw r2,-28(fp)
  5194. 43dfc: 10bfffec andhi r2,r2,65535
  5195. 43e00: 10000f26 beq r2,zero,43e40 <altera_avalon_jtag_uart_irq+0x120>
  5196. {
  5197. /* If there is still data available here then the buffer is full
  5198. * so turn off receive interrupts until some space becomes available.
  5199. */
  5200. sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK;
  5201. 43e04: e0bffb17 ldw r2,-20(fp)
  5202. 43e08: 10c00817 ldw r3,32(r2)
  5203. 43e0c: 00bfff84 movi r2,-2
  5204. 43e10: 1886703a and r3,r3,r2
  5205. 43e14: e0bffb17 ldw r2,-20(fp)
  5206. 43e18: 10c00815 stw r3,32(r2)
  5207. IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, sp->irq_enable);
  5208. 43e1c: e0bffc17 ldw r2,-16(fp)
  5209. 43e20: 10800104 addi r2,r2,4
  5210. 43e24: 1007883a mov r3,r2
  5211. 43e28: e0bffb17 ldw r2,-20(fp)
  5212. 43e2c: 10800817 ldw r2,32(r2)
  5213. 43e30: 18800035 stwio r2,0(r3)
  5214. /* Dummy read to ensure IRQ is cleared prior to ISR completion */
  5215. IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base);
  5216. 43e34: e0bffc17 ldw r2,-16(fp)
  5217. 43e38: 10800104 addi r2,r2,4
  5218. 43e3c: 10800037 ldwio r2,0(r2)
  5219. }
  5220. }
  5221. if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)
  5222. 43e40: e0bffd17 ldw r2,-12(fp)
  5223. 43e44: 1080800c andi r2,r2,512
  5224. 43e48: 103fbe26 beq r2,zero,43d44 <altera_avalon_jtag_uart_irq+0x24>
  5225. {
  5226. /* process a write irq */
  5227. unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST;
  5228. 43e4c: e0bffd17 ldw r2,-12(fp)
  5229. 43e50: 1004d43a srli r2,r2,16
  5230. 43e54: e0bffa15 stw r2,-24(fp)
  5231. while (space > 0 && sp->tx_out != sp->tx_in)
  5232. 43e58: 00001406 br 43eac <altera_avalon_jtag_uart_irq+0x18c>
  5233. {
  5234. IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, sp->tx_buf[sp->tx_out]);
  5235. 43e5c: e0bffc17 ldw r2,-16(fp)
  5236. 43e60: e0fffb17 ldw r3,-20(fp)
  5237. 43e64: 18c00d17 ldw r3,52(r3)
  5238. 43e68: e13ffb17 ldw r4,-20(fp)
  5239. 43e6c: 20c7883a add r3,r4,r3
  5240. 43e70: 18c20e04 addi r3,r3,2104
  5241. 43e74: 18c00003 ldbu r3,0(r3)
  5242. 43e78: 18c03fcc andi r3,r3,255
  5243. 43e7c: 18c0201c xori r3,r3,128
  5244. 43e80: 18ffe004 addi r3,r3,-128
  5245. 43e84: 10c00035 stwio r3,0(r2)
  5246. sp->tx_out = (sp->tx_out + 1) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5247. 43e88: e0bffb17 ldw r2,-20(fp)
  5248. 43e8c: 10800d17 ldw r2,52(r2)
  5249. 43e90: 10800044 addi r2,r2,1
  5250. 43e94: 10c1ffcc andi r3,r2,2047
  5251. 43e98: e0bffb17 ldw r2,-20(fp)
  5252. 43e9c: 10c00d15 stw r3,52(r2)
  5253. /* Post an event to notify jtag_uart_write that a character has been written */
  5254. ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET);
  5255. space--;
  5256. 43ea0: e0bffa17 ldw r2,-24(fp)
  5257. 43ea4: 10bfffc4 addi r2,r2,-1
  5258. 43ea8: e0bffa15 stw r2,-24(fp)
  5259. if (control & ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)
  5260. {
  5261. /* process a write irq */
  5262. unsigned int space = (control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) >> ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST;
  5263. while (space > 0 && sp->tx_out != sp->tx_in)
  5264. 43eac: e0bffa17 ldw r2,-24(fp)
  5265. 43eb0: 10000526 beq r2,zero,43ec8 <altera_avalon_jtag_uart_irq+0x1a8>
  5266. 43eb4: e0bffb17 ldw r2,-20(fp)
  5267. 43eb8: 10c00d17 ldw r3,52(r2)
  5268. 43ebc: e0bffb17 ldw r2,-20(fp)
  5269. 43ec0: 10800c17 ldw r2,48(r2)
  5270. 43ec4: 18bfe51e bne r3,r2,43e5c <altera_avalon_jtag_uart_irq+0x13c>
  5271. ALT_FLAG_POST (sp->events, ALT_JTAG_UART_WRITE_RDY, OS_FLAG_SET);
  5272. space--;
  5273. }
  5274. if (space > 0)
  5275. 43ec8: e0bffa17 ldw r2,-24(fp)
  5276. 43ecc: 103f9d26 beq r2,zero,43d44 <altera_avalon_jtag_uart_irq+0x24>
  5277. {
  5278. /* If we don't have any more data available then turn off the TX interrupt */
  5279. sp->irq_enable &= ~ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK;
  5280. 43ed0: e0bffb17 ldw r2,-20(fp)
  5281. 43ed4: 10c00817 ldw r3,32(r2)
  5282. 43ed8: 00bfff44 movi r2,-3
  5283. 43edc: 1886703a and r3,r3,r2
  5284. 43ee0: e0bffb17 ldw r2,-20(fp)
  5285. 43ee4: 10c00815 stw r3,32(r2)
  5286. IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable);
  5287. 43ee8: e0bffb17 ldw r2,-20(fp)
  5288. 43eec: 10800017 ldw r2,0(r2)
  5289. 43ef0: 10800104 addi r2,r2,4
  5290. 43ef4: 1007883a mov r3,r2
  5291. 43ef8: e0bffb17 ldw r2,-20(fp)
  5292. 43efc: 10800817 ldw r2,32(r2)
  5293. 43f00: 18800035 stwio r2,0(r3)
  5294. /* Dummy read to ensure IRQ is cleared prior to ISR completion */
  5295. IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base);
  5296. 43f04: e0bffc17 ldw r2,-16(fp)
  5297. 43f08: 10800104 addi r2,r2,4
  5298. 43f0c: 10800037 ldwio r2,0(r2)
  5299. }
  5300. }
  5301. }
  5302. 43f10: 003f8c06 br 43d44 <altera_avalon_jtag_uart_irq+0x24>
  5303. {
  5304. unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base);
  5305. /* Return once nothing more to do */
  5306. if ((control & (ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK | ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK)) == 0)
  5307. break;
  5308. 43f14: 0001883a nop
  5309. /* Dummy read to ensure IRQ is cleared prior to ISR completion */
  5310. IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base);
  5311. }
  5312. }
  5313. }
  5314. }
  5315. 43f18: 0001883a nop
  5316. 43f1c: e037883a mov sp,fp
  5317. 43f20: df000017 ldw fp,0(sp)
  5318. 43f24: dec00104 addi sp,sp,4
  5319. 43f28: f800283a ret
  5320. 00043f2c <altera_avalon_jtag_uart_timeout>:
  5321. * Timeout routine is called every second
  5322. */
  5323. static alt_u32
  5324. altera_avalon_jtag_uart_timeout(void* context)
  5325. {
  5326. 43f2c: defff804 addi sp,sp,-32
  5327. 43f30: df000715 stw fp,28(sp)
  5328. 43f34: df000704 addi fp,sp,28
  5329. 43f38: e13ffb15 stw r4,-20(fp)
  5330. altera_avalon_jtag_uart_state* sp = (altera_avalon_jtag_uart_state *) context;
  5331. 43f3c: e0bffb17 ldw r2,-20(fp)
  5332. 43f40: e0bff915 stw r2,-28(fp)
  5333. unsigned int control = IORD_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base);
  5334. 43f44: e0bff917 ldw r2,-28(fp)
  5335. 43f48: 10800017 ldw r2,0(r2)
  5336. 43f4c: 10800104 addi r2,r2,4
  5337. 43f50: 10800037 ldwio r2,0(r2)
  5338. 43f54: e0bffa15 stw r2,-24(fp)
  5339. if (control & ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK)
  5340. 43f58: e0bffa17 ldw r2,-24(fp)
  5341. 43f5c: 1081000c andi r2,r2,1024
  5342. 43f60: 10000b26 beq r2,zero,43f90 <altera_avalon_jtag_uart_timeout+0x64>
  5343. {
  5344. IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable | ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK);
  5345. 43f64: e0bff917 ldw r2,-28(fp)
  5346. 43f68: 10800017 ldw r2,0(r2)
  5347. 43f6c: 10800104 addi r2,r2,4
  5348. 43f70: 1007883a mov r3,r2
  5349. 43f74: e0bff917 ldw r2,-28(fp)
  5350. 43f78: 10800817 ldw r2,32(r2)
  5351. 43f7c: 10810014 ori r2,r2,1024
  5352. 43f80: 18800035 stwio r2,0(r3)
  5353. sp->host_inactive = 0;
  5354. 43f84: e0bff917 ldw r2,-28(fp)
  5355. 43f88: 10000915 stw zero,36(r2)
  5356. 43f8c: 00000a06 br 43fb8 <altera_avalon_jtag_uart_timeout+0x8c>
  5357. }
  5358. else if (sp->host_inactive < INT_MAX - 2) {
  5359. 43f90: e0bff917 ldw r2,-28(fp)
  5360. 43f94: 10c00917 ldw r3,36(r2)
  5361. 43f98: 00a00034 movhi r2,32768
  5362. 43f9c: 10bfff04 addi r2,r2,-4
  5363. 43fa0: 10c00536 bltu r2,r3,43fb8 <altera_avalon_jtag_uart_timeout+0x8c>
  5364. sp->host_inactive++;
  5365. 43fa4: e0bff917 ldw r2,-28(fp)
  5366. 43fa8: 10800917 ldw r2,36(r2)
  5367. 43fac: 10c00044 addi r3,r2,1
  5368. 43fb0: e0bff917 ldw r2,-28(fp)
  5369. 43fb4: 10c00915 stw r3,36(r2)
  5370. 43fb8: d0a6b117 ldw r2,-25916(gp)
  5371. ALT_FLAG_POST (sp->events, ALT_JTAG_UART_TIMEOUT, OS_FLAG_SET);
  5372. }
  5373. }
  5374. return alt_ticks_per_second();
  5375. }
  5376. 43fbc: e037883a mov sp,fp
  5377. 43fc0: df000017 ldw fp,0(sp)
  5378. 43fc4: dec00104 addi sp,sp,4
  5379. 43fc8: f800283a ret
  5380. 00043fcc <altera_avalon_jtag_uart_close>:
  5381. * The close routine is not implemented for the small driver; instead it will
  5382. * map to null. This is because the small driver simply waits while characters
  5383. * are transmitted; there is no interrupt-serviced buffer to empty
  5384. */
  5385. int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp, int flags)
  5386. {
  5387. 43fcc: defffd04 addi sp,sp,-12
  5388. 43fd0: df000215 stw fp,8(sp)
  5389. 43fd4: df000204 addi fp,sp,8
  5390. 43fd8: e13ffe15 stw r4,-8(fp)
  5391. 43fdc: e17fff15 stw r5,-4(fp)
  5392. /*
  5393. * Wait for all transmit data to be emptied by the JTAG UART ISR, or
  5394. * for a host-inactivity timeout, in which case transmit data will be lost
  5395. */
  5396. while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) {
  5397. 43fe0: 00000506 br 43ff8 <altera_avalon_jtag_uart_close+0x2c>
  5398. if (flags & O_NONBLOCK) {
  5399. 43fe4: e0bfff17 ldw r2,-4(fp)
  5400. 43fe8: 1090000c andi r2,r2,16384
  5401. 43fec: 10000226 beq r2,zero,43ff8 <altera_avalon_jtag_uart_close+0x2c>
  5402. return -EWOULDBLOCK;
  5403. 43ff0: 00bffd44 movi r2,-11
  5404. 43ff4: 00000b06 br 44024 <altera_avalon_jtag_uart_close+0x58>
  5405. {
  5406. /*
  5407. * Wait for all transmit data to be emptied by the JTAG UART ISR, or
  5408. * for a host-inactivity timeout, in which case transmit data will be lost
  5409. */
  5410. while ( (sp->tx_out != sp->tx_in) && (sp->host_inactive < sp->timeout) ) {
  5411. 43ff8: e0bffe17 ldw r2,-8(fp)
  5412. 43ffc: 10c00d17 ldw r3,52(r2)
  5413. 44000: e0bffe17 ldw r2,-8(fp)
  5414. 44004: 10800c17 ldw r2,48(r2)
  5415. 44008: 18800526 beq r3,r2,44020 <altera_avalon_jtag_uart_close+0x54>
  5416. 4400c: e0bffe17 ldw r2,-8(fp)
  5417. 44010: 10c00917 ldw r3,36(r2)
  5418. 44014: e0bffe17 ldw r2,-8(fp)
  5419. 44018: 10800117 ldw r2,4(r2)
  5420. 4401c: 18bff136 bltu r3,r2,43fe4 <altera_avalon_jtag_uart_close+0x18>
  5421. if (flags & O_NONBLOCK) {
  5422. return -EWOULDBLOCK;
  5423. }
  5424. }
  5425. return 0;
  5426. 44020: 0005883a mov r2,zero
  5427. }
  5428. 44024: e037883a mov sp,fp
  5429. 44028: df000017 ldw fp,0(sp)
  5430. 4402c: dec00104 addi sp,sp,4
  5431. 44030: f800283a ret
  5432. 00044034 <altera_avalon_jtag_uart_ioctl>:
  5433. /* ----------------------------------------------------------- */
  5434. int
  5435. altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp, int req,
  5436. void* arg)
  5437. {
  5438. 44034: defffa04 addi sp,sp,-24
  5439. 44038: df000515 stw fp,20(sp)
  5440. 4403c: df000504 addi fp,sp,20
  5441. 44040: e13ffd15 stw r4,-12(fp)
  5442. 44044: e17ffe15 stw r5,-8(fp)
  5443. 44048: e1bfff15 stw r6,-4(fp)
  5444. int rc = -ENOTTY;
  5445. 4404c: 00bff9c4 movi r2,-25
  5446. 44050: e0bffb15 stw r2,-20(fp)
  5447. switch (req)
  5448. 44054: e0bffe17 ldw r2,-8(fp)
  5449. 44058: 10da8060 cmpeqi r3,r2,27137
  5450. 4405c: 1800031e bne r3,zero,4406c <altera_avalon_jtag_uart_ioctl+0x38>
  5451. 44060: 109a80a0 cmpeqi r2,r2,27138
  5452. 44064: 1000181e bne r2,zero,440c8 <altera_avalon_jtag_uart_ioctl+0x94>
  5453. rc = 0;
  5454. }
  5455. break;
  5456. default:
  5457. break;
  5458. 44068: 00002906 br 44110 <altera_avalon_jtag_uart_ioctl+0xdc>
  5459. switch (req)
  5460. {
  5461. case TIOCSTIMEOUT:
  5462. /* Set the time to wait until assuming host is not connected */
  5463. if (sp->timeout != INT_MAX)
  5464. 4406c: e0bffd17 ldw r2,-12(fp)
  5465. 44070: 10c00117 ldw r3,4(r2)
  5466. 44074: 00a00034 movhi r2,32768
  5467. 44078: 10bfffc4 addi r2,r2,-1
  5468. 4407c: 18802126 beq r3,r2,44104 <altera_avalon_jtag_uart_ioctl+0xd0>
  5469. {
  5470. int timeout = *((int *)arg);
  5471. 44080: e0bfff17 ldw r2,-4(fp)
  5472. 44084: 10800017 ldw r2,0(r2)
  5473. 44088: e0bffc15 stw r2,-16(fp)
  5474. sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1;
  5475. 4408c: e0bffc17 ldw r2,-16(fp)
  5476. 44090: 10800090 cmplti r2,r2,2
  5477. 44094: 1000061e bne r2,zero,440b0 <altera_avalon_jtag_uart_ioctl+0x7c>
  5478. 44098: e0fffc17 ldw r3,-16(fp)
  5479. 4409c: 00a00034 movhi r2,32768
  5480. 440a0: 10bfffc4 addi r2,r2,-1
  5481. 440a4: 18800226 beq r3,r2,440b0 <altera_avalon_jtag_uart_ioctl+0x7c>
  5482. 440a8: e0bffc17 ldw r2,-16(fp)
  5483. 440ac: 00000206 br 440b8 <altera_avalon_jtag_uart_ioctl+0x84>
  5484. 440b0: 00a00034 movhi r2,32768
  5485. 440b4: 10bfff84 addi r2,r2,-2
  5486. 440b8: e0fffd17 ldw r3,-12(fp)
  5487. 440bc: 18800115 stw r2,4(r3)
  5488. rc = 0;
  5489. 440c0: e03ffb15 stw zero,-20(fp)
  5490. }
  5491. break;
  5492. 440c4: 00000f06 br 44104 <altera_avalon_jtag_uart_ioctl+0xd0>
  5493. case TIOCGCONNECTED:
  5494. /* Find out whether host is connected */
  5495. if (sp->timeout != INT_MAX)
  5496. 440c8: e0bffd17 ldw r2,-12(fp)
  5497. 440cc: 10c00117 ldw r3,4(r2)
  5498. 440d0: 00a00034 movhi r2,32768
  5499. 440d4: 10bfffc4 addi r2,r2,-1
  5500. 440d8: 18800c26 beq r3,r2,4410c <altera_avalon_jtag_uart_ioctl+0xd8>
  5501. {
  5502. *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0;
  5503. 440dc: e0bffd17 ldw r2,-12(fp)
  5504. 440e0: 10c00917 ldw r3,36(r2)
  5505. 440e4: e0bffd17 ldw r2,-12(fp)
  5506. 440e8: 10800117 ldw r2,4(r2)
  5507. 440ec: 1885803a cmpltu r2,r3,r2
  5508. 440f0: 10c03fcc andi r3,r2,255
  5509. 440f4: e0bfff17 ldw r2,-4(fp)
  5510. 440f8: 10c00015 stw r3,0(r2)
  5511. rc = 0;
  5512. 440fc: e03ffb15 stw zero,-20(fp)
  5513. }
  5514. break;
  5515. 44100: 00000206 br 4410c <altera_avalon_jtag_uart_ioctl+0xd8>
  5516. {
  5517. int timeout = *((int *)arg);
  5518. sp->timeout = (timeout >= 2 && timeout < INT_MAX) ? timeout : INT_MAX - 1;
  5519. rc = 0;
  5520. }
  5521. break;
  5522. 44104: 0001883a nop
  5523. 44108: 00000106 br 44110 <altera_avalon_jtag_uart_ioctl+0xdc>
  5524. if (sp->timeout != INT_MAX)
  5525. {
  5526. *((int *)arg) = (sp->host_inactive < sp->timeout) ? 1 : 0;
  5527. rc = 0;
  5528. }
  5529. break;
  5530. 4410c: 0001883a nop
  5531. default:
  5532. break;
  5533. }
  5534. return rc;
  5535. 44110: e0bffb17 ldw r2,-20(fp)
  5536. }
  5537. 44114: e037883a mov sp,fp
  5538. 44118: df000017 ldw fp,0(sp)
  5539. 4411c: dec00104 addi sp,sp,4
  5540. 44120: f800283a ret
  5541. 00044124 <altera_avalon_jtag_uart_read>:
  5542. /* ----------------------------------------------------------- */
  5543. int
  5544. altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp,
  5545. char * buffer, int space, int flags)
  5546. {
  5547. 44124: defff304 addi sp,sp,-52
  5548. 44128: dfc00c15 stw ra,48(sp)
  5549. 4412c: df000b15 stw fp,44(sp)
  5550. 44130: df000b04 addi fp,sp,44
  5551. 44134: e13ffc15 stw r4,-16(fp)
  5552. 44138: e17ffd15 stw r5,-12(fp)
  5553. 4413c: e1bffe15 stw r6,-8(fp)
  5554. 44140: e1ffff15 stw r7,-4(fp)
  5555. char * ptr = buffer;
  5556. 44144: e0bffd17 ldw r2,-12(fp)
  5557. 44148: e0bff515 stw r2,-44(fp)
  5558. * When running in a multi threaded environment, obtain the "read_lock"
  5559. * semaphore. This ensures that reading from the device is thread-safe.
  5560. */
  5561. ALT_SEM_PEND (sp->read_lock, 0);
  5562. while (space > 0)
  5563. 4414c: 00004706 br 4426c <altera_avalon_jtag_uart_read+0x148>
  5564. unsigned int in, out;
  5565. /* Read as much data as possible */
  5566. do
  5567. {
  5568. in = sp->rx_in;
  5569. 44150: e0bffc17 ldw r2,-16(fp)
  5570. 44154: 10800a17 ldw r2,40(r2)
  5571. 44158: e0bff715 stw r2,-36(fp)
  5572. out = sp->rx_out;
  5573. 4415c: e0bffc17 ldw r2,-16(fp)
  5574. 44160: 10800b17 ldw r2,44(r2)
  5575. 44164: e0bff815 stw r2,-32(fp)
  5576. if (in >= out)
  5577. 44168: e0fff717 ldw r3,-36(fp)
  5578. 4416c: e0bff817 ldw r2,-32(fp)
  5579. 44170: 18800536 bltu r3,r2,44188 <altera_avalon_jtag_uart_read+0x64>
  5580. n = in - out;
  5581. 44174: e0fff717 ldw r3,-36(fp)
  5582. 44178: e0bff817 ldw r2,-32(fp)
  5583. 4417c: 1885c83a sub r2,r3,r2
  5584. 44180: e0bff615 stw r2,-40(fp)
  5585. 44184: 00000406 br 44198 <altera_avalon_jtag_uart_read+0x74>
  5586. else
  5587. n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out;
  5588. 44188: 00c20004 movi r3,2048
  5589. 4418c: e0bff817 ldw r2,-32(fp)
  5590. 44190: 1885c83a sub r2,r3,r2
  5591. 44194: e0bff615 stw r2,-40(fp)
  5592. if (n == 0)
  5593. 44198: e0bff617 ldw r2,-40(fp)
  5594. 4419c: 10001e26 beq r2,zero,44218 <altera_avalon_jtag_uart_read+0xf4>
  5595. break; /* No more data available */
  5596. if (n > space)
  5597. 441a0: e0fffe17 ldw r3,-8(fp)
  5598. 441a4: e0bff617 ldw r2,-40(fp)
  5599. 441a8: 1880022e bgeu r3,r2,441b4 <altera_avalon_jtag_uart_read+0x90>
  5600. n = space;
  5601. 441ac: e0bffe17 ldw r2,-8(fp)
  5602. 441b0: e0bff615 stw r2,-40(fp)
  5603. memcpy(ptr, sp->rx_buf + out, n);
  5604. 441b4: e0bffc17 ldw r2,-16(fp)
  5605. 441b8: 10c00e04 addi r3,r2,56
  5606. 441bc: e0bff817 ldw r2,-32(fp)
  5607. 441c0: 1885883a add r2,r3,r2
  5608. 441c4: e1bff617 ldw r6,-40(fp)
  5609. 441c8: 100b883a mov r5,r2
  5610. 441cc: e13ff517 ldw r4,-44(fp)
  5611. 441d0: 00417040 call 41704 <memcpy>
  5612. ptr += n;
  5613. 441d4: e0fff517 ldw r3,-44(fp)
  5614. 441d8: e0bff617 ldw r2,-40(fp)
  5615. 441dc: 1885883a add r2,r3,r2
  5616. 441e0: e0bff515 stw r2,-44(fp)
  5617. space -= n;
  5618. 441e4: e0fffe17 ldw r3,-8(fp)
  5619. 441e8: e0bff617 ldw r2,-40(fp)
  5620. 441ec: 1885c83a sub r2,r3,r2
  5621. 441f0: e0bffe15 stw r2,-8(fp)
  5622. sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5623. 441f4: e0fff817 ldw r3,-32(fp)
  5624. 441f8: e0bff617 ldw r2,-40(fp)
  5625. 441fc: 1885883a add r2,r3,r2
  5626. 44200: 10c1ffcc andi r3,r2,2047
  5627. 44204: e0bffc17 ldw r2,-16(fp)
  5628. 44208: 10c00b15 stw r3,44(r2)
  5629. }
  5630. while (space > 0);
  5631. 4420c: e0bffe17 ldw r2,-8(fp)
  5632. 44210: 00bfcf16 blt zero,r2,44150 <altera_avalon_jtag_uart_read+0x2c>
  5633. 44214: 00000106 br 4421c <altera_avalon_jtag_uart_read+0xf8>
  5634. n = in - out;
  5635. else
  5636. n = ALTERA_AVALON_JTAG_UART_BUF_LEN - out;
  5637. if (n == 0)
  5638. break; /* No more data available */
  5639. 44218: 0001883a nop
  5640. sp->rx_out = (out + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5641. }
  5642. while (space > 0);
  5643. /* If we read any data then return it */
  5644. if (ptr != buffer)
  5645. 4421c: e0fff517 ldw r3,-44(fp)
  5646. 44220: e0bffd17 ldw r2,-12(fp)
  5647. 44224: 1880141e bne r3,r2,44278 <altera_avalon_jtag_uart_read+0x154>
  5648. break;
  5649. /* If in non-blocking mode then return error */
  5650. if (flags & O_NONBLOCK)
  5651. 44228: e0bfff17 ldw r2,-4(fp)
  5652. 4422c: 1090000c andi r2,r2,16384
  5653. 44230: 1000131e bne r2,zero,44280 <altera_avalon_jtag_uart_read+0x15c>
  5654. while (in == sp->rx_in && sp->host_inactive < sp->timeout)
  5655. ;
  5656. }
  5657. #else
  5658. /* No OS: Always spin */
  5659. while (in == sp->rx_in && sp->host_inactive < sp->timeout)
  5660. 44234: 0001883a nop
  5661. 44238: e0bffc17 ldw r2,-16(fp)
  5662. 4423c: 10c00a17 ldw r3,40(r2)
  5663. 44240: e0bff717 ldw r2,-36(fp)
  5664. 44244: 1880051e bne r3,r2,4425c <altera_avalon_jtag_uart_read+0x138>
  5665. 44248: e0bffc17 ldw r2,-16(fp)
  5666. 4424c: 10c00917 ldw r3,36(r2)
  5667. 44250: e0bffc17 ldw r2,-16(fp)
  5668. 44254: 10800117 ldw r2,4(r2)
  5669. 44258: 18bff736 bltu r3,r2,44238 <altera_avalon_jtag_uart_read+0x114>
  5670. ;
  5671. #endif /* __ucosii__ */
  5672. if (in == sp->rx_in)
  5673. 4425c: e0bffc17 ldw r2,-16(fp)
  5674. 44260: 10c00a17 ldw r3,40(r2)
  5675. 44264: e0bff717 ldw r2,-36(fp)
  5676. 44268: 18800726 beq r3,r2,44288 <altera_avalon_jtag_uart_read+0x164>
  5677. * When running in a multi threaded environment, obtain the "read_lock"
  5678. * semaphore. This ensures that reading from the device is thread-safe.
  5679. */
  5680. ALT_SEM_PEND (sp->read_lock, 0);
  5681. while (space > 0)
  5682. 4426c: e0bffe17 ldw r2,-8(fp)
  5683. 44270: 00bfb716 blt zero,r2,44150 <altera_avalon_jtag_uart_read+0x2c>
  5684. 44274: 00000506 br 4428c <altera_avalon_jtag_uart_read+0x168>
  5685. }
  5686. while (space > 0);
  5687. /* If we read any data then return it */
  5688. if (ptr != buffer)
  5689. break;
  5690. 44278: 0001883a nop
  5691. 4427c: 00000306 br 4428c <altera_avalon_jtag_uart_read+0x168>
  5692. /* If in non-blocking mode then return error */
  5693. if (flags & O_NONBLOCK)
  5694. break;
  5695. 44280: 0001883a nop
  5696. 44284: 00000106 br 4428c <altera_avalon_jtag_uart_read+0x168>
  5697. while (in == sp->rx_in && sp->host_inactive < sp->timeout)
  5698. ;
  5699. #endif /* __ucosii__ */
  5700. if (in == sp->rx_in)
  5701. break;
  5702. 44288: 0001883a nop
  5703. * semaphore so that other threads can access the buffer.
  5704. */
  5705. ALT_SEM_POST (sp->read_lock);
  5706. if (ptr != buffer)
  5707. 4428c: e0fff517 ldw r3,-44(fp)
  5708. 44290: e0bffd17 ldw r2,-12(fp)
  5709. 44294: 18801826 beq r3,r2,442f8 <altera_avalon_jtag_uart_read+0x1d4>
  5710. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  5711. alt_irq_disable_all (void)
  5712. {
  5713. alt_irq_context context;
  5714. NIOS2_READ_STATUS (context);
  5715. 44298: 0005303a rdctl r2,status
  5716. 4429c: e0bffb15 stw r2,-20(fp)
  5717. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  5718. 442a0: e0fffb17 ldw r3,-20(fp)
  5719. 442a4: 00bfff84 movi r2,-2
  5720. 442a8: 1884703a and r2,r3,r2
  5721. 442ac: 1001703a wrctl status,r2
  5722. return context;
  5723. 442b0: e0bffb17 ldw r2,-20(fp)
  5724. {
  5725. /* If we read any data then there is space in the buffer so enable interrupts */
  5726. context = alt_irq_disable_all();
  5727. 442b4: e0bffa15 stw r2,-24(fp)
  5728. sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK;
  5729. 442b8: e0bffc17 ldw r2,-16(fp)
  5730. 442bc: 10800817 ldw r2,32(r2)
  5731. 442c0: 10c00054 ori r3,r2,1
  5732. 442c4: e0bffc17 ldw r2,-16(fp)
  5733. 442c8: 10c00815 stw r3,32(r2)
  5734. IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable);
  5735. 442cc: e0bffc17 ldw r2,-16(fp)
  5736. 442d0: 10800017 ldw r2,0(r2)
  5737. 442d4: 10800104 addi r2,r2,4
  5738. 442d8: 1007883a mov r3,r2
  5739. 442dc: e0bffc17 ldw r2,-16(fp)
  5740. 442e0: 10800817 ldw r2,32(r2)
  5741. 442e4: 18800035 stwio r2,0(r3)
  5742. 442e8: e0bffa17 ldw r2,-24(fp)
  5743. 442ec: e0bff915 stw r2,-28(fp)
  5744. status &= ~NIOS2_STATUS_PIE_MSK;
  5745. status |= (context & NIOS2_STATUS_PIE_MSK);
  5746. NIOS2_WRITE_STATUS (status);
  5747. #else
  5748. NIOS2_WRITE_STATUS (context);
  5749. 442f0: e0bff917 ldw r2,-28(fp)
  5750. 442f4: 1001703a wrctl status,r2
  5751. alt_irq_enable_all(context);
  5752. }
  5753. if (ptr != buffer)
  5754. 442f8: e0fff517 ldw r3,-44(fp)
  5755. 442fc: e0bffd17 ldw r2,-12(fp)
  5756. 44300: 18800426 beq r3,r2,44314 <altera_avalon_jtag_uart_read+0x1f0>
  5757. return ptr - buffer;
  5758. 44304: e0fff517 ldw r3,-44(fp)
  5759. 44308: e0bffd17 ldw r2,-12(fp)
  5760. 4430c: 1885c83a sub r2,r3,r2
  5761. 44310: 00000606 br 4432c <altera_avalon_jtag_uart_read+0x208>
  5762. else if (flags & O_NONBLOCK)
  5763. 44314: e0bfff17 ldw r2,-4(fp)
  5764. 44318: 1090000c andi r2,r2,16384
  5765. 4431c: 10000226 beq r2,zero,44328 <altera_avalon_jtag_uart_read+0x204>
  5766. return -EWOULDBLOCK;
  5767. 44320: 00bffd44 movi r2,-11
  5768. 44324: 00000106 br 4432c <altera_avalon_jtag_uart_read+0x208>
  5769. else
  5770. return -EIO;
  5771. 44328: 00bffec4 movi r2,-5
  5772. }
  5773. 4432c: e037883a mov sp,fp
  5774. 44330: dfc00117 ldw ra,4(sp)
  5775. 44334: df000017 ldw fp,0(sp)
  5776. 44338: dec00204 addi sp,sp,8
  5777. 4433c: f800283a ret
  5778. 00044340 <altera_avalon_jtag_uart_write>:
  5779. /* ----------------------------------------------------------- */
  5780. int
  5781. altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp,
  5782. const char * ptr, int count, int flags)
  5783. {
  5784. 44340: defff304 addi sp,sp,-52
  5785. 44344: dfc00c15 stw ra,48(sp)
  5786. 44348: df000b15 stw fp,44(sp)
  5787. 4434c: df000b04 addi fp,sp,44
  5788. 44350: e13ffc15 stw r4,-16(fp)
  5789. 44354: e17ffd15 stw r5,-12(fp)
  5790. 44358: e1bffe15 stw r6,-8(fp)
  5791. 4435c: e1ffff15 stw r7,-4(fp)
  5792. /* Remove warning at optimisation level 03 by seting out to 0 */
  5793. unsigned int in, out=0;
  5794. 44360: e03ff515 stw zero,-44(fp)
  5795. unsigned int n;
  5796. alt_irq_context context;
  5797. const char * start = ptr;
  5798. 44364: e0bffd17 ldw r2,-12(fp)
  5799. 44368: e0bff715 stw r2,-36(fp)
  5800. ALT_SEM_PEND (sp->write_lock, 0);
  5801. do
  5802. {
  5803. /* Copy as much as we can into the transmit buffer */
  5804. while (count > 0)
  5805. 4436c: 00003706 br 4444c <altera_avalon_jtag_uart_write+0x10c>
  5806. {
  5807. /* We need a stable value of the out pointer to calculate the space available */
  5808. in = sp->tx_in;
  5809. 44370: e0bffc17 ldw r2,-16(fp)
  5810. 44374: 10800c17 ldw r2,48(r2)
  5811. 44378: e0bff915 stw r2,-28(fp)
  5812. out = sp->tx_out;
  5813. 4437c: e0bffc17 ldw r2,-16(fp)
  5814. 44380: 10800d17 ldw r2,52(r2)
  5815. 44384: e0bff515 stw r2,-44(fp)
  5816. if (in < out)
  5817. 44388: e0fff917 ldw r3,-28(fp)
  5818. 4438c: e0bff517 ldw r2,-44(fp)
  5819. 44390: 1880062e bgeu r3,r2,443ac <altera_avalon_jtag_uart_write+0x6c>
  5820. n = out - 1 - in;
  5821. 44394: e0fff517 ldw r3,-44(fp)
  5822. 44398: e0bff917 ldw r2,-28(fp)
  5823. 4439c: 1885c83a sub r2,r3,r2
  5824. 443a0: 10bfffc4 addi r2,r2,-1
  5825. 443a4: e0bff615 stw r2,-40(fp)
  5826. 443a8: 00000b06 br 443d8 <altera_avalon_jtag_uart_write+0x98>
  5827. else if (out > 0)
  5828. 443ac: e0bff517 ldw r2,-44(fp)
  5829. 443b0: 10000526 beq r2,zero,443c8 <altera_avalon_jtag_uart_write+0x88>
  5830. n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in;
  5831. 443b4: 00c20004 movi r3,2048
  5832. 443b8: e0bff917 ldw r2,-28(fp)
  5833. 443bc: 1885c83a sub r2,r3,r2
  5834. 443c0: e0bff615 stw r2,-40(fp)
  5835. 443c4: 00000406 br 443d8 <altera_avalon_jtag_uart_write+0x98>
  5836. else
  5837. n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in;
  5838. 443c8: 00c1ffc4 movi r3,2047
  5839. 443cc: e0bff917 ldw r2,-28(fp)
  5840. 443d0: 1885c83a sub r2,r3,r2
  5841. 443d4: e0bff615 stw r2,-40(fp)
  5842. if (n == 0)
  5843. 443d8: e0bff617 ldw r2,-40(fp)
  5844. 443dc: 10001e26 beq r2,zero,44458 <altera_avalon_jtag_uart_write+0x118>
  5845. break;
  5846. if (n > count)
  5847. 443e0: e0fffe17 ldw r3,-8(fp)
  5848. 443e4: e0bff617 ldw r2,-40(fp)
  5849. 443e8: 1880022e bgeu r3,r2,443f4 <altera_avalon_jtag_uart_write+0xb4>
  5850. n = count;
  5851. 443ec: e0bffe17 ldw r2,-8(fp)
  5852. 443f0: e0bff615 stw r2,-40(fp)
  5853. memcpy(sp->tx_buf + in, ptr, n);
  5854. 443f4: e0bffc17 ldw r2,-16(fp)
  5855. 443f8: 10c20e04 addi r3,r2,2104
  5856. 443fc: e0bff917 ldw r2,-28(fp)
  5857. 44400: 1885883a add r2,r3,r2
  5858. 44404: e1bff617 ldw r6,-40(fp)
  5859. 44408: e17ffd17 ldw r5,-12(fp)
  5860. 4440c: 1009883a mov r4,r2
  5861. 44410: 00417040 call 41704 <memcpy>
  5862. ptr += n;
  5863. 44414: e0fffd17 ldw r3,-12(fp)
  5864. 44418: e0bff617 ldw r2,-40(fp)
  5865. 4441c: 1885883a add r2,r3,r2
  5866. 44420: e0bffd15 stw r2,-12(fp)
  5867. count -= n;
  5868. 44424: e0fffe17 ldw r3,-8(fp)
  5869. 44428: e0bff617 ldw r2,-40(fp)
  5870. 4442c: 1885c83a sub r2,r3,r2
  5871. 44430: e0bffe15 stw r2,-8(fp)
  5872. sp->tx_in = (in + n) % ALTERA_AVALON_JTAG_UART_BUF_LEN;
  5873. 44434: e0fff917 ldw r3,-28(fp)
  5874. 44438: e0bff617 ldw r2,-40(fp)
  5875. 4443c: 1885883a add r2,r3,r2
  5876. 44440: 10c1ffcc andi r3,r2,2047
  5877. 44444: e0bffc17 ldw r2,-16(fp)
  5878. 44448: 10c00c15 stw r3,48(r2)
  5879. ALT_SEM_PEND (sp->write_lock, 0);
  5880. do
  5881. {
  5882. /* Copy as much as we can into the transmit buffer */
  5883. while (count > 0)
  5884. 4444c: e0bffe17 ldw r2,-8(fp)
  5885. 44450: 00bfc716 blt zero,r2,44370 <altera_avalon_jtag_uart_write+0x30>
  5886. 44454: 00000106 br 4445c <altera_avalon_jtag_uart_write+0x11c>
  5887. n = ALTERA_AVALON_JTAG_UART_BUF_LEN - in;
  5888. else
  5889. n = ALTERA_AVALON_JTAG_UART_BUF_LEN - 1 - in;
  5890. if (n == 0)
  5891. break;
  5892. 44458: 0001883a nop
  5893. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  5894. alt_irq_disable_all (void)
  5895. {
  5896. alt_irq_context context;
  5897. NIOS2_READ_STATUS (context);
  5898. 4445c: 0005303a rdctl r2,status
  5899. 44460: e0bffb15 stw r2,-20(fp)
  5900. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  5901. 44464: e0fffb17 ldw r3,-20(fp)
  5902. 44468: 00bfff84 movi r2,-2
  5903. 4446c: 1884703a and r2,r3,r2
  5904. 44470: 1001703a wrctl status,r2
  5905. return context;
  5906. 44474: e0bffb17 ldw r2,-20(fp)
  5907. * to enable interrupts if there is no space left in the FIFO
  5908. *
  5909. * For now kick the interrupt routine every time to make it transmit
  5910. * the data
  5911. */
  5912. context = alt_irq_disable_all();
  5913. 44478: e0bffa15 stw r2,-24(fp)
  5914. sp->irq_enable |= ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK;
  5915. 4447c: e0bffc17 ldw r2,-16(fp)
  5916. 44480: 10800817 ldw r2,32(r2)
  5917. 44484: 10c00094 ori r3,r2,2
  5918. 44488: e0bffc17 ldw r2,-16(fp)
  5919. 4448c: 10c00815 stw r3,32(r2)
  5920. IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(sp->base, sp->irq_enable);
  5921. 44490: e0bffc17 ldw r2,-16(fp)
  5922. 44494: 10800017 ldw r2,0(r2)
  5923. 44498: 10800104 addi r2,r2,4
  5924. 4449c: 1007883a mov r3,r2
  5925. 444a0: e0bffc17 ldw r2,-16(fp)
  5926. 444a4: 10800817 ldw r2,32(r2)
  5927. 444a8: 18800035 stwio r2,0(r3)
  5928. 444ac: e0bffa17 ldw r2,-24(fp)
  5929. 444b0: e0bff815 stw r2,-32(fp)
  5930. status &= ~NIOS2_STATUS_PIE_MSK;
  5931. status |= (context & NIOS2_STATUS_PIE_MSK);
  5932. NIOS2_WRITE_STATUS (status);
  5933. #else
  5934. NIOS2_WRITE_STATUS (context);
  5935. 444b4: e0bff817 ldw r2,-32(fp)
  5936. 444b8: 1001703a wrctl status,r2
  5937. /*
  5938. * If there is any data left then either return now or block until
  5939. * some has been sent
  5940. */
  5941. /* consider: test whether there is anything there while doing this and delay for at most 2s. */
  5942. if (count > 0)
  5943. 444bc: e0bffe17 ldw r2,-8(fp)
  5944. 444c0: 0080100e bge zero,r2,44504 <altera_avalon_jtag_uart_write+0x1c4>
  5945. {
  5946. if (flags & O_NONBLOCK)
  5947. 444c4: e0bfff17 ldw r2,-4(fp)
  5948. 444c8: 1090000c andi r2,r2,16384
  5949. 444cc: 1000101e bne r2,zero,44510 <altera_avalon_jtag_uart_write+0x1d0>
  5950. /*
  5951. * No OS present: Always wait for data to be removed from buffer. Once
  5952. * the interrupt routine has removed some data then we will be able to
  5953. * insert some more.
  5954. */
  5955. while (out == sp->tx_out && sp->host_inactive < sp->timeout)
  5956. 444d0: 0001883a nop
  5957. 444d4: e0bffc17 ldw r2,-16(fp)
  5958. 444d8: 10c00d17 ldw r3,52(r2)
  5959. 444dc: e0bff517 ldw r2,-44(fp)
  5960. 444e0: 1880051e bne r3,r2,444f8 <altera_avalon_jtag_uart_write+0x1b8>
  5961. 444e4: e0bffc17 ldw r2,-16(fp)
  5962. 444e8: 10c00917 ldw r3,36(r2)
  5963. 444ec: e0bffc17 ldw r2,-16(fp)
  5964. 444f0: 10800117 ldw r2,4(r2)
  5965. 444f4: 18bff736 bltu r3,r2,444d4 <altera_avalon_jtag_uart_write+0x194>
  5966. ;
  5967. #endif /* __ucosii__ */
  5968. if (sp->host_inactive)
  5969. 444f8: e0bffc17 ldw r2,-16(fp)
  5970. 444fc: 10800917 ldw r2,36(r2)
  5971. 44500: 1000051e bne r2,zero,44518 <altera_avalon_jtag_uart_write+0x1d8>
  5972. break;
  5973. }
  5974. }
  5975. while (count > 0);
  5976. 44504: e0bffe17 ldw r2,-8(fp)
  5977. 44508: 00bfd016 blt zero,r2,4444c <altera_avalon_jtag_uart_write+0x10c>
  5978. 4450c: 00000306 br 4451c <altera_avalon_jtag_uart_write+0x1dc>
  5979. */
  5980. /* consider: test whether there is anything there while doing this and delay for at most 2s. */
  5981. if (count > 0)
  5982. {
  5983. if (flags & O_NONBLOCK)
  5984. break;
  5985. 44510: 0001883a nop
  5986. 44514: 00000106 br 4451c <altera_avalon_jtag_uart_write+0x1dc>
  5987. while (out == sp->tx_out && sp->host_inactive < sp->timeout)
  5988. ;
  5989. #endif /* __ucosii__ */
  5990. if (sp->host_inactive)
  5991. break;
  5992. 44518: 0001883a nop
  5993. * Now that access to the circular buffer is complete, release the write
  5994. * semaphore so that other threads can access the buffer.
  5995. */
  5996. ALT_SEM_POST (sp->write_lock);
  5997. if (ptr != start)
  5998. 4451c: e0fffd17 ldw r3,-12(fp)
  5999. 44520: e0bff717 ldw r2,-36(fp)
  6000. 44524: 18800426 beq r3,r2,44538 <altera_avalon_jtag_uart_write+0x1f8>
  6001. return ptr - start;
  6002. 44528: e0fffd17 ldw r3,-12(fp)
  6003. 4452c: e0bff717 ldw r2,-36(fp)
  6004. 44530: 1885c83a sub r2,r3,r2
  6005. 44534: 00000606 br 44550 <altera_avalon_jtag_uart_write+0x210>
  6006. else if (flags & O_NONBLOCK)
  6007. 44538: e0bfff17 ldw r2,-4(fp)
  6008. 4453c: 1090000c andi r2,r2,16384
  6009. 44540: 10000226 beq r2,zero,4454c <altera_avalon_jtag_uart_write+0x20c>
  6010. return -EWOULDBLOCK;
  6011. 44544: 00bffd44 movi r2,-11
  6012. 44548: 00000106 br 44550 <altera_avalon_jtag_uart_write+0x210>
  6013. sp->tx_out = sp->tx_in = 0;
  6014. return ptr - start + count;
  6015. }
  6016. #endif
  6017. else
  6018. return -EIO; /* Host not connected */
  6019. 4454c: 00bffec4 movi r2,-5
  6020. }
  6021. 44550: e037883a mov sp,fp
  6022. 44554: dfc00117 ldw ra,4(sp)
  6023. 44558: df000017 ldw fp,0(sp)
  6024. 4455c: dec00204 addi sp,sp,8
  6025. 44560: f800283a ret
  6026. 00044564 <alt_alarm_start>:
  6027. */
  6028. int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks,
  6029. alt_u32 (*callback) (void* context),
  6030. void* context)
  6031. {
  6032. 44564: defff504 addi sp,sp,-44
  6033. 44568: df000a15 stw fp,40(sp)
  6034. 4456c: df000a04 addi fp,sp,40
  6035. 44570: e13ffc15 stw r4,-16(fp)
  6036. 44574: e17ffd15 stw r5,-12(fp)
  6037. 44578: e1bffe15 stw r6,-8(fp)
  6038. 4457c: e1ffff15 stw r7,-4(fp)
  6039. alt_irq_context irq_context;
  6040. alt_u32 current_nticks = 0;
  6041. 44580: e03ff615 stw zero,-40(fp)
  6042. 44584: d0a6b117 ldw r2,-25916(gp)
  6043. if (alt_ticks_per_second ())
  6044. 44588: 10003c26 beq r2,zero,4467c <alt_alarm_start+0x118>
  6045. {
  6046. if (alarm)
  6047. 4458c: e0bffc17 ldw r2,-16(fp)
  6048. 44590: 10003826 beq r2,zero,44674 <alt_alarm_start+0x110>
  6049. {
  6050. alarm->callback = callback;
  6051. 44594: e0bffc17 ldw r2,-16(fp)
  6052. 44598: e0fffe17 ldw r3,-8(fp)
  6053. 4459c: 10c00315 stw r3,12(r2)
  6054. alarm->context = context;
  6055. 445a0: e0bffc17 ldw r2,-16(fp)
  6056. 445a4: e0ffff17 ldw r3,-4(fp)
  6057. 445a8: 10c00515 stw r3,20(r2)
  6058. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  6059. alt_irq_disable_all (void)
  6060. {
  6061. alt_irq_context context;
  6062. NIOS2_READ_STATUS (context);
  6063. 445ac: 0005303a rdctl r2,status
  6064. 445b0: e0bff915 stw r2,-28(fp)
  6065. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  6066. 445b4: e0fff917 ldw r3,-28(fp)
  6067. 445b8: 00bfff84 movi r2,-2
  6068. 445bc: 1884703a and r2,r3,r2
  6069. 445c0: 1001703a wrctl status,r2
  6070. return context;
  6071. 445c4: e0bff917 ldw r2,-28(fp)
  6072. irq_context = alt_irq_disable_all ();
  6073. 445c8: e0bff815 stw r2,-32(fp)
  6074. * alt_nticks() returns the elapsed number of system clock ticks since reset.
  6075. */
  6076. static ALT_INLINE alt_u32 ALT_ALWAYS_INLINE alt_nticks (void)
  6077. {
  6078. return _alt_nticks;
  6079. 445cc: d0a6b217 ldw r2,-25912(gp)
  6080. current_nticks = alt_nticks();
  6081. 445d0: e0bff615 stw r2,-40(fp)
  6082. alarm->time = nticks + current_nticks + 1;
  6083. 445d4: e0fffd17 ldw r3,-12(fp)
  6084. 445d8: e0bff617 ldw r2,-40(fp)
  6085. 445dc: 1885883a add r2,r3,r2
  6086. 445e0: 10c00044 addi r3,r2,1
  6087. 445e4: e0bffc17 ldw r2,-16(fp)
  6088. 445e8: 10c00215 stw r3,8(r2)
  6089. /*
  6090. * If the desired alarm time causes a roll-over, set the rollover
  6091. * flag. This will prevent the subsequent tick event from causing
  6092. * an alarm too early.
  6093. */
  6094. if(alarm->time < current_nticks)
  6095. 445ec: e0bffc17 ldw r2,-16(fp)
  6096. 445f0: 10c00217 ldw r3,8(r2)
  6097. 445f4: e0bff617 ldw r2,-40(fp)
  6098. 445f8: 1880042e bgeu r3,r2,4460c <alt_alarm_start+0xa8>
  6099. {
  6100. alarm->rollover = 1;
  6101. 445fc: e0bffc17 ldw r2,-16(fp)
  6102. 44600: 00c00044 movi r3,1
  6103. 44604: 10c00405 stb r3,16(r2)
  6104. 44608: 00000206 br 44614 <alt_alarm_start+0xb0>
  6105. }
  6106. else
  6107. {
  6108. alarm->rollover = 0;
  6109. 4460c: e0bffc17 ldw r2,-16(fp)
  6110. 44610: 10000405 stb zero,16(r2)
  6111. }
  6112. alt_llist_insert (&alt_alarm_list, &alarm->llist);
  6113. 44614: e0bffc17 ldw r2,-16(fp)
  6114. 44618: d0e00c04 addi r3,gp,-32720
  6115. 4461c: e0fffa15 stw r3,-24(fp)
  6116. 44620: e0bffb15 stw r2,-20(fp)
  6117. */
  6118. static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list,
  6119. alt_llist* entry)
  6120. {
  6121. entry->previous = list;
  6122. 44624: e0bffb17 ldw r2,-20(fp)
  6123. 44628: e0fffa17 ldw r3,-24(fp)
  6124. 4462c: 10c00115 stw r3,4(r2)
  6125. entry->next = list->next;
  6126. 44630: e0bffa17 ldw r2,-24(fp)
  6127. 44634: 10c00017 ldw r3,0(r2)
  6128. 44638: e0bffb17 ldw r2,-20(fp)
  6129. 4463c: 10c00015 stw r3,0(r2)
  6130. list->next->previous = entry;
  6131. 44640: e0bffa17 ldw r2,-24(fp)
  6132. 44644: 10800017 ldw r2,0(r2)
  6133. 44648: e0fffb17 ldw r3,-20(fp)
  6134. 4464c: 10c00115 stw r3,4(r2)
  6135. list->next = entry;
  6136. 44650: e0bffa17 ldw r2,-24(fp)
  6137. 44654: e0fffb17 ldw r3,-20(fp)
  6138. 44658: 10c00015 stw r3,0(r2)
  6139. 4465c: e0bff817 ldw r2,-32(fp)
  6140. 44660: e0bff715 stw r2,-36(fp)
  6141. status &= ~NIOS2_STATUS_PIE_MSK;
  6142. status |= (context & NIOS2_STATUS_PIE_MSK);
  6143. NIOS2_WRITE_STATUS (status);
  6144. #else
  6145. NIOS2_WRITE_STATUS (context);
  6146. 44664: e0bff717 ldw r2,-36(fp)
  6147. 44668: 1001703a wrctl status,r2
  6148. alt_irq_enable_all (irq_context);
  6149. return 0;
  6150. 4466c: 0005883a mov r2,zero
  6151. 44670: 00000306 br 44680 <alt_alarm_start+0x11c>
  6152. }
  6153. else
  6154. {
  6155. return -EINVAL;
  6156. 44674: 00bffa84 movi r2,-22
  6157. 44678: 00000106 br 44680 <alt_alarm_start+0x11c>
  6158. }
  6159. }
  6160. else
  6161. {
  6162. return -ENOTSUP;
  6163. 4467c: 00bfde84 movi r2,-134
  6164. }
  6165. }
  6166. 44680: e037883a mov sp,fp
  6167. 44684: df000017 ldw fp,0(sp)
  6168. 44688: dec00104 addi sp,sp,4
  6169. 4468c: f800283a ret
  6170. 00044690 <alt_dcache_flush_all>:
  6171. /*
  6172. * alt_dcache_flush_all() is called to flush the entire data cache.
  6173. */
  6174. void alt_dcache_flush_all (void)
  6175. {
  6176. 44690: deffff04 addi sp,sp,-4
  6177. 44694: df000015 stw fp,0(sp)
  6178. 44698: d839883a mov fp,sp
  6179. for (i = (char*) 0; i < (char*) NIOS2_DCACHE_SIZE; i+= NIOS2_DCACHE_LINE_SIZE)
  6180. {
  6181. __asm__ volatile ("flushd (%0)" :: "r" (i));
  6182. }
  6183. #endif /* NIOS2_DCACHE_SIZE > 0 */
  6184. }
  6185. 4469c: 0001883a nop
  6186. 446a0: e037883a mov sp,fp
  6187. 446a4: df000017 ldw fp,0(sp)
  6188. 446a8: dec00104 addi sp,sp,4
  6189. 446ac: f800283a ret
  6190. 000446b0 <alt_get_errno>:
  6191. #undef errno
  6192. extern int errno;
  6193. static ALT_INLINE int* alt_get_errno(void)
  6194. {
  6195. 446b0: defffe04 addi sp,sp,-8
  6196. 446b4: dfc00115 stw ra,4(sp)
  6197. 446b8: df000015 stw fp,0(sp)
  6198. 446bc: d839883a mov fp,sp
  6199. return ((alt_errno) ? alt_errno() : &errno);
  6200. 446c0: d0a00917 ldw r2,-32732(gp)
  6201. 446c4: 10000326 beq r2,zero,446d4 <alt_get_errno+0x24>
  6202. 446c8: d0a00917 ldw r2,-32732(gp)
  6203. 446cc: 103ee83a callr r2
  6204. 446d0: 00000106 br 446d8 <alt_get_errno+0x28>
  6205. 446d4: d0a6ac04 addi r2,gp,-25936
  6206. }
  6207. 446d8: e037883a mov sp,fp
  6208. 446dc: dfc00117 ldw ra,4(sp)
  6209. 446e0: df000017 ldw fp,0(sp)
  6210. 446e4: dec00204 addi sp,sp,8
  6211. 446e8: f800283a ret
  6212. 000446ec <alt_dev_llist_insert>:
  6213. /*
  6214. *
  6215. */
  6216. int alt_dev_llist_insert (alt_dev_llist* dev, alt_llist* list)
  6217. {
  6218. 446ec: defffa04 addi sp,sp,-24
  6219. 446f0: dfc00515 stw ra,20(sp)
  6220. 446f4: df000415 stw fp,16(sp)
  6221. 446f8: df000404 addi fp,sp,16
  6222. 446fc: e13ffe15 stw r4,-8(fp)
  6223. 44700: e17fff15 stw r5,-4(fp)
  6224. /*
  6225. * check that the device exists, and that it has a valid name.
  6226. */
  6227. if (!dev || !dev->name)
  6228. 44704: e0bffe17 ldw r2,-8(fp)
  6229. 44708: 10000326 beq r2,zero,44718 <alt_dev_llist_insert+0x2c>
  6230. 4470c: e0bffe17 ldw r2,-8(fp)
  6231. 44710: 10800217 ldw r2,8(r2)
  6232. 44714: 1000061e bne r2,zero,44730 <alt_dev_llist_insert+0x44>
  6233. {
  6234. ALT_ERRNO = EINVAL;
  6235. 44718: 00446b00 call 446b0 <alt_get_errno>
  6236. 4471c: 1007883a mov r3,r2
  6237. 44720: 00800584 movi r2,22
  6238. 44724: 18800015 stw r2,0(r3)
  6239. return -EINVAL;
  6240. 44728: 00bffa84 movi r2,-22
  6241. 4472c: 00001306 br 4477c <alt_dev_llist_insert+0x90>
  6242. /*
  6243. * register the device.
  6244. */
  6245. alt_llist_insert(list, &dev->llist);
  6246. 44730: e0bffe17 ldw r2,-8(fp)
  6247. 44734: e0ffff17 ldw r3,-4(fp)
  6248. 44738: e0fffc15 stw r3,-16(fp)
  6249. 4473c: e0bffd15 stw r2,-12(fp)
  6250. */
  6251. static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_insert(alt_llist* list,
  6252. alt_llist* entry)
  6253. {
  6254. entry->previous = list;
  6255. 44740: e0bffd17 ldw r2,-12(fp)
  6256. 44744: e0fffc17 ldw r3,-16(fp)
  6257. 44748: 10c00115 stw r3,4(r2)
  6258. entry->next = list->next;
  6259. 4474c: e0bffc17 ldw r2,-16(fp)
  6260. 44750: 10c00017 ldw r3,0(r2)
  6261. 44754: e0bffd17 ldw r2,-12(fp)
  6262. 44758: 10c00015 stw r3,0(r2)
  6263. list->next->previous = entry;
  6264. 4475c: e0bffc17 ldw r2,-16(fp)
  6265. 44760: 10800017 ldw r2,0(r2)
  6266. 44764: e0fffd17 ldw r3,-12(fp)
  6267. 44768: 10c00115 stw r3,4(r2)
  6268. list->next = entry;
  6269. 4476c: e0bffc17 ldw r2,-16(fp)
  6270. 44770: e0fffd17 ldw r3,-12(fp)
  6271. 44774: 10c00015 stw r3,0(r2)
  6272. return 0;
  6273. 44778: 0005883a mov r2,zero
  6274. }
  6275. 4477c: e037883a mov sp,fp
  6276. 44780: dfc00117 ldw ra,4(sp)
  6277. 44784: df000017 ldw fp,0(sp)
  6278. 44788: dec00204 addi sp,sp,8
  6279. 4478c: f800283a ret
  6280. 00044790 <_do_ctors>:
  6281. /*
  6282. * Run the C++ static constructors.
  6283. */
  6284. void _do_ctors(void)
  6285. {
  6286. 44790: defffd04 addi sp,sp,-12
  6287. 44794: dfc00215 stw ra,8(sp)
  6288. 44798: df000115 stw fp,4(sp)
  6289. 4479c: df000104 addi fp,sp,4
  6290. constructor* ctor;
  6291. for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--)
  6292. 447a0: 00800134 movhi r2,4
  6293. 447a4: 1095d104 addi r2,r2,22340
  6294. 447a8: e0bfff15 stw r2,-4(fp)
  6295. 447ac: 00000606 br 447c8 <_do_ctors+0x38>
  6296. (*ctor) ();
  6297. 447b0: e0bfff17 ldw r2,-4(fp)
  6298. 447b4: 10800017 ldw r2,0(r2)
  6299. 447b8: 103ee83a callr r2
  6300. void _do_ctors(void)
  6301. {
  6302. constructor* ctor;
  6303. for (ctor = &__CTOR_END__[-1]; ctor >= __CTOR_LIST__; ctor--)
  6304. 447bc: e0bfff17 ldw r2,-4(fp)
  6305. 447c0: 10bfff04 addi r2,r2,-4
  6306. 447c4: e0bfff15 stw r2,-4(fp)
  6307. 447c8: e0ffff17 ldw r3,-4(fp)
  6308. 447cc: 00800134 movhi r2,4
  6309. 447d0: 1095d204 addi r2,r2,22344
  6310. 447d4: 18bff62e bgeu r3,r2,447b0 <_do_ctors+0x20>
  6311. (*ctor) ();
  6312. }
  6313. 447d8: 0001883a nop
  6314. 447dc: e037883a mov sp,fp
  6315. 447e0: dfc00117 ldw ra,4(sp)
  6316. 447e4: df000017 ldw fp,0(sp)
  6317. 447e8: dec00204 addi sp,sp,8
  6318. 447ec: f800283a ret
  6319. 000447f0 <_do_dtors>:
  6320. /*
  6321. * Run the C++ static destructors.
  6322. */
  6323. void _do_dtors(void)
  6324. {
  6325. 447f0: defffd04 addi sp,sp,-12
  6326. 447f4: dfc00215 stw ra,8(sp)
  6327. 447f8: df000115 stw fp,4(sp)
  6328. 447fc: df000104 addi fp,sp,4
  6329. destructor* dtor;
  6330. for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--)
  6331. 44800: 00800134 movhi r2,4
  6332. 44804: 1095d104 addi r2,r2,22340
  6333. 44808: e0bfff15 stw r2,-4(fp)
  6334. 4480c: 00000606 br 44828 <_do_dtors+0x38>
  6335. (*dtor) ();
  6336. 44810: e0bfff17 ldw r2,-4(fp)
  6337. 44814: 10800017 ldw r2,0(r2)
  6338. 44818: 103ee83a callr r2
  6339. void _do_dtors(void)
  6340. {
  6341. destructor* dtor;
  6342. for (dtor = &__DTOR_END__[-1]; dtor >= __DTOR_LIST__; dtor--)
  6343. 4481c: e0bfff17 ldw r2,-4(fp)
  6344. 44820: 10bfff04 addi r2,r2,-4
  6345. 44824: e0bfff15 stw r2,-4(fp)
  6346. 44828: e0ffff17 ldw r3,-4(fp)
  6347. 4482c: 00800134 movhi r2,4
  6348. 44830: 1095d204 addi r2,r2,22344
  6349. 44834: 18bff62e bgeu r3,r2,44810 <_do_dtors+0x20>
  6350. (*dtor) ();
  6351. }
  6352. 44838: 0001883a nop
  6353. 4483c: e037883a mov sp,fp
  6354. 44840: dfc00117 ldw ra,4(sp)
  6355. 44844: df000017 ldw fp,0(sp)
  6356. 44848: dec00204 addi sp,sp,8
  6357. 4484c: f800283a ret
  6358. 00044850 <alt_icache_flush_all>:
  6359. /*
  6360. * alt_icache_flush_all() is called to flush the entire instruction cache.
  6361. */
  6362. void alt_icache_flush_all (void)
  6363. {
  6364. 44850: deffff04 addi sp,sp,-4
  6365. 44854: df000015 stw fp,0(sp)
  6366. 44858: d839883a mov fp,sp
  6367. #if NIOS2_ICACHE_SIZE > 0
  6368. alt_icache_flush (0, NIOS2_ICACHE_SIZE);
  6369. #endif
  6370. }
  6371. 4485c: 0001883a nop
  6372. 44860: e037883a mov sp,fp
  6373. 44864: df000017 ldw fp,0(sp)
  6374. 44868: dec00104 addi sp,sp,4
  6375. 4486c: f800283a ret
  6376. 00044870 <alt_ic_isr_register>:
  6377. * @param irq IRQ number
  6378. * @return 0 if successful, else error (-1)
  6379. */
  6380. int alt_ic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr,
  6381. void *isr_context, void *flags)
  6382. {
  6383. 44870: defff904 addi sp,sp,-28
  6384. 44874: dfc00615 stw ra,24(sp)
  6385. 44878: df000515 stw fp,20(sp)
  6386. 4487c: df000504 addi fp,sp,20
  6387. 44880: e13ffc15 stw r4,-16(fp)
  6388. 44884: e17ffd15 stw r5,-12(fp)
  6389. 44888: e1bffe15 stw r6,-8(fp)
  6390. 4488c: e1ffff15 stw r7,-4(fp)
  6391. return alt_iic_isr_register(ic_id, irq, isr, isr_context, flags);
  6392. 44890: e0800217 ldw r2,8(fp)
  6393. 44894: d8800015 stw r2,0(sp)
  6394. 44898: e1ffff17 ldw r7,-4(fp)
  6395. 4489c: e1bffe17 ldw r6,-8(fp)
  6396. 448a0: e17ffd17 ldw r5,-12(fp)
  6397. 448a4: e13ffc17 ldw r4,-16(fp)
  6398. 448a8: 0044a200 call 44a20 <alt_iic_isr_register>
  6399. }
  6400. 448ac: e037883a mov sp,fp
  6401. 448b0: dfc00117 ldw ra,4(sp)
  6402. 448b4: df000017 ldw fp,0(sp)
  6403. 448b8: dec00204 addi sp,sp,8
  6404. 448bc: f800283a ret
  6405. 000448c0 <alt_ic_irq_enable>:
  6406. * @param ic_id Ignored.
  6407. * @param irq IRQ number
  6408. * @return 0 if successful, else error (-1)
  6409. */
  6410. int alt_ic_irq_enable (alt_u32 ic_id, alt_u32 irq)
  6411. {
  6412. 448c0: defff904 addi sp,sp,-28
  6413. 448c4: df000615 stw fp,24(sp)
  6414. 448c8: df000604 addi fp,sp,24
  6415. 448cc: e13ffe15 stw r4,-8(fp)
  6416. 448d0: e17fff15 stw r5,-4(fp)
  6417. 448d4: e0bfff17 ldw r2,-4(fp)
  6418. 448d8: e0bffa15 stw r2,-24(fp)
  6419. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  6420. alt_irq_disable_all (void)
  6421. {
  6422. alt_irq_context context;
  6423. NIOS2_READ_STATUS (context);
  6424. 448dc: 0005303a rdctl r2,status
  6425. 448e0: e0bffb15 stw r2,-20(fp)
  6426. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  6427. 448e4: e0fffb17 ldw r3,-20(fp)
  6428. 448e8: 00bfff84 movi r2,-2
  6429. 448ec: 1884703a and r2,r3,r2
  6430. 448f0: 1001703a wrctl status,r2
  6431. return context;
  6432. 448f4: e0bffb17 ldw r2,-20(fp)
  6433. static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_enable (alt_u32 id)
  6434. {
  6435. alt_irq_context status;
  6436. extern volatile alt_u32 alt_irq_active;
  6437. status = alt_irq_disable_all ();
  6438. 448f8: e0bffc15 stw r2,-16(fp)
  6439. alt_irq_active |= (1 << id);
  6440. 448fc: 00c00044 movi r3,1
  6441. 44900: e0bffa17 ldw r2,-24(fp)
  6442. 44904: 1884983a sll r2,r3,r2
  6443. 44908: 1007883a mov r3,r2
  6444. 4490c: d0a6b017 ldw r2,-25920(gp)
  6445. 44910: 1884b03a or r2,r3,r2
  6446. 44914: d0a6b015 stw r2,-25920(gp)
  6447. NIOS2_WRITE_IENABLE (alt_irq_active);
  6448. 44918: d0a6b017 ldw r2,-25920(gp)
  6449. 4491c: 100170fa wrctl ienable,r2
  6450. 44920: e0bffc17 ldw r2,-16(fp)
  6451. 44924: e0bffd15 stw r2,-12(fp)
  6452. status &= ~NIOS2_STATUS_PIE_MSK;
  6453. status |= (context & NIOS2_STATUS_PIE_MSK);
  6454. NIOS2_WRITE_STATUS (status);
  6455. #else
  6456. NIOS2_WRITE_STATUS (context);
  6457. 44928: e0bffd17 ldw r2,-12(fp)
  6458. 4492c: 1001703a wrctl status,r2
  6459. alt_irq_enable_all(status);
  6460. return 0;
  6461. 44930: 0005883a mov r2,zero
  6462. return alt_irq_enable(irq);
  6463. 44934: 0001883a nop
  6464. }
  6465. 44938: e037883a mov sp,fp
  6466. 4493c: df000017 ldw fp,0(sp)
  6467. 44940: dec00104 addi sp,sp,4
  6468. 44944: f800283a ret
  6469. 00044948 <alt_ic_irq_disable>:
  6470. * @param ic_id Ignored.
  6471. * @param irq IRQ number
  6472. * @return 0 if successful, else error (-1)
  6473. */
  6474. int alt_ic_irq_disable(alt_u32 ic_id, alt_u32 irq)
  6475. {
  6476. 44948: defff904 addi sp,sp,-28
  6477. 4494c: df000615 stw fp,24(sp)
  6478. 44950: df000604 addi fp,sp,24
  6479. 44954: e13ffe15 stw r4,-8(fp)
  6480. 44958: e17fff15 stw r5,-4(fp)
  6481. 4495c: e0bfff17 ldw r2,-4(fp)
  6482. 44960: e0bffa15 stw r2,-24(fp)
  6483. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  6484. alt_irq_disable_all (void)
  6485. {
  6486. alt_irq_context context;
  6487. NIOS2_READ_STATUS (context);
  6488. 44964: 0005303a rdctl r2,status
  6489. 44968: e0bffb15 stw r2,-20(fp)
  6490. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  6491. 4496c: e0fffb17 ldw r3,-20(fp)
  6492. 44970: 00bfff84 movi r2,-2
  6493. 44974: 1884703a and r2,r3,r2
  6494. 44978: 1001703a wrctl status,r2
  6495. return context;
  6496. 4497c: e0bffb17 ldw r2,-20(fp)
  6497. static ALT_INLINE int ALT_ALWAYS_INLINE alt_irq_disable (alt_u32 id)
  6498. {
  6499. alt_irq_context status;
  6500. extern volatile alt_u32 alt_irq_active;
  6501. status = alt_irq_disable_all ();
  6502. 44980: e0bffc15 stw r2,-16(fp)
  6503. alt_irq_active &= ~(1 << id);
  6504. 44984: 00c00044 movi r3,1
  6505. 44988: e0bffa17 ldw r2,-24(fp)
  6506. 4498c: 1884983a sll r2,r3,r2
  6507. 44990: 0084303a nor r2,zero,r2
  6508. 44994: 1007883a mov r3,r2
  6509. 44998: d0a6b017 ldw r2,-25920(gp)
  6510. 4499c: 1884703a and r2,r3,r2
  6511. 449a0: d0a6b015 stw r2,-25920(gp)
  6512. NIOS2_WRITE_IENABLE (alt_irq_active);
  6513. 449a4: d0a6b017 ldw r2,-25920(gp)
  6514. 449a8: 100170fa wrctl ienable,r2
  6515. 449ac: e0bffc17 ldw r2,-16(fp)
  6516. 449b0: e0bffd15 stw r2,-12(fp)
  6517. status &= ~NIOS2_STATUS_PIE_MSK;
  6518. status |= (context & NIOS2_STATUS_PIE_MSK);
  6519. NIOS2_WRITE_STATUS (status);
  6520. #else
  6521. NIOS2_WRITE_STATUS (context);
  6522. 449b4: e0bffd17 ldw r2,-12(fp)
  6523. 449b8: 1001703a wrctl status,r2
  6524. alt_irq_enable_all(status);
  6525. return 0;
  6526. 449bc: 0005883a mov r2,zero
  6527. return alt_irq_disable(irq);
  6528. 449c0: 0001883a nop
  6529. }
  6530. 449c4: e037883a mov sp,fp
  6531. 449c8: df000017 ldw fp,0(sp)
  6532. 449cc: dec00104 addi sp,sp,4
  6533. 449d0: f800283a ret
  6534. 000449d4 <alt_ic_irq_enabled>:
  6535. * @param irq IRQ number
  6536. * @return Zero if corresponding interrupt is disabled and
  6537. * non-zero otherwise.
  6538. */
  6539. alt_u32 alt_ic_irq_enabled(alt_u32 ic_id, alt_u32 irq)
  6540. {
  6541. 449d4: defffc04 addi sp,sp,-16
  6542. 449d8: df000315 stw fp,12(sp)
  6543. 449dc: df000304 addi fp,sp,12
  6544. 449e0: e13ffe15 stw r4,-8(fp)
  6545. 449e4: e17fff15 stw r5,-4(fp)
  6546. alt_u32 irq_enabled;
  6547. NIOS2_READ_IENABLE(irq_enabled);
  6548. 449e8: 000530fa rdctl r2,ienable
  6549. 449ec: e0bffd15 stw r2,-12(fp)
  6550. return (irq_enabled & (1 << irq)) ? 1: 0;
  6551. 449f0: 00c00044 movi r3,1
  6552. 449f4: e0bfff17 ldw r2,-4(fp)
  6553. 449f8: 1884983a sll r2,r3,r2
  6554. 449fc: 1007883a mov r3,r2
  6555. 44a00: e0bffd17 ldw r2,-12(fp)
  6556. 44a04: 1884703a and r2,r3,r2
  6557. 44a08: 1004c03a cmpne r2,r2,zero
  6558. 44a0c: 10803fcc andi r2,r2,255
  6559. }
  6560. 44a10: e037883a mov sp,fp
  6561. 44a14: df000017 ldw fp,0(sp)
  6562. 44a18: dec00104 addi sp,sp,4
  6563. 44a1c: f800283a ret
  6564. 00044a20 <alt_iic_isr_register>:
  6565. * @param flags
  6566. * @return 0 if successful, else error (-1)
  6567. */
  6568. int alt_iic_isr_register(alt_u32 ic_id, alt_u32 irq, alt_isr_func isr,
  6569. void *isr_context, void *flags)
  6570. {
  6571. 44a20: defff504 addi sp,sp,-44
  6572. 44a24: dfc00a15 stw ra,40(sp)
  6573. 44a28: df000915 stw fp,36(sp)
  6574. 44a2c: df000904 addi fp,sp,36
  6575. 44a30: e13ffc15 stw r4,-16(fp)
  6576. 44a34: e17ffd15 stw r5,-12(fp)
  6577. 44a38: e1bffe15 stw r6,-8(fp)
  6578. 44a3c: e1ffff15 stw r7,-4(fp)
  6579. int rc = -EINVAL;
  6580. 44a40: 00bffa84 movi r2,-22
  6581. 44a44: e0bff715 stw r2,-36(fp)
  6582. int id = irq; /* IRQ interpreted as the interrupt ID. */
  6583. 44a48: e0bffd17 ldw r2,-12(fp)
  6584. 44a4c: e0bff815 stw r2,-32(fp)
  6585. alt_irq_context status;
  6586. if (id < ALT_NIRQ)
  6587. 44a50: e0bff817 ldw r2,-32(fp)
  6588. 44a54: 10800808 cmpgei r2,r2,32
  6589. 44a58: 1000271e bne r2,zero,44af8 <alt_iic_isr_register+0xd8>
  6590. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  6591. alt_irq_disable_all (void)
  6592. {
  6593. alt_irq_context context;
  6594. NIOS2_READ_STATUS (context);
  6595. 44a5c: 0005303a rdctl r2,status
  6596. 44a60: e0bffb15 stw r2,-20(fp)
  6597. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  6598. 44a64: e0fffb17 ldw r3,-20(fp)
  6599. 44a68: 00bfff84 movi r2,-2
  6600. 44a6c: 1884703a and r2,r3,r2
  6601. 44a70: 1001703a wrctl status,r2
  6602. return context;
  6603. 44a74: e0bffb17 ldw r2,-20(fp)
  6604. * interrupts are disabled while the handler tables are updated to ensure
  6605. * that an interrupt doesn't occur while the tables are in an inconsistant
  6606. * state.
  6607. */
  6608. status = alt_irq_disable_all();
  6609. 44a78: e0bffa15 stw r2,-24(fp)
  6610. alt_irq[id].handler = isr;
  6611. 44a7c: 00800174 movhi r2,5
  6612. 44a80: 10a32f04 addi r2,r2,-29508
  6613. 44a84: e0fff817 ldw r3,-32(fp)
  6614. 44a88: 180690fa slli r3,r3,3
  6615. 44a8c: 10c5883a add r2,r2,r3
  6616. 44a90: e0fffe17 ldw r3,-8(fp)
  6617. 44a94: 10c00015 stw r3,0(r2)
  6618. alt_irq[id].context = isr_context;
  6619. 44a98: 00800174 movhi r2,5
  6620. 44a9c: 10a32f04 addi r2,r2,-29508
  6621. 44aa0: e0fff817 ldw r3,-32(fp)
  6622. 44aa4: 180690fa slli r3,r3,3
  6623. 44aa8: 10c5883a add r2,r2,r3
  6624. 44aac: 10800104 addi r2,r2,4
  6625. 44ab0: e0ffff17 ldw r3,-4(fp)
  6626. 44ab4: 10c00015 stw r3,0(r2)
  6627. rc = (isr) ? alt_ic_irq_enable(ic_id, id) : alt_ic_irq_disable(ic_id, id);
  6628. 44ab8: e0bffe17 ldw r2,-8(fp)
  6629. 44abc: 10000526 beq r2,zero,44ad4 <alt_iic_isr_register+0xb4>
  6630. 44ac0: e0bff817 ldw r2,-32(fp)
  6631. 44ac4: 100b883a mov r5,r2
  6632. 44ac8: e13ffc17 ldw r4,-16(fp)
  6633. 44acc: 00448c00 call 448c0 <alt_ic_irq_enable>
  6634. 44ad0: 00000406 br 44ae4 <alt_iic_isr_register+0xc4>
  6635. 44ad4: e0bff817 ldw r2,-32(fp)
  6636. 44ad8: 100b883a mov r5,r2
  6637. 44adc: e13ffc17 ldw r4,-16(fp)
  6638. 44ae0: 00449480 call 44948 <alt_ic_irq_disable>
  6639. 44ae4: e0bff715 stw r2,-36(fp)
  6640. 44ae8: e0bffa17 ldw r2,-24(fp)
  6641. 44aec: e0bff915 stw r2,-28(fp)
  6642. status &= ~NIOS2_STATUS_PIE_MSK;
  6643. status |= (context & NIOS2_STATUS_PIE_MSK);
  6644. NIOS2_WRITE_STATUS (status);
  6645. #else
  6646. NIOS2_WRITE_STATUS (context);
  6647. 44af0: e0bff917 ldw r2,-28(fp)
  6648. 44af4: 1001703a wrctl status,r2
  6649. alt_irq_enable_all(status);
  6650. }
  6651. return rc;
  6652. 44af8: e0bff717 ldw r2,-36(fp)
  6653. }
  6654. 44afc: e037883a mov sp,fp
  6655. 44b00: dfc00117 ldw ra,4(sp)
  6656. 44b04: df000017 ldw fp,0(sp)
  6657. 44b08: dec00204 addi sp,sp,8
  6658. 44b0c: f800283a ret
  6659. 00044b10 <alt_open_fd>:
  6660. * If the device can not be succesfully opened, then the input file descriptor
  6661. * remains unchanged.
  6662. */
  6663. static void alt_open_fd(alt_fd* fd, const char* name, int flags, int mode)
  6664. {
  6665. 44b10: defff804 addi sp,sp,-32
  6666. 44b14: dfc00715 stw ra,28(sp)
  6667. 44b18: df000615 stw fp,24(sp)
  6668. 44b1c: dc000515 stw r16,20(sp)
  6669. 44b20: df000604 addi fp,sp,24
  6670. 44b24: e13ffb15 stw r4,-20(fp)
  6671. 44b28: e17ffc15 stw r5,-16(fp)
  6672. 44b2c: e1bffd15 stw r6,-12(fp)
  6673. 44b30: e1fffe15 stw r7,-8(fp)
  6674. int old;
  6675. old = open (name, flags, mode);
  6676. 44b34: e1bffe17 ldw r6,-8(fp)
  6677. 44b38: e17ffd17 ldw r5,-12(fp)
  6678. 44b3c: e13ffc17 ldw r4,-16(fp)
  6679. 44b40: 0044d980 call 44d98 <open>
  6680. 44b44: e0bffa15 stw r2,-24(fp)
  6681. if (old >= 0)
  6682. 44b48: e0bffa17 ldw r2,-24(fp)
  6683. 44b4c: 10002216 blt r2,zero,44bd8 <alt_open_fd+0xc8>
  6684. {
  6685. fd->dev = alt_fd_list[old].dev;
  6686. 44b50: 04000134 movhi r16,4
  6687. 44b54: 8417f904 addi r16,r16,24548
  6688. 44b58: e0bffa17 ldw r2,-24(fp)
  6689. 44b5c: 01400304 movi r5,12
  6690. 44b60: 1009883a mov r4,r2
  6691. 44b64: 004308c0 call 4308c <__mulsi3>
  6692. 44b68: 8085883a add r2,r16,r2
  6693. 44b6c: 10c00017 ldw r3,0(r2)
  6694. 44b70: e0bffb17 ldw r2,-20(fp)
  6695. 44b74: 10c00015 stw r3,0(r2)
  6696. fd->priv = alt_fd_list[old].priv;
  6697. 44b78: 04000134 movhi r16,4
  6698. 44b7c: 8417f904 addi r16,r16,24548
  6699. 44b80: e0bffa17 ldw r2,-24(fp)
  6700. 44b84: 01400304 movi r5,12
  6701. 44b88: 1009883a mov r4,r2
  6702. 44b8c: 004308c0 call 4308c <__mulsi3>
  6703. 44b90: 8085883a add r2,r16,r2
  6704. 44b94: 10800104 addi r2,r2,4
  6705. 44b98: 10c00017 ldw r3,0(r2)
  6706. 44b9c: e0bffb17 ldw r2,-20(fp)
  6707. 44ba0: 10c00115 stw r3,4(r2)
  6708. fd->fd_flags = alt_fd_list[old].fd_flags;
  6709. 44ba4: 04000134 movhi r16,4
  6710. 44ba8: 8417f904 addi r16,r16,24548
  6711. 44bac: e0bffa17 ldw r2,-24(fp)
  6712. 44bb0: 01400304 movi r5,12
  6713. 44bb4: 1009883a mov r4,r2
  6714. 44bb8: 004308c0 call 4308c <__mulsi3>
  6715. 44bbc: 8085883a add r2,r16,r2
  6716. 44bc0: 10800204 addi r2,r2,8
  6717. 44bc4: 10c00017 ldw r3,0(r2)
  6718. 44bc8: e0bffb17 ldw r2,-20(fp)
  6719. 44bcc: 10c00215 stw r3,8(r2)
  6720. alt_release_fd (old);
  6721. 44bd0: e13ffa17 ldw r4,-24(fp)
  6722. 44bd4: 00437d80 call 437d8 <alt_release_fd>
  6723. }
  6724. }
  6725. 44bd8: 0001883a nop
  6726. 44bdc: e6ffff04 addi sp,fp,-4
  6727. 44be0: dfc00217 ldw ra,8(sp)
  6728. 44be4: df000117 ldw fp,4(sp)
  6729. 44be8: dc000017 ldw r16,0(sp)
  6730. 44bec: dec00304 addi sp,sp,12
  6731. 44bf0: f800283a ret
  6732. 00044bf4 <alt_io_redirect>:
  6733. */
  6734. void alt_io_redirect(const char* stdout_dev,
  6735. const char* stdin_dev,
  6736. const char* stderr_dev)
  6737. {
  6738. 44bf4: defffb04 addi sp,sp,-20
  6739. 44bf8: dfc00415 stw ra,16(sp)
  6740. 44bfc: df000315 stw fp,12(sp)
  6741. 44c00: df000304 addi fp,sp,12
  6742. 44c04: e13ffd15 stw r4,-12(fp)
  6743. 44c08: e17ffe15 stw r5,-8(fp)
  6744. 44c0c: e1bfff15 stw r6,-4(fp)
  6745. /* Redirect the channels */
  6746. alt_open_fd (&alt_fd_list[STDOUT_FILENO], stdout_dev, O_WRONLY, 0777);
  6747. 44c10: 01c07fc4 movi r7,511
  6748. 44c14: 01800044 movi r6,1
  6749. 44c18: e17ffd17 ldw r5,-12(fp)
  6750. 44c1c: 01000134 movhi r4,4
  6751. 44c20: 2117fc04 addi r4,r4,24560
  6752. 44c24: 0044b100 call 44b10 <alt_open_fd>
  6753. alt_open_fd (&alt_fd_list[STDIN_FILENO], stdin_dev, O_RDONLY, 0777);
  6754. 44c28: 01c07fc4 movi r7,511
  6755. 44c2c: 000d883a mov r6,zero
  6756. 44c30: e17ffe17 ldw r5,-8(fp)
  6757. 44c34: 01000134 movhi r4,4
  6758. 44c38: 2117f904 addi r4,r4,24548
  6759. 44c3c: 0044b100 call 44b10 <alt_open_fd>
  6760. alt_open_fd (&alt_fd_list[STDERR_FILENO], stderr_dev, O_WRONLY, 0777);
  6761. 44c40: 01c07fc4 movi r7,511
  6762. 44c44: 01800044 movi r6,1
  6763. 44c48: e17fff17 ldw r5,-4(fp)
  6764. 44c4c: 01000134 movhi r4,4
  6765. 44c50: 2117ff04 addi r4,r4,24572
  6766. 44c54: 0044b100 call 44b10 <alt_open_fd>
  6767. }
  6768. 44c58: 0001883a nop
  6769. 44c5c: e037883a mov sp,fp
  6770. 44c60: dfc00117 ldw ra,4(sp)
  6771. 44c64: df000017 ldw fp,0(sp)
  6772. 44c68: dec00204 addi sp,sp,8
  6773. 44c6c: f800283a ret
  6774. 00044c70 <alt_get_errno>:
  6775. #undef errno
  6776. extern int errno;
  6777. static ALT_INLINE int* alt_get_errno(void)
  6778. {
  6779. 44c70: defffe04 addi sp,sp,-8
  6780. 44c74: dfc00115 stw ra,4(sp)
  6781. 44c78: df000015 stw fp,0(sp)
  6782. 44c7c: d839883a mov fp,sp
  6783. return ((alt_errno) ? alt_errno() : &errno);
  6784. 44c80: d0a00917 ldw r2,-32732(gp)
  6785. 44c84: 10000326 beq r2,zero,44c94 <alt_get_errno+0x24>
  6786. 44c88: d0a00917 ldw r2,-32732(gp)
  6787. 44c8c: 103ee83a callr r2
  6788. 44c90: 00000106 br 44c98 <alt_get_errno+0x28>
  6789. 44c94: d0a6ac04 addi r2,gp,-25936
  6790. }
  6791. 44c98: e037883a mov sp,fp
  6792. 44c9c: dfc00117 ldw ra,4(sp)
  6793. 44ca0: df000017 ldw fp,0(sp)
  6794. 44ca4: dec00204 addi sp,sp,8
  6795. 44ca8: f800283a ret
  6796. 00044cac <alt_file_locked>:
  6797. * performed for devices. Filesystems are required to handle the ioctl() call
  6798. * themselves, and report the error from the filesystems open() function.
  6799. */
  6800. static int alt_file_locked (alt_fd* fd)
  6801. {
  6802. 44cac: defffb04 addi sp,sp,-20
  6803. 44cb0: dfc00415 stw ra,16(sp)
  6804. 44cb4: df000315 stw fp,12(sp)
  6805. 44cb8: dc000215 stw r16,8(sp)
  6806. 44cbc: df000304 addi fp,sp,12
  6807. 44cc0: e13ffe15 stw r4,-8(fp)
  6808. /*
  6809. * Mark the file descriptor as belonging to a device.
  6810. */
  6811. fd->fd_flags |= ALT_FD_DEV;
  6812. 44cc4: e0bffe17 ldw r2,-8(fp)
  6813. 44cc8: 10800217 ldw r2,8(r2)
  6814. 44ccc: 10d00034 orhi r3,r2,16384
  6815. 44cd0: e0bffe17 ldw r2,-8(fp)
  6816. 44cd4: 10c00215 stw r3,8(r2)
  6817. /*
  6818. * Loop through all current file descriptors searching for one that's locked
  6819. * for exclusive access. If a match is found, generate an error.
  6820. */
  6821. for (i = 0; i <= alt_max_fd; i++)
  6822. 44cd8: e03ffd15 stw zero,-12(fp)
  6823. 44cdc: 00002306 br 44d6c <alt_file_locked+0xc0>
  6824. {
  6825. if ((alt_fd_list[i].dev == fd->dev) &&
  6826. 44ce0: 04000134 movhi r16,4
  6827. 44ce4: 8417f904 addi r16,r16,24548
  6828. 44ce8: e0bffd17 ldw r2,-12(fp)
  6829. 44cec: 01400304 movi r5,12
  6830. 44cf0: 1009883a mov r4,r2
  6831. 44cf4: 004308c0 call 4308c <__mulsi3>
  6832. 44cf8: 8085883a add r2,r16,r2
  6833. 44cfc: 10c00017 ldw r3,0(r2)
  6834. 44d00: e0bffe17 ldw r2,-8(fp)
  6835. 44d04: 10800017 ldw r2,0(r2)
  6836. 44d08: 1880151e bne r3,r2,44d60 <alt_file_locked+0xb4>
  6837. (alt_fd_list[i].fd_flags & ALT_FD_EXCL) &&
  6838. 44d0c: 04000134 movhi r16,4
  6839. 44d10: 8417f904 addi r16,r16,24548
  6840. 44d14: e0bffd17 ldw r2,-12(fp)
  6841. 44d18: 01400304 movi r5,12
  6842. 44d1c: 1009883a mov r4,r2
  6843. 44d20: 004308c0 call 4308c <__mulsi3>
  6844. 44d24: 8085883a add r2,r16,r2
  6845. 44d28: 10800204 addi r2,r2,8
  6846. 44d2c: 10800017 ldw r2,0(r2)
  6847. * for exclusive access. If a match is found, generate an error.
  6848. */
  6849. for (i = 0; i <= alt_max_fd; i++)
  6850. {
  6851. if ((alt_fd_list[i].dev == fd->dev) &&
  6852. 44d30: 10000b0e bge r2,zero,44d60 <alt_file_locked+0xb4>
  6853. (alt_fd_list[i].fd_flags & ALT_FD_EXCL) &&
  6854. (&alt_fd_list[i] != fd))
  6855. 44d34: 01400304 movi r5,12
  6856. 44d38: e13ffd17 ldw r4,-12(fp)
  6857. 44d3c: 004308c0 call 4308c <__mulsi3>
  6858. 44d40: 1007883a mov r3,r2
  6859. 44d44: 00800134 movhi r2,4
  6860. 44d48: 1097f904 addi r2,r2,24548
  6861. 44d4c: 1887883a add r3,r3,r2
  6862. */
  6863. for (i = 0; i <= alt_max_fd; i++)
  6864. {
  6865. if ((alt_fd_list[i].dev == fd->dev) &&
  6866. (alt_fd_list[i].fd_flags & ALT_FD_EXCL) &&
  6867. 44d50: e0bffe17 ldw r2,-8(fp)
  6868. 44d54: 18800226 beq r3,r2,44d60 <alt_file_locked+0xb4>
  6869. (&alt_fd_list[i] != fd))
  6870. {
  6871. return -EACCES;
  6872. 44d58: 00bffcc4 movi r2,-13
  6873. 44d5c: 00000806 br 44d80 <alt_file_locked+0xd4>
  6874. /*
  6875. * Loop through all current file descriptors searching for one that's locked
  6876. * for exclusive access. If a match is found, generate an error.
  6877. */
  6878. for (i = 0; i <= alt_max_fd; i++)
  6879. 44d60: e0bffd17 ldw r2,-12(fp)
  6880. 44d64: 10800044 addi r2,r2,1
  6881. 44d68: e0bffd15 stw r2,-12(fp)
  6882. 44d6c: d0a00817 ldw r2,-32736(gp)
  6883. 44d70: 1007883a mov r3,r2
  6884. 44d74: e0bffd17 ldw r2,-12(fp)
  6885. 44d78: 18bfd92e bgeu r3,r2,44ce0 <alt_file_locked+0x34>
  6886. }
  6887. }
  6888. /* The device is not locked */
  6889. return 0;
  6890. 44d7c: 0005883a mov r2,zero
  6891. }
  6892. 44d80: e6ffff04 addi sp,fp,-4
  6893. 44d84: dfc00217 ldw ra,8(sp)
  6894. 44d88: df000117 ldw fp,4(sp)
  6895. 44d8c: dc000017 ldw r16,0(sp)
  6896. 44d90: dec00304 addi sp,sp,12
  6897. 44d94: f800283a ret
  6898. 00044d98 <open>:
  6899. *
  6900. * ALT_OPEN is mapped onto the open() system call in alt_syscall.h
  6901. */
  6902. int ALT_OPEN (const char* file, int flags, int mode)
  6903. {
  6904. 44d98: defff604 addi sp,sp,-40
  6905. 44d9c: dfc00915 stw ra,36(sp)
  6906. 44da0: df000815 stw fp,32(sp)
  6907. 44da4: df000804 addi fp,sp,32
  6908. 44da8: e13ffd15 stw r4,-12(fp)
  6909. 44dac: e17ffe15 stw r5,-8(fp)
  6910. 44db0: e1bfff15 stw r6,-4(fp)
  6911. alt_dev* dev;
  6912. alt_fd* fd;
  6913. int index = -1;
  6914. 44db4: 00bfffc4 movi r2,-1
  6915. 44db8: e0bff915 stw r2,-28(fp)
  6916. int status = -ENODEV;
  6917. 44dbc: 00bffb44 movi r2,-19
  6918. 44dc0: e0bffa15 stw r2,-24(fp)
  6919. int isafs = 0;
  6920. 44dc4: e03ffb15 stw zero,-20(fp)
  6921. /*
  6922. * Check the device list, to see if a device with a matching name is
  6923. * registered.
  6924. */
  6925. if (!(dev = alt_find_dev (file, &alt_dev_list)))
  6926. 44dc8: d1600604 addi r5,gp,-32744
  6927. 44dcc: e13ffd17 ldw r4,-12(fp)
  6928. 44dd0: 00450bc0 call 450bc <alt_find_dev>
  6929. 44dd4: e0bff815 stw r2,-32(fp)
  6930. 44dd8: e0bff817 ldw r2,-32(fp)
  6931. 44ddc: 1000051e bne r2,zero,44df4 <open+0x5c>
  6932. {
  6933. /* No matching device, so try the filesystem list */
  6934. dev = alt_find_file (file);
  6935. 44de0: e13ffd17 ldw r4,-12(fp)
  6936. 44de4: 004514c0 call 4514c <alt_find_file>
  6937. 44de8: e0bff815 stw r2,-32(fp)
  6938. isafs = 1;
  6939. 44dec: 00800044 movi r2,1
  6940. 44df0: e0bffb15 stw r2,-20(fp)
  6941. /*
  6942. * If a matching device or filesystem is found, allocate a file descriptor.
  6943. */
  6944. if (dev)
  6945. 44df4: e0bff817 ldw r2,-32(fp)
  6946. 44df8: 10002b26 beq r2,zero,44ea8 <open+0x110>
  6947. {
  6948. if ((index = alt_get_fd (dev)) < 0)
  6949. 44dfc: e13ff817 ldw r4,-32(fp)
  6950. 44e00: 00452540 call 45254 <alt_get_fd>
  6951. 44e04: e0bff915 stw r2,-28(fp)
  6952. 44e08: e0bff917 ldw r2,-28(fp)
  6953. 44e0c: 1000030e bge r2,zero,44e1c <open+0x84>
  6954. {
  6955. status = index;
  6956. 44e10: e0bff917 ldw r2,-28(fp)
  6957. 44e14: e0bffa15 stw r2,-24(fp)
  6958. 44e18: 00002506 br 44eb0 <open+0x118>
  6959. }
  6960. else
  6961. {
  6962. fd = &alt_fd_list[index];
  6963. 44e1c: 01400304 movi r5,12
  6964. 44e20: e13ff917 ldw r4,-28(fp)
  6965. 44e24: 004308c0 call 4308c <__mulsi3>
  6966. 44e28: 1007883a mov r3,r2
  6967. 44e2c: 00800134 movhi r2,4
  6968. 44e30: 1097f904 addi r2,r2,24548
  6969. 44e34: 1885883a add r2,r3,r2
  6970. 44e38: e0bffc15 stw r2,-16(fp)
  6971. fd->fd_flags = (flags & ~ALT_FD_FLAGS_MASK);
  6972. 44e3c: e0fffe17 ldw r3,-8(fp)
  6973. 44e40: 00900034 movhi r2,16384
  6974. 44e44: 10bfffc4 addi r2,r2,-1
  6975. 44e48: 1886703a and r3,r3,r2
  6976. 44e4c: e0bffc17 ldw r2,-16(fp)
  6977. 44e50: 10c00215 stw r3,8(r2)
  6978. /* If this is a device, ensure it isn't already locked */
  6979. if (isafs || ((status = alt_file_locked (fd)) >= 0))
  6980. 44e54: e0bffb17 ldw r2,-20(fp)
  6981. 44e58: 1000051e bne r2,zero,44e70 <open+0xd8>
  6982. 44e5c: e13ffc17 ldw r4,-16(fp)
  6983. 44e60: 0044cac0 call 44cac <alt_file_locked>
  6984. 44e64: e0bffa15 stw r2,-24(fp)
  6985. 44e68: e0bffa17 ldw r2,-24(fp)
  6986. 44e6c: 10001016 blt r2,zero,44eb0 <open+0x118>
  6987. /*
  6988. * If the device or filesystem provides an open() callback function,
  6989. * call it now to perform any device/filesystem specific operations.
  6990. */
  6991. status = (dev->open) ? dev->open(fd, file, flags, mode): 0;
  6992. 44e70: e0bff817 ldw r2,-32(fp)
  6993. 44e74: 10800317 ldw r2,12(r2)
  6994. 44e78: 10000826 beq r2,zero,44e9c <open+0x104>
  6995. 44e7c: e0bff817 ldw r2,-32(fp)
  6996. 44e80: 10800317 ldw r2,12(r2)
  6997. 44e84: e1ffff17 ldw r7,-4(fp)
  6998. 44e88: e1bffe17 ldw r6,-8(fp)
  6999. 44e8c: e17ffd17 ldw r5,-12(fp)
  7000. 44e90: e13ffc17 ldw r4,-16(fp)
  7001. 44e94: 103ee83a callr r2
  7002. 44e98: 00000106 br 44ea0 <open+0x108>
  7003. 44e9c: 0005883a mov r2,zero
  7004. 44ea0: e0bffa15 stw r2,-24(fp)
  7005. 44ea4: 00000206 br 44eb0 <open+0x118>
  7006. }
  7007. }
  7008. }
  7009. else
  7010. {
  7011. status = -ENODEV;
  7012. 44ea8: 00bffb44 movi r2,-19
  7013. 44eac: e0bffa15 stw r2,-24(fp)
  7014. }
  7015. /* Allocation failed, so clean up and return an error */
  7016. if (status < 0)
  7017. 44eb0: e0bffa17 ldw r2,-24(fp)
  7018. 44eb4: 1000090e bge r2,zero,44edc <open+0x144>
  7019. {
  7020. alt_release_fd (index);
  7021. 44eb8: e13ff917 ldw r4,-28(fp)
  7022. 44ebc: 00437d80 call 437d8 <alt_release_fd>
  7023. ALT_ERRNO = -status;
  7024. 44ec0: 0044c700 call 44c70 <alt_get_errno>
  7025. 44ec4: 1007883a mov r3,r2
  7026. 44ec8: e0bffa17 ldw r2,-24(fp)
  7027. 44ecc: 0085c83a sub r2,zero,r2
  7028. 44ed0: 18800015 stw r2,0(r3)
  7029. return -1;
  7030. 44ed4: 00bfffc4 movi r2,-1
  7031. 44ed8: 00000106 br 44ee0 <open+0x148>
  7032. }
  7033. /* return the reference upon success */
  7034. return index;
  7035. 44edc: e0bff917 ldw r2,-28(fp)
  7036. }
  7037. 44ee0: e037883a mov sp,fp
  7038. 44ee4: dfc00117 ldw ra,4(sp)
  7039. 44ee8: df000017 ldw fp,0(sp)
  7040. 44eec: dec00204 addi sp,sp,8
  7041. 44ef0: f800283a ret
  7042. 00044ef4 <alt_alarm_stop>:
  7043. * alarms. Alternatively an alarm can unregister itself by returning zero when
  7044. * the alarm executes.
  7045. */
  7046. void alt_alarm_stop (alt_alarm* alarm)
  7047. {
  7048. 44ef4: defffa04 addi sp,sp,-24
  7049. 44ef8: df000515 stw fp,20(sp)
  7050. 44efc: df000504 addi fp,sp,20
  7051. 44f00: e13fff15 stw r4,-4(fp)
  7052. static ALT_INLINE alt_irq_context ALT_ALWAYS_INLINE
  7053. alt_irq_disable_all (void)
  7054. {
  7055. alt_irq_context context;
  7056. NIOS2_READ_STATUS (context);
  7057. 44f04: 0005303a rdctl r2,status
  7058. 44f08: e0bffc15 stw r2,-16(fp)
  7059. NIOS2_WRITE_STATUS (context & ~NIOS2_STATUS_PIE_MSK);
  7060. 44f0c: e0fffc17 ldw r3,-16(fp)
  7061. 44f10: 00bfff84 movi r2,-2
  7062. 44f14: 1884703a and r2,r3,r2
  7063. 44f18: 1001703a wrctl status,r2
  7064. return context;
  7065. 44f1c: e0bffc17 ldw r2,-16(fp)
  7066. alt_irq_context irq_context;
  7067. irq_context = alt_irq_disable_all();
  7068. 44f20: e0bffb15 stw r2,-20(fp)
  7069. alt_llist_remove (&alarm->llist);
  7070. 44f24: e0bfff17 ldw r2,-4(fp)
  7071. 44f28: e0bffd15 stw r2,-12(fp)
  7072. * input argument is the element to remove.
  7073. */
  7074. static ALT_INLINE void ALT_ALWAYS_INLINE alt_llist_remove(alt_llist* entry)
  7075. {
  7076. entry->next->previous = entry->previous;
  7077. 44f2c: e0bffd17 ldw r2,-12(fp)
  7078. 44f30: 10800017 ldw r2,0(r2)
  7079. 44f34: e0fffd17 ldw r3,-12(fp)
  7080. 44f38: 18c00117 ldw r3,4(r3)
  7081. 44f3c: 10c00115 stw r3,4(r2)
  7082. entry->previous->next = entry->next;
  7083. 44f40: e0bffd17 ldw r2,-12(fp)
  7084. 44f44: 10800117 ldw r2,4(r2)
  7085. 44f48: e0fffd17 ldw r3,-12(fp)
  7086. 44f4c: 18c00017 ldw r3,0(r3)
  7087. 44f50: 10c00015 stw r3,0(r2)
  7088. /*
  7089. * Set the entry to point to itself, so that any further calls to
  7090. * alt_llist_remove() are harmless.
  7091. */
  7092. entry->previous = entry;
  7093. 44f54: e0bffd17 ldw r2,-12(fp)
  7094. 44f58: e0fffd17 ldw r3,-12(fp)
  7095. 44f5c: 10c00115 stw r3,4(r2)
  7096. entry->next = entry;
  7097. 44f60: e0bffd17 ldw r2,-12(fp)
  7098. 44f64: e0fffd17 ldw r3,-12(fp)
  7099. 44f68: 10c00015 stw r3,0(r2)
  7100. 44f6c: e0bffb17 ldw r2,-20(fp)
  7101. 44f70: e0bffe15 stw r2,-8(fp)
  7102. status &= ~NIOS2_STATUS_PIE_MSK;
  7103. status |= (context & NIOS2_STATUS_PIE_MSK);
  7104. NIOS2_WRITE_STATUS (status);
  7105. #else
  7106. NIOS2_WRITE_STATUS (context);
  7107. 44f74: e0bffe17 ldw r2,-8(fp)
  7108. 44f78: 1001703a wrctl status,r2
  7109. alt_irq_enable_all (irq_context);
  7110. }
  7111. 44f7c: 0001883a nop
  7112. 44f80: e037883a mov sp,fp
  7113. 44f84: df000017 ldw fp,0(sp)
  7114. 44f88: dec00104 addi sp,sp,4
  7115. 44f8c: f800283a ret
  7116. 00044f90 <alt_tick>:
  7117. *
  7118. * alt_tick() is expected to run at interrupt level.
  7119. */
  7120. void alt_tick (void)
  7121. {
  7122. 44f90: defffb04 addi sp,sp,-20
  7123. 44f94: dfc00415 stw ra,16(sp)
  7124. 44f98: df000315 stw fp,12(sp)
  7125. 44f9c: df000304 addi fp,sp,12
  7126. alt_alarm* next;
  7127. alt_alarm* alarm = (alt_alarm*) alt_alarm_list.next;
  7128. 44fa0: d0a00c17 ldw r2,-32720(gp)
  7129. 44fa4: e0bffd15 stw r2,-12(fp)
  7130. alt_u32 next_callback;
  7131. /* update the tick counter */
  7132. _alt_nticks++;
  7133. 44fa8: d0a6b217 ldw r2,-25912(gp)
  7134. 44fac: 10800044 addi r2,r2,1
  7135. 44fb0: d0a6b215 stw r2,-25912(gp)
  7136. /* process the registered callbacks */
  7137. while (alarm != (alt_alarm*) &alt_alarm_list)
  7138. 44fb4: 00002e06 br 45070 <alt_tick+0xe0>
  7139. {
  7140. next = (alt_alarm*) alarm->llist.next;
  7141. 44fb8: e0bffd17 ldw r2,-12(fp)
  7142. 44fbc: 10800017 ldw r2,0(r2)
  7143. 44fc0: e0bffe15 stw r2,-8(fp)
  7144. /*
  7145. * Upon the tick-counter rolling over it is safe to clear the
  7146. * roll-over flag; once the flag is cleared this (or subsequnt)
  7147. * tick events are enabled to generate an alarm event.
  7148. */
  7149. if ((alarm->rollover) && (_alt_nticks == 0))
  7150. 44fc4: e0bffd17 ldw r2,-12(fp)
  7151. 44fc8: 10800403 ldbu r2,16(r2)
  7152. 44fcc: 10803fcc andi r2,r2,255
  7153. 44fd0: 10000426 beq r2,zero,44fe4 <alt_tick+0x54>
  7154. 44fd4: d0a6b217 ldw r2,-25912(gp)
  7155. 44fd8: 1000021e bne r2,zero,44fe4 <alt_tick+0x54>
  7156. {
  7157. alarm->rollover = 0;
  7158. 44fdc: e0bffd17 ldw r2,-12(fp)
  7159. 44fe0: 10000405 stb zero,16(r2)
  7160. }
  7161. /* if the alarm period has expired, make the callback */
  7162. if ((alarm->time <= _alt_nticks) && (alarm->rollover == 0))
  7163. 44fe4: e0bffd17 ldw r2,-12(fp)
  7164. 44fe8: 10800217 ldw r2,8(r2)
  7165. 44fec: d0e6b217 ldw r3,-25912(gp)
  7166. 44ff0: 18801d36 bltu r3,r2,45068 <alt_tick+0xd8>
  7167. 44ff4: e0bffd17 ldw r2,-12(fp)
  7168. 44ff8: 10800403 ldbu r2,16(r2)
  7169. 44ffc: 10803fcc andi r2,r2,255
  7170. 45000: 1000191e bne r2,zero,45068 <alt_tick+0xd8>
  7171. {
  7172. next_callback = alarm->callback (alarm->context);
  7173. 45004: e0bffd17 ldw r2,-12(fp)
  7174. 45008: 10800317 ldw r2,12(r2)
  7175. 4500c: e0fffd17 ldw r3,-12(fp)
  7176. 45010: 18c00517 ldw r3,20(r3)
  7177. 45014: 1809883a mov r4,r3
  7178. 45018: 103ee83a callr r2
  7179. 4501c: e0bfff15 stw r2,-4(fp)
  7180. /* deactivate the alarm if the return value is zero */
  7181. if (next_callback == 0)
  7182. 45020: e0bfff17 ldw r2,-4(fp)
  7183. 45024: 1000031e bne r2,zero,45034 <alt_tick+0xa4>
  7184. {
  7185. alt_alarm_stop (alarm);
  7186. 45028: e13ffd17 ldw r4,-12(fp)
  7187. 4502c: 0044ef40 call 44ef4 <alt_alarm_stop>
  7188. 45030: 00000d06 br 45068 <alt_tick+0xd8>
  7189. }
  7190. else
  7191. {
  7192. alarm->time += next_callback;
  7193. 45034: e0bffd17 ldw r2,-12(fp)
  7194. 45038: 10c00217 ldw r3,8(r2)
  7195. 4503c: e0bfff17 ldw r2,-4(fp)
  7196. 45040: 1887883a add r3,r3,r2
  7197. 45044: e0bffd17 ldw r2,-12(fp)
  7198. 45048: 10c00215 stw r3,8(r2)
  7199. /*
  7200. * If the desired alarm time causes a roll-over, set the rollover
  7201. * flag. This will prevent the subsequent tick event from causing
  7202. * an alarm too early.
  7203. */
  7204. if(alarm->time < _alt_nticks)
  7205. 4504c: e0bffd17 ldw r2,-12(fp)
  7206. 45050: 10c00217 ldw r3,8(r2)
  7207. 45054: d0a6b217 ldw r2,-25912(gp)
  7208. 45058: 1880032e bgeu r3,r2,45068 <alt_tick+0xd8>
  7209. {
  7210. alarm->rollover = 1;
  7211. 4505c: e0bffd17 ldw r2,-12(fp)
  7212. 45060: 00c00044 movi r3,1
  7213. 45064: 10c00405 stb r3,16(r2)
  7214. }
  7215. }
  7216. }
  7217. alarm = next;
  7218. 45068: e0bffe17 ldw r2,-8(fp)
  7219. 4506c: e0bffd15 stw r2,-12(fp)
  7220. _alt_nticks++;
  7221. /* process the registered callbacks */
  7222. while (alarm != (alt_alarm*) &alt_alarm_list)
  7223. 45070: e0fffd17 ldw r3,-12(fp)
  7224. 45074: d0a00c04 addi r2,gp,-32720
  7225. 45078: 18bfcf1e bne r3,r2,44fb8 <alt_tick+0x28>
  7226. /*
  7227. * Update the operating system specific timer facilities.
  7228. */
  7229. ALT_OS_TIME_TICK();
  7230. 4507c: 0001883a nop
  7231. }
  7232. 45080: 0001883a nop
  7233. 45084: e037883a mov sp,fp
  7234. 45088: dfc00117 ldw ra,4(sp)
  7235. 4508c: df000017 ldw fp,0(sp)
  7236. 45090: dec00204 addi sp,sp,8
  7237. 45094: f800283a ret
  7238. 00045098 <altera_nios2_gen2_irq_init>:
  7239. /*
  7240. * To initialize the internal interrupt controller, just clear the IENABLE
  7241. * register so that all possible IRQs are disabled.
  7242. */
  7243. void altera_nios2_gen2_irq_init(void)
  7244. {
  7245. 45098: deffff04 addi sp,sp,-4
  7246. 4509c: df000015 stw fp,0(sp)
  7247. 450a0: d839883a mov fp,sp
  7248. NIOS2_WRITE_IENABLE(0);
  7249. 450a4: 000170fa wrctl ienable,zero
  7250. }
  7251. 450a8: 0001883a nop
  7252. 450ac: e037883a mov sp,fp
  7253. 450b0: df000017 ldw fp,0(sp)
  7254. 450b4: dec00104 addi sp,sp,4
  7255. 450b8: f800283a ret
  7256. 000450bc <alt_find_dev>:
  7257. * "name" must be an exact match for the devices registered name for a match to
  7258. * be found.
  7259. */
  7260. alt_dev* alt_find_dev(const char* name, alt_llist* llist)
  7261. {
  7262. 450bc: defffa04 addi sp,sp,-24
  7263. 450c0: dfc00515 stw ra,20(sp)
  7264. 450c4: df000415 stw fp,16(sp)
  7265. 450c8: df000404 addi fp,sp,16
  7266. 450cc: e13ffe15 stw r4,-8(fp)
  7267. 450d0: e17fff15 stw r5,-4(fp)
  7268. alt_dev* next = (alt_dev*) llist->next;
  7269. 450d4: e0bfff17 ldw r2,-4(fp)
  7270. 450d8: 10800017 ldw r2,0(r2)
  7271. 450dc: e0bffc15 stw r2,-16(fp)
  7272. alt_32 len;
  7273. len = strlen(name) + 1;
  7274. 450e0: e13ffe17 ldw r4,-8(fp)
  7275. 450e4: 004037c0 call 4037c <strlen>
  7276. 450e8: 10800044 addi r2,r2,1
  7277. 450ec: e0bffd15 stw r2,-12(fp)
  7278. /*
  7279. * Check each list entry in turn, until a match is found, or we reach the
  7280. * end of the list (i.e. next winds up pointing back to the list head).
  7281. */
  7282. while (next != (alt_dev*) llist)
  7283. 450f0: 00000d06 br 45128 <alt_find_dev+0x6c>
  7284. /*
  7285. * memcmp() is used here rather than strcmp() in order to reduce the size
  7286. * of the executable.
  7287. */
  7288. if (!memcmp (next->name, name, len))
  7289. 450f4: e0bffc17 ldw r2,-16(fp)
  7290. 450f8: 10800217 ldw r2,8(r2)
  7291. 450fc: e0fffd17 ldw r3,-12(fp)
  7292. 45100: 180d883a mov r6,r3
  7293. 45104: e17ffe17 ldw r5,-8(fp)
  7294. 45108: 1009883a mov r4,r2
  7295. 4510c: 00454000 call 45400 <memcmp>
  7296. 45110: 1000021e bne r2,zero,4511c <alt_find_dev+0x60>
  7297. {
  7298. /* match found */
  7299. return next;
  7300. 45114: e0bffc17 ldw r2,-16(fp)
  7301. 45118: 00000706 br 45138 <alt_find_dev+0x7c>
  7302. }
  7303. next = (alt_dev*) next->llist.next;
  7304. 4511c: e0bffc17 ldw r2,-16(fp)
  7305. 45120: 10800017 ldw r2,0(r2)
  7306. 45124: e0bffc15 stw r2,-16(fp)
  7307. /*
  7308. * Check each list entry in turn, until a match is found, or we reach the
  7309. * end of the list (i.e. next winds up pointing back to the list head).
  7310. */
  7311. while (next != (alt_dev*) llist)
  7312. 45128: e0fffc17 ldw r3,-16(fp)
  7313. 4512c: e0bfff17 ldw r2,-4(fp)
  7314. 45130: 18bff01e bne r3,r2,450f4 <alt_find_dev+0x38>
  7315. next = (alt_dev*) next->llist.next;
  7316. }
  7317. /* No match found */
  7318. return NULL;
  7319. 45134: 0005883a mov r2,zero
  7320. }
  7321. 45138: e037883a mov sp,fp
  7322. 4513c: dfc00117 ldw ra,4(sp)
  7323. 45140: df000017 ldw fp,0(sp)
  7324. 45144: dec00204 addi sp,sp,8
  7325. 45148: f800283a ret
  7326. 0004514c <alt_find_file>:
  7327. * either '/' or '\0' is the prefix of the filename. For example the filename:
  7328. * "/myfilesystem/junk.txt" would match: "/myfilesystem", but not: "/myfile".
  7329. */
  7330. alt_dev* alt_find_file (const char* name)
  7331. {
  7332. 4514c: defffb04 addi sp,sp,-20
  7333. 45150: dfc00415 stw ra,16(sp)
  7334. 45154: df000315 stw fp,12(sp)
  7335. 45158: df000304 addi fp,sp,12
  7336. 4515c: e13fff15 stw r4,-4(fp)
  7337. alt_dev* next = (alt_dev*) alt_fs_list.next;
  7338. 45160: d0a00417 ldw r2,-32752(gp)
  7339. 45164: e0bffd15 stw r2,-12(fp)
  7340. /*
  7341. * Check each list entry in turn, until a match is found, or we reach the
  7342. * end of the list (i.e. next winds up pointing back to the list head).
  7343. */
  7344. while (next != (alt_dev*) &alt_fs_list)
  7345. 45168: 00003106 br 45230 <alt_find_file+0xe4>
  7346. {
  7347. len = strlen(next->name);
  7348. 4516c: e0bffd17 ldw r2,-12(fp)
  7349. 45170: 10800217 ldw r2,8(r2)
  7350. 45174: 1009883a mov r4,r2
  7351. 45178: 004037c0 call 4037c <strlen>
  7352. 4517c: e0bffe15 stw r2,-8(fp)
  7353. if (next->name[len-1] == '/')
  7354. 45180: e0bffd17 ldw r2,-12(fp)
  7355. 45184: 10c00217 ldw r3,8(r2)
  7356. 45188: e0bffe17 ldw r2,-8(fp)
  7357. 4518c: 10bfffc4 addi r2,r2,-1
  7358. 45190: 1885883a add r2,r3,r2
  7359. 45194: 10800003 ldbu r2,0(r2)
  7360. 45198: 10803fcc andi r2,r2,255
  7361. 4519c: 1080201c xori r2,r2,128
  7362. 451a0: 10bfe004 addi r2,r2,-128
  7363. 451a4: 10800bd8 cmpnei r2,r2,47
  7364. 451a8: 1000031e bne r2,zero,451b8 <alt_find_file+0x6c>
  7365. {
  7366. len -= 1;
  7367. 451ac: e0bffe17 ldw r2,-8(fp)
  7368. 451b0: 10bfffc4 addi r2,r2,-1
  7369. 451b4: e0bffe15 stw r2,-8(fp)
  7370. }
  7371. if (((name[len] == '/') || (name[len] == '\0')) &&
  7372. 451b8: e0bffe17 ldw r2,-8(fp)
  7373. 451bc: e0ffff17 ldw r3,-4(fp)
  7374. 451c0: 1885883a add r2,r3,r2
  7375. 451c4: 10800003 ldbu r2,0(r2)
  7376. 451c8: 10803fcc andi r2,r2,255
  7377. 451cc: 1080201c xori r2,r2,128
  7378. 451d0: 10bfe004 addi r2,r2,-128
  7379. 451d4: 10800be0 cmpeqi r2,r2,47
  7380. 451d8: 1000081e bne r2,zero,451fc <alt_find_file+0xb0>
  7381. 451dc: e0bffe17 ldw r2,-8(fp)
  7382. 451e0: e0ffff17 ldw r3,-4(fp)
  7383. 451e4: 1885883a add r2,r3,r2
  7384. 451e8: 10800003 ldbu r2,0(r2)
  7385. 451ec: 10803fcc andi r2,r2,255
  7386. 451f0: 1080201c xori r2,r2,128
  7387. 451f4: 10bfe004 addi r2,r2,-128
  7388. 451f8: 10000a1e bne r2,zero,45224 <alt_find_file+0xd8>
  7389. !memcmp (next->name, name, len))
  7390. 451fc: e0bffd17 ldw r2,-12(fp)
  7391. 45200: 10800217 ldw r2,8(r2)
  7392. 45204: e0fffe17 ldw r3,-8(fp)
  7393. 45208: 180d883a mov r6,r3
  7394. 4520c: e17fff17 ldw r5,-4(fp)
  7395. 45210: 1009883a mov r4,r2
  7396. 45214: 00454000 call 45400 <memcmp>
  7397. if (next->name[len-1] == '/')
  7398. {
  7399. len -= 1;
  7400. }
  7401. if (((name[len] == '/') || (name[len] == '\0')) &&
  7402. 45218: 1000021e bne r2,zero,45224 <alt_find_file+0xd8>
  7403. !memcmp (next->name, name, len))
  7404. {
  7405. /* match found */
  7406. return next;
  7407. 4521c: e0bffd17 ldw r2,-12(fp)
  7408. 45220: 00000706 br 45240 <alt_find_file+0xf4>
  7409. }
  7410. next = (alt_dev*) next->llist.next;
  7411. 45224: e0bffd17 ldw r2,-12(fp)
  7412. 45228: 10800017 ldw r2,0(r2)
  7413. 4522c: e0bffd15 stw r2,-12(fp)
  7414. /*
  7415. * Check each list entry in turn, until a match is found, or we reach the
  7416. * end of the list (i.e. next winds up pointing back to the list head).
  7417. */
  7418. while (next != (alt_dev*) &alt_fs_list)
  7419. 45230: e0fffd17 ldw r3,-12(fp)
  7420. 45234: d0a00404 addi r2,gp,-32752
  7421. 45238: 18bfcc1e bne r3,r2,4516c <alt_find_file+0x20>
  7422. next = (alt_dev*) next->llist.next;
  7423. }
  7424. /* No match found */
  7425. return NULL;
  7426. 4523c: 0005883a mov r2,zero
  7427. }
  7428. 45240: e037883a mov sp,fp
  7429. 45244: dfc00117 ldw ra,4(sp)
  7430. 45248: df000017 ldw fp,0(sp)
  7431. 4524c: dec00204 addi sp,sp,8
  7432. 45250: f800283a ret
  7433. 00045254 <alt_get_fd>:
  7434. * the offset of the file descriptor within the file descriptor array). A
  7435. * negative value indicates failure.
  7436. */
  7437. int alt_get_fd (alt_dev* dev)
  7438. {
  7439. 45254: defffa04 addi sp,sp,-24
  7440. 45258: dfc00515 stw ra,20(sp)
  7441. 4525c: df000415 stw fp,16(sp)
  7442. 45260: dc000315 stw r16,12(sp)
  7443. 45264: df000404 addi fp,sp,16
  7444. 45268: e13ffe15 stw r4,-8(fp)
  7445. alt_32 i;
  7446. int rc = -EMFILE;
  7447. 4526c: 00bffa04 movi r2,-24
  7448. 45270: e0bffd15 stw r2,-12(fp)
  7449. * indicates the highest file descriptor ever allocated. This is used to
  7450. * improve efficency when searching the file descriptor list, and
  7451. * therefore reduce contention on the alt_fd_list_lock semaphore.
  7452. */
  7453. for (i = 0; i < ALT_MAX_FD; i++)
  7454. 45274: e03ffc15 stw zero,-16(fp)
  7455. 45278: 00001d06 br 452f0 <alt_get_fd+0x9c>
  7456. {
  7457. if (!alt_fd_list[i].dev)
  7458. 4527c: 04000134 movhi r16,4
  7459. 45280: 8417f904 addi r16,r16,24548
  7460. 45284: e0bffc17 ldw r2,-16(fp)
  7461. 45288: 01400304 movi r5,12
  7462. 4528c: 1009883a mov r4,r2
  7463. 45290: 004308c0 call 4308c <__mulsi3>
  7464. 45294: 8085883a add r2,r16,r2
  7465. 45298: 10800017 ldw r2,0(r2)
  7466. 4529c: 1000111e bne r2,zero,452e4 <alt_get_fd+0x90>
  7467. {
  7468. alt_fd_list[i].dev = dev;
  7469. 452a0: 04000134 movhi r16,4
  7470. 452a4: 8417f904 addi r16,r16,24548
  7471. 452a8: e0bffc17 ldw r2,-16(fp)
  7472. 452ac: 01400304 movi r5,12
  7473. 452b0: 1009883a mov r4,r2
  7474. 452b4: 004308c0 call 4308c <__mulsi3>
  7475. 452b8: 8085883a add r2,r16,r2
  7476. 452bc: e0fffe17 ldw r3,-8(fp)
  7477. 452c0: 10c00015 stw r3,0(r2)
  7478. if (i > alt_max_fd)
  7479. 452c4: d0e00817 ldw r3,-32736(gp)
  7480. 452c8: e0bffc17 ldw r2,-16(fp)
  7481. 452cc: 1880020e bge r3,r2,452d8 <alt_get_fd+0x84>
  7482. {
  7483. alt_max_fd = i;
  7484. 452d0: e0bffc17 ldw r2,-16(fp)
  7485. 452d4: d0a00815 stw r2,-32736(gp)
  7486. }
  7487. rc = i;
  7488. 452d8: e0bffc17 ldw r2,-16(fp)
  7489. 452dc: e0bffd15 stw r2,-12(fp)
  7490. goto alt_get_fd_exit;
  7491. 452e0: 00000606 br 452fc <alt_get_fd+0xa8>
  7492. * indicates the highest file descriptor ever allocated. This is used to
  7493. * improve efficency when searching the file descriptor list, and
  7494. * therefore reduce contention on the alt_fd_list_lock semaphore.
  7495. */
  7496. for (i = 0; i < ALT_MAX_FD; i++)
  7497. 452e4: e0bffc17 ldw r2,-16(fp)
  7498. 452e8: 10800044 addi r2,r2,1
  7499. 452ec: e0bffc15 stw r2,-16(fp)
  7500. 452f0: e0bffc17 ldw r2,-16(fp)
  7501. 452f4: 10800810 cmplti r2,r2,32
  7502. 452f8: 103fe01e bne r2,zero,4527c <alt_get_fd+0x28>
  7503. * file descriptor pool.
  7504. */
  7505. ALT_SEM_POST(alt_fd_list_lock);
  7506. return rc;
  7507. 452fc: e0bffd17 ldw r2,-12(fp)
  7508. }
  7509. 45300: e6ffff04 addi sp,fp,-4
  7510. 45304: dfc00217 ldw ra,8(sp)
  7511. 45308: df000117 ldw fp,4(sp)
  7512. 4530c: dc000017 ldw r16,0(sp)
  7513. 45310: dec00304 addi sp,sp,12
  7514. 45314: f800283a ret
  7515. 00045318 <alt_exception_cause_generated_bad_addr>:
  7516. * Return: 1: BADADDR (bad_addr argument to handler) is valid
  7517. * 0: BADADDR is not valid
  7518. */
  7519. int
  7520. alt_exception_cause_generated_bad_addr(alt_exception_cause cause)
  7521. {
  7522. 45318: defffe04 addi sp,sp,-8
  7523. 4531c: df000115 stw fp,4(sp)
  7524. 45320: df000104 addi fp,sp,4
  7525. 45324: e13fff15 stw r4,-4(fp)
  7526. switch (cause) {
  7527. 45328: e0bfff17 ldw r2,-4(fp)
  7528. 4532c: 10bffe84 addi r2,r2,-6
  7529. 45330: 10c00428 cmpgeui r3,r2,16
  7530. 45334: 18001a1e bne r3,zero,453a0 <alt_exception_cause_generated_bad_addr+0x88>
  7531. 45338: 100690ba slli r3,r2,2
  7532. 4533c: 00800134 movhi r2,4
  7533. 45340: 1094d404 addi r2,r2,21328
  7534. 45344: 1885883a add r2,r3,r2
  7535. 45348: 10800017 ldw r2,0(r2)
  7536. 4534c: 1000683a jmp r2
  7537. 45350: 00045390 cmplti zero,zero,4430
  7538. 45354: 00045390 cmplti zero,zero,4430
  7539. 45358: 000453a0 cmpeqi zero,zero,4430
  7540. 4535c: 000453a0 cmpeqi zero,zero,4430
  7541. 45360: 000453a0 cmpeqi zero,zero,4430
  7542. 45364: 00045390 cmplti zero,zero,4430
  7543. 45368: 00045398 cmpnei zero,zero,4430
  7544. 4536c: 000453a0 cmpeqi zero,zero,4430
  7545. 45370: 00045390 cmplti zero,zero,4430
  7546. 45374: 00045390 cmplti zero,zero,4430
  7547. 45378: 000453a0 cmpeqi zero,zero,4430
  7548. 4537c: 00045390 cmplti zero,zero,4430
  7549. 45380: 00045398 cmpnei zero,zero,4430
  7550. 45384: 000453a0 cmpeqi zero,zero,4430
  7551. 45388: 000453a0 cmpeqi zero,zero,4430
  7552. 4538c: 00045390 cmplti zero,zero,4430
  7553. case NIOS2_EXCEPTION_MISALIGNED_TARGET_PC:
  7554. case NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION:
  7555. case NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION:
  7556. case NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION:
  7557. case NIOS2_EXCEPTION_ECC_DATA_ERR:
  7558. return 1;
  7559. 45390: 00800044 movi r2,1
  7560. 45394: 00000306 br 453a4 <alt_exception_cause_generated_bad_addr+0x8c>
  7561. case NIOS2_EXCEPTION_TLB_MISS:
  7562. case NIOS2_EXCEPTION_ECC_TLB_ERR:
  7563. return 0;
  7564. 45398: 0005883a mov r2,zero
  7565. 4539c: 00000106 br 453a4 <alt_exception_cause_generated_bad_addr+0x8c>
  7566. default:
  7567. return 0;
  7568. 453a0: 0005883a mov r2,zero
  7569. }
  7570. }
  7571. 453a4: e037883a mov sp,fp
  7572. 453a8: df000017 ldw fp,0(sp)
  7573. 453ac: dec00104 addi sp,sp,4
  7574. 453b0: f800283a ret
  7575. 000453b4 <atexit>:
  7576. 453b4: 200b883a mov r5,r4
  7577. 453b8: 000f883a mov r7,zero
  7578. 453bc: 000d883a mov r6,zero
  7579. 453c0: 0009883a mov r4,zero
  7580. 453c4: 004547c1 jmpi 4547c <__register_exitproc>
  7581. 000453c8 <exit>:
  7582. 453c8: defffe04 addi sp,sp,-8
  7583. 453cc: 000b883a mov r5,zero
  7584. 453d0: dc000015 stw r16,0(sp)
  7585. 453d4: dfc00115 stw ra,4(sp)
  7586. 453d8: 2021883a mov r16,r4
  7587. 453dc: 00455940 call 45594 <__call_exitprocs>
  7588. 453e0: 00800134 movhi r2,4
  7589. 453e4: 109c7104 addi r2,r2,29124
  7590. 453e8: 11000017 ldw r4,0(r2)
  7591. 453ec: 20800f17 ldw r2,60(r4)
  7592. 453f0: 10000126 beq r2,zero,453f8 <exit+0x30>
  7593. 453f4: 103ee83a callr r2
  7594. 453f8: 8009883a mov r4,r16
  7595. 453fc: 00457140 call 45714 <_exit>
  7596. 00045400 <memcmp>:
  7597. 45400: 01c000c4 movi r7,3
  7598. 45404: 3980192e bgeu r7,r6,4546c <memcmp+0x6c>
  7599. 45408: 2144b03a or r2,r4,r5
  7600. 4540c: 11c4703a and r2,r2,r7
  7601. 45410: 10000f26 beq r2,zero,45450 <memcmp+0x50>
  7602. 45414: 20800003 ldbu r2,0(r4)
  7603. 45418: 28c00003 ldbu r3,0(r5)
  7604. 4541c: 10c0151e bne r2,r3,45474 <memcmp+0x74>
  7605. 45420: 31bfff84 addi r6,r6,-2
  7606. 45424: 01ffffc4 movi r7,-1
  7607. 45428: 00000406 br 4543c <memcmp+0x3c>
  7608. 4542c: 20800003 ldbu r2,0(r4)
  7609. 45430: 28c00003 ldbu r3,0(r5)
  7610. 45434: 31bfffc4 addi r6,r6,-1
  7611. 45438: 10c00e1e bne r2,r3,45474 <memcmp+0x74>
  7612. 4543c: 21000044 addi r4,r4,1
  7613. 45440: 29400044 addi r5,r5,1
  7614. 45444: 31fff91e bne r6,r7,4542c <memcmp+0x2c>
  7615. 45448: 0005883a mov r2,zero
  7616. 4544c: f800283a ret
  7617. 45450: 20c00017 ldw r3,0(r4)
  7618. 45454: 28800017 ldw r2,0(r5)
  7619. 45458: 18bfee1e bne r3,r2,45414 <memcmp+0x14>
  7620. 4545c: 31bfff04 addi r6,r6,-4
  7621. 45460: 21000104 addi r4,r4,4
  7622. 45464: 29400104 addi r5,r5,4
  7623. 45468: 39bff936 bltu r7,r6,45450 <memcmp+0x50>
  7624. 4546c: 303fe91e bne r6,zero,45414 <memcmp+0x14>
  7625. 45470: 003ff506 br 45448 <memcmp+0x48>
  7626. 45474: 10c5c83a sub r2,r2,r3
  7627. 45478: f800283a ret
  7628. 0004547c <__register_exitproc>:
  7629. 4547c: defffa04 addi sp,sp,-24
  7630. 45480: dc000315 stw r16,12(sp)
  7631. 45484: 04000134 movhi r16,4
  7632. 45488: 841c7104 addi r16,r16,29124
  7633. 4548c: 80c00017 ldw r3,0(r16)
  7634. 45490: dc400415 stw r17,16(sp)
  7635. 45494: dfc00515 stw ra,20(sp)
  7636. 45498: 18805217 ldw r2,328(r3)
  7637. 4549c: 2023883a mov r17,r4
  7638. 454a0: 10003726 beq r2,zero,45580 <__register_exitproc+0x104>
  7639. 454a4: 10c00117 ldw r3,4(r2)
  7640. 454a8: 010007c4 movi r4,31
  7641. 454ac: 20c00e16 blt r4,r3,454e8 <__register_exitproc+0x6c>
  7642. 454b0: 1a000044 addi r8,r3,1
  7643. 454b4: 8800221e bne r17,zero,45540 <__register_exitproc+0xc4>
  7644. 454b8: 18c00084 addi r3,r3,2
  7645. 454bc: 18c7883a add r3,r3,r3
  7646. 454c0: 18c7883a add r3,r3,r3
  7647. 454c4: 12000115 stw r8,4(r2)
  7648. 454c8: 10c7883a add r3,r2,r3
  7649. 454cc: 19400015 stw r5,0(r3)
  7650. 454d0: 0005883a mov r2,zero
  7651. 454d4: dfc00517 ldw ra,20(sp)
  7652. 454d8: dc400417 ldw r17,16(sp)
  7653. 454dc: dc000317 ldw r16,12(sp)
  7654. 454e0: dec00604 addi sp,sp,24
  7655. 454e4: f800283a ret
  7656. 454e8: 00800034 movhi r2,0
  7657. 454ec: 10800004 addi r2,r2,0
  7658. 454f0: 10002626 beq r2,zero,4558c <__register_exitproc+0x110>
  7659. 454f4: 01006404 movi r4,400
  7660. 454f8: d9400015 stw r5,0(sp)
  7661. 454fc: d9800115 stw r6,4(sp)
  7662. 45500: d9c00215 stw r7,8(sp)
  7663. 45504: 00000000 call 0 <__alt_mem_onchip_memory2-0x40000>
  7664. 45508: d9400017 ldw r5,0(sp)
  7665. 4550c: d9800117 ldw r6,4(sp)
  7666. 45510: d9c00217 ldw r7,8(sp)
  7667. 45514: 10001d26 beq r2,zero,4558c <__register_exitproc+0x110>
  7668. 45518: 81000017 ldw r4,0(r16)
  7669. 4551c: 10000115 stw zero,4(r2)
  7670. 45520: 02000044 movi r8,1
  7671. 45524: 22405217 ldw r9,328(r4)
  7672. 45528: 0007883a mov r3,zero
  7673. 4552c: 12400015 stw r9,0(r2)
  7674. 45530: 20805215 stw r2,328(r4)
  7675. 45534: 10006215 stw zero,392(r2)
  7676. 45538: 10006315 stw zero,396(r2)
  7677. 4553c: 883fde26 beq r17,zero,454b8 <__register_exitproc+0x3c>
  7678. 45540: 18c9883a add r4,r3,r3
  7679. 45544: 2109883a add r4,r4,r4
  7680. 45548: 1109883a add r4,r2,r4
  7681. 4554c: 21802215 stw r6,136(r4)
  7682. 45550: 01800044 movi r6,1
  7683. 45554: 12406217 ldw r9,392(r2)
  7684. 45558: 30cc983a sll r6,r6,r3
  7685. 4555c: 4992b03a or r9,r9,r6
  7686. 45560: 12406215 stw r9,392(r2)
  7687. 45564: 21c04215 stw r7,264(r4)
  7688. 45568: 01000084 movi r4,2
  7689. 4556c: 893fd21e bne r17,r4,454b8 <__register_exitproc+0x3c>
  7690. 45570: 11006317 ldw r4,396(r2)
  7691. 45574: 218cb03a or r6,r4,r6
  7692. 45578: 11806315 stw r6,396(r2)
  7693. 4557c: 003fce06 br 454b8 <__register_exitproc+0x3c>
  7694. 45580: 18805304 addi r2,r3,332
  7695. 45584: 18805215 stw r2,328(r3)
  7696. 45588: 003fc606 br 454a4 <__register_exitproc+0x28>
  7697. 4558c: 00bfffc4 movi r2,-1
  7698. 45590: 003fd006 br 454d4 <__register_exitproc+0x58>
  7699. 00045594 <__call_exitprocs>:
  7700. 45594: defff504 addi sp,sp,-44
  7701. 45598: df000915 stw fp,36(sp)
  7702. 4559c: dd400615 stw r21,24(sp)
  7703. 455a0: dc800315 stw r18,12(sp)
  7704. 455a4: dfc00a15 stw ra,40(sp)
  7705. 455a8: ddc00815 stw r23,32(sp)
  7706. 455ac: dd800715 stw r22,28(sp)
  7707. 455b0: dd000515 stw r20,20(sp)
  7708. 455b4: dcc00415 stw r19,16(sp)
  7709. 455b8: dc400215 stw r17,8(sp)
  7710. 455bc: dc000115 stw r16,4(sp)
  7711. 455c0: d9000015 stw r4,0(sp)
  7712. 455c4: 2839883a mov fp,r5
  7713. 455c8: 04800044 movi r18,1
  7714. 455cc: 057fffc4 movi r21,-1
  7715. 455d0: 00800134 movhi r2,4
  7716. 455d4: 109c7104 addi r2,r2,29124
  7717. 455d8: 12000017 ldw r8,0(r2)
  7718. 455dc: 45005217 ldw r20,328(r8)
  7719. 455e0: 44c05204 addi r19,r8,328
  7720. 455e4: a0001c26 beq r20,zero,45658 <__call_exitprocs+0xc4>
  7721. 455e8: a0800117 ldw r2,4(r20)
  7722. 455ec: 15ffffc4 addi r23,r2,-1
  7723. 455f0: b8000d16 blt r23,zero,45628 <__call_exitprocs+0x94>
  7724. 455f4: 14000044 addi r16,r2,1
  7725. 455f8: 8421883a add r16,r16,r16
  7726. 455fc: 8421883a add r16,r16,r16
  7727. 45600: 84402004 addi r17,r16,128
  7728. 45604: a463883a add r17,r20,r17
  7729. 45608: a421883a add r16,r20,r16
  7730. 4560c: e0001e26 beq fp,zero,45688 <__call_exitprocs+0xf4>
  7731. 45610: 80804017 ldw r2,256(r16)
  7732. 45614: e0801c26 beq fp,r2,45688 <__call_exitprocs+0xf4>
  7733. 45618: bdffffc4 addi r23,r23,-1
  7734. 4561c: 843fff04 addi r16,r16,-4
  7735. 45620: 8c7fff04 addi r17,r17,-4
  7736. 45624: bd7ff91e bne r23,r21,4560c <__call_exitprocs+0x78>
  7737. 45628: 00800034 movhi r2,0
  7738. 4562c: 10800004 addi r2,r2,0
  7739. 45630: 10000926 beq r2,zero,45658 <__call_exitprocs+0xc4>
  7740. 45634: a0800117 ldw r2,4(r20)
  7741. 45638: 1000301e bne r2,zero,456fc <__call_exitprocs+0x168>
  7742. 4563c: a0800017 ldw r2,0(r20)
  7743. 45640: 10003226 beq r2,zero,4570c <__call_exitprocs+0x178>
  7744. 45644: a009883a mov r4,r20
  7745. 45648: 98800015 stw r2,0(r19)
  7746. 4564c: 00000000 call 0 <__alt_mem_onchip_memory2-0x40000>
  7747. 45650: 9d000017 ldw r20,0(r19)
  7748. 45654: a03fe41e bne r20,zero,455e8 <__call_exitprocs+0x54>
  7749. 45658: dfc00a17 ldw ra,40(sp)
  7750. 4565c: df000917 ldw fp,36(sp)
  7751. 45660: ddc00817 ldw r23,32(sp)
  7752. 45664: dd800717 ldw r22,28(sp)
  7753. 45668: dd400617 ldw r21,24(sp)
  7754. 4566c: dd000517 ldw r20,20(sp)
  7755. 45670: dcc00417 ldw r19,16(sp)
  7756. 45674: dc800317 ldw r18,12(sp)
  7757. 45678: dc400217 ldw r17,8(sp)
  7758. 4567c: dc000117 ldw r16,4(sp)
  7759. 45680: dec00b04 addi sp,sp,44
  7760. 45684: f800283a ret
  7761. 45688: a0800117 ldw r2,4(r20)
  7762. 4568c: 80c00017 ldw r3,0(r16)
  7763. 45690: 10bfffc4 addi r2,r2,-1
  7764. 45694: 15c01426 beq r2,r23,456e8 <__call_exitprocs+0x154>
  7765. 45698: 80000015 stw zero,0(r16)
  7766. 4569c: 183fde26 beq r3,zero,45618 <__call_exitprocs+0x84>
  7767. 456a0: 95c8983a sll r4,r18,r23
  7768. 456a4: a0806217 ldw r2,392(r20)
  7769. 456a8: a5800117 ldw r22,4(r20)
  7770. 456ac: 2084703a and r2,r4,r2
  7771. 456b0: 10000b26 beq r2,zero,456e0 <__call_exitprocs+0x14c>
  7772. 456b4: a0806317 ldw r2,396(r20)
  7773. 456b8: 2088703a and r4,r4,r2
  7774. 456bc: 20000c1e bne r4,zero,456f0 <__call_exitprocs+0x15c>
  7775. 456c0: 89400017 ldw r5,0(r17)
  7776. 456c4: d9000017 ldw r4,0(sp)
  7777. 456c8: 183ee83a callr r3
  7778. 456cc: a0800117 ldw r2,4(r20)
  7779. 456d0: 15bfbf1e bne r2,r22,455d0 <__call_exitprocs+0x3c>
  7780. 456d4: 98800017 ldw r2,0(r19)
  7781. 456d8: 153fcf26 beq r2,r20,45618 <__call_exitprocs+0x84>
  7782. 456dc: 003fbc06 br 455d0 <__call_exitprocs+0x3c>
  7783. 456e0: 183ee83a callr r3
  7784. 456e4: 003ff906 br 456cc <__call_exitprocs+0x138>
  7785. 456e8: a5c00115 stw r23,4(r20)
  7786. 456ec: 003feb06 br 4569c <__call_exitprocs+0x108>
  7787. 456f0: 89000017 ldw r4,0(r17)
  7788. 456f4: 183ee83a callr r3
  7789. 456f8: 003ff406 br 456cc <__call_exitprocs+0x138>
  7790. 456fc: a0800017 ldw r2,0(r20)
  7791. 45700: a027883a mov r19,r20
  7792. 45704: 1029883a mov r20,r2
  7793. 45708: 003fb606 br 455e4 <__call_exitprocs+0x50>
  7794. 4570c: 0005883a mov r2,zero
  7795. 45710: 003ffb06 br 45700 <__call_exitprocs+0x16c>
  7796. 00045714 <_exit>:
  7797. *
  7798. * ALT_EXIT is mapped onto the _exit() system call in alt_syscall.h
  7799. */
  7800. void ALT_EXIT (int exit_code)
  7801. {
  7802. 45714: defffd04 addi sp,sp,-12
  7803. 45718: df000215 stw fp,8(sp)
  7804. 4571c: df000204 addi fp,sp,8
  7805. 45720: e13fff15 stw r4,-4(fp)
  7806. ALT_LOG_PRINT_BOOT("[alt_exit.c] Entering _exit() function.\r\n");
  7807. ALT_LOG_PRINT_BOOT("[alt_exit.c] Exit code from main was %d.\r\n",exit_code);
  7808. /* Stop all other threads */
  7809. ALT_LOG_PRINT_BOOT("[alt_exit.c] Calling ALT_OS_STOP().\r\n");
  7810. ALT_OS_STOP();
  7811. 45724: 0001883a nop
  7812. 45728: e0bfff17 ldw r2,-4(fp)
  7813. 4572c: e0bffe15 stw r2,-8(fp)
  7814. /*
  7815. * Routine called on exit.
  7816. */
  7817. static ALT_INLINE ALT_ALWAYS_INLINE void alt_sim_halt(int exit_code)
  7818. {
  7819. register int r2 asm ("r2") = exit_code;
  7820. 45730: e0bffe17 ldw r2,-8(fp)
  7821. __asm__ volatile ("\n0:\n\taddi %0,%0, -1\n\tbgt %0,zero,0b" : : "r" (ALT_CPU_FREQ/100) ); /* Delay for >30ms */
  7822. __asm__ volatile ("break 2" : : "r"(r2), "r"(r3) ALT_GMON_DATA );
  7823. #else /* !DEBUG_STUB */
  7824. if (r2) {
  7825. 45734: 10000226 beq r2,zero,45740 <_exit+0x2c>
  7826. ALT_SIM_FAIL();
  7827. 45738: 002af070 cmpltui zero,zero,43969
  7828. 4573c: 00000106 br 45744 <_exit+0x30>
  7829. } else {
  7830. ALT_SIM_PASS();
  7831. 45740: 002af0b0 cmpltui zero,zero,43970
  7832. ALT_SIM_HALT(exit_code);
  7833. /* spin forever, since there's no where to go back to */
  7834. ALT_LOG_PRINT_BOOT("[alt_exit.c] Spinning forever.\r\n");
  7835. while (1);
  7836. 45744: 003fff06 br 45744 <_exit+0x30>