entry.S 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776
  1. /*
  2. * arch/ia64/kernel/entry.S
  3. *
  4. * Kernel entry points.
  5. *
  6. * Copyright (C) 1998-2003, 2005 Hewlett-Packard Co
  7. * David Mosberger-Tang <davidm@hpl.hp.com>
  8. * Copyright (C) 1999, 2002-2003
  9. * Asit Mallick <Asit.K.Mallick@intel.com>
  10. * Don Dugger <Don.Dugger@intel.com>
  11. * Suresh Siddha <suresh.b.siddha@intel.com>
  12. * Fenghua Yu <fenghua.yu@intel.com>
  13. * Copyright (C) 1999 VA Linux Systems
  14. * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  15. */
  16. /*
  17. * ia64_switch_to now places correct virtual mapping in in TR2 for
  18. * kernel stack. This allows us to handle interrupts without changing
  19. * to physical mode.
  20. *
  21. * Jonathan Nicklin <nicklin@missioncriticallinux.com>
  22. * Patrick O'Rourke <orourke@missioncriticallinux.com>
  23. * 11/07/2000
  24. */
  25. /*
  26. * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
  27. * VA Linux Systems Japan K.K.
  28. * pv_ops.
  29. */
  30. /*
  31. * Global (preserved) predicate usage on syscall entry/exit path:
  32. *
  33. * pKStk: See entry.h.
  34. * pUStk: See entry.h.
  35. * pSys: See entry.h.
  36. * pNonSys: !pSys
  37. */
  38. #include <asm/asmmacro.h>
  39. #include <asm/cache.h>
  40. #include <asm/errno.h>
  41. #include <asm/kregs.h>
  42. #include <asm/asm-offsets.h>
  43. #include <asm/pgtable.h>
  44. #include <asm/percpu.h>
  45. #include <asm/processor.h>
  46. #include <asm/thread_info.h>
  47. #include <asm/unistd.h>
  48. #include <asm/ftrace.h>
  49. #include "minstate.h"
  50. /*
  51. * execve() is special because in case of success, we need to
  52. * setup a null register window frame.
  53. */
  54. ENTRY(ia64_execve)
  55. /*
  56. * Allocate 8 input registers since ptrace() may clobber them
  57. */
  58. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
  59. alloc loc1=ar.pfs,8,2,3,0
  60. mov loc0=rp
  61. .body
  62. mov out0=in0 // filename
  63. ;; // stop bit between alloc and call
  64. mov out1=in1 // argv
  65. mov out2=in2 // envp
  66. br.call.sptk.many rp=sys_execve
  67. .ret0:
  68. cmp4.ge p6,p7=r8,r0
  69. mov ar.pfs=loc1 // restore ar.pfs
  70. sxt4 r8=r8 // return 64-bit result
  71. ;;
  72. stf.spill [sp]=f0
  73. mov rp=loc0
  74. (p6) mov ar.pfs=r0 // clear ar.pfs on success
  75. (p7) br.ret.sptk.many rp
  76. /*
  77. * In theory, we'd have to zap this state only to prevent leaking of
  78. * security sensitive state (e.g., if current->mm->dumpable is zero). However,
  79. * this executes in less than 20 cycles even on Itanium, so it's not worth
  80. * optimizing for...).
  81. */
  82. mov ar.unat=0; mov ar.lc=0
  83. mov r4=0; mov f2=f0; mov b1=r0
  84. mov r5=0; mov f3=f0; mov b2=r0
  85. mov r6=0; mov f4=f0; mov b3=r0
  86. mov r7=0; mov f5=f0; mov b4=r0
  87. ldf.fill f12=[sp]; mov f13=f0; mov b5=r0
  88. ldf.fill f14=[sp]; ldf.fill f15=[sp]; mov f16=f0
  89. ldf.fill f17=[sp]; ldf.fill f18=[sp]; mov f19=f0
  90. ldf.fill f20=[sp]; ldf.fill f21=[sp]; mov f22=f0
  91. ldf.fill f23=[sp]; ldf.fill f24=[sp]; mov f25=f0
  92. ldf.fill f26=[sp]; ldf.fill f27=[sp]; mov f28=f0
  93. ldf.fill f29=[sp]; ldf.fill f30=[sp]; mov f31=f0
  94. br.ret.sptk.many rp
  95. END(ia64_execve)
  96. /*
  97. * sys_clone2(u64 flags, u64 ustack_base, u64 ustack_size, u64 parent_tidptr, u64 child_tidptr,
  98. * u64 tls)
  99. */
  100. GLOBAL_ENTRY(sys_clone2)
  101. /*
  102. * Allocate 8 input registers since ptrace() may clobber them
  103. */
  104. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
  105. alloc r16=ar.pfs,8,2,6,0
  106. DO_SAVE_SWITCH_STACK
  107. adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp
  108. mov loc0=rp
  109. mov loc1=r16 // save ar.pfs across do_fork
  110. .body
  111. mov out1=in1
  112. mov out2=in2
  113. tbit.nz p6,p0=in0,CLONE_SETTLS_BIT
  114. mov out3=in3 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
  115. ;;
  116. (p6) st8 [r2]=in5 // store TLS in r16 for copy_thread()
  117. mov out4=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
  118. mov out0=in0 // out0 = clone_flags
  119. br.call.sptk.many rp=do_fork
  120. .ret1: .restore sp
  121. adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
  122. mov ar.pfs=loc1
  123. mov rp=loc0
  124. br.ret.sptk.many rp
  125. END(sys_clone2)
  126. /*
  127. * sys_clone(u64 flags, u64 ustack_base, u64 parent_tidptr, u64 child_tidptr, u64 tls)
  128. * Deprecated. Use sys_clone2() instead.
  129. */
  130. GLOBAL_ENTRY(sys_clone)
  131. /*
  132. * Allocate 8 input registers since ptrace() may clobber them
  133. */
  134. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
  135. alloc r16=ar.pfs,8,2,6,0
  136. DO_SAVE_SWITCH_STACK
  137. adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp
  138. mov loc0=rp
  139. mov loc1=r16 // save ar.pfs across do_fork
  140. .body
  141. mov out1=in1
  142. mov out2=16 // stacksize (compensates for 16-byte scratch area)
  143. tbit.nz p6,p0=in0,CLONE_SETTLS_BIT
  144. mov out3=in2 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
  145. ;;
  146. (p6) st8 [r2]=in4 // store TLS in r13 (tp)
  147. mov out4=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
  148. mov out0=in0 // out0 = clone_flags
  149. br.call.sptk.many rp=do_fork
  150. .ret2: .restore sp
  151. adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
  152. mov ar.pfs=loc1
  153. mov rp=loc0
  154. br.ret.sptk.many rp
  155. END(sys_clone)
  156. /*
  157. * prev_task <- ia64_switch_to(struct task_struct *next)
  158. * With Ingo's new scheduler, interrupts are disabled when this routine gets
  159. * called. The code starting at .map relies on this. The rest of the code
  160. * doesn't care about the interrupt masking status.
  161. */
  162. GLOBAL_ENTRY(ia64_switch_to)
  163. .prologue
  164. alloc r16=ar.pfs,1,0,0,0
  165. DO_SAVE_SWITCH_STACK
  166. .body
  167. adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
  168. movl r25=init_task
  169. mov r27=IA64_KR(CURRENT_STACK)
  170. adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
  171. dep r20=0,in0,61,3 // physical address of "next"
  172. ;;
  173. st8 [r22]=sp // save kernel stack pointer of old task
  174. shr.u r26=r20,IA64_GRANULE_SHIFT
  175. cmp.eq p7,p6=r25,in0
  176. ;;
  177. /*
  178. * If we've already mapped this task's page, we can skip doing it again.
  179. */
  180. (p6) cmp.eq p7,p6=r26,r27
  181. (p6) br.cond.dpnt .map
  182. ;;
  183. .done:
  184. ld8 sp=[r21] // load kernel stack pointer of new task
  185. MOV_TO_KR(CURRENT, in0, r8, r9) // update "current" application register
  186. mov r8=r13 // return pointer to previously running task
  187. mov r13=in0 // set "current" pointer
  188. ;;
  189. DO_LOAD_SWITCH_STACK
  190. #ifdef CONFIG_SMP
  191. sync.i // ensure "fc"s done by this CPU are visible on other CPUs
  192. #endif
  193. br.ret.sptk.many rp // boogie on out in new context
  194. .map:
  195. RSM_PSR_IC(r25) // interrupts (psr.i) are already disabled here
  196. movl r25=PAGE_KERNEL
  197. ;;
  198. srlz.d
  199. or r23=r25,r20 // construct PA | page properties
  200. mov r25=IA64_GRANULE_SHIFT<<2
  201. ;;
  202. MOV_TO_ITIR(p0, r25, r8)
  203. MOV_TO_IFA(in0, r8) // VA of next task...
  204. ;;
  205. mov r25=IA64_TR_CURRENT_STACK
  206. MOV_TO_KR(CURRENT_STACK, r26, r8, r9) // remember last page we mapped...
  207. ;;
  208. itr.d dtr[r25]=r23 // wire in new mapping...
  209. SSM_PSR_IC_AND_SRLZ_D(r8, r9) // reenable the psr.ic bit
  210. br.cond.sptk .done
  211. END(ia64_switch_to)
  212. /*
  213. * Note that interrupts are enabled during save_switch_stack and load_switch_stack. This
  214. * means that we may get an interrupt with "sp" pointing to the new kernel stack while
  215. * ar.bspstore is still pointing to the old kernel backing store area. Since ar.rsc,
  216. * ar.rnat, ar.bsp, and ar.bspstore are all preserved by interrupts, this is not a
  217. * problem. Also, we don't need to specify unwind information for preserved registers
  218. * that are not modified in save_switch_stack as the right unwind information is already
  219. * specified at the call-site of save_switch_stack.
  220. */
  221. /*
  222. * save_switch_stack:
  223. * - r16 holds ar.pfs
  224. * - b7 holds address to return to
  225. * - rp (b0) holds return address to save
  226. */
  227. GLOBAL_ENTRY(save_switch_stack)
  228. .prologue
  229. .altrp b7
  230. flushrs // flush dirty regs to backing store (must be first in insn group)
  231. .save @priunat,r17
  232. mov r17=ar.unat // preserve caller's
  233. .body
  234. #ifdef CONFIG_ITANIUM
  235. adds r2=16+128,sp
  236. adds r3=16+64,sp
  237. adds r14=SW(R4)+16,sp
  238. ;;
  239. st8.spill [r14]=r4,16 // spill r4
  240. lfetch.fault.excl.nt1 [r3],128
  241. ;;
  242. lfetch.fault.excl.nt1 [r2],128
  243. lfetch.fault.excl.nt1 [r3],128
  244. ;;
  245. lfetch.fault.excl [r2]
  246. lfetch.fault.excl [r3]
  247. adds r15=SW(R5)+16,sp
  248. #else
  249. add r2=16+3*128,sp
  250. add r3=16,sp
  251. add r14=SW(R4)+16,sp
  252. ;;
  253. st8.spill [r14]=r4,SW(R6)-SW(R4) // spill r4 and prefetch offset 0x1c0
  254. lfetch.fault.excl.nt1 [r3],128 // prefetch offset 0x010
  255. ;;
  256. lfetch.fault.excl.nt1 [r3],128 // prefetch offset 0x090
  257. lfetch.fault.excl.nt1 [r2],128 // prefetch offset 0x190
  258. ;;
  259. lfetch.fault.excl.nt1 [r3] // prefetch offset 0x110
  260. lfetch.fault.excl.nt1 [r2] // prefetch offset 0x210
  261. adds r15=SW(R5)+16,sp
  262. #endif
  263. ;;
  264. st8.spill [r15]=r5,SW(R7)-SW(R5) // spill r5
  265. mov.m ar.rsc=0 // put RSE in mode: enforced lazy, little endian, pl 0
  266. add r2=SW(F2)+16,sp // r2 = &sw->f2
  267. ;;
  268. st8.spill [r14]=r6,SW(B0)-SW(R6) // spill r6
  269. mov.m r18=ar.fpsr // preserve fpsr
  270. add r3=SW(F3)+16,sp // r3 = &sw->f3
  271. ;;
  272. stf.spill [r2]=f2,32
  273. mov.m r19=ar.rnat
  274. mov r21=b0
  275. stf.spill [r3]=f3,32
  276. st8.spill [r15]=r7,SW(B2)-SW(R7) // spill r7
  277. mov r22=b1
  278. ;;
  279. // since we're done with the spills, read and save ar.unat:
  280. mov.m r29=ar.unat
  281. mov.m r20=ar.bspstore
  282. mov r23=b2
  283. stf.spill [r2]=f4,32
  284. stf.spill [r3]=f5,32
  285. mov r24=b3
  286. ;;
  287. st8 [r14]=r21,SW(B1)-SW(B0) // save b0
  288. st8 [r15]=r23,SW(B3)-SW(B2) // save b2
  289. mov r25=b4
  290. mov r26=b5
  291. ;;
  292. st8 [r14]=r22,SW(B4)-SW(B1) // save b1
  293. st8 [r15]=r24,SW(AR_PFS)-SW(B3) // save b3
  294. mov r21=ar.lc // I-unit
  295. stf.spill [r2]=f12,32
  296. stf.spill [r3]=f13,32
  297. ;;
  298. st8 [r14]=r25,SW(B5)-SW(B4) // save b4
  299. st8 [r15]=r16,SW(AR_LC)-SW(AR_PFS) // save ar.pfs
  300. stf.spill [r2]=f14,32
  301. stf.spill [r3]=f15,32
  302. ;;
  303. st8 [r14]=r26 // save b5
  304. st8 [r15]=r21 // save ar.lc
  305. stf.spill [r2]=f16,32
  306. stf.spill [r3]=f17,32
  307. ;;
  308. stf.spill [r2]=f18,32
  309. stf.spill [r3]=f19,32
  310. ;;
  311. stf.spill [r2]=f20,32
  312. stf.spill [r3]=f21,32
  313. ;;
  314. stf.spill [r2]=f22,32
  315. stf.spill [r3]=f23,32
  316. ;;
  317. stf.spill [r2]=f24,32
  318. stf.spill [r3]=f25,32
  319. ;;
  320. stf.spill [r2]=f26,32
  321. stf.spill [r3]=f27,32
  322. ;;
  323. stf.spill [r2]=f28,32
  324. stf.spill [r3]=f29,32
  325. ;;
  326. stf.spill [r2]=f30,SW(AR_UNAT)-SW(F30)
  327. stf.spill [r3]=f31,SW(PR)-SW(F31)
  328. add r14=SW(CALLER_UNAT)+16,sp
  329. ;;
  330. st8 [r2]=r29,SW(AR_RNAT)-SW(AR_UNAT) // save ar.unat
  331. st8 [r14]=r17,SW(AR_FPSR)-SW(CALLER_UNAT) // save caller_unat
  332. mov r21=pr
  333. ;;
  334. st8 [r2]=r19,SW(AR_BSPSTORE)-SW(AR_RNAT) // save ar.rnat
  335. st8 [r3]=r21 // save predicate registers
  336. ;;
  337. st8 [r2]=r20 // save ar.bspstore
  338. st8 [r14]=r18 // save fpsr
  339. mov ar.rsc=3 // put RSE back into eager mode, pl 0
  340. br.cond.sptk.many b7
  341. END(save_switch_stack)
  342. /*
  343. * load_switch_stack:
  344. * - "invala" MUST be done at call site (normally in DO_LOAD_SWITCH_STACK)
  345. * - b7 holds address to return to
  346. * - must not touch r8-r11
  347. */
  348. GLOBAL_ENTRY(load_switch_stack)
  349. .prologue
  350. .altrp b7
  351. .body
  352. lfetch.fault.nt1 [sp]
  353. adds r2=SW(AR_BSPSTORE)+16,sp
  354. adds r3=SW(AR_UNAT)+16,sp
  355. mov ar.rsc=0 // put RSE into enforced lazy mode
  356. adds r14=SW(CALLER_UNAT)+16,sp
  357. adds r15=SW(AR_FPSR)+16,sp
  358. ;;
  359. ld8 r27=[r2],(SW(B0)-SW(AR_BSPSTORE)) // bspstore
  360. ld8 r29=[r3],(SW(B1)-SW(AR_UNAT)) // unat
  361. ;;
  362. ld8 r21=[r2],16 // restore b0
  363. ld8 r22=[r3],16 // restore b1
  364. ;;
  365. ld8 r23=[r2],16 // restore b2
  366. ld8 r24=[r3],16 // restore b3
  367. ;;
  368. ld8 r25=[r2],16 // restore b4
  369. ld8 r26=[r3],16 // restore b5
  370. ;;
  371. ld8 r16=[r2],(SW(PR)-SW(AR_PFS)) // ar.pfs
  372. ld8 r17=[r3],(SW(AR_RNAT)-SW(AR_LC)) // ar.lc
  373. ;;
  374. ld8 r28=[r2] // restore pr
  375. ld8 r30=[r3] // restore rnat
  376. ;;
  377. ld8 r18=[r14],16 // restore caller's unat
  378. ld8 r19=[r15],24 // restore fpsr
  379. ;;
  380. ldf.fill f2=[r14],32
  381. ldf.fill f3=[r15],32
  382. ;;
  383. ldf.fill f4=[r14],32
  384. ldf.fill f5=[r15],32
  385. ;;
  386. ldf.fill f12=[r14],32
  387. ldf.fill f13=[r15],32
  388. ;;
  389. ldf.fill f14=[r14],32
  390. ldf.fill f15=[r15],32
  391. ;;
  392. ldf.fill f16=[r14],32
  393. ldf.fill f17=[r15],32
  394. ;;
  395. ldf.fill f18=[r14],32
  396. ldf.fill f19=[r15],32
  397. mov b0=r21
  398. ;;
  399. ldf.fill f20=[r14],32
  400. ldf.fill f21=[r15],32
  401. mov b1=r22
  402. ;;
  403. ldf.fill f22=[r14],32
  404. ldf.fill f23=[r15],32
  405. mov b2=r23
  406. ;;
  407. mov ar.bspstore=r27
  408. mov ar.unat=r29 // establish unat holding the NaT bits for r4-r7
  409. mov b3=r24
  410. ;;
  411. ldf.fill f24=[r14],32
  412. ldf.fill f25=[r15],32
  413. mov b4=r25
  414. ;;
  415. ldf.fill f26=[r14],32
  416. ldf.fill f27=[r15],32
  417. mov b5=r26
  418. ;;
  419. ldf.fill f28=[r14],32
  420. ldf.fill f29=[r15],32
  421. mov ar.pfs=r16
  422. ;;
  423. ldf.fill f30=[r14],32
  424. ldf.fill f31=[r15],24
  425. mov ar.lc=r17
  426. ;;
  427. ld8.fill r4=[r14],16
  428. ld8.fill r5=[r15],16
  429. mov pr=r28,-1
  430. ;;
  431. ld8.fill r6=[r14],16
  432. ld8.fill r7=[r15],16
  433. mov ar.unat=r18 // restore caller's unat
  434. mov ar.rnat=r30 // must restore after bspstore but before rsc!
  435. mov ar.fpsr=r19 // restore fpsr
  436. mov ar.rsc=3 // put RSE back into eager mode, pl 0
  437. br.cond.sptk.many b7
  438. END(load_switch_stack)
  439. GLOBAL_ENTRY(prefetch_stack)
  440. add r14 = -IA64_SWITCH_STACK_SIZE, sp
  441. add r15 = IA64_TASK_THREAD_KSP_OFFSET, in0
  442. ;;
  443. ld8 r16 = [r15] // load next's stack pointer
  444. lfetch.fault.excl [r14], 128
  445. ;;
  446. lfetch.fault.excl [r14], 128
  447. lfetch.fault [r16], 128
  448. ;;
  449. lfetch.fault.excl [r14], 128
  450. lfetch.fault [r16], 128
  451. ;;
  452. lfetch.fault.excl [r14], 128
  453. lfetch.fault [r16], 128
  454. ;;
  455. lfetch.fault.excl [r14], 128
  456. lfetch.fault [r16], 128
  457. ;;
  458. lfetch.fault [r16], 128
  459. br.ret.sptk.many rp
  460. END(prefetch_stack)
  461. /*
  462. * Invoke a system call, but do some tracing before and after the call.
  463. * We MUST preserve the current register frame throughout this routine
  464. * because some system calls (such as ia64_execve) directly
  465. * manipulate ar.pfs.
  466. */
  467. GLOBAL_ENTRY(ia64_trace_syscall)
  468. PT_REGS_UNWIND_INFO(0)
  469. /*
  470. * We need to preserve the scratch registers f6-f11 in case the system
  471. * call is sigreturn.
  472. */
  473. adds r16=PT(F6)+16,sp
  474. adds r17=PT(F7)+16,sp
  475. ;;
  476. stf.spill [r16]=f6,32
  477. stf.spill [r17]=f7,32
  478. ;;
  479. stf.spill [r16]=f8,32
  480. stf.spill [r17]=f9,32
  481. ;;
  482. stf.spill [r16]=f10
  483. stf.spill [r17]=f11
  484. br.call.sptk.many rp=syscall_trace_enter // give parent a chance to catch syscall args
  485. cmp.lt p6,p0=r8,r0 // check tracehook
  486. adds r2=PT(R8)+16,sp // r2 = &pt_regs.r8
  487. adds r3=PT(R10)+16,sp // r3 = &pt_regs.r10
  488. mov r10=0
  489. (p6) br.cond.sptk strace_error // syscall failed ->
  490. adds r16=PT(F6)+16,sp
  491. adds r17=PT(F7)+16,sp
  492. ;;
  493. ldf.fill f6=[r16],32
  494. ldf.fill f7=[r17],32
  495. ;;
  496. ldf.fill f8=[r16],32
  497. ldf.fill f9=[r17],32
  498. ;;
  499. ldf.fill f10=[r16]
  500. ldf.fill f11=[r17]
  501. // the syscall number may have changed, so re-load it and re-calculate the
  502. // syscall entry-point:
  503. adds r15=PT(R15)+16,sp // r15 = &pt_regs.r15 (syscall #)
  504. ;;
  505. ld8 r15=[r15]
  506. mov r3=NR_syscalls - 1
  507. ;;
  508. adds r15=-1024,r15
  509. movl r16=sys_call_table
  510. ;;
  511. shladd r20=r15,3,r16 // r20 = sys_call_table + 8*(syscall-1024)
  512. cmp.leu p6,p7=r15,r3
  513. ;;
  514. (p6) ld8 r20=[r20] // load address of syscall entry point
  515. (p7) movl r20=sys_ni_syscall
  516. ;;
  517. mov b6=r20
  518. br.call.sptk.many rp=b6 // do the syscall
  519. .strace_check_retval:
  520. cmp.lt p6,p0=r8,r0 // syscall failed?
  521. adds r2=PT(R8)+16,sp // r2 = &pt_regs.r8
  522. adds r3=PT(R10)+16,sp // r3 = &pt_regs.r10
  523. mov r10=0
  524. (p6) br.cond.sptk strace_error // syscall failed ->
  525. ;; // avoid RAW on r10
  526. .strace_save_retval:
  527. .mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8
  528. .mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
  529. br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
  530. .ret3:
  531. (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
  532. (pUStk) rsm psr.i // disable interrupts
  533. br.cond.sptk ia64_work_pending_syscall_end
  534. strace_error:
  535. ld8 r3=[r2] // load pt_regs.r8
  536. sub r9=0,r8 // negate return value to get errno value
  537. ;;
  538. cmp.ne p6,p0=r3,r0 // is pt_regs.r8!=0?
  539. adds r3=16,r2 // r3=&pt_regs.r10
  540. ;;
  541. (p6) mov r10=-1
  542. (p6) mov r8=r9
  543. br.cond.sptk .strace_save_retval
  544. END(ia64_trace_syscall)
  545. /*
  546. * When traced and returning from sigreturn, we invoke syscall_trace but then
  547. * go straight to ia64_leave_kernel rather than ia64_leave_syscall.
  548. */
  549. GLOBAL_ENTRY(ia64_strace_leave_kernel)
  550. PT_REGS_UNWIND_INFO(0)
  551. { /*
  552. * Some versions of gas generate bad unwind info if the first instruction of a
  553. * procedure doesn't go into the first slot of a bundle. This is a workaround.
  554. */
  555. nop.m 0
  556. nop.i 0
  557. br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
  558. }
  559. .ret4: br.cond.sptk ia64_leave_kernel
  560. END(ia64_strace_leave_kernel)
  561. ENTRY(call_payload)
  562. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0)
  563. /* call the kernel_thread payload; fn is in r4, arg - in r5 */
  564. alloc loc1=ar.pfs,0,3,1,0
  565. mov loc0=rp
  566. mov loc2=gp
  567. mov out0=r5 // arg
  568. ld8 r14 = [r4], 8 // fn.address
  569. ;;
  570. mov b6 = r14
  571. ld8 gp = [r4] // fn.gp
  572. ;;
  573. br.call.sptk.many rp=b6 // fn(arg)
  574. .ret12: mov gp=loc2
  575. mov rp=loc0
  576. mov ar.pfs=loc1
  577. /* ... and if it has returned, we are going to userland */
  578. cmp.ne pKStk,pUStk=r0,r0
  579. br.ret.sptk.many rp
  580. END(call_payload)
  581. GLOBAL_ENTRY(ia64_ret_from_clone)
  582. PT_REGS_UNWIND_INFO(0)
  583. { /*
  584. * Some versions of gas generate bad unwind info if the first instruction of a
  585. * procedure doesn't go into the first slot of a bundle. This is a workaround.
  586. */
  587. nop.m 0
  588. nop.i 0
  589. /*
  590. * We need to call schedule_tail() to complete the scheduling process.
  591. * Called by ia64_switch_to() after do_fork()->copy_thread(). r8 contains the
  592. * address of the previously executing task.
  593. */
  594. br.call.sptk.many rp=ia64_invoke_schedule_tail
  595. }
  596. .ret8:
  597. (pKStk) br.call.sptk.many rp=call_payload
  598. adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
  599. ;;
  600. ld4 r2=[r2]
  601. ;;
  602. mov r8=0
  603. and r2=_TIF_SYSCALL_TRACEAUDIT,r2
  604. ;;
  605. cmp.ne p6,p0=r2,r0
  606. (p6) br.cond.spnt .strace_check_retval
  607. ;; // added stop bits to prevent r8 dependency
  608. END(ia64_ret_from_clone)
  609. // fall through
  610. GLOBAL_ENTRY(ia64_ret_from_syscall)
  611. PT_REGS_UNWIND_INFO(0)
  612. cmp.ge p6,p7=r8,r0 // syscall executed successfully?
  613. adds r2=PT(R8)+16,sp // r2 = &pt_regs.r8
  614. mov r10=r0 // clear error indication in r10
  615. (p7) br.cond.spnt handle_syscall_error // handle potential syscall failure
  616. END(ia64_ret_from_syscall)
  617. // fall through
  618. /*
  619. * ia64_leave_syscall(): Same as ia64_leave_kernel, except that it doesn't
  620. * need to switch to bank 0 and doesn't restore the scratch registers.
  621. * To avoid leaking kernel bits, the scratch registers are set to
  622. * the following known-to-be-safe values:
  623. *
  624. * r1: restored (global pointer)
  625. * r2: cleared
  626. * r3: 1 (when returning to user-level)
  627. * r8-r11: restored (syscall return value(s))
  628. * r12: restored (user-level stack pointer)
  629. * r13: restored (user-level thread pointer)
  630. * r14: set to __kernel_syscall_via_epc
  631. * r15: restored (syscall #)
  632. * r16-r17: cleared
  633. * r18: user-level b6
  634. * r19: cleared
  635. * r20: user-level ar.fpsr
  636. * r21: user-level b0
  637. * r22: cleared
  638. * r23: user-level ar.bspstore
  639. * r24: user-level ar.rnat
  640. * r25: user-level ar.unat
  641. * r26: user-level ar.pfs
  642. * r27: user-level ar.rsc
  643. * r28: user-level ip
  644. * r29: user-level psr
  645. * r30: user-level cfm
  646. * r31: user-level pr
  647. * f6-f11: cleared
  648. * pr: restored (user-level pr)
  649. * b0: restored (user-level rp)
  650. * b6: restored
  651. * b7: set to __kernel_syscall_via_epc
  652. * ar.unat: restored (user-level ar.unat)
  653. * ar.pfs: restored (user-level ar.pfs)
  654. * ar.rsc: restored (user-level ar.rsc)
  655. * ar.rnat: restored (user-level ar.rnat)
  656. * ar.bspstore: restored (user-level ar.bspstore)
  657. * ar.fpsr: restored (user-level ar.fpsr)
  658. * ar.ccv: cleared
  659. * ar.csd: cleared
  660. * ar.ssd: cleared
  661. */
  662. GLOBAL_ENTRY(ia64_leave_syscall)
  663. PT_REGS_UNWIND_INFO(0)
  664. /*
  665. * work.need_resched etc. mustn't get changed by this CPU before it returns to
  666. * user- or fsys-mode, hence we disable interrupts early on.
  667. *
  668. * p6 controls whether current_thread_info()->flags needs to be check for
  669. * extra work. We always check for extra work when returning to user-level.
  670. * With CONFIG_PREEMPT, we also check for extra work when the preempt_count
  671. * is 0. After extra work processing has been completed, execution
  672. * resumes at ia64_work_processed_syscall with p6 set to 1 if the extra-work-check
  673. * needs to be redone.
  674. */
  675. #ifdef CONFIG_PREEMPT
  676. RSM_PSR_I(p0, r2, r18) // disable interrupts
  677. cmp.eq pLvSys,p0=r0,r0 // pLvSys=1: leave from syscall
  678. (pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
  679. ;;
  680. .pred.rel.mutex pUStk,pKStk
  681. (pKStk) ld4 r21=[r20] // r21 <- preempt_count
  682. (pUStk) mov r21=0 // r21 <- 0
  683. ;;
  684. cmp.eq p6,p0=r21,r0 // p6 <- pUStk || (preempt_count == 0)
  685. #else /* !CONFIG_PREEMPT */
  686. RSM_PSR_I(pUStk, r2, r18)
  687. cmp.eq pLvSys,p0=r0,r0 // pLvSys=1: leave from syscall
  688. (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
  689. #endif
  690. .global ia64_work_processed_syscall;
  691. ia64_work_processed_syscall:
  692. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  693. adds r2=PT(LOADRS)+16,r12
  694. MOV_FROM_ITC(pUStk, p9, r22, r19) // fetch time at leave
  695. adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
  696. ;;
  697. (p6) ld4 r31=[r18] // load current_thread_info()->flags
  698. ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
  699. adds r3=PT(AR_BSPSTORE)+16,r12 // deferred
  700. ;;
  701. #else
  702. adds r2=PT(LOADRS)+16,r12
  703. adds r3=PT(AR_BSPSTORE)+16,r12
  704. adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
  705. ;;
  706. (p6) ld4 r31=[r18] // load current_thread_info()->flags
  707. ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
  708. nop.i 0
  709. ;;
  710. #endif
  711. mov r16=ar.bsp // M2 get existing backing store pointer
  712. ld8 r18=[r2],PT(R9)-PT(B6) // load b6
  713. (p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE?
  714. ;;
  715. ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage)
  716. (p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending?
  717. (p6) br.cond.spnt .work_pending_syscall
  718. ;;
  719. // start restoring the state saved on the kernel stack (struct pt_regs):
  720. ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
  721. ld8 r11=[r3],PT(CR_IIP)-PT(R11)
  722. (pNonSys) break 0 // bug check: we shouldn't be here if pNonSys is TRUE!
  723. ;;
  724. invala // M0|1 invalidate ALAT
  725. RSM_PSR_I_IC(r28, r29, r30) // M2 turn off interrupts and interruption collection
  726. cmp.eq p9,p0=r0,r0 // A set p9 to indicate that we should restore cr.ifs
  727. ld8 r29=[r2],16 // M0|1 load cr.ipsr
  728. ld8 r28=[r3],16 // M0|1 load cr.iip
  729. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  730. (pUStk) add r14=TI_AC_LEAVE+IA64_TASK_SIZE,r13
  731. ;;
  732. ld8 r30=[r2],16 // M0|1 load cr.ifs
  733. ld8 r25=[r3],16 // M0|1 load ar.unat
  734. (pUStk) add r15=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
  735. ;;
  736. #else
  737. mov r22=r0 // A clear r22
  738. ;;
  739. ld8 r30=[r2],16 // M0|1 load cr.ifs
  740. ld8 r25=[r3],16 // M0|1 load ar.unat
  741. (pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
  742. ;;
  743. #endif
  744. ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs
  745. MOV_FROM_PSR(pKStk, r22, r21) // M2 read PSR now that interrupts are disabled
  746. nop 0
  747. ;;
  748. ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // M0|1 load b0
  749. ld8 r27=[r3],PT(PR)-PT(AR_RSC) // M0|1 load ar.rsc
  750. mov f6=f0 // F clear f6
  751. ;;
  752. ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // M0|1 load ar.rnat (may be garbage)
  753. ld8 r31=[r3],PT(R1)-PT(PR) // M0|1 load predicates
  754. mov f7=f0 // F clear f7
  755. ;;
  756. ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // M0|1 load ar.fpsr
  757. ld8.fill r1=[r3],16 // M0|1 load r1
  758. (pUStk) mov r17=1 // A
  759. ;;
  760. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  761. (pUStk) st1 [r15]=r17 // M2|3
  762. #else
  763. (pUStk) st1 [r14]=r17 // M2|3
  764. #endif
  765. ld8.fill r13=[r3],16 // M0|1
  766. mov f8=f0 // F clear f8
  767. ;;
  768. ld8.fill r12=[r2] // M0|1 restore r12 (sp)
  769. ld8.fill r15=[r3] // M0|1 restore r15
  770. mov b6=r18 // I0 restore b6
  771. LOAD_PHYS_STACK_REG_SIZE(r17)
  772. mov f9=f0 // F clear f9
  773. (pKStk) br.cond.dpnt.many skip_rbs_switch // B
  774. srlz.d // M0 ensure interruption collection is off (for cover)
  775. shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition
  776. COVER // B add current frame into dirty partition & set cr.ifs
  777. ;;
  778. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  779. mov r19=ar.bsp // M2 get new backing store pointer
  780. st8 [r14]=r22 // M save time at leave
  781. mov f10=f0 // F clear f10
  782. mov r22=r0 // A clear r22
  783. movl r14=__kernel_syscall_via_epc // X
  784. ;;
  785. #else
  786. mov r19=ar.bsp // M2 get new backing store pointer
  787. mov f10=f0 // F clear f10
  788. nop.m 0
  789. movl r14=__kernel_syscall_via_epc // X
  790. ;;
  791. #endif
  792. mov.m ar.csd=r0 // M2 clear ar.csd
  793. mov.m ar.ccv=r0 // M2 clear ar.ccv
  794. mov b7=r14 // I0 clear b7 (hint with __kernel_syscall_via_epc)
  795. mov.m ar.ssd=r0 // M2 clear ar.ssd
  796. mov f11=f0 // F clear f11
  797. br.cond.sptk.many rbs_switch // B
  798. END(ia64_leave_syscall)
  799. GLOBAL_ENTRY(ia64_leave_kernel)
  800. PT_REGS_UNWIND_INFO(0)
  801. /*
  802. * work.need_resched etc. mustn't get changed by this CPU before it returns to
  803. * user- or fsys-mode, hence we disable interrupts early on.
  804. *
  805. * p6 controls whether current_thread_info()->flags needs to be check for
  806. * extra work. We always check for extra work when returning to user-level.
  807. * With CONFIG_PREEMPT, we also check for extra work when the preempt_count
  808. * is 0. After extra work processing has been completed, execution
  809. * resumes at .work_processed_syscall with p6 set to 1 if the extra-work-check
  810. * needs to be redone.
  811. */
  812. #ifdef CONFIG_PREEMPT
  813. RSM_PSR_I(p0, r17, r31) // disable interrupts
  814. cmp.eq p0,pLvSys=r0,r0 // pLvSys=0: leave from kernel
  815. (pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
  816. ;;
  817. .pred.rel.mutex pUStk,pKStk
  818. (pKStk) ld4 r21=[r20] // r21 <- preempt_count
  819. (pUStk) mov r21=0 // r21 <- 0
  820. ;;
  821. cmp.eq p6,p0=r21,r0 // p6 <- pUStk || (preempt_count == 0)
  822. #else
  823. RSM_PSR_I(pUStk, r17, r31)
  824. cmp.eq p0,pLvSys=r0,r0 // pLvSys=0: leave from kernel
  825. (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
  826. #endif
  827. .work_processed_kernel:
  828. adds r17=TI_FLAGS+IA64_TASK_SIZE,r13
  829. ;;
  830. (p6) ld4 r31=[r17] // load current_thread_info()->flags
  831. adds r21=PT(PR)+16,r12
  832. ;;
  833. lfetch [r21],PT(CR_IPSR)-PT(PR)
  834. adds r2=PT(B6)+16,r12
  835. adds r3=PT(R16)+16,r12
  836. ;;
  837. lfetch [r21]
  838. ld8 r28=[r2],8 // load b6
  839. adds r29=PT(R24)+16,r12
  840. ld8.fill r16=[r3],PT(AR_CSD)-PT(R16)
  841. adds r30=PT(AR_CCV)+16,r12
  842. (p6) and r19=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE?
  843. ;;
  844. ld8.fill r24=[r29]
  845. ld8 r15=[r30] // load ar.ccv
  846. (p6) cmp4.ne.unc p6,p0=r19, r0 // any special work pending?
  847. ;;
  848. ld8 r29=[r2],16 // load b7
  849. ld8 r30=[r3],16 // load ar.csd
  850. (p6) br.cond.spnt .work_pending
  851. ;;
  852. ld8 r31=[r2],16 // load ar.ssd
  853. ld8.fill r8=[r3],16
  854. ;;
  855. ld8.fill r9=[r2],16
  856. ld8.fill r10=[r3],PT(R17)-PT(R10)
  857. ;;
  858. ld8.fill r11=[r2],PT(R18)-PT(R11)
  859. ld8.fill r17=[r3],16
  860. ;;
  861. ld8.fill r18=[r2],16
  862. ld8.fill r19=[r3],16
  863. ;;
  864. ld8.fill r20=[r2],16
  865. ld8.fill r21=[r3],16
  866. mov ar.csd=r30
  867. mov ar.ssd=r31
  868. ;;
  869. RSM_PSR_I_IC(r23, r22, r25) // initiate turning off of interrupt and interruption collection
  870. invala // invalidate ALAT
  871. ;;
  872. ld8.fill r22=[r2],24
  873. ld8.fill r23=[r3],24
  874. mov b6=r28
  875. ;;
  876. ld8.fill r25=[r2],16
  877. ld8.fill r26=[r3],16
  878. mov b7=r29
  879. ;;
  880. ld8.fill r27=[r2],16
  881. ld8.fill r28=[r3],16
  882. ;;
  883. ld8.fill r29=[r2],16
  884. ld8.fill r30=[r3],24
  885. ;;
  886. ld8.fill r31=[r2],PT(F9)-PT(R31)
  887. adds r3=PT(F10)-PT(F6),r3
  888. ;;
  889. ldf.fill f9=[r2],PT(F6)-PT(F9)
  890. ldf.fill f10=[r3],PT(F8)-PT(F10)
  891. ;;
  892. ldf.fill f6=[r2],PT(F7)-PT(F6)
  893. ;;
  894. ldf.fill f7=[r2],PT(F11)-PT(F7)
  895. ldf.fill f8=[r3],32
  896. ;;
  897. srlz.d // ensure that inter. collection is off (VHPT is don't care, since text is pinned)
  898. mov ar.ccv=r15
  899. ;;
  900. ldf.fill f11=[r2]
  901. BSW_0(r2, r3, r15) // switch back to bank 0 (no stop bit required beforehand...)
  902. ;;
  903. (pUStk) mov r18=IA64_KR(CURRENT)// M2 (12 cycle read latency)
  904. adds r16=PT(CR_IPSR)+16,r12
  905. adds r17=PT(CR_IIP)+16,r12
  906. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  907. .pred.rel.mutex pUStk,pKStk
  908. MOV_FROM_PSR(pKStk, r22, r29) // M2 read PSR now that interrupts are disabled
  909. MOV_FROM_ITC(pUStk, p9, r22, r29) // M fetch time at leave
  910. nop.i 0
  911. ;;
  912. #else
  913. MOV_FROM_PSR(pKStk, r22, r29) // M2 read PSR now that interrupts are disabled
  914. nop.i 0
  915. nop.i 0
  916. ;;
  917. #endif
  918. ld8 r29=[r16],16 // load cr.ipsr
  919. ld8 r28=[r17],16 // load cr.iip
  920. ;;
  921. ld8 r30=[r16],16 // load cr.ifs
  922. ld8 r25=[r17],16 // load ar.unat
  923. ;;
  924. ld8 r26=[r16],16 // load ar.pfs
  925. ld8 r27=[r17],16 // load ar.rsc
  926. cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs
  927. ;;
  928. ld8 r24=[r16],16 // load ar.rnat (may be garbage)
  929. ld8 r23=[r17],16 // load ar.bspstore (may be garbage)
  930. ;;
  931. ld8 r31=[r16],16 // load predicates
  932. ld8 r21=[r17],16 // load b0
  933. ;;
  934. ld8 r19=[r16],16 // load ar.rsc value for "loadrs"
  935. ld8.fill r1=[r17],16 // load r1
  936. ;;
  937. ld8.fill r12=[r16],16
  938. ld8.fill r13=[r17],16
  939. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  940. (pUStk) adds r3=TI_AC_LEAVE+IA64_TASK_SIZE,r18
  941. #else
  942. (pUStk) adds r18=IA64_TASK_THREAD_ON_USTACK_OFFSET,r18
  943. #endif
  944. ;;
  945. ld8 r20=[r16],16 // ar.fpsr
  946. ld8.fill r15=[r17],16
  947. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  948. (pUStk) adds r18=IA64_TASK_THREAD_ON_USTACK_OFFSET,r18 // deferred
  949. #endif
  950. ;;
  951. ld8.fill r14=[r16],16
  952. ld8.fill r2=[r17]
  953. (pUStk) mov r17=1
  954. ;;
  955. #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
  956. // mmi_ : ld8 st1 shr;; mmi_ : st8 st1 shr;;
  957. // mib : mov add br -> mib : ld8 add br
  958. // bbb_ : br nop cover;; mbb_ : mov br cover;;
  959. //
  960. // no one require bsp in r16 if (pKStk) branch is selected.
  961. (pUStk) st8 [r3]=r22 // save time at leave
  962. (pUStk) st1 [r18]=r17 // restore current->thread.on_ustack
  963. shr.u r18=r19,16 // get byte size of existing "dirty" partition
  964. ;;
  965. ld8.fill r3=[r16] // deferred
  966. LOAD_PHYS_STACK_REG_SIZE(r17)
  967. (pKStk) br.cond.dpnt skip_rbs_switch
  968. mov r16=ar.bsp // get existing backing store pointer
  969. #else
  970. ld8.fill r3=[r16]
  971. (pUStk) st1 [r18]=r17 // restore current->thread.on_ustack
  972. shr.u r18=r19,16 // get byte size of existing "dirty" partition
  973. ;;
  974. mov r16=ar.bsp // get existing backing store pointer
  975. LOAD_PHYS_STACK_REG_SIZE(r17)
  976. (pKStk) br.cond.dpnt skip_rbs_switch
  977. #endif
  978. /*
  979. * Restore user backing store.
  980. *
  981. * NOTE: alloc, loadrs, and cover can't be predicated.
  982. */
  983. (pNonSys) br.cond.dpnt dont_preserve_current_frame
  984. COVER // add current frame into dirty partition and set cr.ifs
  985. ;;
  986. mov r19=ar.bsp // get new backing store pointer
  987. rbs_switch:
  988. sub r16=r16,r18 // krbs = old bsp - size of dirty partition
  989. cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs
  990. ;;
  991. sub r19=r19,r16 // calculate total byte size of dirty partition
  992. add r18=64,r18 // don't force in0-in7 into memory...
  993. ;;
  994. shl r19=r19,16 // shift size of dirty partition into loadrs position
  995. ;;
  996. dont_preserve_current_frame:
  997. /*
  998. * To prevent leaking bits between the kernel and user-space,
  999. * we must clear the stacked registers in the "invalid" partition here.
  1000. * Not pretty, but at least it's fast (3.34 registers/cycle on Itanium,
  1001. * 5 registers/cycle on McKinley).
  1002. */
  1003. # define pRecurse p6
  1004. # define pReturn p7
  1005. #ifdef CONFIG_ITANIUM
  1006. # define Nregs 10
  1007. #else
  1008. # define Nregs 14
  1009. #endif
  1010. alloc loc0=ar.pfs,2,Nregs-2,2,0
  1011. shr.u loc1=r18,9 // RNaTslots <= floor(dirtySize / (64*8))
  1012. sub r17=r17,r18 // r17 = (physStackedSize + 8) - dirtySize
  1013. ;;
  1014. mov ar.rsc=r19 // load ar.rsc to be used for "loadrs"
  1015. shladd in0=loc1,3,r17
  1016. mov in1=0
  1017. ;;
  1018. TEXT_ALIGN(32)
  1019. rse_clear_invalid:
  1020. #ifdef CONFIG_ITANIUM
  1021. // cycle 0
  1022. { .mii
  1023. alloc loc0=ar.pfs,2,Nregs-2,2,0
  1024. cmp.lt pRecurse,p0=Nregs*8,in0 // if more than Nregs regs left to clear, (re)curse
  1025. add out0=-Nregs*8,in0
  1026. }{ .mfb
  1027. add out1=1,in1 // increment recursion count
  1028. nop.f 0
  1029. nop.b 0 // can't do br.call here because of alloc (WAW on CFM)
  1030. ;;
  1031. }{ .mfi // cycle 1
  1032. mov loc1=0
  1033. nop.f 0
  1034. mov loc2=0
  1035. }{ .mib
  1036. mov loc3=0
  1037. mov loc4=0
  1038. (pRecurse) br.call.sptk.many b0=rse_clear_invalid
  1039. }{ .mfi // cycle 2
  1040. mov loc5=0
  1041. nop.f 0
  1042. cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret
  1043. }{ .mib
  1044. mov loc6=0
  1045. mov loc7=0
  1046. (pReturn) br.ret.sptk.many b0
  1047. }
  1048. #else /* !CONFIG_ITANIUM */
  1049. alloc loc0=ar.pfs,2,Nregs-2,2,0
  1050. cmp.lt pRecurse,p0=Nregs*8,in0 // if more than Nregs regs left to clear, (re)curse
  1051. add out0=-Nregs*8,in0
  1052. add out1=1,in1 // increment recursion count
  1053. mov loc1=0
  1054. mov loc2=0
  1055. ;;
  1056. mov loc3=0
  1057. mov loc4=0
  1058. mov loc5=0
  1059. mov loc6=0
  1060. mov loc7=0
  1061. (pRecurse) br.call.dptk.few b0=rse_clear_invalid
  1062. ;;
  1063. mov loc8=0
  1064. mov loc9=0
  1065. cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret
  1066. mov loc10=0
  1067. mov loc11=0
  1068. (pReturn) br.ret.dptk.many b0
  1069. #endif /* !CONFIG_ITANIUM */
  1070. # undef pRecurse
  1071. # undef pReturn
  1072. ;;
  1073. alloc r17=ar.pfs,0,0,0,0 // drop current register frame
  1074. ;;
  1075. loadrs
  1076. ;;
  1077. skip_rbs_switch:
  1078. mov ar.unat=r25 // M2
  1079. (pKStk) extr.u r22=r22,21,1 // I0 extract current value of psr.pp from r22
  1080. (pLvSys)mov r19=r0 // A clear r19 for leave_syscall, no-op otherwise
  1081. ;;
  1082. (pUStk) mov ar.bspstore=r23 // M2
  1083. (pKStk) dep r29=r22,r29,21,1 // I0 update ipsr.pp with psr.pp
  1084. (pLvSys)mov r16=r0 // A clear r16 for leave_syscall, no-op otherwise
  1085. ;;
  1086. MOV_TO_IPSR(p0, r29, r25) // M2
  1087. mov ar.pfs=r26 // I0
  1088. (pLvSys)mov r17=r0 // A clear r17 for leave_syscall, no-op otherwise
  1089. MOV_TO_IFS(p9, r30, r25)// M2
  1090. mov b0=r21 // I0
  1091. (pLvSys)mov r18=r0 // A clear r18 for leave_syscall, no-op otherwise
  1092. mov ar.fpsr=r20 // M2
  1093. MOV_TO_IIP(r28, r25) // M2
  1094. nop 0
  1095. ;;
  1096. (pUStk) mov ar.rnat=r24 // M2 must happen with RSE in lazy mode
  1097. nop 0
  1098. (pLvSys)mov r2=r0
  1099. mov ar.rsc=r27 // M2
  1100. mov pr=r31,-1 // I0
  1101. RFI // B
  1102. /*
  1103. * On entry:
  1104. * r20 = &current->thread_info->pre_count (if CONFIG_PREEMPT)
  1105. * r31 = current->thread_info->flags
  1106. * On exit:
  1107. * p6 = TRUE if work-pending-check needs to be redone
  1108. *
  1109. * Interrupts are disabled on entry, reenabled depend on work, and
  1110. * disabled on exit.
  1111. */
  1112. .work_pending_syscall:
  1113. add r2=-8,r2
  1114. add r3=-8,r3
  1115. ;;
  1116. st8 [r2]=r8
  1117. st8 [r3]=r10
  1118. .work_pending:
  1119. tbit.z p6,p0=r31,TIF_NEED_RESCHED // is resched not needed?
  1120. (p6) br.cond.sptk.few .notify
  1121. br.call.spnt.many rp=preempt_schedule_irq
  1122. .ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1 (re-check)
  1123. (pLvSys)br.cond.sptk.few ia64_work_pending_syscall_end
  1124. br.cond.sptk.many .work_processed_kernel
  1125. .notify:
  1126. (pUStk) br.call.spnt.many rp=notify_resume_user
  1127. .ret10: cmp.ne p6,p0=r0,r0 // p6 <- 0 (don't re-check)
  1128. (pLvSys)br.cond.sptk.few ia64_work_pending_syscall_end
  1129. br.cond.sptk.many .work_processed_kernel
  1130. .global ia64_work_pending_syscall_end;
  1131. ia64_work_pending_syscall_end:
  1132. adds r2=PT(R8)+16,r12
  1133. adds r3=PT(R10)+16,r12
  1134. ;;
  1135. ld8 r8=[r2]
  1136. ld8 r10=[r3]
  1137. br.cond.sptk.many ia64_work_processed_syscall
  1138. END(ia64_leave_kernel)
  1139. ENTRY(handle_syscall_error)
  1140. /*
  1141. * Some system calls (e.g., ptrace, mmap) can return arbitrary values which could
  1142. * lead us to mistake a negative return value as a failed syscall. Those syscall
  1143. * must deposit a non-zero value in pt_regs.r8 to indicate an error. If
  1144. * pt_regs.r8 is zero, we assume that the call completed successfully.
  1145. */
  1146. PT_REGS_UNWIND_INFO(0)
  1147. ld8 r3=[r2] // load pt_regs.r8
  1148. ;;
  1149. cmp.eq p6,p7=r3,r0 // is pt_regs.r8==0?
  1150. ;;
  1151. (p7) mov r10=-1
  1152. (p7) sub r8=0,r8 // negate return value to get errno
  1153. br.cond.sptk ia64_leave_syscall
  1154. END(handle_syscall_error)
  1155. /*
  1156. * Invoke schedule_tail(task) while preserving in0-in7, which may be needed
  1157. * in case a system call gets restarted.
  1158. */
  1159. GLOBAL_ENTRY(ia64_invoke_schedule_tail)
  1160. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
  1161. alloc loc1=ar.pfs,8,2,1,0
  1162. mov loc0=rp
  1163. mov out0=r8 // Address of previous task
  1164. ;;
  1165. br.call.sptk.many rp=schedule_tail
  1166. .ret11: mov ar.pfs=loc1
  1167. mov rp=loc0
  1168. br.ret.sptk.many rp
  1169. END(ia64_invoke_schedule_tail)
  1170. /*
  1171. * Setup stack and call do_notify_resume_user(), keeping interrupts
  1172. * disabled.
  1173. *
  1174. * Note that pSys and pNonSys need to be set up by the caller.
  1175. * We declare 8 input registers so the system call args get preserved,
  1176. * in case we need to restart a system call.
  1177. */
  1178. GLOBAL_ENTRY(notify_resume_user)
  1179. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
  1180. alloc loc1=ar.pfs,8,2,3,0 // preserve all eight input regs in case of syscall restart!
  1181. mov r9=ar.unat
  1182. mov loc0=rp // save return address
  1183. mov out0=0 // there is no "oldset"
  1184. adds out1=8,sp // out1=&sigscratch->ar_pfs
  1185. (pSys) mov out2=1 // out2==1 => we're in a syscall
  1186. ;;
  1187. (pNonSys) mov out2=0 // out2==0 => not a syscall
  1188. .fframe 16
  1189. .spillsp ar.unat, 16
  1190. st8 [sp]=r9,-16 // allocate space for ar.unat and save it
  1191. st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch
  1192. .body
  1193. br.call.sptk.many rp=do_notify_resume_user
  1194. .ret15: .restore sp
  1195. adds sp=16,sp // pop scratch stack space
  1196. ;;
  1197. ld8 r9=[sp] // load new unat from sigscratch->scratch_unat
  1198. mov rp=loc0
  1199. ;;
  1200. mov ar.unat=r9
  1201. mov ar.pfs=loc1
  1202. br.ret.sptk.many rp
  1203. END(notify_resume_user)
  1204. ENTRY(sys_rt_sigreturn)
  1205. PT_REGS_UNWIND_INFO(0)
  1206. /*
  1207. * Allocate 8 input registers since ptrace() may clobber them
  1208. */
  1209. alloc r2=ar.pfs,8,0,1,0
  1210. .prologue
  1211. PT_REGS_SAVES(16)
  1212. adds sp=-16,sp
  1213. .body
  1214. cmp.eq pNonSys,pSys=r0,r0 // sigreturn isn't a normal syscall...
  1215. ;;
  1216. /*
  1217. * leave_kernel() restores f6-f11 from pt_regs, but since the streamlined
  1218. * syscall-entry path does not save them we save them here instead. Note: we
  1219. * don't need to save any other registers that are not saved by the stream-lined
  1220. * syscall path, because restore_sigcontext() restores them.
  1221. */
  1222. adds r16=PT(F6)+32,sp
  1223. adds r17=PT(F7)+32,sp
  1224. ;;
  1225. stf.spill [r16]=f6,32
  1226. stf.spill [r17]=f7,32
  1227. ;;
  1228. stf.spill [r16]=f8,32
  1229. stf.spill [r17]=f9,32
  1230. ;;
  1231. stf.spill [r16]=f10
  1232. stf.spill [r17]=f11
  1233. adds out0=16,sp // out0 = &sigscratch
  1234. br.call.sptk.many rp=ia64_rt_sigreturn
  1235. .ret19: .restore sp,0
  1236. adds sp=16,sp
  1237. ;;
  1238. ld8 r9=[sp] // load new ar.unat
  1239. mov.sptk b7=r8,ia64_leave_kernel
  1240. ;;
  1241. mov ar.unat=r9
  1242. br.many b7
  1243. END(sys_rt_sigreturn)
  1244. GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
  1245. .prologue
  1246. /*
  1247. * r16 = fake ar.pfs, we simply need to make sure privilege is still 0
  1248. */
  1249. mov r16=r0
  1250. DO_SAVE_SWITCH_STACK
  1251. br.call.sptk.many rp=ia64_handle_unaligned // stack frame setup in ivt
  1252. .ret21: .body
  1253. DO_LOAD_SWITCH_STACK
  1254. br.cond.sptk.many rp // goes to ia64_leave_kernel
  1255. END(ia64_prepare_handle_unaligned)
  1256. //
  1257. // unw_init_running(void (*callback)(info, arg), void *arg)
  1258. //
  1259. # define EXTRA_FRAME_SIZE ((UNW_FRAME_INFO_SIZE+15)&~15)
  1260. GLOBAL_ENTRY(unw_init_running)
  1261. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
  1262. alloc loc1=ar.pfs,2,3,3,0
  1263. ;;
  1264. ld8 loc2=[in0],8
  1265. mov loc0=rp
  1266. mov r16=loc1
  1267. DO_SAVE_SWITCH_STACK
  1268. .body
  1269. .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
  1270. .fframe IA64_SWITCH_STACK_SIZE+EXTRA_FRAME_SIZE
  1271. SWITCH_STACK_SAVES(EXTRA_FRAME_SIZE)
  1272. adds sp=-EXTRA_FRAME_SIZE,sp
  1273. .body
  1274. ;;
  1275. adds out0=16,sp // &info
  1276. mov out1=r13 // current
  1277. adds out2=16+EXTRA_FRAME_SIZE,sp // &switch_stack
  1278. br.call.sptk.many rp=unw_init_frame_info
  1279. 1: adds out0=16,sp // &info
  1280. mov b6=loc2
  1281. mov loc2=gp // save gp across indirect function call
  1282. ;;
  1283. ld8 gp=[in0]
  1284. mov out1=in1 // arg
  1285. br.call.sptk.many rp=b6 // invoke the callback function
  1286. 1: mov gp=loc2 // restore gp
  1287. // For now, we don't allow changing registers from within
  1288. // unw_init_running; if we ever want to allow that, we'd
  1289. // have to do a load_switch_stack here:
  1290. .restore sp
  1291. adds sp=IA64_SWITCH_STACK_SIZE+EXTRA_FRAME_SIZE,sp
  1292. mov ar.pfs=loc1
  1293. mov rp=loc0
  1294. br.ret.sptk.many rp
  1295. END(unw_init_running)
  1296. #ifdef CONFIG_FUNCTION_TRACER
  1297. #ifdef CONFIG_DYNAMIC_FTRACE
  1298. GLOBAL_ENTRY(_mcount)
  1299. br ftrace_stub
  1300. END(_mcount)
  1301. .here:
  1302. br.ret.sptk.many b0
  1303. GLOBAL_ENTRY(ftrace_caller)
  1304. alloc out0 = ar.pfs, 8, 0, 4, 0
  1305. mov out3 = r0
  1306. ;;
  1307. mov out2 = b0
  1308. add r3 = 0x20, r3
  1309. mov out1 = r1;
  1310. br.call.sptk.many b0 = ftrace_patch_gp
  1311. //this might be called from module, so we must patch gp
  1312. ftrace_patch_gp:
  1313. movl gp=__gp
  1314. mov b0 = r3
  1315. ;;
  1316. .global ftrace_call;
  1317. ftrace_call:
  1318. {
  1319. .mlx
  1320. nop.m 0x0
  1321. movl r3 = .here;;
  1322. }
  1323. alloc loc0 = ar.pfs, 4, 4, 2, 0
  1324. ;;
  1325. mov loc1 = b0
  1326. mov out0 = b0
  1327. mov loc2 = r8
  1328. mov loc3 = r15
  1329. ;;
  1330. adds out0 = -MCOUNT_INSN_SIZE, out0
  1331. mov out1 = in2
  1332. mov b6 = r3
  1333. br.call.sptk.many b0 = b6
  1334. ;;
  1335. mov ar.pfs = loc0
  1336. mov b0 = loc1
  1337. mov r8 = loc2
  1338. mov r15 = loc3
  1339. br ftrace_stub
  1340. ;;
  1341. END(ftrace_caller)
  1342. #else
  1343. GLOBAL_ENTRY(_mcount)
  1344. movl r2 = ftrace_stub
  1345. movl r3 = ftrace_trace_function;;
  1346. ld8 r3 = [r3];;
  1347. ld8 r3 = [r3];;
  1348. cmp.eq p7,p0 = r2, r3
  1349. (p7) br.sptk.many ftrace_stub
  1350. ;;
  1351. alloc loc0 = ar.pfs, 4, 4, 2, 0
  1352. ;;
  1353. mov loc1 = b0
  1354. mov out0 = b0
  1355. mov loc2 = r8
  1356. mov loc3 = r15
  1357. ;;
  1358. adds out0 = -MCOUNT_INSN_SIZE, out0
  1359. mov out1 = in2
  1360. mov b6 = r3
  1361. br.call.sptk.many b0 = b6
  1362. ;;
  1363. mov ar.pfs = loc0
  1364. mov b0 = loc1
  1365. mov r8 = loc2
  1366. mov r15 = loc3
  1367. br ftrace_stub
  1368. ;;
  1369. END(_mcount)
  1370. #endif
  1371. GLOBAL_ENTRY(ftrace_stub)
  1372. mov r3 = b0
  1373. movl r2 = _mcount_ret_helper
  1374. ;;
  1375. mov b6 = r2
  1376. mov b7 = r3
  1377. br.ret.sptk.many b6
  1378. _mcount_ret_helper:
  1379. mov b0 = r42
  1380. mov r1 = r41
  1381. mov ar.pfs = r40
  1382. br b7
  1383. END(ftrace_stub)
  1384. #endif /* CONFIG_FUNCTION_TRACER */
  1385. .rodata
  1386. .align 8
  1387. .globl sys_call_table
  1388. sys_call_table:
  1389. data8 sys_ni_syscall // This must be sys_ni_syscall! See ivt.S.
  1390. data8 sys_exit // 1025
  1391. data8 sys_read
  1392. data8 sys_write
  1393. data8 sys_open
  1394. data8 sys_close
  1395. data8 sys_creat // 1030
  1396. data8 sys_link
  1397. data8 sys_unlink
  1398. data8 ia64_execve
  1399. data8 sys_chdir
  1400. data8 sys_fchdir // 1035
  1401. data8 sys_utimes
  1402. data8 sys_mknod
  1403. data8 sys_chmod
  1404. data8 sys_chown
  1405. data8 sys_lseek // 1040
  1406. data8 sys_getpid
  1407. data8 sys_getppid
  1408. data8 sys_mount
  1409. data8 sys_umount
  1410. data8 sys_setuid // 1045
  1411. data8 sys_getuid
  1412. data8 sys_geteuid
  1413. data8 sys_ptrace
  1414. data8 sys_access
  1415. data8 sys_sync // 1050
  1416. data8 sys_fsync
  1417. data8 sys_fdatasync
  1418. data8 sys_kill
  1419. data8 sys_rename
  1420. data8 sys_mkdir // 1055
  1421. data8 sys_rmdir
  1422. data8 sys_dup
  1423. data8 sys_ia64_pipe
  1424. data8 sys_times
  1425. data8 ia64_brk // 1060
  1426. data8 sys_setgid
  1427. data8 sys_getgid
  1428. data8 sys_getegid
  1429. data8 sys_acct
  1430. data8 sys_ioctl // 1065
  1431. data8 sys_fcntl
  1432. data8 sys_umask
  1433. data8 sys_chroot
  1434. data8 sys_ustat
  1435. data8 sys_dup2 // 1070
  1436. data8 sys_setreuid
  1437. data8 sys_setregid
  1438. data8 sys_getresuid
  1439. data8 sys_setresuid
  1440. data8 sys_getresgid // 1075
  1441. data8 sys_setresgid
  1442. data8 sys_getgroups
  1443. data8 sys_setgroups
  1444. data8 sys_getpgid
  1445. data8 sys_setpgid // 1080
  1446. data8 sys_setsid
  1447. data8 sys_getsid
  1448. data8 sys_sethostname
  1449. data8 sys_setrlimit
  1450. data8 sys_getrlimit // 1085
  1451. data8 sys_getrusage
  1452. data8 sys_gettimeofday
  1453. data8 sys_settimeofday
  1454. data8 sys_select
  1455. data8 sys_poll // 1090
  1456. data8 sys_symlink
  1457. data8 sys_readlink
  1458. data8 sys_uselib
  1459. data8 sys_swapon
  1460. data8 sys_swapoff // 1095
  1461. data8 sys_reboot
  1462. data8 sys_truncate
  1463. data8 sys_ftruncate
  1464. data8 sys_fchmod
  1465. data8 sys_fchown // 1100
  1466. data8 ia64_getpriority
  1467. data8 sys_setpriority
  1468. data8 sys_statfs
  1469. data8 sys_fstatfs
  1470. data8 sys_gettid // 1105
  1471. data8 sys_semget
  1472. data8 sys_semop
  1473. data8 sys_semctl
  1474. data8 sys_msgget
  1475. data8 sys_msgsnd // 1110
  1476. data8 sys_msgrcv
  1477. data8 sys_msgctl
  1478. data8 sys_shmget
  1479. data8 sys_shmat
  1480. data8 sys_shmdt // 1115
  1481. data8 sys_shmctl
  1482. data8 sys_syslog
  1483. data8 sys_setitimer
  1484. data8 sys_getitimer
  1485. data8 sys_ni_syscall // 1120 /* was: ia64_oldstat */
  1486. data8 sys_ni_syscall /* was: ia64_oldlstat */
  1487. data8 sys_ni_syscall /* was: ia64_oldfstat */
  1488. data8 sys_vhangup
  1489. data8 sys_lchown
  1490. data8 sys_remap_file_pages // 1125
  1491. data8 sys_wait4
  1492. data8 sys_sysinfo
  1493. data8 sys_clone
  1494. data8 sys_setdomainname
  1495. data8 sys_newuname // 1130
  1496. data8 sys_adjtimex
  1497. data8 sys_ni_syscall /* was: ia64_create_module */
  1498. data8 sys_init_module
  1499. data8 sys_delete_module
  1500. data8 sys_ni_syscall // 1135 /* was: sys_get_kernel_syms */
  1501. data8 sys_ni_syscall /* was: sys_query_module */
  1502. data8 sys_quotactl
  1503. data8 sys_bdflush
  1504. data8 sys_sysfs
  1505. data8 sys_personality // 1140
  1506. data8 sys_ni_syscall // sys_afs_syscall
  1507. data8 sys_setfsuid
  1508. data8 sys_setfsgid
  1509. data8 sys_getdents
  1510. data8 sys_flock // 1145
  1511. data8 sys_readv
  1512. data8 sys_writev
  1513. data8 sys_pread64
  1514. data8 sys_pwrite64
  1515. data8 sys_sysctl // 1150
  1516. data8 sys_mmap
  1517. data8 sys_munmap
  1518. data8 sys_mlock
  1519. data8 sys_mlockall
  1520. data8 sys_mprotect // 1155
  1521. data8 ia64_mremap
  1522. data8 sys_msync
  1523. data8 sys_munlock
  1524. data8 sys_munlockall
  1525. data8 sys_sched_getparam // 1160
  1526. data8 sys_sched_setparam
  1527. data8 sys_sched_getscheduler
  1528. data8 sys_sched_setscheduler
  1529. data8 sys_sched_yield
  1530. data8 sys_sched_get_priority_max // 1165
  1531. data8 sys_sched_get_priority_min
  1532. data8 sys_sched_rr_get_interval
  1533. data8 sys_nanosleep
  1534. data8 sys_ni_syscall // old nfsservctl
  1535. data8 sys_prctl // 1170
  1536. data8 sys_getpagesize
  1537. data8 sys_mmap2
  1538. data8 sys_pciconfig_read
  1539. data8 sys_pciconfig_write
  1540. data8 sys_perfmonctl // 1175
  1541. data8 sys_sigaltstack
  1542. data8 sys_rt_sigaction
  1543. data8 sys_rt_sigpending
  1544. data8 sys_rt_sigprocmask
  1545. data8 sys_rt_sigqueueinfo // 1180
  1546. data8 sys_rt_sigreturn
  1547. data8 sys_rt_sigsuspend
  1548. data8 sys_rt_sigtimedwait
  1549. data8 sys_getcwd
  1550. data8 sys_capget // 1185
  1551. data8 sys_capset
  1552. data8 sys_sendfile64
  1553. data8 sys_ni_syscall // sys_getpmsg (STREAMS)
  1554. data8 sys_ni_syscall // sys_putpmsg (STREAMS)
  1555. data8 sys_socket // 1190
  1556. data8 sys_bind
  1557. data8 sys_connect
  1558. data8 sys_listen
  1559. data8 sys_accept
  1560. data8 sys_getsockname // 1195
  1561. data8 sys_getpeername
  1562. data8 sys_socketpair
  1563. data8 sys_send
  1564. data8 sys_sendto
  1565. data8 sys_recv // 1200
  1566. data8 sys_recvfrom
  1567. data8 sys_shutdown
  1568. data8 sys_setsockopt
  1569. data8 sys_getsockopt
  1570. data8 sys_sendmsg // 1205
  1571. data8 sys_recvmsg
  1572. data8 sys_pivot_root
  1573. data8 sys_mincore
  1574. data8 sys_madvise
  1575. data8 sys_newstat // 1210
  1576. data8 sys_newlstat
  1577. data8 sys_newfstat
  1578. data8 sys_clone2
  1579. data8 sys_getdents64
  1580. data8 sys_getunwind // 1215
  1581. data8 sys_readahead
  1582. data8 sys_setxattr
  1583. data8 sys_lsetxattr
  1584. data8 sys_fsetxattr
  1585. data8 sys_getxattr // 1220
  1586. data8 sys_lgetxattr
  1587. data8 sys_fgetxattr
  1588. data8 sys_listxattr
  1589. data8 sys_llistxattr
  1590. data8 sys_flistxattr // 1225
  1591. data8 sys_removexattr
  1592. data8 sys_lremovexattr
  1593. data8 sys_fremovexattr
  1594. data8 sys_tkill
  1595. data8 sys_futex // 1230
  1596. data8 sys_sched_setaffinity
  1597. data8 sys_sched_getaffinity
  1598. data8 sys_set_tid_address
  1599. data8 sys_fadvise64_64
  1600. data8 sys_tgkill // 1235
  1601. data8 sys_exit_group
  1602. data8 sys_lookup_dcookie
  1603. data8 sys_io_setup
  1604. data8 sys_io_destroy
  1605. data8 sys_io_getevents // 1240
  1606. data8 sys_io_submit
  1607. data8 sys_io_cancel
  1608. data8 sys_epoll_create
  1609. data8 sys_epoll_ctl
  1610. data8 sys_epoll_wait // 1245
  1611. data8 sys_restart_syscall
  1612. data8 sys_semtimedop
  1613. data8 sys_timer_create
  1614. data8 sys_timer_settime
  1615. data8 sys_timer_gettime // 1250
  1616. data8 sys_timer_getoverrun
  1617. data8 sys_timer_delete
  1618. data8 sys_clock_settime
  1619. data8 sys_clock_gettime
  1620. data8 sys_clock_getres // 1255
  1621. data8 sys_clock_nanosleep
  1622. data8 sys_fstatfs64
  1623. data8 sys_statfs64
  1624. data8 sys_mbind
  1625. data8 sys_get_mempolicy // 1260
  1626. data8 sys_set_mempolicy
  1627. data8 sys_mq_open
  1628. data8 sys_mq_unlink
  1629. data8 sys_mq_timedsend
  1630. data8 sys_mq_timedreceive // 1265
  1631. data8 sys_mq_notify
  1632. data8 sys_mq_getsetattr
  1633. data8 sys_kexec_load
  1634. data8 sys_ni_syscall // reserved for vserver
  1635. data8 sys_waitid // 1270
  1636. data8 sys_add_key
  1637. data8 sys_request_key
  1638. data8 sys_keyctl
  1639. data8 sys_ioprio_set
  1640. data8 sys_ioprio_get // 1275
  1641. data8 sys_move_pages
  1642. data8 sys_inotify_init
  1643. data8 sys_inotify_add_watch
  1644. data8 sys_inotify_rm_watch
  1645. data8 sys_migrate_pages // 1280
  1646. data8 sys_openat
  1647. data8 sys_mkdirat
  1648. data8 sys_mknodat
  1649. data8 sys_fchownat
  1650. data8 sys_futimesat // 1285
  1651. data8 sys_newfstatat
  1652. data8 sys_unlinkat
  1653. data8 sys_renameat
  1654. data8 sys_linkat
  1655. data8 sys_symlinkat // 1290
  1656. data8 sys_readlinkat
  1657. data8 sys_fchmodat
  1658. data8 sys_faccessat
  1659. data8 sys_pselect6
  1660. data8 sys_ppoll // 1295
  1661. data8 sys_unshare
  1662. data8 sys_splice
  1663. data8 sys_set_robust_list
  1664. data8 sys_get_robust_list
  1665. data8 sys_sync_file_range // 1300
  1666. data8 sys_tee
  1667. data8 sys_vmsplice
  1668. data8 sys_fallocate
  1669. data8 sys_getcpu
  1670. data8 sys_epoll_pwait // 1305
  1671. data8 sys_utimensat
  1672. data8 sys_signalfd
  1673. data8 sys_ni_syscall
  1674. data8 sys_eventfd
  1675. data8 sys_timerfd_create // 1310
  1676. data8 sys_timerfd_settime
  1677. data8 sys_timerfd_gettime
  1678. data8 sys_signalfd4
  1679. data8 sys_eventfd2
  1680. data8 sys_epoll_create1 // 1315
  1681. data8 sys_dup3
  1682. data8 sys_pipe2
  1683. data8 sys_inotify_init1
  1684. data8 sys_preadv
  1685. data8 sys_pwritev // 1320
  1686. data8 sys_rt_tgsigqueueinfo
  1687. data8 sys_recvmmsg
  1688. data8 sys_fanotify_init
  1689. data8 sys_fanotify_mark
  1690. data8 sys_prlimit64 // 1325
  1691. data8 sys_name_to_handle_at
  1692. data8 sys_open_by_handle_at
  1693. data8 sys_clock_adjtime
  1694. data8 sys_syncfs
  1695. data8 sys_setns // 1330
  1696. data8 sys_sendmmsg
  1697. data8 sys_process_vm_readv
  1698. data8 sys_process_vm_writev
  1699. data8 sys_accept4
  1700. data8 sys_finit_module // 1335
  1701. data8 sys_sched_setattr
  1702. data8 sys_sched_getattr
  1703. data8 sys_renameat2
  1704. data8 sys_getrandom
  1705. data8 sys_memfd_create // 1340
  1706. data8 sys_bpf
  1707. data8 sys_execveat
  1708. data8 sys_userfaultfd
  1709. data8 sys_membarrier
  1710. data8 sys_kcmp // 1345
  1711. data8 sys_mlock2
  1712. .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls