entry.S 47 KB

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