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