musl-git-20140225.patch 242 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039
  1. diff -Nur musl-0.9.15/arch/arm/bits/shm.h musl-git/arch/arm/bits/shm.h
  2. --- musl-0.9.15/arch/arm/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  3. +++ musl-git/arch/arm/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  4. @@ -16,3 +16,14 @@
  5. unsigned long __pad1;
  6. unsigned long __pad2;
  7. };
  8. +
  9. +struct shminfo {
  10. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  11. +};
  12. +
  13. +struct shm_info {
  14. + int __used_ids;
  15. + unsigned long shm_tot, shm_rss, shm_swp;
  16. + unsigned long __swap_attempts, __swap_successes;
  17. +};
  18. +
  19. diff -Nur musl-0.9.15/arch/arm/bits/termios.h musl-git/arch/arm/bits/termios.h
  20. --- musl-0.9.15/arch/arm/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  21. +++ musl-git/arch/arm/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  22. @@ -42,6 +42,7 @@
  23. #define IXANY 0004000
  24. #define IXOFF 0010000
  25. #define IMAXBEL 0020000
  26. +#define IUTF8 0040000
  27. #define OPOST 0000001
  28. #define OLCUC 0000002
  29. @@ -75,9 +76,6 @@
  30. #define VT0 0000000
  31. #define VT1 0040000
  32. -/* ?? */
  33. -#define XTABS 0014000
  34. -
  35. #define B0 0000000
  36. #define B50 0000001
  37. #define B75 0000002
  38. @@ -125,8 +123,6 @@
  39. #define HUPCL 0002000
  40. #define CLOCAL 0004000
  41. -#define CRTSCTS 020000000000
  42. -
  43. #define ISIG 0000001
  44. #define ICANON 0000002
  45. #define ECHO 0000010
  46. @@ -137,14 +133,11 @@
  47. #define TOSTOP 0000400
  48. #define IEXTEN 0100000
  49. -/* Extensions? */
  50. -#define CBAUDEX 0010000
  51. #define ECHOCTL 0001000
  52. #define ECHOPRT 0002000
  53. #define ECHOKE 0004000
  54. #define FLUSHO 0010000
  55. #define PENDIN 0040000
  56. -#define EXTPROC 0200000
  57. #define TCOOFF 0
  58. #define TCOON 1
  59. @@ -158,3 +151,10 @@
  60. #define TCSANOW 0
  61. #define TCSADRAIN 1
  62. #define TCSAFLUSH 2
  63. +
  64. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  65. +#define CBAUDEX 0010000
  66. +#define CRTSCTS 020000000000
  67. +#define EXTPROC 0200000
  68. +#define XTABS 0014000
  69. +#endif
  70. diff -Nur musl-0.9.15/arch/arm/syscall_arch.h musl-git/arch/arm/syscall_arch.h
  71. --- musl-0.9.15/arch/arm/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  72. +++ musl-git/arch/arm/syscall_arch.h 2014-02-25 15:24:14.000000000 +0100
  73. @@ -3,6 +3,8 @@
  74. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  75. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  76. +long (__syscall)(long, ...);
  77. +
  78. #ifndef __clang__
  79. #define __asm_syscall(...) do { \
  80. diff -Nur musl-0.9.15/arch/i386/bits/shm.h musl-git/arch/i386/bits/shm.h
  81. --- musl-0.9.15/arch/i386/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  82. +++ musl-git/arch/i386/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  83. @@ -16,3 +16,14 @@
  84. unsigned long __pad1;
  85. unsigned long __pad2;
  86. };
  87. +
  88. +struct shminfo {
  89. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  90. +};
  91. +
  92. +struct shm_info {
  93. + int __used_ids;
  94. + unsigned long shm_tot, shm_rss, shm_swp;
  95. + unsigned long __swap_attempts, __swap_successes;
  96. +};
  97. +
  98. diff -Nur musl-0.9.15/arch/i386/bits/termios.h musl-git/arch/i386/bits/termios.h
  99. --- musl-0.9.15/arch/i386/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  100. +++ musl-git/arch/i386/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  101. @@ -42,6 +42,7 @@
  102. #define IXANY 0004000
  103. #define IXOFF 0010000
  104. #define IMAXBEL 0020000
  105. +#define IUTF8 0040000
  106. #define OPOST 0000001
  107. #define OLCUC 0000002
  108. @@ -75,9 +76,6 @@
  109. #define VT0 0000000
  110. #define VT1 0040000
  111. -/* ?? */
  112. -#define XTABS 0014000
  113. -
  114. #define B0 0000000
  115. #define B50 0000001
  116. #define B75 0000002
  117. @@ -125,8 +123,6 @@
  118. #define HUPCL 0002000
  119. #define CLOCAL 0004000
  120. -#define CRTSCTS 020000000000
  121. -
  122. #define ISIG 0000001
  123. #define ICANON 0000002
  124. #define ECHO 0000010
  125. @@ -137,14 +133,11 @@
  126. #define TOSTOP 0000400
  127. #define IEXTEN 0100000
  128. -/* Extensions? */
  129. -#define CBAUDEX 0010000
  130. #define ECHOCTL 0001000
  131. #define ECHOPRT 0002000
  132. #define ECHOKE 0004000
  133. #define FLUSHO 0010000
  134. #define PENDIN 0040000
  135. -#define EXTPROC 0200000
  136. #define TCOOFF 0
  137. #define TCOON 1
  138. @@ -158,3 +151,10 @@
  139. #define TCSANOW 0
  140. #define TCSADRAIN 1
  141. #define TCSAFLUSH 2
  142. +
  143. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  144. +#define CBAUDEX 0010000
  145. +#define CRTSCTS 020000000000
  146. +#define EXTPROC 0200000
  147. +#define XTABS 0014000
  148. +#endif
  149. diff -Nur musl-0.9.15/arch/microblaze/bits/shm.h musl-git/arch/microblaze/bits/shm.h
  150. --- musl-0.9.15/arch/microblaze/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  151. +++ musl-git/arch/microblaze/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  152. @@ -16,3 +16,14 @@
  153. unsigned long __pad1;
  154. unsigned long __pad2;
  155. };
  156. +
  157. +struct shminfo {
  158. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  159. +};
  160. +
  161. +struct shm_info {
  162. + int __used_ids;
  163. + unsigned long shm_tot, shm_rss, shm_swp;
  164. + unsigned long __swap_attempts, __swap_successes;
  165. +};
  166. +
  167. diff -Nur musl-0.9.15/arch/microblaze/bits/termios.h musl-git/arch/microblaze/bits/termios.h
  168. --- musl-0.9.15/arch/microblaze/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  169. +++ musl-git/arch/microblaze/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  170. @@ -42,6 +42,7 @@
  171. #define IXANY 0004000
  172. #define IXOFF 0010000
  173. #define IMAXBEL 0020000
  174. +#define IUTF8 0040000
  175. #define OPOST 0000001
  176. #define OLCUC 0000002
  177. @@ -75,9 +76,6 @@
  178. #define VT0 0000000
  179. #define VT1 0040000
  180. -/* ?? */
  181. -#define XTABS 0014000
  182. -
  183. #define B0 0000000
  184. #define B50 0000001
  185. #define B75 0000002
  186. @@ -125,8 +123,6 @@
  187. #define HUPCL 0002000
  188. #define CLOCAL 0004000
  189. -#define CRTSCTS 020000000000
  190. -
  191. #define ISIG 0000001
  192. #define ICANON 0000002
  193. #define ECHO 0000010
  194. @@ -137,14 +133,11 @@
  195. #define TOSTOP 0000400
  196. #define IEXTEN 0100000
  197. -/* Extensions? */
  198. -#define CBAUDEX 0010000
  199. #define ECHOCTL 0001000
  200. #define ECHOPRT 0002000
  201. #define ECHOKE 0004000
  202. #define FLUSHO 0010000
  203. #define PENDIN 0040000
  204. -#define EXTPROC 0200000
  205. #define TCOOFF 0
  206. #define TCOON 1
  207. @@ -158,3 +151,10 @@
  208. #define TCSANOW 0
  209. #define TCSADRAIN 1
  210. #define TCSAFLUSH 2
  211. +
  212. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  213. +#define CBAUDEX 0010000
  214. +#define CRTSCTS 020000000000
  215. +#define EXTPROC 0200000
  216. +#define XTABS 0014000
  217. +#endif
  218. diff -Nur musl-0.9.15/arch/microblaze/syscall_arch.h musl-git/arch/microblaze/syscall_arch.h
  219. --- musl-0.9.15/arch/microblaze/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  220. +++ musl-git/arch/microblaze/syscall_arch.h 2014-02-25 15:24:14.000000000 +0100
  221. @@ -3,6 +3,8 @@
  222. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  223. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  224. +long (__syscall)(long, ...);
  225. +
  226. #ifndef __clang__
  227. static __inline long __syscall0(long n)
  228. diff -Nur musl-0.9.15/arch/mips/bits/fenv.h musl-git/arch/mips/bits/fenv.h
  229. --- musl-0.9.15/arch/mips/bits/fenv.h 2014-01-03 21:12:17.000000000 +0100
  230. +++ musl-git/arch/mips/bits/fenv.h 2014-02-25 15:24:14.000000000 +0100
  231. @@ -1,3 +1,7 @@
  232. +#ifdef __mips_soft_float
  233. +#define FE_ALL_EXCEPT 0
  234. +#define FE_TONEAREST 0
  235. +#else
  236. #define FE_INEXACT 4
  237. #define FE_UNDERFLOW 8
  238. #define FE_OVERFLOW 16
  239. @@ -10,6 +14,7 @@
  240. #define FE_TOWARDZERO 1
  241. #define FE_UPWARD 2
  242. #define FE_DOWNWARD 3
  243. +#endif
  244. typedef unsigned short fexcept_t;
  245. diff -Nur musl-0.9.15/arch/mips/bits/shm.h musl-git/arch/mips/bits/shm.h
  246. --- musl-0.9.15/arch/mips/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  247. +++ musl-git/arch/mips/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  248. @@ -13,3 +13,14 @@
  249. unsigned long __pad1;
  250. unsigned long __pad2;
  251. };
  252. +
  253. +struct shminfo {
  254. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  255. +};
  256. +
  257. +struct shm_info {
  258. + int __used_ids;
  259. + unsigned long shm_tot, shm_rss, shm_swp;
  260. + unsigned long __swap_attempts, __swap_successes;
  261. +};
  262. +
  263. diff -Nur musl-0.9.15/arch/mips/bits/termios.h musl-git/arch/mips/bits/termios.h
  264. --- musl-0.9.15/arch/mips/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  265. +++ musl-git/arch/mips/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  266. @@ -77,9 +77,6 @@
  267. #define VT0 0000000
  268. #define VT1 0040000
  269. -/* ?? */
  270. -#define XTABS 0014000
  271. -
  272. #define B0 0000000
  273. #define B50 0000001
  274. #define B75 0000002
  275. @@ -129,12 +126,6 @@
  276. #define PARODD 0001000
  277. #define HUPCL 0002000
  278. #define CLOCAL 0004000
  279. -#define CBAUDEX 0010000
  280. -
  281. -#define CIBAUD 002003600000
  282. -#define CMSPAR 010000000000
  283. -#define CRTSCTS 020000000000
  284. -#define IBSHIFT 16
  285. #define ISIG 0000001
  286. #define ICANON 0000002
  287. @@ -152,9 +143,6 @@
  288. #define PENDIN 0040000
  289. #define TOSTOP 0100000
  290. #define ITOSTOP 0100000
  291. -#define EXTPROC 0200000
  292. -
  293. -#define TIOCSER_TEMT 1
  294. #define TCOOFF 0
  295. #define TCOON 1
  296. @@ -168,3 +156,14 @@
  297. #define TCSANOW 0
  298. #define TCSADRAIN 1
  299. #define TCSAFLUSH 2
  300. +
  301. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  302. +#define CBAUDEX 0010000
  303. +#define CIBAUD 002003600000
  304. +#define IBSHIFT 16
  305. +#define CMSPAR 010000000000
  306. +#define CRTSCTS 020000000000
  307. +#define EXTPROC 0200000
  308. +#define XTABS 0014000
  309. +#define TIOCSER_TEMT 1
  310. +#endif
  311. diff -Nur musl-0.9.15/arch/mips/reloc.h musl-git/arch/mips/reloc.h
  312. --- musl-0.9.15/arch/mips/reloc.h 2014-01-03 21:12:17.000000000 +0100
  313. +++ musl-git/arch/mips/reloc.h 2014-02-25 15:24:14.000000000 +0100
  314. @@ -8,7 +8,13 @@
  315. #define ENDIAN_SUFFIX ""
  316. #endif
  317. -#define LDSO_ARCH "mips" ENDIAN_SUFFIX
  318. +#ifdef __mips_soft_float
  319. +#define FP_SUFFIX "-sf"
  320. +#else
  321. +#define FP_SUFFIX ""
  322. +#endif
  323. +
  324. +#define LDSO_ARCH "mips" ENDIAN_SUFFIX FP_SUFFIX
  325. #define IS_COPY(x) ((x)==R_MIPS_COPY)
  326. #define IS_PLT(x) 1
  327. diff -Nur musl-0.9.15/arch/mips/syscall_arch.h musl-git/arch/mips/syscall_arch.h
  328. --- musl-0.9.15/arch/mips/syscall_arch.h 2014-01-03 21:12:17.000000000 +0100
  329. +++ musl-git/arch/mips/syscall_arch.h 2014-02-25 15:24:14.000000000 +0100
  330. @@ -3,6 +3,8 @@
  331. ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  332. #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
  333. +long (__syscall)(long, ...);
  334. +
  335. #ifndef __clang__
  336. #define __asm_syscall(...) do { \
  337. diff -Nur musl-0.9.15/arch/powerpc/bits/shm.h musl-git/arch/powerpc/bits/shm.h
  338. --- musl-0.9.15/arch/powerpc/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  339. +++ musl-git/arch/powerpc/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  340. @@ -16,3 +16,14 @@
  341. unsigned long __pad1;
  342. unsigned long __pad2;
  343. };
  344. +
  345. +struct shminfo {
  346. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  347. +};
  348. +
  349. +struct shm_info {
  350. + int __used_ids;
  351. + unsigned long shm_tot, shm_rss, shm_swp;
  352. + unsigned long __swap_attempts, __swap_successes;
  353. +};
  354. +
  355. diff -Nur musl-0.9.15/arch/powerpc/bits/termios.h musl-git/arch/powerpc/bits/termios.h
  356. --- musl-0.9.15/arch/powerpc/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  357. +++ musl-git/arch/powerpc/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  358. @@ -66,7 +66,6 @@
  359. #define TAB1 00002000
  360. #define TAB2 00004000
  361. #define TAB3 00006000
  362. -#define XTABS 00006000
  363. #define CRDLY 00030000
  364. #define CR0 00000000
  365. #define CR1 00010000
  366. @@ -101,7 +100,6 @@
  367. #define B38400 0000017
  368. #define EXTA B19200
  369. #define EXTB B38400
  370. -#define CBAUDEX 0000000
  371. #define B57600 00020
  372. #define B115200 00021
  373. #define B230400 00022
  374. @@ -120,9 +118,6 @@
  375. #define B4000000 00036
  376. #define BOTHER 00037
  377. -#define CIBAUD 077600000
  378. -#define IBSHIFT 16
  379. -
  380. #define CSIZE 00001400
  381. #define CS5 00000000
  382. #define CS6 00000400
  383. @@ -136,8 +131,6 @@
  384. #define HUPCL 00040000
  385. #define CLOCAL 00100000
  386. -#define CMSPAR 010000000000
  387. -#define CRTSCTS 020000000000
  388. #define ISIG 0x00000080
  389. #define ICANON 0x00000100
  390. @@ -154,7 +147,6 @@
  391. #define FLUSHO 0x00800000
  392. #define PENDIN 0x20000000
  393. #define IEXTEN 0x00000400
  394. -#define EXTPROC 0x10000000
  395. #define TCOOFF 0
  396. #define TCOON 1
  397. @@ -168,3 +160,13 @@
  398. #define TCSANOW 0
  399. #define TCSADRAIN 1
  400. #define TCSAFLUSH 2
  401. +
  402. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  403. +#define CBAUDEX 0000000
  404. +#define CIBAUD 077600000
  405. +#define IBSHIFT 16
  406. +#define CMSPAR 010000000000
  407. +#define CRTSCTS 020000000000
  408. +#define EXTPROC 0x10000000
  409. +#define XTABS 00006000
  410. +#endif
  411. diff -Nur musl-0.9.15/arch/superh/atomic.h musl-git/arch/superh/atomic.h
  412. --- musl-0.9.15/arch/superh/atomic.h 1970-01-01 01:00:00.000000000 +0100
  413. +++ musl-git/arch/superh/atomic.h 2014-02-25 15:24:14.000000000 +0100
  414. @@ -0,0 +1,87 @@
  415. +#ifndef _INTERNAL_ATOMIC_H
  416. +#define _INTERNAL_ATOMIC_H
  417. +
  418. +#include <stdint.h>
  419. +
  420. +static inline int a_ctz_l(unsigned long x)
  421. +{
  422. + static const char debruijn32[32] = {
  423. + 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13,
  424. + 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14
  425. + };
  426. + return debruijn32[(x&-x)*0x076be629 >> 27];
  427. +}
  428. +
  429. +static inline int a_ctz_64(uint64_t x)
  430. +{
  431. + uint32_t y = x;
  432. + if (!y) {
  433. + y = x>>32;
  434. + return 32 + a_ctz_l(y);
  435. + }
  436. + return a_ctz_l(y);
  437. +}
  438. +
  439. +int __sh_cas(volatile int *, int, int);
  440. +int __sh_swap(volatile int *, int);
  441. +int __sh_fetch_add(volatile int *, int);
  442. +void __sh_store(volatile int *, int);
  443. +void __sh_and(volatile int *, int);
  444. +void __sh_or(volatile int *, int);
  445. +
  446. +#define a_cas(p,t,s) __sh_cas(p,t,s)
  447. +#define a_swap(x,v) __sh_swap(x,v)
  448. +#define a_fetch_add(x,v) __sh_fetch_add(x, v)
  449. +#define a_store(x,v) __sh_store(x, v)
  450. +#define a_and(x,v) __sh_and(x, v)
  451. +#define a_or(x,v) __sh_or(x, v)
  452. +
  453. +static inline void *a_cas_p(volatile void *p, void *t, void *s)
  454. +{
  455. + return (void *)a_cas(p, (int)t, (int)s);
  456. +}
  457. +
  458. +static inline long a_cas_l(volatile void *p, long t, long s)
  459. +{
  460. + return a_cas(p, t, s);
  461. +}
  462. +
  463. +static inline void a_inc(volatile int *x)
  464. +{
  465. + a_fetch_add(x, 1);
  466. +}
  467. +
  468. +static inline void a_dec(volatile int *x)
  469. +{
  470. + a_fetch_add(x, -1);
  471. +}
  472. +
  473. +static inline void a_spin()
  474. +{
  475. +}
  476. +
  477. +static inline void a_crash()
  478. +{
  479. + *(volatile char *)0=0;
  480. +}
  481. +
  482. +static inline void a_or_l(volatile void *p, long v)
  483. +{
  484. + a_or(p, v);
  485. +}
  486. +
  487. +static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  488. +{
  489. + union { uint64_t v; uint32_t r[2]; } u = { v };
  490. + a_and((int *)p, u.r[0]);
  491. + a_and((int *)p+1, u.r[1]);
  492. +}
  493. +
  494. +static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  495. +{
  496. + union { uint64_t v; uint32_t r[2]; } u = { v };
  497. + a_or((int *)p, u.r[0]);
  498. + a_or((int *)p+1, u.r[1]);
  499. +}
  500. +
  501. +#endif
  502. diff -Nur musl-0.9.15/arch/superh/bits/alltypes.h.in musl-git/arch/superh/bits/alltypes.h.in
  503. --- musl-0.9.15/arch/superh/bits/alltypes.h.in 1970-01-01 01:00:00.000000000 +0100
  504. +++ musl-git/arch/superh/bits/alltypes.h.in 2014-02-25 15:24:14.000000000 +0100
  505. @@ -0,0 +1,23 @@
  506. +#define _Addr int
  507. +#define _Int64 long long
  508. +#define _Reg int
  509. +
  510. +TYPEDEF __builtin_va_list va_list;
  511. +TYPEDEF __builtin_va_list __isoc_va_list;
  512. +
  513. +#ifndef __cplusplus
  514. +TYPEDEF long wchar_t;
  515. +#endif
  516. +TYPEDEF unsigned wint_t;
  517. +
  518. +TYPEDEF float float_t;
  519. +TYPEDEF double double_t;
  520. +
  521. +TYPEDEF long time_t;
  522. +TYPEDEF long suseconds_t;
  523. +
  524. +TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
  525. +TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
  526. +TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
  527. +TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
  528. +TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
  529. diff -Nur musl-0.9.15/arch/superh/bits/endian.h musl-git/arch/superh/bits/endian.h
  530. --- musl-0.9.15/arch/superh/bits/endian.h 1970-01-01 01:00:00.000000000 +0100
  531. +++ musl-git/arch/superh/bits/endian.h 2014-02-25 15:24:14.000000000 +0100
  532. @@ -0,0 +1,5 @@
  533. +#if __LITTLE_ENDIAN__
  534. +#define __BYTE_ORDER __LITTLE_ENDIAN
  535. +#else
  536. +#define __BYTE_ORDER __BIG_ENDIAN
  537. +#endif
  538. diff -Nur musl-0.9.15/arch/superh/bits/errno.h musl-git/arch/superh/bits/errno.h
  539. --- musl-0.9.15/arch/superh/bits/errno.h 1970-01-01 01:00:00.000000000 +0100
  540. +++ musl-git/arch/superh/bits/errno.h 2014-02-25 15:24:14.000000000 +0100
  541. @@ -0,0 +1,134 @@
  542. +#define EPERM 1
  543. +#define ENOENT 2
  544. +#define ESRCH 3
  545. +#define EINTR 4
  546. +#define EIO 5
  547. +#define ENXIO 6
  548. +#define E2BIG 7
  549. +#define ENOEXEC 8
  550. +#define EBADF 9
  551. +#define ECHILD 10
  552. +#define EAGAIN 11
  553. +#define ENOMEM 12
  554. +#define EACCES 13
  555. +#define EFAULT 14
  556. +#define ENOTBLK 15
  557. +#define EBUSY 16
  558. +#define EEXIST 17
  559. +#define EXDEV 18
  560. +#define ENODEV 19
  561. +#define ENOTDIR 20
  562. +#define EISDIR 21
  563. +#define EINVAL 22
  564. +#define ENFILE 23
  565. +#define EMFILE 24
  566. +#define ENOTTY 25
  567. +#define ETXTBSY 26
  568. +#define EFBIG 27
  569. +#define ENOSPC 28
  570. +#define ESPIPE 29
  571. +#define EROFS 30
  572. +#define EMLINK 31
  573. +#define EPIPE 32
  574. +#define EDOM 33
  575. +#define ERANGE 34
  576. +#define EDEADLK 35
  577. +#define ENAMETOOLONG 36
  578. +#define ENOLCK 37
  579. +#define ENOSYS 38
  580. +#define ENOTEMPTY 39
  581. +#define ELOOP 40
  582. +#define EWOULDBLOCK EAGAIN
  583. +#define ENOMSG 42
  584. +#define EIDRM 43
  585. +#define ECHRNG 44
  586. +#define EL2NSYNC 45
  587. +#define EL3HLT 46
  588. +#define EL3RST 47
  589. +#define ELNRNG 48
  590. +#define EUNATCH 49
  591. +#define ENOCSI 50
  592. +#define EL2HLT 51
  593. +#define EBADE 52
  594. +#define EBADR 53
  595. +#define EXFULL 54
  596. +#define ENOANO 55
  597. +#define EBADRQC 56
  598. +#define EBADSLT 57
  599. +#define EDEADLOCK EDEADLK
  600. +#define EBFONT 59
  601. +#define ENOSTR 60
  602. +#define ENODATA 61
  603. +#define ETIME 62
  604. +#define ENOSR 63
  605. +#define ENONET 64
  606. +#define ENOPKG 65
  607. +#define EREMOTE 66
  608. +#define ENOLINK 67
  609. +#define EADV 68
  610. +#define ESRMNT 69
  611. +#define ECOMM 70
  612. +#define EPROTO 71
  613. +#define EMULTIHOP 72
  614. +#define EDOTDOT 73
  615. +#define EBADMSG 74
  616. +#define EOVERFLOW 75
  617. +#define ENOTUNIQ 76
  618. +#define EBADFD 77
  619. +#define EREMCHG 78
  620. +#define ELIBACC 79
  621. +#define ELIBBAD 80
  622. +#define ELIBSCN 81
  623. +#define ELIBMAX 82
  624. +#define ELIBEXEC 83
  625. +#define EILSEQ 84
  626. +#define ERESTART 85
  627. +#define ESTRPIPE 86
  628. +#define EUSERS 87
  629. +#define ENOTSOCK 88
  630. +#define EDESTADDRREQ 89
  631. +#define EMSGSIZE 90
  632. +#define EPROTOTYPE 91
  633. +#define ENOPROTOOPT 92
  634. +#define EPROTONOSUPPORT 93
  635. +#define ESOCKTNOSUPPORT 94
  636. +#define EOPNOTSUPP 95
  637. +#define ENOTSUP EOPNOTSUPP
  638. +#define EPFNOSUPPORT 96
  639. +#define EAFNOSUPPORT 97
  640. +#define EADDRINUSE 98
  641. +#define EADDRNOTAVAIL 99
  642. +#define ENETDOWN 100
  643. +#define ENETUNREACH 101
  644. +#define ENETRESET 102
  645. +#define ECONNABORTED 103
  646. +#define ECONNRESET 104
  647. +#define ENOBUFS 105
  648. +#define EISCONN 106
  649. +#define ENOTCONN 107
  650. +#define ESHUTDOWN 108
  651. +#define ETOOMANYREFS 109
  652. +#define ETIMEDOUT 110
  653. +#define ECONNREFUSED 111
  654. +#define EHOSTDOWN 112
  655. +#define EHOSTUNREACH 113
  656. +#define EALREADY 114
  657. +#define EINPROGRESS 115
  658. +#define ESTALE 116
  659. +#define EUCLEAN 117
  660. +#define ENOTNAM 118
  661. +#define ENAVAIL 119
  662. +#define EISNAM 120
  663. +#define EREMOTEIO 121
  664. +#define EDQUOT 122
  665. +#define ENOMEDIUM 123
  666. +#define EMEDIUMTYPE 124
  667. +#define ECANCELED 125
  668. +#define ENOKEY 126
  669. +#define EKEYEXPIRED 127
  670. +#define EKEYREVOKED 128
  671. +#define EKEYREJECTED 129
  672. +#define EOWNERDEAD 130
  673. +#define ENOTRECOVERABLE 131
  674. +#define ERFKILL 132
  675. +#define EHWPOISON 133
  676. diff -Nur musl-0.9.15/arch/superh/bits/fcntl.h musl-git/arch/superh/bits/fcntl.h
  677. --- musl-0.9.15/arch/superh/bits/fcntl.h 1970-01-01 01:00:00.000000000 +0100
  678. +++ musl-git/arch/superh/bits/fcntl.h 2014-02-25 15:24:14.000000000 +0100
  679. @@ -0,0 +1,39 @@
  680. +#define O_CREAT 0100
  681. +#define O_EXCL 0200
  682. +#define O_NOCTTY 0400
  683. +#define O_TRUNC 01000
  684. +#define O_APPEND 02000
  685. +#define O_NONBLOCK 04000
  686. +#define O_DSYNC 010000
  687. +#define O_SYNC 04010000
  688. +#define O_RSYNC 04010000
  689. +#define O_DIRECTORY 0200000
  690. +#define O_NOFOLLOW 0400000
  691. +#define O_CLOEXEC 02000000
  692. +
  693. +#define O_ASYNC 020000
  694. +#define O_DIRECT 040000
  695. +#define O_LARGEFILE 0100000
  696. +#define O_NOATIME 01000000
  697. +#define O_TMPFILE 020200000
  698. +#define O_NDELAY O_NONBLOCK
  699. +
  700. +#define F_DUPFD 0
  701. +#define F_GETFD 1
  702. +#define F_SETFD 2
  703. +#define F_GETFL 3
  704. +#define F_SETFL 4
  705. +
  706. +#define F_SETOWN 8
  707. +#define F_GETOWN 9
  708. +#define F_SETSIG 10
  709. +#define F_GETSIG 11
  710. +
  711. +#define F_GETLK 12
  712. +#define F_SETLK 13
  713. +#define F_SETLKW 14
  714. +
  715. +#define F_SETOWN_EX 15
  716. +#define F_GETOWN_EX 16
  717. +
  718. +#define F_GETOWNER_UIDS 17
  719. diff -Nur musl-0.9.15/arch/superh/bits/fenv.h musl-git/arch/superh/bits/fenv.h
  720. --- musl-0.9.15/arch/superh/bits/fenv.h 1970-01-01 01:00:00.000000000 +0100
  721. +++ musl-git/arch/superh/bits/fenv.h 2014-02-25 15:24:14.000000000 +0100
  722. @@ -0,0 +1,17 @@
  723. +#define FE_TONEAREST 0
  724. +#define FE_TOWARDZERO 1
  725. +
  726. +#define FE_INEXACT 0x04
  727. +#define FE_UNDERFLOW 0x08
  728. +#define FE_OVERFLOW 0x10
  729. +#define FE_DIVBYZERO 0x20
  730. +#define FE_INVALID 0x40
  731. +#define FE_ALL_EXCEPT 0x7c
  732. +
  733. +typedef unsigned long fexcept_t;
  734. +
  735. +typedef struct {
  736. + unsigned long __cw;
  737. +} fenv_t;
  738. +
  739. +#define FE_DFL_ENV ((const fenv_t *) -1)
  740. diff -Nur musl-0.9.15/arch/superh/bits/float.h musl-git/arch/superh/bits/float.h
  741. --- musl-0.9.15/arch/superh/bits/float.h 1970-01-01 01:00:00.000000000 +0100
  742. +++ musl-git/arch/superh/bits/float.h 2014-02-25 15:24:14.000000000 +0100
  743. @@ -0,0 +1,17 @@
  744. +#define FLT_ROUNDS 1
  745. +#define FLT_EVAL_METHOD 0
  746. +
  747. +#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
  748. +#define LDBL_MIN 2.22507385850720138309e-308L
  749. +#define LDBL_MAX 1.79769313486231570815e+308L
  750. +#define LDBL_EPSILON 2.22044604925031308085e-16L
  751. +
  752. +#define LDBL_MANT_DIG 53
  753. +#define LDBL_MIN_EXP (-1021)
  754. +#define LDBL_MAX_EXP 1024
  755. +
  756. +#define LDBL_DIG 15
  757. +#define LDBL_MIN_10_EXP (-307)
  758. +#define LDBL_MAX_10_EXP 308
  759. +
  760. +#define DECIMAL_DIG 17
  761. diff -Nur musl-0.9.15/arch/superh/bits/ioctl.h musl-git/arch/superh/bits/ioctl.h
  762. --- musl-0.9.15/arch/superh/bits/ioctl.h 1970-01-01 01:00:00.000000000 +0100
  763. +++ musl-git/arch/superh/bits/ioctl.h 2014-02-25 15:24:14.000000000 +0100
  764. @@ -0,0 +1,205 @@
  765. +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
  766. +#define _IOC_NONE 0U
  767. +#define _IOC_WRITE 1U
  768. +#define _IOC_READ 2U
  769. +
  770. +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
  771. +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
  772. +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
  773. +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
  774. +
  775. +#define FIOCLEX _IO('f', 1)
  776. +#define FIONCLEX _IO('f', 2)
  777. +#define FIOASYNC _IOW('f', 125, int)
  778. +#define FIONBIO _IOW('f', 126, int)
  779. +#define FIONREAD _IOR('f', 127, int)
  780. +#define TIOCINQ FIONREAD
  781. +#define FIOQSIZE _IOR('f', 128, char[8])
  782. +
  783. +#define TCGETA _IOR('t', 23, char[18])
  784. +#define TCSETA _IOW('t', 24, char[18])
  785. +#define TCSETAW _IOW('t', 25, char[18])
  786. +#define TCSETAF _IOW('t', 28, char[18])
  787. +
  788. +#define TCSBRK _IO('t', 29)
  789. +#define TCXONC _IO('t', 30)
  790. +#define TCFLSH _IO('t', 31)
  791. +
  792. +#define TIOCSWINSZ _IOW('t', 103, char[8])
  793. +#define TIOCGWINSZ _IOR('t', 104, char[8])
  794. +#define TIOCSTART _IO('t', 110)
  795. +#define TIOCSTOP _IO('t', 111)
  796. +#define TIOCOUTQ _IOR('t', 115, int)
  797. +
  798. +#define TIOCSPGRP _IOW('t', 118, int)
  799. +#define TIOCGPGRP _IOR('t', 119, int)
  800. +
  801. +#define TIOCEXCL _IO('T', 12)
  802. +#define TIOCNXCL _IO('T', 13)
  803. +#define TIOCSCTTY _IO('T', 14)
  804. +
  805. +#define TIOCSTI _IOW('T', 18, char)
  806. +#define TIOCMGET _IOR('T', 21, unsigned int)
  807. +#define TIOCMBIS _IOW('T', 22, unsigned int)
  808. +#define TIOCMBIC _IOW('T', 23, unsigned int)
  809. +#define TIOCMSET _IOW('T', 24, unsigned int)
  810. +#define TIOCM_LE 0x001
  811. +#define TIOCM_DTR 0x002
  812. +#define TIOCM_RTS 0x004
  813. +#define TIOCM_ST 0x008
  814. +#define TIOCM_SR 0x010
  815. +#define TIOCM_CTS 0x020
  816. +#define TIOCM_CAR 0x040
  817. +#define TIOCM_RNG 0x080
  818. +#define TIOCM_DSR 0x100
  819. +#define TIOCM_CD TIOCM_CAR
  820. +#define TIOCM_RI TIOCM_RNG
  821. +#define TIOCM_OUT1 0x2000
  822. +#define TIOCM_OUT2 0x4000
  823. +#define TIOCM_LOOP 0x8000
  824. +
  825. +#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
  826. +#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
  827. +#define TIOCLINUX _IOW('T', 28, char)
  828. +#define TIOCCONS _IO('T', 29)
  829. +#define TIOCGSERIAL _IOR('T', 30, char[60])
  830. +#define TIOCSSERIAL _IOW('T', 31, char[60])
  831. +#define TIOCPKT _IOW('T', 32, int)
  832. +#define TIOCPKT_DATA 0
  833. +#define TIOCPKT_FLUSHREAD 1
  834. +#define TIOCPKT_FLUSHWRITE 2
  835. +#define TIOCPKT_STOP 4
  836. +#define TIOCPKT_START 8
  837. +#define TIOCPKT_NOSTOP 16
  838. +#define TIOCPKT_DOSTOP 32
  839. +#define TIOCPKT_IOCTL 64
  840. +
  841. +#define TIOCNOTTY _IO('T', 34)
  842. +#define TIOCSETD _IOW('T', 35, int)
  843. +#define TIOCGETD _IOR('T', 36, int)
  844. +#define TCSBRKP _IOW('T', 37, int)
  845. +#define TIOCSBRK _IO('T', 39)
  846. +#define TIOCCBRK _IO('T', 40)
  847. +#define TIOCGSID _IOR('T', 41, int)
  848. +#define TCGETS _IOR('T', 42, char[44])
  849. +#define TCSETS _IOW('T', 43, char[44])
  850. +#define TCSETSW _IOW('T', 44, char[44])
  851. +#define TCSETSF _IOW('T', 45, char[44])
  852. +#define TIOCGPTN _IOR('T', 48, unsigned int)
  853. +#define TIOCSPTLCK _IOW('T', 49, int)
  854. +#define TIOCGDEV _IOR('T', 50, unsigned int)
  855. +#define TIOCSIG _IOW('T', 54, int)
  856. +#define TIOCVHANGUP _IO('T', 55)
  857. +#define TIOCGPKT _IOR('T', 56, int)
  858. +#define TIOCGPTLCK _IOR('T', 57, int)
  859. +#define TIOCGEXCL _IOR('T', 64, int)
  860. +
  861. +#define TIOCSERCONFIG _IO('T', 83)
  862. +#define TIOCSERGWILD _IOR('T', 84, int)
  863. +#define TIOCSERSWILD _IOW('T', 85, int)
  864. +#define TIOCGLCKTRMIOS _IO('T', 86)
  865. +#define TIOCSLCKTRMIOS _IO('T', 87)
  866. +#define TIOCSERGSTRUCT _IOR('T', 88, char[216])
  867. +#define TIOCSERGETLSR _IOR('T', 89, unsigned int)
  868. +#define TIOCSER_TEMT 0x01
  869. +#define TIOCSERGETMULTI _IOR('T', 90, char[168])
  870. +#define TIOCSERSETMULTI _IOW('T', 91, char[168])
  871. +
  872. +#define TIOCMIWAIT _IO('T', 92)
  873. +#define TIOCGICOUNT _IO('T', 93)
  874. +
  875. +struct winsize {
  876. + unsigned short ws_row;
  877. + unsigned short ws_col;
  878. + unsigned short ws_xpixel;
  879. + unsigned short ws_ypixel;
  880. +};
  881. +
  882. +#define TIOCM_MODEM_BITS TIOCM_OUT2
  883. +
  884. +#define N_TTY 0
  885. +#define N_SLIP 1
  886. +#define N_MOUSE 2
  887. +#define N_PPP 3
  888. +#define N_STRIP 4
  889. +#define N_AX25 5
  890. +#define N_X25 6
  891. +#define N_6PACK 7
  892. +#define N_MASC 8
  893. +#define N_R3964 9
  894. +#define N_PROFIBUS_FDL 10
  895. +#define N_IRDA 11
  896. +#define N_SMSBLOCK 12
  897. +#define N_HDLC 13
  898. +#define N_SYNC_PPP 14
  899. +#define N_HCI 15
  900. +
  901. +#define FIOGETOWN _IOR('f', 123, int)
  902. +#define FIOSETOWN _IOW('f', 124, int)
  903. +
  904. +#define SIOCATMARK _IOR('s', 7, int)
  905. +#define SIOCSPGRP _IOW('s', 8, int)
  906. +#define SIOCGPGRP _IOW('s', 9, int)
  907. +#define SIOCGSTAMP _IOR('s', 100, char[8])
  908. +
  909. +#define SIOCADDRT 0x890B
  910. +#define SIOCDELRT 0x890C
  911. +#define SIOCRTMSG 0x890D
  912. +
  913. +#define SIOCGIFNAME 0x8910
  914. +#define SIOCSIFLINK 0x8911
  915. +#define SIOCGIFCONF 0x8912
  916. +#define SIOCGIFFLAGS 0x8913
  917. +#define SIOCSIFFLAGS 0x8914
  918. +#define SIOCGIFADDR 0x8915
  919. +#define SIOCSIFADDR 0x8916
  920. +#define SIOCGIFDSTADDR 0x8917
  921. +#define SIOCSIFDSTADDR 0x8918
  922. +#define SIOCGIFBRDADDR 0x8919
  923. +#define SIOCSIFBRDADDR 0x891a
  924. +#define SIOCGIFNETMASK 0x891b
  925. +#define SIOCSIFNETMASK 0x891c
  926. +#define SIOCGIFMETRIC 0x891d
  927. +#define SIOCSIFMETRIC 0x891e
  928. +#define SIOCGIFMEM 0x891f
  929. +#define SIOCSIFMEM 0x8920
  930. +#define SIOCGIFMTU 0x8921
  931. +#define SIOCSIFMTU 0x8922
  932. +#define SIOCSIFHWADDR 0x8924
  933. +#define SIOCGIFENCAP 0x8925
  934. +#define SIOCSIFENCAP 0x8926
  935. +#define SIOCGIFHWADDR 0x8927
  936. +#define SIOCGIFSLAVE 0x8929
  937. +#define SIOCSIFSLAVE 0x8930
  938. +#define SIOCADDMULTI 0x8931
  939. +#define SIOCDELMULTI 0x8932
  940. +#define SIOCGIFINDEX 0x8933
  941. +#define SIOGIFINDEX SIOCGIFINDEX
  942. +#define SIOCSIFPFLAGS 0x8934
  943. +#define SIOCGIFPFLAGS 0x8935
  944. +#define SIOCDIFADDR 0x8936
  945. +#define SIOCSIFHWBROADCAST 0x8937
  946. +#define SIOCGIFCOUNT 0x8938
  947. +
  948. +#define SIOCGIFBR 0x8940
  949. +#define SIOCSIFBR 0x8941
  950. +
  951. +#define SIOCGIFTXQLEN 0x8942
  952. +#define SIOCSIFTXQLEN 0x8943
  953. +
  954. +#define SIOCDARP 0x8953
  955. +#define SIOCGARP 0x8954
  956. +#define SIOCSARP 0x8955
  957. +
  958. +#define SIOCDRARP 0x8960
  959. +#define SIOCGRARP 0x8961
  960. +#define SIOCSRARP 0x8962
  961. +
  962. +#define SIOCGIFMAP 0x8970
  963. +#define SIOCSIFMAP 0x8971
  964. +
  965. +#define SIOCADDDLCI 0x8980
  966. +#define SIOCDELDLCI 0x8981
  967. +
  968. +#define SIOCDEVPRIVATE 0x89F0
  969. +#define SIOCPROTOPRIVATE 0x89E0
  970. diff -Nur musl-0.9.15/arch/superh/bits/ipc.h musl-git/arch/superh/bits/ipc.h
  971. --- musl-0.9.15/arch/superh/bits/ipc.h 1970-01-01 01:00:00.000000000 +0100
  972. +++ musl-git/arch/superh/bits/ipc.h 2014-02-25 15:24:14.000000000 +0100
  973. @@ -0,0 +1,14 @@
  974. +struct ipc_perm
  975. +{
  976. + key_t __ipc_perm_key;
  977. + uid_t uid;
  978. + gid_t gid;
  979. + uid_t cuid;
  980. + gid_t cgid;
  981. + mode_t mode;
  982. + int __ipc_perm_seq;
  983. + long __pad1;
  984. + long __pad2;
  985. +};
  986. +
  987. +#define IPC_64 0x100
  988. diff -Nur musl-0.9.15/arch/superh/bits/limits.h musl-git/arch/superh/bits/limits.h
  989. --- musl-0.9.15/arch/superh/bits/limits.h 1970-01-01 01:00:00.000000000 +0100
  990. +++ musl-git/arch/superh/bits/limits.h 2014-02-25 15:24:14.000000000 +0100
  991. @@ -0,0 +1,8 @@
  992. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  993. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  994. +#define PAGE_SIZE 4096
  995. +#define LONG_BIT 32
  996. +#endif
  997. +
  998. +#define LONG_MAX 0x7fffffffL
  999. +#define LLONG_MAX 0x7fffffffffffffffLL
  1000. diff -Nur musl-0.9.15/arch/superh/bits/mman.h musl-git/arch/superh/bits/mman.h
  1001. --- musl-0.9.15/arch/superh/bits/mman.h 1970-01-01 01:00:00.000000000 +0100
  1002. +++ musl-git/arch/superh/bits/mman.h 2014-02-25 15:24:14.000000000 +0100
  1003. @@ -0,0 +1,62 @@
  1004. +#define MAP_FAILED ((void *) -1)
  1005. +
  1006. +#define PROT_NONE 0
  1007. +#define PROT_READ 1
  1008. +#define PROT_WRITE 2
  1009. +#define PROT_EXEC 4
  1010. +#define PROT_GROWSDOWN 0x01000000
  1011. +#define PROT_GROWSUP 0x02000000
  1012. +
  1013. +#define MAP_SHARED 0x01
  1014. +#define MAP_PRIVATE 0x02
  1015. +#define MAP_FIXED 0x10
  1016. +
  1017. +#define MAP_TYPE 0x0f
  1018. +#define MAP_FILE 0x00
  1019. +#define MAP_ANON 0x20
  1020. +#define MAP_ANONYMOUS MAP_ANON
  1021. +#define MAP_32BIT 0x40
  1022. +#define MAP_NORESERVE 0x4000
  1023. +#define MAP_GROWSDOWN 0x0100
  1024. +#define MAP_DENYWRITE 0x0800
  1025. +#define MAP_EXECUTABLE 0x1000
  1026. +#define MAP_LOCKED 0x2000
  1027. +#define MAP_POPULATE 0x8000
  1028. +#define MAP_NONBLOCK 0x10000
  1029. +#define MAP_STACK 0x20000
  1030. +#define MAP_HUGETLB 0x40000
  1031. +
  1032. +#define POSIX_MADV_NORMAL 0
  1033. +#define POSIX_MADV_RANDOM 1
  1034. +#define POSIX_MADV_SEQUENTIAL 2
  1035. +#define POSIX_MADV_WILLNEED 3
  1036. +#define POSIX_MADV_DONTNEED 4
  1037. +
  1038. +#define MS_ASYNC 1
  1039. +#define MS_INVALIDATE 2
  1040. +#define MS_SYNC 4
  1041. +
  1042. +#define MCL_CURRENT 1
  1043. +#define MCL_FUTURE 2
  1044. +
  1045. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1046. +#define MADV_NORMAL 0
  1047. +#define MADV_RANDOM 1
  1048. +#define MADV_SEQUENTIAL 2
  1049. +#define MADV_WILLNEED 3
  1050. +#define MADV_DONTNEED 4
  1051. +#define MADV_REMOVE 9
  1052. +#define MADV_DONTFORK 10
  1053. +#define MADV_DOFORK 11
  1054. +#define MADV_MERGEABLE 12
  1055. +#define MADV_UNMERGEABLE 13
  1056. +#define MADV_HUGEPAGE 14
  1057. +#define MADV_NOHUGEPAGE 15
  1058. +#define MADV_DONTDUMP 16
  1059. +#define MADV_DODUMP 17
  1060. +#define MADV_HWPOISON 100
  1061. +#define MADV_SOFT_OFFLINE 101
  1062. +
  1063. +#define MREMAP_MAYMOVE 1
  1064. +#define MREMAP_FIXED 2
  1065. +#endif
  1066. diff -Nur musl-0.9.15/arch/superh/bits/msg.h musl-git/arch/superh/bits/msg.h
  1067. --- musl-0.9.15/arch/superh/bits/msg.h 1970-01-01 01:00:00.000000000 +0100
  1068. +++ musl-git/arch/superh/bits/msg.h 2014-02-25 15:24:14.000000000 +0100
  1069. @@ -0,0 +1,16 @@
  1070. +struct msqid_ds
  1071. +{
  1072. + struct ipc_perm msg_perm;
  1073. + time_t msg_stime;
  1074. + int __unused1;
  1075. + time_t msg_rtime;
  1076. + int __unused2;
  1077. + time_t msg_ctime;
  1078. + int __unused3;
  1079. + unsigned long msg_cbytes;
  1080. + msgqnum_t msg_qnum;
  1081. + msglen_t msg_qbytes;
  1082. + pid_t msg_lspid;
  1083. + pid_t msg_lrpid;
  1084. + unsigned long __unused[2];
  1085. +};
  1086. diff -Nur musl-0.9.15/arch/superh/bits/posix.h musl-git/arch/superh/bits/posix.h
  1087. --- musl-0.9.15/arch/superh/bits/posix.h 1970-01-01 01:00:00.000000000 +0100
  1088. +++ musl-git/arch/superh/bits/posix.h 2014-02-25 15:24:14.000000000 +0100
  1089. @@ -0,0 +1,2 @@
  1090. +#define _POSIX_V6_ILP32_OFFBIG 1
  1091. +#define _POSIX_V7_ILP32_OFFBIG 1
  1092. diff -Nur musl-0.9.15/arch/superh/bits/setjmp.h musl-git/arch/superh/bits/setjmp.h
  1093. --- musl-0.9.15/arch/superh/bits/setjmp.h 1970-01-01 01:00:00.000000000 +0100
  1094. +++ musl-git/arch/superh/bits/setjmp.h 2014-02-25 15:24:14.000000000 +0100
  1095. @@ -0,0 +1 @@
  1096. +typedef unsigned long __jmp_buf[13];
  1097. diff -Nur musl-0.9.15/arch/superh/bits/shm.h musl-git/arch/superh/bits/shm.h
  1098. --- musl-0.9.15/arch/superh/bits/shm.h 1970-01-01 01:00:00.000000000 +0100
  1099. +++ musl-git/arch/superh/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  1100. @@ -0,0 +1,28 @@
  1101. +#define SHMLBA 16384
  1102. +
  1103. +struct shmid_ds
  1104. +{
  1105. + struct ipc_perm shm_perm;
  1106. + size_t shm_segsz;
  1107. + time_t shm_atime;
  1108. + int __unused1;
  1109. + time_t shm_dtime;
  1110. + int __unused2;
  1111. + time_t shm_ctime;
  1112. + int __unused3;
  1113. + pid_t shm_cpid;
  1114. + pid_t shm_lpid;
  1115. + unsigned long shm_nattch;
  1116. + unsigned long __pad1;
  1117. + unsigned long __pad2;
  1118. +};
  1119. +
  1120. +struct shminfo {
  1121. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  1122. +};
  1123. +
  1124. +struct shm_info {
  1125. + int __used_ids;
  1126. + unsigned long shm_tot, shm_rss, shm_swp;
  1127. + unsigned long __swap_attempts, __swap_successes;
  1128. +};
  1129. diff -Nur musl-0.9.15/arch/superh/bits/signal.h musl-git/arch/superh/bits/signal.h
  1130. --- musl-0.9.15/arch/superh/bits/signal.h 1970-01-01 01:00:00.000000000 +0100
  1131. +++ musl-git/arch/superh/bits/signal.h 2014-02-25 15:24:14.000000000 +0100
  1132. @@ -0,0 +1,76 @@
  1133. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  1134. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1135. +
  1136. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  1137. +typedef int greg_t, gregset_t[16];
  1138. +typedef int freg_t, fpregset_t[16];
  1139. +typedef struct sigcontext {
  1140. + unsigned long oldmask;
  1141. + unsigned long sc_regs[16];
  1142. + unsigned long sc_pc, sc_pr, sc_sr;
  1143. + unsigned long sc_gbr, sc_mach, sc_macl;
  1144. + unsigned long sc_fpregs[16];
  1145. + unsigned long sc_xfpregs[16];
  1146. + unsigned int sc_fpscr, sc_fpul, sc_ownedfp;
  1147. +} mcontext_t;
  1148. +#else
  1149. +typedef struct {
  1150. + unsigned long __regs[58];
  1151. +} mcontext_t;
  1152. +#endif
  1153. +
  1154. +typedef struct __ucontext {
  1155. + unsigned long uc_flags;
  1156. + struct __ucontext *uc_link;
  1157. + stack_t uc_stack;
  1158. + mcontext_t uc_mcontext;
  1159. + sigset_t uc_sigmask;
  1160. +} ucontext_t;
  1161. +
  1162. +#define SA_NOCLDSTOP 1
  1163. +#define SA_NOCLDWAIT 2
  1164. +#define SA_SIGINFO 4
  1165. +#define SA_ONSTACK 0x08000000
  1166. +#define SA_RESTART 0x10000000
  1167. +#define SA_NODEFER 0x40000000
  1168. +#define SA_RESETHAND 0x80000000
  1169. +#define SA_RESTORER 0x04000000
  1170. +
  1171. +#endif
  1172. +
  1173. +#define SIGHUP 1
  1174. +#define SIGINT 2
  1175. +#define SIGQUIT 3
  1176. +#define SIGILL 4
  1177. +#define SIGTRAP 5
  1178. +#define SIGABRT 6
  1179. +#define SIGIOT SIGABRT
  1180. +#define SIGBUS 7
  1181. +#define SIGFPE 8
  1182. +#define SIGKILL 9
  1183. +#define SIGUSR1 10
  1184. +#define SIGSEGV 11
  1185. +#define SIGUSR2 12
  1186. +#define SIGPIPE 13
  1187. +#define SIGALRM 14
  1188. +#define SIGTERM 15
  1189. +#define SIGSTKFLT 16
  1190. +#define SIGCHLD 17
  1191. +#define SIGCONT 18
  1192. +#define SIGSTOP 19
  1193. +#define SIGTSTP 20
  1194. +#define SIGTTIN 21
  1195. +#define SIGTTOU 22
  1196. +#define SIGURG 23
  1197. +#define SIGXCPU 24
  1198. +#define SIGXFSZ 25
  1199. +#define SIGVTALRM 26
  1200. +#define SIGPROF 27
  1201. +#define SIGWINCH 28
  1202. +#define SIGIO 29
  1203. +#define SIGPOLL 29
  1204. +#define SIGPWR 30
  1205. +#define SIGSYS 31
  1206. +#define SIGUNUSED SIGSYS
  1207. +
  1208. +#define _NSIG 65
  1209. diff -Nur musl-0.9.15/arch/superh/bits/socket.h musl-git/arch/superh/bits/socket.h
  1210. --- musl-0.9.15/arch/superh/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
  1211. +++ musl-git/arch/superh/bits/socket.h 2014-02-25 15:24:14.000000000 +0100
  1212. @@ -0,0 +1,17 @@
  1213. +struct msghdr
  1214. +{
  1215. + void *msg_name;
  1216. + socklen_t msg_namelen;
  1217. + struct iovec *msg_iov;
  1218. + int msg_iovlen;
  1219. + void *msg_control;
  1220. + socklen_t msg_controllen;
  1221. + int msg_flags;
  1222. +};
  1223. +
  1224. +struct cmsghdr
  1225. +{
  1226. + socklen_t cmsg_len;
  1227. + int cmsg_level;
  1228. + int cmsg_type;
  1229. +};
  1230. diff -Nur musl-0.9.15/arch/superh/bits/statfs.h musl-git/arch/superh/bits/statfs.h
  1231. --- musl-0.9.15/arch/superh/bits/statfs.h 1970-01-01 01:00:00.000000000 +0100
  1232. +++ musl-git/arch/superh/bits/statfs.h 2014-02-25 15:24:14.000000000 +0100
  1233. @@ -0,0 +1,7 @@
  1234. +struct statfs {
  1235. + unsigned long f_type, f_bsize;
  1236. + fsblkcnt_t f_blocks, f_bfree, f_bavail;
  1237. + fsfilcnt_t f_files, f_ffree;
  1238. + fsid_t f_fsid;
  1239. + unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
  1240. +};
  1241. diff -Nur musl-0.9.15/arch/superh/bits/stat.h musl-git/arch/superh/bits/stat.h
  1242. --- musl-0.9.15/arch/superh/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
  1243. +++ musl-git/arch/superh/bits/stat.h 2014-02-25 15:24:14.000000000 +0100
  1244. @@ -0,0 +1,22 @@
  1245. +/* copied from kernel definition, but with padding replaced
  1246. + * by the corresponding correctly-sized userspace types. */
  1247. +
  1248. +struct stat
  1249. +{
  1250. + dev_t st_dev;
  1251. + int __st_dev_padding;
  1252. + long __st_ino_truncated;
  1253. + mode_t st_mode;
  1254. + nlink_t st_nlink;
  1255. + uid_t st_uid;
  1256. + gid_t st_gid;
  1257. + dev_t st_rdev;
  1258. + int __st_rdev_padding;
  1259. + off_t st_size;
  1260. + blksize_t st_blksize;
  1261. + blkcnt_t st_blocks;
  1262. + struct timespec st_atim;
  1263. + struct timespec st_mtim;
  1264. + struct timespec st_ctim;
  1265. + ino_t st_ino;
  1266. +};
  1267. diff -Nur musl-0.9.15/arch/superh/bits/stdarg.h musl-git/arch/superh/bits/stdarg.h
  1268. --- musl-0.9.15/arch/superh/bits/stdarg.h 1970-01-01 01:00:00.000000000 +0100
  1269. +++ musl-git/arch/superh/bits/stdarg.h 2014-02-25 15:24:14.000000000 +0100
  1270. @@ -0,0 +1,4 @@
  1271. +#define va_start(v,l) __builtin_va_start(v,l)
  1272. +#define va_end(v) __builtin_va_end(v)
  1273. +#define va_arg(v,l) __builtin_va_arg(v,l)
  1274. +#define va_copy(d,s) __builtin_va_copy(d,s)
  1275. diff -Nur musl-0.9.15/arch/superh/bits/stdint.h musl-git/arch/superh/bits/stdint.h
  1276. --- musl-0.9.15/arch/superh/bits/stdint.h 1970-01-01 01:00:00.000000000 +0100
  1277. +++ musl-git/arch/superh/bits/stdint.h 2014-02-25 15:24:14.000000000 +0100
  1278. @@ -0,0 +1,20 @@
  1279. +typedef int32_t int_fast16_t;
  1280. +typedef int32_t int_fast32_t;
  1281. +typedef uint32_t uint_fast16_t;
  1282. +typedef uint32_t uint_fast32_t;
  1283. +
  1284. +#define INT_FAST16_MIN INT32_MIN
  1285. +#define INT_FAST32_MIN INT32_MIN
  1286. +
  1287. +#define INT_FAST16_MAX INT32_MAX
  1288. +#define INT_FAST32_MAX INT32_MAX
  1289. +
  1290. +#define UINT_FAST16_MAX UINT32_MAX
  1291. +#define UINT_FAST32_MAX UINT32_MAX
  1292. +
  1293. +#define INTPTR_MIN INT32_MIN
  1294. +#define INTPTR_MAX INT32_MAX
  1295. +#define UINTPTR_MAX UINT32_MAX
  1296. +#define PTRDIFF_MIN INT32_MIN
  1297. +#define PTRDIFF_MAX INT32_MAX
  1298. +#define SIZE_MAX UINT32_MAX
  1299. diff -Nur musl-0.9.15/arch/superh/bits/syscall.h musl-git/arch/superh/bits/syscall.h
  1300. --- musl-0.9.15/arch/superh/bits/syscall.h 1970-01-01 01:00:00.000000000 +0100
  1301. +++ musl-git/arch/superh/bits/syscall.h 2014-02-25 15:24:14.000000000 +0100
  1302. @@ -0,0 +1,684 @@
  1303. +#define __NR_restart_syscall 0
  1304. +#define __NR_exit 1
  1305. +#define __NR_fork 2
  1306. +#define __NR_read 3
  1307. +#define __NR_write 4
  1308. +#define __NR_open 5
  1309. +#define __NR_close 6
  1310. +#define __NR_waitpid 7
  1311. +#define __NR_creat 8
  1312. +#define __NR_link 9
  1313. +#define __NR_unlink 10
  1314. +#define __NR_execve 11
  1315. +#define __NR_chdir 12
  1316. +#define __NR_time 13
  1317. +#define __NR_mknod 14
  1318. +#define __NR_chmod 15
  1319. +#define __NR_lchown 16
  1320. +#define __NR_oldstat 18
  1321. +#define __NR_lseek 19
  1322. +#define __NR_getpid 20
  1323. +#define __NR_mount 21
  1324. +#define __NR_umount 22
  1325. +#define __NR_setuid 23
  1326. +#define __NR_getuid 24
  1327. +#define __NR_stime 25
  1328. +#define __NR_ptrace 26
  1329. +#define __NR_alarm 27
  1330. +#define __NR_oldfstat 28
  1331. +#define __NR_pause 29
  1332. +#define __NR_utime 30
  1333. +#define __NR_access 33
  1334. +#define __NR_nice 34
  1335. +#define __NR_sync 36
  1336. +#define __NR_kill 37
  1337. +#define __NR_rename 38
  1338. +#define __NR_mkdir 39
  1339. +#define __NR_rmdir 40
  1340. +#define __NR_dup 41
  1341. +#define __NR_pipe 42
  1342. +#define __NR_times 43
  1343. +#define __NR_brk 45
  1344. +#define __NR_setgid 46
  1345. +#define __NR_getgid 47
  1346. +#define __NR_signal 48
  1347. +#define __NR_geteuid 49
  1348. +#define __NR_getegid 50
  1349. +#define __NR_acct 51
  1350. +#define __NR_umount2 52
  1351. +#define __NR_ioctl 54
  1352. +#define __NR_fcntl 55
  1353. +#define __NR_setpgid 57
  1354. +#define __NR_umask 60
  1355. +#define __NR_chroot 61
  1356. +#define __NR_ustat 62
  1357. +#define __NR_dup2 63
  1358. +#define __NR_getppid 64
  1359. +#define __NR_getpgrp 65
  1360. +#define __NR_setsid 66
  1361. +#define __NR_sigaction 67
  1362. +#define __NR_sgetmask 68
  1363. +#define __NR_ssetmask 69
  1364. +#define __NR_setreuid 70
  1365. +#define __NR_setregid 71
  1366. +#define __NR_sigsuspend 72
  1367. +#define __NR_sigpending 73
  1368. +#define __NR_sethostname 74
  1369. +#define __NR_setrlimit 75
  1370. +#define __NR_getrlimit 76
  1371. +#define __NR_getrusage 77
  1372. +#define __NR_gettimeofday 78
  1373. +#define __NR_settimeofday 79
  1374. +#define __NR_getgroups 80
  1375. +#define __NR_setgroups 81
  1376. +#define __NR_symlink 83
  1377. +#define __NR_oldlstat 84
  1378. +#define __NR_readlink 85
  1379. +#define __NR_uselib 86
  1380. +#define __NR_swapon 87
  1381. +#define __NR_reboot 88
  1382. +#define __NR_readdir 89
  1383. +#define __NR_mmap 90
  1384. +#define __NR_munmap 91
  1385. +#define __NR_truncate 92
  1386. +#define __NR_ftruncate 93
  1387. +#define __NR_fchmod 94
  1388. +#define __NR_fchown 95
  1389. +#define __NR_getpriority 96
  1390. +#define __NR_setpriority 97
  1391. +#define __NR_statfs 99
  1392. +#define __NR_fstatfs 100
  1393. +#define __NR_socketcall 102
  1394. +#define __NR_syslog 103
  1395. +#define __NR_setitimer 104
  1396. +#define __NR_getitimer 105
  1397. +#define __NR_stat 106
  1398. +#define __NR_lstat 107
  1399. +#define __NR_fstat 108
  1400. +#define __NR_olduname 109
  1401. +#define __NR_vhangup 111
  1402. +#define __NR_wait4 114
  1403. +#define __NR_swapoff 115
  1404. +#define __NR_sysinfo 116
  1405. +#define __NR_ipc 117
  1406. +#define __NR_fsync 118
  1407. +#define __NR_sigreturn 119
  1408. +#define __NR_clone 120
  1409. +#define __NR_setdomainname 121
  1410. +#define __NR_uname 122
  1411. +#define __NR_cacheflush 123
  1412. +#define __NR_adjtimex 124
  1413. +#define __NR_mprotect 125
  1414. +#define __NR_sigprocmask 126
  1415. +#define __NR_init_module 128
  1416. +#define __NR_delete_module 129
  1417. +#define __NR_quotactl 131
  1418. +#define __NR_getpgid 132
  1419. +#define __NR_fchdir 133
  1420. +#define __NR_bdflush 134
  1421. +#define __NR_sysfs 135
  1422. +#define __NR_personality 136
  1423. +#define __NR_setfsuid 138
  1424. +#define __NR_setfsgid 139
  1425. +#define __NR__llseek 140
  1426. +#define __NR_getdents 141
  1427. +#define __NR__newselect 142
  1428. +#define __NR_flock 143
  1429. +#define __NR_msync 144
  1430. +#define __NR_readv 145
  1431. +#define __NR_writev 146
  1432. +#define __NR_getsid 147
  1433. +#define __NR_fdatasync 148
  1434. +#define __NR__sysctl 149
  1435. +#define __NR_mlock 150
  1436. +#define __NR_munlock 151
  1437. +#define __NR_mlockall 152
  1438. +#define __NR_munlockall 153
  1439. +#define __NR_sched_setparam 154
  1440. +#define __NR_sched_getparam 155
  1441. +#define __NR_sched_setscheduler 156
  1442. +#define __NR_sched_getscheduler 157
  1443. +#define __NR_sched_yield 158
  1444. +#define __NR_sched_get_priority_max 159
  1445. +#define __NR_sched_get_priority_min 160
  1446. +#define __NR_sched_rr_get_interval 161
  1447. +#define __NR_nanosleep 162
  1448. +#define __NR_mremap 163
  1449. +#define __NR_setresuid 164
  1450. +#define __NR_getresuid 165
  1451. +#define __NR_poll 168
  1452. +#define __NR_nfsservctl 169
  1453. +#define __NR_setresgid 170
  1454. +#define __NR_getresgid 171
  1455. +#define __NR_prctl 172
  1456. +#define __NR_rt_sigreturn 173
  1457. +#define __NR_rt_sigaction 174
  1458. +#define __NR_rt_sigprocmask 175
  1459. +#define __NR_rt_sigpending 176
  1460. +#define __NR_rt_sigtimedwait 177
  1461. +#define __NR_rt_sigqueueinfo 178
  1462. +#define __NR_rt_sigsuspend 179
  1463. +#define __NR_pread64 180
  1464. +#define __NR_pwrite64 181
  1465. +#define __NR_chown 182
  1466. +#define __NR_getcwd 183
  1467. +#define __NR_capget 184
  1468. +#define __NR_capset 185
  1469. +#define __NR_sigaltstack 186
  1470. +#define __NR_sendfile 187
  1471. +#define __NR_vfork 190
  1472. +#define __NR_ugetrlimit 191
  1473. +#define __NR_mmap2 192
  1474. +#define __NR_truncate64 193
  1475. +#define __NR_ftruncate64 194
  1476. +#define __NR_stat64 195
  1477. +#define __NR_lstat64 196
  1478. +#define __NR_fstat64 197
  1479. +#define __NR_lchown32 198
  1480. +#define __NR_getuid32 199
  1481. +#define __NR_getgid32 200
  1482. +#define __NR_geteuid32 201
  1483. +#define __NR_getegid32 202
  1484. +#define __NR_setreuid32 203
  1485. +#define __NR_setregid32 204
  1486. +#define __NR_getgroups32 205
  1487. +#define __NR_setgroups32 206
  1488. +#define __NR_fchown32 207
  1489. +#define __NR_setresuid32 208
  1490. +#define __NR_getresuid32 209
  1491. +#define __NR_setresgid32 210
  1492. +#define __NR_getresgid32 211
  1493. +#define __NR_chown32 212
  1494. +#define __NR_setuid32 213
  1495. +#define __NR_setgid32 214
  1496. +#define __NR_setfsuid32 215
  1497. +#define __NR_setfsgid32 216
  1498. +#define __NR_pivot_root 217
  1499. +#define __NR_mincore 218
  1500. +#define __NR_madvise 219
  1501. +#define __NR_getdents64 220
  1502. +#define __NR_fcntl64 221
  1503. +#define __NR_gettid 224
  1504. +#define __NR_readahead 225
  1505. +#define __NR_setxattr 226
  1506. +#define __NR_lsetxattr 227
  1507. +#define __NR_fsetxattr 228
  1508. +#define __NR_getxattr 229
  1509. +#define __NR_lgetxattr 230
  1510. +#define __NR_fgetxattr 231
  1511. +#define __NR_listxattr 232
  1512. +#define __NR_llistxattr 233
  1513. +#define __NR_flistxattr 234
  1514. +#define __NR_removexattr 235
  1515. +#define __NR_lremovexattr 236
  1516. +#define __NR_fremovexattr 237
  1517. +#define __NR_tkill 238
  1518. +#define __NR_sendfile64 239
  1519. +#define __NR_futex 240
  1520. +#define __NR_sched_setaffinity 241
  1521. +#define __NR_sched_getaffinity 242
  1522. +#define __NR_io_setup 245
  1523. +#define __NR_io_destroy 246
  1524. +#define __NR_io_getevents 247
  1525. +#define __NR_io_submit 248
  1526. +#define __NR_io_cancel 249
  1527. +#define __NR_fadvise64 250
  1528. +#define __NR_exit_group 252
  1529. +#define __NR_lookup_dcookie 253
  1530. +#define __NR_epoll_create 254
  1531. +#define __NR_epoll_ctl 255
  1532. +#define __NR_epoll_wait 256
  1533. +#define __NR_remap_file_pages 257
  1534. +#define __NR_set_tid_address 258
  1535. +#define __NR_timer_create 259
  1536. +#define __NR_timer_settime 260
  1537. +#define __NR_timer_gettime 261
  1538. +#define __NR_timer_getoverrun 262
  1539. +#define __NR_timer_delete 263
  1540. +#define __NR_clock_settime 264
  1541. +#define __NR_clock_gettime 265
  1542. +#define __NR_clock_getres 266
  1543. +#define __NR_clock_nanosleep 267
  1544. +#define __NR_statfs64 268
  1545. +#define __NR_fstatfs64 269
  1546. +#define __NR_tgkill 270
  1547. +#define __NR_utimes 271
  1548. +#define __NR_fadvise64_64 272
  1549. +#define __NR_mbind 274
  1550. +#define __NR_get_mempolicy 275
  1551. +#define __NR_set_mempolicy 276
  1552. +#define __NR_mq_open 277
  1553. +#define __NR_mq_unlink 278
  1554. +#define __NR_mq_timedsend 279
  1555. +#define __NR_mq_timedreceive 280
  1556. +#define __NR_mq_notify 281
  1557. +#define __NR_mq_getsetattr 282
  1558. +#define __NR_kexec_load 283
  1559. +#define __NR_waitid 284
  1560. +#define __NR_add_key 285
  1561. +#define __NR_request_key 286
  1562. +#define __NR_keyctl 287
  1563. +#define __NR_ioprio_set 288
  1564. +#define __NR_ioprio_get 289
  1565. +#define __NR_inotify_init 290
  1566. +#define __NR_inotify_add_watch 291
  1567. +#define __NR_inotify_rm_watch 292
  1568. +#define __NR_migrate_pages 294
  1569. +#define __NR_openat 295
  1570. +#define __NR_mkdirat 296
  1571. +#define __NR_mknodat 297
  1572. +#define __NR_fchownat 298
  1573. +#define __NR_futimesat 299
  1574. +#define __NR_fstatat64 300
  1575. +#define __NR_unlinkat 301
  1576. +#define __NR_renameat 302
  1577. +#define __NR_linkat 303
  1578. +#define __NR_symlinkat 304
  1579. +#define __NR_readlinkat 305
  1580. +#define __NR_fchmodat 306
  1581. +#define __NR_faccessat 307
  1582. +#define __NR_pselect6 308
  1583. +#define __NR_ppoll 309
  1584. +#define __NR_unshare 310
  1585. +#define __NR_set_robust_list 311
  1586. +#define __NR_get_robust_list 312
  1587. +#define __NR_splice 313
  1588. +#define __NR_sync_file_range 314
  1589. +#define __NR_tee 315
  1590. +#define __NR_vmsplice 316
  1591. +#define __NR_move_pages 317
  1592. +#define __NR_getcpu 318
  1593. +#define __NR_epoll_pwait 319
  1594. +#define __NR_utimensat 320
  1595. +#define __NR_signalfd 321
  1596. +#define __NR_timerfd_create 322
  1597. +#define __NR_eventfd 323
  1598. +#define __NR_fallocate 324
  1599. +#define __NR_timerfd_settime 325
  1600. +#define __NR_timerfd_gettime 326
  1601. +#define __NR_signalfd4 327
  1602. +#define __NR_eventfd2 328
  1603. +#define __NR_epoll_create1 329
  1604. +#define __NR_dup3 330
  1605. +#define __NR_pipe2 331
  1606. +#define __NR_inotify_init1 332
  1607. +#define __NR_preadv 333
  1608. +#define __NR_pwritev 334
  1609. +#define __NR_rt_tgsigqueueinfo 335
  1610. +#define __NR_perf_event_open 336
  1611. +#define __NR_fanotify_init 337
  1612. +#define __NR_fanotify_mark 338
  1613. +#define __NR_prlimit64 339
  1614. +#define __NR_socket 340
  1615. +#define __NR_bind 341
  1616. +#define __NR_connect 342
  1617. +#define __NR_listen 343
  1618. +#define __NR_accept 344
  1619. +#define __NR_getsockname 345
  1620. +#define __NR_getpeername 346
  1621. +#define __NR_socketpair 347
  1622. +#define __NR_send 348
  1623. +#define __NR_sendto 349
  1624. +#define __NR_recv 350
  1625. +#define __NR_recvfrom 351
  1626. +#define __NR_shutdown 352
  1627. +#define __NR_setsockopt 353
  1628. +#define __NR_getsockopt 354
  1629. +#define __NR_sendmsg 355
  1630. +#define __NR_recvmsg 356
  1631. +#define __NR_recvmmsg 357
  1632. +#define __NR_accept4 358
  1633. +#define __NR_name_to_handle_at 359
  1634. +#define __NR_open_by_handle_at 360
  1635. +#define __NR_clock_adjtime 361
  1636. +#define __NR_syncfs 362
  1637. +#define __NR_sendmmsg 363
  1638. +#define __NR_setns 364
  1639. +#define __NR_process_vm_readv 365
  1640. +#define __NR_process_vm_writev 366
  1641. +#define __NR_kcmp 367
  1642. +#define __NR_finit_module 368
  1643. +
  1644. +
  1645. +/* Repeated with SYS_ prefix */
  1646. +
  1647. +#define SYS_restart_syscall 0
  1648. +#define SYS_exit 1
  1649. +#define SYS_fork 2
  1650. +#define SYS_read 3
  1651. +#define SYS_write 4
  1652. +#define SYS_open 5
  1653. +#define SYS_close 6
  1654. +#define SYS_waitpid 7
  1655. +#define SYS_creat 8
  1656. +#define SYS_link 9
  1657. +#define SYS_unlink 10
  1658. +#define SYS_execve 11
  1659. +#define SYS_chdir 12
  1660. +#define SYS_time 13
  1661. +#define SYS_mknod 14
  1662. +#define SYS_chmod 15
  1663. +#define SYS_lchown 16
  1664. +#define SYS_oldstat 18
  1665. +#define SYS_lseek 19
  1666. +#define SYS_getpid 20
  1667. +#define SYS_mount 21
  1668. +#define SYS_umount 22
  1669. +#define SYS_setuid 23
  1670. +#define SYS_getuid 24
  1671. +#define SYS_stime 25
  1672. +#define SYS_ptrace 26
  1673. +#define SYS_alarm 27
  1674. +#define SYS_oldfstat 28
  1675. +#define SYS_pause 29
  1676. +#define SYS_utime 30
  1677. +#define SYS_access 33
  1678. +#define SYS_nice 34
  1679. +#define SYS_sync 36
  1680. +#define SYS_kill 37
  1681. +#define SYS_rename 38
  1682. +#define SYS_mkdir 39
  1683. +#define SYS_rmdir 40
  1684. +#define SYS_dup 41
  1685. +#define SYS_pipe 42
  1686. +#define SYS_times 43
  1687. +#define SYS_brk 45
  1688. +#define SYS_setgid 46
  1689. +#define SYS_getgid 47
  1690. +#define SYS_signal 48
  1691. +#define SYS_geteuid 49
  1692. +#define SYS_getegid 50
  1693. +#define SYS_acct 51
  1694. +#define SYS_umount2 52
  1695. +#define SYS_ioctl 54
  1696. +#define SYS_fcntl 55
  1697. +#define SYS_setpgid 57
  1698. +#define SYS_umask 60
  1699. +#define SYS_chroot 61
  1700. +#define SYS_ustat 62
  1701. +#define SYS_dup2 63
  1702. +#define SYS_getppid 64
  1703. +#define SYS_getpgrp 65
  1704. +#define SYS_setsid 66
  1705. +#define SYS_sigaction 67
  1706. +#define SYS_sgetmask 68
  1707. +#define SYS_ssetmask 69
  1708. +#define SYS_setreuid 70
  1709. +#define SYS_setregid 71
  1710. +#define SYS_sigsuspend 72
  1711. +#define SYS_sigpending 73
  1712. +#define SYS_sethostname 74
  1713. +#define SYS_setrlimit 75
  1714. +#define SYS_getrlimit 76
  1715. +#define SYS_getrusage 77
  1716. +#define SYS_gettimeofday 78
  1717. +#define SYS_settimeofday 79
  1718. +#define SYS_getgroups 80
  1719. +#define SYS_setgroups 81
  1720. +#define SYS_symlink 83
  1721. +#define SYS_oldlstat 84
  1722. +#define SYS_readlink 85
  1723. +#define SYS_uselib 86
  1724. +#define SYS_swapon 87
  1725. +#define SYS_reboot 88
  1726. +#define SYS_readdir 89
  1727. +#define SYS_mmap 90
  1728. +#define SYS_munmap 91
  1729. +#define SYS_truncate 92
  1730. +#define SYS_ftruncate 93
  1731. +#define SYS_fchmod 94
  1732. +#define SYS_fchown 95
  1733. +#define SYS_getpriority 96
  1734. +#define SYS_setpriority 97
  1735. +#define SYS_statfs 99
  1736. +#define SYS_fstatfs 100
  1737. +#define SYS_socketcall 102
  1738. +#define SYS_syslog 103
  1739. +#define SYS_setitimer 104
  1740. +#define SYS_getitimer 105
  1741. +#define SYS_stat 106
  1742. +#define SYS_lstat 107
  1743. +#define SYS_fstat 108
  1744. +#define SYS_olduname 109
  1745. +#define SYS_vhangup 111
  1746. +#define SYS_wait4 114
  1747. +#define SYS_swapoff 115
  1748. +#define SYS_sysinfo 116
  1749. +#define SYS_ipc 117
  1750. +#define SYS_fsync 118
  1751. +#define SYS_sigreturn 119
  1752. +#define SYS_clone 120
  1753. +#define SYS_setdomainname 121
  1754. +#define SYS_uname 122
  1755. +#define SYS_cacheflush 123
  1756. +#define SYS_adjtimex 124
  1757. +#define SYS_mprotect 125
  1758. +#define SYS_sigprocmask 126
  1759. +#define SYS_init_module 128
  1760. +#define SYS_delete_module 129
  1761. +#define SYS_quotactl 131
  1762. +#define SYS_getpgid 132
  1763. +#define SYS_fchdir 133
  1764. +#define SYS_bdflush 134
  1765. +#define SYS_sysfs 135
  1766. +#define SYS_personality 136
  1767. +#define SYS_setfsuid 138
  1768. +#define SYS_setfsgid 139
  1769. +#define SYS__llseek 140
  1770. +#define SYS_getdents 141
  1771. +#define SYS__newselect 142
  1772. +#define SYS_flock 143
  1773. +#define SYS_msync 144
  1774. +#define SYS_readv 145
  1775. +#define SYS_writev 146
  1776. +#define SYS_getsid 147
  1777. +#define SYS_fdatasync 148
  1778. +#define SYS__sysctl 149
  1779. +#define SYS_mlock 150
  1780. +#define SYS_munlock 151
  1781. +#define SYS_mlockall 152
  1782. +#define SYS_munlockall 153
  1783. +#define SYS_sched_setparam 154
  1784. +#define SYS_sched_getparam 155
  1785. +#define SYS_sched_setscheduler 156
  1786. +#define SYS_sched_getscheduler 157
  1787. +#define SYS_sched_yield 158
  1788. +#define SYS_sched_get_priority_max 159
  1789. +#define SYS_sched_get_priority_min 160
  1790. +#define SYS_sched_rr_get_interval 161
  1791. +#define SYS_nanosleep 162
  1792. +#define SYS_mremap 163
  1793. +#define SYS_setresuid 164
  1794. +#define SYS_getresuid 165
  1795. +#define SYS_poll 168
  1796. +#define SYS_nfsservctl 169
  1797. +#define SYS_setresgid 170
  1798. +#define SYS_getresgid 171
  1799. +#define SYS_prctl 172
  1800. +#define SYS_rt_sigreturn 173
  1801. +#define SYS_rt_sigaction 174
  1802. +#define SYS_rt_sigprocmask 175
  1803. +#define SYS_rt_sigpending 176
  1804. +#define SYS_rt_sigtimedwait 177
  1805. +#define SYS_rt_sigqueueinfo 178
  1806. +#define SYS_rt_sigsuspend 179
  1807. +#define SYS_pread64 180
  1808. +#define SYS_pwrite64 181
  1809. +#define SYS_chown 182
  1810. +#define SYS_getcwd 183
  1811. +#define SYS_capget 184
  1812. +#define SYS_capset 185
  1813. +#define SYS_sigaltstack 186
  1814. +#define SYS_sendfile 187
  1815. +#define SYS_vfork 190
  1816. +#define SYS_ugetrlimit 191
  1817. +#define SYS_mmap2 192
  1818. +#define SYS_truncate64 193
  1819. +#define SYS_ftruncate64 194
  1820. +#define SYS_stat64 195
  1821. +#define SYS_lstat64 196
  1822. +#define SYS_fstat64 197
  1823. +#define SYS_lchown32 198
  1824. +#define SYS_getuid32 199
  1825. +#define SYS_getgid32 200
  1826. +#define SYS_geteuid32 201
  1827. +#define SYS_getegid32 202
  1828. +#define SYS_setreuid32 203
  1829. +#define SYS_setregid32 204
  1830. +#define SYS_getgroups32 205
  1831. +#define SYS_setgroups32 206
  1832. +#define SYS_fchown32 207
  1833. +#define SYS_setresuid32 208
  1834. +#define SYS_getresuid32 209
  1835. +#define SYS_setresgid32 210
  1836. +#define SYS_getresgid32 211
  1837. +#define SYS_chown32 212
  1838. +#define SYS_setuid32 213
  1839. +#define SYS_setgid32 214
  1840. +#define SYS_setfsuid32 215
  1841. +#define SYS_setfsgid32 216
  1842. +#define SYS_pivot_root 217
  1843. +#define SYS_mincore 218
  1844. +#define SYS_madvise 219
  1845. +#define SYS_getdents64 220
  1846. +#define SYS_fcntl64 221
  1847. +#define SYS_gettid 224
  1848. +#define SYS_readahead 225
  1849. +#define SYS_setxattr 226
  1850. +#define SYS_lsetxattr 227
  1851. +#define SYS_fsetxattr 228
  1852. +#define SYS_getxattr 229
  1853. +#define SYS_lgetxattr 230
  1854. +#define SYS_fgetxattr 231
  1855. +#define SYS_listxattr 232
  1856. +#define SYS_llistxattr 233
  1857. +#define SYS_flistxattr 234
  1858. +#define SYS_removexattr 235
  1859. +#define SYS_lremovexattr 236
  1860. +#define SYS_fremovexattr 237
  1861. +#define SYS_tkill 238
  1862. +#define SYS_sendfile64 239
  1863. +#define SYS_futex 240
  1864. +#define SYS_sched_setaffinity 241
  1865. +#define SYS_sched_getaffinity 242
  1866. +#define SYS_io_setup 245
  1867. +#define SYS_io_destroy 246
  1868. +#define SYS_io_getevents 247
  1869. +#define SYS_io_submit 248
  1870. +#define SYS_io_cancel 249
  1871. +#define SYS_fadvise64 250
  1872. +#define SYS_exit_group 252
  1873. +#define SYS_lookup_dcookie 253
  1874. +#define SYS_epoll_create 254
  1875. +#define SYS_epoll_ctl 255
  1876. +#define SYS_epoll_wait 256
  1877. +#define SYS_remap_file_pages 257
  1878. +#define SYS_set_tid_address 258
  1879. +#define SYS_timer_create 259
  1880. +#define SYS_timer_settime 260
  1881. +#define SYS_timer_gettime 261
  1882. +#define SYS_timer_getoverrun 262
  1883. +#define SYS_timer_delete 263
  1884. +#define SYS_clock_settime 264
  1885. +#define SYS_clock_gettime 265
  1886. +#define SYS_clock_getres 266
  1887. +#define SYS_clock_nanosleep 267
  1888. +#define SYS_statfs64 268
  1889. +#define SYS_fstatfs64 269
  1890. +#define SYS_tgkill 270
  1891. +#define SYS_utimes 271
  1892. +#define SYS_fadvise64_64 272
  1893. +#define SYS_mbind 274
  1894. +#define SYS_get_mempolicy 275
  1895. +#define SYS_set_mempolicy 276
  1896. +#define SYS_mq_open 277
  1897. +#define SYS_mq_unlink 278
  1898. +#define SYS_mq_timedsend 279
  1899. +#define SYS_mq_timedreceive 280
  1900. +#define SYS_mq_notify 281
  1901. +#define SYS_mq_getsetattr 282
  1902. +#define SYS_kexec_load 283
  1903. +#define SYS_waitid 284
  1904. +#define SYS_add_key 285
  1905. +#define SYS_request_key 286
  1906. +#define SYS_keyctl 287
  1907. +#define SYS_ioprio_set 288
  1908. +#define SYS_ioprio_get 289
  1909. +#define SYS_inotify_init 290
  1910. +#define SYS_inotify_add_watch 291
  1911. +#define SYS_inotify_rm_watch 292
  1912. +#define SYS_migrate_pages 294
  1913. +#define SYS_openat 295
  1914. +#define SYS_mkdirat 296
  1915. +#define SYS_mknodat 297
  1916. +#define SYS_fchownat 298
  1917. +#define SYS_futimesat 299
  1918. +#define SYS_fstatat64 300
  1919. +#define SYS_unlinkat 301
  1920. +#define SYS_renameat 302
  1921. +#define SYS_linkat 303
  1922. +#define SYS_symlinkat 304
  1923. +#define SYS_readlinkat 305
  1924. +#define SYS_fchmodat 306
  1925. +#define SYS_faccessat 307
  1926. +#define SYS_pselect6 308
  1927. +#define SYS_ppoll 309
  1928. +#define SYS_unshare 310
  1929. +#define SYS_set_robust_list 311
  1930. +#define SYS_get_robust_list 312
  1931. +#define SYS_splice 313
  1932. +#define SYS_sync_file_range 314
  1933. +#define SYS_tee 315
  1934. +#define SYS_vmsplice 316
  1935. +#define SYS_move_pages 317
  1936. +#define SYS_getcpu 318
  1937. +#define SYS_epoll_pwait 319
  1938. +#define SYS_utimensat 320
  1939. +#define SYS_signalfd 321
  1940. +#define SYS_timerfd_create 322
  1941. +#define SYS_eventfd 323
  1942. +#define SYS_fallocate 324
  1943. +#define SYS_timerfd_settime 325
  1944. +#define SYS_timerfd_gettime 326
  1945. +#define SYS_signalfd4 327
  1946. +#define SYS_eventfd2 328
  1947. +#define SYS_epoll_create1 329
  1948. +#define SYS_dup3 330
  1949. +#define SYS_pipe2 331
  1950. +#define SYS_inotify_init1 332
  1951. +#define SYS_preadv 333
  1952. +#define SYS_pwritev 334
  1953. +#define SYS_rt_tgsigqueueinfo 335
  1954. +#define SYS_perf_event_open 336
  1955. +#define SYS_fanotify_init 337
  1956. +#define SYS_fanotify_mark 338
  1957. +#define SYS_prlimit64 339
  1958. +#define SYS_socket 340
  1959. +#define SYS_bind 341
  1960. +#define SYS_connect 342
  1961. +#define SYS_listen 343
  1962. +#define SYS_accept 344
  1963. +#define SYS_getsockname 345
  1964. +#define SYS_getpeername 346
  1965. +#define SYS_socketpair 347
  1966. +#define SYS_send 348
  1967. +#define SYS_sendto 349
  1968. +#define SYS_recv 350
  1969. +#define SYS_recvfrom 351
  1970. +#define SYS_shutdown 352
  1971. +#define SYS_setsockopt 353
  1972. +#define SYS_getsockopt 354
  1973. +#define SYS_sendmsg 355
  1974. +#define SYS_recvmsg 356
  1975. +#define SYS_recvmmsg 357
  1976. +#define SYS_accept4 358
  1977. +#define SYS_name_to_handle_at 359
  1978. +#define SYS_open_by_handle_at 360
  1979. +#define SYS_clock_adjtime 361
  1980. +#define SYS_syncfs 362
  1981. +#define SYS_sendmmsg 363
  1982. +#define SYS_setns 364
  1983. +#define SYS_process_vm_readv 365
  1984. +#define SYS_process_vm_writev 366
  1985. +#define SYS_kcmp 367
  1986. +#define SYS_finit_module 368
  1987. diff -Nur musl-0.9.15/arch/superh/bits/termios.h musl-git/arch/superh/bits/termios.h
  1988. --- musl-0.9.15/arch/superh/bits/termios.h 1970-01-01 01:00:00.000000000 +0100
  1989. +++ musl-git/arch/superh/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  1990. @@ -0,0 +1,160 @@
  1991. +struct termios
  1992. +{
  1993. + tcflag_t c_iflag;
  1994. + tcflag_t c_oflag;
  1995. + tcflag_t c_cflag;
  1996. + tcflag_t c_lflag;
  1997. + cc_t c_line;
  1998. + cc_t c_cc[NCCS];
  1999. + speed_t __c_ispeed;
  2000. + speed_t __c_ospeed;
  2001. +};
  2002. +
  2003. +#define VINTR 0
  2004. +#define VQUIT 1
  2005. +#define VERASE 2
  2006. +#define VKILL 3
  2007. +#define VEOF 4
  2008. +#define VTIME 5
  2009. +#define VMIN 6
  2010. +#define VSWTC 7
  2011. +#define VSTART 8
  2012. +#define VSTOP 9
  2013. +#define VSUSP 10
  2014. +#define VEOL 11
  2015. +#define VREPRINT 12
  2016. +#define VDISCARD 13
  2017. +#define VWERASE 14
  2018. +#define VLNEXT 15
  2019. +#define VEOL2 16
  2020. +
  2021. +#define IGNBRK 0000001
  2022. +#define BRKINT 0000002
  2023. +#define IGNPAR 0000004
  2024. +#define PARMRK 0000010
  2025. +#define INPCK 0000020
  2026. +#define ISTRIP 0000040
  2027. +#define INLCR 0000100
  2028. +#define IGNCR 0000200
  2029. +#define ICRNL 0000400
  2030. +#define IUCLC 0001000
  2031. +#define IXON 0002000
  2032. +#define IXANY 0004000
  2033. +#define IXOFF 0010000
  2034. +#define IMAXBEL 0020000
  2035. +#define IUTF8 0040000
  2036. +
  2037. +#define OPOST 0000001
  2038. +#define OLCUC 0000002
  2039. +#define ONLCR 0000004
  2040. +#define OCRNL 0000010
  2041. +#define ONOCR 0000020
  2042. +#define ONLRET 0000040
  2043. +#define OFILL 0000100
  2044. +#define OFDEL 0000200
  2045. +#define NLDLY 0000400
  2046. +#define NL0 0000000
  2047. +#define NL1 0000400
  2048. +#define CRDLY 0003000
  2049. +#define CR0 0000000
  2050. +#define CR1 0001000
  2051. +#define CR2 0002000
  2052. +#define CR3 0003000
  2053. +#define TABDLY 0014000
  2054. +#define TAB0 0000000
  2055. +#define TAB1 0004000
  2056. +#define TAB2 0010000
  2057. +#define TAB3 0014000
  2058. +#define BSDLY 0020000
  2059. +#define BS0 0000000
  2060. +#define BS1 0020000
  2061. +#define FFDLY 0100000
  2062. +#define FF0 0000000
  2063. +#define FF1 0100000
  2064. +
  2065. +#define VTDLY 0040000
  2066. +#define VT0 0000000
  2067. +#define VT1 0040000
  2068. +
  2069. +#define B0 0000000
  2070. +#define B50 0000001
  2071. +#define B75 0000002
  2072. +#define B110 0000003
  2073. +#define B134 0000004
  2074. +#define B150 0000005
  2075. +#define B200 0000006
  2076. +#define B300 0000007
  2077. +#define B600 0000010
  2078. +#define B1200 0000011
  2079. +#define B1800 0000012
  2080. +#define B2400 0000013
  2081. +#define B4800 0000014
  2082. +#define B9600 0000015
  2083. +#define B19200 0000016
  2084. +#define B38400 0000017
  2085. +
  2086. +#define B57600 0010001
  2087. +#define B115200 0010002
  2088. +#define B230400 0010003
  2089. +#define B460800 0010004
  2090. +#define B500000 0010005
  2091. +#define B576000 0010006
  2092. +#define B921600 0010007
  2093. +#define B1000000 0010010
  2094. +#define B1152000 0010011
  2095. +#define B1500000 0010012
  2096. +#define B2000000 0010013
  2097. +#define B2500000 0010014
  2098. +#define B3000000 0010015
  2099. +#define B3500000 0010016
  2100. +#define B4000000 0010017
  2101. +
  2102. +#define CBAUD 0010017
  2103. +
  2104. +#define CSIZE 0000060
  2105. +#define CS5 0000000
  2106. +#define CS6 0000020
  2107. +#define CS7 0000040
  2108. +#define CS8 0000060
  2109. +#define CSTOPB 0000100
  2110. +#define CREAD 0000200
  2111. +#define PARENB 0000400
  2112. +#define PARODD 0001000
  2113. +#define HUPCL 0002000
  2114. +#define CLOCAL 0004000
  2115. +
  2116. +#define ISIG 0000001
  2117. +#define ICANON 0000002
  2118. +#define ECHO 0000010
  2119. +#define ECHOE 0000020
  2120. +#define ECHOK 0000040
  2121. +#define ECHONL 0000100
  2122. +#define NOFLSH 0000200
  2123. +#define TOSTOP 0000400
  2124. +#define IEXTEN 0100000
  2125. +
  2126. +#define ECHOCTL 0001000
  2127. +#define ECHOPRT 0002000
  2128. +#define ECHOKE 0004000
  2129. +#define FLUSHO 0010000
  2130. +#define PENDIN 0040000
  2131. +
  2132. +#define TCOOFF 0
  2133. +#define TCOON 1
  2134. +#define TCIOFF 2
  2135. +#define TCION 3
  2136. +
  2137. +#define TCIFLUSH 0
  2138. +#define TCOFLUSH 1
  2139. +#define TCIOFLUSH 2
  2140. +
  2141. +#define TCSANOW 0
  2142. +#define TCSADRAIN 1
  2143. +#define TCSAFLUSH 2
  2144. +
  2145. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  2146. +#define CBAUDEX 0010000
  2147. +#define CRTSCTS 020000000000
  2148. +#define EXTPROC 0200000
  2149. +#define XTABS 0014000
  2150. +#endif
  2151. diff -Nur musl-0.9.15/arch/superh/crt_arch.h musl-git/arch/superh/crt_arch.h
  2152. --- musl-0.9.15/arch/superh/crt_arch.h 1970-01-01 01:00:00.000000000 +0100
  2153. +++ musl-git/arch/superh/crt_arch.h 2014-02-25 15:24:14.000000000 +0100
  2154. @@ -0,0 +1,9 @@
  2155. +__asm__("\
  2156. +.global _start \n\
  2157. +_start: \n\
  2158. + mov r15, r4 \n\
  2159. + mov #-16, r0 \n\
  2160. + and r0, r15 \n\
  2161. + bsr __cstart \n\
  2162. + nop \n\
  2163. +");
  2164. diff -Nur musl-0.9.15/arch/superh/pthread_arch.h musl-git/arch/superh/pthread_arch.h
  2165. --- musl-0.9.15/arch/superh/pthread_arch.h 1970-01-01 01:00:00.000000000 +0100
  2166. +++ musl-git/arch/superh/pthread_arch.h 2014-02-25 15:24:14.000000000 +0100
  2167. @@ -0,0 +1,11 @@
  2168. +static inline struct pthread *__pthread_self()
  2169. +{
  2170. + char *self;
  2171. + __asm__ __volatile__ ("stc gbr,%0" : "=r" (self) );
  2172. + return (struct pthread *) (self + 8 - sizeof(struct pthread));
  2173. +}
  2174. +
  2175. +#define TLS_ABOVE_TP
  2176. +#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
  2177. +
  2178. +#define CANCEL_REG_IP 17
  2179. diff -Nur musl-0.9.15/arch/superh/reloc.h musl-git/arch/superh/reloc.h
  2180. --- musl-0.9.15/arch/superh/reloc.h 1970-01-01 01:00:00.000000000 +0100
  2181. +++ musl-git/arch/superh/reloc.h 2014-02-25 15:24:14.000000000 +0100
  2182. @@ -0,0 +1,47 @@
  2183. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  2184. +#define ENDIAN_SUFFIX "l"
  2185. +#else
  2186. +#define ENDIAN_SUFFIX ""
  2187. +#endif
  2188. +
  2189. +#define LDSO_ARCH "sh" ENDIAN_SUFFIX
  2190. +
  2191. +#define IS_COPY(x) ((x) == R_SH_COPY)
  2192. +#define IS_PLT(x) ((x) == R_SH_JMP_SLOT)
  2193. +
  2194. +static inline void do_single_reloc(
  2195. + struct dso *self, unsigned char *base_addr,
  2196. + size_t *reloc_addr, int type, size_t addend,
  2197. + Sym *sym, size_t sym_size,
  2198. + struct symdef def, size_t sym_val)
  2199. +{
  2200. + switch(type) {
  2201. + case R_SH_GLOB_DAT:
  2202. + case R_SH_JMP_SLOT:
  2203. + *reloc_addr = sym_val;
  2204. + break;
  2205. + case R_SH_RELATIVE:
  2206. + *reloc_addr = (size_t)base_addr + addend;
  2207. + break;
  2208. + case R_SH_DIR32:
  2209. + *reloc_addr = sym_val + addend;
  2210. + break;
  2211. + case R_SH_REL32:
  2212. + *reloc_addr = sym_val + addend - (size_t)reloc_addr + (size_t)base_addr;
  2213. + break;
  2214. + case R_SH_COPY:
  2215. + memcpy(reloc_addr, (void *)sym_val, sym_size);
  2216. + break;
  2217. + case R_SH_TLS_DTPMOD32:
  2218. + *reloc_addr += def.dso ? def.dso->tls_id : self->tls_id;
  2219. + break;
  2220. + case R_SH_TLS_DTPOFF32:
  2221. + *reloc_addr += def.sym->st_value;
  2222. + break;
  2223. + case R_SH_TLS_TPOFF32:
  2224. + *reloc_addr += def.sym
  2225. + ? def.sym->st_value + def.dso->tls_offset + 8
  2226. + : self->tls_offset + 8;
  2227. + break;
  2228. + }
  2229. +}
  2230. diff -Nur musl-0.9.15/arch/superh/src/atomic.c musl-git/arch/superh/src/atomic.c
  2231. --- musl-0.9.15/arch/superh/src/atomic.c 1970-01-01 01:00:00.000000000 +0100
  2232. +++ musl-git/arch/superh/src/atomic.c 2014-02-25 15:24:14.000000000 +0100
  2233. @@ -0,0 +1,146 @@
  2234. +#include "libc.h"
  2235. +
  2236. +#define LLSC_CLOBBERS "r0", "t", "memory"
  2237. +#define LLSC_START(mem) \
  2238. + "0: movli.l @" mem ", r0\n"
  2239. +#define LLSC_END(mem) \
  2240. + "1: movco.l r0, @" mem "\n" \
  2241. + " bf 0b\n" \
  2242. + " synco\n"
  2243. +
  2244. +/* gusa is a hack in the kernel which lets you create a sequence of instructions
  2245. + * which will be restarted if the process is preempted in the middle of the
  2246. + * sequence. It will do for implementing atomics on non-smp systems. ABI is:
  2247. + * r0 = address of first instruction after the atomic sequence
  2248. + * r1 = original stack pointer
  2249. + * r15 = -1 * length of atomic sequence in bytes
  2250. + */
  2251. +#define GUSA_CLOBBERS "r0", "r1", "memory"
  2252. +#define GUSA_START(mem,old,nop) \
  2253. + " .align 2\n" \
  2254. + " mova 1f, r0\n" \
  2255. + nop \
  2256. + " mov r15, r1\n" \
  2257. + " mov #(0f-1f), r15\n" \
  2258. + "0: mov.l @" mem ", " old "\n"
  2259. +/* the target of mova must be 4 byte aligned, so we may need a nop */
  2260. +#define GUSA_START_ODD(mem,old) GUSA_START(mem,old,"")
  2261. +#define GUSA_START_EVEN(mem,old) GUSA_START(mem,old,"\tnop\n")
  2262. +#define GUSA_END(mem,new) \
  2263. + " mov.l " new ", @" mem "\n" \
  2264. + "1: mov r1, r15\n"
  2265. +
  2266. +#define CPU_HAS_LLSC 0x0040
  2267. +
  2268. +int __sh_cas(volatile int *p, int t, int s)
  2269. +{
  2270. + int old;
  2271. + if (__hwcap & CPU_HAS_LLSC) {
  2272. + __asm__ __volatile__(
  2273. + LLSC_START("%1")
  2274. + " mov r0, %0\n"
  2275. + " cmp/eq %0, %2\n"
  2276. + " bf 1f\n"
  2277. + " mov %3, r0\n"
  2278. + LLSC_END("%1")
  2279. + : "=&r"(old) : "r"(p), "r"(t), "r"(s) : LLSC_CLOBBERS);
  2280. + } else {
  2281. + __asm__ __volatile__(
  2282. + GUSA_START_EVEN("%1", "%0")
  2283. + " cmp/eq %0, %2\n"
  2284. + " bf 1f\n"
  2285. + GUSA_END("%1", "%3")
  2286. + : "=&r"(old) : "r"(p), "r"(t), "r"(s) : GUSA_CLOBBERS, "t");
  2287. + }
  2288. + return old;
  2289. +}
  2290. +
  2291. +int __sh_swap(volatile int *x, int v)
  2292. +{
  2293. + int old;
  2294. + if (__hwcap & CPU_HAS_LLSC) {
  2295. + __asm__ __volatile__(
  2296. + LLSC_START("%1")
  2297. + " mov r0, %0\n"
  2298. + " mov %2, r0\n"
  2299. + LLSC_END("%1")
  2300. + : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2301. + } else {
  2302. + __asm__ __volatile__(
  2303. + GUSA_START_EVEN("%1", "%0")
  2304. + GUSA_END("%1", "%2")
  2305. + : "=&r"(old) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2306. + }
  2307. + return old;
  2308. +}
  2309. +
  2310. +int __sh_fetch_add(volatile int *x, int v)
  2311. +{
  2312. + int old, dummy;
  2313. + if (__hwcap & CPU_HAS_LLSC) {
  2314. + __asm__ __volatile__(
  2315. + LLSC_START("%1")
  2316. + " mov r0, %0\n"
  2317. + " add %2, r0\n"
  2318. + LLSC_END("%1")
  2319. + : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2320. + } else {
  2321. + __asm__ __volatile__(
  2322. + GUSA_START_EVEN("%2", "%0")
  2323. + " mov %0, %1\n"
  2324. + " add %3, %1\n"
  2325. + GUSA_END("%2", "%1")
  2326. + : "=&r"(old), "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2327. + }
  2328. + return old;
  2329. +}
  2330. +
  2331. +void __sh_store(volatile int *p, int x)
  2332. +{
  2333. + if (__hwcap & CPU_HAS_LLSC) {
  2334. + __asm__ __volatile__(
  2335. + " mov.l %1, @%0\n"
  2336. + " synco\n"
  2337. + : : "r"(p), "r"(x) : "memory");
  2338. + } else {
  2339. + __asm__ __volatile__(
  2340. + " mov.l %1, @%0\n"
  2341. + : : "r"(p), "r"(x) : "memory");
  2342. + }
  2343. +}
  2344. +
  2345. +void __sh_and(volatile int *x, int v)
  2346. +{
  2347. + int dummy;
  2348. + if (__hwcap & CPU_HAS_LLSC) {
  2349. + __asm__ __volatile__(
  2350. + LLSC_START("%0")
  2351. + " and %1, r0\n"
  2352. + LLSC_END("%0")
  2353. + : : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2354. + } else {
  2355. + __asm__ __volatile__(
  2356. + GUSA_START_ODD("%1", "%0")
  2357. + " and %2, %0\n"
  2358. + GUSA_END("%1", "%0")
  2359. + : "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2360. + }
  2361. +}
  2362. +
  2363. +void __sh_or(volatile int *x, int v)
  2364. +{
  2365. + int dummy;
  2366. + if (__hwcap & CPU_HAS_LLSC) {
  2367. + __asm__ __volatile__(
  2368. + LLSC_START("%0")
  2369. + " or %1, r0\n"
  2370. + LLSC_END("%0")
  2371. + : : "r"(x), "r"(v) : LLSC_CLOBBERS);
  2372. + } else {
  2373. + __asm__ __volatile__(
  2374. + GUSA_START_ODD("%1", "%0")
  2375. + " or %2, %0\n"
  2376. + GUSA_END("%1", "%0")
  2377. + : "=&r"(dummy) : "r"(x), "r"(v) : GUSA_CLOBBERS);
  2378. + }
  2379. +}
  2380. diff -Nur musl-0.9.15/arch/superh/src/__fpsrc_values.c musl-git/arch/superh/src/__fpsrc_values.c
  2381. --- musl-0.9.15/arch/superh/src/__fpsrc_values.c 1970-01-01 01:00:00.000000000 +0100
  2382. +++ musl-git/arch/superh/src/__fpsrc_values.c 2014-02-25 15:24:14.000000000 +0100
  2383. @@ -0,0 +1,2 @@
  2384. +/* used by gcc for switching the FPU between single and double precision */
  2385. +const unsigned long __fpscr_values[2] = { 0, 0x80000 };
  2386. diff -Nur musl-0.9.15/arch/superh/syscall_arch.h musl-git/arch/superh/syscall_arch.h
  2387. --- musl-0.9.15/arch/superh/syscall_arch.h 1970-01-01 01:00:00.000000000 +0100
  2388. +++ musl-git/arch/superh/syscall_arch.h 2014-02-25 15:24:14.000000000 +0100
  2389. @@ -0,0 +1,87 @@
  2390. +#define __SYSCALL_LL_E(x) \
  2391. +((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
  2392. +((union { long long ll; long l[2]; }){ .ll = x }).l[1]
  2393. +#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
  2394. +
  2395. +/* The extra OR instructions are to work around a hardware bug:
  2396. + * http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf
  2397. + */
  2398. +#define __asm_syscall(trapno, ...) do { \
  2399. + __asm__ __volatile__ ( \
  2400. + "trapa #" #trapno "\n" \
  2401. + "or r0, r0\n" \
  2402. + "or r0, r0\n" \
  2403. + "or r0, r0\n" \
  2404. + "or r0, r0\n" \
  2405. + "or r0, r0\n" \
  2406. + : "=r"(r0) : __VA_ARGS__ : "memory"); \
  2407. + return r0; \
  2408. + } while (0)
  2409. +
  2410. +static inline long __syscall0(long n)
  2411. +{
  2412. + register long r3 __asm__("r3") = n;
  2413. + register long r0 __asm__("r0");
  2414. + __asm_syscall(16, "r"(r3));
  2415. +}
  2416. +
  2417. +static inline long __syscall1(long n, long a)
  2418. +{
  2419. + register long r3 __asm__("r3") = n;
  2420. + register long r4 __asm__("r4") = a;
  2421. + register long r0 __asm__("r0");
  2422. + __asm_syscall(17, "r"(r3), "r"(r4));
  2423. +}
  2424. +
  2425. +static inline long __syscall2(long n, long a, long b)
  2426. +{
  2427. + register long r3 __asm__("r3") = n;
  2428. + register long r4 __asm__("r4") = a;
  2429. + register long r5 __asm__("r5") = b;
  2430. + register long r0 __asm__("r0");
  2431. + __asm_syscall(18, "r"(r3), "r"(r4), "r"(r5));
  2432. +}
  2433. +
  2434. +static inline long __syscall3(long n, long a, long b, long c)
  2435. +{
  2436. + register long r3 __asm__("r3") = n;
  2437. + register long r4 __asm__("r4") = a;
  2438. + register long r5 __asm__("r5") = b;
  2439. + register long r6 __asm__("r6") = c;
  2440. + register long r0 __asm__("r0");
  2441. + __asm_syscall(19, "r"(r3), "r"(r4), "r"(r5), "r"(r6));
  2442. +}
  2443. +
  2444. +static inline long __syscall4(long n, long a, long b, long c, long d)
  2445. +{
  2446. + register long r3 __asm__("r3") = n;
  2447. + register long r4 __asm__("r4") = a;
  2448. + register long r5 __asm__("r5") = b;
  2449. + register long r6 __asm__("r6") = c;
  2450. + register long r7 __asm__("r7") = d;
  2451. + register long r0 __asm__("r0");
  2452. + __asm_syscall(20, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7));
  2453. +}
  2454. +
  2455. +static inline long __syscall5(long n, long a, long b, long c, long d, long e)
  2456. +{
  2457. + register long r3 __asm__("r3") = n;
  2458. + register long r4 __asm__("r4") = a;
  2459. + register long r5 __asm__("r5") = b;
  2460. + register long r6 __asm__("r6") = c;
  2461. + register long r7 __asm__("r7") = d;
  2462. + register long r0 __asm__("r0") = e;
  2463. + __asm_syscall(21, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0));
  2464. +}
  2465. +
  2466. +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
  2467. +{
  2468. + register long r3 __asm__("r3") = n;
  2469. + register long r4 __asm__("r4") = a;
  2470. + register long r5 __asm__("r5") = b;
  2471. + register long r6 __asm__("r6") = c;
  2472. + register long r7 __asm__("r7") = d;
  2473. + register long r0 __asm__("r0") = e;
  2474. + register long r1 __asm__("r1") = f;
  2475. + __asm_syscall(22, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0), "r"(r1));
  2476. +}
  2477. diff -Nur musl-0.9.15/arch/x32/atomic.h musl-git/arch/x32/atomic.h
  2478. --- musl-0.9.15/arch/x32/atomic.h 1970-01-01 01:00:00.000000000 +0100
  2479. +++ musl-git/arch/x32/atomic.h 2014-02-25 15:24:14.000000000 +0100
  2480. @@ -0,0 +1,125 @@
  2481. +#ifndef _INTERNAL_ATOMIC_H
  2482. +#define _INTERNAL_ATOMIC_H
  2483. +
  2484. +#include <stdint.h>
  2485. +
  2486. +static inline int a_ctz_64(uint64_t x)
  2487. +{
  2488. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  2489. + return x;
  2490. +}
  2491. +
  2492. +static inline int a_ctz_l(unsigned long x)
  2493. +{
  2494. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  2495. + return x;
  2496. +}
  2497. +
  2498. +static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  2499. +{
  2500. + __asm__( "lock ; and %1, %0"
  2501. + : "=m"(*p) : "r"(v) : "memory" );
  2502. +}
  2503. +
  2504. +static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  2505. +{
  2506. + __asm__( "lock ; or %1, %0"
  2507. + : "=m"(*p) : "r"(v) : "memory" );
  2508. +}
  2509. +
  2510. +static inline void a_store_l(volatile void *p, long x)
  2511. +{
  2512. + __asm__( "mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  2513. +}
  2514. +
  2515. +static inline void a_or_l(volatile void *p, long v)
  2516. +{
  2517. + __asm__( "lock ; or %1, %0"
  2518. + : "=m"(*(long *)p) : "r"(v) : "memory" );
  2519. +}
  2520. +
  2521. +static inline void *a_cas_p(volatile void *p, void *t, void *s)
  2522. +{
  2523. + __asm__( "lock ; cmpxchg %3, %1"
  2524. + : "=a"(t), "=m"(*(long *)p) : "a"(t), "r"(s) : "memory" );
  2525. + return t;
  2526. +}
  2527. +
  2528. +static inline long a_cas_l(volatile void *p, long t, long s)
  2529. +{
  2530. + __asm__( "lock ; cmpxchg %3, %1"
  2531. + : "=a"(t), "=m"(*(long *)p) : "a"(t), "r"(s) : "memory" );
  2532. + return t;
  2533. +}
  2534. +
  2535. +static inline int a_cas(volatile int *p, int t, int s)
  2536. +{
  2537. + __asm__( "lock ; cmpxchg %3, %1"
  2538. + : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
  2539. + return t;
  2540. +}
  2541. +
  2542. +static inline void *a_swap_p(void *volatile *x, void *v)
  2543. +{
  2544. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*(void **)x) : "0"(v) : "memory" );
  2545. + return v;
  2546. +}
  2547. +static inline long a_swap_l(volatile void *x, long v)
  2548. +{
  2549. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*(long *)x) : "0"(v) : "memory" );
  2550. + return v;
  2551. +}
  2552. +
  2553. +static inline void a_or(volatile void *p, int v)
  2554. +{
  2555. + __asm__( "lock ; or %1, %0"
  2556. + : "=m"(*(int *)p) : "r"(v) : "memory" );
  2557. +}
  2558. +
  2559. +static inline void a_and(volatile void *p, int v)
  2560. +{
  2561. + __asm__( "lock ; and %1, %0"
  2562. + : "=m"(*(int *)p) : "r"(v) : "memory" );
  2563. +}
  2564. +
  2565. +static inline int a_swap(volatile int *x, int v)
  2566. +{
  2567. + __asm__( "xchg %0, %1" : "=r"(v), "=m"(*x) : "0"(v) : "memory" );
  2568. + return v;
  2569. +}
  2570. +
  2571. +#define a_xchg a_swap
  2572. +
  2573. +static inline int a_fetch_add(volatile int *x, int v)
  2574. +{
  2575. + __asm__( "lock ; xadd %0, %1" : "=r"(v), "=m"(*x) : "0"(v) : "memory" );
  2576. + return v;
  2577. +}
  2578. +
  2579. +static inline void a_inc(volatile int *x)
  2580. +{
  2581. + __asm__( "lock ; incl %0" : "=m"(*x) : "m"(*x) : "memory" );
  2582. +}
  2583. +
  2584. +static inline void a_dec(volatile int *x)
  2585. +{
  2586. + __asm__( "lock ; decl %0" : "=m"(*x) : "m"(*x) : "memory" );
  2587. +}
  2588. +
  2589. +static inline void a_store(volatile int *p, int x)
  2590. +{
  2591. + __asm__( "mov %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  2592. +}
  2593. +
  2594. +static inline void a_spin()
  2595. +{
  2596. + __asm__ __volatile__( "pause" : : : "memory" );
  2597. +}
  2598. +
  2599. +static inline void a_crash()
  2600. +{
  2601. + __asm__ __volatile__( "hlt" : : : "memory" );
  2602. +}
  2603. +
  2604. +
  2605. +#endif
  2606. diff -Nur musl-0.9.15/arch/x32/bits/alltypes.h.in musl-git/arch/x32/bits/alltypes.h.in
  2607. --- musl-0.9.15/arch/x32/bits/alltypes.h.in 1970-01-01 01:00:00.000000000 +0100
  2608. +++ musl-git/arch/x32/bits/alltypes.h.in 2014-02-25 15:24:14.000000000 +0100
  2609. @@ -0,0 +1,28 @@
  2610. +#define _Addr int
  2611. +#define _Int64 long long
  2612. +#define _Reg long long
  2613. +
  2614. +TYPEDEF __builtin_va_list va_list;
  2615. +TYPEDEF __builtin_va_list __isoc_va_list;
  2616. +
  2617. +#ifndef __cplusplus
  2618. +TYPEDEF long wchar_t;
  2619. +#endif
  2620. +TYPEDEF unsigned wint_t;
  2621. +
  2622. +#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
  2623. +TYPEDEF long double float_t;
  2624. +TYPEDEF long double double_t;
  2625. +#else
  2626. +TYPEDEF float float_t;
  2627. +TYPEDEF double double_t;
  2628. +#endif
  2629. +
  2630. +TYPEDEF long long time_t;
  2631. +TYPEDEF long long suseconds_t;
  2632. +
  2633. +TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
  2634. +TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t;
  2635. +TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t;
  2636. +TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t;
  2637. +TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t;
  2638. diff -Nur musl-0.9.15/arch/x32/bits/endian.h musl-git/arch/x32/bits/endian.h
  2639. --- musl-0.9.15/arch/x32/bits/endian.h 1970-01-01 01:00:00.000000000 +0100
  2640. +++ musl-git/arch/x32/bits/endian.h 2014-02-25 15:24:14.000000000 +0100
  2641. @@ -0,0 +1 @@
  2642. +#define __BYTE_ORDER __LITTLE_ENDIAN
  2643. diff -Nur musl-0.9.15/arch/x32/bits/errno.h musl-git/arch/x32/bits/errno.h
  2644. --- musl-0.9.15/arch/x32/bits/errno.h 1970-01-01 01:00:00.000000000 +0100
  2645. +++ musl-git/arch/x32/bits/errno.h 2014-02-25 15:24:14.000000000 +0100
  2646. @@ -0,0 +1,134 @@
  2647. +#define EPERM 1
  2648. +#define ENOENT 2
  2649. +#define ESRCH 3
  2650. +#define EINTR 4
  2651. +#define EIO 5
  2652. +#define ENXIO 6
  2653. +#define E2BIG 7
  2654. +#define ENOEXEC 8
  2655. +#define EBADF 9
  2656. +#define ECHILD 10
  2657. +#define EAGAIN 11
  2658. +#define ENOMEM 12
  2659. +#define EACCES 13
  2660. +#define EFAULT 14
  2661. +#define ENOTBLK 15
  2662. +#define EBUSY 16
  2663. +#define EEXIST 17
  2664. +#define EXDEV 18
  2665. +#define ENODEV 19
  2666. +#define ENOTDIR 20
  2667. +#define EISDIR 21
  2668. +#define EINVAL 22
  2669. +#define ENFILE 23
  2670. +#define EMFILE 24
  2671. +#define ENOTTY 25
  2672. +#define ETXTBSY 26
  2673. +#define EFBIG 27
  2674. +#define ENOSPC 28
  2675. +#define ESPIPE 29
  2676. +#define EROFS 30
  2677. +#define EMLINK 31
  2678. +#define EPIPE 32
  2679. +#define EDOM 33
  2680. +#define ERANGE 34
  2681. +#define EDEADLK 35
  2682. +#define ENAMETOOLONG 36
  2683. +#define ENOLCK 37
  2684. +#define ENOSYS 38
  2685. +#define ENOTEMPTY 39
  2686. +#define ELOOP 40
  2687. +#define EWOULDBLOCK EAGAIN
  2688. +#define ENOMSG 42
  2689. +#define EIDRM 43
  2690. +#define ECHRNG 44
  2691. +#define EL2NSYNC 45
  2692. +#define EL3HLT 46
  2693. +#define EL3RST 47
  2694. +#define ELNRNG 48
  2695. +#define EUNATCH 49
  2696. +#define ENOCSI 50
  2697. +#define EL2HLT 51
  2698. +#define EBADE 52
  2699. +#define EBADR 53
  2700. +#define EXFULL 54
  2701. +#define ENOANO 55
  2702. +#define EBADRQC 56
  2703. +#define EBADSLT 57
  2704. +#define EDEADLOCK EDEADLK
  2705. +#define EBFONT 59
  2706. +#define ENOSTR 60
  2707. +#define ENODATA 61
  2708. +#define ETIME 62
  2709. +#define ENOSR 63
  2710. +#define ENONET 64
  2711. +#define ENOPKG 65
  2712. +#define EREMOTE 66
  2713. +#define ENOLINK 67
  2714. +#define EADV 68
  2715. +#define ESRMNT 69
  2716. +#define ECOMM 70
  2717. +#define EPROTO 71
  2718. +#define EMULTIHOP 72
  2719. +#define EDOTDOT 73
  2720. +#define EBADMSG 74
  2721. +#define EOVERFLOW 75
  2722. +#define ENOTUNIQ 76
  2723. +#define EBADFD 77
  2724. +#define EREMCHG 78
  2725. +#define ELIBACC 79
  2726. +#define ELIBBAD 80
  2727. +#define ELIBSCN 81
  2728. +#define ELIBMAX 82
  2729. +#define ELIBEXEC 83
  2730. +#define EILSEQ 84
  2731. +#define ERESTART 85
  2732. +#define ESTRPIPE 86
  2733. +#define EUSERS 87
  2734. +#define ENOTSOCK 88
  2735. +#define EDESTADDRREQ 89
  2736. +#define EMSGSIZE 90
  2737. +#define EPROTOTYPE 91
  2738. +#define ENOPROTOOPT 92
  2739. +#define EPROTONOSUPPORT 93
  2740. +#define ESOCKTNOSUPPORT 94
  2741. +#define EOPNOTSUPP 95
  2742. +#define ENOTSUP EOPNOTSUPP
  2743. +#define EPFNOSUPPORT 96
  2744. +#define EAFNOSUPPORT 97
  2745. +#define EADDRINUSE 98
  2746. +#define EADDRNOTAVAIL 99
  2747. +#define ENETDOWN 100
  2748. +#define ENETUNREACH 101
  2749. +#define ENETRESET 102
  2750. +#define ECONNABORTED 103
  2751. +#define ECONNRESET 104
  2752. +#define ENOBUFS 105
  2753. +#define EISCONN 106
  2754. +#define ENOTCONN 107
  2755. +#define ESHUTDOWN 108
  2756. +#define ETOOMANYREFS 109
  2757. +#define ETIMEDOUT 110
  2758. +#define ECONNREFUSED 111
  2759. +#define EHOSTDOWN 112
  2760. +#define EHOSTUNREACH 113
  2761. +#define EALREADY 114
  2762. +#define EINPROGRESS 115
  2763. +#define ESTALE 116
  2764. +#define EUCLEAN 117
  2765. +#define ENOTNAM 118
  2766. +#define ENAVAIL 119
  2767. +#define EISNAM 120
  2768. +#define EREMOTEIO 121
  2769. +#define EDQUOT 122
  2770. +#define ENOMEDIUM 123
  2771. +#define EMEDIUMTYPE 124
  2772. +#define ECANCELED 125
  2773. +#define ENOKEY 126
  2774. +#define EKEYEXPIRED 127
  2775. +#define EKEYREVOKED 128
  2776. +#define EKEYREJECTED 129
  2777. +#define EOWNERDEAD 130
  2778. +#define ENOTRECOVERABLE 131
  2779. +#define ERFKILL 132
  2780. +#define EHWPOISON 133
  2781. diff -Nur musl-0.9.15/arch/x32/bits/fcntl.h musl-git/arch/x32/bits/fcntl.h
  2782. --- musl-0.9.15/arch/x32/bits/fcntl.h 1970-01-01 01:00:00.000000000 +0100
  2783. +++ musl-git/arch/x32/bits/fcntl.h 2014-02-25 15:24:14.000000000 +0100
  2784. @@ -0,0 +1,39 @@
  2785. +#define O_CREAT 0100
  2786. +#define O_EXCL 0200
  2787. +#define O_NOCTTY 0400
  2788. +#define O_TRUNC 01000
  2789. +#define O_APPEND 02000
  2790. +#define O_NONBLOCK 04000
  2791. +#define O_DSYNC 010000
  2792. +#define O_SYNC 04010000
  2793. +#define O_RSYNC 04010000
  2794. +#define O_DIRECTORY 0200000
  2795. +#define O_NOFOLLOW 0400000
  2796. +#define O_CLOEXEC 02000000
  2797. +
  2798. +#define O_ASYNC 020000
  2799. +#define O_DIRECT 040000
  2800. +#define O_LARGEFILE 0
  2801. +#define O_NOATIME 01000000
  2802. +#define O_TMPFILE 020200000
  2803. +#define O_NDELAY O_NONBLOCK
  2804. +
  2805. +#define F_DUPFD 0
  2806. +#define F_GETFD 1
  2807. +#define F_SETFD 2
  2808. +#define F_GETFL 3
  2809. +#define F_SETFL 4
  2810. +
  2811. +#define F_SETOWN 8
  2812. +#define F_GETOWN 9
  2813. +#define F_SETSIG 10
  2814. +#define F_GETSIG 11
  2815. +
  2816. +#define F_GETLK 5
  2817. +#define F_SETLK 6
  2818. +#define F_SETLKW 7
  2819. +
  2820. +#define F_SETOWN_EX 15
  2821. +#define F_GETOWN_EX 16
  2822. +
  2823. +#define F_GETOWNER_UIDS 17
  2824. diff -Nur musl-0.9.15/arch/x32/bits/fenv.h musl-git/arch/x32/bits/fenv.h
  2825. --- musl-0.9.15/arch/x32/bits/fenv.h 1970-01-01 01:00:00.000000000 +0100
  2826. +++ musl-git/arch/x32/bits/fenv.h 2014-02-25 15:24:14.000000000 +0100
  2827. @@ -0,0 +1,34 @@
  2828. +#define FE_INVALID 1
  2829. +#define __FE_DENORM 2
  2830. +#define FE_DIVBYZERO 4
  2831. +#define FE_OVERFLOW 8
  2832. +#define FE_UNDERFLOW 16
  2833. +#define FE_INEXACT 32
  2834. +
  2835. +#define FE_ALL_EXCEPT 63
  2836. +
  2837. +#define FE_TONEAREST 0
  2838. +#define FE_DOWNWARD 0x400
  2839. +#define FE_UPWARD 0x800
  2840. +#define FE_TOWARDZERO 0xc00
  2841. +
  2842. +typedef unsigned short fexcept_t;
  2843. +
  2844. +typedef struct {
  2845. + unsigned short __control_word;
  2846. + unsigned short __unused1;
  2847. + unsigned short __status_word;
  2848. + unsigned short __unused2;
  2849. + unsigned short __tags;
  2850. + unsigned short __unused3;
  2851. + unsigned int __eip;
  2852. + unsigned short __cs_selector;
  2853. + unsigned int __opcode:11;
  2854. + unsigned int __unused4:5;
  2855. + unsigned int __data_offset;
  2856. + unsigned short __data_selector;
  2857. + unsigned short __unused5;
  2858. + unsigned int __mxcsr;
  2859. +} fenv_t;
  2860. +
  2861. +#define FE_DFL_ENV ((const fenv_t *) -1)
  2862. diff -Nur musl-0.9.15/arch/x32/bits/float.h musl-git/arch/x32/bits/float.h
  2863. --- musl-0.9.15/arch/x32/bits/float.h 1970-01-01 01:00:00.000000000 +0100
  2864. +++ musl-git/arch/x32/bits/float.h 2014-02-25 15:24:14.000000000 +0100
  2865. @@ -0,0 +1,21 @@
  2866. +#define FLT_ROUNDS 1
  2867. +#ifdef __FLT_EVAL_METHOD__
  2868. +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
  2869. +#else
  2870. +#define FLT_EVAL_METHOD 0
  2871. +#endif
  2872. +
  2873. +#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
  2874. +#define LDBL_MIN 3.3621031431120935063e-4932L
  2875. +#define LDBL_MAX 1.1897314953572317650e+4932L
  2876. +#define LDBL_EPSILON 1.0842021724855044340e-19L
  2877. +
  2878. +#define LDBL_MANT_DIG 64
  2879. +#define LDBL_MIN_EXP (-16381)
  2880. +#define LDBL_MAX_EXP 16384
  2881. +
  2882. +#define LDBL_DIG 18
  2883. +#define LDBL_MIN_10_EXP (-4931)
  2884. +#define LDBL_MAX_10_EXP 4932
  2885. +
  2886. +#define DECIMAL_DIG 21
  2887. diff -Nur musl-0.9.15/arch/x32/bits/ioctl.h musl-git/arch/x32/bits/ioctl.h
  2888. --- musl-0.9.15/arch/x32/bits/ioctl.h 1970-01-01 01:00:00.000000000 +0100
  2889. +++ musl-git/arch/x32/bits/ioctl.h 2014-02-25 15:24:14.000000000 +0100
  2890. @@ -0,0 +1,197 @@
  2891. +#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
  2892. +#define _IOC_NONE 0U
  2893. +#define _IOC_WRITE 1U
  2894. +#define _IOC_READ 2U
  2895. +
  2896. +#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
  2897. +#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
  2898. +#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
  2899. +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
  2900. +
  2901. +#define TCGETS 0x5401
  2902. +#define TCSETS 0x5402
  2903. +#define TCSETSW 0x5403
  2904. +#define TCSETSF 0x5404
  2905. +#define TCGETA 0x5405
  2906. +#define TCSETA 0x5406
  2907. +#define TCSETAW 0x5407
  2908. +#define TCSETAF 0x5408
  2909. +#define TCSBRK 0x5409
  2910. +#define TCXONC 0x540A
  2911. +#define TCFLSH 0x540B
  2912. +#define TIOCEXCL 0x540C
  2913. +#define TIOCNXCL 0x540D
  2914. +#define TIOCSCTTY 0x540E
  2915. +#define TIOCGPGRP 0x540F
  2916. +#define TIOCSPGRP 0x5410
  2917. +#define TIOCOUTQ 0x5411
  2918. +#define TIOCSTI 0x5412
  2919. +#define TIOCGWINSZ 0x5413
  2920. +#define TIOCSWINSZ 0x5414
  2921. +#define TIOCMGET 0x5415
  2922. +#define TIOCMBIS 0x5416
  2923. +#define TIOCMBIC 0x5417
  2924. +#define TIOCMSET 0x5418
  2925. +#define TIOCGSOFTCAR 0x5419
  2926. +#define TIOCSSOFTCAR 0x541A
  2927. +#define FIONREAD 0x541B
  2928. +#define TIOCINQ FIONREAD
  2929. +#define TIOCLINUX 0x541C
  2930. +#define TIOCCONS 0x541D
  2931. +#define TIOCGSERIAL 0x541E
  2932. +#define TIOCSSERIAL 0x541F
  2933. +#define TIOCPKT 0x5420
  2934. +#define FIONBIO 0x5421
  2935. +#define TIOCNOTTY 0x5422
  2936. +#define TIOCSETD 0x5423
  2937. +#define TIOCGETD 0x5424
  2938. +#define TCSBRKP 0x5425
  2939. +#define TIOCTTYGSTRUCT 0x5426
  2940. +#define TIOCSBRK 0x5427
  2941. +#define TIOCCBRK 0x5428
  2942. +#define TIOCGSID 0x5429
  2943. +#define TIOCGPTN 0x80045430
  2944. +#define TIOCSPTLCK 0x40045431
  2945. +#define TCGETX 0x5432
  2946. +#define TCSETX 0x5433
  2947. +#define TCSETXF 0x5434
  2948. +#define TCSETXW 0x5435
  2949. +
  2950. +#define FIONCLEX 0x5450
  2951. +#define FIOCLEX 0x5451
  2952. +#define FIOASYNC 0x5452
  2953. +#define TIOCSERCONFIG 0x5453
  2954. +#define TIOCSERGWILD 0x5454
  2955. +#define TIOCSERSWILD 0x5455
  2956. +#define TIOCGLCKTRMIOS 0x5456
  2957. +#define TIOCSLCKTRMIOS 0x5457
  2958. +#define TIOCSERGSTRUCT 0x5458
  2959. +#define TIOCSERGETLSR 0x5459
  2960. +#define TIOCSERGETMULTI 0x545A
  2961. +#define TIOCSERSETMULTI 0x545B
  2962. +
  2963. +#define TIOCMIWAIT 0x545C
  2964. +#define TIOCGICOUNT 0x545D
  2965. +#define TIOCGHAYESESP 0x545E
  2966. +#define TIOCSHAYESESP 0x545F
  2967. +#define FIOQSIZE 0x5460
  2968. +
  2969. +#define TIOCPKT_DATA 0
  2970. +#define TIOCPKT_FLUSHREAD 1
  2971. +#define TIOCPKT_FLUSHWRITE 2
  2972. +#define TIOCPKT_STOP 4
  2973. +#define TIOCPKT_START 8
  2974. +#define TIOCPKT_NOSTOP 16
  2975. +#define TIOCPKT_DOSTOP 32
  2976. +#define TIOCPKT_IOCTL 64
  2977. +
  2978. +#define TIOCSER_TEMT 0x01
  2979. +
  2980. +struct winsize {
  2981. + unsigned short ws_row;
  2982. + unsigned short ws_col;
  2983. + unsigned short ws_xpixel;
  2984. + unsigned short ws_ypixel;
  2985. +};
  2986. +
  2987. +#define TIOCM_LE 0x001
  2988. +#define TIOCM_DTR 0x002
  2989. +#define TIOCM_RTS 0x004
  2990. +#define TIOCM_ST 0x008
  2991. +#define TIOCM_SR 0x010
  2992. +#define TIOCM_CTS 0x020
  2993. +#define TIOCM_CAR 0x040
  2994. +#define TIOCM_RNG 0x080
  2995. +#define TIOCM_DSR 0x100
  2996. +#define TIOCM_CD TIOCM_CAR
  2997. +#define TIOCM_RI TIOCM_RNG
  2998. +#define TIOCM_OUT1 0x2000
  2999. +#define TIOCM_OUT2 0x4000
  3000. +#define TIOCM_LOOP 0x8000
  3001. +#define TIOCM_MODEM_BITS TIOCM_OUT2
  3002. +
  3003. +#define N_TTY 0
  3004. +#define N_SLIP 1
  3005. +#define N_MOUSE 2
  3006. +#define N_PPP 3
  3007. +#define N_STRIP 4
  3008. +#define N_AX25 5
  3009. +#define N_X25 6
  3010. +#define N_6PACK 7
  3011. +#define N_MASC 8
  3012. +#define N_R3964 9
  3013. +#define N_PROFIBUS_FDL 10
  3014. +#define N_IRDA 11
  3015. +#define N_SMSBLOCK 12
  3016. +#define N_HDLC 13
  3017. +#define N_SYNC_PPP 14
  3018. +#define N_HCI 15
  3019. +
  3020. +#define FIOSETOWN 0x8901
  3021. +#define SIOCSPGRP 0x8902
  3022. +#define FIOGETOWN 0x8903
  3023. +#define SIOCGPGRP 0x8904
  3024. +#define SIOCATMARK 0x8905
  3025. +#define SIOCGSTAMP 0x8906
  3026. +
  3027. +#define SIOCADDRT 0x890B
  3028. +#define SIOCDELRT 0x890C
  3029. +#define SIOCRTMSG 0x890D
  3030. +
  3031. +#define SIOCGIFNAME 0x8910
  3032. +#define SIOCSIFLINK 0x8911
  3033. +#define SIOCGIFCONF 0x8912
  3034. +#define SIOCGIFFLAGS 0x8913
  3035. +#define SIOCSIFFLAGS 0x8914
  3036. +#define SIOCGIFADDR 0x8915
  3037. +#define SIOCSIFADDR 0x8916
  3038. +#define SIOCGIFDSTADDR 0x8917
  3039. +#define SIOCSIFDSTADDR 0x8918
  3040. +#define SIOCGIFBRDADDR 0x8919
  3041. +#define SIOCSIFBRDADDR 0x891a
  3042. +#define SIOCGIFNETMASK 0x891b
  3043. +#define SIOCSIFNETMASK 0x891c
  3044. +#define SIOCGIFMETRIC 0x891d
  3045. +#define SIOCSIFMETRIC 0x891e
  3046. +#define SIOCGIFMEM 0x891f
  3047. +#define SIOCSIFMEM 0x8920
  3048. +#define SIOCGIFMTU 0x8921
  3049. +#define SIOCSIFMTU 0x8922
  3050. +#define SIOCSIFHWADDR 0x8924
  3051. +#define SIOCGIFENCAP 0x8925
  3052. +#define SIOCSIFENCAP 0x8926
  3053. +#define SIOCGIFHWADDR 0x8927
  3054. +#define SIOCGIFSLAVE 0x8929
  3055. +#define SIOCSIFSLAVE 0x8930
  3056. +#define SIOCADDMULTI 0x8931
  3057. +#define SIOCDELMULTI 0x8932
  3058. +#define SIOCGIFINDEX 0x8933
  3059. +#define SIOGIFINDEX SIOCGIFINDEX
  3060. +#define SIOCSIFPFLAGS 0x8934
  3061. +#define SIOCGIFPFLAGS 0x8935
  3062. +#define SIOCDIFADDR 0x8936
  3063. +#define SIOCSIFHWBROADCAST 0x8937
  3064. +#define SIOCGIFCOUNT 0x8938
  3065. +
  3066. +#define SIOCGIFBR 0x8940
  3067. +#define SIOCSIFBR 0x8941
  3068. +
  3069. +#define SIOCGIFTXQLEN 0x8942
  3070. +#define SIOCSIFTXQLEN 0x8943
  3071. +
  3072. +#define SIOCDARP 0x8953
  3073. +#define SIOCGARP 0x8954
  3074. +#define SIOCSARP 0x8955
  3075. +
  3076. +#define SIOCDRARP 0x8960
  3077. +#define SIOCGRARP 0x8961
  3078. +#define SIOCSRARP 0x8962
  3079. +
  3080. +#define SIOCGIFMAP 0x8970
  3081. +#define SIOCSIFMAP 0x8971
  3082. +
  3083. +#define SIOCADDDLCI 0x8980
  3084. +#define SIOCDELDLCI 0x8981
  3085. +
  3086. +#define SIOCDEVPRIVATE 0x89F0
  3087. +#define SIOCPROTOPRIVATE 0x89E0
  3088. diff -Nur musl-0.9.15/arch/x32/bits/io.h musl-git/arch/x32/bits/io.h
  3089. --- musl-0.9.15/arch/x32/bits/io.h 1970-01-01 01:00:00.000000000 +0100
  3090. +++ musl-git/arch/x32/bits/io.h 2014-02-25 15:24:14.000000000 +0100
  3091. @@ -0,0 +1,77 @@
  3092. +static __inline void outb(unsigned char __val, unsigned short __port)
  3093. +{
  3094. + __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
  3095. +}
  3096. +
  3097. +static __inline void outw(unsigned short __val, unsigned short __port)
  3098. +{
  3099. + __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
  3100. +}
  3101. +
  3102. +static __inline void outl(unsigned int __val, unsigned short __port)
  3103. +{
  3104. + __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
  3105. +}
  3106. +
  3107. +static __inline unsigned char inb(unsigned short __port)
  3108. +{
  3109. + unsigned char __val;
  3110. + __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
  3111. + return __val;
  3112. +}
  3113. +
  3114. +static __inline unsigned short inw(unsigned short __port)
  3115. +{
  3116. + unsigned short __val;
  3117. + __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
  3118. + return __val;
  3119. +}
  3120. +
  3121. +static __inline unsigned int inl(unsigned short __port)
  3122. +{
  3123. + unsigned int __val;
  3124. + __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
  3125. + return __val;
  3126. +}
  3127. +
  3128. +static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
  3129. +{
  3130. + __asm__ volatile ("cld; rep; outsb"
  3131. + : "+S" (__buf), "+c" (__n)
  3132. + : "d" (__port));
  3133. +}
  3134. +
  3135. +static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
  3136. +{
  3137. + __asm__ volatile ("cld; rep; outsw"
  3138. + : "+S" (__buf), "+c" (__n)
  3139. + : "d" (__port));
  3140. +}
  3141. +
  3142. +static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
  3143. +{
  3144. + __asm__ volatile ("cld; rep; outsl"
  3145. + : "+S" (__buf), "+c"(__n)
  3146. + : "d" (__port));
  3147. +}
  3148. +
  3149. +static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
  3150. +{
  3151. + __asm__ volatile ("cld; rep; insb"
  3152. + : "+D" (__buf), "+c" (__n)
  3153. + : "d" (__port));
  3154. +}
  3155. +
  3156. +static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
  3157. +{
  3158. + __asm__ volatile ("cld; rep; insw"
  3159. + : "+D" (__buf), "+c" (__n)
  3160. + : "d" (__port));
  3161. +}
  3162. +
  3163. +static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
  3164. +{
  3165. + __asm__ volatile ("cld; rep; insl"
  3166. + : "+D" (__buf), "+c" (__n)
  3167. + : "d" (__port));
  3168. +}
  3169. diff -Nur musl-0.9.15/arch/x32/bits/ipc.h musl-git/arch/x32/bits/ipc.h
  3170. --- musl-0.9.15/arch/x32/bits/ipc.h 1970-01-01 01:00:00.000000000 +0100
  3171. +++ musl-git/arch/x32/bits/ipc.h 2014-02-25 15:24:14.000000000 +0100
  3172. @@ -0,0 +1,14 @@
  3173. +struct ipc_perm
  3174. +{
  3175. + key_t __ipc_perm_key;
  3176. + uid_t uid;
  3177. + gid_t gid;
  3178. + uid_t cuid;
  3179. + gid_t cgid;
  3180. + mode_t mode;
  3181. + int __ipc_perm_seq;
  3182. + long long __pad1;
  3183. + long long __pad2;
  3184. +};
  3185. +
  3186. +#define IPC_64 0
  3187. diff -Nur musl-0.9.15/arch/x32/bits/limits.h musl-git/arch/x32/bits/limits.h
  3188. --- musl-0.9.15/arch/x32/bits/limits.h 1970-01-01 01:00:00.000000000 +0100
  3189. +++ musl-git/arch/x32/bits/limits.h 2014-02-25 15:24:14.000000000 +0100
  3190. @@ -0,0 +1,8 @@
  3191. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  3192. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3193. +#define PAGE_SIZE 4096
  3194. +#define LONG_BIT 32
  3195. +#endif
  3196. +
  3197. +#define LONG_MAX 0x7fffffffL
  3198. +#define LLONG_MAX 0x7fffffffffffffffLL
  3199. diff -Nur musl-0.9.15/arch/x32/bits/mman.h musl-git/arch/x32/bits/mman.h
  3200. --- musl-0.9.15/arch/x32/bits/mman.h 1970-01-01 01:00:00.000000000 +0100
  3201. +++ musl-git/arch/x32/bits/mman.h 2014-02-25 15:24:14.000000000 +0100
  3202. @@ -0,0 +1,62 @@
  3203. +#define MAP_FAILED ((void *) -1)
  3204. +
  3205. +#define PROT_NONE 0
  3206. +#define PROT_READ 1
  3207. +#define PROT_WRITE 2
  3208. +#define PROT_EXEC 4
  3209. +#define PROT_GROWSDOWN 0x01000000
  3210. +#define PROT_GROWSUP 0x02000000
  3211. +
  3212. +#define MAP_SHARED 0x01
  3213. +#define MAP_PRIVATE 0x02
  3214. +#define MAP_FIXED 0x10
  3215. +
  3216. +#define MAP_TYPE 0x0f
  3217. +#define MAP_FILE 0x00
  3218. +#define MAP_ANON 0x20
  3219. +#define MAP_ANONYMOUS MAP_ANON
  3220. +#define MAP_32BIT 0x40
  3221. +#define MAP_NORESERVE 0x4000
  3222. +#define MAP_GROWSDOWN 0x0100
  3223. +#define MAP_DENYWRITE 0x0800
  3224. +#define MAP_EXECUTABLE 0x1000
  3225. +#define MAP_LOCKED 0x2000
  3226. +#define MAP_POPULATE 0x8000
  3227. +#define MAP_NONBLOCK 0x10000
  3228. +#define MAP_STACK 0x20000
  3229. +#define MAP_HUGETLB 0x40000
  3230. +
  3231. +#define POSIX_MADV_NORMAL 0
  3232. +#define POSIX_MADV_RANDOM 1
  3233. +#define POSIX_MADV_SEQUENTIAL 2
  3234. +#define POSIX_MADV_WILLNEED 3
  3235. +#define POSIX_MADV_DONTNEED 0
  3236. +
  3237. +#define MS_ASYNC 1
  3238. +#define MS_INVALIDATE 2
  3239. +#define MS_SYNC 4
  3240. +
  3241. +#define MCL_CURRENT 1
  3242. +#define MCL_FUTURE 2
  3243. +
  3244. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3245. +#define MADV_NORMAL 0
  3246. +#define MADV_RANDOM 1
  3247. +#define MADV_SEQUENTIAL 2
  3248. +#define MADV_WILLNEED 3
  3249. +#define MADV_DONTNEED 4
  3250. +#define MADV_REMOVE 9
  3251. +#define MADV_DONTFORK 10
  3252. +#define MADV_DOFORK 11
  3253. +#define MADV_MERGEABLE 12
  3254. +#define MADV_UNMERGEABLE 13
  3255. +#define MADV_HUGEPAGE 14
  3256. +#define MADV_NOHUGEPAGE 15
  3257. +#define MADV_DONTDUMP 16
  3258. +#define MADV_DODUMP 17
  3259. +#define MADV_HWPOISON 100
  3260. +#define MADV_SOFT_OFFLINE 101
  3261. +
  3262. +#define MREMAP_MAYMOVE 1
  3263. +#define MREMAP_FIXED 2
  3264. +#endif
  3265. diff -Nur musl-0.9.15/arch/x32/bits/msg.h musl-git/arch/x32/bits/msg.h
  3266. --- musl-0.9.15/arch/x32/bits/msg.h 1970-01-01 01:00:00.000000000 +0100
  3267. +++ musl-git/arch/x32/bits/msg.h 2014-02-25 15:24:14.000000000 +0100
  3268. @@ -0,0 +1,16 @@
  3269. +struct msqid_ds
  3270. +{
  3271. + struct ipc_perm msg_perm;
  3272. + time_t msg_stime;
  3273. + time_t msg_rtime;
  3274. + time_t msg_ctime;
  3275. + unsigned long msg_cbytes;
  3276. + long __unused1;
  3277. + msgqnum_t msg_qnum;
  3278. + long __unused2;
  3279. + msglen_t msg_qbytes;
  3280. + long __unused3;
  3281. + pid_t msg_lspid;
  3282. + pid_t msg_lrpid;
  3283. + unsigned long long __unused[2];
  3284. +};
  3285. diff -Nur musl-0.9.15/arch/x32/bits/posix.h musl-git/arch/x32/bits/posix.h
  3286. --- musl-0.9.15/arch/x32/bits/posix.h 1970-01-01 01:00:00.000000000 +0100
  3287. +++ musl-git/arch/x32/bits/posix.h 2014-02-25 15:24:14.000000000 +0100
  3288. @@ -0,0 +1,2 @@
  3289. +#define _POSIX_V6_LP64_OFF64 1
  3290. +#define _POSIX_V7_LP64_OFF64 1
  3291. diff -Nur musl-0.9.15/arch/x32/bits/reg.h musl-git/arch/x32/bits/reg.h
  3292. --- musl-0.9.15/arch/x32/bits/reg.h 1970-01-01 01:00:00.000000000 +0100
  3293. +++ musl-git/arch/x32/bits/reg.h 2014-02-25 15:24:14.000000000 +0100
  3294. @@ -0,0 +1,29 @@
  3295. +#undef __WORDSIZE
  3296. +#define __WORDSIZE 32
  3297. +#define R15 0
  3298. +#define R14 1
  3299. +#define R13 2
  3300. +#define R12 3
  3301. +#define RBP 4
  3302. +#define RBX 5
  3303. +#define R11 6
  3304. +#define R10 7
  3305. +#define R9 8
  3306. +#define R8 9
  3307. +#define RAX 10
  3308. +#define RCX 11
  3309. +#define RDX 12
  3310. +#define RSI 13
  3311. +#define RDI 14
  3312. +#define ORIG_RAX 15
  3313. +#define RIP 16
  3314. +#define CS 17
  3315. +#define EFLAGS 18
  3316. +#define RSP 19
  3317. +#define SS 20
  3318. +#define FS_BASE 21
  3319. +#define GS_BASE 22
  3320. +#define DS 23
  3321. +#define ES 24
  3322. +#define FS 25
  3323. +#define GS 26
  3324. diff -Nur musl-0.9.15/arch/x32/bits/setjmp.h musl-git/arch/x32/bits/setjmp.h
  3325. --- musl-0.9.15/arch/x32/bits/setjmp.h 1970-01-01 01:00:00.000000000 +0100
  3326. +++ musl-git/arch/x32/bits/setjmp.h 2014-02-25 15:24:14.000000000 +0100
  3327. @@ -0,0 +1 @@
  3328. +typedef unsigned long long __jmp_buf[8];
  3329. diff -Nur musl-0.9.15/arch/x32/bits/shm.h musl-git/arch/x32/bits/shm.h
  3330. --- musl-0.9.15/arch/x32/bits/shm.h 1970-01-01 01:00:00.000000000 +0100
  3331. +++ musl-git/arch/x32/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  3332. @@ -0,0 +1,33 @@
  3333. +#define SHMLBA 4096
  3334. +
  3335. +struct shmid_ds
  3336. +{
  3337. + struct ipc_perm shm_perm;
  3338. + size_t shm_segsz;
  3339. + time_t shm_atime;
  3340. + time_t shm_dtime;
  3341. + time_t shm_ctime;
  3342. + pid_t shm_cpid;
  3343. + pid_t shm_lpid;
  3344. + unsigned long shm_nattch;
  3345. + unsigned long __pad0;
  3346. + unsigned long long __pad1;
  3347. + unsigned long long __pad2;
  3348. +};
  3349. +
  3350. +struct shminfo {
  3351. + unsigned long shmmax, __pad0, shmmin, __pad1, shmmni, __pad2,
  3352. + shmseg, __pad3, shmall, __pad4;
  3353. + unsigned long long __unused[4];
  3354. +};
  3355. +
  3356. +struct shm_info {
  3357. + int __used_ids;
  3358. + int __pad_ids;
  3359. + unsigned long shm_tot, __pad0, shm_rss, __pad1, shm_swp, __pad2;
  3360. + unsigned long __swap_attempts, __pad3, __swap_successes, __pad4;
  3361. +}
  3362. +#ifdef __GNUC__
  3363. +__attribute__((__aligned__(8)))
  3364. +#endif
  3365. +;
  3366. diff -Nur musl-0.9.15/arch/x32/bits/signal.h musl-git/arch/x32/bits/signal.h
  3367. --- musl-0.9.15/arch/x32/bits/signal.h 1970-01-01 01:00:00.000000000 +0100
  3368. +++ musl-git/arch/x32/bits/signal.h 2014-02-25 15:24:14.000000000 +0100
  3369. @@ -0,0 +1,119 @@
  3370. +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  3371. + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3372. +
  3373. +#ifdef _GNU_SOURCE
  3374. +#define REG_R8 0
  3375. +#define REG_R9 1
  3376. +#define REG_R10 2
  3377. +#define REG_R11 3
  3378. +#define REG_R12 4
  3379. +#define REG_R13 5
  3380. +#define REG_R14 6
  3381. +#define REG_R15 7
  3382. +#define REG_RDI 8
  3383. +#define REG_RSI 9
  3384. +#define REG_RBP 10
  3385. +#define REG_RBX 11
  3386. +#define REG_RDX 12
  3387. +#define REG_RAX 13
  3388. +#define REG_RCX 14
  3389. +#define REG_RSP 15
  3390. +#define REG_RIP 16
  3391. +#define REG_EFL 17
  3392. +#define REG_CSGSFS 18
  3393. +#define REG_ERR 19
  3394. +#define REG_TRAPNO 20
  3395. +#define REG_OLDMASK 21
  3396. +#define REG_CR2 22
  3397. +#endif
  3398. +
  3399. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  3400. +typedef long long greg_t, gregset_t[23];
  3401. +typedef struct _fpstate {
  3402. + unsigned short cwd, swd, ftw, fop;
  3403. + unsigned long long rip, rdp;
  3404. + unsigned mxcsr, mxcr_mask;
  3405. + struct {
  3406. + unsigned short significand[4], exponent, padding[3];
  3407. + } _st[8];
  3408. + struct {
  3409. + unsigned element[4];
  3410. + } _xmm[16];
  3411. + unsigned padding[24];
  3412. +} *fpregset_t;
  3413. +struct sigcontext {
  3414. + unsigned long long r8, r9, r10, r11, r12, r13, r14, r15;
  3415. + unsigned long long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
  3416. + unsigned short cs, gs, fs, __pad0;
  3417. + unsigned long long err, trapno, oldmask, cr2;
  3418. + struct _fpstate *fpstate;
  3419. + unsigned long long __reserved1[8];
  3420. +};
  3421. +typedef struct {
  3422. + gregset_t gregs;
  3423. + fpregset_t fpregs;
  3424. + unsigned long long __reserved1[8];
  3425. +} mcontext_t;
  3426. +#else
  3427. +typedef struct {
  3428. + unsigned long long __space[32];
  3429. +} mcontext_t;
  3430. +#endif
  3431. +
  3432. +typedef struct __ucontext {
  3433. + unsigned long uc_flags;
  3434. + struct __ucontext *uc_link;
  3435. + stack_t uc_stack;
  3436. + mcontext_t uc_mcontext;
  3437. + sigset_t uc_sigmask;
  3438. + unsigned long long __fpregs_mem[64];
  3439. +} ucontext_t;
  3440. +
  3441. +#define SA_NOCLDSTOP 1
  3442. +#define SA_NOCLDWAIT 2
  3443. +#define SA_SIGINFO 4
  3444. +#define SA_ONSTACK 0x08000000
  3445. +#define SA_RESTART 0x10000000
  3446. +#define SA_NODEFER 0x40000000
  3447. +#define SA_RESETHAND 0x80000000
  3448. +#define SA_RESTORER 0x04000000
  3449. +
  3450. +#endif
  3451. +
  3452. +#define SIGHUP 1
  3453. +#define SIGINT 2
  3454. +#define SIGQUIT 3
  3455. +#define SIGILL 4
  3456. +#define SIGTRAP 5
  3457. +#define SIGABRT 6
  3458. +#define SIGIOT SIGABRT
  3459. +#define SIGBUS 7
  3460. +#define SIGFPE 8
  3461. +#define SIGKILL 9
  3462. +#define SIGUSR1 10
  3463. +#define SIGSEGV 11
  3464. +#define SIGUSR2 12
  3465. +#define SIGPIPE 13
  3466. +#define SIGALRM 14
  3467. +#define SIGTERM 15
  3468. +#define SIGSTKFLT 16
  3469. +#define SIGCHLD 17
  3470. +#define SIGCONT 18
  3471. +#define SIGSTOP 19
  3472. +#define SIGTSTP 20
  3473. +#define SIGTTIN 21
  3474. +#define SIGTTOU 22
  3475. +#define SIGURG 23
  3476. +#define SIGXCPU 24
  3477. +#define SIGXFSZ 25
  3478. +#define SIGVTALRM 26
  3479. +#define SIGPROF 27
  3480. +#define SIGWINCH 28
  3481. +#define SIGIO 29
  3482. +#define SIGPOLL 29
  3483. +#define SIGPWR 30
  3484. +#define SIGSYS 31
  3485. +#define SIGUNUSED SIGSYS
  3486. +
  3487. +#define _NSIG 65
  3488. +
  3489. diff -Nur musl-0.9.15/arch/x32/bits/socket.h musl-git/arch/x32/bits/socket.h
  3490. --- musl-0.9.15/arch/x32/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
  3491. +++ musl-git/arch/x32/bits/socket.h 2014-02-25 15:24:14.000000000 +0100
  3492. @@ -0,0 +1,18 @@
  3493. +struct msghdr
  3494. +{
  3495. + void *msg_name;
  3496. + socklen_t msg_namelen;
  3497. + struct iovec *msg_iov;
  3498. + int msg_iovlen, __pad1;
  3499. + void *msg_control;
  3500. + socklen_t msg_controllen, __pad2;
  3501. + int msg_flags;
  3502. +};
  3503. +
  3504. +struct cmsghdr
  3505. +{
  3506. + socklen_t cmsg_len;
  3507. + int __pad1;
  3508. + int cmsg_level;
  3509. + int cmsg_type;
  3510. +};
  3511. diff -Nur musl-0.9.15/arch/x32/bits/statfs.h musl-git/arch/x32/bits/statfs.h
  3512. --- musl-0.9.15/arch/x32/bits/statfs.h 1970-01-01 01:00:00.000000000 +0100
  3513. +++ musl-git/arch/x32/bits/statfs.h 2014-02-25 15:24:14.000000000 +0100
  3514. @@ -0,0 +1,7 @@
  3515. +struct statfs {
  3516. + unsigned long f_type, f_bsize;
  3517. + fsblkcnt_t f_blocks, f_bfree, f_bavail;
  3518. + fsfilcnt_t f_files, f_ffree;
  3519. + fsid_t f_fsid;
  3520. + unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
  3521. +};
  3522. diff -Nur musl-0.9.15/arch/x32/bits/stat.h musl-git/arch/x32/bits/stat.h
  3523. --- musl-0.9.15/arch/x32/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
  3524. +++ musl-git/arch/x32/bits/stat.h 2014-02-25 15:24:14.000000000 +0100
  3525. @@ -0,0 +1,22 @@
  3526. +/* copied from kernel definition, but with padding replaced
  3527. + * by the corresponding correctly-sized userspace types. */
  3528. +
  3529. +struct stat {
  3530. + dev_t st_dev;
  3531. + ino_t st_ino;
  3532. + nlink_t st_nlink;
  3533. +
  3534. + mode_t st_mode;
  3535. + uid_t st_uid;
  3536. + gid_t st_gid;
  3537. + unsigned int __pad0;
  3538. + dev_t st_rdev;
  3539. + off_t st_size;
  3540. + blksize_t st_blksize;
  3541. + blkcnt_t st_blocks;
  3542. +
  3543. + struct timespec st_atim;
  3544. + struct timespec st_mtim;
  3545. + struct timespec st_ctim;
  3546. + long long __unused[3];
  3547. +};
  3548. diff -Nur musl-0.9.15/arch/x32/bits/stdarg.h musl-git/arch/x32/bits/stdarg.h
  3549. --- musl-0.9.15/arch/x32/bits/stdarg.h 1970-01-01 01:00:00.000000000 +0100
  3550. +++ musl-git/arch/x32/bits/stdarg.h 2014-02-25 15:24:14.000000000 +0100
  3551. @@ -0,0 +1,4 @@
  3552. +#define va_start(v,l) __builtin_va_start(v,l)
  3553. +#define va_end(v) __builtin_va_end(v)
  3554. +#define va_arg(v,l) __builtin_va_arg(v,l)
  3555. +#define va_copy(d,s) __builtin_va_copy(d,s)
  3556. diff -Nur musl-0.9.15/arch/x32/bits/stdint.h musl-git/arch/x32/bits/stdint.h
  3557. --- musl-0.9.15/arch/x32/bits/stdint.h 1970-01-01 01:00:00.000000000 +0100
  3558. +++ musl-git/arch/x32/bits/stdint.h 2014-02-25 15:24:14.000000000 +0100
  3559. @@ -0,0 +1,20 @@
  3560. +typedef int32_t int_fast16_t;
  3561. +typedef int32_t int_fast32_t;
  3562. +typedef uint32_t uint_fast16_t;
  3563. +typedef uint32_t uint_fast32_t;
  3564. +
  3565. +#define INT_FAST16_MIN INT32_MIN
  3566. +#define INT_FAST32_MIN INT32_MIN
  3567. +
  3568. +#define INT_FAST16_MAX INT32_MAX
  3569. +#define INT_FAST32_MAX INT32_MAX
  3570. +
  3571. +#define UINT_FAST16_MAX UINT32_MAX
  3572. +#define UINT_FAST32_MAX UINT32_MAX
  3573. +
  3574. +#define INTPTR_MIN INT32_MIN
  3575. +#define INTPTR_MAX INT32_MAX
  3576. +#define UINTPTR_MAX UINT32_MAX
  3577. +#define PTRDIFF_MIN INT32_MIN
  3578. +#define PTRDIFF_MAX INT32_MAX
  3579. +#define SIZE_MAX UINT32_MAX
  3580. diff -Nur musl-0.9.15/arch/x32/bits/syscall.h musl-git/arch/x32/bits/syscall.h
  3581. --- musl-0.9.15/arch/x32/bits/syscall.h 1970-01-01 01:00:00.000000000 +0100
  3582. +++ musl-git/arch/x32/bits/syscall.h 2014-02-25 15:24:14.000000000 +0100
  3583. @@ -0,0 +1,634 @@
  3584. +#define __X32_SYSCALL_BIT 0x40000000
  3585. +#define __NR_read (__X32_SYSCALL_BIT + 0)
  3586. +#define __NR_write (__X32_SYSCALL_BIT + 1)
  3587. +#define __NR_open (__X32_SYSCALL_BIT + 2)
  3588. +#define __NR_close (__X32_SYSCALL_BIT + 3)
  3589. +#define __NR_stat (__X32_SYSCALL_BIT + 4)
  3590. +#define __NR_fstat (__X32_SYSCALL_BIT + 5)
  3591. +#define __NR_lstat (__X32_SYSCALL_BIT + 6)
  3592. +#define __NR_poll (__X32_SYSCALL_BIT + 7)
  3593. +#define __NR_lseek (__X32_SYSCALL_BIT + 8)
  3594. +#define __NR_mmap (__X32_SYSCALL_BIT + 9)
  3595. +#define __NR_mprotect (__X32_SYSCALL_BIT + 10)
  3596. +#define __NR_munmap (__X32_SYSCALL_BIT + 11)
  3597. +#define __NR_brk (__X32_SYSCALL_BIT + 12)
  3598. +#define __NR_rt_sigprocmask (__X32_SYSCALL_BIT + 14)
  3599. +#define __NR_pread64 (__X32_SYSCALL_BIT + 17)
  3600. +#define __NR_pwrite64 (__X32_SYSCALL_BIT + 18)
  3601. +#define __NR_access (__X32_SYSCALL_BIT + 21)
  3602. +#define __NR_pipe (__X32_SYSCALL_BIT + 22)
  3603. +#define __NR_select (__X32_SYSCALL_BIT + 23)
  3604. +#define __NR_sched_yield (__X32_SYSCALL_BIT + 24)
  3605. +#define __NR_mremap (__X32_SYSCALL_BIT + 25)
  3606. +#define __NR_msync (__X32_SYSCALL_BIT + 26)
  3607. +#define __NR_mincore (__X32_SYSCALL_BIT + 27)
  3608. +#define __NR_madvise (__X32_SYSCALL_BIT + 28)
  3609. +#define __NR_shmget (__X32_SYSCALL_BIT + 29)
  3610. +#define __NR_shmat (__X32_SYSCALL_BIT + 30)
  3611. +#define __NR_shmctl (__X32_SYSCALL_BIT + 31)
  3612. +#define __NR_dup (__X32_SYSCALL_BIT + 32)
  3613. +#define __NR_dup2 (__X32_SYSCALL_BIT + 33)
  3614. +#define __NR_pause (__X32_SYSCALL_BIT + 34)
  3615. +#define __NR_nanosleep (__X32_SYSCALL_BIT + 35)
  3616. +#define __NR_getitimer (__X32_SYSCALL_BIT + 36)
  3617. +#define __NR_alarm (__X32_SYSCALL_BIT + 37)
  3618. +#define __NR_setitimer (__X32_SYSCALL_BIT + 38)
  3619. +#define __NR_getpid (__X32_SYSCALL_BIT + 39)
  3620. +#define __NR_sendfile (__X32_SYSCALL_BIT + 40)
  3621. +#define __NR_socket (__X32_SYSCALL_BIT + 41)
  3622. +#define __NR_connect (__X32_SYSCALL_BIT + 42)
  3623. +#define __NR_accept (__X32_SYSCALL_BIT + 43)
  3624. +#define __NR_sendto (__X32_SYSCALL_BIT + 44)
  3625. +#define __NR_shutdown (__X32_SYSCALL_BIT + 48)
  3626. +#define __NR_bind (__X32_SYSCALL_BIT + 49)
  3627. +#define __NR_listen (__X32_SYSCALL_BIT + 50)
  3628. +#define __NR_getsockname (__X32_SYSCALL_BIT + 51)
  3629. +#define __NR_getpeername (__X32_SYSCALL_BIT + 52)
  3630. +#define __NR_socketpair (__X32_SYSCALL_BIT + 53)
  3631. +#define __NR_clone (__X32_SYSCALL_BIT + 56)
  3632. +#define __NR_fork (__X32_SYSCALL_BIT + 57)
  3633. +#define __NR_vfork (__X32_SYSCALL_BIT + 58)
  3634. +#define __NR_exit (__X32_SYSCALL_BIT + 60)
  3635. +#define __NR_wait4 (__X32_SYSCALL_BIT + 61)
  3636. +#define __NR_kill (__X32_SYSCALL_BIT + 62)
  3637. +#define __NR_uname (__X32_SYSCALL_BIT + 63)
  3638. +#define __NR_semget (__X32_SYSCALL_BIT + 64)
  3639. +#define __NR_semop (__X32_SYSCALL_BIT + 65)
  3640. +#define __NR_semctl (__X32_SYSCALL_BIT + 66)
  3641. +#define __NR_shmdt (__X32_SYSCALL_BIT + 67)
  3642. +#define __NR_msgget (__X32_SYSCALL_BIT + 68)
  3643. +#define __NR_msgsnd (__X32_SYSCALL_BIT + 69)
  3644. +#define __NR_msgrcv (__X32_SYSCALL_BIT + 70)
  3645. +#define __NR_msgctl (__X32_SYSCALL_BIT + 71)
  3646. +#define __NR_fcntl (__X32_SYSCALL_BIT + 72)
  3647. +#define __NR_flock (__X32_SYSCALL_BIT + 73)
  3648. +#define __NR_fsync (__X32_SYSCALL_BIT + 74)
  3649. +#define __NR_fdatasync (__X32_SYSCALL_BIT + 75)
  3650. +#define __NR_truncate (__X32_SYSCALL_BIT + 76)
  3651. +#define __NR_ftruncate (__X32_SYSCALL_BIT + 77)
  3652. +#define __NR_getdents (__X32_SYSCALL_BIT + 78)
  3653. +#define __NR_getcwd (__X32_SYSCALL_BIT + 79)
  3654. +#define __NR_chdir (__X32_SYSCALL_BIT + 80)
  3655. +#define __NR_fchdir (__X32_SYSCALL_BIT + 81)
  3656. +#define __NR_rename (__X32_SYSCALL_BIT + 82)
  3657. +#define __NR_mkdir (__X32_SYSCALL_BIT + 83)
  3658. +#define __NR_rmdir (__X32_SYSCALL_BIT + 84)
  3659. +#define __NR_creat (__X32_SYSCALL_BIT + 85)
  3660. +#define __NR_link (__X32_SYSCALL_BIT + 86)
  3661. +#define __NR_unlink (__X32_SYSCALL_BIT + 87)
  3662. +#define __NR_symlink (__X32_SYSCALL_BIT + 88)
  3663. +#define __NR_readlink (__X32_SYSCALL_BIT + 89)
  3664. +#define __NR_chmod (__X32_SYSCALL_BIT + 90)
  3665. +#define __NR_fchmod (__X32_SYSCALL_BIT + 91)
  3666. +#define __NR_chown (__X32_SYSCALL_BIT + 92)
  3667. +#define __NR_fchown (__X32_SYSCALL_BIT + 93)
  3668. +#define __NR_lchown (__X32_SYSCALL_BIT + 94)
  3669. +#define __NR_umask (__X32_SYSCALL_BIT + 95)
  3670. +#define __NR_gettimeofday (__X32_SYSCALL_BIT + 96)
  3671. +#define __NR_getrlimit (__X32_SYSCALL_BIT + 97)
  3672. +#define __NR_getrusage (__X32_SYSCALL_BIT + 98)
  3673. +#define __NR_sysinfo (__X32_SYSCALL_BIT + 99)
  3674. +#define __NR_times (__X32_SYSCALL_BIT + 100)
  3675. +#define __NR_getuid (__X32_SYSCALL_BIT + 102)
  3676. +#define __NR_syslog (__X32_SYSCALL_BIT + 103)
  3677. +#define __NR_getgid (__X32_SYSCALL_BIT + 104)
  3678. +#define __NR_setuid (__X32_SYSCALL_BIT + 105)
  3679. +#define __NR_setgid (__X32_SYSCALL_BIT + 106)
  3680. +#define __NR_geteuid (__X32_SYSCALL_BIT + 107)
  3681. +#define __NR_getegid (__X32_SYSCALL_BIT + 108)
  3682. +#define __NR_setpgid (__X32_SYSCALL_BIT + 109)
  3683. +#define __NR_getppid (__X32_SYSCALL_BIT + 110)
  3684. +#define __NR_getpgrp (__X32_SYSCALL_BIT + 111)
  3685. +#define __NR_setsid (__X32_SYSCALL_BIT + 112)
  3686. +#define __NR_setreuid (__X32_SYSCALL_BIT + 113)
  3687. +#define __NR_setregid (__X32_SYSCALL_BIT + 114)
  3688. +#define __NR_getgroups (__X32_SYSCALL_BIT + 115)
  3689. +#define __NR_setgroups (__X32_SYSCALL_BIT + 116)
  3690. +#define __NR_setresuid (__X32_SYSCALL_BIT + 117)
  3691. +#define __NR_getresuid (__X32_SYSCALL_BIT + 118)
  3692. +#define __NR_setresgid (__X32_SYSCALL_BIT + 119)
  3693. +#define __NR_getresgid (__X32_SYSCALL_BIT + 120)
  3694. +#define __NR_getpgid (__X32_SYSCALL_BIT + 121)
  3695. +#define __NR_setfsuid (__X32_SYSCALL_BIT + 122)
  3696. +#define __NR_setfsgid (__X32_SYSCALL_BIT + 123)
  3697. +#define __NR_getsid (__X32_SYSCALL_BIT + 124)
  3698. +#define __NR_capget (__X32_SYSCALL_BIT + 125)
  3699. +#define __NR_capset (__X32_SYSCALL_BIT + 126)
  3700. +#define __NR_rt_sigsuspend (__X32_SYSCALL_BIT + 130)
  3701. +#define __NR_utime (__X32_SYSCALL_BIT + 132)
  3702. +#define __NR_mknod (__X32_SYSCALL_BIT + 133)
  3703. +#define __NR_personality (__X32_SYSCALL_BIT + 135)
  3704. +#define __NR_ustat (__X32_SYSCALL_BIT + 136)
  3705. +#define __NR_statfs (__X32_SYSCALL_BIT + 137)
  3706. +#define __NR_fstatfs (__X32_SYSCALL_BIT + 138)
  3707. +#define __NR_sysfs (__X32_SYSCALL_BIT + 139)
  3708. +#define __NR_getpriority (__X32_SYSCALL_BIT + 140)
  3709. +#define __NR_setpriority (__X32_SYSCALL_BIT + 141)
  3710. +#define __NR_sched_setparam (__X32_SYSCALL_BIT + 142)
  3711. +#define __NR_sched_getparam (__X32_SYSCALL_BIT + 143)
  3712. +#define __NR_sched_setscheduler (__X32_SYSCALL_BIT + 144)
  3713. +#define __NR_sched_getscheduler (__X32_SYSCALL_BIT + 145)
  3714. +#define __NR_sched_get_priority_max (__X32_SYSCALL_BIT + 146)
  3715. +#define __NR_sched_get_priority_min (__X32_SYSCALL_BIT + 147)
  3716. +#define __NR_sched_rr_get_interval (__X32_SYSCALL_BIT + 148)
  3717. +#define __NR_mlock (__X32_SYSCALL_BIT + 149)
  3718. +#define __NR_munlock (__X32_SYSCALL_BIT + 150)
  3719. +#define __NR_mlockall (__X32_SYSCALL_BIT + 151)
  3720. +#define __NR_munlockall (__X32_SYSCALL_BIT + 152)
  3721. +#define __NR_vhangup (__X32_SYSCALL_BIT + 153)
  3722. +#define __NR_modify_ldt (__X32_SYSCALL_BIT + 154)
  3723. +#define __NR_pivot_root (__X32_SYSCALL_BIT + 155)
  3724. +#define __NR_prctl (__X32_SYSCALL_BIT + 157)
  3725. +#define __NR_arch_prctl (__X32_SYSCALL_BIT + 158)
  3726. +#define __NR_adjtimex (__X32_SYSCALL_BIT + 159)
  3727. +#define __NR_setrlimit (__X32_SYSCALL_BIT + 160)
  3728. +#define __NR_chroot (__X32_SYSCALL_BIT + 161)
  3729. +#define __NR_sync (__X32_SYSCALL_BIT + 162)
  3730. +#define __NR_acct (__X32_SYSCALL_BIT + 163)
  3731. +#define __NR_settimeofday (__X32_SYSCALL_BIT + 164)
  3732. +#define __NR_mount (__X32_SYSCALL_BIT + 165)
  3733. +#define __NR_umount2 (__X32_SYSCALL_BIT + 166)
  3734. +#define __NR_swapon (__X32_SYSCALL_BIT + 167)
  3735. +#define __NR_swapoff (__X32_SYSCALL_BIT + 168)
  3736. +#define __NR_reboot (__X32_SYSCALL_BIT + 169)
  3737. +#define __NR_sethostname (__X32_SYSCALL_BIT + 170)
  3738. +#define __NR_setdomainname (__X32_SYSCALL_BIT + 171)
  3739. +#define __NR_iopl (__X32_SYSCALL_BIT + 172)
  3740. +#define __NR_ioperm (__X32_SYSCALL_BIT + 173)
  3741. +#define __NR_init_module (__X32_SYSCALL_BIT + 175)
  3742. +#define __NR_delete_module (__X32_SYSCALL_BIT + 176)
  3743. +#define __NR_quotactl (__X32_SYSCALL_BIT + 179)
  3744. +#define __NR_getpmsg (__X32_SYSCALL_BIT + 181)
  3745. +#define __NR_putpmsg (__X32_SYSCALL_BIT + 182)
  3746. +#define __NR_afs_syscall (__X32_SYSCALL_BIT + 183)
  3747. +#define __NR_tuxcall (__X32_SYSCALL_BIT + 184)
  3748. +#define __NR_security (__X32_SYSCALL_BIT + 185)
  3749. +#define __NR_gettid (__X32_SYSCALL_BIT + 186)
  3750. +#define __NR_readahead (__X32_SYSCALL_BIT + 187)
  3751. +#define __NR_setxattr (__X32_SYSCALL_BIT + 188)
  3752. +#define __NR_lsetxattr (__X32_SYSCALL_BIT + 189)
  3753. +#define __NR_fsetxattr (__X32_SYSCALL_BIT + 190)
  3754. +#define __NR_getxattr (__X32_SYSCALL_BIT + 191)
  3755. +#define __NR_lgetxattr (__X32_SYSCALL_BIT + 192)
  3756. +#define __NR_fgetxattr (__X32_SYSCALL_BIT + 193)
  3757. +#define __NR_listxattr (__X32_SYSCALL_BIT + 194)
  3758. +#define __NR_llistxattr (__X32_SYSCALL_BIT + 195)
  3759. +#define __NR_flistxattr (__X32_SYSCALL_BIT + 196)
  3760. +#define __NR_removexattr (__X32_SYSCALL_BIT + 197)
  3761. +#define __NR_lremovexattr (__X32_SYSCALL_BIT + 198)
  3762. +#define __NR_fremovexattr (__X32_SYSCALL_BIT + 199)
  3763. +#define __NR_tkill (__X32_SYSCALL_BIT + 200)
  3764. +#define __NR_time (__X32_SYSCALL_BIT + 201)
  3765. +#define __NR_futex (__X32_SYSCALL_BIT + 202)
  3766. +#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203)
  3767. +#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
  3768. +#define __NR_io_setup (__X32_SYSCALL_BIT + 206)
  3769. +#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
  3770. +#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
  3771. +#define __NR_io_submit (__X32_SYSCALL_BIT + 209)
  3772. +#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
  3773. +#define __NR_lookup_dcookie (__X32_SYSCALL_BIT + 212)
  3774. +#define __NR_epoll_create (__X32_SYSCALL_BIT + 213)
  3775. +#define __NR_remap_file_pages (__X32_SYSCALL_BIT + 216)
  3776. +#define __NR_getdents64 (__X32_SYSCALL_BIT + 217)
  3777. +#define __NR_set_tid_address (__X32_SYSCALL_BIT + 218)
  3778. +#define __NR_restart_syscall (__X32_SYSCALL_BIT + 219)
  3779. +#define __NR_semtimedop (__X32_SYSCALL_BIT + 220)
  3780. +#define __NR_fadvise64 (__X32_SYSCALL_BIT + 221)
  3781. +#define __NR_timer_settime (__X32_SYSCALL_BIT + 223)
  3782. +#define __NR_timer_gettime (__X32_SYSCALL_BIT + 224)
  3783. +#define __NR_timer_getoverrun (__X32_SYSCALL_BIT + 225)
  3784. +#define __NR_timer_delete (__X32_SYSCALL_BIT + 226)
  3785. +#define __NR_clock_settime (__X32_SYSCALL_BIT + 227)
  3786. +#define __NR_clock_gettime (__X32_SYSCALL_BIT + 228)
  3787. +#define __NR_clock_getres (__X32_SYSCALL_BIT + 229)
  3788. +#define __NR_clock_nanosleep (__X32_SYSCALL_BIT + 230)
  3789. +#define __NR_exit_group (__X32_SYSCALL_BIT + 231)
  3790. +#define __NR_epoll_wait (__X32_SYSCALL_BIT + 232)
  3791. +#define __NR_epoll_ctl (__X32_SYSCALL_BIT + 233)
  3792. +#define __NR_tgkill (__X32_SYSCALL_BIT + 234)
  3793. +#define __NR_utimes (__X32_SYSCALL_BIT + 235)
  3794. +#define __NR_mbind (__X32_SYSCALL_BIT + 237)
  3795. +#define __NR_set_mempolicy (__X32_SYSCALL_BIT + 238)
  3796. +#define __NR_get_mempolicy (__X32_SYSCALL_BIT + 239)
  3797. +#define __NR_mq_open (__X32_SYSCALL_BIT + 240)
  3798. +#define __NR_mq_unlink (__X32_SYSCALL_BIT + 241)
  3799. +#define __NR_mq_timedsend (__X32_SYSCALL_BIT + 242)
  3800. +#define __NR_mq_timedreceive (__X32_SYSCALL_BIT + 243)
  3801. +#define __NR_mq_getsetattr (__X32_SYSCALL_BIT + 245)
  3802. +#define __NR_add_key (__X32_SYSCALL_BIT + 248)
  3803. +#define __NR_request_key (__X32_SYSCALL_BIT + 249)
  3804. +#define __NR_keyctl (__X32_SYSCALL_BIT + 250)
  3805. +#define __NR_ioprio_set (__X32_SYSCALL_BIT + 251)
  3806. +#define __NR_ioprio_get (__X32_SYSCALL_BIT + 252)
  3807. +#define __NR_inotify_init (__X32_SYSCALL_BIT + 253)
  3808. +#define __NR_inotify_add_watch (__X32_SYSCALL_BIT + 254)
  3809. +#define __NR_inotify_rm_watch (__X32_SYSCALL_BIT + 255)
  3810. +#define __NR_migrate_pages (__X32_SYSCALL_BIT + 256)
  3811. +#define __NR_openat (__X32_SYSCALL_BIT + 257)
  3812. +#define __NR_mkdirat (__X32_SYSCALL_BIT + 258)
  3813. +#define __NR_mknodat (__X32_SYSCALL_BIT + 259)
  3814. +#define __NR_fchownat (__X32_SYSCALL_BIT + 260)
  3815. +#define __NR_futimesat (__X32_SYSCALL_BIT + 261)
  3816. +#define __NR_newfstatat (__X32_SYSCALL_BIT + 262)
  3817. +#define __NR_unlinkat (__X32_SYSCALL_BIT + 263)
  3818. +#define __NR_renameat (__X32_SYSCALL_BIT + 264)
  3819. +#define __NR_linkat (__X32_SYSCALL_BIT + 265)
  3820. +#define __NR_symlinkat (__X32_SYSCALL_BIT + 266)
  3821. +#define __NR_readlinkat (__X32_SYSCALL_BIT + 267)
  3822. +#define __NR_fchmodat (__X32_SYSCALL_BIT + 268)
  3823. +#define __NR_faccessat (__X32_SYSCALL_BIT + 269)
  3824. +#define __NR_pselect6 (__X32_SYSCALL_BIT + 270)
  3825. +#define __NR_ppoll (__X32_SYSCALL_BIT + 271)
  3826. +#define __NR_unshare (__X32_SYSCALL_BIT + 272)
  3827. +#define __NR_splice (__X32_SYSCALL_BIT + 275)
  3828. +#define __NR_tee (__X32_SYSCALL_BIT + 276)
  3829. +#define __NR_sync_file_range (__X32_SYSCALL_BIT + 277)
  3830. +#define __NR_utimensat (__X32_SYSCALL_BIT + 280)
  3831. +#define __NR_epoll_pwait (__X32_SYSCALL_BIT + 281)
  3832. +#define __NR_signalfd (__X32_SYSCALL_BIT + 282)
  3833. +#define __NR_timerfd_create (__X32_SYSCALL_BIT + 283)
  3834. +#define __NR_eventfd (__X32_SYSCALL_BIT + 284)
  3835. +#define __NR_fallocate (__X32_SYSCALL_BIT + 285)
  3836. +#define __NR_timerfd_settime (__X32_SYSCALL_BIT + 286)
  3837. +#define __NR_timerfd_gettime (__X32_SYSCALL_BIT + 287)
  3838. +#define __NR_accept4 (__X32_SYSCALL_BIT + 288)
  3839. +#define __NR_signalfd4 (__X32_SYSCALL_BIT + 289)
  3840. +#define __NR_eventfd2 (__X32_SYSCALL_BIT + 290)
  3841. +#define __NR_epoll_create1 (__X32_SYSCALL_BIT + 291)
  3842. +#define __NR_dup3 (__X32_SYSCALL_BIT + 292)
  3843. +#define __NR_pipe2 (__X32_SYSCALL_BIT + 293)
  3844. +#define __NR_inotify_init1 (__X32_SYSCALL_BIT + 294)
  3845. +#define __NR_perf_event_open (__X32_SYSCALL_BIT + 298)
  3846. +#define __NR_fanotify_init (__X32_SYSCALL_BIT + 300)
  3847. +#define __NR_fanotify_mark (__X32_SYSCALL_BIT + 301)
  3848. +#define __NR_prlimit64 (__X32_SYSCALL_BIT + 302)
  3849. +#define __NR_name_to_handle_at (__X32_SYSCALL_BIT + 303)
  3850. +#define __NR_open_by_handle_at (__X32_SYSCALL_BIT + 304)
  3851. +#define __NR_clock_adjtime (__X32_SYSCALL_BIT + 305)
  3852. +#define __NR_syncfs (__X32_SYSCALL_BIT + 306)
  3853. +#define __NR_setns (__X32_SYSCALL_BIT + 308)
  3854. +#define __NR_getcpu (__X32_SYSCALL_BIT + 309)
  3855. +#define __NR_kcmp (__X32_SYSCALL_BIT + 312)
  3856. +#define __NR_finit_module (__X32_SYSCALL_BIT + 313)
  3857. +#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
  3858. +#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
  3859. +#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
  3860. +#define __NR_readv (__X32_SYSCALL_BIT + 515)
  3861. +#define __NR_writev (__X32_SYSCALL_BIT + 516)
  3862. +#define __NR_recvfrom (__X32_SYSCALL_BIT + 517)
  3863. +#define __NR_sendmsg (__X32_SYSCALL_BIT + 518)
  3864. +#define __NR_recvmsg (__X32_SYSCALL_BIT + 519)
  3865. +#define __NR_execve (__X32_SYSCALL_BIT + 520)
  3866. +#define __NR_ptrace (__X32_SYSCALL_BIT + 521)
  3867. +#define __NR_rt_sigpending (__X32_SYSCALL_BIT + 522)
  3868. +#define __NR_rt_sigtimedwait (__X32_SYSCALL_BIT + 523)
  3869. +#define __NR_rt_sigqueueinfo (__X32_SYSCALL_BIT + 524)
  3870. +#define __NR_sigaltstack (__X32_SYSCALL_BIT + 525)
  3871. +#define __NR_timer_create (__X32_SYSCALL_BIT + 526)
  3872. +#define __NR_mq_notify (__X32_SYSCALL_BIT + 527)
  3873. +#define __NR_kexec_load (__X32_SYSCALL_BIT + 528)
  3874. +#define __NR_waitid (__X32_SYSCALL_BIT + 529)
  3875. +#define __NR_set_robust_list (__X32_SYSCALL_BIT + 530)
  3876. +#define __NR_get_robust_list (__X32_SYSCALL_BIT + 531)
  3877. +#define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
  3878. +#define __NR_move_pages (__X32_SYSCALL_BIT + 533)
  3879. +#define __NR_preadv (__X32_SYSCALL_BIT + 534)
  3880. +#define __NR_pwritev (__X32_SYSCALL_BIT + 535)
  3881. +#define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
  3882. +#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
  3883. +#define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
  3884. +#define __NR_process_vm_readv (__X32_SYSCALL_BIT + 539)
  3885. +#define __NR_process_vm_writev (__X32_SYSCALL_BIT + 540)
  3886. +#define __NR_setsockopt (__X32_SYSCALL_BIT + 541)
  3887. +#define __NR_getsockopt (__X32_SYSCALL_BIT + 542)
  3888. +
  3889. +#undef __NR_fstatat
  3890. +#undef __NR_pread
  3891. +#undef __NR_pwrite
  3892. +#undef __NR_getdents
  3893. +#define __NR_fstatat __NR_newfstatat
  3894. +#define __NR_pread __NR_pread64
  3895. +#define __NR_pwrite __NR_pwrite64
  3896. +#define __NR_getdents __NR_getdents64
  3897. +#define __NR_fadvise __NR_fadvise64
  3898. +
  3899. +
  3900. +
  3901. +/* Repeat with SYS_ prefix */
  3902. +
  3903. +
  3904. +
  3905. +#define SYS_read __NR_read
  3906. +#define SYS_write __NR_write
  3907. +#define SYS_open __NR_open
  3908. +#define SYS_close __NR_close
  3909. +#define SYS_stat __NR_stat
  3910. +#define SYS_fstat __NR_fstat
  3911. +#define SYS_lstat __NR_lstat
  3912. +#define SYS_poll __NR_poll
  3913. +#define SYS_lseek __NR_lseek
  3914. +#define SYS_mmap __NR_mmap
  3915. +#define SYS_mprotect __NR_mprotect
  3916. +#define SYS_munmap __NR_munmap
  3917. +#define SYS_brk __NR_brk
  3918. +#define SYS_rt_sigprocmask __NR_rt_sigprocmask
  3919. +#define SYS_pread64 __NR_pread64
  3920. +#define SYS_pwrite64 __NR_pwrite64
  3921. +#define SYS_access __NR_access
  3922. +#define SYS_pipe __NR_pipe
  3923. +#define SYS_select __NR_select
  3924. +#define SYS_sched_yield __NR_sched_yield
  3925. +#define SYS_mremap __NR_mremap
  3926. +#define SYS_msync __NR_msync
  3927. +#define SYS_mincore __NR_mincore
  3928. +#define SYS_madvise __NR_madvise
  3929. +#define SYS_shmget __NR_shmget
  3930. +#define SYS_shmat __NR_shmat
  3931. +#define SYS_shmctl __NR_shmctl
  3932. +#define SYS_dup __NR_dup
  3933. +#define SYS_dup2 __NR_dup2
  3934. +#define SYS_pause __NR_pause
  3935. +#define SYS_nanosleep __NR_nanosleep
  3936. +#define SYS_getitimer __NR_getitimer
  3937. +#define SYS_alarm __NR_alarm
  3938. +#define SYS_setitimer __NR_setitimer
  3939. +#define SYS_getpid __NR_getpid
  3940. +#define SYS_sendfile __NR_sendfile
  3941. +#define SYS_socket __NR_socket
  3942. +#define SYS_connect __NR_connect
  3943. +#define SYS_accept __NR_accept
  3944. +#define SYS_sendto __NR_sendto
  3945. +#define SYS_shutdown __NR_shutdown
  3946. +#define SYS_bind __NR_bind
  3947. +#define SYS_listen __NR_listen
  3948. +#define SYS_getsockname __NR_getsockname
  3949. +#define SYS_getpeername __NR_getpeername
  3950. +#define SYS_socketpair __NR_socketpair
  3951. +#define SYS_clone __NR_clone
  3952. +#define SYS_fork __NR_fork
  3953. +#define SYS_vfork __NR_vfork
  3954. +#define SYS_exit __NR_exit
  3955. +#define SYS_wait4 __NR_wait4
  3956. +#define SYS_kill __NR_kill
  3957. +#define SYS_uname __NR_uname
  3958. +#define SYS_semget __NR_semget
  3959. +#define SYS_semop __NR_semop
  3960. +#define SYS_semctl __NR_semctl
  3961. +#define SYS_shmdt __NR_shmdt
  3962. +#define SYS_msgget __NR_msgget
  3963. +#define SYS_msgsnd __NR_msgsnd
  3964. +#define SYS_msgrcv __NR_msgrcv
  3965. +#define SYS_msgctl __NR_msgctl
  3966. +#define SYS_fcntl __NR_fcntl
  3967. +#define SYS_flock __NR_flock
  3968. +#define SYS_fsync __NR_fsync
  3969. +#define SYS_fdatasync __NR_fdatasync
  3970. +#define SYS_truncate __NR_truncate
  3971. +#define SYS_ftruncate __NR_ftruncate
  3972. +#define SYS_getdents __NR_getdents
  3973. +#define SYS_getcwd __NR_getcwd
  3974. +#define SYS_chdir __NR_chdir
  3975. +#define SYS_fchdir __NR_fchdir
  3976. +#define SYS_rename __NR_rename
  3977. +#define SYS_mkdir __NR_mkdir
  3978. +#define SYS_rmdir __NR_rmdir
  3979. +#define SYS_creat __NR_creat
  3980. +#define SYS_link __NR_link
  3981. +#define SYS_unlink __NR_unlink
  3982. +#define SYS_symlink __NR_symlink
  3983. +#define SYS_readlink __NR_readlink
  3984. +#define SYS_chmod __NR_chmod
  3985. +#define SYS_fchmod __NR_fchmod
  3986. +#define SYS_chown __NR_chown
  3987. +#define SYS_fchown __NR_fchown
  3988. +#define SYS_lchown __NR_lchown
  3989. +#define SYS_umask __NR_umask
  3990. +#define SYS_gettimeofday __NR_gettimeofday
  3991. +#define SYS_getrlimit __NR_getrlimit
  3992. +#define SYS_getrusage __NR_getrusage
  3993. +#define SYS_sysinfo __NR_sysinfo
  3994. +#define SYS_times __NR_times
  3995. +#define SYS_getuid __NR_getuid
  3996. +#define SYS_syslog __NR_syslog
  3997. +#define SYS_getgid __NR_getgid
  3998. +#define SYS_setuid __NR_setuid
  3999. +#define SYS_setgid __NR_setgid
  4000. +#define SYS_geteuid __NR_geteuid
  4001. +#define SYS_getegid __NR_getegid
  4002. +#define SYS_setpgid __NR_setpgid
  4003. +#define SYS_getppid __NR_getppid
  4004. +#define SYS_getpgrp __NR_getpgrp
  4005. +#define SYS_setsid __NR_setsid
  4006. +#define SYS_setreuid __NR_setreuid
  4007. +#define SYS_setregid __NR_setregid
  4008. +#define SYS_getgroups __NR_getgroups
  4009. +#define SYS_setgroups __NR_setgroups
  4010. +#define SYS_setresuid __NR_setresuid
  4011. +#define SYS_getresuid __NR_getresuid
  4012. +#define SYS_setresgid __NR_setresgid
  4013. +#define SYS_getresgid __NR_getresgid
  4014. +#define SYS_getpgid __NR_getpgid
  4015. +#define SYS_setfsuid __NR_setfsuid
  4016. +#define SYS_setfsgid __NR_setfsgid
  4017. +#define SYS_getsid __NR_getsid
  4018. +#define SYS_capget __NR_capget
  4019. +#define SYS_capset __NR_capset
  4020. +#define SYS_rt_sigsuspend __NR_rt_sigsuspend
  4021. +#define SYS_utime __NR_utime
  4022. +#define SYS_mknod __NR_mknod
  4023. +#define SYS_personality __NR_personality
  4024. +#define SYS_ustat __NR_ustat
  4025. +#define SYS_statfs __NR_statfs
  4026. +#define SYS_fstatfs __NR_fstatfs
  4027. +#define SYS_sysfs __NR_sysfs
  4028. +#define SYS_getpriority __NR_getpriority
  4029. +#define SYS_setpriority __NR_setpriority
  4030. +#define SYS_sched_setparam __NR_sched_setparam
  4031. +#define SYS_sched_getparam __NR_sched_getparam
  4032. +#define SYS_sched_setscheduler __NR_sched_setscheduler
  4033. +#define SYS_sched_getscheduler __NR_sched_getscheduler
  4034. +#define SYS_sched_get_priority_max __NR_sched_get_priority_max
  4035. +#define SYS_sched_get_priority_min __NR_sched_get_priority_min
  4036. +#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
  4037. +#define SYS_mlock __NR_mlock
  4038. +#define SYS_munlock __NR_munlock
  4039. +#define SYS_mlockall __NR_mlockall
  4040. +#define SYS_munlockall __NR_munlockall
  4041. +#define SYS_vhangup __NR_vhangup
  4042. +#define SYS_modify_ldt __NR_modify_ldt
  4043. +#define SYS_pivot_root __NR_pivot_root
  4044. +#define SYS_prctl __NR_prctl
  4045. +#define SYS_arch_prctl __NR_arch_prctl
  4046. +#define SYS_adjtimex __NR_adjtimex
  4047. +#define SYS_setrlimit __NR_setrlimit
  4048. +#define SYS_chroot __NR_chroot
  4049. +#define SYS_sync __NR_sync
  4050. +#define SYS_acct __NR_acct
  4051. +#define SYS_settimeofday __NR_settimeofday
  4052. +#define SYS_mount __NR_mount
  4053. +#define SYS_umount2 __NR_umount2
  4054. +#define SYS_swapon __NR_swapon
  4055. +#define SYS_swapoff __NR_swapoff
  4056. +#define SYS_reboot __NR_reboot
  4057. +#define SYS_sethostname __NR_sethostname
  4058. +#define SYS_setdomainname __NR_setdomainname
  4059. +#define SYS_iopl __NR_iopl
  4060. +#define SYS_ioperm __NR_ioperm
  4061. +#define SYS_init_module __NR_init_module
  4062. +#define SYS_delete_module __NR_delete_module
  4063. +#define SYS_quotactl __NR_quotactl
  4064. +#define SYS_getpmsg __NR_getpmsg
  4065. +#define SYS_putpmsg __NR_putpmsg
  4066. +#define SYS_afs_syscall __NR_afs_syscall
  4067. +#define SYS_tuxcall __NR_tuxcall
  4068. +#define SYS_security __NR_security
  4069. +#define SYS_gettid __NR_gettid
  4070. +#define SYS_readahead __NR_readahead
  4071. +#define SYS_setxattr __NR_setxattr
  4072. +#define SYS_lsetxattr __NR_lsetxattr
  4073. +#define SYS_fsetxattr __NR_fsetxattr
  4074. +#define SYS_getxattr __NR_getxattr
  4075. +#define SYS_lgetxattr __NR_lgetxattr
  4076. +#define SYS_fgetxattr __NR_fgetxattr
  4077. +#define SYS_listxattr __NR_listxattr
  4078. +#define SYS_llistxattr __NR_llistxattr
  4079. +#define SYS_flistxattr __NR_flistxattr
  4080. +#define SYS_removexattr __NR_removexattr
  4081. +#define SYS_lremovexattr __NR_lremovexattr
  4082. +#define SYS_fremovexattr __NR_fremovexattr
  4083. +#define SYS_tkill __NR_tkill
  4084. +#define SYS_time __NR_time
  4085. +#define SYS_futex __NR_futex
  4086. +#define SYS_sched_setaffinity __NR_sched_setaffinity
  4087. +#define SYS_sched_getaffinity __NR_sched_getaffinity
  4088. +#define SYS_io_setup __NR_io_setup
  4089. +#define SYS_io_destroy __NR_io_destroy
  4090. +#define SYS_io_getevents __NR_io_getevents
  4091. +#define SYS_io_submit __NR_io_submit
  4092. +#define SYS_io_cancel __NR_io_cancel
  4093. +#define SYS_lookup_dcookie __NR_lookup_dcookie
  4094. +#define SYS_epoll_create __NR_epoll_create
  4095. +#define SYS_remap_file_pages __NR_remap_file_pages
  4096. +#define SYS_getdents64 __NR_getdents64
  4097. +#define SYS_set_tid_address __NR_set_tid_address
  4098. +#define SYS_restart_syscall __NR_restart_syscall
  4099. +#define SYS_semtimedop __NR_semtimedop
  4100. +#define SYS_fadvise64 __NR_fadvise64
  4101. +#define SYS_timer_settime __NR_timer_settime
  4102. +#define SYS_timer_gettime __NR_timer_gettime
  4103. +#define SYS_timer_getoverrun __NR_timer_getoverrun
  4104. +#define SYS_timer_delete __NR_timer_delete
  4105. +#define SYS_clock_settime __NR_clock_settime
  4106. +#define SYS_clock_gettime __NR_clock_gettime
  4107. +#define SYS_clock_getres __NR_clock_getres
  4108. +#define SYS_clock_nanosleep __NR_clock_nanosleep
  4109. +#define SYS_exit_group __NR_exit_group
  4110. +#define SYS_epoll_wait __NR_epoll_wait
  4111. +#define SYS_epoll_ctl __NR_epoll_ctl
  4112. +#define SYS_tgkill __NR_tgkill
  4113. +#define SYS_utimes __NR_utimes
  4114. +#define SYS_mbind __NR_mbind
  4115. +#define SYS_set_mempolicy __NR_set_mempolicy
  4116. +#define SYS_get_mempolicy __NR_get_mempolicy
  4117. +#define SYS_mq_open __NR_mq_open
  4118. +#define SYS_mq_unlink __NR_mq_unlink
  4119. +#define SYS_mq_timedsend __NR_mq_timedsend
  4120. +#define SYS_mq_timedreceive __NR_mq_timedreceive
  4121. +#define SYS_mq_getsetattr __NR_mq_getsetattr
  4122. +#define SYS_add_key __NR_add_key
  4123. +#define SYS_request_key __NR_request_key
  4124. +#define SYS_keyctl __NR_keyctl
  4125. +#define SYS_ioprio_set __NR_ioprio_set
  4126. +#define SYS_ioprio_get __NR_ioprio_get
  4127. +#define SYS_inotify_init __NR_inotify_init
  4128. +#define SYS_inotify_add_watch __NR_inotify_add_watch
  4129. +#define SYS_inotify_rm_watch __NR_inotify_rm_watch
  4130. +#define SYS_migrate_pages __NR_migrate_pages
  4131. +#define SYS_openat __NR_openat
  4132. +#define SYS_mkdirat __NR_mkdirat
  4133. +#define SYS_mknodat __NR_mknodat
  4134. +#define SYS_fchownat __NR_fchownat
  4135. +#define SYS_futimesat __NR_futimesat
  4136. +#define SYS_newfstatat __NR_newfstatat
  4137. +#define SYS_unlinkat __NR_unlinkat
  4138. +#define SYS_renameat __NR_renameat
  4139. +#define SYS_linkat __NR_linkat
  4140. +#define SYS_symlinkat __NR_symlinkat
  4141. +#define SYS_readlinkat __NR_readlinkat
  4142. +#define SYS_fchmodat __NR_fchmodat
  4143. +#define SYS_faccessat __NR_faccessat
  4144. +#define SYS_pselect6 __NR_pselect6
  4145. +#define SYS_ppoll __NR_ppoll
  4146. +#define SYS_unshare __NR_unshare
  4147. +#define SYS_splice __NR_splice
  4148. +#define SYS_tee __NR_tee
  4149. +#define SYS_sync_file_range __NR_sync_file_range
  4150. +#define SYS_utimensat __NR_utimensat
  4151. +#define SYS_epoll_pwait __NR_epoll_pwait
  4152. +#define SYS_signalfd __NR_signalfd
  4153. +#define SYS_timerfd_create __NR_timerfd_create
  4154. +#define SYS_eventfd __NR_eventfd
  4155. +#define SYS_fallocate __NR_fallocate
  4156. +#define SYS_timerfd_settime __NR_timerfd_settime
  4157. +#define SYS_timerfd_gettime __NR_timerfd_gettime
  4158. +#define SYS_accept4 __NR_accept4
  4159. +#define SYS_signalfd4 __NR_signalfd4
  4160. +#define SYS_eventfd2 __NR_eventfd2
  4161. +#define SYS_epoll_create1 __NR_epoll_create1
  4162. +#define SYS_dup3 __NR_dup3
  4163. +#define SYS_pipe2 __NR_pipe2
  4164. +#define SYS_inotify_init1 __NR_inotify_init1
  4165. +#define SYS_perf_event_open __NR_perf_event_open
  4166. +#define SYS_fanotify_init __NR_fanotify_init
  4167. +#define SYS_fanotify_mark __NR_fanotify_mark
  4168. +#define SYS_prlimit64 __NR_prlimit64
  4169. +#define SYS_name_to_handle_at __NR_name_to_handle_at
  4170. +#define SYS_open_by_handle_at __NR_open_by_handle_at
  4171. +#define SYS_clock_adjtime __NR_clock_adjtime
  4172. +#define SYS_syncfs __NR_syncfs
  4173. +#define SYS_setns __NR_setns
  4174. +#define SYS_getcpu __NR_getcpu
  4175. +#define SYS_kcmp __NR_kcmp
  4176. +#define SYS_finit_module __NR_finit_module
  4177. +#define SYS_rt_sigaction __NR_rt_sigaction
  4178. +#define SYS_rt_sigreturn __NR_rt_sigreturn
  4179. +#define SYS_ioctl __NR_ioctl
  4180. +#define SYS_readv __NR_readv
  4181. +#define SYS_writev __NR_writev
  4182. +#define SYS_recvfrom __NR_recvfrom
  4183. +#define SYS_sendmsg __NR_sendmsg
  4184. +#define SYS_recvmsg __NR_recvmsg
  4185. +#define SYS_execve __NR_execve
  4186. +#define SYS_ptrace __NR_ptrace
  4187. +#define SYS_rt_sigpending __NR_rt_sigpending
  4188. +#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
  4189. +#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
  4190. +#define SYS_sigaltstack __NR_sigaltstack
  4191. +#define SYS_timer_create __NR_timer_create
  4192. +#define SYS_mq_notify __NR_mq_notify
  4193. +#define SYS_kexec_load __NR_kexec_load
  4194. +#define SYS_waitid __NR_waitid
  4195. +#define SYS_set_robust_list __NR_set_robust_list
  4196. +#define SYS_get_robust_list __NR_get_robust_list
  4197. +#define SYS_vmsplice __NR_vmsplice
  4198. +#define SYS_move_pages __NR_move_pages
  4199. +#define SYS_preadv __NR_preadv
  4200. +#define SYS_pwritev __NR_pwritev
  4201. +#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
  4202. +#define SYS_recvmmsg __NR_recvmmsg
  4203. +#define SYS_sendmmsg __NR_sendmmsg
  4204. +#define SYS_process_vm_readv __NR_process_vm_readv
  4205. +#define SYS_process_vm_writev __NR_process_vm_writev
  4206. +#define SYS_setsockopt __NR_setsockopt
  4207. +#define SYS_getsockopt __NR_getsockopt
  4208. +
  4209. +#undef SYS_fstatat
  4210. +#undef SYS_pread
  4211. +#undef SYS_pwrite
  4212. +#undef SYS_getdents
  4213. +#define SYS_fstatat SYS_newfstatat
  4214. +#define SYS_pread SYS_pread64
  4215. +#define SYS_pwrite SYS_pwrite64
  4216. +#define SYS_getdents SYS_getdents64
  4217. +#define SYS_fadvise SYS_fadvise64
  4218. diff -Nur musl-0.9.15/arch/x32/bits/termios.h musl-git/arch/x32/bits/termios.h
  4219. --- musl-0.9.15/arch/x32/bits/termios.h 1970-01-01 01:00:00.000000000 +0100
  4220. +++ musl-git/arch/x32/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  4221. @@ -0,0 +1,160 @@
  4222. +struct termios
  4223. +{
  4224. + tcflag_t c_iflag;
  4225. + tcflag_t c_oflag;
  4226. + tcflag_t c_cflag;
  4227. + tcflag_t c_lflag;
  4228. + cc_t c_line;
  4229. + cc_t c_cc[NCCS];
  4230. + speed_t __c_ispeed;
  4231. + speed_t __c_ospeed;
  4232. +};
  4233. +
  4234. +#define VINTR 0
  4235. +#define VQUIT 1
  4236. +#define VERASE 2
  4237. +#define VKILL 3
  4238. +#define VEOF 4
  4239. +#define VTIME 5
  4240. +#define VMIN 6
  4241. +#define VSWTC 7
  4242. +#define VSTART 8
  4243. +#define VSTOP 9
  4244. +#define VSUSP 10
  4245. +#define VEOL 11
  4246. +#define VREPRINT 12
  4247. +#define VDISCARD 13
  4248. +#define VWERASE 14
  4249. +#define VLNEXT 15
  4250. +#define VEOL2 16
  4251. +
  4252. +#define IGNBRK 0000001
  4253. +#define BRKINT 0000002
  4254. +#define IGNPAR 0000004
  4255. +#define PARMRK 0000010
  4256. +#define INPCK 0000020
  4257. +#define ISTRIP 0000040
  4258. +#define INLCR 0000100
  4259. +#define IGNCR 0000200
  4260. +#define ICRNL 0000400
  4261. +#define IUCLC 0001000
  4262. +#define IXON 0002000
  4263. +#define IXANY 0004000
  4264. +#define IXOFF 0010000
  4265. +#define IMAXBEL 0020000
  4266. +#define IUTF8 0040000
  4267. +
  4268. +#define OPOST 0000001
  4269. +#define OLCUC 0000002
  4270. +#define ONLCR 0000004
  4271. +#define OCRNL 0000010
  4272. +#define ONOCR 0000020
  4273. +#define ONLRET 0000040
  4274. +#define OFILL 0000100
  4275. +#define OFDEL 0000200
  4276. +#define NLDLY 0000400
  4277. +#define NL0 0000000
  4278. +#define NL1 0000400
  4279. +#define CRDLY 0003000
  4280. +#define CR0 0000000
  4281. +#define CR1 0001000
  4282. +#define CR2 0002000
  4283. +#define CR3 0003000
  4284. +#define TABDLY 0014000
  4285. +#define TAB0 0000000
  4286. +#define TAB1 0004000
  4287. +#define TAB2 0010000
  4288. +#define TAB3 0014000
  4289. +#define BSDLY 0020000
  4290. +#define BS0 0000000
  4291. +#define BS1 0020000
  4292. +#define FFDLY 0100000
  4293. +#define FF0 0000000
  4294. +#define FF1 0100000
  4295. +
  4296. +#define VTDLY 0040000
  4297. +#define VT0 0000000
  4298. +#define VT1 0040000
  4299. +
  4300. +#define B0 0000000
  4301. +#define B50 0000001
  4302. +#define B75 0000002
  4303. +#define B110 0000003
  4304. +#define B134 0000004
  4305. +#define B150 0000005
  4306. +#define B200 0000006
  4307. +#define B300 0000007
  4308. +#define B600 0000010
  4309. +#define B1200 0000011
  4310. +#define B1800 0000012
  4311. +#define B2400 0000013
  4312. +#define B4800 0000014
  4313. +#define B9600 0000015
  4314. +#define B19200 0000016
  4315. +#define B38400 0000017
  4316. +
  4317. +#define B57600 0010001
  4318. +#define B115200 0010002
  4319. +#define B230400 0010003
  4320. +#define B460800 0010004
  4321. +#define B500000 0010005
  4322. +#define B576000 0010006
  4323. +#define B921600 0010007
  4324. +#define B1000000 0010010
  4325. +#define B1152000 0010011
  4326. +#define B1500000 0010012
  4327. +#define B2000000 0010013
  4328. +#define B2500000 0010014
  4329. +#define B3000000 0010015
  4330. +#define B3500000 0010016
  4331. +#define B4000000 0010017
  4332. +
  4333. +#define CBAUD 0010017
  4334. +
  4335. +#define CSIZE 0000060
  4336. +#define CS5 0000000
  4337. +#define CS6 0000020
  4338. +#define CS7 0000040
  4339. +#define CS8 0000060
  4340. +#define CSTOPB 0000100
  4341. +#define CREAD 0000200
  4342. +#define PARENB 0000400
  4343. +#define PARODD 0001000
  4344. +#define HUPCL 0002000
  4345. +#define CLOCAL 0004000
  4346. +
  4347. +#define ISIG 0000001
  4348. +#define ICANON 0000002
  4349. +#define ECHO 0000010
  4350. +#define ECHOE 0000020
  4351. +#define ECHOK 0000040
  4352. +#define ECHONL 0000100
  4353. +#define NOFLSH 0000200
  4354. +#define TOSTOP 0000400
  4355. +#define IEXTEN 0100000
  4356. +
  4357. +#define ECHOCTL 0001000
  4358. +#define ECHOPRT 0002000
  4359. +#define ECHOKE 0004000
  4360. +#define FLUSHO 0010000
  4361. +#define PENDIN 0040000
  4362. +
  4363. +#define TCOOFF 0
  4364. +#define TCOON 1
  4365. +#define TCIOFF 2
  4366. +#define TCION 3
  4367. +
  4368. +#define TCIFLUSH 0
  4369. +#define TCOFLUSH 1
  4370. +#define TCIOFLUSH 2
  4371. +
  4372. +#define TCSANOW 0
  4373. +#define TCSADRAIN 1
  4374. +#define TCSAFLUSH 2
  4375. +
  4376. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4377. +#define CBAUDEX 0010000
  4378. +#define CRTSCTS 020000000000
  4379. +#define EXTPROC 0200000
  4380. +#define XTABS 0014000
  4381. +#endif
  4382. diff -Nur musl-0.9.15/arch/x32/bits/user.h musl-git/arch/x32/bits/user.h
  4383. --- musl-0.9.15/arch/x32/bits/user.h 1970-01-01 01:00:00.000000000 +0100
  4384. +++ musl-git/arch/x32/bits/user.h 2014-02-25 15:24:14.000000000 +0100
  4385. @@ -0,0 +1,44 @@
  4386. +#undef __WORDSIZE
  4387. +#define __WORDSIZE 64
  4388. +
  4389. +typedef struct user_fpregs_struct
  4390. +{
  4391. + uint16_t cwd, swd, ftw, fop;
  4392. + uint64_t rip, rdp;
  4393. + uint32_t mxcsr, mxcs_mask;
  4394. + uint32_t st_space[32], xmm_space[64], padding[24];
  4395. +} elf_fpregset_t;
  4396. +
  4397. +struct user_regs_struct
  4398. +{
  4399. + unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
  4400. + unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
  4401. + unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
  4402. +};
  4403. +#define ELF_NGREG 27
  4404. +typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
  4405. +
  4406. +struct user
  4407. +{
  4408. + struct user_regs_struct regs;
  4409. + int u_fpvalid;
  4410. + struct user_fpregs_struct i387;
  4411. + unsigned long u_tsize;
  4412. + unsigned long u_dsize;
  4413. + unsigned long u_ssize;
  4414. + unsigned long start_code;
  4415. + unsigned long start_stack;
  4416. + long signal;
  4417. + int reserved;
  4418. + struct user_regs_struct *u_ar0;
  4419. + struct user_fpregs_struct *u_fpstate;
  4420. + unsigned long magic;
  4421. + char u_comm[32];
  4422. + unsigned long u_debugreg[8];
  4423. +};
  4424. +
  4425. +#define PAGE_MASK (~(PAGE_SIZE-1))
  4426. +#define NBPG PAGE_SIZE
  4427. +#define UPAGES 1
  4428. +#define HOST_TEXT_START_ADDR (u.start_code)
  4429. +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  4430. diff -Nur musl-0.9.15/arch/x32/crt_arch.h musl-git/arch/x32/crt_arch.h
  4431. --- musl-0.9.15/arch/x32/crt_arch.h 1970-01-01 01:00:00.000000000 +0100
  4432. +++ musl-git/arch/x32/crt_arch.h 2014-02-25 15:24:14.000000000 +0100
  4433. @@ -0,0 +1,9 @@
  4434. +__asm__("\
  4435. +.text \n\
  4436. +.global _start \n\
  4437. +_start: \n\
  4438. + xor %rbp,%rbp \n\
  4439. + mov %rsp,%rdi \n\
  4440. + andq $-16,%rsp \n\
  4441. + call __cstart \n\
  4442. +");
  4443. diff -Nur musl-0.9.15/arch/x32/pthread_arch.h musl-git/arch/x32/pthread_arch.h
  4444. --- musl-0.9.15/arch/x32/pthread_arch.h 1970-01-01 01:00:00.000000000 +0100
  4445. +++ musl-git/arch/x32/pthread_arch.h 2014-02-25 15:24:14.000000000 +0100
  4446. @@ -0,0 +1,10 @@
  4447. +static inline struct pthread *__pthread_self()
  4448. +{
  4449. + struct pthread *self;
  4450. + __asm__ __volatile__ ("mov %%fs:0,%0" : "=r" (self) );
  4451. + return self;
  4452. +}
  4453. +
  4454. +#define TP_ADJ(p) (p)
  4455. +
  4456. +#define CANCEL_REG_IP 16
  4457. diff -Nur musl-0.9.15/arch/x32/reloc.h musl-git/arch/x32/reloc.h
  4458. --- musl-0.9.15/arch/x32/reloc.h 1970-01-01 01:00:00.000000000 +0100
  4459. +++ musl-git/arch/x32/reloc.h 2014-02-25 15:24:14.000000000 +0100
  4460. @@ -0,0 +1,46 @@
  4461. +#include <stdint.h>
  4462. +#include <string.h>
  4463. +#include <elf.h>
  4464. +
  4465. +#define LDSO_ARCH "x32"
  4466. +
  4467. +#define IS_COPY(x) ((x)==R_X86_64_COPY)
  4468. +#define IS_PLT(x) ((x)==R_X86_64_JUMP_SLOT)
  4469. +
  4470. +static inline void do_single_reloc(
  4471. + struct dso *self, unsigned char *base_addr,
  4472. + size_t *reloc_addr, int type, size_t addend,
  4473. + Sym *sym, size_t sym_size,
  4474. + struct symdef def, size_t sym_val)
  4475. +{
  4476. + switch(type) {
  4477. + case R_X86_64_GLOB_DAT:
  4478. + case R_X86_64_JUMP_SLOT:
  4479. + case R_X86_64_64:
  4480. + *reloc_addr = sym_val + addend;
  4481. + break;
  4482. + case R_X86_64_32:
  4483. + *(uint32_t *)reloc_addr = sym_val + addend;
  4484. + break;
  4485. + case R_X86_64_PC32:
  4486. + *reloc_addr = sym_val + addend - (size_t)reloc_addr + (size_t)base_addr;
  4487. + break;
  4488. + case R_X86_64_RELATIVE:
  4489. + *reloc_addr = (size_t)base_addr + addend;
  4490. + break;
  4491. + case R_X86_64_COPY:
  4492. + memcpy(reloc_addr, (void *)sym_val, sym_size);
  4493. + break;
  4494. + case R_X86_64_DTPMOD64:
  4495. + *reloc_addr = def.dso ? def.dso->tls_id : self->tls_id;
  4496. + break;
  4497. + case R_X86_64_DTPOFF64:
  4498. + *reloc_addr = def.sym->st_value + addend;
  4499. + break;
  4500. + case R_X86_64_TPOFF64:
  4501. + *reloc_addr = (def.sym
  4502. + ? def.sym->st_value - def.dso->tls_offset
  4503. + : 0 - self->tls_offset) + addend;
  4504. + break;
  4505. + }
  4506. +}
  4507. diff -Nur musl-0.9.15/arch/x32/src/syscall_cp_fixup.c musl-git/arch/x32/src/syscall_cp_fixup.c
  4508. --- musl-0.9.15/arch/x32/src/syscall_cp_fixup.c 1970-01-01 01:00:00.000000000 +0100
  4509. +++ musl-git/arch/x32/src/syscall_cp_fixup.c 2014-02-25 15:24:14.000000000 +0100
  4510. @@ -0,0 +1,31 @@
  4511. +#include <sys/syscall.h>
  4512. +long __syscall_cp_internal(volatile void*, long long, long long, long long, long long,
  4513. + long long, long long, long long);
  4514. +
  4515. +struct __timespec { long long tv_sec; long tv_nsec; };
  4516. +struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
  4517. +#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
  4518. +#define __fixup(X) do { if(X) X = (unsigned long) (&(struct __timespec_kernel) \
  4519. + { .tv_sec = __tsc(X)->tv_sec, .tv_nsec = __tsc(X)->tv_nsec}); } while(0)
  4520. +
  4521. +long __syscall_cp_asm (volatile void * foo, long long n, long long a1, long long a2, long long a3,
  4522. + long long a4, long long a5, long long a6) {
  4523. + switch (n) {
  4524. + case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6:
  4525. + __fixup(a5);
  4526. + break;
  4527. + case SYS_futex:
  4528. + if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */)
  4529. + __fixup(a4);
  4530. + break;
  4531. + case SYS_clock_nanosleep:
  4532. + case SYS_rt_sigtimedwait: case SYS_ppoll:
  4533. + __fixup(a3);
  4534. + break;
  4535. + case SYS_nanosleep:
  4536. + __fixup(a1);
  4537. + break;
  4538. + }
  4539. + return __syscall_cp_internal(foo, n, a1, a2, a3, a4, a5, a6);
  4540. +}
  4541. +
  4542. diff -Nur musl-0.9.15/arch/x32/syscall_arch.h musl-git/arch/x32/syscall_arch.h
  4543. --- musl-0.9.15/arch/x32/syscall_arch.h 1970-01-01 01:00:00.000000000 +0100
  4544. +++ musl-git/arch/x32/syscall_arch.h 2014-02-25 15:24:14.000000000 +0100
  4545. @@ -0,0 +1,117 @@
  4546. +#define __SYSCALL_LL_E(x) (x)
  4547. +#define __SYSCALL_LL_O(x) (x)
  4548. +
  4549. +#define __scc(X) sizeof(1?(X):0ULL) < 8 ? (unsigned long) (X) : (long long) (X)
  4550. +typedef long long syscall_arg_t;
  4551. +struct __timespec { long long tv_sec; long tv_nsec; };
  4552. +struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
  4553. +#define __tsc(X) ((struct __timespec*)(unsigned long)(X))
  4554. +#define __fixup(X) do { if(X) X = (unsigned long) (&(struct __timespec_kernel) \
  4555. + { .tv_sec = __tsc(X)->tv_sec, .tv_nsec = __tsc(X)->tv_nsec}); } while(0)
  4556. +#define __fixup_case_2 \
  4557. + case SYS_nanosleep: \
  4558. + __fixup(a1); break; \
  4559. + case SYS_clock_settime: \
  4560. + __fixup(a2); break;
  4561. +#define __fixup_case_3 \
  4562. + case SYS_clock_nanosleep: case SYS_rt_sigtimedwait: case SYS_ppoll: \
  4563. + __fixup(a3); break; \
  4564. + case SYS_utimensat: \
  4565. + if(a3) a3 = (unsigned long) ((struct __timespec_kernel[2]) { \
  4566. + [0] = {.tv_sec = __tsc(a3)[0].tv_sec, .tv_nsec = __tsc(a3)[0].tv_nsec}, \
  4567. + [1] = {.tv_sec = __tsc(a3)[1].tv_sec, .tv_nsec = __tsc(a3)[1].tv_nsec}, \
  4568. + }); break;
  4569. +#define __fixup_case_4 \
  4570. + case SYS_futex: \
  4571. + if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */) __fixup(a4); break;
  4572. +#define __fixup_case_5 \
  4573. + case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6: \
  4574. + __fixup(a5); break;
  4575. +
  4576. +static __inline long __syscall0(long long n)
  4577. +{
  4578. + unsigned long ret;
  4579. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n) : "rcx", "r11", "memory");
  4580. + return ret;
  4581. +}
  4582. +
  4583. +static __inline long __syscall1(long long n, long long a1)
  4584. +{
  4585. + unsigned long ret;
  4586. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1) : "rcx", "r11", "memory");
  4587. + return ret;
  4588. +}
  4589. +
  4590. +static __inline long __syscall2(long long n, long long a1, long long a2)
  4591. +{
  4592. + unsigned long ret;
  4593. + struct __timespec *ts2 = 0;
  4594. + switch (n) {
  4595. + __fixup_case_2;
  4596. + }
  4597. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2)
  4598. + : "rcx", "r11", "memory");
  4599. + return ret;
  4600. +}
  4601. +
  4602. +static __inline long __syscall3(long long n, long long a1, long long a2, long long a3)
  4603. +{
  4604. + unsigned long ret;
  4605. + switch (n) {
  4606. + __fixup_case_2;
  4607. + __fixup_case_3;
  4608. + }
  4609. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4610. + "d"(a3) : "rcx", "r11", "memory");
  4611. + return ret;
  4612. +}
  4613. +
  4614. +static __inline long __syscall4(long long n, long long a1, long long a2, long long a3,
  4615. + long long a4_)
  4616. +{
  4617. + unsigned long ret;
  4618. + register long long a4 __asm__("r10") = a4_;
  4619. + switch (n) {
  4620. + __fixup_case_2;
  4621. + __fixup_case_3;
  4622. + __fixup_case_4;
  4623. + }
  4624. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4625. + "d"(a3), "r"(a4): "rcx", "r11", "memory");
  4626. + return ret;
  4627. +}
  4628. +
  4629. +static __inline long __syscall5(long long n, long long a1, long long a2, long long a3,
  4630. + long long a4_, long long a5_)
  4631. +{
  4632. + unsigned long ret;
  4633. + register long long a4 __asm__("r10") = a4_;
  4634. + register long long a5 __asm__("r8") = a5_;
  4635. + switch (n) {
  4636. + __fixup_case_2;
  4637. + __fixup_case_3;
  4638. + __fixup_case_4;
  4639. + __fixup_case_5;
  4640. + }
  4641. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4642. + "d"(a3), "r"(a4), "r"(a5) : "rcx", "r11", "memory");
  4643. + return ret;
  4644. +}
  4645. +
  4646. +static __inline long __syscall6(long long n, long long a1, long long a2, long long a3,
  4647. + long long a4_, long long a5_, long long a6_)
  4648. +{
  4649. + unsigned long ret;
  4650. + register long long a4 __asm__("r10") = a4_;
  4651. + register long long a5 __asm__("r8") = a5_;
  4652. + register long long a6 __asm__("r9") = a6_;
  4653. + switch (n) {
  4654. + __fixup_case_2;
  4655. + __fixup_case_3;
  4656. + __fixup_case_4;
  4657. + __fixup_case_5;
  4658. + }
  4659. + __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  4660. + "d"(a3), "r"(a4), "r"(a5), "r"(a6) : "rcx", "r11", "memory");
  4661. + return ret;
  4662. +}
  4663. diff -Nur musl-0.9.15/arch/x86_64/atomic.h musl-git/arch/x86_64/atomic.h
  4664. --- musl-0.9.15/arch/x86_64/atomic.h 2014-01-03 21:12:17.000000000 +0100
  4665. +++ musl-git/arch/x86_64/atomic.h 2014-02-25 15:24:14.000000000 +0100
  4666. @@ -5,38 +5,36 @@
  4667. static inline int a_ctz_64(uint64_t x)
  4668. {
  4669. - long r;
  4670. - __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
  4671. - return r;
  4672. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  4673. + return x;
  4674. }
  4675. static inline int a_ctz_l(unsigned long x)
  4676. {
  4677. - long r;
  4678. - __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
  4679. - return r;
  4680. + __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
  4681. + return x;
  4682. }
  4683. static inline void a_and_64(volatile uint64_t *p, uint64_t v)
  4684. {
  4685. - __asm__( "lock ; andq %1, %0"
  4686. - : "=m"(*(long *)p) : "r"(v) : "memory" );
  4687. + __asm__( "lock ; and %1, %0"
  4688. + : "=m"(*p) : "r"(v) : "memory" );
  4689. }
  4690. static inline void a_or_64(volatile uint64_t *p, uint64_t v)
  4691. {
  4692. - __asm__( "lock ; orq %1, %0"
  4693. - : "=m"(*(long *)p) : "r"(v) : "memory" );
  4694. + __asm__( "lock ; or %1, %0"
  4695. + : "=m"(*p) : "r"(v) : "memory" );
  4696. }
  4697. static inline void a_store_l(volatile void *p, long x)
  4698. {
  4699. - __asm__( "movq %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  4700. + __asm__( "mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory" );
  4701. }
  4702. static inline void a_or_l(volatile void *p, long v)
  4703. {
  4704. - __asm__( "lock ; orq %1, %0"
  4705. + __asm__( "lock ; or %1, %0"
  4706. : "=m"(*(long *)p) : "r"(v) : "memory" );
  4707. }
  4708. @@ -56,7 +54,7 @@
  4709. static inline int a_cas(volatile int *p, int t, int s)
  4710. {
  4711. - __asm__( "lock ; cmpxchgl %3, %1"
  4712. + __asm__( "lock ; cmpxchg %3, %1"
  4713. : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
  4714. return t;
  4715. }
  4716. @@ -74,13 +72,13 @@
  4717. static inline void a_or(volatile void *p, int v)
  4718. {
  4719. - __asm__( "lock ; orl %1, %0"
  4720. + __asm__( "lock ; or %1, %0"
  4721. : "=m"(*(int *)p) : "r"(v) : "memory" );
  4722. }
  4723. static inline void a_and(volatile void *p, int v)
  4724. {
  4725. - __asm__( "lock ; andl %1, %0"
  4726. + __asm__( "lock ; and %1, %0"
  4727. : "=m"(*(int *)p) : "r"(v) : "memory" );
  4728. }
  4729. @@ -110,7 +108,7 @@
  4730. static inline void a_store(volatile int *p, int x)
  4731. {
  4732. - __asm__( "movl %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  4733. + __asm__( "mov %1, %0" : "=m"(*p) : "r"(x) : "memory" );
  4734. }
  4735. static inline void a_spin()
  4736. diff -Nur musl-0.9.15/arch/x86_64/bits/shm.h musl-git/arch/x86_64/bits/shm.h
  4737. --- musl-0.9.15/arch/x86_64/bits/shm.h 2014-01-03 21:12:17.000000000 +0100
  4738. +++ musl-git/arch/x86_64/bits/shm.h 2014-02-25 15:24:14.000000000 +0100
  4739. @@ -13,3 +13,14 @@
  4740. unsigned long __pad1;
  4741. unsigned long __pad2;
  4742. };
  4743. +
  4744. +struct shminfo {
  4745. + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  4746. +};
  4747. +
  4748. +struct shm_info {
  4749. + int __used_ids;
  4750. + unsigned long shm_tot, shm_rss, shm_swp;
  4751. + unsigned long __swap_attempts, __swap_successes;
  4752. +};
  4753. +
  4754. diff -Nur musl-0.9.15/arch/x86_64/bits/stat.h musl-git/arch/x86_64/bits/stat.h
  4755. --- musl-0.9.15/arch/x86_64/bits/stat.h 2014-01-03 21:12:17.000000000 +0100
  4756. +++ musl-git/arch/x86_64/bits/stat.h 2014-02-25 15:24:14.000000000 +0100
  4757. @@ -2,7 +2,7 @@
  4758. * by the corresponding correctly-sized userspace types. */
  4759. struct stat {
  4760. - unsigned long st_dev;
  4761. + dev_t st_dev;
  4762. ino_t st_ino;
  4763. nlink_t st_nlink;
  4764. diff -Nur musl-0.9.15/arch/x86_64/bits/termios.h musl-git/arch/x86_64/bits/termios.h
  4765. --- musl-0.9.15/arch/x86_64/bits/termios.h 2014-01-03 21:12:17.000000000 +0100
  4766. +++ musl-git/arch/x86_64/bits/termios.h 2014-02-25 15:24:14.000000000 +0100
  4767. @@ -42,6 +42,7 @@
  4768. #define IXANY 0004000
  4769. #define IXOFF 0010000
  4770. #define IMAXBEL 0020000
  4771. +#define IUTF8 0040000
  4772. #define OPOST 0000001
  4773. #define OLCUC 0000002
  4774. @@ -75,9 +76,6 @@
  4775. #define VT0 0000000
  4776. #define VT1 0040000
  4777. -/* ?? */
  4778. -#define XTABS 0014000
  4779. -
  4780. #define B0 0000000
  4781. #define B50 0000001
  4782. #define B75 0000002
  4783. @@ -125,8 +123,6 @@
  4784. #define HUPCL 0002000
  4785. #define CLOCAL 0004000
  4786. -#define CRTSCTS 020000000000
  4787. -
  4788. #define ISIG 0000001
  4789. #define ICANON 0000002
  4790. #define ECHO 0000010
  4791. @@ -137,14 +133,11 @@
  4792. #define TOSTOP 0000400
  4793. #define IEXTEN 0100000
  4794. -/* Extensions? */
  4795. -#define CBAUDEX 0010000
  4796. #define ECHOCTL 0001000
  4797. #define ECHOPRT 0002000
  4798. #define ECHOKE 0004000
  4799. #define FLUSHO 0010000
  4800. #define PENDIN 0040000
  4801. -#define EXTPROC 0200000
  4802. #define TCOOFF 0
  4803. #define TCOON 1
  4804. @@ -158,3 +151,10 @@
  4805. #define TCSANOW 0
  4806. #define TCSADRAIN 1
  4807. #define TCSAFLUSH 2
  4808. +
  4809. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  4810. +#define CBAUDEX 0010000
  4811. +#define CRTSCTS 020000000000
  4812. +#define EXTPROC 0200000
  4813. +#define XTABS 0014000
  4814. +#endif
  4815. diff -Nur musl-0.9.15/arch/x86_64/pthread_arch.h musl-git/arch/x86_64/pthread_arch.h
  4816. --- musl-0.9.15/arch/x86_64/pthread_arch.h 2014-01-03 21:12:17.000000000 +0100
  4817. +++ musl-git/arch/x86_64/pthread_arch.h 2014-02-25 15:24:14.000000000 +0100
  4818. @@ -1,7 +1,7 @@
  4819. static inline struct pthread *__pthread_self()
  4820. {
  4821. struct pthread *self;
  4822. - __asm__ __volatile__ ("movq %%fs:0,%0" : "=r" (self) );
  4823. + __asm__ __volatile__ ("mov %%fs:0,%0" : "=r" (self) );
  4824. return self;
  4825. }
  4826. diff -Nur musl-0.9.15/configure musl-git/configure
  4827. --- musl-0.9.15/configure 2014-01-03 21:12:17.000000000 +0100
  4828. +++ musl-git/configure 2014-02-25 15:24:14.000000000 +0100
  4829. @@ -224,10 +224,12 @@
  4830. case "$target" in
  4831. arm*) ARCH=arm ;;
  4832. i?86*) ARCH=i386 ;;
  4833. +x86_64-x32*|x32*) ARCH=x32 ;;
  4834. x86_64*) ARCH=x86_64 ;;
  4835. mips-*|mipsel-*) ARCH=mips ;;
  4836. microblaze-*) ARCH=microblaze ;;
  4837. powerpc-*) ARCH=powerpc ;;
  4838. +sh-*) ARCH=superh ;;
  4839. unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
  4840. *) fail "$0: unknown or unsupported target \"$target\"" ;;
  4841. esac
  4842. @@ -381,6 +383,7 @@
  4843. tryflag CFLAGS_AUTO -Wno-unused-value
  4844. tryflag CFLAGS_AUTO -Wno-unused-but-set-variable
  4845. tryflag CFLAGS_AUTO -Wno-unknown-pragmas
  4846. +tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast
  4847. fi
  4848. # Some patched GCC builds have these defaults messed up...
  4849. @@ -410,12 +413,17 @@
  4850. trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf
  4851. fi
  4852. -test "$ARCH" = "mips" && trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" \
  4853. -&& SUBARCH=${SUBARCH}el
  4854. +if test "$ARCH" = "mips" ; then
  4855. +trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el
  4856. +trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf
  4857. +fi
  4858. test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \
  4859. && SUBARCH=${SUBARCH}el
  4860. +test "$ARCH" = "superh" && trycppif __LITTLE_ENDIAN__ "$t" \
  4861. +&& SUBARCH=${SUBARCH}el
  4862. +
  4863. test "$SUBARCH" \
  4864. && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH"
  4865. diff -Nur musl-0.9.15/crt/superh/crti.s musl-git/crt/superh/crti.s
  4866. --- musl-0.9.15/crt/superh/crti.s 1970-01-01 01:00:00.000000000 +0100
  4867. +++ musl-git/crt/superh/crti.s 2014-02-25 15:24:14.000000000 +0100
  4868. @@ -0,0 +1,13 @@
  4869. +.section .init
  4870. +.global _init
  4871. +.type _init, @function
  4872. +_init:
  4873. + sts.l pr, @-r15
  4874. + nop
  4875. +
  4876. +.section .fini
  4877. +.global _fini
  4878. +.type _fini, @function
  4879. +_fini:
  4880. + sts.l pr, @-r15
  4881. + nop
  4882. diff -Nur musl-0.9.15/crt/superh/crtn.s musl-git/crt/superh/crtn.s
  4883. --- musl-0.9.15/crt/superh/crtn.s 1970-01-01 01:00:00.000000000 +0100
  4884. +++ musl-git/crt/superh/crtn.s 2014-02-25 15:24:14.000000000 +0100
  4885. @@ -0,0 +1,9 @@
  4886. +.section .init
  4887. + lds.l @r15+, pr
  4888. + rts
  4889. + nop
  4890. +
  4891. +.section .fini
  4892. + lds.l @r15+, pr
  4893. + rts
  4894. + nop
  4895. diff -Nur musl-0.9.15/crt/x32/crti.s musl-git/crt/x32/crti.s
  4896. --- musl-0.9.15/crt/x32/crti.s 1970-01-01 01:00:00.000000000 +0100
  4897. +++ musl-git/crt/x32/crti.s 2014-02-25 15:24:14.000000000 +0100
  4898. @@ -0,0 +1,9 @@
  4899. +.section .init
  4900. +.global _init
  4901. +_init:
  4902. + push %rax
  4903. +
  4904. +.section .fini
  4905. +.global _fini
  4906. +_fini:
  4907. + push %rax
  4908. diff -Nur musl-0.9.15/crt/x32/crtn.s musl-git/crt/x32/crtn.s
  4909. --- musl-0.9.15/crt/x32/crtn.s 1970-01-01 01:00:00.000000000 +0100
  4910. +++ musl-git/crt/x32/crtn.s 2014-02-25 15:24:14.000000000 +0100
  4911. @@ -0,0 +1,7 @@
  4912. +.section .init
  4913. + pop %rax
  4914. + ret
  4915. +
  4916. +.section .fini
  4917. + pop %rax
  4918. + ret
  4919. diff -Nur musl-0.9.15/.gitignore musl-git/.gitignore
  4920. --- musl-0.9.15/.gitignore 1970-01-01 01:00:00.000000000 +0100
  4921. +++ musl-git/.gitignore 2014-02-25 15:24:14.000000000 +0100
  4922. @@ -0,0 +1,11 @@
  4923. +*.o
  4924. +*.lo
  4925. +*.a
  4926. +*.so
  4927. +*.so.1
  4928. +arch/*/bits/alltypes.h
  4929. +config.mak
  4930. +include/bits
  4931. +tools/musl-gcc
  4932. +lib/musl-gcc.specs
  4933. +src/internal/version.h
  4934. diff -Nur musl-0.9.15/include/arpa/inet.h musl-git/include/arpa/inet.h
  4935. --- musl-0.9.15/include/arpa/inet.h 2014-01-03 21:12:17.000000000 +0100
  4936. +++ musl-git/include/arpa/inet.h 2014-02-25 15:24:14.000000000 +0100
  4937. @@ -20,7 +20,7 @@
  4938. const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
  4939. int inet_aton (const char *, struct in_addr *);
  4940. -struct in_addr inet_makeaddr(int, int);
  4941. +struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
  4942. in_addr_t inet_lnaof(struct in_addr);
  4943. in_addr_t inet_netof(struct in_addr);
  4944. diff -Nur musl-0.9.15/include/dlfcn.h musl-git/include/dlfcn.h
  4945. --- musl-0.9.15/include/dlfcn.h 2014-01-03 21:12:17.000000000 +0100
  4946. +++ musl-git/include/dlfcn.h 2014-02-25 15:24:14.000000000 +0100
  4947. @@ -31,7 +31,7 @@
  4948. const char *dli_sname;
  4949. void *dli_saddr;
  4950. } Dl_info;
  4951. -int dladdr(void *, Dl_info *);
  4952. +int dladdr(const void *, Dl_info *);
  4953. int dlinfo(void *, int, void *);
  4954. #endif
  4955. diff -Nur musl-0.9.15/include/elf.h musl-git/include/elf.h
  4956. --- musl-0.9.15/include/elf.h 2014-01-03 21:12:17.000000000 +0100
  4957. +++ musl-git/include/elf.h 2014-02-25 15:24:14.000000000 +0100
  4958. @@ -1153,6 +1153,7 @@
  4959. #define EF_MIPS_64BIT_WHIRL 16
  4960. #define EF_MIPS_ABI2 32
  4961. #define EF_MIPS_ABI_ON32 64
  4962. +#define EF_MIPS_NAN2008 1024
  4963. #define EF_MIPS_ARCH 0xf0000000
  4964. @@ -2092,6 +2093,117 @@
  4965. #define R_AARCH64_NONE 0
  4966. #define R_AARCH64_ABS64 257
  4967. #define R_AARCH64_ABS32 258
  4968. +#define R_AARCH64_ABS16 259
  4969. +#define R_AARCH64_PREL64 260
  4970. +#define R_AARCH64_PREL32 261
  4971. +#define R_AARCH64_PREL16 262
  4972. +#define R_AARCH64_MOVW_UABS_G0 263
  4973. +#define R_AARCH64_MOVW_UABS_G0_NC 264
  4974. +#define R_AARCH64_MOVW_UABS_G1 265
  4975. +#define R_AARCH64_MOVW_UABS_G1_NC 266
  4976. +#define R_AARCH64_MOVW_UABS_G2 267
  4977. +#define R_AARCH64_MOVW_UABS_G2_NC 268
  4978. +#define R_AARCH64_MOVW_UABS_G3 269
  4979. +#define R_AARCH64_MOVW_SABS_G0 270
  4980. +#define R_AARCH64_MOVW_SABS_G1 271
  4981. +#define R_AARCH64_MOVW_SABS_G2 272
  4982. +#define R_AARCH64_LD_PREL_LO19 273
  4983. +#define R_AARCH64_ADR_PREL_LO21 274
  4984. +#define R_AARCH64_ADR_PREL_PG_HI21 275
  4985. +#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
  4986. +#define R_AARCH64_ADD_ABS_LO12_NC 277
  4987. +#define R_AARCH64_LDST8_ABS_LO12_NC 278
  4988. +#define R_AARCH64_TSTBR14 279
  4989. +#define R_AARCH64_CONDBR19 280
  4990. +#define R_AARCH64_JUMP26 282
  4991. +#define R_AARCH64_CALL26 283
  4992. +#define R_AARCH64_LDST16_ABS_LO12_NC 284
  4993. +#define R_AARCH64_LDST32_ABS_LO12_NC 285
  4994. +#define R_AARCH64_LDST64_ABS_LO12_NC 286
  4995. +#define R_AARCH64_MOVW_PREL_G0 287
  4996. +#define R_AARCH64_MOVW_PREL_G0_NC 288
  4997. +#define R_AARCH64_MOVW_PREL_G1 289
  4998. +#define R_AARCH64_MOVW_PREL_G1_NC 290
  4999. +#define R_AARCH64_MOVW_PREL_G2 291
  5000. +#define R_AARCH64_MOVW_PREL_G2_NC 292
  5001. +#define R_AARCH64_MOVW_PREL_G3 293
  5002. +#define R_AARCH64_LDST128_ABS_LO12_NC 299
  5003. +#define R_AARCH64_MOVW_GOTOFF_G0 300
  5004. +#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
  5005. +#define R_AARCH64_MOVW_GOTOFF_G1 302
  5006. +#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
  5007. +#define R_AARCH64_MOVW_GOTOFF_G2 304
  5008. +#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
  5009. +#define R_AARCH64_MOVW_GOTOFF_G3 306
  5010. +#define R_AARCH64_GOTREL64 307
  5011. +#define R_AARCH64_GOTREL32 308
  5012. +#define R_AARCH64_GOT_LD_PREL19 309
  5013. +#define R_AARCH64_LD64_GOTOFF_LO15 310
  5014. +#define R_AARCH64_ADR_GOT_PAGE 311
  5015. +#define R_AARCH64_LD64_GOT_LO12_NC 312
  5016. +#define R_AARCH64_LD64_GOTPAGE_LO15 313
  5017. +#define R_AARCH64_TLSGD_ADR_PREL21 512
  5018. +#define R_AARCH64_TLSGD_ADR_PAGE21 513
  5019. +#define R_AARCH64_TLSGD_ADD_LO12_NC 514
  5020. +#define R_AARCH64_TLSGD_MOVW_G1 515
  5021. +#define R_AARCH64_TLSGD_MOVW_G0_NC 516
  5022. +#define R_AARCH64_TLSLD_ADR_PREL21 517
  5023. +#define R_AARCH64_TLSLD_ADR_PAGE21 518
  5024. +#define R_AARCH64_TLSLD_ADD_LO12_NC 519
  5025. +#define R_AARCH64_TLSLD_MOVW_G1 520
  5026. +#define R_AARCH64_TLSLD_MOVW_G0_NC 521
  5027. +#define R_AARCH64_TLSLD_LD_PREL19 522
  5028. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
  5029. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
  5030. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
  5031. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
  5032. +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
  5033. +#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
  5034. +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
  5035. +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
  5036. +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
  5037. +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
  5038. +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
  5039. +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
  5040. +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
  5041. +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
  5042. +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
  5043. +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
  5044. +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
  5045. +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
  5046. +#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
  5047. +#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
  5048. +#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
  5049. +#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
  5050. +#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
  5051. +#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
  5052. +#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
  5053. +#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
  5054. +#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
  5055. +#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
  5056. +#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
  5057. +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
  5058. +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
  5059. +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
  5060. +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
  5061. +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
  5062. +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
  5063. +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
  5064. +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
  5065. +#define R_AARCH64_TLSDESC_LD_PREL19 560
  5066. +#define R_AARCH64_TLSDESC_ADR_PREL21 561
  5067. +#define R_AARCH64_TLSDESC_ADR_PAGE21 562
  5068. +#define R_AARCH64_TLSDESC_LD64_LO12 563
  5069. +#define R_AARCH64_TLSDESC_ADD_LO12 564
  5070. +#define R_AARCH64_TLSDESC_OFF_G1 565
  5071. +#define R_AARCH64_TLSDESC_OFF_G0_NC 566
  5072. +#define R_AARCH64_TLSDESC_LDR 567
  5073. +#define R_AARCH64_TLSDESC_ADD 568
  5074. +#define R_AARCH64_TLSDESC_CALL 569
  5075. +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
  5076. +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
  5077. +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
  5078. +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
  5079. #define R_AARCH64_COPY 1024
  5080. #define R_AARCH64_GLOB_DAT 1025
  5081. #define R_AARCH64_JUMP_SLOT 1026
  5082. diff -Nur musl-0.9.15/include/fcntl.h musl-git/include/fcntl.h
  5083. --- musl-0.9.15/include/fcntl.h 2014-01-03 21:12:17.000000000 +0100
  5084. +++ musl-git/include/fcntl.h 2014-02-25 15:24:14.000000000 +0100
  5085. @@ -148,6 +148,7 @@
  5086. #define SPLICE_F_MORE 4
  5087. #define SPLICE_F_GIFT 8
  5088. int fallocate(int, int, off_t, off_t);
  5089. +#define fallocate64 fallocate
  5090. ssize_t readahead(int, off_t, size_t);
  5091. int sync_file_range(int, off_t, off_t, unsigned);
  5092. ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
  5093. @@ -160,6 +161,7 @@
  5094. #define F_GETLK64 F_GETLK
  5095. #define F_SETLK64 F_SETLK
  5096. #define F_SETLKW64 F_SETLKW
  5097. +#define flock64 flock
  5098. #define open64 open
  5099. #define openat64 openat
  5100. #define creat64 creat
  5101. diff -Nur musl-0.9.15/include/netdb.h musl-git/include/netdb.h
  5102. --- musl-0.9.15/include/netdb.h 2014-01-03 21:12:17.000000000 +0100
  5103. +++ musl-git/include/netdb.h 2014-02-25 15:24:14.000000000 +0100
  5104. @@ -131,6 +131,7 @@
  5105. #define TRY_AGAIN 2
  5106. #define NO_RECOVERY 3
  5107. #define NO_DATA 4
  5108. +#define NO_ADDRESS NO_DATA
  5109. #endif
  5110. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5111. diff -Nur musl-0.9.15/include/netinet/if_ether.h musl-git/include/netinet/if_ether.h
  5112. --- musl-0.9.15/include/netinet/if_ether.h 2014-01-03 21:12:17.000000000 +0100
  5113. +++ musl-git/include/netinet/if_ether.h 2014-02-25 15:24:14.000000000 +0100
  5114. @@ -54,6 +54,7 @@
  5115. #define ETH_P_8021AH 0x88E7
  5116. #define ETH_P_MVRP 0x88F5
  5117. #define ETH_P_1588 0x88F7
  5118. +#define ETH_P_PRP 0x88FB
  5119. #define ETH_P_FCOE 0x8906
  5120. #define ETH_P_TDLS 0x890D
  5121. #define ETH_P_FIP 0x8914
  5122. diff -Nur musl-0.9.15/include/netinet/in.h musl-git/include/netinet/in.h
  5123. --- musl-0.9.15/include/netinet/in.h 2014-01-03 21:12:17.000000000 +0100
  5124. +++ musl-git/include/netinet/in.h 2014-02-25 15:24:14.000000000 +0100
  5125. @@ -149,7 +149,7 @@
  5126. (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe))
  5127. #define __ARE_4_EQUAL(a,b) \
  5128. - (!( 0[a]-0[b] | 1[a]-1[b] | 2[a]-2[b] | 3[a]-3[b] ))
  5129. + (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) ))
  5130. #define IN6_ARE_ADDR_EQUAL(a,b) \
  5131. __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b))
  5132. @@ -211,27 +211,13 @@
  5133. #define IP_MULTICAST_ALL 49
  5134. #define IP_UNICAST_IF 50
  5135. -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5136. -#define MCAST_JOIN_GROUP 42
  5137. -#define MCAST_BLOCK_SOURCE 43
  5138. -#define MCAST_UNBLOCK_SOURCE 44
  5139. -#define MCAST_LEAVE_GROUP 45
  5140. -#define MCAST_JOIN_SOURCE_GROUP 46
  5141. -#define MCAST_LEAVE_SOURCE_GROUP 47
  5142. -#define MCAST_MSFILTER 48
  5143. -
  5144. -#define MCAST_EXCLUDE 0
  5145. -#define MCAST_INCLUDE 1
  5146. -#endif
  5147. -
  5148. #define IP_RECVRETOPTS IP_RETOPTS
  5149. #define IP_PMTUDISC_DONT 0
  5150. #define IP_PMTUDISC_WANT 1
  5151. #define IP_PMTUDISC_DO 2
  5152. #define IP_PMTUDISC_PROBE 3
  5153. -
  5154. -#define SOL_IP 0
  5155. +#define IP_PMTUDISC_INTERFACE 4
  5156. #define IP_DEFAULT_MULTICAST_TTL 1
  5157. #define IP_DEFAULT_MULTICAST_LOOP 1
  5158. @@ -243,6 +229,19 @@
  5159. char ip_opts[40];
  5160. };
  5161. +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5162. +
  5163. +#define MCAST_JOIN_GROUP 42
  5164. +#define MCAST_BLOCK_SOURCE 43
  5165. +#define MCAST_UNBLOCK_SOURCE 44
  5166. +#define MCAST_LEAVE_GROUP 45
  5167. +#define MCAST_JOIN_SOURCE_GROUP 46
  5168. +#define MCAST_LEAVE_SOURCE_GROUP 47
  5169. +#define MCAST_MSFILTER 48
  5170. +
  5171. +#define MCAST_EXCLUDE 0
  5172. +#define MCAST_INCLUDE 1
  5173. +
  5174. struct ip_mreq
  5175. {
  5176. struct in_addr imr_multiaddr;
  5177. @@ -273,7 +272,6 @@
  5178. (sizeof(struct ip_msfilter) - sizeof(struct in_addr) \
  5179. + (numsrc) * sizeof(struct in_addr))
  5180. -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5181. struct group_req {
  5182. uint32_t gr_interface;
  5183. struct sockaddr_storage gr_group;
  5184. @@ -295,7 +293,6 @@
  5185. #define GROUP_FILTER_SIZE(numsrc) \
  5186. (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \
  5187. + (numsrc) * sizeof(struct sockaddr_storage))
  5188. -#endif
  5189. struct in_pktinfo
  5190. {
  5191. @@ -315,6 +312,7 @@
  5192. struct sockaddr_in6 ip6m_addr;
  5193. uint32_t ip6m_mtu;
  5194. };
  5195. +#endif
  5196. #define IPV6_ADDRFORM 1
  5197. #define IPV6_2292PKTINFO 2
  5198. @@ -324,7 +322,6 @@
  5199. #define IPV6_2292PKTOPTIONS 6
  5200. #define IPV6_CHECKSUM 7
  5201. #define IPV6_2292HOPLIMIT 8
  5202. -#define SCM_SRCRT IPV6_RXSRCRT
  5203. #define IPV6_NEXTHOP 9
  5204. #define IPV6_AUTHHDR 10
  5205. #define IPV6_UNICAST_HOPS 16
  5206. @@ -363,15 +360,11 @@
  5207. #define IPV6_RXHOPOPTS IPV6_HOPOPTS
  5208. #define IPV6_RXDSTOPTS IPV6_DSTOPTS
  5209. -
  5210. #define IPV6_PMTUDISC_DONT 0
  5211. #define IPV6_PMTUDISC_WANT 1
  5212. #define IPV6_PMTUDISC_DO 2
  5213. #define IPV6_PMTUDISC_PROBE 3
  5214. -#define SOL_IPV6 41
  5215. -#define SOL_ICMPV6 58
  5216. -
  5217. #define IPV6_RTHDR_LOOSE 0
  5218. #define IPV6_RTHDR_STRICT 1
  5219. diff -Nur musl-0.9.15/include/netinet/tcp.h musl-git/include/netinet/tcp.h
  5220. --- musl-0.9.15/include/netinet/tcp.h 2014-01-03 21:12:17.000000000 +0100
  5221. +++ musl-git/include/netinet/tcp.h 2014-02-25 15:24:14.000000000 +0100
  5222. @@ -44,42 +44,80 @@
  5223. #define SOL_TCP 6
  5224. #include <sys/types.h>
  5225. #include <sys/socket.h>
  5226. -#endif
  5227. +#include <stdint.h>
  5228. +#include <endian.h>
  5229. +
  5230. +typedef uint32_t tcp_seq;
  5231. +#define TH_FIN 0x01
  5232. +#define TH_SYN 0x02
  5233. +#define TH_RST 0x04
  5234. +#define TH_PUSH 0x08
  5235. +#define TH_ACK 0x10
  5236. +#define TH_URG 0x20
  5237. +
  5238. +struct tcphdr {
  5239. #ifdef _GNU_SOURCE
  5240. -#include <endian.h>
  5241. -struct tcphdr
  5242. -{
  5243. - u_int16_t source;
  5244. - u_int16_t dest;
  5245. - u_int32_t seq;
  5246. - u_int32_t ack_seq;
  5247. +#ifdef __GNUC__
  5248. + __extension__
  5249. +#endif
  5250. + union { struct {
  5251. +
  5252. + uint16_t source;
  5253. + uint16_t dest;
  5254. + uint32_t seq;
  5255. + uint32_t ack_seq;
  5256. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  5257. + uint16_t res1:4;
  5258. + uint16_t doff:4;
  5259. + uint16_t fin:1;
  5260. + uint16_t syn:1;
  5261. + uint16_t rst:1;
  5262. + uint16_t psh:1;
  5263. + uint16_t ack:1;
  5264. + uint16_t urg:1;
  5265. + uint16_t res2:2;
  5266. +#else
  5267. + uint16_t doff:4;
  5268. + uint16_t res1:4;
  5269. + uint16_t res2:2;
  5270. + uint16_t urg:1;
  5271. + uint16_t ack:1;
  5272. + uint16_t psh:1;
  5273. + uint16_t rst:1;
  5274. + uint16_t syn:1;
  5275. + uint16_t fin:1;
  5276. +#endif
  5277. + uint16_t window;
  5278. + uint16_t check;
  5279. + uint16_t urg_ptr;
  5280. +
  5281. + }; struct {
  5282. +#endif
  5283. +
  5284. + uint16_t th_sport;
  5285. + uint16_t th_dport;
  5286. + uint32_t th_seq;
  5287. + uint32_t th_ack;
  5288. #if __BYTE_ORDER == __LITTLE_ENDIAN
  5289. - u_int16_t res1:4;
  5290. - u_int16_t doff:4;
  5291. - u_int16_t fin:1;
  5292. - u_int16_t syn:1;
  5293. - u_int16_t rst:1;
  5294. - u_int16_t psh:1;
  5295. - u_int16_t ack:1;
  5296. - u_int16_t urg:1;
  5297. - u_int16_t res2:2;
  5298. + uint8_t th_x2:4;
  5299. + uint8_t th_off:4;
  5300. #else
  5301. - u_int16_t doff:4;
  5302. - u_int16_t res1:4;
  5303. - u_int16_t res2:2;
  5304. - u_int16_t urg:1;
  5305. - u_int16_t ack:1;
  5306. - u_int16_t psh:1;
  5307. - u_int16_t rst:1;
  5308. - u_int16_t syn:1;
  5309. - u_int16_t fin:1;
  5310. -#endif
  5311. - u_int16_t window;
  5312. - u_int16_t check;
  5313. - u_int16_t urg_ptr;
  5314. + uint8_t th_off:4;
  5315. + uint8_t th_x2:4;
  5316. +#endif
  5317. + uint8_t th_flags;
  5318. + uint16_t th_win;
  5319. + uint16_t th_sum;
  5320. + uint16_t th_urp;
  5321. +
  5322. +#ifdef _GNU_SOURCE
  5323. + }; };
  5324. +#endif
  5325. };
  5326. +#endif
  5327. +#ifdef _GNU_SOURCE
  5328. #define TCPI_OPT_TIMESTAMPS 1
  5329. #define TCPI_OPT_SACK 2
  5330. #define TCPI_OPT_WSCALE 4
  5331. @@ -93,37 +131,37 @@
  5332. struct tcp_info
  5333. {
  5334. - u_int8_t tcpi_state;
  5335. - u_int8_t tcpi_ca_state;
  5336. - u_int8_t tcpi_retransmits;
  5337. - u_int8_t tcpi_probes;
  5338. - u_int8_t tcpi_backoff;
  5339. - u_int8_t tcpi_options;
  5340. - u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
  5341. - u_int32_t tcpi_rto;
  5342. - u_int32_t tcpi_ato;
  5343. - u_int32_t tcpi_snd_mss;
  5344. - u_int32_t tcpi_rcv_mss;
  5345. - u_int32_t tcpi_unacked;
  5346. - u_int32_t tcpi_sacked;
  5347. - u_int32_t tcpi_lost;
  5348. - u_int32_t tcpi_retrans;
  5349. - u_int32_t tcpi_fackets;
  5350. - u_int32_t tcpi_last_data_sent;
  5351. - u_int32_t tcpi_last_ack_sent;
  5352. - u_int32_t tcpi_last_data_recv;
  5353. - u_int32_t tcpi_last_ack_recv;
  5354. - u_int32_t tcpi_pmtu;
  5355. - u_int32_t tcpi_rcv_ssthresh;
  5356. - u_int32_t tcpi_rtt;
  5357. - u_int32_t tcpi_rttvar;
  5358. - u_int32_t tcpi_snd_ssthresh;
  5359. - u_int32_t tcpi_snd_cwnd;
  5360. - u_int32_t tcpi_advmss;
  5361. - u_int32_t tcpi_reordering;
  5362. - u_int32_t tcpi_rcv_rtt;
  5363. - u_int32_t tcpi_rcv_space;
  5364. - u_int32_t tcpi_total_retrans;
  5365. + uint8_t tcpi_state;
  5366. + uint8_t tcpi_ca_state;
  5367. + uint8_t tcpi_retransmits;
  5368. + uint8_t tcpi_probes;
  5369. + uint8_t tcpi_backoff;
  5370. + uint8_t tcpi_options;
  5371. + uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
  5372. + uint32_t tcpi_rto;
  5373. + uint32_t tcpi_ato;
  5374. + uint32_t tcpi_snd_mss;
  5375. + uint32_t tcpi_rcv_mss;
  5376. + uint32_t tcpi_unacked;
  5377. + uint32_t tcpi_sacked;
  5378. + uint32_t tcpi_lost;
  5379. + uint32_t tcpi_retrans;
  5380. + uint32_t tcpi_fackets;
  5381. + uint32_t tcpi_last_data_sent;
  5382. + uint32_t tcpi_last_ack_sent;
  5383. + uint32_t tcpi_last_data_recv;
  5384. + uint32_t tcpi_last_ack_recv;
  5385. + uint32_t tcpi_pmtu;
  5386. + uint32_t tcpi_rcv_ssthresh;
  5387. + uint32_t tcpi_rtt;
  5388. + uint32_t tcpi_rttvar;
  5389. + uint32_t tcpi_snd_ssthresh;
  5390. + uint32_t tcpi_snd_cwnd;
  5391. + uint32_t tcpi_advmss;
  5392. + uint32_t tcpi_reordering;
  5393. + uint32_t tcpi_rcv_rtt;
  5394. + uint32_t tcpi_rcv_space;
  5395. + uint32_t tcpi_total_retrans;
  5396. };
  5397. #define TCP_MD5SIG_MAXKEYLEN 80
  5398. @@ -131,10 +169,10 @@
  5399. struct tcp_md5sig
  5400. {
  5401. struct sockaddr_storage tcpm_addr;
  5402. - u_int16_t __tcpm_pad1;
  5403. - u_int16_t tcpm_keylen;
  5404. - u_int32_t __tcpm_pad2;
  5405. - u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
  5406. + uint16_t __tcpm_pad1;
  5407. + uint16_t tcpm_keylen;
  5408. + uint32_t __tcpm_pad2;
  5409. + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
  5410. };
  5411. #endif
  5412. diff -Nur musl-0.9.15/include/netinet/udp.h musl-git/include/netinet/udp.h
  5413. --- musl-0.9.15/include/netinet/udp.h 2014-01-03 21:12:17.000000000 +0100
  5414. +++ musl-git/include/netinet/udp.h 2014-02-25 15:24:14.000000000 +0100
  5415. @@ -5,19 +5,22 @@
  5416. extern "C" {
  5417. #endif
  5418. +#include <features.h>
  5419. #include <stdint.h>
  5420. -struct udphdr {
  5421. - uint16_t source;
  5422. - uint16_t dest;
  5423. - uint16_t len;
  5424. - uint16_t check;
  5425. -};
  5426. -
  5427. +#ifdef _GNU_SOURCE
  5428. #define uh_sport source
  5429. #define uh_dport dest
  5430. #define uh_ulen len
  5431. #define uh_sum check
  5432. +#endif
  5433. +
  5434. +struct udphdr {
  5435. + uint16_t uh_sport;
  5436. + uint16_t uh_dport;
  5437. + uint16_t uh_ulen;
  5438. + uint16_t uh_sum;
  5439. +};
  5440. #define UDP_CORK 1
  5441. #define UDP_ENCAP 100
  5442. diff -Nur musl-0.9.15/include/sched.h musl-git/include/sched.h
  5443. --- musl-0.9.15/include/sched.h 2014-01-03 21:12:17.000000000 +0100
  5444. +++ musl-git/include/sched.h 2014-02-25 15:24:14.000000000 +0100
  5445. @@ -78,7 +78,7 @@
  5446. int sched_getaffinity(pid_t, size_t, cpu_set_t *);
  5447. int sched_setaffinity(pid_t, size_t, const cpu_set_t *);
  5448. -#define __CPU_op_S(i, size, set, op) ( (i)/8 >= (size) ? 0 : \
  5449. +#define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \
  5450. ((set)->__bits[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) )
  5451. #define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=)
  5452. diff -Nur musl-0.9.15/include/signal.h musl-git/include/signal.h
  5453. --- musl-0.9.15/include/signal.h 2014-01-03 21:12:17.000000000 +0100
  5454. +++ musl-git/include/signal.h 2014-02-25 15:24:14.000000000 +0100
  5455. @@ -227,8 +227,8 @@
  5456. typedef void (*sighandler_t)(int);
  5457. void (*bsd_signal(int, void (*)(int)))(int);
  5458. int sigisemptyset(const sigset_t *);
  5459. -int sigorset (sigset_t *, sigset_t *, sigset_t *);
  5460. -int sigandset(sigset_t *, sigset_t *, sigset_t *);
  5461. +int sigorset (sigset_t *, const sigset_t *, const sigset_t *);
  5462. +int sigandset(sigset_t *, const sigset_t *, const sigset_t *);
  5463. #define SA_NOMASK SA_NODEFER
  5464. #define SA_ONESHOT SA_RESETHAND
  5465. diff -Nur musl-0.9.15/include/stdlib.h musl-git/include/stdlib.h
  5466. --- musl-0.9.15/include/stdlib.h 2014-01-03 21:12:17.000000000 +0100
  5467. +++ musl-git/include/stdlib.h 2014-02-25 15:24:14.000000000 +0100
  5468. @@ -93,7 +93,7 @@
  5469. #define WSTOPSIG(s) WEXITSTATUS(s)
  5470. #define WIFEXITED(s) (!WTERMSIG(s))
  5471. #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
  5472. -#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
  5473. +#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
  5474. int posix_memalign (void **, size_t, size_t);
  5475. int setenv (const char *, const char *, int);
  5476. diff -Nur musl-0.9.15/include/sys/inotify.h musl-git/include/sys/inotify.h
  5477. --- musl-0.9.15/include/sys/inotify.h 2014-01-03 21:12:17.000000000 +0100
  5478. +++ musl-git/include/sys/inotify.h 2014-02-25 15:24:14.000000000 +0100
  5479. @@ -48,7 +48,7 @@
  5480. int inotify_init(void);
  5481. int inotify_init1(int);
  5482. int inotify_add_watch(int, const char *, uint32_t);
  5483. -int inotify_rm_watch(int, uint32_t);
  5484. +int inotify_rm_watch(int, int);
  5485. #ifdef __cplusplus
  5486. }
  5487. diff -Nur musl-0.9.15/include/sys/mman.h musl-git/include/sys/mman.h
  5488. --- musl-0.9.15/include/sys/mman.h 2014-01-03 21:12:17.000000000 +0100
  5489. +++ musl-git/include/sys/mman.h 2014-02-25 15:24:14.000000000 +0100
  5490. @@ -33,7 +33,7 @@
  5491. #ifdef _GNU_SOURCE
  5492. void *mremap (void *, size_t, size_t, int, ...);
  5493. -int remap_file_pages (void *, size_t, int, ssize_t, int);
  5494. +int remap_file_pages (void *, size_t, int, size_t, int);
  5495. #endif
  5496. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5497. diff -Nur musl-0.9.15/include/sys/sem.h musl-git/include/sys/sem.h
  5498. --- musl-0.9.15/include/sys/sem.h 2014-01-03 21:12:17.000000000 +0100
  5499. +++ musl-git/include/sys/sem.h 2014-02-25 15:24:14.000000000 +0100
  5500. @@ -29,19 +29,19 @@
  5501. struct semid_ds {
  5502. struct ipc_perm sem_perm;
  5503. - long sem_otime;
  5504. - unsigned long __unused1;
  5505. - long sem_ctime;
  5506. - unsigned long __unused2;
  5507. + time_t sem_otime;
  5508. + time_t __unused1;
  5509. + time_t sem_ctime;
  5510. + time_t __unused2;
  5511. #if __BYTE_ORDER == __LITTLE_ENDIAN
  5512. unsigned short sem_nsems;
  5513. - char __sem_nsems_pad[sizeof(long)-sizeof(short)];
  5514. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  5515. #else
  5516. - char __sem_nsems_pad[sizeof(long)-sizeof(short)];
  5517. + char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
  5518. unsigned short sem_nsems;
  5519. #endif
  5520. - unsigned long __unused3;
  5521. - unsigned long __unused4;
  5522. + time_t __unused3;
  5523. + time_t __unused4;
  5524. };
  5525. #define _SEM_SEMUN_UNDEFINED 1
  5526. diff -Nur musl-0.9.15/include/sys/shm.h musl-git/include/sys/shm.h
  5527. --- musl-0.9.15/include/sys/shm.h 2014-01-03 21:12:17.000000000 +0100
  5528. +++ musl-git/include/sys/shm.h 2014-02-25 15:24:14.000000000 +0100
  5529. @@ -14,6 +14,13 @@
  5530. #include <bits/alltypes.h>
  5531. #include <sys/ipc.h>
  5532. +
  5533. +#ifdef _GNU_SOURCE
  5534. +#define __used_ids used_ids
  5535. +#define __swap_attempts swap_attempts
  5536. +#define __swap_successes swap_successes
  5537. +#endif
  5538. +
  5539. #include <bits/shm.h>
  5540. #define SHM_R 0400
  5541. @@ -33,20 +40,6 @@
  5542. #define SHM_HUGETLB 04000
  5543. #define SHM_NORESERVE 010000
  5544. -struct shminfo {
  5545. - unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
  5546. -};
  5547. -
  5548. -struct shm_info {
  5549. - int used_ids;
  5550. - unsigned long shm_tot, shm_rss, shm_swp;
  5551. -#ifdef _GNU_SOURCE
  5552. - unsigned long swap_attempts, swap_successes;
  5553. -#else
  5554. - unsigned long __reserved[2];
  5555. -#endif
  5556. -};
  5557. -
  5558. typedef unsigned long shmatt_t;
  5559. void *shmat(int, const void *, int);
  5560. diff -Nur musl-0.9.15/include/sys/socket.h musl-git/include/sys/socket.h
  5561. --- musl-0.9.15/include/sys/socket.h 2014-01-03 21:12:17.000000000 +0100
  5562. +++ musl-git/include/sys/socket.h 2014-02-25 15:24:14.000000000 +0100
  5563. @@ -202,11 +202,16 @@
  5564. #define SO_LOCK_FILTER 44
  5565. #define SO_SELECT_ERR_QUEUE 45
  5566. #define SO_BUSY_POLL 46
  5567. +#define SO_MAX_PACING_RATE 47
  5568. #ifndef SOL_SOCKET
  5569. #define SOL_SOCKET 1
  5570. #endif
  5571. +#define SOL_IP 0
  5572. +#define SOL_IPV6 41
  5573. +#define SOL_ICMPV6 58
  5574. +
  5575. #define SOL_RAW 255
  5576. #define SOL_DECNET 261
  5577. #define SOL_X25 262
  5578. diff -Nur musl-0.9.15/include/sys/sysctl.h musl-git/include/sys/sysctl.h
  5579. --- musl-0.9.15/include/sys/sysctl.h 2014-01-03 21:12:17.000000000 +0100
  5580. +++ musl-git/include/sys/sysctl.h 1970-01-01 01:00:00.000000000 +0100
  5581. @@ -1,17 +0,0 @@
  5582. -#ifndef _SYS_SYSCTL_H
  5583. -#define _SYS_SYSCTL_H
  5584. -
  5585. -#ifdef __cplusplus
  5586. -extern "C" {
  5587. -#endif
  5588. -
  5589. -#define __NEED_size_t
  5590. -#include <bits/alltypes.h>
  5591. -
  5592. -int sysctl (int *, int, void *, size_t *, void *, size_t);
  5593. -
  5594. -#ifdef __cplusplus
  5595. -}
  5596. -#endif
  5597. -
  5598. -#endif
  5599. diff -Nur musl-0.9.15/include/sys/time.h musl-git/include/sys/time.h
  5600. --- musl-0.9.15/include/sys/time.h 2014-01-03 21:12:17.000000000 +0100
  5601. +++ musl-git/include/sys/time.h 2014-02-25 15:24:14.000000000 +0100
  5602. @@ -51,6 +51,17 @@
  5603. ((a)->tv_usec += 1000000, (a)->tv_sec--) )
  5604. #endif
  5605. +#if defined(_GNU_SOURCE)
  5606. +#define TIMEVAL_TO_TIMESPEC(tv, ts) ( \
  5607. + (ts)->tv_sec = (tv)->tv_sec, \
  5608. + (ts)->tv_nsec = (tv)->tv_usec * 1000, \
  5609. + (void)0 )
  5610. +#define TIMESPEC_TO_TIMEVAL(tv, ts) ( \
  5611. + (tv)->tv_sec = (ts)->tv_sec, \
  5612. + (tv)->tv_usec = (ts)->tv_nsec / 1000, \
  5613. + (void)0 )
  5614. +#endif
  5615. +
  5616. #ifdef __cplusplus
  5617. }
  5618. #endif
  5619. diff -Nur musl-0.9.15/include/sys/wait.h musl-git/include/sys/wait.h
  5620. --- musl-0.9.15/include/sys/wait.h 2014-01-03 21:12:17.000000000 +0100
  5621. +++ musl-git/include/sys/wait.h 2014-02-25 15:24:14.000000000 +0100
  5622. @@ -50,7 +50,7 @@
  5623. #define WCOREDUMP(s) ((s) & 0x80)
  5624. #define WIFEXITED(s) (!WTERMSIG(s))
  5625. #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
  5626. -#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
  5627. +#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
  5628. #define WIFCONTINUED(s) ((s) == 0xffff)
  5629. #ifdef __cplusplus
  5630. diff -Nur musl-0.9.15/include/syslog.h musl-git/include/syslog.h
  5631. --- musl-0.9.15/include/syslog.h 2014-01-03 21:12:17.000000000 +0100
  5632. +++ musl-git/include/syslog.h 2014-02-25 15:24:14.000000000 +0100
  5633. @@ -21,7 +21,7 @@
  5634. #define LOG_MAKEPRI(f, p) (((f)<<3)|(p))
  5635. #define LOG_MASK(p) (1<<(p))
  5636. -#define LOG_UPTO(p) ((1<<(p)+1)-1)
  5637. +#define LOG_UPTO(p) ((1<<((p)+1))-1)
  5638. #define LOG_KERN (0<<3)
  5639. #define LOG_USER (1<<3)
  5640. diff -Nur musl-0.9.15/include/time.h musl-git/include/time.h
  5641. --- musl-0.9.15/include/time.h 2014-01-03 21:12:17.000000000 +0100
  5642. +++ musl-git/include/time.h 2014-02-25 15:24:14.000000000 +0100
  5643. @@ -125,7 +125,7 @@
  5644. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  5645. -int stime(time_t *);
  5646. +int stime(const time_t *);
  5647. time_t timegm(struct tm *);
  5648. #endif
  5649. diff -Nur musl-0.9.15/include/utmp.h musl-git/include/utmp.h
  5650. --- musl-0.9.15/include/utmp.h 2014-01-03 21:12:17.000000000 +0100
  5651. +++ musl-git/include/utmp.h 2014-02-25 15:24:14.000000000 +0100
  5652. @@ -10,6 +10,7 @@
  5653. #define ACCOUNTING 9
  5654. #define UT_NAMESIZE 32
  5655. #define UT_HOSTSIZE 256
  5656. +#define UT_LINESIZE 32
  5657. struct lastlog {
  5658. time_t ll_time;
  5659. @@ -22,6 +23,8 @@
  5660. #define ut_addr ut_addr_v6[0]
  5661. #define utmp utmpx
  5662. #define utmpname(x) (-1)
  5663. +#define e_exit __e_exit
  5664. +#define e_termination __e_termination
  5665. void endutent(void);
  5666. struct utmp *getutent(void);
  5667. diff -Nur musl-0.9.15/include/utmpx.h musl-git/include/utmpx.h
  5668. --- musl-0.9.15/include/utmpx.h 2014-01-03 21:12:17.000000000 +0100
  5669. +++ musl-git/include/utmpx.h 2014-02-25 15:24:14.000000000 +0100
  5670. @@ -5,6 +5,8 @@
  5671. extern "C" {
  5672. #endif
  5673. +#include <features.h>
  5674. +
  5675. #define __NEED_pid_t
  5676. #define __NEED_time_t
  5677. #define __NEED_suseconds_t
  5678. @@ -12,19 +14,17 @@
  5679. #include <bits/alltypes.h>
  5680. -#define UT_LINESIZE 32
  5681. -
  5682. struct utmpx
  5683. {
  5684. short ut_type;
  5685. pid_t ut_pid;
  5686. - char ut_line[UT_LINESIZE];
  5687. + char ut_line[32];
  5688. char ut_id[4];
  5689. char ut_user[32];
  5690. char ut_host[256];
  5691. struct {
  5692. - short e_termination;
  5693. - short e_exit;
  5694. + short __e_termination;
  5695. + short __e_exit;
  5696. } ut_exit;
  5697. long ut_session;
  5698. struct timeval ut_tv;
  5699. @@ -39,7 +39,11 @@
  5700. struct utmpx *pututxline(const struct utmpx *);
  5701. void setutxent(void);
  5702. +#if defined(_BSD_SOURCE) | defined(_GNU_SOURCE)
  5703. +#define e_exit __e_exit
  5704. +#define e_termination __e_termination
  5705. void updwtmpx(const char *, const struct utmpx *);
  5706. +#endif
  5707. #define EMPTY 0
  5708. #define RUN_LVL 1
  5709. diff -Nur musl-0.9.15/src/crypt/crypt_des.c musl-git/src/crypt/crypt_des.c
  5710. --- musl-0.9.15/src/crypt/crypt_des.c 2014-01-03 21:12:17.000000000 +0100
  5711. +++ musl-git/src/crypt/crypt_des.c 2014-02-25 15:24:14.000000000 +0100
  5712. @@ -692,7 +692,7 @@
  5713. return saltbits;
  5714. }
  5715. -static void des_setkey(const unsigned char *key, struct expanded_key *ekey)
  5716. +void __des_setkey(const unsigned char *key, struct expanded_key *ekey)
  5717. {
  5718. uint32_t k0, k1, rawkey0, rawkey1;
  5719. unsigned int shifts, round, i, ibit;
  5720. @@ -753,7 +753,7 @@
  5721. /*
  5722. * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
  5723. */
  5724. -static void do_des(uint32_t l_in, uint32_t r_in,
  5725. +void __do_des(uint32_t l_in, uint32_t r_in,
  5726. uint32_t *l_out, uint32_t *r_out,
  5727. uint32_t count, uint32_t saltbits, const struct expanded_key *ekey)
  5728. {
  5729. @@ -862,7 +862,7 @@
  5730. ((uint32_t)in[5] << 16) |
  5731. ((uint32_t)in[4] << 24);
  5732. - do_des(rawl, rawr, &l_out, &r_out, count, saltbits, ekey);
  5733. + __do_des(rawl, rawr, &l_out, &r_out, count, saltbits, ekey);
  5734. out[0] = l_out >> 24;
  5735. out[1] = l_out >> 16;
  5736. @@ -894,7 +894,7 @@
  5737. if (*key)
  5738. key++;
  5739. }
  5740. - des_setkey(keybuf, &ekey);
  5741. + __des_setkey(keybuf, &ekey);
  5742. if (*setting == _PASSWORD_EFMT1) {
  5743. /*
  5744. @@ -929,7 +929,7 @@
  5745. q = keybuf;
  5746. while (q <= &keybuf[sizeof(keybuf) - 1] && *key)
  5747. *q++ ^= *key++ << 1;
  5748. - des_setkey(keybuf, &ekey);
  5749. + __des_setkey(keybuf, &ekey);
  5750. }
  5751. memcpy(output, setting, 9);
  5752. @@ -957,7 +957,7 @@
  5753. /*
  5754. * Do it.
  5755. */
  5756. - do_des(0, 0, &r0, &r1, count, setup_salt(salt), &ekey);
  5757. + __do_des(0, 0, &r0, &r1, count, setup_salt(salt), &ekey);
  5758. /*
  5759. * Now encode the result...
  5760. diff -Nur musl-0.9.15/src/crypt/encrypt.c musl-git/src/crypt/encrypt.c
  5761. --- musl-0.9.15/src/crypt/encrypt.c 1970-01-01 01:00:00.000000000 +0100
  5762. +++ musl-git/src/crypt/encrypt.c 2014-02-25 15:24:14.000000000 +0100
  5763. @@ -0,0 +1,60 @@
  5764. +#include <stdint.h>
  5765. +#include <stdlib.h>
  5766. +#include <unistd.h>
  5767. +
  5768. +struct expanded_key {
  5769. + uint32_t l[16], r[16];
  5770. +};
  5771. +
  5772. +void __des_setkey(const unsigned char *key, struct expanded_key *ekey);
  5773. +void __do_des(uint32_t l_in, uint32_t r_in,
  5774. + uint32_t *l_out, uint32_t *r_out,
  5775. + uint32_t count, uint32_t saltbits, const struct expanded_key *ekey);
  5776. +
  5777. +
  5778. +static struct expanded_key __encrypt_key;
  5779. +
  5780. +void setkey(const char *key)
  5781. +{
  5782. + unsigned char bkey[8];
  5783. + int i, j;
  5784. +
  5785. + for (i = 0; i < 8; i++) {
  5786. + bkey[i] = 0;
  5787. + for (j = 7; j >= 0; j--, key++)
  5788. + bkey[i] |= (uint32_t)(*key & 1) << j;
  5789. + }
  5790. +
  5791. + __des_setkey(bkey, &__encrypt_key);
  5792. +}
  5793. +
  5794. +void encrypt(char *block, int edflag)
  5795. +{
  5796. + struct expanded_key decrypt_key, *key;
  5797. + uint32_t b[2];
  5798. + int i, j;
  5799. + char *p;
  5800. +
  5801. + p = block;
  5802. + for (i = 0; i < 2; i++) {
  5803. + b[i] = 0;
  5804. + for (j = 31; j >= 0; j--, p++)
  5805. + b[i] |= (uint32_t)(*p & 1) << j;
  5806. + }
  5807. +
  5808. + key = &__encrypt_key;
  5809. + if (edflag) {
  5810. + key = &decrypt_key;
  5811. + for (i = 0; i < 16; i++) {
  5812. + decrypt_key.l[i] = __encrypt_key.l[15-i];
  5813. + decrypt_key.r[i] = __encrypt_key.r[15-i];
  5814. + }
  5815. + }
  5816. +
  5817. + __do_des(b[0], b[1], b, b + 1, 1, 0, key);
  5818. +
  5819. + p = block;
  5820. + for (i = 0; i < 2; i++)
  5821. + for (j = 31; j >= 0; j--)
  5822. + *p++ = b[i]>>j & 1;
  5823. +}
  5824. diff -Nur musl-0.9.15/src/fcntl/fcntl.c musl-git/src/fcntl/fcntl.c
  5825. --- musl-0.9.15/src/fcntl/fcntl.c 2014-01-03 21:12:17.000000000 +0100
  5826. +++ musl-git/src/fcntl/fcntl.c 2014-02-25 15:24:14.000000000 +0100
  5827. @@ -13,11 +13,11 @@
  5828. arg = va_arg(ap, long);
  5829. va_end(ap);
  5830. if (cmd == F_SETFL) arg |= O_LARGEFILE;
  5831. - if (cmd == F_SETLKW) return syscall_cp(SYS_fcntl, fd, cmd, arg);
  5832. + if (cmd == F_SETLKW) return syscall_cp(SYS_fcntl, fd, cmd, (void *)arg);
  5833. if (cmd == F_GETOWN) {
  5834. struct f_owner_ex ex;
  5835. int ret = __syscall(SYS_fcntl, fd, F_GETOWN_EX, &ex);
  5836. - if (ret == -EINVAL) return __syscall(SYS_fcntl, fd, cmd, arg);
  5837. + if (ret == -EINVAL) return __syscall(SYS_fcntl, fd, cmd, (void *)arg);
  5838. if (ret) return __syscall_ret(ret);
  5839. return ex.type == F_OWNER_PGRP ? -ex.pid : ex.pid;
  5840. }
  5841. @@ -37,5 +37,14 @@
  5842. if (ret >= 0) __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
  5843. return __syscall_ret(ret);
  5844. }
  5845. - return syscall(SYS_fcntl, fd, cmd, arg);
  5846. + switch (cmd) {
  5847. + case F_SETLK:
  5848. + case F_SETLKW:
  5849. + case F_GETLK:
  5850. + case F_GETOWN_EX:
  5851. + case F_SETOWN_EX:
  5852. + return syscall(SYS_fcntl, fd, cmd, (void *)arg);
  5853. + default:
  5854. + return syscall(SYS_fcntl, fd, cmd, arg);
  5855. + }
  5856. }
  5857. diff -Nur musl-0.9.15/src/fcntl/posix_fadvise.c musl-git/src/fcntl/posix_fadvise.c
  5858. --- musl-0.9.15/src/fcntl/posix_fadvise.c 2014-01-03 21:12:17.000000000 +0100
  5859. +++ musl-git/src/fcntl/posix_fadvise.c 2014-02-25 15:24:14.000000000 +0100
  5860. @@ -1,8 +1,11 @@
  5861. #include <fcntl.h>
  5862. #include "syscall.h"
  5863. +#include "libc.h"
  5864. int posix_fadvise(int fd, off_t base, off_t len, int advice)
  5865. {
  5866. return -(__syscall)(SYS_fadvise, fd, __SYSCALL_LL_O(base),
  5867. __SYSCALL_LL_E(len), advice);
  5868. }
  5869. +
  5870. +LFS64(posix_fadvise);
  5871. diff -Nur musl-0.9.15/src/fcntl/posix_fallocate.c musl-git/src/fcntl/posix_fallocate.c
  5872. --- musl-0.9.15/src/fcntl/posix_fallocate.c 2014-01-03 21:12:17.000000000 +0100
  5873. +++ musl-git/src/fcntl/posix_fallocate.c 2014-02-25 15:24:14.000000000 +0100
  5874. @@ -1,8 +1,11 @@
  5875. #include <fcntl.h>
  5876. #include "syscall.h"
  5877. +#include "libc.h"
  5878. int posix_fallocate(int fd, off_t base, off_t len)
  5879. {
  5880. return -__syscall(SYS_fallocate, fd, 0, __SYSCALL_LL_E(base),
  5881. __SYSCALL_LL_E(len));
  5882. }
  5883. +
  5884. +LFS64(posix_fallocate);
  5885. diff -Nur musl-0.9.15/src/fenv/i386/fenv.s musl-git/src/fenv/i386/fenv.s
  5886. --- musl-0.9.15/src/fenv/i386/fenv.s 2014-01-03 21:12:17.000000000 +0100
  5887. +++ musl-git/src/fenv/i386/fenv.s 2014-02-25 15:24:14.000000000 +0100
  5888. @@ -126,7 +126,7 @@
  5889. push %eax
  5890. push %eax
  5891. push %eax
  5892. - push %eax
  5893. + pushl $0xffff
  5894. push %eax
  5895. pushl $0x37f
  5896. fldenv (%esp)
  5897. diff -Nur musl-0.9.15/src/fenv/mipsel-sf/fenv.sub musl-git/src/fenv/mipsel-sf/fenv.sub
  5898. --- musl-0.9.15/src/fenv/mipsel-sf/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  5899. +++ musl-git/src/fenv/mipsel-sf/fenv.sub 2014-02-25 15:24:14.000000000 +0100
  5900. @@ -0,0 +1 @@
  5901. +../fenv.c
  5902. diff -Nur musl-0.9.15/src/fenv/mips-sf/fenv.sub musl-git/src/fenv/mips-sf/fenv.sub
  5903. --- musl-0.9.15/src/fenv/mips-sf/fenv.sub 1970-01-01 01:00:00.000000000 +0100
  5904. +++ musl-git/src/fenv/mips-sf/fenv.sub 2014-02-25 15:24:14.000000000 +0100
  5905. @@ -0,0 +1 @@
  5906. +../fenv.c
  5907. diff -Nur musl-0.9.15/src/fenv/superh/fenv.s musl-git/src/fenv/superh/fenv.s
  5908. --- musl-0.9.15/src/fenv/superh/fenv.s 1970-01-01 01:00:00.000000000 +0100
  5909. +++ musl-git/src/fenv/superh/fenv.s 2014-02-25 15:24:14.000000000 +0100
  5910. @@ -0,0 +1,74 @@
  5911. +.global fegetround
  5912. +.type fegetround, @function
  5913. +fegetround:
  5914. + sts fpscr, r0
  5915. + rts
  5916. + and #3, r0
  5917. +
  5918. +.global __fesetround
  5919. +.type __fesetround, @function
  5920. +__fesetround:
  5921. + sts fpscr, r0
  5922. + or r4, r0
  5923. + lds r0, fpscr
  5924. + rts
  5925. + mov #0, r0
  5926. +
  5927. +.global fetestexcept
  5928. +.type fetestexcept, @function
  5929. +fetestexcept:
  5930. + sts fpscr, r0
  5931. + and r4, r0
  5932. + rts
  5933. + and #0x7c, r0
  5934. +
  5935. +.global feclearexcept
  5936. +.type feclearexcept, @function
  5937. +feclearexcept:
  5938. + mov r4, r0
  5939. + and #0x7c, r0
  5940. + not r0, r4
  5941. + sts fpscr, r0
  5942. + and r4, r0
  5943. + lds r0, fpscr
  5944. + rts
  5945. + mov #0, r0
  5946. +
  5947. +.global feraiseexcept
  5948. +.type feraiseexcept, @function
  5949. +feraiseexcept:
  5950. + mov r4, r0
  5951. + and #0x7c, r0
  5952. + sts fpscr, r4
  5953. + or r4, r0
  5954. + lds r0, fpscr
  5955. + rts
  5956. + mov #0, r0
  5957. +
  5958. +.global fegetenv
  5959. +.type fegetenv, @function
  5960. +fegetenv:
  5961. + sts fpscr, r0
  5962. + mov.l r0, @r4
  5963. + rts
  5964. + mov #0, r0
  5965. +
  5966. +.global fesetenv
  5967. +.type fesetenv, @function
  5968. +fesetenv:
  5969. + mov r4, r0
  5970. + cmp/eq #-1, r0
  5971. + bf 1f
  5972. +
  5973. + ! the default environment is complicated by the fact that we need to
  5974. + ! preserve the current precision bit, which we do not know a priori
  5975. + sts fpscr, r0
  5976. + mov #8, r1
  5977. + swap.w r1, r1
  5978. + bra 2f
  5979. + and r1, r0
  5980. +
  5981. +1: mov.l @r4, r0 ! non-default environment
  5982. +2: lds r0, fpscr
  5983. + rts
  5984. + mov #0, r0
  5985. diff -Nur musl-0.9.15/src/fenv/x32/fenv.s musl-git/src/fenv/x32/fenv.s
  5986. --- musl-0.9.15/src/fenv/x32/fenv.s 1970-01-01 01:00:00.000000000 +0100
  5987. +++ musl-git/src/fenv/x32/fenv.s 2014-02-25 15:24:14.000000000 +0100
  5988. @@ -0,0 +1,97 @@
  5989. +.global feclearexcept
  5990. +.type feclearexcept,@function
  5991. +feclearexcept:
  5992. + # maintain exceptions in the sse mxcsr, clear x87 exceptions
  5993. + mov %edi,%ecx
  5994. + and $0x3f,%ecx
  5995. + fnstsw %ax
  5996. + test %eax,%ecx
  5997. + jz 1f
  5998. + fnclex
  5999. +1: stmxcsr -8(%esp)
  6000. + and $0x3f,%eax
  6001. + or %eax,-8(%esp)
  6002. + test %ecx,-8(%esp)
  6003. + jz 1f
  6004. + not %ecx
  6005. + and %ecx,-8(%esp)
  6006. + ldmxcsr -8(%esp)
  6007. +1: xor %eax,%eax
  6008. + ret
  6009. +
  6010. +.global feraiseexcept
  6011. +.type feraiseexcept,@function
  6012. +feraiseexcept:
  6013. + and $0x3f,%edi
  6014. + stmxcsr -8(%esp)
  6015. + or %edi,-8(%esp)
  6016. + ldmxcsr -8(%esp)
  6017. + xor %eax,%eax
  6018. + ret
  6019. +
  6020. +.global __fesetround
  6021. +.type __fesetround,@function
  6022. +__fesetround:
  6023. + push %rax
  6024. + xor %eax,%eax
  6025. + mov %edi,%ecx
  6026. + fnstcw (%esp)
  6027. + andb $0xf3,1(%esp)
  6028. + or %ch,1(%esp)
  6029. + fldcw (%esp)
  6030. + stmxcsr (%esp)
  6031. + shl $3,%ch
  6032. + andb $0x9f,1(%esp)
  6033. + or %ch,1(%esp)
  6034. + ldmxcsr (%esp)
  6035. + pop %rcx
  6036. + ret
  6037. +
  6038. +.global fegetround
  6039. +.type fegetround,@function
  6040. +fegetround:
  6041. + push %rax
  6042. + stmxcsr (%esp)
  6043. + pop %rax
  6044. + shr $3,%eax
  6045. + and $0xc00,%eax
  6046. + ret
  6047. +
  6048. +.global fegetenv
  6049. +.type fegetenv,@function
  6050. +fegetenv:
  6051. + xor %eax,%eax
  6052. + fnstenv (%edi)
  6053. + stmxcsr 28(%edi)
  6054. + ret
  6055. +
  6056. +.global fesetenv
  6057. +.type fesetenv,@function
  6058. +fesetenv:
  6059. + xor %eax,%eax
  6060. + inc %edi
  6061. + jz 1f
  6062. + fldenv -1(%edi)
  6063. + ldmxcsr 27(%edi)
  6064. + ret
  6065. +1: push %rax
  6066. + push %rax
  6067. + pushq $0xffff
  6068. + pushq $0x37f
  6069. + fldenv (%esp)
  6070. + pushq $0x1f80
  6071. + ldmxcsr (%esp)
  6072. + add $40,%esp
  6073. + ret
  6074. +
  6075. +.global fetestexcept
  6076. +.type fetestexcept,@function
  6077. +fetestexcept:
  6078. + and $0x3f,%edi
  6079. + push %rax
  6080. + stmxcsr (%esp)
  6081. + pop %rsi
  6082. + fnstsw %ax
  6083. + or %esi,%eax
  6084. + and %edi,%eax
  6085. + ret
  6086. diff -Nur musl-0.9.15/src/fenv/x86_64/fenv.s musl-git/src/fenv/x86_64/fenv.s
  6087. --- musl-0.9.15/src/fenv/x86_64/fenv.s 2014-01-03 21:12:17.000000000 +0100
  6088. +++ musl-git/src/fenv/x86_64/fenv.s 2014-02-25 15:24:14.000000000 +0100
  6089. @@ -76,7 +76,7 @@
  6090. ret
  6091. 1: push %rax
  6092. push %rax
  6093. - push %rax
  6094. + pushq $0xffff
  6095. pushq $0x37f
  6096. fldenv (%rsp)
  6097. pushq $0x1f80
  6098. diff -Nur musl-0.9.15/src/internal/stdio_impl.h musl-git/src/internal/stdio_impl.h
  6099. --- musl-0.9.15/src/internal/stdio_impl.h 2014-01-03 21:12:17.000000000 +0100
  6100. +++ musl-git/src/internal/stdio_impl.h 2014-02-25 15:24:14.000000000 +0100
  6101. @@ -17,6 +17,7 @@
  6102. #define F_EOF 16
  6103. #define F_ERR 32
  6104. #define F_SVB 64
  6105. +#define F_APP 128
  6106. struct _IO_FILE {
  6107. unsigned flags;
  6108. diff -Nur musl-0.9.15/src/internal/superh/syscall.s musl-git/src/internal/superh/syscall.s
  6109. --- musl-0.9.15/src/internal/superh/syscall.s 1970-01-01 01:00:00.000000000 +0100
  6110. +++ musl-git/src/internal/superh/syscall.s 2014-02-25 15:24:14.000000000 +0100
  6111. @@ -0,0 +1,22 @@
  6112. +.global __syscall
  6113. +.type __syscall, @function
  6114. +__syscall:
  6115. + ! The kernel syscall entry point documents that the trap number indicates
  6116. + ! the number of arguments being passed, but it then ignores that information.
  6117. + ! Since we do not actually know how many arguments are being passed, we will
  6118. + ! say there are six, since that is the maximum we support here.
  6119. + mov r4, r3
  6120. + mov r5, r4
  6121. + mov r6, r5
  6122. + mov r7, r6
  6123. + mov.l @r15, r7
  6124. + mov.l @(4,r15), r0
  6125. + mov.l @(8,r15), r1
  6126. + trapa #22
  6127. + or r0, r0
  6128. + or r0, r0
  6129. + or r0, r0
  6130. + or r0, r0
  6131. + or r0, r0
  6132. + rts
  6133. + nop
  6134. diff -Nur musl-0.9.15/src/internal/syscall.h musl-git/src/internal/syscall.h
  6135. --- musl-0.9.15/src/internal/syscall.h 2014-01-03 21:12:17.000000000 +0100
  6136. +++ musl-git/src/internal/syscall.h 2014-02-25 15:24:14.000000000 +0100
  6137. @@ -1,22 +1,28 @@
  6138. #ifndef _INTERNAL_SYSCALL_H
  6139. #define _INTERNAL_SYSCALL_H
  6140. -#if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
  6141. -__attribute__((visibility("protected")))
  6142. -#endif
  6143. -long __syscall_ret(unsigned long), __syscall(long, ...),
  6144. - __syscall_cp(long, long, long, long, long, long, long);
  6145. -
  6146. #include <sys/syscall.h>
  6147. #include "syscall_arch.h"
  6148. -#define __syscall1(n,a) __syscall1(n,(long)(a))
  6149. -#define __syscall2(n,a,b) __syscall2(n,(long)(a),(long)(b))
  6150. -#define __syscall3(n,a,b,c) __syscall3(n,(long)(a),(long)(b),(long)(c))
  6151. -#define __syscall4(n,a,b,c,d) __syscall4(n,(long)(a),(long)(b),(long)(c),(long)(d))
  6152. -#define __syscall5(n,a,b,c,d,e) __syscall5(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e))
  6153. -#define __syscall6(n,a,b,c,d,e,f) __syscall6(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f))
  6154. -#define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f),(long)g)
  6155. +#ifndef __scc
  6156. +#define __scc(X) ((long) (X))
  6157. +typedef long syscall_arg_t;
  6158. +#endif
  6159. +
  6160. +#if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
  6161. +__attribute__((visibility("protected")))
  6162. +#endif
  6163. +long __syscall_ret(unsigned long), __syscall(syscall_arg_t, ...),
  6164. + __syscall_cp(syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t,
  6165. + syscall_arg_t, syscall_arg_t, syscall_arg_t);
  6166. +
  6167. +#define __syscall1(n,a) __syscall1(n,__scc(a))
  6168. +#define __syscall2(n,a,b) __syscall2(n,__scc(a),__scc(b))
  6169. +#define __syscall3(n,a,b,c) __syscall3(n,__scc(a),__scc(b),__scc(c))
  6170. +#define __syscall4(n,a,b,c,d) __syscall4(n,__scc(a),__scc(b),__scc(c),__scc(d))
  6171. +#define __syscall5(n,a,b,c,d,e) __syscall5(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e))
  6172. +#define __syscall6(n,a,b,c,d,e,f) __syscall6(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f))
  6173. +#define __syscall7(n,a,b,c,d,e,f,g) (__syscall)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f),__scc(g))
  6174. #define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
  6175. #define __SYSCALL_NARGS(...) __SYSCALL_NARGS_X(__VA_ARGS__,7,6,5,4,3,2,1,0,)
  6176. @@ -31,12 +37,12 @@
  6177. #define socketcall_cp __socketcall_cp
  6178. #define __syscall_cp0(n) (__syscall_cp)(n,0,0,0,0,0,0)
  6179. -#define __syscall_cp1(n,a) (__syscall_cp)(n,(long)(a),0,0,0,0,0)
  6180. -#define __syscall_cp2(n,a,b) (__syscall_cp)(n,(long)(a),(long)(b),0,0,0,0)
  6181. -#define __syscall_cp3(n,a,b,c) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),0,0,0)
  6182. -#define __syscall_cp4(n,a,b,c,d) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),0,0)
  6183. -#define __syscall_cp5(n,a,b,c,d,e) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),0)
  6184. -#define __syscall_cp6(n,a,b,c,d,e,f) (__syscall_cp)(n,(long)(a),(long)(b),(long)(c),(long)(d),(long)(e),(long)(f))
  6185. +#define __syscall_cp1(n,a) (__syscall_cp)(n,__scc(a),0,0,0,0,0)
  6186. +#define __syscall_cp2(n,a,b) (__syscall_cp)(n,__scc(a),__scc(b),0,0,0,0)
  6187. +#define __syscall_cp3(n,a,b,c) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),0,0,0)
  6188. +#define __syscall_cp4(n,a,b,c,d) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),0,0)
  6189. +#define __syscall_cp5(n,a,b,c,d,e) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),0)
  6190. +#define __syscall_cp6(n,a,b,c,d,e,f) (__syscall_cp)(n,__scc(a),__scc(b),__scc(c),__scc(d),__scc(e),__scc(f))
  6191. #define __syscall_cp(...) __SYSCALL_DISP(__syscall_cp,__VA_ARGS__)
  6192. #define syscall_cp(...) __syscall_ret(__syscall_cp(__VA_ARGS__))
  6193. diff -Nur musl-0.9.15/src/internal/x32/syscall.s musl-git/src/internal/x32/syscall.s
  6194. --- musl-0.9.15/src/internal/x32/syscall.s 1970-01-01 01:00:00.000000000 +0100
  6195. +++ musl-git/src/internal/x32/syscall.s 2014-02-25 15:24:14.000000000 +0100
  6196. @@ -0,0 +1,12 @@
  6197. +.global __syscall
  6198. +.type __syscall,@function
  6199. +__syscall:
  6200. + movq %rdi,%rax
  6201. + movq %rsi,%rdi
  6202. + movq %rdx,%rsi
  6203. + movq %rcx,%rdx
  6204. + movq %r8,%r10
  6205. + movq %r9,%r8
  6206. + movq 8(%rsp),%r9
  6207. + syscall
  6208. + ret
  6209. diff -Nur musl-0.9.15/src/ipc/semctl.c musl-git/src/ipc/semctl.c
  6210. --- musl-0.9.15/src/ipc/semctl.c 2014-01-03 21:12:17.000000000 +0100
  6211. +++ musl-git/src/ipc/semctl.c 2014-02-25 15:24:14.000000000 +0100
  6212. @@ -3,16 +3,22 @@
  6213. #include "syscall.h"
  6214. #include "ipc.h"
  6215. +union semun {
  6216. + int val;
  6217. + struct semid_ds *buf;
  6218. + unsigned short *array;
  6219. +};
  6220. +
  6221. int semctl(int id, int num, int cmd, ...)
  6222. {
  6223. - long arg;
  6224. + union semun arg;
  6225. va_list ap;
  6226. va_start(ap, cmd);
  6227. - arg = va_arg(ap, long);
  6228. + arg = va_arg(ap, union semun);
  6229. va_end(ap);
  6230. #ifdef SYS_semctl
  6231. - return syscall(SYS_semctl, id, num, cmd | IPC_64, arg);
  6232. + return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
  6233. #else
  6234. - return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg);
  6235. + return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
  6236. #endif
  6237. }
  6238. diff -Nur musl-0.9.15/src/ldso/dladdr.c musl-git/src/ldso/dladdr.c
  6239. --- musl-0.9.15/src/ldso/dladdr.c 2014-01-03 21:12:17.000000000 +0100
  6240. +++ musl-git/src/ldso/dladdr.c 2014-02-25 15:24:14.000000000 +0100
  6241. @@ -1,9 +1,9 @@
  6242. #define _GNU_SOURCE
  6243. #include <dlfcn.h>
  6244. -int __dladdr(void *, Dl_info *);
  6245. +int __dladdr(const void *, Dl_info *);
  6246. -int dladdr(void *addr, Dl_info *info)
  6247. +int dladdr(const void *addr, Dl_info *info)
  6248. {
  6249. return __dladdr(addr, info);
  6250. }
  6251. diff -Nur musl-0.9.15/src/ldso/dynlink.c musl-git/src/ldso/dynlink.c
  6252. --- musl-0.9.15/src/ldso/dynlink.c 2014-01-03 21:12:17.000000000 +0100
  6253. +++ musl-git/src/ldso/dynlink.c 2014-02-25 15:24:14.000000000 +0100
  6254. @@ -253,7 +253,8 @@
  6255. name = strings + sym->st_name;
  6256. ctx = IS_COPY(type) ? head->next : head;
  6257. def = find_sym(ctx, name, IS_PLT(type));
  6258. - if (!def.sym && sym->st_info>>4 != STB_WEAK) {
  6259. + if (!def.sym && (sym->st_shndx != SHN_UNDEF
  6260. + || sym->st_info>>4 != STB_WEAK)) {
  6261. snprintf(errbuf, sizeof errbuf,
  6262. "Error relocating %s: %s: symbol not found",
  6263. dso->name, name);
  6264. @@ -1331,7 +1332,7 @@
  6265. return 0;
  6266. }
  6267. -int __dladdr(void *addr, Dl_info *info)
  6268. +int __dladdr(const void *addr, Dl_info *info)
  6269. {
  6270. struct dso *p;
  6271. Sym *sym;
  6272. @@ -1441,7 +1442,7 @@
  6273. {
  6274. return 0;
  6275. }
  6276. -int __dladdr (void *addr, Dl_info *info)
  6277. +int __dladdr (const void *addr, Dl_info *info)
  6278. {
  6279. return 0;
  6280. }
  6281. diff -Nur musl-0.9.15/src/ldso/superh/dlsym.s musl-git/src/ldso/superh/dlsym.s
  6282. --- musl-0.9.15/src/ldso/superh/dlsym.s 1970-01-01 01:00:00.000000000 +0100
  6283. +++ musl-git/src/ldso/superh/dlsym.s 2014-02-25 15:24:14.000000000 +0100
  6284. @@ -0,0 +1,10 @@
  6285. +.text
  6286. +.global dlsym
  6287. +.type dlsym, @function
  6288. +dlsym:
  6289. + mov.l L1, r0
  6290. + braf r0
  6291. +1: mov.l @r15, r6
  6292. +
  6293. +.align 2
  6294. +L1: .long __dlsym@PLT-(1b-.)
  6295. diff -Nur musl-0.9.15/src/ldso/superh/start.s musl-git/src/ldso/superh/start.s
  6296. --- musl-0.9.15/src/ldso/superh/start.s 1970-01-01 01:00:00.000000000 +0100
  6297. +++ musl-git/src/ldso/superh/start.s 2014-02-25 15:24:14.000000000 +0100
  6298. @@ -0,0 +1,26 @@
  6299. +.text
  6300. +.global _start
  6301. +.type _start, @function
  6302. +_start:
  6303. + mov.l @r15, r4
  6304. + mov r15, r5
  6305. + mov.l L1, r0
  6306. + bsrf r0
  6307. + add #4, r5
  6308. +
  6309. +2: mov r0, r2
  6310. + mov.l @r15+, r1
  6311. +1: mov.l @r15+, r0
  6312. + cmp/eq #-1, r0
  6313. + bt/s 1b
  6314. + add #-1, r1
  6315. +
  6316. + add #1, r1
  6317. + mov.l r0, @-r15
  6318. + mov.l r1, @-r15
  6319. + mov #0, r4
  6320. + jmp @r2
  6321. + nop
  6322. +
  6323. +.align 2
  6324. +L1: .long __dynlink@PLT-(2b-.)
  6325. diff -Nur musl-0.9.15/src/ldso/x32/dlsym.s musl-git/src/ldso/x32/dlsym.s
  6326. --- musl-0.9.15/src/ldso/x32/dlsym.s 1970-01-01 01:00:00.000000000 +0100
  6327. +++ musl-git/src/ldso/x32/dlsym.s 2014-02-25 15:24:14.000000000 +0100
  6328. @@ -0,0 +1,6 @@
  6329. +.text
  6330. +.global dlsym
  6331. +.type dlsym,@function
  6332. +dlsym:
  6333. + mov (%rsp),%rdx
  6334. + jmp __dlsym
  6335. diff -Nur musl-0.9.15/src/ldso/x32/start.s musl-git/src/ldso/x32/start.s
  6336. --- musl-0.9.15/src/ldso/x32/start.s 1970-01-01 01:00:00.000000000 +0100
  6337. +++ musl-git/src/ldso/x32/start.s 2014-02-25 15:24:14.000000000 +0100
  6338. @@ -0,0 +1,24 @@
  6339. +.text
  6340. +.global _start
  6341. +_start:
  6342. + mov (%rsp),%rdi /* move argc into 1st argument slot */
  6343. + lea 4(%rsp),%rsi /* move argv into 2nd argument slot */
  6344. + call __dynlink
  6345. + /* in case the dynlinker was called directly, it sets the "consumed"
  6346. + argv values to -1. so we must loop over the array as long as -1
  6347. + is in the top argv slot, decrement argc, and then set the stackpointer
  6348. + to the new argc as well as argc's new value.
  6349. + as the x32 abi has longs in the argv array, we cannot use push/pop.*/
  6350. + movl (%rsp),%edi /* copy argc into edi */
  6351. + xor %rdx,%rdx /* we use rdx as an offset to the current argv member */
  6352. +1: dec %edi
  6353. + addl $4, %edx
  6354. + movl (%rsp, %rdx), %esi
  6355. + cmp $-1,%esi
  6356. + jz 1b
  6357. + inc %edi
  6358. + subl $4, %edx
  6359. + lea (%rsp, %rdx), %rsp /* set rsp to new argv[-1] */
  6360. + movl %edi, (%rsp) /* write new argc there */
  6361. + xor %edx,%edx
  6362. + jmp *%rax
  6363. diff -Nur musl-0.9.15/src/linux/clone.c musl-git/src/linux/clone.c
  6364. --- musl-0.9.15/src/linux/clone.c 1970-01-01 01:00:00.000000000 +0100
  6365. +++ musl-git/src/linux/clone.c 2014-02-25 15:24:14.000000000 +0100
  6366. @@ -0,0 +1,19 @@
  6367. +#include <stdarg.h>
  6368. +#include <unistd.h>
  6369. +#include "pthread_impl.h"
  6370. +#include "syscall.h"
  6371. +
  6372. +int clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
  6373. +{
  6374. + va_list ap;
  6375. + pid_t *ptid, *ctid;
  6376. + void *tls;
  6377. +
  6378. + va_start(ap, arg);
  6379. + ptid = va_arg(ap, pid_t *);
  6380. + tls = va_arg(ap, void *);
  6381. + ctid = va_arg(ap, pid_t *);
  6382. + va_end(ap);
  6383. +
  6384. + return __syscall_ret(__clone(func, stack, flags, arg, ptid, tls, ctid));
  6385. +}
  6386. diff -Nur musl-0.9.15/src/linux/fallocate.c musl-git/src/linux/fallocate.c
  6387. --- musl-0.9.15/src/linux/fallocate.c 2014-01-03 21:12:17.000000000 +0100
  6388. +++ musl-git/src/linux/fallocate.c 2014-02-25 15:24:14.000000000 +0100
  6389. @@ -1,9 +1,13 @@
  6390. #define _GNU_SOURCE
  6391. #include <fcntl.h>
  6392. #include "syscall.h"
  6393. +#include "libc.h"
  6394. int fallocate(int fd, int mode, off_t base, off_t len)
  6395. {
  6396. return syscall(SYS_fallocate, fd, mode, __SYSCALL_LL_E(base),
  6397. __SYSCALL_LL_E(len));
  6398. }
  6399. +
  6400. +#undef fallocate64
  6401. +LFS64(fallocate);
  6402. diff -Nur musl-0.9.15/src/linux/inotify.c musl-git/src/linux/inotify.c
  6403. --- musl-0.9.15/src/linux/inotify.c 2014-01-03 21:12:17.000000000 +0100
  6404. +++ musl-git/src/linux/inotify.c 2014-02-25 15:24:14.000000000 +0100
  6405. @@ -15,7 +15,7 @@
  6406. return syscall(SYS_inotify_add_watch, fd, pathname, mask);
  6407. }
  6408. -int inotify_rm_watch(int fd, uint32_t wd)
  6409. +int inotify_rm_watch(int fd, int wd)
  6410. {
  6411. return syscall(SYS_inotify_rm_watch, fd, wd);
  6412. }
  6413. diff -Nur musl-0.9.15/src/linux/remap_file_pages.c musl-git/src/linux/remap_file_pages.c
  6414. --- musl-0.9.15/src/linux/remap_file_pages.c 2014-01-03 21:12:17.000000000 +0100
  6415. +++ musl-git/src/linux/remap_file_pages.c 2014-02-25 15:24:14.000000000 +0100
  6416. @@ -2,7 +2,7 @@
  6417. #include <sys/mman.h>
  6418. #include "syscall.h"
  6419. -int remap_file_pages(void *addr, size_t size, int prot, ssize_t pgoff, int flags)
  6420. +int remap_file_pages(void *addr, size_t size, int prot, size_t pgoff, int flags)
  6421. {
  6422. return syscall(SYS_remap_file_pages, addr, size, prot, pgoff, flags);
  6423. }
  6424. diff -Nur musl-0.9.15/src/linux/stime.c musl-git/src/linux/stime.c
  6425. --- musl-0.9.15/src/linux/stime.c 2014-01-03 21:12:17.000000000 +0100
  6426. +++ musl-git/src/linux/stime.c 2014-02-25 15:24:14.000000000 +0100
  6427. @@ -2,7 +2,7 @@
  6428. #include <time.h>
  6429. #include <sys/time.h>
  6430. -int stime(time_t *t)
  6431. +int stime(const time_t *t)
  6432. {
  6433. struct timeval tv = { .tv_sec = *t, .tv_usec = 0 };
  6434. return settimeofday(&tv, (void *)0);
  6435. diff -Nur musl-0.9.15/src/locale/wcsxfrm.c musl-git/src/locale/wcsxfrm.c
  6436. --- musl-0.9.15/src/locale/wcsxfrm.c 2014-01-03 21:12:17.000000000 +0100
  6437. +++ musl-git/src/locale/wcsxfrm.c 2014-02-25 15:24:14.000000000 +0100
  6438. @@ -6,10 +6,12 @@
  6439. size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc)
  6440. {
  6441. size_t l = wcslen(src);
  6442. - if (l >= n) {
  6443. + if (l < n) {
  6444. + wmemcpy(dest, src, l+1);
  6445. + } else if (n) {
  6446. wmemcpy(dest, src, n-1);
  6447. dest[n-1] = 0;
  6448. - } else wcscpy(dest, src);
  6449. + }
  6450. return l;
  6451. }
  6452. diff -Nur musl-0.9.15/src/math/i386/remainderf.s musl-git/src/math/i386/remainderf.s
  6453. --- musl-0.9.15/src/math/i386/remainderf.s 2014-01-03 21:12:18.000000000 +0100
  6454. +++ musl-git/src/math/i386/remainderf.s 2014-02-25 15:24:14.000000000 +0100
  6455. @@ -1,6 +1,9 @@
  6456. .global remainderf
  6457. .type remainderf,@function
  6458. remainderf:
  6459. +.weak dremf
  6460. +.type dremf,@function
  6461. +dremf:
  6462. flds 8(%esp)
  6463. flds 4(%esp)
  6464. 1: fprem1
  6465. diff -Nur musl-0.9.15/src/math/i386/remainder.s musl-git/src/math/i386/remainder.s
  6466. --- musl-0.9.15/src/math/i386/remainder.s 2014-01-03 21:12:18.000000000 +0100
  6467. +++ musl-git/src/math/i386/remainder.s 2014-02-25 15:24:14.000000000 +0100
  6468. @@ -1,6 +1,9 @@
  6469. .global remainder
  6470. .type remainder,@function
  6471. remainder:
  6472. +.weak drem
  6473. +.type drem,@function
  6474. +drem:
  6475. fldl 12(%esp)
  6476. fldl 4(%esp)
  6477. 1: fprem1
  6478. diff -Nur musl-0.9.15/src/math/x32/acosl.s musl-git/src/math/x32/acosl.s
  6479. --- musl-0.9.15/src/math/x32/acosl.s 1970-01-01 01:00:00.000000000 +0100
  6480. +++ musl-git/src/math/x32/acosl.s 2014-02-25 15:24:14.000000000 +0100
  6481. @@ -0,0 +1,16 @@
  6482. +# see ../i386/acos.s
  6483. +
  6484. +.global acosl
  6485. +.type acosl,@function
  6486. +acosl:
  6487. + fldt 8(%esp)
  6488. +1: fld %st(0)
  6489. + fld1
  6490. + fsub %st(0),%st(1)
  6491. + fadd %st(2)
  6492. + fmulp
  6493. + fsqrt
  6494. + fabs
  6495. + fxch %st(1)
  6496. + fpatan
  6497. + ret
  6498. diff -Nur musl-0.9.15/src/math/x32/asinl.s musl-git/src/math/x32/asinl.s
  6499. --- musl-0.9.15/src/math/x32/asinl.s 1970-01-01 01:00:00.000000000 +0100
  6500. +++ musl-git/src/math/x32/asinl.s 2014-02-25 15:24:14.000000000 +0100
  6501. @@ -0,0 +1,12 @@
  6502. +.global asinl
  6503. +.type asinl,@function
  6504. +asinl:
  6505. + fldt 8(%esp)
  6506. +1: fld %st(0)
  6507. + fld1
  6508. + fsub %st(0),%st(1)
  6509. + fadd %st(2)
  6510. + fmulp
  6511. + fsqrt
  6512. + fpatan
  6513. + ret
  6514. diff -Nur musl-0.9.15/src/math/x32/atan2l.s musl-git/src/math/x32/atan2l.s
  6515. --- musl-0.9.15/src/math/x32/atan2l.s 1970-01-01 01:00:00.000000000 +0100
  6516. +++ musl-git/src/math/x32/atan2l.s 2014-02-25 15:24:14.000000000 +0100
  6517. @@ -0,0 +1,7 @@
  6518. +.global atan2l
  6519. +.type atan2l,@function
  6520. +atan2l:
  6521. + fldt 8(%esp)
  6522. + fldt 24(%esp)
  6523. + fpatan
  6524. + ret
  6525. diff -Nur musl-0.9.15/src/math/x32/atanl.s musl-git/src/math/x32/atanl.s
  6526. --- musl-0.9.15/src/math/x32/atanl.s 1970-01-01 01:00:00.000000000 +0100
  6527. +++ musl-git/src/math/x32/atanl.s 2014-02-25 15:24:14.000000000 +0100
  6528. @@ -0,0 +1,7 @@
  6529. +.global atanl
  6530. +.type atanl,@function
  6531. +atanl:
  6532. + fldt 8(%esp)
  6533. + fld1
  6534. + fpatan
  6535. + ret
  6536. diff -Nur musl-0.9.15/src/math/x32/ceill.s musl-git/src/math/x32/ceill.s
  6537. --- musl-0.9.15/src/math/x32/ceill.s 1970-01-01 01:00:00.000000000 +0100
  6538. +++ musl-git/src/math/x32/ceill.s 2014-02-25 15:24:14.000000000 +0100
  6539. @@ -0,0 +1 @@
  6540. +# see floorl.s
  6541. diff -Nur musl-0.9.15/src/math/x32/exp2l.s musl-git/src/math/x32/exp2l.s
  6542. --- musl-0.9.15/src/math/x32/exp2l.s 1970-01-01 01:00:00.000000000 +0100
  6543. +++ musl-git/src/math/x32/exp2l.s 2014-02-25 15:24:14.000000000 +0100
  6544. @@ -0,0 +1,90 @@
  6545. +.global expm1l
  6546. +.type expm1l,@function
  6547. +expm1l:
  6548. + fldt 8(%esp)
  6549. + fldl2e
  6550. + fmulp
  6551. + movl $0xc2820000,-4(%esp)
  6552. + flds -4(%esp)
  6553. + fucomp %st(1)
  6554. + fnstsw %ax
  6555. + sahf
  6556. + fld1
  6557. + jb 1f
  6558. + # x*log2e <= -65, return -1 without underflow
  6559. + fstp %st(1)
  6560. + fchs
  6561. + ret
  6562. +1: fld %st(1)
  6563. + fabs
  6564. + fucom %st(1)
  6565. + fnstsw %ax
  6566. + fstp %st(0)
  6567. + fstp %st(0)
  6568. + sahf
  6569. + ja 1f
  6570. + f2xm1
  6571. + ret
  6572. +1: push %rax
  6573. + call 1f
  6574. + pop %rax
  6575. + fld1
  6576. + fsubrp
  6577. + ret
  6578. +
  6579. +.global exp2l
  6580. +.type exp2l,@function
  6581. +exp2l:
  6582. + fldt 8(%esp)
  6583. +1: fld %st(0)
  6584. + sub $16,%esp
  6585. + fstpt (%esp)
  6586. + mov 8(%esp),%ax
  6587. + and $0x7fff,%ax
  6588. + cmp $0x3fff+13,%ax
  6589. + jb 4f # |x| < 8192
  6590. + cmp $0x3fff+15,%ax
  6591. + jae 3f # |x| >= 32768
  6592. + fsts (%esp)
  6593. + cmpl $0xc67ff800,(%esp)
  6594. + jb 2f # x > -16382
  6595. + movl $0x5f000000,(%esp)
  6596. + flds (%esp) # 0x1p63
  6597. + fld %st(1)
  6598. + fsub %st(1)
  6599. + faddp
  6600. + fucomp %st(1)
  6601. + fnstsw
  6602. + sahf
  6603. + je 2f # x - 0x1p63 + 0x1p63 == x
  6604. + movl $1,(%esp)
  6605. + flds (%esp) # 0x1p-149
  6606. + fdiv %st(1)
  6607. + fstps (%esp) # raise underflow
  6608. +2: fld1
  6609. + fld %st(1)
  6610. + frndint
  6611. + fxch %st(2)
  6612. + fsub %st(2) # st(0)=x-rint(x), st(1)=1, st(2)=rint(x)
  6613. + f2xm1
  6614. + faddp # 2^(x-rint(x))
  6615. +1: fscale
  6616. + fstp %st(1)
  6617. + add $16,%esp
  6618. + ret
  6619. +3: xor %eax,%eax
  6620. +4: cmp $0x3fff-64,%ax
  6621. + fld1
  6622. + jb 1b # |x| < 0x1p-64
  6623. + fstpt (%esp)
  6624. + fistl 8(%esp)
  6625. + fildl 8(%esp)
  6626. + fsubrp %st(1)
  6627. + addl $0x3fff,8(%esp)
  6628. + f2xm1
  6629. + fld1
  6630. + faddp # 2^(x-rint(x))
  6631. + fldt (%esp) # 2^rint(x)
  6632. + fmulp
  6633. + add $16,%esp
  6634. + ret
  6635. diff -Nur musl-0.9.15/src/math/x32/expl.s musl-git/src/math/x32/expl.s
  6636. --- musl-0.9.15/src/math/x32/expl.s 1970-01-01 01:00:00.000000000 +0100
  6637. +++ musl-git/src/math/x32/expl.s 2014-02-25 15:24:14.000000000 +0100
  6638. @@ -0,0 +1,101 @@
  6639. +# exp(x) = 2^hi + 2^hi (2^lo - 1)
  6640. +# where hi+lo = log2e*x with 128bit precision
  6641. +# exact log2e*x calculation depends on nearest rounding mode
  6642. +# using the exact multiplication method of Dekker and Veltkamp
  6643. +
  6644. +.global expl
  6645. +.type expl,@function
  6646. +expl:
  6647. + fldt 8(%esp)
  6648. +
  6649. + # interesting case: 0x1p-32 <= |x| < 16384
  6650. + # check if (exponent|0x8000) is in [0xbfff-32, 0xbfff+13]
  6651. + mov 16(%esp), %ax
  6652. + or $0x8000, %ax
  6653. + sub $0xbfdf, %ax
  6654. + cmp $45, %ax
  6655. + jbe 2f
  6656. + test %ax, %ax
  6657. + fld1
  6658. + js 1f
  6659. + # if |x|>=0x1p14 or nan return 2^trunc(x)
  6660. + fscale
  6661. + fstp %st(1)
  6662. + ret
  6663. + # if |x|<0x1p-32 return 1+x
  6664. +1: faddp
  6665. + ret
  6666. +
  6667. + # should be 0x1.71547652b82fe178p0L == 0x3fff b8aa3b29 5c17f0bc
  6668. + # it will be wrong on non-nearest rounding mode
  6669. +2: fldl2e
  6670. + sub $48, %esp
  6671. + # hi = log2e_hi*x
  6672. + # 2^hi = exp2l(hi)
  6673. + fmul %st(1),%st
  6674. + fld %st(0)
  6675. + fstpt (%esp)
  6676. + fstpt 16(%esp)
  6677. + fstpt 32(%esp)
  6678. + call exp2l
  6679. + # if 2^hi == inf return 2^hi
  6680. + fld %st(0)
  6681. + fstpt (%esp)
  6682. + cmpw $0x7fff, 8(%esp)
  6683. + je 1f
  6684. + fldt 32(%esp)
  6685. + fldt 16(%esp)
  6686. + # fpu stack: 2^hi x hi
  6687. + # exact mult: x*log2e
  6688. + fld %st(1)
  6689. + # c = 0x1p32+1
  6690. + movq $0x41f0000000100000,%rax
  6691. + pushq %rax
  6692. + fldl (%esp)
  6693. + # xh = x - c*x + c*x
  6694. + # xl = x - xh
  6695. + fmulp
  6696. + fld %st(2)
  6697. + fsub %st(1), %st
  6698. + faddp
  6699. + fld %st(2)
  6700. + fsub %st(1), %st
  6701. + # yh = log2e_hi - c*log2e_hi + c*log2e_hi
  6702. + movq $0x3ff7154765200000,%rax
  6703. + pushq %rax
  6704. + fldl (%esp)
  6705. + # fpu stack: 2^hi x hi xh xl yh
  6706. + # lo = hi - xh*yh + xl*yh
  6707. + fld %st(2)
  6708. + fmul %st(1), %st
  6709. + fsubp %st, %st(4)
  6710. + fmul %st(1), %st
  6711. + faddp %st, %st(3)
  6712. + # yl = log2e_hi - yh
  6713. + movq $0x3de705fc2f000000,%rax
  6714. + pushq %rax
  6715. + fldl (%esp)
  6716. + # fpu stack: 2^hi x lo xh xl yl
  6717. + # lo += xh*yl + xl*yl
  6718. + fmul %st, %st(2)
  6719. + fmulp %st, %st(1)
  6720. + fxch %st(2)
  6721. + faddp
  6722. + faddp
  6723. + # log2e_lo
  6724. + movq $0xbfbe,%rax
  6725. + pushq %rax
  6726. + movq $0x82f0025f2dc582ee,%rax
  6727. + pushq %rax
  6728. + fldt (%esp)
  6729. + add $40,%esp
  6730. + # fpu stack: 2^hi x lo log2e_lo
  6731. + # lo += log2e_lo*x
  6732. + # return 2^hi + 2^hi (2^lo - 1)
  6733. + fmulp %st, %st(2)
  6734. + faddp
  6735. + f2xm1
  6736. + fmul %st(1), %st
  6737. + faddp
  6738. +1: add $48, %esp
  6739. + ret
  6740. diff -Nur musl-0.9.15/src/math/x32/expm1l.s musl-git/src/math/x32/expm1l.s
  6741. --- musl-0.9.15/src/math/x32/expm1l.s 1970-01-01 01:00:00.000000000 +0100
  6742. +++ musl-git/src/math/x32/expm1l.s 2014-02-25 15:24:14.000000000 +0100
  6743. @@ -0,0 +1 @@
  6744. +# see exp2l.s
  6745. diff -Nur musl-0.9.15/src/math/x32/fabsf.s musl-git/src/math/x32/fabsf.s
  6746. --- musl-0.9.15/src/math/x32/fabsf.s 1970-01-01 01:00:00.000000000 +0100
  6747. +++ musl-git/src/math/x32/fabsf.s 2014-02-25 15:24:14.000000000 +0100
  6748. @@ -0,0 +1,7 @@
  6749. +.global fabsf
  6750. +.type fabsf,@function
  6751. +fabsf:
  6752. + mov $0x7fffffff,%eax
  6753. + movq %rax,%xmm1
  6754. + andps %xmm1,%xmm0
  6755. + ret
  6756. diff -Nur musl-0.9.15/src/math/x32/fabsl.s musl-git/src/math/x32/fabsl.s
  6757. --- musl-0.9.15/src/math/x32/fabsl.s 1970-01-01 01:00:00.000000000 +0100
  6758. +++ musl-git/src/math/x32/fabsl.s 2014-02-25 15:24:14.000000000 +0100
  6759. @@ -0,0 +1,6 @@
  6760. +.global fabsl
  6761. +.type fabsl,@function
  6762. +fabsl:
  6763. + fldt 8(%esp)
  6764. + fabs
  6765. + ret
  6766. diff -Nur musl-0.9.15/src/math/x32/fabs.s musl-git/src/math/x32/fabs.s
  6767. --- musl-0.9.15/src/math/x32/fabs.s 1970-01-01 01:00:00.000000000 +0100
  6768. +++ musl-git/src/math/x32/fabs.s 2014-02-25 15:24:14.000000000 +0100
  6769. @@ -0,0 +1,9 @@
  6770. +.global fabs
  6771. +.type fabs,@function
  6772. +fabs:
  6773. + xor %eax,%eax
  6774. + dec %rax
  6775. + shr %rax
  6776. + movq %rax,%xmm1
  6777. + andpd %xmm1,%xmm0
  6778. + ret
  6779. diff -Nur musl-0.9.15/src/math/x32/floorl.s musl-git/src/math/x32/floorl.s
  6780. --- musl-0.9.15/src/math/x32/floorl.s 1970-01-01 01:00:00.000000000 +0100
  6781. +++ musl-git/src/math/x32/floorl.s 2014-02-25 15:24:14.000000000 +0100
  6782. @@ -0,0 +1,27 @@
  6783. +.global floorl
  6784. +.type floorl,@function
  6785. +floorl:
  6786. + fldt 8(%esp)
  6787. +1: mov $0x7,%al
  6788. +1: fstcw 8(%esp)
  6789. + mov 9(%esp),%ah
  6790. + mov %al,9(%esp)
  6791. + fldcw 8(%esp)
  6792. + frndint
  6793. + mov %ah,9(%esp)
  6794. + fldcw 8(%esp)
  6795. + ret
  6796. +
  6797. +.global ceill
  6798. +.type ceill,@function
  6799. +ceill:
  6800. + fldt 8(%esp)
  6801. + mov $0xb,%al
  6802. + jmp 1b
  6803. +
  6804. +.global truncl
  6805. +.type truncl,@function
  6806. +truncl:
  6807. + fldt 8(%esp)
  6808. + mov $0xf,%al
  6809. + jmp 1b
  6810. diff -Nur musl-0.9.15/src/math/x32/fmodl.s musl-git/src/math/x32/fmodl.s
  6811. --- musl-0.9.15/src/math/x32/fmodl.s 1970-01-01 01:00:00.000000000 +0100
  6812. +++ musl-git/src/math/x32/fmodl.s 2014-02-25 15:24:14.000000000 +0100
  6813. @@ -0,0 +1,11 @@
  6814. +.global fmodl
  6815. +.type fmodl,@function
  6816. +fmodl:
  6817. + fldt 24(%esp)
  6818. + fldt 8(%esp)
  6819. +1: fprem
  6820. + fstsw %ax
  6821. + sahf
  6822. + jp 1b
  6823. + fstp %st(1)
  6824. + ret
  6825. diff -Nur musl-0.9.15/src/math/x32/llrintf.s musl-git/src/math/x32/llrintf.s
  6826. --- musl-0.9.15/src/math/x32/llrintf.s 1970-01-01 01:00:00.000000000 +0100
  6827. +++ musl-git/src/math/x32/llrintf.s 2014-02-25 15:24:14.000000000 +0100
  6828. @@ -0,0 +1,5 @@
  6829. +.global llrintf
  6830. +.type llrintf,@function
  6831. +llrintf:
  6832. + cvtss2si %xmm0,%rax
  6833. + ret
  6834. diff -Nur musl-0.9.15/src/math/x32/llrintl.s musl-git/src/math/x32/llrintl.s
  6835. --- musl-0.9.15/src/math/x32/llrintl.s 1970-01-01 01:00:00.000000000 +0100
  6836. +++ musl-git/src/math/x32/llrintl.s 2014-02-25 15:24:14.000000000 +0100
  6837. @@ -0,0 +1,7 @@
  6838. +.global llrintl
  6839. +.type llrintl,@function
  6840. +llrintl:
  6841. + fldt 8(%esp)
  6842. + fistpll 8(%esp)
  6843. + mov 8(%esp),%rax
  6844. + ret
  6845. diff -Nur musl-0.9.15/src/math/x32/llrint.s musl-git/src/math/x32/llrint.s
  6846. --- musl-0.9.15/src/math/x32/llrint.s 1970-01-01 01:00:00.000000000 +0100
  6847. +++ musl-git/src/math/x32/llrint.s 2014-02-25 15:24:14.000000000 +0100
  6848. @@ -0,0 +1,5 @@
  6849. +.global llrint
  6850. +.type llrint,@function
  6851. +llrint:
  6852. + cvtsd2si %xmm0,%rax
  6853. + ret
  6854. diff -Nur musl-0.9.15/src/math/x32/log10l.s musl-git/src/math/x32/log10l.s
  6855. --- musl-0.9.15/src/math/x32/log10l.s 1970-01-01 01:00:00.000000000 +0100
  6856. +++ musl-git/src/math/x32/log10l.s 2014-02-25 15:24:14.000000000 +0100
  6857. @@ -0,0 +1,7 @@
  6858. +.global log10l
  6859. +.type log10l,@function
  6860. +log10l:
  6861. + fldlg2
  6862. + fldt 8(%esp)
  6863. + fyl2x
  6864. + ret
  6865. diff -Nur musl-0.9.15/src/math/x32/log1pl.s musl-git/src/math/x32/log1pl.s
  6866. --- musl-0.9.15/src/math/x32/log1pl.s 1970-01-01 01:00:00.000000000 +0100
  6867. +++ musl-git/src/math/x32/log1pl.s 2014-02-25 15:24:14.000000000 +0100
  6868. @@ -0,0 +1,15 @@
  6869. +.global log1pl
  6870. +.type log1pl,@function
  6871. +log1pl:
  6872. + mov 14(%esp),%eax
  6873. + fldln2
  6874. + and $0x7fffffff,%eax
  6875. + fldt 8(%esp)
  6876. + cmp $0x3ffd9400,%eax
  6877. + ja 1f
  6878. + fyl2xp1
  6879. + ret
  6880. +1: fld1
  6881. + faddp
  6882. + fyl2x
  6883. + ret
  6884. diff -Nur musl-0.9.15/src/math/x32/log2l.s musl-git/src/math/x32/log2l.s
  6885. --- musl-0.9.15/src/math/x32/log2l.s 1970-01-01 01:00:00.000000000 +0100
  6886. +++ musl-git/src/math/x32/log2l.s 2014-02-25 15:24:14.000000000 +0100
  6887. @@ -0,0 +1,7 @@
  6888. +.global log2l
  6889. +.type log2l,@function
  6890. +log2l:
  6891. + fld1
  6892. + fldt 8(%esp)
  6893. + fyl2x
  6894. + ret
  6895. diff -Nur musl-0.9.15/src/math/x32/logl.s musl-git/src/math/x32/logl.s
  6896. --- musl-0.9.15/src/math/x32/logl.s 1970-01-01 01:00:00.000000000 +0100
  6897. +++ musl-git/src/math/x32/logl.s 2014-02-25 15:24:14.000000000 +0100
  6898. @@ -0,0 +1,7 @@
  6899. +.global logl
  6900. +.type logl,@function
  6901. +logl:
  6902. + fldln2
  6903. + fldt 8(%esp)
  6904. + fyl2x
  6905. + ret
  6906. diff -Nur musl-0.9.15/src/math/x32/lrintf.s musl-git/src/math/x32/lrintf.s
  6907. --- musl-0.9.15/src/math/x32/lrintf.s 1970-01-01 01:00:00.000000000 +0100
  6908. +++ musl-git/src/math/x32/lrintf.s 2014-02-25 15:24:14.000000000 +0100
  6909. @@ -0,0 +1,5 @@
  6910. +.global lrintf
  6911. +.type lrintf,@function
  6912. +lrintf:
  6913. + cvtss2si %xmm0,%rax
  6914. + ret
  6915. diff -Nur musl-0.9.15/src/math/x32/lrintl.s musl-git/src/math/x32/lrintl.s
  6916. --- musl-0.9.15/src/math/x32/lrintl.s 1970-01-01 01:00:00.000000000 +0100
  6917. +++ musl-git/src/math/x32/lrintl.s 2014-02-25 15:24:14.000000000 +0100
  6918. @@ -0,0 +1,7 @@
  6919. +.global lrintl
  6920. +.type lrintl,@function
  6921. +lrintl:
  6922. + fldt 8(%esp)
  6923. + fistpll 8(%esp)
  6924. + mov 8(%esp),%rax
  6925. + ret
  6926. diff -Nur musl-0.9.15/src/math/x32/lrint.s musl-git/src/math/x32/lrint.s
  6927. --- musl-0.9.15/src/math/x32/lrint.s 1970-01-01 01:00:00.000000000 +0100
  6928. +++ musl-git/src/math/x32/lrint.s 2014-02-25 15:24:14.000000000 +0100
  6929. @@ -0,0 +1,5 @@
  6930. +.global lrint
  6931. +.type lrint,@function
  6932. +lrint:
  6933. + cvtsd2si %xmm0,%rax
  6934. + ret
  6935. diff -Nur musl-0.9.15/src/math/x32/remainderl.s musl-git/src/math/x32/remainderl.s
  6936. --- musl-0.9.15/src/math/x32/remainderl.s 1970-01-01 01:00:00.000000000 +0100
  6937. +++ musl-git/src/math/x32/remainderl.s 2014-02-25 15:24:14.000000000 +0100
  6938. @@ -0,0 +1,11 @@
  6939. +.global remainderl
  6940. +.type remainderl,@function
  6941. +remainderl:
  6942. + fldt 24(%esp)
  6943. + fldt 8(%esp)
  6944. +1: fprem1
  6945. + fstsw %ax
  6946. + sahf
  6947. + jp 1b
  6948. + fstp %st(1)
  6949. + ret
  6950. diff -Nur musl-0.9.15/src/math/x32/rintl.s musl-git/src/math/x32/rintl.s
  6951. --- musl-0.9.15/src/math/x32/rintl.s 1970-01-01 01:00:00.000000000 +0100
  6952. +++ musl-git/src/math/x32/rintl.s 2014-02-25 15:24:14.000000000 +0100
  6953. @@ -0,0 +1,6 @@
  6954. +.global rintl
  6955. +.type rintl,@function
  6956. +rintl:
  6957. + fldt 8(%esp)
  6958. + frndint
  6959. + ret
  6960. diff -Nur musl-0.9.15/src/math/x32/sqrtf.s musl-git/src/math/x32/sqrtf.s
  6961. --- musl-0.9.15/src/math/x32/sqrtf.s 1970-01-01 01:00:00.000000000 +0100
  6962. +++ musl-git/src/math/x32/sqrtf.s 2014-02-25 15:24:14.000000000 +0100
  6963. @@ -0,0 +1,4 @@
  6964. +.global sqrtf
  6965. +.type sqrtf,@function
  6966. +sqrtf: sqrtss %xmm0, %xmm0
  6967. + ret
  6968. diff -Nur musl-0.9.15/src/math/x32/sqrtl.s musl-git/src/math/x32/sqrtl.s
  6969. --- musl-0.9.15/src/math/x32/sqrtl.s 1970-01-01 01:00:00.000000000 +0100
  6970. +++ musl-git/src/math/x32/sqrtl.s 2014-02-25 15:24:14.000000000 +0100
  6971. @@ -0,0 +1,5 @@
  6972. +.global sqrtl
  6973. +.type sqrtl,@function
  6974. +sqrtl: fldt 8(%esp)
  6975. + fsqrt
  6976. + ret
  6977. diff -Nur musl-0.9.15/src/math/x32/sqrt.s musl-git/src/math/x32/sqrt.s
  6978. --- musl-0.9.15/src/math/x32/sqrt.s 1970-01-01 01:00:00.000000000 +0100
  6979. +++ musl-git/src/math/x32/sqrt.s 2014-02-25 15:24:14.000000000 +0100
  6980. @@ -0,0 +1,4 @@
  6981. +.global sqrt
  6982. +.type sqrt,@function
  6983. +sqrt: sqrtsd %xmm0, %xmm0
  6984. + ret
  6985. diff -Nur musl-0.9.15/src/math/x32/truncl.s musl-git/src/math/x32/truncl.s
  6986. --- musl-0.9.15/src/math/x32/truncl.s 1970-01-01 01:00:00.000000000 +0100
  6987. +++ musl-git/src/math/x32/truncl.s 2014-02-25 15:24:14.000000000 +0100
  6988. @@ -0,0 +1 @@
  6989. +# see floorl.s
  6990. diff -Nur musl-0.9.15/src/misc/nftw.c musl-git/src/misc/nftw.c
  6991. --- musl-0.9.15/src/misc/nftw.c 2014-01-03 21:12:18.000000000 +0100
  6992. +++ musl-git/src/misc/nftw.c 2014-02-25 15:24:14.000000000 +0100
  6993. @@ -46,8 +46,7 @@
  6994. type = FTW_F;
  6995. }
  6996. - if ((flags & FTW_MOUNT) && h
  6997. - && (st.st_dev != h->dev || st.st_ino != h->ino))
  6998. + if ((flags & FTW_MOUNT) && h && st.st_dev != h->dev)
  6999. return 0;
  7000. new.chain = h;
  7001. diff -Nur musl-0.9.15/src/network/accept4.c musl-git/src/network/accept4.c
  7002. --- musl-0.9.15/src/network/accept4.c 2014-01-03 21:12:18.000000000 +0100
  7003. +++ musl-git/src/network/accept4.c 2014-02-25 15:24:14.000000000 +0100
  7004. @@ -1,9 +1,20 @@
  7005. #define _GNU_SOURCE
  7006. #include <sys/socket.h>
  7007. +#include <errno.h>
  7008. +#include <fcntl.h>
  7009. #include "syscall.h"
  7010. #include "libc.h"
  7011. int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
  7012. {
  7013. - return socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
  7014. + if (!flg) return accept(fd, addr, len);
  7015. + int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
  7016. + if (ret>=0 || (errno != ENOSYS && errno != EINVAL)) return ret;
  7017. + ret = accept(fd, addr, len);
  7018. + if (ret<0) return ret;
  7019. + if (flg & SOCK_CLOEXEC)
  7020. + __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
  7021. + if (flg & SOCK_NONBLOCK)
  7022. + __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
  7023. + return ret;
  7024. }
  7025. diff -Nur musl-0.9.15/src/network/inet_legacy.c musl-git/src/network/inet_legacy.c
  7026. --- musl-0.9.15/src/network/inet_legacy.c 2014-01-03 21:12:18.000000000 +0100
  7027. +++ musl-git/src/network/inet_legacy.c 2014-02-25 15:24:14.000000000 +0100
  7028. @@ -16,9 +16,8 @@
  7029. return 1;
  7030. }
  7031. -struct in_addr inet_makeaddr(int net, int host)
  7032. +struct in_addr inet_makeaddr(in_addr_t n, in_addr_t h)
  7033. {
  7034. - uint32_t n = net, h = host;
  7035. if (n < 256) h |= n<<24;
  7036. else if (n < 65536) h |= n<<16;
  7037. else h |= n<<8;
  7038. diff -Nur musl-0.9.15/src/network/proto.c musl-git/src/network/proto.c
  7039. --- musl-0.9.15/src/network/proto.c 2014-01-03 21:12:18.000000000 +0100
  7040. +++ musl-git/src/network/proto.c 2014-02-25 15:24:14.000000000 +0100
  7041. @@ -4,7 +4,7 @@
  7042. /* do we really need all these?? */
  7043. static int idx;
  7044. -static const unsigned char protos[][6] = {
  7045. +static const unsigned char protos[][8] = {
  7046. "\000ip",
  7047. "\001icmp",
  7048. "\002igmp",
  7049. @@ -13,7 +13,9 @@
  7050. "\014pup",
  7051. "\021udp",
  7052. "\026idp",
  7053. - "\377raw"
  7054. + "\051ipv6",
  7055. + "\072icmpv6",
  7056. + "\377raw",
  7057. "\0\0"
  7058. };
  7059. diff -Nur musl-0.9.15/src/prng/random.c musl-git/src/prng/random.c
  7060. --- musl-0.9.15/src/prng/random.c 2014-01-03 21:12:18.000000000 +0100
  7061. +++ musl-git/src/prng/random.c 2014-02-25 15:24:14.000000000 +0100
  7062. @@ -1,10 +1,3 @@
  7063. -/*
  7064. - * random.c - Copyright © 2011 Szabolcs Nagy
  7065. - * Permission to use, copy, modify, and/or distribute this code
  7066. - * for any purpose with or without fee is hereby granted.
  7067. - * There is no warranty.
  7068. -*/
  7069. -
  7070. #include <stdlib.h>
  7071. #include <stdint.h>
  7072. #include "libc.h"
  7073. @@ -12,11 +5,7 @@
  7074. /*
  7075. this code uses the same lagged fibonacci generator as the
  7076. original bsd random implementation except for the seeding
  7077. -
  7078. -different seeds produce different sequences with long period
  7079. -(other libcs seed the state with a park-miller generator
  7080. -when seed=0 some fail to produce good random sequence
  7081. -others produce the same sequence as another seed)
  7082. +which was broken in the original
  7083. */
  7084. static uint32_t init[] = {
  7085. @@ -98,6 +87,7 @@
  7086. n = 63;
  7087. x = (uint32_t*)state + 1;
  7088. __srandom(seed);
  7089. + savestate();
  7090. UNLOCK(lock);
  7091. return old;
  7092. }
  7093. diff -Nur musl-0.9.15/src/process/posix_spawn.c musl-git/src/process/posix_spawn.c
  7094. --- musl-0.9.15/src/process/posix_spawn.c 2014-01-03 21:12:18.000000000 +0100
  7095. +++ musl-git/src/process/posix_spawn.c 2014-02-25 15:24:14.000000000 +0100
  7096. @@ -166,7 +166,7 @@
  7097. close(args.p[0]);
  7098. - if (!ec) *res = pid;
  7099. + if (!ec && res) *res = pid;
  7100. pthread_sigmask(SIG_SETMASK, &args.oldmask, 0);
  7101. pthread_setcancelstate(cs, 0);
  7102. diff -Nur musl-0.9.15/src/process/x32/vfork.s musl-git/src/process/x32/vfork.s
  7103. --- musl-0.9.15/src/process/x32/vfork.s 1970-01-01 01:00:00.000000000 +0100
  7104. +++ musl-git/src/process/x32/vfork.s 2014-02-25 15:24:14.000000000 +0100
  7105. @@ -0,0 +1,12 @@
  7106. +.global __vfork
  7107. +.weak vfork
  7108. +.type __vfork,@function
  7109. +.type vfork,@function
  7110. +__vfork:
  7111. +vfork:
  7112. + pop %rdx
  7113. + mov $0x4000003a,%eax /* SYS_vfork */
  7114. + syscall
  7115. + push %rdx
  7116. + mov %rax,%rdi
  7117. + jmp __syscall_ret
  7118. diff -Nur musl-0.9.15/src/setjmp/mipsel-sf/longjmp.sub musl-git/src/setjmp/mipsel-sf/longjmp.sub
  7119. --- musl-0.9.15/src/setjmp/mipsel-sf/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7120. +++ musl-git/src/setjmp/mipsel-sf/longjmp.sub 2014-02-25 15:24:14.000000000 +0100
  7121. @@ -0,0 +1 @@
  7122. +../mips-sf/longjmp.s
  7123. diff -Nur musl-0.9.15/src/setjmp/mipsel-sf/setjmp.sub musl-git/src/setjmp/mipsel-sf/setjmp.sub
  7124. --- musl-0.9.15/src/setjmp/mipsel-sf/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7125. +++ musl-git/src/setjmp/mipsel-sf/setjmp.sub 2014-02-25 15:24:14.000000000 +0100
  7126. @@ -0,0 +1 @@
  7127. +../mips-sf/setjmp.s
  7128. diff -Nur musl-0.9.15/src/setjmp/mips-sf/longjmp.s musl-git/src/setjmp/mips-sf/longjmp.s
  7129. --- musl-0.9.15/src/setjmp/mips-sf/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7130. +++ musl-git/src/setjmp/mips-sf/longjmp.s 2014-02-25 15:24:14.000000000 +0100
  7131. @@ -0,0 +1,25 @@
  7132. +.set noreorder
  7133. +
  7134. +.global _longjmp
  7135. +.global longjmp
  7136. +.type _longjmp,@function
  7137. +.type longjmp,@function
  7138. +_longjmp:
  7139. +longjmp:
  7140. + move $2, $5
  7141. + bne $2, $0, 1f
  7142. + nop
  7143. + addu $2, $2, 1
  7144. +1: lw $ra, 0($4)
  7145. + lw $sp, 4($4)
  7146. + lw $16, 8($4)
  7147. + lw $17, 12($4)
  7148. + lw $18, 16($4)
  7149. + lw $19, 20($4)
  7150. + lw $20, 24($4)
  7151. + lw $21, 28($4)
  7152. + lw $22, 32($4)
  7153. + lw $23, 36($4)
  7154. + lw $30, 40($4)
  7155. + jr $ra
  7156. + lw $28, 44($4)
  7157. diff -Nur musl-0.9.15/src/setjmp/mips-sf/longjmp.sub musl-git/src/setjmp/mips-sf/longjmp.sub
  7158. --- musl-0.9.15/src/setjmp/mips-sf/longjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7159. +++ musl-git/src/setjmp/mips-sf/longjmp.sub 2014-02-25 15:24:14.000000000 +0100
  7160. @@ -0,0 +1 @@
  7161. +longjmp.s
  7162. diff -Nur musl-0.9.15/src/setjmp/mips-sf/setjmp.s musl-git/src/setjmp/mips-sf/setjmp.s
  7163. --- musl-0.9.15/src/setjmp/mips-sf/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7164. +++ musl-git/src/setjmp/mips-sf/setjmp.s 2014-02-25 15:24:14.000000000 +0100
  7165. @@ -0,0 +1,25 @@
  7166. +.set noreorder
  7167. +
  7168. +.global __setjmp
  7169. +.global _setjmp
  7170. +.global setjmp
  7171. +.type __setjmp,@function
  7172. +.type _setjmp,@function
  7173. +.type setjmp,@function
  7174. +__setjmp:
  7175. +_setjmp:
  7176. +setjmp:
  7177. + sw $ra, 0($4)
  7178. + sw $sp, 4($4)
  7179. + sw $16, 8($4)
  7180. + sw $17, 12($4)
  7181. + sw $18, 16($4)
  7182. + sw $19, 20($4)
  7183. + sw $20, 24($4)
  7184. + sw $21, 28($4)
  7185. + sw $22, 32($4)
  7186. + sw $23, 36($4)
  7187. + sw $30, 40($4)
  7188. + sw $28, 44($4)
  7189. + jr $ra
  7190. + li $2, 0
  7191. diff -Nur musl-0.9.15/src/setjmp/mips-sf/setjmp.sub musl-git/src/setjmp/mips-sf/setjmp.sub
  7192. --- musl-0.9.15/src/setjmp/mips-sf/setjmp.sub 1970-01-01 01:00:00.000000000 +0100
  7193. +++ musl-git/src/setjmp/mips-sf/setjmp.sub 2014-02-25 15:24:14.000000000 +0100
  7194. @@ -0,0 +1 @@
  7195. +setjmp.s
  7196. diff -Nur musl-0.9.15/src/setjmp/superh/longjmp.s musl-git/src/setjmp/superh/longjmp.s
  7197. --- musl-0.9.15/src/setjmp/superh/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7198. +++ musl-git/src/setjmp/superh/longjmp.s 2014-02-25 15:24:14.000000000 +0100
  7199. @@ -0,0 +1,26 @@
  7200. +.global _longjmp
  7201. +.global longjmp
  7202. +.type _longjmp, @function
  7203. +.type longjmp, @function
  7204. +_longjmp:
  7205. +longjmp:
  7206. + mov.l @r4+, r8
  7207. + mov.l @r4+, r9
  7208. + mov.l @r4+, r10
  7209. + mov.l @r4+, r11
  7210. + mov.l @r4+, r12
  7211. + mov.l @r4+, r13
  7212. + mov.l @r4+, r14
  7213. + mov.l @r4+, r15
  7214. + lds.l @r4+, pr
  7215. + fmov.s @r4+, fr12
  7216. + fmov.s @r4+, fr13
  7217. + fmov.s @r4+, fr14
  7218. + fmov.s @r4+, fr15
  7219. +
  7220. + tst r5, r5
  7221. + movt r0
  7222. + add r5, r0
  7223. +
  7224. + rts
  7225. + nop
  7226. diff -Nur musl-0.9.15/src/setjmp/superh/setjmp.s musl-git/src/setjmp/superh/setjmp.s
  7227. --- musl-0.9.15/src/setjmp/superh/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7228. +++ musl-git/src/setjmp/superh/setjmp.s 2014-02-25 15:24:14.000000000 +0100
  7229. @@ -0,0 +1,25 @@
  7230. +.global __setjmp
  7231. +.global _setjmp
  7232. +.global setjmp
  7233. +.type __setjmp, @function
  7234. +.type _setjmp, @function
  7235. +.type setjmp, @function
  7236. +__setjmp:
  7237. +_setjmp:
  7238. +setjmp:
  7239. + add #52, r4
  7240. + fmov.s fr15, @-r4
  7241. + fmov.s fr14, @-r4
  7242. + fmov.s fr13, @-r4
  7243. + fmov.s fr12, @-r4
  7244. + sts.l pr, @-r4
  7245. + mov.l r15 @-r4
  7246. + mov.l r14, @-r4
  7247. + mov.l r13, @-r4
  7248. + mov.l r12, @-r4
  7249. + mov.l r11, @-r4
  7250. + mov.l r10, @-r4
  7251. + mov.l r9, @-r4
  7252. + mov.l r8, @-r4
  7253. + rts
  7254. + mov #0, r0
  7255. diff -Nur musl-0.9.15/src/setjmp/x32/longjmp.s musl-git/src/setjmp/x32/longjmp.s
  7256. --- musl-0.9.15/src/setjmp/x32/longjmp.s 1970-01-01 01:00:00.000000000 +0100
  7257. +++ musl-git/src/setjmp/x32/longjmp.s 2014-02-25 15:24:14.000000000 +0100
  7258. @@ -0,0 +1,22 @@
  7259. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7260. +.global _longjmp
  7261. +.global longjmp
  7262. +.type _longjmp,@function
  7263. +.type longjmp,@function
  7264. +_longjmp:
  7265. +longjmp:
  7266. + mov %rsi,%rax /* val will be longjmp return */
  7267. + test %rax,%rax
  7268. + jnz 1f
  7269. + inc %rax /* if val==0, val=1 per longjmp semantics */
  7270. +1:
  7271. + mov (%rdi),%rbx /* rdi is the jmp_buf, restore regs from it */
  7272. + mov 8(%rdi),%rbp
  7273. + mov 16(%rdi),%r12
  7274. + mov 24(%rdi),%r13
  7275. + mov 32(%rdi),%r14
  7276. + mov 40(%rdi),%r15
  7277. + mov 48(%rdi),%rdx /* this ends up being the stack pointer */
  7278. + mov %rdx,%rsp
  7279. + mov 56(%rdi),%rdx /* this is the instruction pointer */
  7280. + jmp *%rdx /* goto saved address without altering rsp */
  7281. diff -Nur musl-0.9.15/src/setjmp/x32/setjmp.s musl-git/src/setjmp/x32/setjmp.s
  7282. --- musl-0.9.15/src/setjmp/x32/setjmp.s 1970-01-01 01:00:00.000000000 +0100
  7283. +++ musl-git/src/setjmp/x32/setjmp.s 2014-02-25 15:24:14.000000000 +0100
  7284. @@ -0,0 +1,22 @@
  7285. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7286. +.global __setjmp
  7287. +.global _setjmp
  7288. +.global setjmp
  7289. +.type __setjmp,@function
  7290. +.type _setjmp,@function
  7291. +.type setjmp,@function
  7292. +__setjmp:
  7293. +_setjmp:
  7294. +setjmp:
  7295. + mov %rbx,(%rdi) /* rdi is jmp_buf, move registers onto it */
  7296. + mov %rbp,8(%rdi)
  7297. + mov %r12,16(%rdi)
  7298. + mov %r13,24(%rdi)
  7299. + mov %r14,32(%rdi)
  7300. + mov %r15,40(%rdi)
  7301. + lea 8(%rsp),%rdx /* this is our rsp WITHOUT current ret addr */
  7302. + mov %rdx,48(%rdi)
  7303. + mov (%rsp),%rdx /* save return addr ptr for new rip */
  7304. + mov %rdx,56(%rdi)
  7305. + xor %rax,%rax /* always return 0 */
  7306. + ret
  7307. diff -Nur musl-0.9.15/src/signal/sigandset.c musl-git/src/signal/sigandset.c
  7308. --- musl-0.9.15/src/signal/sigandset.c 2014-01-03 21:12:18.000000000 +0100
  7309. +++ musl-git/src/signal/sigandset.c 2014-02-25 15:24:14.000000000 +0100
  7310. @@ -3,7 +3,7 @@
  7311. #define SST_SIZE (_NSIG/8/sizeof(long))
  7312. -int sigandset(sigset_t *dest, sigset_t *left, sigset_t *right)
  7313. +int sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
  7314. {
  7315. unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
  7316. for(; i < SST_SIZE; i++) d[i] = l[i] & r[i];
  7317. diff -Nur musl-0.9.15/src/signal/sigorset.c musl-git/src/signal/sigorset.c
  7318. --- musl-0.9.15/src/signal/sigorset.c 2014-01-03 21:12:18.000000000 +0100
  7319. +++ musl-git/src/signal/sigorset.c 2014-02-25 15:24:14.000000000 +0100
  7320. @@ -3,7 +3,7 @@
  7321. #define SST_SIZE (_NSIG/8/sizeof(long))
  7322. -int sigorset(sigset_t *dest, sigset_t *left, sigset_t *right)
  7323. +int sigorset(sigset_t *dest, const sigset_t *left, const sigset_t *right)
  7324. {
  7325. unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
  7326. for(; i < SST_SIZE; i++) d[i] = l[i] | r[i];
  7327. diff -Nur musl-0.9.15/src/signal/superh/restore.s musl-git/src/signal/superh/restore.s
  7328. --- musl-0.9.15/src/signal/superh/restore.s 1970-01-01 01:00:00.000000000 +0100
  7329. +++ musl-git/src/signal/superh/restore.s 2014-02-25 15:24:14.000000000 +0100
  7330. @@ -0,0 +1,24 @@
  7331. +.global __restore
  7332. +.type __restore, @function
  7333. +__restore:
  7334. + mov #119, r3 !__NR_sigreturn
  7335. + trapa #16
  7336. +
  7337. + or r0, r0
  7338. + or r0, r0
  7339. + or r0, r0
  7340. + or r0, r0
  7341. + or r0, r0
  7342. +
  7343. +.global __restore_rt
  7344. +.type __restore_rt, @function
  7345. +__restore_rt:
  7346. + mov #100, r3 !__NR_rt_sigreturn
  7347. + add #73, r3
  7348. + trapa #16
  7349. +
  7350. + or r0, r0
  7351. + or r0, r0
  7352. + or r0, r0
  7353. + or r0, r0
  7354. + or r0, r0
  7355. diff -Nur musl-0.9.15/src/signal/superh/sigsetjmp.s musl-git/src/signal/superh/sigsetjmp.s
  7356. --- musl-0.9.15/src/signal/superh/sigsetjmp.s 1970-01-01 01:00:00.000000000 +0100
  7357. +++ musl-git/src/signal/superh/sigsetjmp.s 2014-02-25 15:24:14.000000000 +0100
  7358. @@ -0,0 +1,27 @@
  7359. +.global sigsetjmp
  7360. +.type sigsetjmp, @function
  7361. +sigsetjmp:
  7362. + mov.l r5, @(36,r4)
  7363. + tst r5, r5
  7364. + bf 2f
  7365. +
  7366. + sts.l pr, @-r15
  7367. + mov.l r4, @-r15
  7368. + mov r4, r6
  7369. + add #40, r6
  7370. + mov #0, r5
  7371. + mov #2, r4
  7372. + mov.l L1, r0
  7373. + bsrf r0
  7374. + nop
  7375. +1: mov.l @r15+, r4
  7376. + lds.l @r15+, pr
  7377. +
  7378. +2: mov.l L2, r0
  7379. + braf r0
  7380. + nop
  7381. +3:
  7382. +
  7383. +.align 2
  7384. +L1: .long pthread_sigmask@PLT-(1b-.)
  7385. +L2: .long setjmp@PLT-(3b-.)
  7386. diff -Nur musl-0.9.15/src/signal/x32/restore.s musl-git/src/signal/x32/restore.s
  7387. --- musl-0.9.15/src/signal/x32/restore.s 1970-01-01 01:00:00.000000000 +0100
  7388. +++ musl-git/src/signal/x32/restore.s 2014-02-25 15:24:14.000000000 +0100
  7389. @@ -0,0 +1,8 @@
  7390. +.global __restore_rt
  7391. +.global __restore
  7392. +.type __restore_rt,@function
  7393. +.type __restore,@function
  7394. +__restore_rt:
  7395. +__restore:
  7396. + movl $0x40000201, %eax /* SYS_rt_sigreturn */
  7397. + syscall
  7398. diff -Nur musl-0.9.15/src/signal/x32/sigsetjmp.s musl-git/src/signal/x32/sigsetjmp.s
  7399. --- musl-0.9.15/src/signal/x32/sigsetjmp.s 1970-01-01 01:00:00.000000000 +0100
  7400. +++ musl-git/src/signal/x32/sigsetjmp.s 2014-02-25 15:24:14.000000000 +0100
  7401. @@ -0,0 +1,14 @@
  7402. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7403. +.global sigsetjmp
  7404. +.type sigsetjmp,@function
  7405. +sigsetjmp:
  7406. + andl %esi,%esi
  7407. + movq %rsi,64(%rdi)
  7408. + jz 1f
  7409. + pushq %rdi
  7410. + leaq 72(%rdi),%rdx
  7411. + xorl %esi,%esi
  7412. + movl $2,%edi
  7413. + call sigprocmask
  7414. + popq %rdi
  7415. +1: jmp setjmp
  7416. diff -Nur musl-0.9.15/src/stdio/__fdopen.c musl-git/src/stdio/__fdopen.c
  7417. --- musl-0.9.15/src/stdio/__fdopen.c 2014-01-03 21:12:18.000000000 +0100
  7418. +++ musl-git/src/stdio/__fdopen.c 2014-02-25 15:24:14.000000000 +0100
  7419. @@ -32,7 +32,9 @@
  7420. /* Set append mode on fd if opened for append */
  7421. if (*mode == 'a') {
  7422. int flags = __syscall(SYS_fcntl, fd, F_GETFL);
  7423. - __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
  7424. + if (!(flags & O_APPEND))
  7425. + __syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
  7426. + f->flags |= F_APP;
  7427. }
  7428. f->fd = fd;
  7429. diff -Nur musl-0.9.15/src/stdio/ftell.c musl-git/src/stdio/ftell.c
  7430. --- musl-0.9.15/src/stdio/ftell.c 2014-01-03 21:12:18.000000000 +0100
  7431. +++ musl-git/src/stdio/ftell.c 2014-02-25 15:24:14.000000000 +0100
  7432. @@ -4,7 +4,9 @@
  7433. off_t __ftello_unlocked(FILE *f)
  7434. {
  7435. - off_t pos = f->seek(f, 0, SEEK_CUR);
  7436. + off_t pos = f->seek(f, 0,
  7437. + (f->flags & F_APP) && f->wpos > f->wbase
  7438. + ? SEEK_END : SEEK_CUR);
  7439. if (pos < 0) return pos;
  7440. /* Adjust for data in buffer. */
  7441. diff -Nur musl-0.9.15/src/stdio/vfscanf.c musl-git/src/stdio/vfscanf.c
  7442. --- musl-0.9.15/src/stdio/vfscanf.c 2014-01-03 21:12:18.000000000 +0100
  7443. +++ musl-git/src/stdio/vfscanf.c 2014-02-25 15:24:14.000000000 +0100
  7444. @@ -328,3 +328,5 @@
  7445. FUNLOCK(f);
  7446. return matches;
  7447. }
  7448. +
  7449. +weak_alias(vfscanf,__isoc99_vfscanf);
  7450. diff -Nur musl-0.9.15/src/thread/arm/clone.s musl-git/src/thread/arm/clone.s
  7451. --- musl-0.9.15/src/thread/arm/clone.s 2014-01-03 21:12:18.000000000 +0100
  7452. +++ musl-git/src/thread/arm/clone.s 2014-02-25 15:24:14.000000000 +0100
  7453. @@ -1,10 +1,7 @@
  7454. .text
  7455. .global __clone
  7456. -.weak clone
  7457. .type __clone,%function
  7458. -.type clone,%function
  7459. __clone:
  7460. -clone:
  7461. stmfd sp!,{r4,r5,r6,r7}
  7462. mov r7,#120
  7463. mov r6,r3
  7464. diff -Nur musl-0.9.15/src/thread/cancel_dummy.c musl-git/src/thread/cancel_dummy.c
  7465. --- musl-0.9.15/src/thread/cancel_dummy.c 2014-01-03 21:12:18.000000000 +0100
  7466. +++ musl-git/src/thread/cancel_dummy.c 2014-02-25 15:24:14.000000000 +0100
  7467. @@ -1,6 +1,9 @@
  7468. #include "pthread_impl.h"
  7469. +#include "syscall.h"
  7470. -static long sccp(long nr, long u, long v, long w, long x, long y, long z)
  7471. +static long sccp(syscall_arg_t nr,
  7472. + syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
  7473. + syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
  7474. {
  7475. return (__syscall)(nr, u, v, w, x, y, z);
  7476. }
  7477. diff -Nur musl-0.9.15/src/thread/cancel_impl.c musl-git/src/thread/cancel_impl.c
  7478. --- musl-0.9.15/src/thread/cancel_impl.c 2014-01-03 21:12:18.000000000 +0100
  7479. +++ musl-git/src/thread/cancel_impl.c 2014-02-25 15:24:14.000000000 +0100
  7480. @@ -1,4 +1,5 @@
  7481. #include "pthread_impl.h"
  7482. +#include "syscall.h"
  7483. void __cancel()
  7484. {
  7485. @@ -8,9 +9,13 @@
  7486. pthread_exit(PTHREAD_CANCELED);
  7487. }
  7488. -long __syscall_cp_asm(volatile void *, long, long, long, long, long, long, long);
  7489. +long __syscall_cp_asm(volatile void *, syscall_arg_t,
  7490. + syscall_arg_t, syscall_arg_t, syscall_arg_t,
  7491. + syscall_arg_t, syscall_arg_t, syscall_arg_t);
  7492. -long (__syscall_cp)(long nr, long u, long v, long w, long x, long y, long z)
  7493. +long (__syscall_cp)(syscall_arg_t nr,
  7494. + syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
  7495. + syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
  7496. {
  7497. pthread_t self;
  7498. long r;
  7499. diff -Nur musl-0.9.15/src/thread/clone.c musl-git/src/thread/clone.c
  7500. --- musl-0.9.15/src/thread/clone.c 2014-01-03 21:12:18.000000000 +0100
  7501. +++ musl-git/src/thread/clone.c 2014-02-25 15:24:14.000000000 +0100
  7502. @@ -1,10 +1,7 @@
  7503. #include <errno.h>
  7504. -#include "libc.h"
  7505. +#include "pthread_impl.h"
  7506. int __clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
  7507. {
  7508. - errno = ENOSYS;
  7509. - return -1;
  7510. + return -ENOSYS;
  7511. }
  7512. -
  7513. -weak_alias(__clone, clone);
  7514. diff -Nur musl-0.9.15/src/thread/i386/clone.s musl-git/src/thread/i386/clone.s
  7515. --- musl-0.9.15/src/thread/i386/clone.s 2014-01-03 21:12:18.000000000 +0100
  7516. +++ musl-git/src/thread/i386/clone.s 2014-02-25 15:24:14.000000000 +0100
  7517. @@ -1,10 +1,7 @@
  7518. .text
  7519. .global __clone
  7520. -.weak clone
  7521. .type __clone,@function
  7522. -.type clone,@function
  7523. __clone:
  7524. -clone:
  7525. push %ebp
  7526. mov %esp,%ebp
  7527. push %ebx
  7528. diff -Nur musl-0.9.15/src/thread/microblaze/clone.s musl-git/src/thread/microblaze/clone.s
  7529. --- musl-0.9.15/src/thread/microblaze/clone.s 2014-01-03 21:12:18.000000000 +0100
  7530. +++ musl-git/src/thread/microblaze/clone.s 2014-02-25 15:24:14.000000000 +0100
  7531. @@ -1,14 +1,11 @@
  7532. .global __clone
  7533. -.weak clone
  7534. .type __clone,@function
  7535. -.type clone,@function
  7536. # r5, r6, r7, r8, r9, r10, stack
  7537. # fn, st, fl, ar, pt, tl, ct
  7538. # fl, st, __, pt, ct, tl
  7539. __clone:
  7540. -clone:
  7541. andi r6, r6, -16
  7542. addi r6, r6, -16
  7543. swi r5, r6, 0
  7544. @@ -23,7 +20,7 @@
  7545. beqi r3, 1f
  7546. rtsd r15, 8
  7547. nop
  7548. -
  7549. +
  7550. 1: lwi r3, r1, 0
  7551. lwi r5, r1, 4
  7552. brald r15, r3
  7553. diff -Nur musl-0.9.15/src/thread/superh/clone.s musl-git/src/thread/superh/clone.s
  7554. --- musl-0.9.15/src/thread/superh/clone.s 1970-01-01 01:00:00.000000000 +0100
  7555. +++ musl-git/src/thread/superh/clone.s 2014-02-25 15:24:14.000000000 +0100
  7556. @@ -0,0 +1,47 @@
  7557. +.text
  7558. +.global __clone
  7559. +.type __clone, @function
  7560. +__clone:
  7561. +! incoming: fn stack flags arg ptid tls ctid
  7562. +! r4 r5 r6 r7 @r15 @(4,r15) @(8,r15)
  7563. +
  7564. + mov #-16, r0
  7565. + and r0, r5
  7566. +
  7567. + mov r4, r1 ! r1 = fn
  7568. + mov r7, r2 ! r2 = arg
  7569. +
  7570. + mov #120, r3 ! r3 = __NR_clone
  7571. + mov r6, r4 ! r4 = flags
  7572. + !mov r5, r5 ! r5 = stack
  7573. + mov.l @r15, r6 ! r6 = ptid
  7574. + mov.l @(8,r15), r7 ! r7 = ctid
  7575. + mov.l @(4,r15), r0 ! r0 = tls
  7576. + trapa #21
  7577. +
  7578. + or r0, r0
  7579. + or r0, r0
  7580. + or r0, r0
  7581. + or r0, r0
  7582. + or r0, r0
  7583. +
  7584. + cmp/eq #0, r0
  7585. + bt 1f
  7586. +
  7587. + ! we are the parent, return
  7588. + rts
  7589. + nop
  7590. +
  7591. +1: ! we are the child, call fn(arg)
  7592. + jsr @r1
  7593. + mov r2, r4
  7594. +
  7595. + mov #1, r3 ! __NR_exit
  7596. + mov r0, r4
  7597. + trapa #17
  7598. +
  7599. + or r0, r0
  7600. + or r0, r0
  7601. + or r0, r0
  7602. + or r0, r0
  7603. + or r0, r0
  7604. diff -Nur musl-0.9.15/src/thread/superh/__set_thread_area.s musl-git/src/thread/superh/__set_thread_area.s
  7605. --- musl-0.9.15/src/thread/superh/__set_thread_area.s 1970-01-01 01:00:00.000000000 +0100
  7606. +++ musl-git/src/thread/superh/__set_thread_area.s 2014-02-25 15:24:14.000000000 +0100
  7607. @@ -0,0 +1,5 @@
  7608. +.global __set_thread_area
  7609. +.type __set_thread_area, @function
  7610. +__set_thread_area:
  7611. + rts
  7612. + ldc r4, gbr
  7613. diff -Nur musl-0.9.15/src/thread/superh/syscall_cp.s musl-git/src/thread/superh/syscall_cp.s
  7614. --- musl-0.9.15/src/thread/superh/syscall_cp.s 1970-01-01 01:00:00.000000000 +0100
  7615. +++ musl-git/src/thread/superh/syscall_cp.s 2014-02-25 15:24:14.000000000 +0100
  7616. @@ -0,0 +1,39 @@
  7617. +.text
  7618. +.global __syscall_cp_asm
  7619. +.type __syscall_cp_asm, @function
  7620. +__syscall_cp_asm:
  7621. +
  7622. +.global __cp_begin
  7623. +__cp_begin:
  7624. + mov.l @r4, r4
  7625. + tst r4, r4
  7626. + bt 2f
  7627. +
  7628. + mov.l L1, r0
  7629. + braf r0
  7630. + nop
  7631. +1:
  7632. +
  7633. +.align 2
  7634. +L1: .long __cancel@PLT-(1b-.)
  7635. +
  7636. +2: mov r5, r3
  7637. + mov r6, r4
  7638. + mov r7, r5
  7639. + mov.l @r15, r6
  7640. + mov.l @(4,r15), r7
  7641. + mov.l @(8,r15), r0
  7642. + mov.l @(12,r15), r1
  7643. + trapa #22
  7644. +
  7645. +.global __cp_end
  7646. +__cp_end:
  7647. + ! work around hardware bug
  7648. + or r0, r0
  7649. + or r0, r0
  7650. + or r0, r0
  7651. + or r0, r0
  7652. + or r0, r0
  7653. +
  7654. + rts
  7655. + nop
  7656. diff -Nur musl-0.9.15/src/thread/superh/__unmapself.s musl-git/src/thread/superh/__unmapself.s
  7657. --- musl-0.9.15/src/thread/superh/__unmapself.s 1970-01-01 01:00:00.000000000 +0100
  7658. +++ musl-git/src/thread/superh/__unmapself.s 2014-02-25 15:24:14.000000000 +0100
  7659. @@ -0,0 +1,22 @@
  7660. +.text
  7661. +.global __unmapself
  7662. +.type __unmapself, @function
  7663. +__unmapself:
  7664. + mov #91, r3 ! SYS_munmap
  7665. + trapa #18
  7666. +
  7667. + or r0, r0
  7668. + or r0, r0
  7669. + or r0, r0
  7670. + or r0, r0
  7671. + or r0, r0
  7672. +
  7673. + mov #1, r3 ! SYS_exit
  7674. + mov #0, r4
  7675. + trapa #17
  7676. +
  7677. + or r0, r0
  7678. + or r0, r0
  7679. + or r0, r0
  7680. + or r0, r0
  7681. + or r0, r0
  7682. diff -Nur musl-0.9.15/src/thread/__wait.c musl-git/src/thread/__wait.c
  7683. --- musl-0.9.15/src/thread/__wait.c 2014-01-03 21:12:18.000000000 +0100
  7684. +++ musl-git/src/thread/__wait.c 2014-02-25 15:24:14.000000000 +0100
  7685. @@ -10,6 +10,6 @@
  7686. }
  7687. if (waiters) a_inc(waiters);
  7688. while (*addr==val)
  7689. - __syscall(SYS_futex, (long)addr, FUTEX_WAIT|priv, val, 0);
  7690. + __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val, 0);
  7691. if (waiters) a_dec(waiters);
  7692. }
  7693. diff -Nur musl-0.9.15/src/thread/x32/clone.s musl-git/src/thread/x32/clone.s
  7694. --- musl-0.9.15/src/thread/x32/clone.s 1970-01-01 01:00:00.000000000 +0100
  7695. +++ musl-git/src/thread/x32/clone.s 2014-02-25 15:24:14.000000000 +0100
  7696. @@ -0,0 +1,25 @@
  7697. +.text
  7698. +.global __clone
  7699. +.type __clone,@function
  7700. +__clone:
  7701. + movl $0x40000038,%eax /* SYS_clone */
  7702. + mov %rdi,%r11
  7703. + mov %rdx,%rdi
  7704. + mov %r8,%rdx
  7705. + mov %r9,%r8
  7706. + mov 8(%rsp),%r10
  7707. + mov %r11,%r9
  7708. + and $-16,%rsi
  7709. + sub $8,%rsi
  7710. + mov %rcx,(%rsi)
  7711. + syscall
  7712. + test %eax,%eax
  7713. + jnz 1f
  7714. + xor %ebp,%ebp
  7715. + pop %rdi
  7716. + call *%r9
  7717. + mov %eax,%edi
  7718. + movl $0x4000003c,%eax /* SYS_exit */
  7719. + syscall
  7720. + hlt
  7721. +1: ret
  7722. diff -Nur musl-0.9.15/src/thread/x32/__set_thread_area.s musl-git/src/thread/x32/__set_thread_area.s
  7723. --- musl-0.9.15/src/thread/x32/__set_thread_area.s 1970-01-01 01:00:00.000000000 +0100
  7724. +++ musl-git/src/thread/x32/__set_thread_area.s 2014-02-25 15:24:14.000000000 +0100
  7725. @@ -0,0 +1,10 @@
  7726. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7727. +.text
  7728. +.global __set_thread_area
  7729. +.type __set_thread_area,@function
  7730. +__set_thread_area:
  7731. + mov %rdi,%rsi /* shift for syscall */
  7732. + movl $0x1002,%edi /* SET_FS register */
  7733. + movl $0x4000009e,%eax /* set fs segment to */
  7734. + syscall /* arch_prctl(SET_FS, arg)*/
  7735. + ret
  7736. diff -Nur musl-0.9.15/src/thread/x32/syscall_cp.s musl-git/src/thread/x32/syscall_cp.s
  7737. --- musl-0.9.15/src/thread/x32/syscall_cp.s 1970-01-01 01:00:00.000000000 +0100
  7738. +++ musl-git/src/thread/x32/syscall_cp.s 2014-02-25 15:24:14.000000000 +0100
  7739. @@ -0,0 +1,23 @@
  7740. +.text
  7741. +.global __syscall_cp_internal
  7742. +.type __syscall_cp_internal,@function
  7743. +__syscall_cp_internal:
  7744. +
  7745. +.global __cp_begin
  7746. +__cp_begin:
  7747. + mov (%rdi),%eax
  7748. + test %eax,%eax
  7749. + jnz __cancel
  7750. + mov %rdi,%r11
  7751. + mov %rsi,%rax
  7752. + mov %rdx,%rdi
  7753. + mov %rcx,%rsi
  7754. + mov %r8,%rdx
  7755. + mov %r9,%r10
  7756. + mov 8(%rsp),%r8
  7757. + mov 16(%rsp),%r9
  7758. + mov %r11,8(%rsp)
  7759. + syscall
  7760. +.global __cp_end
  7761. +__cp_end:
  7762. + ret
  7763. diff -Nur musl-0.9.15/src/thread/x32/__unmapself.s musl-git/src/thread/x32/__unmapself.s
  7764. --- musl-0.9.15/src/thread/x32/__unmapself.s 1970-01-01 01:00:00.000000000 +0100
  7765. +++ musl-git/src/thread/x32/__unmapself.s 2014-02-25 15:24:14.000000000 +0100
  7766. @@ -0,0 +1,10 @@
  7767. +/* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */
  7768. +.text
  7769. +.global __unmapself
  7770. +.type __unmapself,@function
  7771. +__unmapself:
  7772. + movl $0x4000000b,%eax /* SYS_munmap */
  7773. + syscall /* munmap(arg2,arg3) */
  7774. + xor %rdi,%rdi /* exit() args: always return success */
  7775. + movl $0x4000003c,%eax /* SYS_exit */
  7776. + syscall /* exit(0) */
  7777. diff -Nur musl-0.9.15/src/thread/x86_64/clone.s musl-git/src/thread/x86_64/clone.s
  7778. --- musl-0.9.15/src/thread/x86_64/clone.s 2014-01-03 21:12:18.000000000 +0100
  7779. +++ musl-git/src/thread/x86_64/clone.s 2014-02-25 15:24:14.000000000 +0100
  7780. @@ -1,10 +1,7 @@
  7781. .text
  7782. .global __clone
  7783. -.weak clone
  7784. .type __clone,@function
  7785. -.type clone,@function
  7786. __clone:
  7787. -clone:
  7788. xor %eax,%eax
  7789. mov $56,%al
  7790. mov %rdi,%r11
  7791. diff -Nur musl-0.9.15/src/time/timer_delete.c musl-git/src/time/timer_delete.c
  7792. --- musl-0.9.15/src/time/timer_delete.c 2014-01-03 21:12:18.000000000 +0100
  7793. +++ musl-git/src/time/timer_delete.c 2014-02-25 15:24:14.000000000 +0100
  7794. @@ -10,5 +10,5 @@
  7795. __wake(&td->timer_id, 1, 1);
  7796. return 0;
  7797. }
  7798. - return __syscall(SYS_timer_delete, (long)t);
  7799. + return __syscall(SYS_timer_delete, t);
  7800. }
  7801. diff -Nur musl-0.9.15/src/time/timer_getoverrun.c musl-git/src/time/timer_getoverrun.c
  7802. --- musl-0.9.15/src/time/timer_getoverrun.c 2014-01-03 21:12:18.000000000 +0100
  7803. +++ musl-git/src/time/timer_getoverrun.c 2014-02-25 15:24:14.000000000 +0100
  7804. @@ -8,5 +8,5 @@
  7805. pthread_t td = (void *)((uintptr_t)t << 1);
  7806. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  7807. }
  7808. - return syscall(SYS_timer_getoverrun, (long)t);
  7809. + return syscall(SYS_timer_getoverrun, t);
  7810. }
  7811. diff -Nur musl-0.9.15/src/time/timer_gettime.c musl-git/src/time/timer_gettime.c
  7812. --- musl-0.9.15/src/time/timer_gettime.c 2014-01-03 21:12:18.000000000 +0100
  7813. +++ musl-git/src/time/timer_gettime.c 2014-02-25 15:24:14.000000000 +0100
  7814. @@ -8,5 +8,5 @@
  7815. pthread_t td = (void *)((uintptr_t)t << 1);
  7816. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  7817. }
  7818. - return syscall(SYS_timer_gettime, (long)t, val);
  7819. + return syscall(SYS_timer_gettime, t, val);
  7820. }
  7821. diff -Nur musl-0.9.15/src/time/timer_settime.c musl-git/src/time/timer_settime.c
  7822. --- musl-0.9.15/src/time/timer_settime.c 2014-01-03 21:12:18.000000000 +0100
  7823. +++ musl-git/src/time/timer_settime.c 2014-02-25 15:24:14.000000000 +0100
  7824. @@ -8,5 +8,5 @@
  7825. pthread_t td = (void *)((uintptr_t)t << 1);
  7826. t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
  7827. }
  7828. - return syscall(SYS_timer_settime, (long)t, flags, val, old);
  7829. + return syscall(SYS_timer_settime, t, flags, val, old);
  7830. }
  7831. diff -Nur musl-0.9.15/src/unistd/superh/pipe.s musl-git/src/unistd/superh/pipe.s
  7832. --- musl-0.9.15/src/unistd/superh/pipe.s 1970-01-01 01:00:00.000000000 +0100
  7833. +++ musl-git/src/unistd/superh/pipe.s 2014-02-25 15:24:14.000000000 +0100
  7834. @@ -0,0 +1,27 @@
  7835. +.global pipe
  7836. +.type pipe, @function
  7837. +pipe:
  7838. + mov #42, r3
  7839. + trapa #17
  7840. +
  7841. + ! work around hardware bug
  7842. + or r0, r0
  7843. + or r0, r0
  7844. + or r0, r0
  7845. + or r0, r0
  7846. + or r0, r0
  7847. +
  7848. + cmp/pz r0
  7849. + bt 1f
  7850. +
  7851. + mov.l L1, r1
  7852. + braf r1
  7853. + mov r0, r4
  7854. +
  7855. +1: mov.l r0, @(0,r4)
  7856. + mov.l r1, @(4,r4)
  7857. + rts
  7858. + mov #0, r0
  7859. +
  7860. +.align 2
  7861. +L1: .long __syscall_ret@PLT-(1b-.)
  7862. diff -Nur musl-0.9.15/tools/install.sh musl-git/tools/install.sh
  7863. --- musl-0.9.15/tools/install.sh 2014-01-03 21:12:18.000000000 +0100
  7864. +++ musl-git/tools/install.sh 2014-02-25 15:24:14.000000000 +0100
  7865. @@ -51,6 +51,7 @@
  7866. ln -s "$1" "$tmp"
  7867. else
  7868. cat < "$1" > "$tmp"
  7869. +chmod "$mode" "$tmp"
  7870. fi
  7871. mv -f "$tmp" "$2"
  7872. @@ -60,6 +61,4 @@
  7873. exit 1
  7874. }
  7875. -test "$symlink" || chmod "$mode" "$2"
  7876. -
  7877. exit 0