entry.S 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  1. /* $Id: entry.S,v 1.28 2005/06/20 05:06:30 starvik Exp $
  2. *
  3. * linux/arch/cris/entry.S
  4. *
  5. * Copyright (C) 2000, 2001, 2002 Axis Communications AB
  6. *
  7. * Authors: Bjorn Wesen (bjornw@axis.com)
  8. *
  9. * $Log: entry.S,v $
  10. * Revision 1.28 2005/06/20 05:06:30 starvik
  11. * Remove unnecessary diff to kernel.org tree
  12. *
  13. * Revision 1.27 2005/03/04 08:16:16 starvik
  14. * Merge of Linux 2.6.11.
  15. *
  16. * Revision 1.26 2005/01/11 13:49:47 starvik
  17. * Added NMI handler.
  18. *
  19. * Revision 1.25 2004/12/27 11:18:32 starvik
  20. * Merge of Linux 2.6.10 (not functional yet).
  21. *
  22. * Revision 1.24 2004/12/22 10:41:23 starvik
  23. * Updates to make v10 compile with the latest SMP aware generic code (even
  24. * though v10 will never have SMP).
  25. *
  26. * Revision 1.23 2004/10/19 13:07:37 starvik
  27. * Merge of Linux 2.6.9
  28. *
  29. * Revision 1.22 2004/06/21 10:29:55 starvik
  30. * Merge of Linux 2.6.7
  31. *
  32. * Revision 1.21 2004/06/09 05:30:27 starvik
  33. * Clean up multiple interrupt handling.
  34. * Prevent interrupts from interrupting each other.
  35. * Handle all active interrupts.
  36. *
  37. * Revision 1.20 2004/06/08 08:55:32 starvik
  38. * Removed unused code
  39. *
  40. * Revision 1.19 2004/06/04 11:56:15 starvik
  41. * Implemented page table lookup for refills in assembler for improved performance.
  42. *
  43. * Revision 1.18 2004/05/11 12:28:25 starvik
  44. * Merge of Linux 2.6.6
  45. *
  46. * Revision 1.17 2003/09/11 07:29:49 starvik
  47. * Merge of Linux 2.6.0-test5
  48. *
  49. * Revision 1.16 2003/07/04 08:27:41 starvik
  50. * Merge of Linux 2.5.74
  51. *
  52. * Revision 1.15 2003/04/09 07:32:55 starvik
  53. * resume should return task_struct, not thread_info
  54. *
  55. * Revision 1.14 2003/04/09 05:20:44 starvik
  56. * Merge of Linux 2.5.67
  57. *
  58. * Revision 1.13 2002/12/11 15:42:02 starvik
  59. * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/*.c
  60. *
  61. * Revision 1.12 2002/12/10 09:00:10 starvik
  62. * Merge of Linux 2.5.51
  63. *
  64. * Revision 1.11 2002/12/05 07:53:10 starvik
  65. * Corrected constants used with btstq
  66. *
  67. * Revision 1.10 2002/11/27 08:45:10 starvik
  68. * pid is in task_struct, not thread_info
  69. *
  70. * Revision 1.9 2002/11/26 09:52:05 starvik
  71. * Added preemptive kernel scheduling (if CONFIG_PREEMPT)
  72. *
  73. * Revision 1.8 2002/11/20 11:56:11 starvik
  74. * Merge of Linux 2.5.48
  75. *
  76. * Revision 1.7 2002/11/18 13:02:42 starvik
  77. * Added fourth parameter to do_notify_resume
  78. * Minor cleanup
  79. *
  80. * Revision 1.6 2002/11/11 10:37:50 starvik
  81. * Use new asm-offset defines
  82. * Modified for new location of current->work etc
  83. * Removed SYMBOL_NAME from syscalls
  84. * Added some new syscalls
  85. *
  86. * Revision 1.5 2002/11/05 06:45:11 starvik
  87. * Merge of Linux 2.5.45
  88. *
  89. * Revision 1.4 2002/02/05 15:41:31 bjornw
  90. * Rewritten to conform better to current 2.5 code (similar to arch/i386)
  91. *
  92. * Revision 1.3 2002/01/21 15:22:20 bjornw
  93. * NICE_DOGGY fix from 2.4 arch/cris
  94. *
  95. * Revision 1.37 2001/12/07 17:03:55 bjornw
  96. * Call a c-hook called watchdog_bite_hook instead of show_registers directly
  97. *
  98. * Revision 1.36 2001/11/22 13:36:36 bjornw
  99. * * In ret_from_intr, check regs->dccr for usermode reentrance instead of
  100. * DCCR explicitly (because the latter might not reflect current reality)
  101. * * In mmu_bus_fault, set $r9 _after_ calling the C-code instead of before
  102. * since $r9 is call-clobbered and is potentially needed afterwards
  103. *
  104. * Revision 1.35 2001/10/30 17:10:15 bjornw
  105. * Add some syscalls
  106. *
  107. * Revision 1.34 2001/10/01 14:45:03 bjornw
  108. * Removed underscores and added register prefixes
  109. *
  110. * Revision 1.33 2001/08/21 13:48:01 jonashg
  111. * Added fix by HP to avoid oops when doing a hard_reset_now.
  112. *
  113. * Revision 1.32 2001/08/14 04:32:02 hp
  114. * In _resume, add comment why R9 is saved; don't sound like it's call-saved.
  115. *
  116. * Revision 1.31 2001/07/25 16:07:42 bjornw
  117. * softirq_active/mask -> softirq_pending only
  118. *
  119. * Revision 1.30 2001/07/05 01:03:32 hp
  120. * - include asm/errno.h to get ENOSYS.
  121. * - Use ENOSYS, not local constant LENOSYS; tweak comments.
  122. * - Explain why .include, not #include is used.
  123. * - Make oops-register-dump if watchdog bits and it's not expected.
  124. * - Don't jsr, use jump _hard_reset_now, and skip spurious nop.
  125. * - Use correct section attribute for section .rodata.
  126. * - Adjust sys_ni_syscall fill number.
  127. *
  128. * Revision 1.29 2001/06/25 14:07:00 hp
  129. * Fix review comment.
  130. * * head.S: Use IO_STATE, IO_FIELD and IO_MASK constructs instead of
  131. * magic numbers. Add comment that -traditional must not be used.
  132. * * entry.S (SYMBOL_NAME): Change redefinition to use ## concatenation.
  133. * Correct and update comment.
  134. * * Makefile (.S.o): Don't use -traditional. Add comment why the
  135. * toplevel rule can't be used (now that there's a reason).
  136. *
  137. * Revision 1.28 2001/06/21 02:00:40 hp
  138. * * entry.S: Include asm/unistd.h.
  139. * (_sys_call_table): Use section .rodata, not .data.
  140. * (_kernel_thread): Move from...
  141. * * process.c: ... here.
  142. * * entryoffsets.c (VAL): Break out from...
  143. * (OF): Use VAL.
  144. * (LCLONE_VM): New asmified value from CLONE_VM.
  145. *
  146. * Revision 1.27 2001/05/29 11:25:27 markusl
  147. * In case of "spurious_interrupt", do hard_reset instead of hanging system in a loop...
  148. *
  149. * Revision 1.26 2001/05/15 15:46:03 bjornw
  150. * Include config.h now that we use some CONFIG_ options
  151. *
  152. * Revision 1.25 2001/05/15 05:38:47 hp
  153. * Tweaked code in _ret_from_sys_call
  154. *
  155. * Revision 1.24 2001/05/15 05:27:49 hp
  156. * Save r9 in r1 over function call rather than on stack.
  157. *
  158. * Revision 1.23 2001/05/15 05:10:00 hp
  159. * Generate entry.S structure offsets from C
  160. *
  161. * Revision 1.22 2001/04/17 13:58:39 orjanf
  162. * * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
  163. *
  164. * Revision 1.21 2001/04/17 11:33:29 orjanf
  165. * Updated according to review:
  166. * * Included asm/sv_addr_ag.h to get macro for internal register.
  167. * * Corrected comment regarding system call argument passing.
  168. * * Removed comment about instruction being in a delay slot.
  169. * * Added comment about SYMBOL_NAME macro.
  170. *
  171. * Revision 1.20 2001/04/12 08:51:07 hp
  172. * - Add entry for sys_fcntl64. In fact copy last piece from i386 including ...
  173. * - .rept to fill table to safe state with sys_ni_syscall.
  174. *
  175. * Revision 1.19 2001/04/04 09:43:32 orjanf
  176. * * Moved do_sigtrap from traps.c to entry.S.
  177. * * LTASK_PID need not be global anymore.
  178. *
  179. * Revision 1.18 2001/03/26 09:25:02 markusl
  180. * Updated after review, should now handle USB interrupts correctly.
  181. *
  182. * Revision 1.17 2001/03/21 16:12:55 bjornw
  183. * * Always make room for the cpu status record in the frame, in order to
  184. * use the same framelength and layout for both mmu busfaults and normal
  185. * irqs. No need to check for the explicit CRIS_FRAME_FIXUP type anymore.
  186. * * Fixed bug with using addq for popping the stack in the epilogue - it
  187. * destroyed the flag register. Use instructions that don't affect the
  188. * flag register instead.
  189. * * Removed write to R_PORT_PA_DATA during spurious_interrupt
  190. *
  191. * Revision 1.16 2001/03/20 19:43:02 bjornw
  192. * * Get rid of esp0 setting
  193. * * Give a 7th argument to a systemcall - the stackframe
  194. *
  195. * Revision 1.15 2001/03/05 13:14:30 bjornw
  196. * Spelling fix
  197. *
  198. * Revision 1.14 2001/02/23 08:36:36 perf
  199. * New ABI; syscallnr=r9, arg5=mof, arg6=srp.
  200. * Corrected tracesys call check.
  201. *
  202. * Revision 1.13 2001/02/15 08:40:55 perf
  203. * H-P by way of perf;
  204. * - (_system_call): Don't read system call function address into r1.
  205. * - (RBFExit): There is no such thing as a null pop. Adjust sp by addq.
  206. * - (_system_call): Don't use r10 and don't save and restore it.
  207. * - (THREAD_ESP0): New constant.
  208. * - (_system_call): Inline set_esp0.
  209. *
  210. * Revision 1.12 2001/01/31 17:56:25 orjanf
  211. * Added definition of LTASK_PID and made it global.
  212. *
  213. * Revision 1.11 2001/01/10 21:13:29 bjornw
  214. * SYMBOL_NAME is defined incorrectly for the compiler options we currently use
  215. *
  216. * Revision 1.10 2000/12/18 23:47:56 bjornw
  217. * * Added syscall trace support (ptrace), completely untested of course
  218. * * Removed redundant check for NULL entries in syscall_table
  219. *
  220. * Revision 1.9 2000/11/21 16:40:51 bjornw
  221. * * New frame type used when an SBFS frame needs to be popped without
  222. * actually restarting the instruction
  223. * * Enable interrupts in signal_return (they did so in x86, I hope it's a good
  224. * idea)
  225. *
  226. * Revision 1.8 2000/11/17 16:53:35 bjornw
  227. * Added detection of frame-type in Rexit, so that mmu_bus_fault can
  228. * use ret_from_intr in the return-path to check for signals (like SEGV)
  229. * and other foul things that might have occurred during the fault.
  230. *
  231. * Revision 1.7 2000/10/06 15:04:28 bjornw
  232. * Include mof in register savings
  233. *
  234. * Revision 1.6 2000/09/12 16:02:44 bjornw
  235. * Linux-2.4.0-test7 derived updates
  236. *
  237. * Revision 1.5 2000/08/17 15:35:15 bjornw
  238. * 2.4.0-test6 changed local_irq_count and friends API
  239. *
  240. * Revision 1.4 2000/08/02 13:59:30 bjornw
  241. * Removed olduname and uname from the syscall list
  242. *
  243. * Revision 1.3 2000/07/31 13:32:58 bjornw
  244. * * Export ret_from_intr
  245. * * _resume updated (prev/last tjohejsan)
  246. * * timer_interrupt obsolete
  247. * * SIGSEGV detection in mmu_bus_fault temporarily disabled
  248. *
  249. *
  250. */
  251. /*
  252. * entry.S contains the system-call and fault low-level handling routines.
  253. *
  254. * NOTE: This code handles signal-recognition, which happens every time
  255. * after a timer-interrupt and after each system call.
  256. *
  257. * Stack layout in 'ret_from_system_call':
  258. * ptrace needs to have all regs on the stack.
  259. * if the order here is changed, it needs to be
  260. * updated in fork.c:copy_process, signal.c:do_signal,
  261. * ptrace.c and ptrace.h
  262. *
  263. */
  264. #include <linux/linkage.h>
  265. #include <linux/sys.h>
  266. #include <asm/unistd.h>
  267. #include <asm/arch/sv_addr_ag.h>
  268. #include <asm/errno.h>
  269. #include <asm/thread_info.h>
  270. #include <asm/asm-offsets.h>
  271. #include <asm/page.h>
  272. #include <asm/pgtable.h>
  273. ;; functions exported from this file
  274. .globl system_call
  275. .globl ret_from_intr
  276. .globl ret_from_fork
  277. .globl resume
  278. .globl multiple_interrupt
  279. .globl hwbreakpoint
  280. .globl IRQ1_interrupt
  281. .globl spurious_interrupt
  282. .globl hw_bp_trigs
  283. .globl mmu_bus_fault
  284. .globl do_sigtrap
  285. .globl gdb_handle_breakpoint
  286. .globl sys_call_table
  287. ;; below are various parts of system_call which are not in the fast-path
  288. #ifdef CONFIG_PREEMPT
  289. ; Check if preemptive kernel scheduling should be done
  290. _resume_kernel:
  291. di
  292. ; Load current task struct
  293. movs.w -8192, $r0 ; THREAD_SIZE = 8192
  294. and.d $sp, $r0
  295. move.d [$r0+TI_preempt_count], $r10 ; Preemption disabled?
  296. bne _Rexit
  297. nop
  298. _need_resched:
  299. move.d [$r0+TI_flags], $r10
  300. btstq TIF_NEED_RESCHED, $r10 ; Check if need_resched is set
  301. bpl _Rexit
  302. nop
  303. ; Ok, lets's do some preemptive kernel scheduling
  304. jsr preempt_schedule_irq
  305. ; Load new task struct
  306. movs.w -8192, $r0 ; THREAD_SIZE = 8192
  307. and.d $sp, $r0
  308. ; One more time (with new task)
  309. ba _need_resched
  310. nop
  311. #else
  312. #define _resume_kernel _Rexit
  313. #endif
  314. ; Called at exit from fork. schedule_tail must be called to drop
  315. ; spinlock if CONFIG_PREEMPT
  316. ret_from_fork:
  317. jsr schedule_tail
  318. ba ret_from_sys_call
  319. nop
  320. ret_from_intr:
  321. ;; check for resched if preemptive kernel or if we're going back to user-mode
  322. ;; this test matches the user_regs(regs) macro
  323. ;; we cannot simply test $dccr, because that does not necessarily
  324. ;; reflect what mode we'll return into.
  325. move.d [$sp + PT_dccr], $r0; regs->dccr
  326. btstq 8, $r0 ; U-flag
  327. bpl _resume_kernel
  328. ; Note that di below is in delay slot
  329. _resume_userspace:
  330. di ; so need_resched and sigpending don't change
  331. movs.w -8192, $r0 ; THREAD_SIZE == 8192
  332. and.d $sp, $r0
  333. move.d [$r0+TI_flags], $r10 ; current->work
  334. and.d _TIF_WORK_MASK, $r10 ; is there any work to be done on return
  335. bne _work_pending
  336. nop
  337. ba _Rexit
  338. nop
  339. ;; The system_call is called by a BREAK instruction, which works like
  340. ;; an interrupt call but it stores the return PC in BRP instead of IRP.
  341. ;; Since we dont really want to have two epilogues (one for system calls
  342. ;; and one for interrupts) we push the contents of BRP instead of IRP in the
  343. ;; system call prologue, to make it look like an ordinary interrupt on the
  344. ;; stackframe.
  345. ;;
  346. ;; Since we can't have system calls inside interrupts, it should not matter
  347. ;; that we don't stack IRP.
  348. ;;
  349. ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,r13,mof,srp
  350. ;;
  351. ;; This function looks on the _surface_ like spaghetti programming, but it's
  352. ;; really designed so that the fast-path does not force cache-loading of non-used
  353. ;; instructions. Only the non-common cases cause the outlined code to run..
  354. system_call:
  355. ;; stack-frame similar to the irq heads, which is reversed in ret_from_sys_call
  356. move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame
  357. push $srp
  358. push $dccr
  359. push $mof
  360. subq 14*4, $sp ; make room for r0-r13
  361. movem $r13, [$sp] ; push r0-r13
  362. push $r10 ; push orig_r10
  363. clear.d [$sp=$sp-4] ; frametype == 0, normal stackframe
  364. movs.w -ENOSYS, $r0
  365. move.d $r0, [$sp+PT_r10] ; put the default return value in r10 in the frame
  366. ;; check if this process is syscall-traced
  367. movs.w -8192, $r0 ; THREAD_SIZE == 8192
  368. and.d $sp, $r0
  369. move.d [$r0+TI_flags], $r0
  370. btstq TIF_SYSCALL_TRACE, $r0
  371. bmi _syscall_trace_entry
  372. nop
  373. _syscall_traced:
  374. ;; check for sanity in the requested syscall number
  375. cmpu.w NR_syscalls, $r9
  376. bcc ret_from_sys_call
  377. lslq 2, $r9 ; multiply by 4, in the delay slot
  378. ;; as a bonus 7th parameter, we give the location on the stack
  379. ;; of the register structure itself. some syscalls need this.
  380. push $sp
  381. ;; the parameter carrying registers r10, r11, r12 and 13 are intact.
  382. ;; the fifth and sixth parameters (if any) was in mof and srp
  383. ;; respectively, and we need to put them on the stack.
  384. push $srp
  385. push $mof
  386. jsr [$r9+sys_call_table] ; actually do the system call
  387. addq 3*4, $sp ; pop the mof, srp and regs parameters
  388. move.d $r10, [$sp+PT_r10] ; save the return value
  389. moveq 1, $r9 ; "parameter" to ret_from_sys_call to show it was a sys call
  390. ;; fall through into ret_from_sys_call to return
  391. ret_from_sys_call:
  392. ;; r9 is a parameter - if >=1 we came from a syscall, if 0, from an irq
  393. ;; get the current task-struct pointer (see top for defs)
  394. movs.w -8192, $r0 ; THREAD_SIZE == 8192
  395. and.d $sp, $r0
  396. di ; make sure need_resched and sigpending don't change
  397. move.d [$r0+TI_flags],$r1
  398. and.d _TIF_ALLWORK_MASK, $r1
  399. bne _syscall_exit_work
  400. nop
  401. _Rexit:
  402. ;; this epilogue MUST match the prologues in multiple_interrupt, irq.h and ptregs.h
  403. pop $r10 ; frametype
  404. bne _RBFexit ; was not CRIS_FRAME_NORMAL, handle otherwise
  405. addq 4, $sp ; skip orig_r10, in delayslot
  406. movem [$sp+], $r13 ; registers r0-r13
  407. pop $mof ; multiply overflow register
  408. pop $dccr ; condition codes
  409. pop $srp ; subroutine return pointer
  410. ;; now we have a 4-word SBFS frame which we do not want to restore
  411. ;; using RBF since it was not stacked with SBFS. instead we would like to
  412. ;; just get the PC value to restart it with, and skip the rest of
  413. ;; the frame.
  414. ;; Also notice that it's important to use instructions here that
  415. ;; keep the interrupts disabled (since we've already popped DCCR)
  416. move [$sp=$sp+16], $p8; pop the SBFS frame from the sp
  417. jmpu [$sp-16] ; return through the irp field in the sbfs frame
  418. _RBFexit:
  419. movem [$sp+], $r13 ; registers r0-r13, in delay slot
  420. pop $mof ; multiply overflow register
  421. pop $dccr ; condition codes
  422. pop $srp ; subroutine return pointer
  423. rbf [$sp+] ; return by popping the CPU status
  424. ;; We get here after doing a syscall if extra work might need to be done
  425. ;; perform syscall exit tracing if needed
  426. _syscall_exit_work:
  427. ;; $r0 contains current at this point and irq's are disabled
  428. move.d [$r0+TI_flags], $r1
  429. btstq TIF_SYSCALL_TRACE, $r1
  430. bpl _work_pending
  431. nop
  432. ei
  433. move.d $r9, $r1 ; preserve r9
  434. jsr do_syscall_trace
  435. move.d $r1, $r9
  436. ba _resume_userspace
  437. nop
  438. _work_pending:
  439. move.d [$r0+TI_flags], $r1
  440. btstq TIF_NEED_RESCHED, $r1
  441. bpl _work_notifysig ; was neither trace nor sched, must be signal/notify
  442. nop
  443. _work_resched:
  444. move.d $r9, $r1 ; preserve r9
  445. jsr schedule
  446. move.d $r1, $r9
  447. di
  448. move.d [$r0+TI_flags], $r1
  449. and.d _TIF_WORK_MASK, $r1; ignore the syscall trace counter
  450. beq _Rexit
  451. nop
  452. btstq TIF_NEED_RESCHED, $r1
  453. bmi _work_resched ; current->work.need_resched
  454. nop
  455. _work_notifysig:
  456. ;; deal with pending signals and notify-resume requests
  457. move.d $r9, $r10 ; do_notify_resume syscall/irq param
  458. move.d $sp, $r11 ; the regs param
  459. move.d $r1, $r12 ; the thread_info_flags parameter
  460. jsr do_notify_resume
  461. ba _Rexit
  462. nop
  463. ;; We get here as a sidetrack when we've entered a syscall with the
  464. ;; trace-bit set. We need to call do_syscall_trace and then continue
  465. ;; with the call.
  466. _syscall_trace_entry:
  467. ;; PT_r10 in the frame contains -ENOSYS as required, at this point
  468. jsr do_syscall_trace
  469. ;; now re-enter the syscall code to do the syscall itself
  470. ;; we need to restore $r9 here to contain the wanted syscall, and
  471. ;; the other parameter-bearing registers
  472. move.d [$sp+PT_r9], $r9
  473. move.d [$sp+PT_orig_r10], $r10 ; PT_r10 is already filled with -ENOSYS.
  474. move.d [$sp+PT_r11], $r11
  475. move.d [$sp+PT_r12], $r12
  476. move.d [$sp+PT_r13], $r13
  477. move [$sp+PT_mof], $mof
  478. move [$sp+PT_srp], $srp
  479. ba _syscall_traced
  480. nop
  481. ;; resume performs the actual task-switching, by switching stack pointers
  482. ;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct
  483. ;; returns old current in r10
  484. ;;
  485. ;; TODO: see the i386 version. The switch_to which calls resume in our version
  486. ;; could really be an inline asm of this.
  487. resume:
  488. push $srp ; we keep the old/new PC on the stack
  489. add.d $r12, $r10 ; r10 = current tasks tss
  490. move $dccr, [$r10+THREAD_dccr]; save irq enable state
  491. di
  492. move $usp, [$r10+ THREAD_usp] ; save user-mode stackpointer
  493. ;; See copy_thread for the reason why register R9 is saved.
  494. subq 10*4, $sp
  495. movem $r9, [$sp] ; save non-scratch registers and R9.
  496. move.d $sp, [$r10+THREAD_ksp] ; save the kernel stack pointer for the old task
  497. move.d $sp, $r10 ; return last running task in r10
  498. and.d -8192, $r10 ; get thread_info from stackpointer
  499. move.d [$r10+TI_task], $r10 ; get task
  500. add.d $r12, $r11 ; find the new tasks tss
  501. move.d [$r11+THREAD_ksp], $sp ; switch into the new stackframe by restoring kernel sp
  502. movem [$sp+], $r9 ; restore non-scratch registers and R9.
  503. move [$r11+THREAD_usp], $usp ; restore user-mode stackpointer
  504. move [$r11+THREAD_dccr], $dccr ; restore irq enable status
  505. jump [$sp+] ; restore PC
  506. ;; This is the MMU bus fault handler.
  507. ;; It needs to stack the CPU status and overall is different
  508. ;; from the other interrupt handlers.
  509. mmu_bus_fault:
  510. ;; For refills we try to do a quick page table lookup. If it is
  511. ;; a real fault we let the mm subsystem handle it.
  512. ;; the first longword in the sbfs frame was the interrupted PC
  513. ;; which fits nicely with the "IRP" slot in pt_regs normally used to
  514. ;; contain the return address. used by Oops to print kernel errors.
  515. sbfs [$sp=$sp-16] ; push the internal CPU status
  516. push $dccr
  517. di
  518. subq 2*4, $sp
  519. movem $r1, [$sp]
  520. move.d [R_MMU_CAUSE], $r1
  521. ;; ETRAX 100LX TR89 bugfix: if the second half of an unaligned
  522. ;; write causes a MMU-fault, it will not be restarted correctly.
  523. ;; This could happen if a write crosses a page-boundary and the
  524. ;; second page is not yet COW'ed or even loaded. The workaround
  525. ;; is to clear the unaligned bit in the CPU status record, so
  526. ;; that the CPU will rerun both the first and second halves of
  527. ;; the instruction. This will not have any sideeffects unless
  528. ;; the first half goes to any device or memory that can't be
  529. ;; written twice, and which is mapped through the MMU.
  530. ;;
  531. ;; We only need to do this for writes.
  532. btstq 8, $r1 ; Write access?
  533. bpl 1f
  534. nop
  535. move.d [$sp+16], $r0 ; Clear unaligned bit in csrinstr
  536. and.d ~(1<<5), $r0
  537. move.d $r0, [$sp+16]
  538. 1: btstq 12, $r1 ; Refill?
  539. bpl 2f
  540. lsrq 24, $r1 ; Get PGD index (bit 24-31)
  541. move.d [per_cpu__current_pgd], $r0 ; PGD for the current process
  542. move.d [$r0+$r1.d], $r0 ; Get PMD
  543. beq 2f
  544. nop
  545. and.w PAGE_MASK, $r0 ; Remove PMD flags
  546. move.d [R_MMU_CAUSE], $r1
  547. lsrq PAGE_SHIFT, $r1
  548. and.d 0x7ff, $r1 ; Get PTE index into PGD (bit 13-23)
  549. move.d [$r0+$r1.d], $r1 ; Get PTE
  550. beq 2f
  551. nop
  552. ;; Store in TLB
  553. move.d $r1, [R_TLB_LO]
  554. ;; Return
  555. movem [$sp+], $r1
  556. pop $dccr
  557. rbf [$sp+] ; return by popping the CPU status
  558. 2: ; PMD or PTE missing, let the mm subsystem fix it up.
  559. movem [$sp+], $r1
  560. pop $dccr
  561. ; Ok, not that easy, pass it on to the mm subsystem
  562. ; The MMU status record is now on the stack
  563. push $srp ; make a stackframe similar to pt_regs
  564. push $dccr
  565. push $mof
  566. di
  567. subq 14*4, $sp
  568. movem $r13, [$sp]
  569. push $r10 ; dummy orig_r10
  570. moveq 1, $r10
  571. push $r10 ; frametype == 1, BUSFAULT frame type
  572. move.d $sp, $r10 ; pt_regs argument to handle_mmu_bus_fault
  573. jsr handle_mmu_bus_fault ; in arch/cris/arch-v10/mm/fault.c
  574. ;; now we need to return through the normal path, we cannot just
  575. ;; do the RBFexit since we might have killed off the running
  576. ;; process due to a SEGV, scheduled due to a page blocking or
  577. ;; whatever.
  578. moveq 0, $r9 ; busfault is equivalent to an irq
  579. ba ret_from_intr
  580. nop
  581. ;; special handlers for breakpoint and NMI
  582. hwbreakpoint:
  583. push $dccr
  584. di
  585. push $r10
  586. push $r11
  587. move.d [hw_bp_trig_ptr],$r10
  588. move $brp,$r11
  589. move.d $r11,[$r10+]
  590. move.d $r10,[hw_bp_trig_ptr]
  591. 1: pop $r11
  592. pop $r10
  593. pop $dccr
  594. retb
  595. nop
  596. IRQ1_interrupt:
  597. ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!!
  598. move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame
  599. push $srp
  600. push $dccr
  601. push $mof
  602. di
  603. subq 14*4, $sp
  604. movem $r13, [$sp]
  605. push $r10 ; push orig_r10
  606. clear.d [$sp=$sp-4] ; frametype == 0, normal frame
  607. ;; If there is a glitch on the NMI pin shorter than ~100ns
  608. ;; (i.e. non-active by the time we get here) then the nmi_pin bit
  609. ;; in R_IRQ_MASK0_RD will already be cleared. The watchdog_nmi bit
  610. ;; is cleared by us however (when feeding the watchdog), which is why
  611. ;; we use that bit to determine what brought us here.
  612. move.d [R_IRQ_MASK0_RD], $r1 ; External NMI or watchdog?
  613. and.d (1<<30), $r1
  614. bne wdog
  615. move.d $sp, $r10
  616. jsr handle_nmi
  617. setf m ; Enable NMI again
  618. ba _Rexit ; Return the standard way
  619. nop
  620. wdog:
  621. #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
  622. ;; Check if we're waiting for reset to happen, as signalled by
  623. ;; hard_reset_now setting cause_of_death to a magic value. If so, just
  624. ;; get stuck until reset happens.
  625. .comm cause_of_death, 4 ;; Don't declare this anywhere.
  626. move.d [cause_of_death], $r10
  627. cmp.d 0xbedead, $r10
  628. _killed_by_death:
  629. beq _killed_by_death
  630. nop
  631. ;; We'll see this in ksymoops dumps.
  632. Watchdog_bite:
  633. #ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
  634. ;; We just restart the watchdog here to be sure we dont get
  635. ;; hit while printing the watchdogmsg below
  636. ;; This restart is compatible with the rest of the C-code, so
  637. ;; the C-code can keep restarting the watchdog after this point.
  638. ;; The non-NICE_DOGGY code below though, disables the possibility
  639. ;; to restart since it changes the watchdog key, to avoid any
  640. ;; buggy loops etc. keeping the watchdog alive after this.
  641. jsr reset_watchdog
  642. #else
  643. ;; We need to extend the 3.3ms after the NMI at watchdog bite, so we have
  644. ;; time for an oops-dump over a 115k2 serial wire. Another 100ms should do.
  645. ;; Change the watchdog key to an arbitrary 3-bit value and restart the
  646. ;; watchdog.
  647. #define WD_INIT 2
  648. moveq IO_FIELD (R_WATCHDOG, key, WD_INIT), $r10
  649. move.d R_WATCHDOG, $r11
  650. move.d $r10, [$r11]
  651. moveq IO_FIELD (R_WATCHDOG, key, \
  652. IO_EXTRACT (R_WATCHDOG, key, \
  653. IO_MASK (R_WATCHDOG, key)) \
  654. ^ WD_INIT) \
  655. | IO_STATE (R_WATCHDOG, enable, start), $r10
  656. move.d $r10, [$r11]
  657. #endif
  658. ;; Note that we don't do "setf m" here (or after two necessary NOPs),
  659. ;; since *not* doing that saves us from re-entrancy checks. We don't want
  660. ;; to get here again due to possible subsequent NMIs; we want the watchdog
  661. ;; to reset us.
  662. move.d _watchdogmsg,$r10
  663. jsr printk
  664. move.d $sp, $r10
  665. jsr watchdog_bite_hook
  666. ;; This nop is here so we see the "Watchdog_bite" label in ksymoops dumps
  667. ;; rather than "spurious_interrupt".
  668. nop
  669. ;; At this point we drop down into spurious_interrupt, which will do a
  670. ;; hard reset.
  671. .section .rodata,"a"
  672. _watchdogmsg:
  673. .ascii "Oops: bitten by watchdog\n\0"
  674. .previous
  675. #endif /* CONFIG_ETRAX_WATCHDOG and not CONFIG_SVINTO_SIM */
  676. spurious_interrupt:
  677. di
  678. jump hard_reset_now
  679. ;; this handles the case when multiple interrupts arrive at the same time
  680. ;; we jump to the first set interrupt bit in a priority fashion
  681. ;; the hardware will call the unserved interrupts after the handler finishes
  682. multiple_interrupt:
  683. ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!!
  684. move $irp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame
  685. push $srp
  686. push $dccr
  687. push $mof
  688. di
  689. subq 14*4, $sp
  690. movem $r13, [$sp]
  691. push $r10 ; push orig_r10
  692. clear.d [$sp=$sp-4] ; frametype == 0, normal frame
  693. move.d $sp, $r10
  694. jsr do_multiple_IRQ
  695. jump ret_from_intr
  696. do_sigtrap:
  697. ;;
  698. ;; SIGTRAP the process that executed the break instruction.
  699. ;; Make a frame that Rexit in entry.S expects.
  700. ;;
  701. move $brp, [$sp=$sp-16] ; Push BRP while faking a cpu status record.
  702. push $srp ; Push subroutine return pointer.
  703. push $dccr ; Push condition codes.
  704. push $mof ; Push multiply overflow reg.
  705. di ; Need to disable irq's at this point.
  706. subq 14*4, $sp ; Make room for r0-r13.
  707. movem $r13, [$sp] ; Push the r0-r13 registers.
  708. push $r10 ; Push orig_r10.
  709. clear.d [$sp=$sp-4] ; Frametype - this is a normal stackframe.
  710. movs.w -8192,$r9 ; THREAD_SIZE == 8192
  711. and.d $sp, $r9
  712. move.d [$r9+TI_task], $r10
  713. move.d [$r10+TASK_pid], $r10 ; current->pid as arg1.
  714. moveq 5, $r11 ; SIGTRAP as arg2.
  715. jsr sys_kill
  716. jump ret_from_intr ; Use the return routine for interrupts.
  717. gdb_handle_breakpoint:
  718. push $dccr
  719. push $r0
  720. #ifdef CONFIG_ETRAX_KGDB
  721. move $dccr, $r0 ; U-flag not affected by previous insns.
  722. btstq 8, $r0 ; Test the U-flag.
  723. bmi _ugdb_handle_breakpoint ; Go to user mode debugging.
  724. nop ; Empty delay slot (cannot pop r0 here).
  725. pop $r0 ; Restore r0.
  726. ba kgdb_handle_breakpoint ; Go to kernel debugging.
  727. pop $dccr ; Restore dccr in delay slot.
  728. #endif
  729. _ugdb_handle_breakpoint:
  730. move $brp, $r0 ; Use r0 temporarily for calculation.
  731. subq 2, $r0 ; Set to address of previous instruction.
  732. move $r0, $brp
  733. pop $r0 ; Restore r0.
  734. ba do_sigtrap ; SIGTRAP the offending process.
  735. pop $dccr ; Restore dccr in delay slot.
  736. .global kernel_execve
  737. kernel_execve:
  738. move.d __NR_execve, $r9
  739. break 13
  740. ret
  741. nop
  742. .data
  743. hw_bp_trigs:
  744. .space 64*4
  745. hw_bp_trig_ptr:
  746. .dword hw_bp_trigs
  747. .section .rodata,"a"
  748. sys_call_table:
  749. .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
  750. .long sys_exit
  751. .long sys_fork
  752. .long sys_read
  753. .long sys_write
  754. .long sys_open /* 5 */
  755. .long sys_close
  756. .long sys_waitpid
  757. .long sys_creat
  758. .long sys_link
  759. .long sys_unlink /* 10 */
  760. .long sys_execve
  761. .long sys_chdir
  762. .long sys_time
  763. .long sys_mknod
  764. .long sys_chmod /* 15 */
  765. .long sys_lchown16
  766. .long sys_ni_syscall /* old break syscall holder */
  767. .long sys_stat
  768. .long sys_lseek
  769. .long sys_getpid /* 20 */
  770. .long sys_mount
  771. .long sys_oldumount
  772. .long sys_setuid16
  773. .long sys_getuid16
  774. .long sys_stime /* 25 */
  775. .long sys_ptrace
  776. .long sys_alarm
  777. .long sys_fstat
  778. .long sys_pause
  779. .long sys_utime /* 30 */
  780. .long sys_ni_syscall /* old stty syscall holder */
  781. .long sys_ni_syscall /* old gtty syscall holder */
  782. .long sys_access
  783. .long sys_nice
  784. .long sys_ni_syscall /* 35 old ftime syscall holder */
  785. .long sys_sync
  786. .long sys_kill
  787. .long sys_rename
  788. .long sys_mkdir
  789. .long sys_rmdir /* 40 */
  790. .long sys_dup
  791. .long sys_pipe
  792. .long sys_times
  793. .long sys_ni_syscall /* old prof syscall holder */
  794. .long sys_brk /* 45 */
  795. .long sys_setgid16
  796. .long sys_getgid16
  797. .long sys_signal
  798. .long sys_geteuid16
  799. .long sys_getegid16 /* 50 */
  800. .long sys_acct
  801. .long sys_umount /* recycled never used phys( */
  802. .long sys_ni_syscall /* old lock syscall holder */
  803. .long sys_ioctl
  804. .long sys_fcntl /* 55 */
  805. .long sys_ni_syscall /* old mpx syscall holder */
  806. .long sys_setpgid
  807. .long sys_ni_syscall /* old ulimit syscall holder */
  808. .long sys_ni_syscall /* old sys_olduname holder */
  809. .long sys_umask /* 60 */
  810. .long sys_chroot
  811. .long sys_ustat
  812. .long sys_dup2
  813. .long sys_getppid
  814. .long sys_getpgrp /* 65 */
  815. .long sys_setsid
  816. .long sys_sigaction
  817. .long sys_sgetmask
  818. .long sys_ssetmask
  819. .long sys_setreuid16 /* 70 */
  820. .long sys_setregid16
  821. .long sys_sigsuspend
  822. .long sys_sigpending
  823. .long sys_sethostname
  824. .long sys_setrlimit /* 75 */
  825. .long sys_old_getrlimit
  826. .long sys_getrusage
  827. .long sys_gettimeofday
  828. .long sys_settimeofday
  829. .long sys_getgroups16 /* 80 */
  830. .long sys_setgroups16
  831. .long sys_select /* was old_select in Linux/E100 */
  832. .long sys_symlink
  833. .long sys_lstat
  834. .long sys_readlink /* 85 */
  835. .long sys_uselib
  836. .long sys_swapon
  837. .long sys_reboot
  838. .long old_readdir
  839. .long old_mmap /* 90 */
  840. .long sys_munmap
  841. .long sys_truncate
  842. .long sys_ftruncate
  843. .long sys_fchmod
  844. .long sys_fchown16 /* 95 */
  845. .long sys_getpriority
  846. .long sys_setpriority
  847. .long sys_ni_syscall /* old profil syscall holder */
  848. .long sys_statfs
  849. .long sys_fstatfs /* 100 */
  850. .long sys_ni_syscall /* sys_ioperm in i386 */
  851. .long sys_socketcall
  852. .long sys_syslog
  853. .long sys_setitimer
  854. .long sys_getitimer /* 105 */
  855. .long sys_newstat
  856. .long sys_newlstat
  857. .long sys_newfstat
  858. .long sys_ni_syscall /* old sys_uname holder */
  859. .long sys_ni_syscall /* sys_iopl in i386 */
  860. .long sys_vhangup
  861. .long sys_ni_syscall /* old "idle" system call */
  862. .long sys_ni_syscall /* vm86old in i386 */
  863. .long sys_wait4
  864. .long sys_swapoff /* 115 */
  865. .long sys_sysinfo
  866. .long sys_ipc
  867. .long sys_fsync
  868. .long sys_sigreturn
  869. .long sys_clone /* 120 */
  870. .long sys_setdomainname
  871. .long sys_newuname
  872. .long sys_ni_syscall /* sys_modify_ldt */
  873. .long sys_adjtimex
  874. .long sys_mprotect /* 125 */
  875. .long sys_sigprocmask
  876. .long sys_ni_syscall /* old "create_module" */
  877. .long sys_init_module
  878. .long sys_delete_module
  879. .long sys_ni_syscall /* 130: old "get_kernel_syms" */
  880. .long sys_quotactl
  881. .long sys_getpgid
  882. .long sys_fchdir
  883. .long sys_bdflush
  884. .long sys_sysfs /* 135 */
  885. .long sys_personality
  886. .long sys_ni_syscall /* for afs_syscall */
  887. .long sys_setfsuid16
  888. .long sys_setfsgid16
  889. .long sys_llseek /* 140 */
  890. .long sys_getdents
  891. .long sys_select
  892. .long sys_flock
  893. .long sys_msync
  894. .long sys_readv /* 145 */
  895. .long sys_writev
  896. .long sys_getsid
  897. .long sys_fdatasync
  898. .long sys_sysctl
  899. .long sys_mlock /* 150 */
  900. .long sys_munlock
  901. .long sys_mlockall
  902. .long sys_munlockall
  903. .long sys_sched_setparam
  904. .long sys_sched_getparam /* 155 */
  905. .long sys_sched_setscheduler
  906. .long sys_sched_getscheduler
  907. .long sys_sched_yield
  908. .long sys_sched_get_priority_max
  909. .long sys_sched_get_priority_min /* 160 */
  910. .long sys_sched_rr_get_interval
  911. .long sys_nanosleep
  912. .long sys_mremap
  913. .long sys_setresuid16
  914. .long sys_getresuid16 /* 165 */
  915. .long sys_ni_syscall /* sys_vm86 */
  916. .long sys_ni_syscall /* Old sys_query_module */
  917. .long sys_poll
  918. .long sys_nfsservctl
  919. .long sys_setresgid16 /* 170 */
  920. .long sys_getresgid16
  921. .long sys_prctl
  922. .long sys_rt_sigreturn
  923. .long sys_rt_sigaction
  924. .long sys_rt_sigprocmask /* 175 */
  925. .long sys_rt_sigpending
  926. .long sys_rt_sigtimedwait
  927. .long sys_rt_sigqueueinfo
  928. .long sys_rt_sigsuspend
  929. .long sys_pread64 /* 180 */
  930. .long sys_pwrite64
  931. .long sys_chown16
  932. .long sys_getcwd
  933. .long sys_capget
  934. .long sys_capset /* 185 */
  935. .long sys_sigaltstack
  936. .long sys_sendfile
  937. .long sys_ni_syscall /* streams1 */
  938. .long sys_ni_syscall /* streams2 */
  939. .long sys_vfork /* 190 */
  940. .long sys_getrlimit
  941. .long sys_mmap2
  942. .long sys_truncate64
  943. .long sys_ftruncate64
  944. .long sys_stat64 /* 195 */
  945. .long sys_lstat64
  946. .long sys_fstat64
  947. .long sys_lchown
  948. .long sys_getuid
  949. .long sys_getgid /* 200 */
  950. .long sys_geteuid
  951. .long sys_getegid
  952. .long sys_setreuid
  953. .long sys_setregid
  954. .long sys_getgroups /* 205 */
  955. .long sys_setgroups
  956. .long sys_fchown
  957. .long sys_setresuid
  958. .long sys_getresuid
  959. .long sys_setresgid /* 210 */
  960. .long sys_getresgid
  961. .long sys_chown
  962. .long sys_setuid
  963. .long sys_setgid
  964. .long sys_setfsuid /* 215 */
  965. .long sys_setfsgid
  966. .long sys_pivot_root
  967. .long sys_mincore
  968. .long sys_madvise
  969. .long sys_getdents64 /* 220 */
  970. .long sys_fcntl64
  971. .long sys_ni_syscall /* reserved for TUX */
  972. .long sys_ni_syscall
  973. .long sys_gettid
  974. .long sys_readahead /* 225 */
  975. .long sys_setxattr
  976. .long sys_lsetxattr
  977. .long sys_fsetxattr
  978. .long sys_getxattr
  979. .long sys_lgetxattr /* 230 */
  980. .long sys_fgetxattr
  981. .long sys_listxattr
  982. .long sys_llistxattr
  983. .long sys_flistxattr
  984. .long sys_removexattr /* 235 */
  985. .long sys_lremovexattr
  986. .long sys_fremovexattr
  987. .long sys_tkill
  988. .long sys_sendfile64
  989. .long sys_futex /* 240 */
  990. .long sys_sched_setaffinity
  991. .long sys_sched_getaffinity
  992. .long sys_ni_syscall /* sys_set_thread_area */
  993. .long sys_ni_syscall /* sys_get_thread_area */
  994. .long sys_io_setup /* 245 */
  995. .long sys_io_destroy
  996. .long sys_io_getevents
  997. .long sys_io_submit
  998. .long sys_io_cancel
  999. .long sys_fadvise64 /* 250 */
  1000. .long sys_ni_syscall
  1001. .long sys_exit_group
  1002. .long sys_lookup_dcookie
  1003. .long sys_epoll_create
  1004. .long sys_epoll_ctl /* 255 */
  1005. .long sys_epoll_wait
  1006. .long sys_remap_file_pages
  1007. .long sys_set_tid_address
  1008. .long sys_timer_create
  1009. .long sys_timer_settime /* 260 */
  1010. .long sys_timer_gettime
  1011. .long sys_timer_getoverrun
  1012. .long sys_timer_delete
  1013. .long sys_clock_settime
  1014. .long sys_clock_gettime /* 265 */
  1015. .long sys_clock_getres
  1016. .long sys_clock_nanosleep
  1017. .long sys_statfs64
  1018. .long sys_fstatfs64
  1019. .long sys_tgkill /* 270 */
  1020. .long sys_utimes
  1021. .long sys_fadvise64_64
  1022. .long sys_ni_syscall /* sys_vserver */
  1023. .long sys_ni_syscall /* sys_mbind */
  1024. .long sys_ni_syscall /* 275 sys_get_mempolicy */
  1025. .long sys_ni_syscall /* sys_set_mempolicy */
  1026. .long sys_mq_open
  1027. .long sys_mq_unlink
  1028. .long sys_mq_timedsend
  1029. .long sys_mq_timedreceive /* 280 */
  1030. .long sys_mq_notify
  1031. .long sys_mq_getsetattr
  1032. .long sys_ni_syscall /* reserved for kexec */
  1033. .long sys_waitid
  1034. .long sys_ni_syscall /* 285 */ /* available */
  1035. .long sys_add_key
  1036. .long sys_request_key
  1037. .long sys_keyctl
  1038. .long sys_ioprio_set
  1039. .long sys_ioprio_get /* 290 */
  1040. .long sys_inotify_init
  1041. .long sys_inotify_add_watch
  1042. .long sys_inotify_rm_watch
  1043. .long sys_migrate_pages
  1044. .long sys_openat /* 295 */
  1045. .long sys_mkdirat
  1046. .long sys_mknodat
  1047. .long sys_fchownat
  1048. .long sys_futimesat
  1049. .long sys_fstatat64 /* 300 */
  1050. .long sys_unlinkat
  1051. .long sys_renameat
  1052. .long sys_linkat
  1053. .long sys_symlinkat
  1054. .long sys_readlinkat /* 305 */
  1055. .long sys_fchmodat
  1056. .long sys_faccessat
  1057. .long sys_pselect6
  1058. .long sys_ppoll
  1059. .long sys_unshare /* 310 */
  1060. .long sys_set_robust_list
  1061. .long sys_get_robust_list
  1062. .long sys_splice
  1063. .long sys_sync_file_range
  1064. .long sys_tee /* 315 */
  1065. .long sys_vmsplice
  1066. .long sys_move_pages
  1067. .long sys_getcpu
  1068. .long sys_epoll_pwait
  1069. .long sys_utimensat /* 320 */
  1070. .long sys_signalfd
  1071. .long sys_timerfd
  1072. .long sys_eventfd
  1073. .long sys_fallocate
  1074. /*
  1075. * NOTE!! This doesn't have to be exact - we just have
  1076. * to make sure we have _enough_ of the "sys_ni_syscall"
  1077. * entries. Don't panic if you notice that this hasn't
  1078. * been shrunk every time we add a new system call.
  1079. */
  1080. .rept NR_syscalls-(.-sys_call_table)/4
  1081. .long sys_ni_syscall
  1082. .endr