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