Merge branch 'x86/amd-nb' into x86/apic-cleanups
[pandora-kernel.git] / arch / mn10300 / kernel / entry.S
1 ###############################################################################
2 #
3 # MN10300 Exception and interrupt entry points
4 #
5 # Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
6 # Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
7 # Modified by David Howells (dhowells@redhat.com)
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public Licence
11 # as published by the Free Software Foundation; either version
12 # 2 of the Licence, or (at your option) any later version.
13 #
14 ###############################################################################
15 #include <linux/sys.h>
16 #include <linux/linkage.h>
17 #include <asm/smp.h>
18 #include <asm/system.h>
19 #include <asm/irqflags.h>
20 #include <asm/thread_info.h>
21 #include <asm/intctl-regs.h>
22 #include <asm/busctl-regs.h>
23 #include <asm/timer-regs.h>
24 #include <unit/leds.h>
25 #include <asm/page.h>
26 #include <asm/pgtable.h>
27 #include <asm/errno.h>
28 #include <asm/asm-offsets.h>
29 #include <asm/frame.inc>
30
31 #if defined(CONFIG_SMP) && defined(CONFIG_GDBSTUB)
32 #include <asm/gdb-stub.h>
33 #endif /* CONFIG_SMP && CONFIG_GDBSTUB */
34
35 #ifdef CONFIG_PREEMPT
36 #define preempt_stop            LOCAL_IRQ_DISABLE
37 #else
38 #define preempt_stop
39 #define resume_kernel           restore_all
40 #endif
41
42         .am33_2
43
44 ###############################################################################
45 #
46 # the return path for a forked child
47 # - on entry, D0 holds the address of the previous task to run
48 #
49 ###############################################################################
50 ENTRY(ret_from_fork)
51         call    schedule_tail[],0
52         GET_THREAD_INFO a2
53
54         # return 0 to indicate child process
55         clr     d0
56         mov     d0,(REG_D0,fp)
57         jmp     syscall_exit
58
59 ###############################################################################
60 #
61 # system call handler
62 #
63 ###############################################################################
64 ENTRY(system_call)
65         add     -4,sp
66         SAVE_ALL
67         mov     d0,(REG_ORIG_D0,fp)
68         GET_THREAD_INFO a2
69         cmp     nr_syscalls,d0
70         bcc     syscall_badsys
71         btst    _TIF_SYSCALL_TRACE,(TI_flags,a2)
72         bne     syscall_entry_trace
73 syscall_call:
74         add     d0,d0,a1
75         add     a1,a1
76         mov     (REG_A0,fp),d0
77         mov     (sys_call_table,a1),a0
78         calls   (a0)
79         mov     d0,(REG_D0,fp)
80 syscall_exit:
81         # make sure we don't miss an interrupt setting need_resched or
82         # sigpending between sampling and the rti
83         LOCAL_IRQ_DISABLE
84         mov     (TI_flags,a2),d2
85         btst    _TIF_ALLWORK_MASK,d2
86         bne     syscall_exit_work
87 restore_all:
88         RESTORE_ALL
89
90 ###############################################################################
91 #
92 # perform work that needs to be done immediately before resumption and syscall
93 # tracing
94 #
95 ###############################################################################
96         ALIGN
97 syscall_exit_work:
98         btst    _TIF_SYSCALL_TRACE,d2
99         beq     work_pending
100         LOCAL_IRQ_ENABLE                # could let syscall_trace_exit() call
101                                         # schedule() instead
102         mov     fp,d0
103         call    syscall_trace_exit[],0  # do_syscall_trace(regs)
104         jmp     resume_userspace
105
106         ALIGN
107 work_pending:
108         btst    _TIF_NEED_RESCHED,d2
109         beq     work_notifysig
110
111 work_resched:
112         call    schedule[],0
113
114         # make sure we don't miss an interrupt setting need_resched or
115         # sigpending between sampling and the rti
116         LOCAL_IRQ_DISABLE
117
118         # is there any work to be done other than syscall tracing?
119         mov     (TI_flags,a2),d2
120         btst    _TIF_WORK_MASK,d2
121         beq     restore_all
122         btst    _TIF_NEED_RESCHED,d2
123         bne     work_resched
124
125         # deal with pending signals and notify-resume requests
126 work_notifysig:
127         mov     fp,d0
128         mov     d2,d1
129         call    do_notify_resume[],0
130         jmp     resume_userspace
131
132         # perform syscall entry tracing
133 syscall_entry_trace:
134         mov     -ENOSYS,d0
135         mov     d0,(REG_D0,fp)
136         mov     fp,d0
137         call    syscall_trace_entry[],0 # returns the syscall number to actually use
138         mov     (REG_D1,fp),d1
139         cmp     nr_syscalls,d0
140         bcs     syscall_call
141         jmp     syscall_exit
142
143 syscall_badsys:
144         mov     -ENOSYS,d0
145         mov     d0,(REG_D0,fp)
146         jmp     resume_userspace
147
148         # userspace resumption stub bypassing syscall exit tracing
149         .globl  ret_from_exception, ret_from_intr
150         ALIGN
151 ret_from_exception:
152         preempt_stop
153 ret_from_intr:
154         GET_THREAD_INFO a2
155         mov     (REG_EPSW,fp),d0        # need to deliver signals before
156                                         # returning to userspace
157         and     EPSW_nSL,d0
158         beq     resume_kernel           # returning to supervisor mode
159
160 ENTRY(resume_userspace)
161         # make sure we don't miss an interrupt setting need_resched or
162         # sigpending between sampling and the rti
163         LOCAL_IRQ_DISABLE
164
165         # is there any work to be done on int/exception return?
166         mov     (TI_flags,a2),d2
167         btst    _TIF_WORK_MASK,d2
168         bne     work_pending
169         jmp     restore_all
170
171 #ifdef CONFIG_PREEMPT
172 ENTRY(resume_kernel)
173         LOCAL_IRQ_DISABLE
174         mov     (TI_preempt_count,a2),d0        # non-zero preempt_count ?
175         cmp     0,d0
176         bne     restore_all
177
178 need_resched:
179         btst    _TIF_NEED_RESCHED,(TI_flags,a2)
180         beq     restore_all
181         mov     (REG_EPSW,fp),d0
182         and     EPSW_IM,d0
183         cmp     EPSW_IM_7,d0            # interrupts off (exception path) ?
184         bne     restore_all
185         call    preempt_schedule_irq[],0
186         jmp     need_resched
187 #endif
188
189
190 ###############################################################################
191 #
192 # IRQ handler entry point
193 # - intended to be entered at multiple priorities
194 #
195 ###############################################################################
196 ENTRY(irq_handler)
197         add     -4,sp
198         SAVE_ALL
199
200         # it's not a syscall
201         mov     0xffffffff,d0
202         mov     d0,(REG_ORIG_D0,fp)
203
204         mov     fp,d0
205         call    do_IRQ[],0                      # do_IRQ(regs)
206
207         jmp     ret_from_intr
208
209 ###############################################################################
210 #
211 # Double Fault handler entry point
212 # - note that there will not be a stack, D0/A0 will hold EPSW/PC as were
213 #
214 ###############################################################################
215         .section .bss
216         .balign THREAD_SIZE
217         .space  THREAD_SIZE
218 __df_stack:
219         .previous
220
221 ENTRY(double_fault)
222         mov     a0,(__df_stack-4)       # PC as was
223         mov     d0,(__df_stack-8)       # EPSW as was
224         mn10300_set_dbfleds             # display 'db-f' on the LEDs
225         mov     0xaa55aa55,d0
226         mov     d0,(__df_stack-12)      # no ORIG_D0
227         mov     sp,a0                   # save corrupted SP
228         mov     __df_stack-12,sp        # emergency supervisor stack
229         SAVE_ALL
230         mov     a0,(REG_A0,fp)          # save corrupted SP as A0 (which got
231                                         # clobbered by the CPU)
232         mov     fp,d0
233         calls   do_double_fault
234 double_fault_loop:
235         bra     double_fault_loop
236
237 ###############################################################################
238 #
239 # Bus Error handler entry point
240 # - handle external (async) bus errors separately
241 #
242 ###############################################################################
243 ENTRY(raw_bus_error)
244         add     -4,sp
245         mov     d0,(sp)
246 #if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
247         mov     (MMUCTR),d0
248         mov     d0,(MMUCTR)
249 #endif
250         mov     (BCBERR),d0             # what
251         btst    BCBERR_BEMR_DMA,d0      # see if it was an external bus error
252         beq     __common_exception_aux  # it wasn't
253
254         SAVE_ALL
255         mov     (BCBEAR),d1             # destination of erroneous access
256
257         mov     (REG_ORIG_D0,fp),d2
258         mov     d2,(REG_D0,fp)
259         mov     -1,d2
260         mov     d2,(REG_ORIG_D0,fp)
261
262         add     -4,sp
263         mov     fp,(12,sp)              # frame pointer
264         call    io_bus_error[],0
265         jmp     restore_all
266
267 ###############################################################################
268 #
269 # Miscellaneous exception entry points
270 #
271 ###############################################################################
272 ENTRY(nmi_handler)
273         add     -4,sp
274         mov     d0,(sp)
275         mov     (TBR),d0
276
277 #ifdef CONFIG_SMP
278         add     -4,sp
279         mov     d0,(sp)                 # save d0(TBR)
280         movhu   (NMIAGR),d0
281         and     NMIAGR_GN,d0
282         lsr     0x2,d0
283         cmp     CALL_FUNCTION_NMI_IPI,d0
284         bne     5f                      # if not call function, jump
285
286         # function call nmi ipi
287         add     4,sp                    # no need to store TBR
288         mov     GxICR_DETECT,d0         # clear NMI request
289         movbu   d0,(GxICR(CALL_FUNCTION_NMI_IPI))
290         movhu   (GxICR(CALL_FUNCTION_NMI_IPI)),d0
291         and     ~EPSW_NMID,epsw         # enable NMI
292
293         mov     (sp),d0                 # restore d0
294         SAVE_ALL
295         call    smp_nmi_call_function_interrupt[],0
296         RESTORE_ALL
297
298 5:
299 #ifdef CONFIG_GDBSTUB
300         cmp     GDB_NMI_IPI,d0
301         bne     3f                      # if not gdb nmi ipi, jump
302
303         # gdb nmi ipi
304         add     4,sp                    # no need to store TBR
305         mov     GxICR_DETECT,d0         # clear NMI
306         movbu   d0,(GxICR(GDB_NMI_IPI))
307         movhu   (GxICR(GDB_NMI_IPI)),d0
308         and     ~EPSW_NMID,epsw         # enable NMI
309 #ifdef CONFIG_MN10300_CACHE_ENABLED
310         mov     (gdbstub_nmi_opr_type),d0
311         cmp     GDBSTUB_NMI_CACHE_PURGE,d0
312         bne     4f                      # if not gdb cache purge, jump
313
314         # gdb cache purge nmi ipi
315         add     -20,sp
316         mov     d1,(4,sp)
317         mov     a0,(8,sp)
318         mov     a1,(12,sp)
319         mov     mdr,d0
320         mov     d0,(16,sp)
321         call    gdbstub_local_purge_cache[],0
322         mov     0x1,d0
323         mov     (CPUID),d1
324         asl     d1,d0
325         mov     gdbstub_nmi_cpumask,a0
326         bclr    d0,(a0)
327         mov     (4,sp),d1
328         mov     (8,sp),a0
329         mov     (12,sp),a1
330         mov     (16,sp),d0
331         mov     d0,mdr
332         add     20,sp
333         mov     (sp),d0
334         add     4,sp
335         rti
336 4:
337 #endif /* CONFIG_MN10300_CACHE_ENABLED */
338         # gdb wait nmi ipi
339         mov     (sp),d0
340         SAVE_ALL
341         call    gdbstub_nmi_wait[],0
342         RESTORE_ALL
343 3:
344 #endif /* CONFIG_GDBSTUB */
345         mov     (sp),d0                 # restore TBR to d0
346         add     4,sp
347 #endif /* CONFIG_SMP */
348
349         bra     __common_exception_nonmi
350
351 ENTRY(__common_exception)
352         add     -4,sp
353         mov     d0,(sp)
354 #if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
355         mov     (MMUCTR),d0
356         mov     d0,(MMUCTR)
357 #endif
358
359 __common_exception_aux:
360         mov     (TBR),d0
361         and     ~EPSW_NMID,epsw         # turn NMIs back on if not NMI
362         or      EPSW_IE,epsw
363
364 __common_exception_nonmi:
365         and     0x0000FFFF,d0           # turn the exception code into a vector
366                                         # table index
367
368         btst    0x00000007,d0
369         bne     1f
370         cmp     0x00000400,d0
371         bge     1f
372
373         SAVE_ALL                        # build the stack frame
374
375         mov     (REG_D0,fp),a2          # get the exception number
376         mov     (REG_ORIG_D0,fp),d0
377         mov     d0,(REG_D0,fp)
378         mov     -1,d0
379         mov     d0,(REG_ORIG_D0,fp)
380
381 #ifdef CONFIG_GDBSTUB
382 #ifdef CONFIG_SMP
383         call    gdbstub_busy_check[],0
384         and     d0,d0                   # check return value
385         beq     2f
386 #else  /* CONFIG_SMP */
387         btst    0x01,(gdbstub_busy)
388         beq     2f
389 #endif /* CONFIG_SMP */
390         and     ~EPSW_IE,epsw
391         mov     fp,d0
392         mov     a2,d1
393         call    gdbstub_exception[],0   # gdbstub itself caused an exception
394         bra     restore_all
395 2:
396 #endif /* CONFIG_GDBSTUB */
397
398         mov     fp,d0                   # arg 0: stacked register file
399         mov     a2,d1                   # arg 1: exception number
400         lsr     1,a2
401
402         mov     (exception_table,a2),a2
403         calls   (a2)
404         jmp     ret_from_exception
405
406 1:      pi                              # BUG() equivalent
407
408 ###############################################################################
409 #
410 # Exception handler functions table
411 #
412 ###############################################################################
413         .data
414 ENTRY(exception_table)
415         .rept   0x400>>1
416          .long  uninitialised_exception
417         .endr
418         .previous
419
420 ###############################################################################
421 #
422 # Change an entry in the exception table
423 # - D0 exception code, D1 handler
424 #
425 ###############################################################################
426 ENTRY(set_excp_vector)
427         lsr     1,d0
428         add     exception_table,d0
429         mov     d1,(d0)
430         mov     4,d1
431         ret     [],0
432
433 ###############################################################################
434 #
435 # System call table
436 #
437 ###############################################################################
438         .data
439 ENTRY(sys_call_table)
440         .long sys_restart_syscall       /* 0 */
441         .long sys_exit
442         .long sys_fork
443         .long sys_read
444         .long sys_write
445         .long sys_open          /* 5 */
446         .long sys_close
447         .long sys_waitpid
448         .long sys_creat
449         .long sys_link
450         .long sys_unlink        /* 10 */
451         .long sys_execve
452         .long sys_chdir
453         .long sys_time
454         .long sys_mknod
455         .long sys_chmod         /* 15 */
456         .long sys_lchown16
457         .long sys_ni_syscall    /* old break syscall holder */
458         .long sys_stat
459         .long sys_lseek
460         .long sys_getpid        /* 20 */
461         .long sys_mount
462         .long sys_oldumount
463         .long sys_setuid16
464         .long sys_getuid16
465         .long sys_stime         /* 25 */
466         .long sys_ptrace
467         .long sys_alarm
468         .long sys_fstat
469         .long sys_pause
470         .long sys_utime         /* 30 */
471         .long sys_ni_syscall    /* old stty syscall holder */
472         .long sys_ni_syscall    /* old gtty syscall holder */
473         .long sys_access
474         .long sys_nice
475         .long sys_ni_syscall    /* 35 - old ftime syscall holder */
476         .long sys_sync
477         .long sys_kill
478         .long sys_rename
479         .long sys_mkdir
480         .long sys_rmdir         /* 40 */
481         .long sys_dup
482         .long sys_pipe
483         .long sys_times
484         .long sys_ni_syscall    /* old prof syscall holder */
485         .long sys_brk           /* 45 */
486         .long sys_setgid16
487         .long sys_getgid16
488         .long sys_signal
489         .long sys_geteuid16
490         .long sys_getegid16     /* 50 */
491         .long sys_acct
492         .long sys_umount        /* recycled never used phys() */
493         .long sys_ni_syscall    /* old lock syscall holder */
494         .long sys_ioctl
495         .long sys_fcntl         /* 55 */
496         .long sys_ni_syscall    /* old mpx syscall holder */
497         .long sys_setpgid
498         .long sys_ni_syscall    /* old ulimit syscall holder */
499         .long sys_ni_syscall    /* old sys_olduname */
500         .long sys_umask         /* 60 */
501         .long sys_chroot
502         .long sys_ustat
503         .long sys_dup2
504         .long sys_getppid
505         .long sys_getpgrp       /* 65 */
506         .long sys_setsid
507         .long sys_sigaction
508         .long sys_sgetmask
509         .long sys_ssetmask
510         .long sys_setreuid16    /* 70 */
511         .long sys_setregid16
512         .long sys_sigsuspend
513         .long sys_sigpending
514         .long sys_sethostname
515         .long sys_setrlimit     /* 75 */
516         .long sys_old_getrlimit
517         .long sys_getrusage
518         .long sys_gettimeofday
519         .long sys_settimeofday
520         .long sys_getgroups16   /* 80 */
521         .long sys_setgroups16
522         .long sys_old_select
523         .long sys_symlink
524         .long sys_lstat
525         .long sys_readlink      /* 85 */
526         .long sys_uselib
527         .long sys_swapon
528         .long sys_reboot
529         .long sys_old_readdir
530         .long old_mmap          /* 90 */
531         .long sys_munmap
532         .long sys_truncate
533         .long sys_ftruncate
534         .long sys_fchmod
535         .long sys_fchown16      /* 95 */
536         .long sys_getpriority
537         .long sys_setpriority
538         .long sys_ni_syscall    /* old profil syscall holder */
539         .long sys_statfs
540         .long sys_fstatfs       /* 100 */
541         .long sys_ni_syscall    /* ioperm */
542         .long sys_socketcall
543         .long sys_syslog
544         .long sys_setitimer
545         .long sys_getitimer     /* 105 */
546         .long sys_newstat
547         .long sys_newlstat
548         .long sys_newfstat
549         .long sys_ni_syscall    /* old sys_uname */
550         .long sys_ni_syscall    /* 110 - iopl */
551         .long sys_vhangup
552         .long sys_ni_syscall    /* old "idle" system call */
553         .long sys_ni_syscall    /* vm86old */
554         .long sys_wait4
555         .long sys_swapoff       /* 115 */
556         .long sys_sysinfo
557         .long sys_ipc
558         .long sys_fsync
559         .long sys_sigreturn
560         .long sys_clone         /* 120 */
561         .long sys_setdomainname
562         .long sys_newuname
563         .long sys_ni_syscall    /* modify_ldt */
564         .long sys_adjtimex
565         .long sys_mprotect      /* 125 */
566         .long sys_sigprocmask
567         .long sys_ni_syscall    /* old "create_module" */
568         .long sys_init_module
569         .long sys_delete_module
570         .long sys_ni_syscall    /* 130: old "get_kernel_syms" */
571         .long sys_quotactl
572         .long sys_getpgid
573         .long sys_fchdir
574         .long sys_bdflush
575         .long sys_sysfs         /* 135 */
576         .long sys_personality
577         .long sys_ni_syscall    /* reserved for afs_syscall */
578         .long sys_setfsuid16
579         .long sys_setfsgid16
580         .long sys_llseek        /* 140 */
581         .long sys_getdents
582         .long sys_select
583         .long sys_flock
584         .long sys_msync
585         .long sys_readv         /* 145 */
586         .long sys_writev
587         .long sys_getsid
588         .long sys_fdatasync
589         .long sys_sysctl
590         .long sys_mlock         /* 150 */
591         .long sys_munlock
592         .long sys_mlockall
593         .long sys_munlockall
594         .long sys_sched_setparam
595         .long sys_sched_getparam   /* 155 */
596         .long sys_sched_setscheduler
597         .long sys_sched_getscheduler
598         .long sys_sched_yield
599         .long sys_sched_get_priority_max
600         .long sys_sched_get_priority_min  /* 160 */
601         .long sys_sched_rr_get_interval
602         .long sys_nanosleep
603         .long sys_mremap
604         .long sys_setresuid16
605         .long sys_getresuid16   /* 165 */
606         .long sys_ni_syscall    /* vm86 */
607         .long sys_ni_syscall    /* Old sys_query_module */
608         .long sys_poll
609         .long sys_nfsservctl
610         .long sys_setresgid16   /* 170 */
611         .long sys_getresgid16
612         .long sys_prctl
613         .long sys_rt_sigreturn
614         .long sys_rt_sigaction
615         .long sys_rt_sigprocmask        /* 175 */
616         .long sys_rt_sigpending
617         .long sys_rt_sigtimedwait
618         .long sys_rt_sigqueueinfo
619         .long sys_rt_sigsuspend
620         .long sys_pread64       /* 180 */
621         .long sys_pwrite64
622         .long sys_chown16
623         .long sys_getcwd
624         .long sys_capget
625         .long sys_capset        /* 185 */
626         .long sys_sigaltstack
627         .long sys_sendfile
628         .long sys_ni_syscall    /* reserved for streams1 */
629         .long sys_ni_syscall    /* reserved for streams2 */
630         .long sys_vfork         /* 190 */
631         .long sys_getrlimit
632         .long sys_mmap_pgoff
633         .long sys_truncate64
634         .long sys_ftruncate64
635         .long sys_stat64        /* 195 */
636         .long sys_lstat64
637         .long sys_fstat64
638         .long sys_lchown
639         .long sys_getuid
640         .long sys_getgid        /* 200 */
641         .long sys_geteuid
642         .long sys_getegid
643         .long sys_setreuid
644         .long sys_setregid
645         .long sys_getgroups     /* 205 */
646         .long sys_setgroups
647         .long sys_fchown
648         .long sys_setresuid
649         .long sys_getresuid
650         .long sys_setresgid     /* 210 */
651         .long sys_getresgid
652         .long sys_chown
653         .long sys_setuid
654         .long sys_setgid
655         .long sys_setfsuid      /* 215 */
656         .long sys_setfsgid
657         .long sys_pivot_root
658         .long sys_mincore
659         .long sys_madvise
660         .long sys_getdents64    /* 220 */
661         .long sys_fcntl64
662         .long sys_ni_syscall    /* reserved for TUX */
663         .long sys_ni_syscall
664         .long sys_gettid
665         .long sys_readahead     /* 225 */
666         .long sys_setxattr
667         .long sys_lsetxattr
668         .long sys_fsetxattr
669         .long sys_getxattr
670         .long sys_lgetxattr     /* 230 */
671         .long sys_fgetxattr
672         .long sys_listxattr
673         .long sys_llistxattr
674         .long sys_flistxattr
675         .long sys_removexattr   /* 235 */
676         .long sys_lremovexattr
677         .long sys_fremovexattr
678         .long sys_tkill
679         .long sys_sendfile64
680         .long sys_futex         /* 240 */
681         .long sys_sched_setaffinity
682         .long sys_sched_getaffinity
683         .long sys_ni_syscall    /* sys_set_thread_area */
684         .long sys_ni_syscall    /* sys_get_thread_area */
685         .long sys_io_setup      /* 245 */
686         .long sys_io_destroy
687         .long sys_io_getevents
688         .long sys_io_submit
689         .long sys_io_cancel
690         .long sys_fadvise64     /* 250 */
691         .long sys_ni_syscall
692         .long sys_exit_group
693         .long sys_lookup_dcookie
694         .long sys_epoll_create
695         .long sys_epoll_ctl     /* 255 */
696         .long sys_epoll_wait
697         .long sys_remap_file_pages
698         .long sys_set_tid_address
699         .long sys_timer_create
700         .long sys_timer_settime         /* 260 */
701         .long sys_timer_gettime
702         .long sys_timer_getoverrun
703         .long sys_timer_delete
704         .long sys_clock_settime
705         .long sys_clock_gettime         /* 265 */
706         .long sys_clock_getres
707         .long sys_clock_nanosleep
708         .long sys_statfs64
709         .long sys_fstatfs64
710         .long sys_tgkill                /* 270 */
711         .long sys_utimes
712         .long sys_fadvise64_64
713         .long sys_ni_syscall    /* sys_vserver */
714         .long sys_mbind
715         .long sys_get_mempolicy         /* 275 */
716         .long sys_set_mempolicy
717         .long sys_mq_open
718         .long sys_mq_unlink
719         .long sys_mq_timedsend
720         .long sys_mq_timedreceive       /* 280 */
721         .long sys_mq_notify
722         .long sys_mq_getsetattr
723         .long sys_kexec_load
724         .long sys_waitid
725         .long sys_ni_syscall            /* 285 */ /* available */
726         .long sys_add_key
727         .long sys_request_key
728         .long sys_keyctl
729         .long sys_cacheflush
730         .long sys_ioprio_set            /* 290 */
731         .long sys_ioprio_get
732         .long sys_inotify_init
733         .long sys_inotify_add_watch
734         .long sys_inotify_rm_watch
735         .long sys_migrate_pages         /* 295 */
736         .long sys_openat
737         .long sys_mkdirat
738         .long sys_mknodat
739         .long sys_fchownat
740         .long sys_futimesat             /* 300 */
741         .long sys_fstatat64
742         .long sys_unlinkat
743         .long sys_renameat
744         .long sys_linkat
745         .long sys_symlinkat             /* 305 */
746         .long sys_readlinkat
747         .long sys_fchmodat
748         .long sys_faccessat
749         .long sys_pselect6
750         .long sys_ppoll                 /* 310 */
751         .long sys_unshare
752         .long sys_set_robust_list
753         .long sys_get_robust_list
754         .long sys_splice
755         .long sys_sync_file_range       /* 315 */
756         .long sys_tee
757         .long sys_vmsplice
758         .long sys_move_pages
759         .long sys_getcpu
760         .long sys_epoll_pwait           /* 320 */
761         .long sys_utimensat
762         .long sys_signalfd
763         .long sys_timerfd_create
764         .long sys_eventfd
765         .long sys_fallocate             /* 325 */
766         .long sys_timerfd_settime
767         .long sys_timerfd_gettime
768         .long sys_signalfd4
769         .long sys_eventfd2
770         .long sys_epoll_create1         /* 330 */
771         .long sys_dup3
772         .long sys_pipe2
773         .long sys_inotify_init1
774         .long sys_preadv
775         .long sys_pwritev               /* 335 */
776         .long sys_rt_tgsigqueueinfo
777         .long sys_perf_event_open
778         .long sys_recvmmsg
779
780
781 nr_syscalls=(.-sys_call_table)/4