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