entry.S 47 KB

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