entry.S 34 KB

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