entry.S 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. /*
  2. * linux/arch/i386/entry.S
  3. *
  4. * Copyright (C) 1991, 1992 Linus Torvalds
  5. */
  6. /*
  7. * entry.S contains the system-call and fault low-level handling routines.
  8. * This also contains the timer-interrupt handler, as well as all interrupts
  9. * and faults that can result in a task-switch.
  10. *
  11. * NOTE: This code handles signal-recognition, which happens every time
  12. * after a timer-interrupt and after each system call.
  13. *
  14. * I changed all the .align's to 4 (16 byte alignment), as that's faster
  15. * on a 486.
  16. *
  17. * Stack layout in 'ret_from_system_call':
  18. * ptrace needs to have all regs on the stack.
  19. * if the order here is changed, it needs to be
  20. * updated in fork.c:copy_process, signal.c:do_signal,
  21. * ptrace.c and ptrace.h
  22. *
  23. * 0(%esp) - %ebx
  24. * 4(%esp) - %ecx
  25. * 8(%esp) - %edx
  26. * C(%esp) - %esi
  27. * 10(%esp) - %edi
  28. * 14(%esp) - %ebp
  29. * 18(%esp) - %eax
  30. * 1C(%esp) - %ds
  31. * 20(%esp) - %es
  32. * 24(%esp) - orig_eax
  33. * 28(%esp) - %eip
  34. * 2C(%esp) - %cs
  35. * 30(%esp) - %eflags
  36. * 34(%esp) - %oldesp
  37. * 38(%esp) - %oldss
  38. *
  39. * "current" is in register %ebx during any slow entries.
  40. */
  41. #include <linux/config.h>
  42. #include <linux/linkage.h>
  43. #include <asm/thread_info.h>
  44. #include <asm/errno.h>
  45. #include <asm/segment.h>
  46. #include <asm/smp.h>
  47. #include <asm/page.h>
  48. #include <asm/desc.h>
  49. #include "irq_vectors.h"
  50. #define nr_syscalls ((syscall_table_size)/4)
  51. EBX = 0x00
  52. ECX = 0x04
  53. EDX = 0x08
  54. ESI = 0x0C
  55. EDI = 0x10
  56. EBP = 0x14
  57. EAX = 0x18
  58. DS = 0x1C
  59. ES = 0x20
  60. ORIG_EAX = 0x24
  61. EIP = 0x28
  62. CS = 0x2C
  63. EFLAGS = 0x30
  64. OLDESP = 0x34
  65. OLDSS = 0x38
  66. CF_MASK = 0x00000001
  67. TF_MASK = 0x00000100
  68. IF_MASK = 0x00000200
  69. DF_MASK = 0x00000400
  70. NT_MASK = 0x00004000
  71. VM_MASK = 0x00020000
  72. #ifdef CONFIG_PREEMPT
  73. #define preempt_stop cli
  74. #else
  75. #define preempt_stop
  76. #define resume_kernel restore_nocheck
  77. #endif
  78. #define SAVE_ALL \
  79. cld; \
  80. pushl %es; \
  81. pushl %ds; \
  82. pushl %eax; \
  83. pushl %ebp; \
  84. pushl %edi; \
  85. pushl %esi; \
  86. pushl %edx; \
  87. pushl %ecx; \
  88. pushl %ebx; \
  89. movl $(__USER_DS), %edx; \
  90. movl %edx, %ds; \
  91. movl %edx, %es;
  92. #define RESTORE_INT_REGS \
  93. popl %ebx; \
  94. popl %ecx; \
  95. popl %edx; \
  96. popl %esi; \
  97. popl %edi; \
  98. popl %ebp; \
  99. popl %eax
  100. #define RESTORE_REGS \
  101. RESTORE_INT_REGS; \
  102. 1: popl %ds; \
  103. 2: popl %es; \
  104. .section .fixup,"ax"; \
  105. 3: movl $0,(%esp); \
  106. jmp 1b; \
  107. 4: movl $0,(%esp); \
  108. jmp 2b; \
  109. .previous; \
  110. .section __ex_table,"a";\
  111. .align 4; \
  112. .long 1b,3b; \
  113. .long 2b,4b; \
  114. .previous
  115. ENTRY(ret_from_fork)
  116. pushl %eax
  117. call schedule_tail
  118. GET_THREAD_INFO(%ebp)
  119. popl %eax
  120. jmp syscall_exit
  121. /*
  122. * Return to user mode is not as complex as all this looks,
  123. * but we want the default path for a system call return to
  124. * go as quickly as possible which is why some of this is
  125. * less clear than it otherwise should be.
  126. */
  127. # userspace resumption stub bypassing syscall exit tracing
  128. ALIGN
  129. ret_from_exception:
  130. preempt_stop
  131. ret_from_intr:
  132. GET_THREAD_INFO(%ebp)
  133. movl EFLAGS(%esp), %eax # mix EFLAGS and CS
  134. movb CS(%esp), %al
  135. testl $(VM_MASK | 3), %eax
  136. jz resume_kernel
  137. ENTRY(resume_userspace)
  138. cli # make sure we don't miss an interrupt
  139. # setting need_resched or sigpending
  140. # between sampling and the iret
  141. movl TI_flags(%ebp), %ecx
  142. andl $_TIF_WORK_MASK, %ecx # is there any work to be done on
  143. # int/exception return?
  144. jne work_pending
  145. jmp restore_all
  146. #ifdef CONFIG_PREEMPT
  147. ENTRY(resume_kernel)
  148. cli
  149. cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
  150. jnz restore_nocheck
  151. need_resched:
  152. movl TI_flags(%ebp), %ecx # need_resched set ?
  153. testb $_TIF_NEED_RESCHED, %cl
  154. jz restore_all
  155. testl $IF_MASK,EFLAGS(%esp) # interrupts off (exception path) ?
  156. jz restore_all
  157. call preempt_schedule_irq
  158. jmp need_resched
  159. #endif
  160. /* SYSENTER_RETURN points to after the "sysenter" instruction in
  161. the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
  162. # sysenter call handler stub
  163. ENTRY(sysenter_entry)
  164. movl TSS_sysenter_esp0(%esp),%esp
  165. sysenter_past_esp:
  166. sti
  167. pushl $(__USER_DS)
  168. pushl %ebp
  169. pushfl
  170. pushl $(__USER_CS)
  171. pushl $SYSENTER_RETURN
  172. /*
  173. * Load the potential sixth argument from user stack.
  174. * Careful about security.
  175. */
  176. cmpl $__PAGE_OFFSET-3,%ebp
  177. jae syscall_fault
  178. 1: movl (%ebp),%ebp
  179. .section __ex_table,"a"
  180. .align 4
  181. .long 1b,syscall_fault
  182. .previous
  183. pushl %eax
  184. SAVE_ALL
  185. GET_THREAD_INFO(%ebp)
  186. /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
  187. testw $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),TI_flags(%ebp)
  188. jnz syscall_trace_entry
  189. cmpl $(nr_syscalls), %eax
  190. jae syscall_badsys
  191. call *sys_call_table(,%eax,4)
  192. movl %eax,EAX(%esp)
  193. cli
  194. movl TI_flags(%ebp), %ecx
  195. testw $_TIF_ALLWORK_MASK, %cx
  196. jne syscall_exit_work
  197. /* if something modifies registers it must also disable sysexit */
  198. movl EIP(%esp), %edx
  199. movl OLDESP(%esp), %ecx
  200. xorl %ebp,%ebp
  201. sti
  202. sysexit
  203. # system call handler stub
  204. ENTRY(system_call)
  205. pushl %eax # save orig_eax
  206. SAVE_ALL
  207. GET_THREAD_INFO(%ebp)
  208. # system call tracing in operation
  209. /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
  210. testw $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),TI_flags(%ebp)
  211. jnz syscall_trace_entry
  212. cmpl $(nr_syscalls), %eax
  213. jae syscall_badsys
  214. syscall_call:
  215. call *sys_call_table(,%eax,4)
  216. movl %eax,EAX(%esp) # store the return value
  217. syscall_exit:
  218. cli # make sure we don't miss an interrupt
  219. # setting need_resched or sigpending
  220. # between sampling and the iret
  221. movl TI_flags(%ebp), %ecx
  222. testw $_TIF_ALLWORK_MASK, %cx # current->work
  223. jne syscall_exit_work
  224. restore_all:
  225. movl EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
  226. # Warning: OLDSS(%esp) contains the wrong/random values if we
  227. # are returning to the kernel.
  228. # See comments in process.c:copy_thread() for details.
  229. movb OLDSS(%esp), %ah
  230. movb CS(%esp), %al
  231. andl $(VM_MASK | (4 << 8) | 3), %eax
  232. cmpl $((4 << 8) | 3), %eax
  233. je ldt_ss # returning to user-space with LDT SS
  234. restore_nocheck:
  235. RESTORE_REGS
  236. addl $4, %esp
  237. 1: iret
  238. .section .fixup,"ax"
  239. iret_exc:
  240. sti
  241. movl $__USER_DS, %edx
  242. movl %edx, %ds
  243. movl %edx, %es
  244. movl $11,%eax
  245. call do_exit
  246. .previous
  247. .section __ex_table,"a"
  248. .align 4
  249. .long 1b,iret_exc
  250. .previous
  251. ldt_ss:
  252. larl OLDSS(%esp), %eax
  253. jnz restore_nocheck
  254. testl $0x00400000, %eax # returning to 32bit stack?
  255. jnz restore_nocheck # allright, normal return
  256. /* If returning to userspace with 16bit stack,
  257. * try to fix the higher word of ESP, as the CPU
  258. * won't restore it.
  259. * This is an "official" bug of all the x86-compatible
  260. * CPUs, which we can try to work around to make
  261. * dosemu and wine happy. */
  262. subl $8, %esp # reserve space for switch16 pointer
  263. cli
  264. movl %esp, %eax
  265. /* Set up the 16bit stack frame with switch32 pointer on top,
  266. * and a switch16 pointer on top of the current frame. */
  267. call setup_x86_bogus_stack
  268. RESTORE_REGS
  269. lss 20+4(%esp), %esp # switch to 16bit stack
  270. 1: iret
  271. .section __ex_table,"a"
  272. .align 4
  273. .long 1b,iret_exc
  274. .previous
  275. # perform work that needs to be done immediately before resumption
  276. ALIGN
  277. work_pending:
  278. testb $_TIF_NEED_RESCHED, %cl
  279. jz work_notifysig
  280. work_resched:
  281. call schedule
  282. cli # make sure we don't miss an interrupt
  283. # setting need_resched or sigpending
  284. # between sampling and the iret
  285. movl TI_flags(%ebp), %ecx
  286. andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
  287. # than syscall tracing?
  288. jz restore_all
  289. testb $_TIF_NEED_RESCHED, %cl
  290. jnz work_resched
  291. work_notifysig: # deal with pending signals and
  292. # notify-resume requests
  293. testl $VM_MASK, EFLAGS(%esp)
  294. movl %esp, %eax
  295. jne work_notifysig_v86 # returning to kernel-space or
  296. # vm86-space
  297. xorl %edx, %edx
  298. call do_notify_resume
  299. jmp restore_all
  300. ALIGN
  301. work_notifysig_v86:
  302. pushl %ecx # save ti_flags for do_notify_resume
  303. call save_v86_state # %eax contains pt_regs pointer
  304. popl %ecx
  305. movl %eax, %esp
  306. xorl %edx, %edx
  307. call do_notify_resume
  308. jmp restore_all
  309. # perform syscall exit tracing
  310. ALIGN
  311. syscall_trace_entry:
  312. movl $-ENOSYS,EAX(%esp)
  313. movl %esp, %eax
  314. xorl %edx,%edx
  315. call do_syscall_trace
  316. movl ORIG_EAX(%esp), %eax
  317. cmpl $(nr_syscalls), %eax
  318. jnae syscall_call
  319. jmp syscall_exit
  320. # perform syscall exit tracing
  321. ALIGN
  322. syscall_exit_work:
  323. testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
  324. jz work_pending
  325. sti # could let do_syscall_trace() call
  326. # schedule() instead
  327. movl %esp, %eax
  328. movl $1, %edx
  329. call do_syscall_trace
  330. jmp resume_userspace
  331. ALIGN
  332. syscall_fault:
  333. pushl %eax # save orig_eax
  334. SAVE_ALL
  335. GET_THREAD_INFO(%ebp)
  336. movl $-EFAULT,EAX(%esp)
  337. jmp resume_userspace
  338. ALIGN
  339. syscall_badsys:
  340. movl $-ENOSYS,EAX(%esp)
  341. jmp resume_userspace
  342. #define FIXUP_ESPFIX_STACK \
  343. movl %esp, %eax; \
  344. /* switch to 32bit stack using the pointer on top of 16bit stack */ \
  345. lss %ss:CPU_16BIT_STACK_SIZE-8, %esp; \
  346. /* copy data from 16bit stack to 32bit stack */ \
  347. call fixup_x86_bogus_stack; \
  348. /* put ESP to the proper location */ \
  349. movl %eax, %esp;
  350. #define UNWIND_ESPFIX_STACK \
  351. pushl %eax; \
  352. movl %ss, %eax; \
  353. /* see if on 16bit stack */ \
  354. cmpw $__ESPFIX_SS, %ax; \
  355. jne 28f; \
  356. movl $__KERNEL_DS, %edx; \
  357. movl %edx, %ds; \
  358. movl %edx, %es; \
  359. /* switch to 32bit stack */ \
  360. FIXUP_ESPFIX_STACK \
  361. 28: popl %eax;
  362. /*
  363. * Build the entry stubs and pointer table with
  364. * some assembler magic.
  365. */
  366. .data
  367. ENTRY(interrupt)
  368. .text
  369. vector=0
  370. ENTRY(irq_entries_start)
  371. .rept NR_IRQS
  372. ALIGN
  373. 1: pushl $vector-256
  374. jmp common_interrupt
  375. .data
  376. .long 1b
  377. .text
  378. vector=vector+1
  379. .endr
  380. ALIGN
  381. common_interrupt:
  382. SAVE_ALL
  383. movl %esp,%eax
  384. call do_IRQ
  385. jmp ret_from_intr
  386. #define BUILD_INTERRUPT(name, nr) \
  387. ENTRY(name) \
  388. pushl $nr-256; \
  389. SAVE_ALL \
  390. movl %esp,%eax; \
  391. call smp_/**/name; \
  392. jmp ret_from_intr;
  393. /* The include is where all of the SMP etc. interrupts come from */
  394. #include "entry_arch.h"
  395. ENTRY(divide_error)
  396. pushl $0 # no error code
  397. pushl $do_divide_error
  398. ALIGN
  399. error_code:
  400. pushl %ds
  401. pushl %eax
  402. xorl %eax, %eax
  403. pushl %ebp
  404. pushl %edi
  405. pushl %esi
  406. pushl %edx
  407. decl %eax # eax = -1
  408. pushl %ecx
  409. pushl %ebx
  410. cld
  411. pushl %es
  412. UNWIND_ESPFIX_STACK
  413. popl %ecx
  414. movl ES(%esp), %edi # get the function address
  415. movl ORIG_EAX(%esp), %edx # get the error code
  416. movl %eax, ORIG_EAX(%esp)
  417. movl %ecx, ES(%esp)
  418. movl $(__USER_DS), %ecx
  419. movl %ecx, %ds
  420. movl %ecx, %es
  421. movl %esp,%eax # pt_regs pointer
  422. call *%edi
  423. jmp ret_from_exception
  424. ENTRY(coprocessor_error)
  425. pushl $0
  426. pushl $do_coprocessor_error
  427. jmp error_code
  428. ENTRY(simd_coprocessor_error)
  429. pushl $0
  430. pushl $do_simd_coprocessor_error
  431. jmp error_code
  432. ENTRY(device_not_available)
  433. pushl $-1 # mark this as an int
  434. SAVE_ALL
  435. movl %cr0, %eax
  436. testl $0x4, %eax # EM (math emulation bit)
  437. jne device_not_available_emulate
  438. preempt_stop
  439. call math_state_restore
  440. jmp ret_from_exception
  441. device_not_available_emulate:
  442. pushl $0 # temporary storage for ORIG_EIP
  443. call math_emulate
  444. addl $4, %esp
  445. jmp ret_from_exception
  446. /*
  447. * Debug traps and NMI can happen at the one SYSENTER instruction
  448. * that sets up the real kernel stack. Check here, since we can't
  449. * allow the wrong stack to be used.
  450. *
  451. * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have
  452. * already pushed 3 words if it hits on the sysenter instruction:
  453. * eflags, cs and eip.
  454. *
  455. * We just load the right stack, and push the three (known) values
  456. * by hand onto the new stack - while updating the return eip past
  457. * the instruction that would have done it for sysenter.
  458. */
  459. #define FIX_STACK(offset, ok, label) \
  460. cmpw $__KERNEL_CS,4(%esp); \
  461. jne ok; \
  462. label: \
  463. movl TSS_sysenter_esp0+offset(%esp),%esp; \
  464. pushfl; \
  465. pushl $__KERNEL_CS; \
  466. pushl $sysenter_past_esp
  467. ENTRY(debug)
  468. cmpl $sysenter_entry,(%esp)
  469. jne debug_stack_correct
  470. FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
  471. debug_stack_correct:
  472. pushl $-1 # mark this as an int
  473. SAVE_ALL
  474. xorl %edx,%edx # error code 0
  475. movl %esp,%eax # pt_regs pointer
  476. call do_debug
  477. testl %eax,%eax
  478. jnz restore_all
  479. jmp ret_from_exception
  480. /*
  481. * NMI is doubly nasty. It can happen _while_ we're handling
  482. * a debug fault, and the debug fault hasn't yet been able to
  483. * clear up the stack. So we first check whether we got an
  484. * NMI on the sysenter entry path, but after that we need to
  485. * check whether we got an NMI on the debug path where the debug
  486. * fault happened on the sysenter path.
  487. */
  488. ENTRY(nmi)
  489. pushl %eax
  490. movl %ss, %eax
  491. cmpw $__ESPFIX_SS, %ax
  492. popl %eax
  493. je nmi_16bit_stack
  494. cmpl $sysenter_entry,(%esp)
  495. je nmi_stack_fixup
  496. pushl %eax
  497. movl %esp,%eax
  498. /* Do not access memory above the end of our stack page,
  499. * it might not exist.
  500. */
  501. andl $(THREAD_SIZE-1),%eax
  502. cmpl $(THREAD_SIZE-20),%eax
  503. popl %eax
  504. jae nmi_stack_correct
  505. cmpl $sysenter_entry,12(%esp)
  506. je nmi_debug_stack_check
  507. nmi_stack_correct:
  508. pushl %eax
  509. SAVE_ALL
  510. xorl %edx,%edx # zero error code
  511. movl %esp,%eax # pt_regs pointer
  512. call do_nmi
  513. jmp restore_all
  514. nmi_stack_fixup:
  515. FIX_STACK(12,nmi_stack_correct, 1)
  516. jmp nmi_stack_correct
  517. nmi_debug_stack_check:
  518. cmpw $__KERNEL_CS,16(%esp)
  519. jne nmi_stack_correct
  520. cmpl $debug - 1,(%esp)
  521. jle nmi_stack_correct
  522. cmpl $debug_esp_fix_insn,(%esp)
  523. jle nmi_debug_stack_fixup
  524. nmi_debug_stack_fixup:
  525. FIX_STACK(24,nmi_stack_correct, 1)
  526. jmp nmi_stack_correct
  527. nmi_16bit_stack:
  528. /* create the pointer to lss back */
  529. pushl %ss
  530. pushl %esp
  531. movzwl %sp, %esp
  532. addw $4, (%esp)
  533. /* copy the iret frame of 12 bytes */
  534. .rept 3
  535. pushl 16(%esp)
  536. .endr
  537. pushl %eax
  538. SAVE_ALL
  539. FIXUP_ESPFIX_STACK # %eax == %esp
  540. xorl %edx,%edx # zero error code
  541. call do_nmi
  542. RESTORE_REGS
  543. lss 12+4(%esp), %esp # back to 16bit stack
  544. 1: iret
  545. .section __ex_table,"a"
  546. .align 4
  547. .long 1b,iret_exc
  548. .previous
  549. ENTRY(int3)
  550. pushl $-1 # mark this as an int
  551. SAVE_ALL
  552. xorl %edx,%edx # zero error code
  553. movl %esp,%eax # pt_regs pointer
  554. call do_int3
  555. testl %eax,%eax
  556. jnz restore_all
  557. jmp ret_from_exception
  558. ENTRY(overflow)
  559. pushl $0
  560. pushl $do_overflow
  561. jmp error_code
  562. ENTRY(bounds)
  563. pushl $0
  564. pushl $do_bounds
  565. jmp error_code
  566. ENTRY(invalid_op)
  567. pushl $0
  568. pushl $do_invalid_op
  569. jmp error_code
  570. ENTRY(coprocessor_segment_overrun)
  571. pushl $0
  572. pushl $do_coprocessor_segment_overrun
  573. jmp error_code
  574. ENTRY(invalid_TSS)
  575. pushl $do_invalid_TSS
  576. jmp error_code
  577. ENTRY(segment_not_present)
  578. pushl $do_segment_not_present
  579. jmp error_code
  580. ENTRY(stack_segment)
  581. pushl $do_stack_segment
  582. jmp error_code
  583. ENTRY(general_protection)
  584. pushl $do_general_protection
  585. jmp error_code
  586. ENTRY(alignment_check)
  587. pushl $do_alignment_check
  588. jmp error_code
  589. ENTRY(page_fault)
  590. pushl $do_page_fault
  591. jmp error_code
  592. #ifdef CONFIG_X86_MCE
  593. ENTRY(machine_check)
  594. pushl $0
  595. pushl machine_check_vector
  596. jmp error_code
  597. #endif
  598. ENTRY(spurious_interrupt_bug)
  599. pushl $0
  600. pushl $do_spurious_interrupt_bug
  601. jmp error_code
  602. .data
  603. ENTRY(sys_call_table)
  604. .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
  605. .long sys_exit
  606. .long sys_fork
  607. .long sys_read
  608. .long sys_write
  609. .long sys_open /* 5 */
  610. .long sys_close
  611. .long sys_waitpid
  612. .long sys_creat
  613. .long sys_link
  614. .long sys_unlink /* 10 */
  615. .long sys_execve
  616. .long sys_chdir
  617. .long sys_time
  618. .long sys_mknod
  619. .long sys_chmod /* 15 */
  620. .long sys_lchown16
  621. .long sys_ni_syscall /* old break syscall holder */
  622. .long sys_stat
  623. .long sys_lseek
  624. .long sys_getpid /* 20 */
  625. .long sys_mount
  626. .long sys_oldumount
  627. .long sys_setuid16
  628. .long sys_getuid16
  629. .long sys_stime /* 25 */
  630. .long sys_ptrace
  631. .long sys_alarm
  632. .long sys_fstat
  633. .long sys_pause
  634. .long sys_utime /* 30 */
  635. .long sys_ni_syscall /* old stty syscall holder */
  636. .long sys_ni_syscall /* old gtty syscall holder */
  637. .long sys_access
  638. .long sys_nice
  639. .long sys_ni_syscall /* 35 - old ftime syscall holder */
  640. .long sys_sync
  641. .long sys_kill
  642. .long sys_rename
  643. .long sys_mkdir
  644. .long sys_rmdir /* 40 */
  645. .long sys_dup
  646. .long sys_pipe
  647. .long sys_times
  648. .long sys_ni_syscall /* old prof syscall holder */
  649. .long sys_brk /* 45 */
  650. .long sys_setgid16
  651. .long sys_getgid16
  652. .long sys_signal
  653. .long sys_geteuid16
  654. .long sys_getegid16 /* 50 */
  655. .long sys_acct
  656. .long sys_umount /* recycled never used phys() */
  657. .long sys_ni_syscall /* old lock syscall holder */
  658. .long sys_ioctl
  659. .long sys_fcntl /* 55 */
  660. .long sys_ni_syscall /* old mpx syscall holder */
  661. .long sys_setpgid
  662. .long sys_ni_syscall /* old ulimit syscall holder */
  663. .long sys_olduname
  664. .long sys_umask /* 60 */
  665. .long sys_chroot
  666. .long sys_ustat
  667. .long sys_dup2
  668. .long sys_getppid
  669. .long sys_getpgrp /* 65 */
  670. .long sys_setsid
  671. .long sys_sigaction
  672. .long sys_sgetmask
  673. .long sys_ssetmask
  674. .long sys_setreuid16 /* 70 */
  675. .long sys_setregid16
  676. .long sys_sigsuspend
  677. .long sys_sigpending
  678. .long sys_sethostname
  679. .long sys_setrlimit /* 75 */
  680. .long sys_old_getrlimit
  681. .long sys_getrusage
  682. .long sys_gettimeofday
  683. .long sys_settimeofday
  684. .long sys_getgroups16 /* 80 */
  685. .long sys_setgroups16
  686. .long old_select
  687. .long sys_symlink
  688. .long sys_lstat
  689. .long sys_readlink /* 85 */
  690. .long sys_uselib
  691. .long sys_swapon
  692. .long sys_reboot
  693. .long old_readdir
  694. .long old_mmap /* 90 */
  695. .long sys_munmap
  696. .long sys_truncate
  697. .long sys_ftruncate
  698. .long sys_fchmod
  699. .long sys_fchown16 /* 95 */
  700. .long sys_getpriority
  701. .long sys_setpriority
  702. .long sys_ni_syscall /* old profil syscall holder */
  703. .long sys_statfs
  704. .long sys_fstatfs /* 100 */
  705. .long sys_ioperm
  706. .long sys_socketcall
  707. .long sys_syslog
  708. .long sys_setitimer
  709. .long sys_getitimer /* 105 */
  710. .long sys_newstat
  711. .long sys_newlstat
  712. .long sys_newfstat
  713. .long sys_uname
  714. .long sys_iopl /* 110 */
  715. .long sys_vhangup
  716. .long sys_ni_syscall /* old "idle" system call */
  717. .long sys_vm86old
  718. .long sys_wait4
  719. .long sys_swapoff /* 115 */
  720. .long sys_sysinfo
  721. .long sys_ipc
  722. .long sys_fsync
  723. .long sys_sigreturn
  724. .long sys_clone /* 120 */
  725. .long sys_setdomainname
  726. .long sys_newuname
  727. .long sys_modify_ldt
  728. .long sys_adjtimex
  729. .long sys_mprotect /* 125 */
  730. .long sys_sigprocmask
  731. .long sys_ni_syscall /* old "create_module" */
  732. .long sys_init_module
  733. .long sys_delete_module
  734. .long sys_ni_syscall /* 130: old "get_kernel_syms" */
  735. .long sys_quotactl
  736. .long sys_getpgid
  737. .long sys_fchdir
  738. .long sys_bdflush
  739. .long sys_sysfs /* 135 */
  740. .long sys_personality
  741. .long sys_ni_syscall /* reserved for afs_syscall */
  742. .long sys_setfsuid16
  743. .long sys_setfsgid16
  744. .long sys_llseek /* 140 */
  745. .long sys_getdents
  746. .long sys_select
  747. .long sys_flock
  748. .long sys_msync
  749. .long sys_readv /* 145 */
  750. .long sys_writev
  751. .long sys_getsid
  752. .long sys_fdatasync
  753. .long sys_sysctl
  754. .long sys_mlock /* 150 */
  755. .long sys_munlock
  756. .long sys_mlockall
  757. .long sys_munlockall
  758. .long sys_sched_setparam
  759. .long sys_sched_getparam /* 155 */
  760. .long sys_sched_setscheduler
  761. .long sys_sched_getscheduler
  762. .long sys_sched_yield
  763. .long sys_sched_get_priority_max
  764. .long sys_sched_get_priority_min /* 160 */
  765. .long sys_sched_rr_get_interval
  766. .long sys_nanosleep
  767. .long sys_mremap
  768. .long sys_setresuid16
  769. .long sys_getresuid16 /* 165 */
  770. .long sys_vm86
  771. .long sys_ni_syscall /* Old sys_query_module */
  772. .long sys_poll
  773. .long sys_nfsservctl
  774. .long sys_setresgid16 /* 170 */
  775. .long sys_getresgid16
  776. .long sys_prctl
  777. .long sys_rt_sigreturn
  778. .long sys_rt_sigaction
  779. .long sys_rt_sigprocmask /* 175 */
  780. .long sys_rt_sigpending
  781. .long sys_rt_sigtimedwait
  782. .long sys_rt_sigqueueinfo
  783. .long sys_rt_sigsuspend
  784. .long sys_pread64 /* 180 */
  785. .long sys_pwrite64
  786. .long sys_chown16
  787. .long sys_getcwd
  788. .long sys_capget
  789. .long sys_capset /* 185 */
  790. .long sys_sigaltstack
  791. .long sys_sendfile
  792. .long sys_ni_syscall /* reserved for streams1 */
  793. .long sys_ni_syscall /* reserved for streams2 */
  794. .long sys_vfork /* 190 */
  795. .long sys_getrlimit
  796. .long sys_mmap2
  797. .long sys_truncate64
  798. .long sys_ftruncate64
  799. .long sys_stat64 /* 195 */
  800. .long sys_lstat64
  801. .long sys_fstat64
  802. .long sys_lchown
  803. .long sys_getuid
  804. .long sys_getgid /* 200 */
  805. .long sys_geteuid
  806. .long sys_getegid
  807. .long sys_setreuid
  808. .long sys_setregid
  809. .long sys_getgroups /* 205 */
  810. .long sys_setgroups
  811. .long sys_fchown
  812. .long sys_setresuid
  813. .long sys_getresuid
  814. .long sys_setresgid /* 210 */
  815. .long sys_getresgid
  816. .long sys_chown
  817. .long sys_setuid
  818. .long sys_setgid
  819. .long sys_setfsuid /* 215 */
  820. .long sys_setfsgid
  821. .long sys_pivot_root
  822. .long sys_mincore
  823. .long sys_madvise
  824. .long sys_getdents64 /* 220 */
  825. .long sys_fcntl64
  826. .long sys_ni_syscall /* reserved for TUX */
  827. .long sys_ni_syscall
  828. .long sys_gettid
  829. .long sys_readahead /* 225 */
  830. .long sys_setxattr
  831. .long sys_lsetxattr
  832. .long sys_fsetxattr
  833. .long sys_getxattr
  834. .long sys_lgetxattr /* 230 */
  835. .long sys_fgetxattr
  836. .long sys_listxattr
  837. .long sys_llistxattr
  838. .long sys_flistxattr
  839. .long sys_removexattr /* 235 */
  840. .long sys_lremovexattr
  841. .long sys_fremovexattr
  842. .long sys_tkill
  843. .long sys_sendfile64
  844. .long sys_futex /* 240 */
  845. .long sys_sched_setaffinity
  846. .long sys_sched_getaffinity
  847. .long sys_set_thread_area
  848. .long sys_get_thread_area
  849. .long sys_io_setup /* 245 */
  850. .long sys_io_destroy
  851. .long sys_io_getevents
  852. .long sys_io_submit
  853. .long sys_io_cancel
  854. .long sys_fadvise64 /* 250 */
  855. .long sys_ni_syscall
  856. .long sys_exit_group
  857. .long sys_lookup_dcookie
  858. .long sys_epoll_create
  859. .long sys_epoll_ctl /* 255 */
  860. .long sys_epoll_wait
  861. .long sys_remap_file_pages
  862. .long sys_set_tid_address
  863. .long sys_timer_create
  864. .long sys_timer_settime /* 260 */
  865. .long sys_timer_gettime
  866. .long sys_timer_getoverrun
  867. .long sys_timer_delete
  868. .long sys_clock_settime
  869. .long sys_clock_gettime /* 265 */
  870. .long sys_clock_getres
  871. .long sys_clock_nanosleep
  872. .long sys_statfs64
  873. .long sys_fstatfs64
  874. .long sys_tgkill /* 270 */
  875. .long sys_utimes
  876. .long sys_fadvise64_64
  877. .long sys_ni_syscall /* sys_vserver */
  878. .long sys_mbind
  879. .long sys_get_mempolicy
  880. .long sys_set_mempolicy
  881. .long sys_mq_open
  882. .long sys_mq_unlink
  883. .long sys_mq_timedsend
  884. .long sys_mq_timedreceive /* 280 */
  885. .long sys_mq_notify
  886. .long sys_mq_getsetattr
  887. .long sys_ni_syscall /* reserved for kexec */
  888. .long sys_waitid
  889. .long sys_ni_syscall /* 285 */ /* available */
  890. .long sys_add_key
  891. .long sys_request_key
  892. .long sys_keyctl
  893. syscall_table_size=(.-sys_call_table)