entry.S 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  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. pushl $0 # no error code
  242. pushl $do_iret_error
  243. jmp error_code
  244. .previous
  245. .section __ex_table,"a"
  246. .align 4
  247. .long 1b,iret_exc
  248. .previous
  249. ldt_ss:
  250. larl OLDSS(%esp), %eax
  251. jnz restore_nocheck
  252. testl $0x00400000, %eax # returning to 32bit stack?
  253. jnz restore_nocheck # allright, normal return
  254. /* If returning to userspace with 16bit stack,
  255. * try to fix the higher word of ESP, as the CPU
  256. * won't restore it.
  257. * This is an "official" bug of all the x86-compatible
  258. * CPUs, which we can try to work around to make
  259. * dosemu and wine happy. */
  260. subl $8, %esp # reserve space for switch16 pointer
  261. cli
  262. movl %esp, %eax
  263. /* Set up the 16bit stack frame with switch32 pointer on top,
  264. * and a switch16 pointer on top of the current frame. */
  265. call setup_x86_bogus_stack
  266. RESTORE_REGS
  267. lss 20+4(%esp), %esp # switch to 16bit stack
  268. 1: iret
  269. .section __ex_table,"a"
  270. .align 4
  271. .long 1b,iret_exc
  272. .previous
  273. # perform work that needs to be done immediately before resumption
  274. ALIGN
  275. work_pending:
  276. testb $_TIF_NEED_RESCHED, %cl
  277. jz work_notifysig
  278. work_resched:
  279. call schedule
  280. cli # make sure we don't miss an interrupt
  281. # setting need_resched or sigpending
  282. # between sampling and the iret
  283. movl TI_flags(%ebp), %ecx
  284. andl $_TIF_WORK_MASK, %ecx # is there any work to be done other
  285. # than syscall tracing?
  286. jz restore_all
  287. testb $_TIF_NEED_RESCHED, %cl
  288. jnz work_resched
  289. work_notifysig: # deal with pending signals and
  290. # notify-resume requests
  291. testl $VM_MASK, EFLAGS(%esp)
  292. movl %esp, %eax
  293. jne work_notifysig_v86 # returning to kernel-space or
  294. # vm86-space
  295. xorl %edx, %edx
  296. call do_notify_resume
  297. jmp restore_all
  298. ALIGN
  299. work_notifysig_v86:
  300. pushl %ecx # save ti_flags for do_notify_resume
  301. call save_v86_state # %eax contains pt_regs pointer
  302. popl %ecx
  303. movl %eax, %esp
  304. xorl %edx, %edx
  305. call do_notify_resume
  306. jmp restore_all
  307. # perform syscall exit tracing
  308. ALIGN
  309. syscall_trace_entry:
  310. movl $-ENOSYS,EAX(%esp)
  311. movl %esp, %eax
  312. xorl %edx,%edx
  313. call do_syscall_trace
  314. movl ORIG_EAX(%esp), %eax
  315. cmpl $(nr_syscalls), %eax
  316. jnae syscall_call
  317. jmp syscall_exit
  318. # perform syscall exit tracing
  319. ALIGN
  320. syscall_exit_work:
  321. testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
  322. jz work_pending
  323. sti # could let do_syscall_trace() call
  324. # schedule() instead
  325. movl %esp, %eax
  326. movl $1, %edx
  327. call do_syscall_trace
  328. jmp resume_userspace
  329. ALIGN
  330. syscall_fault:
  331. pushl %eax # save orig_eax
  332. SAVE_ALL
  333. GET_THREAD_INFO(%ebp)
  334. movl $-EFAULT,EAX(%esp)
  335. jmp resume_userspace
  336. ALIGN
  337. syscall_badsys:
  338. movl $-ENOSYS,EAX(%esp)
  339. jmp resume_userspace
  340. #define FIXUP_ESPFIX_STACK \
  341. movl %esp, %eax; \
  342. /* switch to 32bit stack using the pointer on top of 16bit stack */ \
  343. lss %ss:CPU_16BIT_STACK_SIZE-8, %esp; \
  344. /* copy data from 16bit stack to 32bit stack */ \
  345. call fixup_x86_bogus_stack; \
  346. /* put ESP to the proper location */ \
  347. movl %eax, %esp;
  348. #define UNWIND_ESPFIX_STACK \
  349. pushl %eax; \
  350. movl %ss, %eax; \
  351. /* see if on 16bit stack */ \
  352. cmpw $__ESPFIX_SS, %ax; \
  353. jne 28f; \
  354. movl $__KERNEL_DS, %edx; \
  355. movl %edx, %ds; \
  356. movl %edx, %es; \
  357. /* switch to 32bit stack */ \
  358. FIXUP_ESPFIX_STACK \
  359. 28: popl %eax;
  360. /*
  361. * Build the entry stubs and pointer table with
  362. * some assembler magic.
  363. */
  364. .data
  365. ENTRY(interrupt)
  366. .text
  367. vector=0
  368. ENTRY(irq_entries_start)
  369. .rept NR_IRQS
  370. ALIGN
  371. 1: pushl $vector-256
  372. jmp common_interrupt
  373. .data
  374. .long 1b
  375. .text
  376. vector=vector+1
  377. .endr
  378. ALIGN
  379. common_interrupt:
  380. SAVE_ALL
  381. movl %esp,%eax
  382. call do_IRQ
  383. jmp ret_from_intr
  384. #define BUILD_INTERRUPT(name, nr) \
  385. ENTRY(name) \
  386. pushl $nr-256; \
  387. SAVE_ALL \
  388. movl %esp,%eax; \
  389. call smp_/**/name; \
  390. jmp ret_from_intr;
  391. /* The include is where all of the SMP etc. interrupts come from */
  392. #include "entry_arch.h"
  393. ENTRY(divide_error)
  394. pushl $0 # no error code
  395. pushl $do_divide_error
  396. ALIGN
  397. error_code:
  398. pushl %ds
  399. pushl %eax
  400. xorl %eax, %eax
  401. pushl %ebp
  402. pushl %edi
  403. pushl %esi
  404. pushl %edx
  405. decl %eax # eax = -1
  406. pushl %ecx
  407. pushl %ebx
  408. cld
  409. pushl %es
  410. UNWIND_ESPFIX_STACK
  411. popl %ecx
  412. movl ES(%esp), %edi # get the function address
  413. movl ORIG_EAX(%esp), %edx # get the error code
  414. movl %eax, ORIG_EAX(%esp)
  415. movl %ecx, ES(%esp)
  416. movl $(__USER_DS), %ecx
  417. movl %ecx, %ds
  418. movl %ecx, %es
  419. movl %esp,%eax # pt_regs pointer
  420. call *%edi
  421. jmp ret_from_exception
  422. ENTRY(coprocessor_error)
  423. pushl $0
  424. pushl $do_coprocessor_error
  425. jmp error_code
  426. ENTRY(simd_coprocessor_error)
  427. pushl $0
  428. pushl $do_simd_coprocessor_error
  429. jmp error_code
  430. ENTRY(device_not_available)
  431. pushl $-1 # mark this as an int
  432. SAVE_ALL
  433. movl %cr0, %eax
  434. testl $0x4, %eax # EM (math emulation bit)
  435. jne device_not_available_emulate
  436. preempt_stop
  437. call math_state_restore
  438. jmp ret_from_exception
  439. device_not_available_emulate:
  440. pushl $0 # temporary storage for ORIG_EIP
  441. call math_emulate
  442. addl $4, %esp
  443. jmp ret_from_exception
  444. /*
  445. * Debug traps and NMI can happen at the one SYSENTER instruction
  446. * that sets up the real kernel stack. Check here, since we can't
  447. * allow the wrong stack to be used.
  448. *
  449. * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have
  450. * already pushed 3 words if it hits on the sysenter instruction:
  451. * eflags, cs and eip.
  452. *
  453. * We just load the right stack, and push the three (known) values
  454. * by hand onto the new stack - while updating the return eip past
  455. * the instruction that would have done it for sysenter.
  456. */
  457. #define FIX_STACK(offset, ok, label) \
  458. cmpw $__KERNEL_CS,4(%esp); \
  459. jne ok; \
  460. label: \
  461. movl TSS_sysenter_esp0+offset(%esp),%esp; \
  462. pushfl; \
  463. pushl $__KERNEL_CS; \
  464. pushl $sysenter_past_esp
  465. ENTRY(debug)
  466. cmpl $sysenter_entry,(%esp)
  467. jne debug_stack_correct
  468. FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
  469. debug_stack_correct:
  470. pushl $-1 # mark this as an int
  471. SAVE_ALL
  472. xorl %edx,%edx # error code 0
  473. movl %esp,%eax # pt_regs pointer
  474. call do_debug
  475. jmp ret_from_exception
  476. /*
  477. * NMI is doubly nasty. It can happen _while_ we're handling
  478. * a debug fault, and the debug fault hasn't yet been able to
  479. * clear up the stack. So we first check whether we got an
  480. * NMI on the sysenter entry path, but after that we need to
  481. * check whether we got an NMI on the debug path where the debug
  482. * fault happened on the sysenter path.
  483. */
  484. ENTRY(nmi)
  485. pushl %eax
  486. movl %ss, %eax
  487. cmpw $__ESPFIX_SS, %ax
  488. popl %eax
  489. je nmi_16bit_stack
  490. cmpl $sysenter_entry,(%esp)
  491. je nmi_stack_fixup
  492. pushl %eax
  493. movl %esp,%eax
  494. /* Do not access memory above the end of our stack page,
  495. * it might not exist.
  496. */
  497. andl $(THREAD_SIZE-1),%eax
  498. cmpl $(THREAD_SIZE-20),%eax
  499. popl %eax
  500. jae nmi_stack_correct
  501. cmpl $sysenter_entry,12(%esp)
  502. je nmi_debug_stack_check
  503. nmi_stack_correct:
  504. pushl %eax
  505. SAVE_ALL
  506. xorl %edx,%edx # zero error code
  507. movl %esp,%eax # pt_regs pointer
  508. call do_nmi
  509. jmp restore_all
  510. nmi_stack_fixup:
  511. FIX_STACK(12,nmi_stack_correct, 1)
  512. jmp nmi_stack_correct
  513. nmi_debug_stack_check:
  514. cmpw $__KERNEL_CS,16(%esp)
  515. jne nmi_stack_correct
  516. cmpl $debug - 1,(%esp)
  517. jle nmi_stack_correct
  518. cmpl $debug_esp_fix_insn,(%esp)
  519. jle nmi_debug_stack_fixup
  520. nmi_debug_stack_fixup:
  521. FIX_STACK(24,nmi_stack_correct, 1)
  522. jmp nmi_stack_correct
  523. nmi_16bit_stack:
  524. /* create the pointer to lss back */
  525. pushl %ss
  526. pushl %esp
  527. movzwl %sp, %esp
  528. addw $4, (%esp)
  529. /* copy the iret frame of 12 bytes */
  530. .rept 3
  531. pushl 16(%esp)
  532. .endr
  533. pushl %eax
  534. SAVE_ALL
  535. FIXUP_ESPFIX_STACK # %eax == %esp
  536. xorl %edx,%edx # zero error code
  537. call do_nmi
  538. RESTORE_REGS
  539. lss 12+4(%esp), %esp # back to 16bit stack
  540. 1: iret
  541. .section __ex_table,"a"
  542. .align 4
  543. .long 1b,iret_exc
  544. .previous
  545. ENTRY(int3)
  546. pushl $-1 # mark this as an int
  547. SAVE_ALL
  548. xorl %edx,%edx # zero error code
  549. movl %esp,%eax # pt_regs pointer
  550. call do_int3
  551. jmp ret_from_exception
  552. ENTRY(overflow)
  553. pushl $0
  554. pushl $do_overflow
  555. jmp error_code
  556. ENTRY(bounds)
  557. pushl $0
  558. pushl $do_bounds
  559. jmp error_code
  560. ENTRY(invalid_op)
  561. pushl $0
  562. pushl $do_invalid_op
  563. jmp error_code
  564. ENTRY(coprocessor_segment_overrun)
  565. pushl $0
  566. pushl $do_coprocessor_segment_overrun
  567. jmp error_code
  568. ENTRY(invalid_TSS)
  569. pushl $do_invalid_TSS
  570. jmp error_code
  571. ENTRY(segment_not_present)
  572. pushl $do_segment_not_present
  573. jmp error_code
  574. ENTRY(stack_segment)
  575. pushl $do_stack_segment
  576. jmp error_code
  577. ENTRY(general_protection)
  578. pushl $do_general_protection
  579. jmp error_code
  580. ENTRY(alignment_check)
  581. pushl $do_alignment_check
  582. jmp error_code
  583. ENTRY(page_fault)
  584. pushl $do_page_fault
  585. jmp error_code
  586. #ifdef CONFIG_X86_MCE
  587. ENTRY(machine_check)
  588. pushl $0
  589. pushl machine_check_vector
  590. jmp error_code
  591. #endif
  592. ENTRY(spurious_interrupt_bug)
  593. pushl $0
  594. pushl $do_spurious_interrupt_bug
  595. jmp error_code
  596. .data
  597. ENTRY(sys_call_table)
  598. .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
  599. .long sys_exit
  600. .long sys_fork
  601. .long sys_read
  602. .long sys_write
  603. .long sys_open /* 5 */
  604. .long sys_close
  605. .long sys_waitpid
  606. .long sys_creat
  607. .long sys_link
  608. .long sys_unlink /* 10 */
  609. .long sys_execve
  610. .long sys_chdir
  611. .long sys_time
  612. .long sys_mknod
  613. .long sys_chmod /* 15 */
  614. .long sys_lchown16
  615. .long sys_ni_syscall /* old break syscall holder */
  616. .long sys_stat
  617. .long sys_lseek
  618. .long sys_getpid /* 20 */
  619. .long sys_mount
  620. .long sys_oldumount
  621. .long sys_setuid16
  622. .long sys_getuid16
  623. .long sys_stime /* 25 */
  624. .long sys_ptrace
  625. .long sys_alarm
  626. .long sys_fstat
  627. .long sys_pause
  628. .long sys_utime /* 30 */
  629. .long sys_ni_syscall /* old stty syscall holder */
  630. .long sys_ni_syscall /* old gtty syscall holder */
  631. .long sys_access
  632. .long sys_nice
  633. .long sys_ni_syscall /* 35 - old ftime syscall holder */
  634. .long sys_sync
  635. .long sys_kill
  636. .long sys_rename
  637. .long sys_mkdir
  638. .long sys_rmdir /* 40 */
  639. .long sys_dup
  640. .long sys_pipe
  641. .long sys_times
  642. .long sys_ni_syscall /* old prof syscall holder */
  643. .long sys_brk /* 45 */
  644. .long sys_setgid16
  645. .long sys_getgid16
  646. .long sys_signal
  647. .long sys_geteuid16
  648. .long sys_getegid16 /* 50 */
  649. .long sys_acct
  650. .long sys_umount /* recycled never used phys() */
  651. .long sys_ni_syscall /* old lock syscall holder */
  652. .long sys_ioctl
  653. .long sys_fcntl /* 55 */
  654. .long sys_ni_syscall /* old mpx syscall holder */
  655. .long sys_setpgid
  656. .long sys_ni_syscall /* old ulimit syscall holder */
  657. .long sys_olduname
  658. .long sys_umask /* 60 */
  659. .long sys_chroot
  660. .long sys_ustat
  661. .long sys_dup2
  662. .long sys_getppid
  663. .long sys_getpgrp /* 65 */
  664. .long sys_setsid
  665. .long sys_sigaction
  666. .long sys_sgetmask
  667. .long sys_ssetmask
  668. .long sys_setreuid16 /* 70 */
  669. .long sys_setregid16
  670. .long sys_sigsuspend
  671. .long sys_sigpending
  672. .long sys_sethostname
  673. .long sys_setrlimit /* 75 */
  674. .long sys_old_getrlimit
  675. .long sys_getrusage
  676. .long sys_gettimeofday
  677. .long sys_settimeofday
  678. .long sys_getgroups16 /* 80 */
  679. .long sys_setgroups16
  680. .long old_select
  681. .long sys_symlink
  682. .long sys_lstat
  683. .long sys_readlink /* 85 */
  684. .long sys_uselib
  685. .long sys_swapon
  686. .long sys_reboot
  687. .long old_readdir
  688. .long old_mmap /* 90 */
  689. .long sys_munmap
  690. .long sys_truncate
  691. .long sys_ftruncate
  692. .long sys_fchmod
  693. .long sys_fchown16 /* 95 */
  694. .long sys_getpriority
  695. .long sys_setpriority
  696. .long sys_ni_syscall /* old profil syscall holder */
  697. .long sys_statfs
  698. .long sys_fstatfs /* 100 */
  699. .long sys_ioperm
  700. .long sys_socketcall
  701. .long sys_syslog
  702. .long sys_setitimer
  703. .long sys_getitimer /* 105 */
  704. .long sys_newstat
  705. .long sys_newlstat
  706. .long sys_newfstat
  707. .long sys_uname
  708. .long sys_iopl /* 110 */
  709. .long sys_vhangup
  710. .long sys_ni_syscall /* old "idle" system call */
  711. .long sys_vm86old
  712. .long sys_wait4
  713. .long sys_swapoff /* 115 */
  714. .long sys_sysinfo
  715. .long sys_ipc
  716. .long sys_fsync
  717. .long sys_sigreturn
  718. .long sys_clone /* 120 */
  719. .long sys_setdomainname
  720. .long sys_newuname
  721. .long sys_modify_ldt
  722. .long sys_adjtimex
  723. .long sys_mprotect /* 125 */
  724. .long sys_sigprocmask
  725. .long sys_ni_syscall /* old "create_module" */
  726. .long sys_init_module
  727. .long sys_delete_module
  728. .long sys_ni_syscall /* 130: old "get_kernel_syms" */
  729. .long sys_quotactl
  730. .long sys_getpgid
  731. .long sys_fchdir
  732. .long sys_bdflush
  733. .long sys_sysfs /* 135 */
  734. .long sys_personality
  735. .long sys_ni_syscall /* reserved for afs_syscall */
  736. .long sys_setfsuid16
  737. .long sys_setfsgid16
  738. .long sys_llseek /* 140 */
  739. .long sys_getdents
  740. .long sys_select
  741. .long sys_flock
  742. .long sys_msync
  743. .long sys_readv /* 145 */
  744. .long sys_writev
  745. .long sys_getsid
  746. .long sys_fdatasync
  747. .long sys_sysctl
  748. .long sys_mlock /* 150 */
  749. .long sys_munlock
  750. .long sys_mlockall
  751. .long sys_munlockall
  752. .long sys_sched_setparam
  753. .long sys_sched_getparam /* 155 */
  754. .long sys_sched_setscheduler
  755. .long sys_sched_getscheduler
  756. .long sys_sched_yield
  757. .long sys_sched_get_priority_max
  758. .long sys_sched_get_priority_min /* 160 */
  759. .long sys_sched_rr_get_interval
  760. .long sys_nanosleep
  761. .long sys_mremap
  762. .long sys_setresuid16
  763. .long sys_getresuid16 /* 165 */
  764. .long sys_vm86
  765. .long sys_ni_syscall /* Old sys_query_module */
  766. .long sys_poll
  767. .long sys_nfsservctl
  768. .long sys_setresgid16 /* 170 */
  769. .long sys_getresgid16
  770. .long sys_prctl
  771. .long sys_rt_sigreturn
  772. .long sys_rt_sigaction
  773. .long sys_rt_sigprocmask /* 175 */
  774. .long sys_rt_sigpending
  775. .long sys_rt_sigtimedwait
  776. .long sys_rt_sigqueueinfo
  777. .long sys_rt_sigsuspend
  778. .long sys_pread64 /* 180 */
  779. .long sys_pwrite64
  780. .long sys_chown16
  781. .long sys_getcwd
  782. .long sys_capget
  783. .long sys_capset /* 185 */
  784. .long sys_sigaltstack
  785. .long sys_sendfile
  786. .long sys_ni_syscall /* reserved for streams1 */
  787. .long sys_ni_syscall /* reserved for streams2 */
  788. .long sys_vfork /* 190 */
  789. .long sys_getrlimit
  790. .long sys_mmap2
  791. .long sys_truncate64
  792. .long sys_ftruncate64
  793. .long sys_stat64 /* 195 */
  794. .long sys_lstat64
  795. .long sys_fstat64
  796. .long sys_lchown
  797. .long sys_getuid
  798. .long sys_getgid /* 200 */
  799. .long sys_geteuid
  800. .long sys_getegid
  801. .long sys_setreuid
  802. .long sys_setregid
  803. .long sys_getgroups /* 205 */
  804. .long sys_setgroups
  805. .long sys_fchown
  806. .long sys_setresuid
  807. .long sys_getresuid
  808. .long sys_setresgid /* 210 */
  809. .long sys_getresgid
  810. .long sys_chown
  811. .long sys_setuid
  812. .long sys_setgid
  813. .long sys_setfsuid /* 215 */
  814. .long sys_setfsgid
  815. .long sys_pivot_root
  816. .long sys_mincore
  817. .long sys_madvise
  818. .long sys_getdents64 /* 220 */
  819. .long sys_fcntl64
  820. .long sys_ni_syscall /* reserved for TUX */
  821. .long sys_ni_syscall
  822. .long sys_gettid
  823. .long sys_readahead /* 225 */
  824. .long sys_setxattr
  825. .long sys_lsetxattr
  826. .long sys_fsetxattr
  827. .long sys_getxattr
  828. .long sys_lgetxattr /* 230 */
  829. .long sys_fgetxattr
  830. .long sys_listxattr
  831. .long sys_llistxattr
  832. .long sys_flistxattr
  833. .long sys_removexattr /* 235 */
  834. .long sys_lremovexattr
  835. .long sys_fremovexattr
  836. .long sys_tkill
  837. .long sys_sendfile64
  838. .long sys_futex /* 240 */
  839. .long sys_sched_setaffinity
  840. .long sys_sched_getaffinity
  841. .long sys_set_thread_area
  842. .long sys_get_thread_area
  843. .long sys_io_setup /* 245 */
  844. .long sys_io_destroy
  845. .long sys_io_getevents
  846. .long sys_io_submit
  847. .long sys_io_cancel
  848. .long sys_fadvise64 /* 250 */
  849. .long sys_ni_syscall
  850. .long sys_exit_group
  851. .long sys_lookup_dcookie
  852. .long sys_epoll_create
  853. .long sys_epoll_ctl /* 255 */
  854. .long sys_epoll_wait
  855. .long sys_remap_file_pages
  856. .long sys_set_tid_address
  857. .long sys_timer_create
  858. .long sys_timer_settime /* 260 */
  859. .long sys_timer_gettime
  860. .long sys_timer_getoverrun
  861. .long sys_timer_delete
  862. .long sys_clock_settime
  863. .long sys_clock_gettime /* 265 */
  864. .long sys_clock_getres
  865. .long sys_clock_nanosleep
  866. .long sys_statfs64
  867. .long sys_fstatfs64
  868. .long sys_tgkill /* 270 */
  869. .long sys_utimes
  870. .long sys_fadvise64_64
  871. .long sys_ni_syscall /* sys_vserver */
  872. .long sys_mbind
  873. .long sys_get_mempolicy
  874. .long sys_set_mempolicy
  875. .long sys_mq_open
  876. .long sys_mq_unlink
  877. .long sys_mq_timedsend
  878. .long sys_mq_timedreceive /* 280 */
  879. .long sys_mq_notify
  880. .long sys_mq_getsetattr
  881. .long sys_ni_syscall /* reserved for kexec */
  882. .long sys_waitid
  883. .long sys_ni_syscall /* 285 */ /* available */
  884. .long sys_add_key
  885. .long sys_request_key
  886. .long sys_keyctl
  887. syscall_table_size=(.-sys_call_table)