Back to home page

LXR

 
 

    


0001 /*
0002  *  Copyright (C) 2000-2003 Axis Communications AB
0003  *
0004  *  Authors:    Bjorn Wesen (bjornw@axis.com)
0005  *              Tobias Anderberg (tobiasa@axis.com), CRISv32 port.
0006  *
0007  * Code for the system-call and fault low-level handling routines.
0008  *
0009  * NOTE: This code handles signal-recognition, which happens every time
0010  * after a timer-interrupt and after each system call.
0011  *
0012  * Stack layout in 'ret_from_system_call':
0013  *  ptrace needs to have all regs on the stack.
0014  *  if the order here is changed, it needs to be
0015  *  updated in fork.c:copy_process, signal.c:do_signal,
0016  *  ptrace.c and ptrace.h
0017  *
0018  */
0019 
0020 #include <linux/linkage.h>
0021 #include <linux/sys.h>
0022 #include <asm/unistd.h>
0023 #include <asm/errno.h>
0024 #include <asm/thread_info.h>
0025 #include <asm/asm-offsets.h>
0026 
0027 #include <hwregs/asm/reg_map_asm.h>
0028 #include <hwregs/asm/intr_vect_defs_asm.h>
0029 
0030     ;; Exported functions.
0031     .globl system_call
0032     .globl ret_from_intr
0033     .globl ret_from_fork
0034     .globl ret_from_kernel_thread
0035     .globl resume
0036     .globl multiple_interrupt
0037     .globl nmi_interrupt
0038     .globl spurious_interrupt
0039     .globl do_sigtrap
0040     .globl gdb_handle_exception
0041     .globl sys_call_table
0042 
0043     ; Check if preemptive kernel scheduling should be done.
0044 #ifdef CONFIG_PREEMPT
0045 _resume_kernel:
0046     di
0047     ; Load current task struct.
0048     movs.w  -8192, $r0      ; THREAD_SIZE = 8192
0049     and.d   $sp, $r0
0050 
0051     addoq   +TI_preempt_count, $r0, $acr
0052     move.d  [$acr], $r10        ; Preemption disabled?
0053     bne _Rexit
0054     nop
0055 
0056 _need_resched:
0057     addoq   +TI_flags, $r0, $acr
0058     move.d  [$acr], $r10
0059     btstq   TIF_NEED_RESCHED, $r10  ; Check if need_resched is set.
0060     bpl _Rexit
0061     nop
0062 
0063     ; Do preemptive kernel scheduling.
0064     jsr preempt_schedule_irq
0065     nop
0066 
0067     ; Load new task struct.
0068     movs.w  -8192, $r0      ; THREAD_SIZE = 8192.
0069     and.d   $sp, $r0
0070 
0071     ; One more time with new task.
0072     ba  _need_resched
0073     nop
0074 #else
0075 #define _resume_kernel _Rexit
0076 #endif
0077 
0078     ; Called at exit from fork. schedule_tail must be called to drop
0079     ; spinlock if CONFIG_PREEMPT.
0080     .type   ret_from_fork,@function
0081 ret_from_fork:
0082     jsr schedule_tail
0083     nop
0084     ba  ret_from_sys_call
0085     nop
0086     .size   ret_from_fork, . - ret_from_fork
0087 
0088     .type   ret_from_kernel_thread,@function
0089 ret_from_kernel_thread:
0090     jsr schedule_tail
0091     nop
0092     move.d  $r2, $r10
0093     jsr $r1
0094     nop
0095     moveq   0, $r9          ; no syscall restarts, TYVM...
0096     ba  ret_from_sys_call
0097     nop
0098     .size   ret_from_kernel_thread, . - ret_from_kernel_thread
0099 
0100     .type   ret_from_intr,@function
0101 ret_from_intr:
0102     moveq   0, $r9          ; not a syscall
0103 
0104     ;; Check for resched if preemptive kernel, or if we're going back to
0105     ;; user-mode. This test matches the user_regs(regs) macro. Don't simply
0106     ;; test CCS since that doesn't necessarily reflect what mode we'll
0107     ;; return into.
0108     addoq   +PT_ccs, $sp, $acr
0109     move.d  [$acr], $r0
0110     btstq   16, $r0         ; User-mode flag.
0111     bpl _resume_kernel
0112     .size   ret_from_intr, . - ret_from_intr + 2    ; +2 includes the dslot.
0113 
0114     ; Note that di below is in delay slot.
0115     .type   _resume_userspace,@function
0116 _resume_userspace:
0117     di          ; So need_resched and sigpending don't change.
0118 
0119     movs.w  -8192, $r0      ; THREAD_SIZE == 8192
0120     and.d   $sp, $r0
0121 
0122     addoq   +TI_flags, $r0, $acr    ; current->work
0123     move.d  [$acr], $r10
0124     and.d   _TIF_WORK_MASK, $r10    ; Work to be done on return?
0125     bne _work_pending
0126     nop
0127     ba  _Rexit
0128     nop
0129     .size   _resume_userspace, . - _resume_userspace
0130 
0131     ;; The system_call is called by a BREAK instruction, which looks pretty
0132     ;; much like any other exception.
0133     ;;
0134     ;; System calls can't be made from interrupts but we still stack ERP
0135     ;; to have a complete stack frame.
0136     ;;
0137     ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,
0138     ;; r13,mof,srp
0139     ;;
0140     ;; This function looks on the _surface_ like spaghetti programming, but it's
0141     ;; really designed so that the fast-path does not force cache-loading of
0142     ;; non-used instructions. Only the non-common cases cause the outlined code
0143     ;; to run..
0144 
0145     .type   system_call,@function
0146 system_call:
0147     ;; Stack-frame similar to the irq heads, which is reversed in
0148     ;; ret_from_sys_call.
0149 
0150     sub.d   92, $sp     ; Skip EDA.
0151     movem   $r13, [$sp]
0152     move.d  $sp, $r8
0153     addq    14*4, $r8
0154     move.d  $acr, $r0
0155     move    $srs, $r1
0156     move    $mof, $r2
0157     move    $spc, $r3
0158     move    $ccs, $r4
0159     move    $srp, $r5
0160     move    $erp, $r6
0161     move.d  $r9, $r7    ; Store syscall number in EXS
0162     subq    4, $sp
0163     movem   $r7, [$r8]
0164     ei          ; Enable interrupts while processing syscalls.
0165     move.d  $r10, [$sp]
0166 
0167     ; Set S-bit when kernel debugging to keep hardware breakpoints active.
0168 #ifdef CONFIG_ETRAX_KGDB
0169     move $ccs, $r0
0170     or.d (1<<9), $r0
0171     move $r0, $ccs
0172 #endif
0173 
0174     movs.w  -ENOSYS, $r0
0175     addoq   +PT_r10, $sp, $acr
0176     move.d  $r0, [$acr]
0177 
0178     ;; Check if this process is syscall-traced.
0179     movs.w  -8192, $r0  ; THREAD_SIZE == 8192
0180     and.d   $sp, $r0
0181 
0182     addoq   +TI_flags, $r0, $acr
0183     move.d  [$acr], $r0
0184     btstq   TIF_SYSCALL_TRACE, $r0
0185     bmi _syscall_trace_entry
0186     nop
0187 
0188 _syscall_traced:
0189     ;; Check for sanity in the requested syscall number.
0190     cmpu.w  NR_syscalls, $r9
0191     bhs ret_from_sys_call
0192     lslq    2, $r9      ;  Multiply by 4, in the delay slot.
0193 
0194     ;; The location on the stack for the register structure is passed as a
0195     ;; seventh argument. Some system calls need this.
0196     move.d  $sp, $r0
0197     subq    4, $sp
0198     move.d  $r0, [$sp]
0199 
0200     ;; The registers carrying parameters (R10-R13) are intact. The optional
0201     ;; fifth and sixth parameters is in MOF and SRP respectively. Put them
0202     ;; back on the stack.
0203     subq    4, $sp
0204     move    $srp, [$sp]
0205     subq    4, $sp
0206     move    $mof, [$sp]
0207 
0208     ;; Actually to the system call.
0209     addo.d  +sys_call_table, $r9, $acr
0210     move.d  [$acr], $acr
0211     jsr $acr
0212     nop
0213 
0214     addq    3*4, $sp        ; Pop the mof, srp and regs parameters.
0215     addoq   +PT_r10, $sp, $acr
0216     move.d  $r10, [$acr]        ; Save the return value.
0217 
0218     moveq   1, $r9          ; "Parameter" to ret_from_sys_call to
0219                     ; show it was a sys call.
0220 
0221     ;; Fall through into ret_from_sys_call to return.
0222 
0223 ret_from_sys_call:
0224     ;; R9 is a parameter:
0225     ;;  >= 1 from syscall
0226     ;;     0 from irq
0227 
0228     ;; Get the current task-struct pointer.
0229     movs.w  -8192, $r0  ; THREAD_SIZE == 8192
0230     and.d   $sp, $r0
0231 
0232     di      ; Make sure need_resched and sigpending don't change.
0233 
0234     addoq   +TI_flags, $r0, $acr
0235     move.d  [$acr], $r1
0236     and.d   _TIF_ALLWORK_MASK, $r1
0237     bne _syscall_exit_work
0238     nop
0239     .size   system_call, . - system_call
0240 
0241     .type   _Rexit,@function
0242 _Rexit:
0243 #if defined(CONFIG_TRACE_IRQFLAGS)
0244     addoq   +PT_ccs, $sp, $acr
0245     move.d  [$acr], $r0
0246     btstq   15, $r0     ; I1
0247     bpl 1f
0248     nop
0249     jsr trace_hardirqs_on
0250     nop
0251 1:
0252 #endif
0253 
0254     ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h
0255     ;; and ptregs.h.
0256     addq    4, $sp      ; Skip orig_r10.
0257     movem   [$sp+], $r13    ; Registers R0-R13.
0258     move.d  [$sp+], $acr
0259     move    [$sp], $srs
0260     addq    4, $sp
0261     move    [$sp+], $mof
0262     move    [$sp+], $spc
0263     move    [$sp+], $ccs
0264     move    [$sp+], $srp
0265     move    [$sp+], $erp
0266     addq    8, $sp      ; Skip EXS, EDA.
0267     jump    $erp
0268     rfe         ; Restore condition code stack in delay-slot.
0269     .size   _Rexit, . - _Rexit
0270 
0271     ;; We get here after doing a syscall if extra work might need to be done
0272     ;; perform syscall exit tracing if needed.
0273 
0274     .type   _syscall_exit_work,@function
0275 _syscall_exit_work:
0276     ;; R0 contains current at this point and irq's are disabled.
0277 
0278     addoq   +TI_flags, $r0, $acr
0279     move.d  [$acr], $r1
0280     btstq   TIF_SYSCALL_TRACE, $r1
0281     bpl _work_pending
0282     nop
0283     ei
0284     move.d  $r9, $r1        ; Preserve R9.
0285     jsr do_syscall_trace
0286     nop
0287     move.d  $r1, $r9
0288     ba  _resume_userspace
0289     nop
0290     .size   _syscall_exit_work, . - _syscall_exit_work
0291 
0292     .type   _work_pending,@function
0293 _work_pending:
0294     addoq   +TI_flags, $r0, $acr
0295     move.d  [$acr], $r12        ; The thread_info_flags parameter.
0296     move.d  $sp, $r11       ; The regs param.
0297     jsr do_work_pending
0298     move.d  $r9, $r10       ; The syscall/irq param.
0299 
0300     ba _Rexit
0301     nop
0302     .size   _work_pending, . - _work_pending
0303 
0304     ;; We get here as a sidetrack when we've entered a syscall with the
0305     ;; trace-bit set. We need to call do_syscall_trace and then continue
0306     ;; with the call.
0307 
0308 _syscall_trace_entry:
0309     ;; PT_r10 in the frame contains -ENOSYS as required, at this point.
0310 
0311     jsr do_syscall_trace
0312     nop
0313 
0314     ;; Now re-enter the syscall code to do the syscall itself. We need to
0315     ;; restore R9 here to contain the wanted syscall, and the other
0316     ;; parameter-bearing registers.
0317     addoq   +PT_r9, $sp, $acr
0318     move.d  [$acr], $r9
0319     addoq   +PT_orig_r10, $sp, $acr
0320     move.d  [$acr], $r10        ; PT_r10 is already -ENOSYS.
0321     addoq   +PT_r11, $sp, $acr
0322     move.d  [$acr], $r11
0323     addoq   +PT_r12, $sp, $acr
0324     move.d  [$acr], $r12
0325     addoq   +PT_r13, $sp, $acr
0326     move.d  [$acr], $r13
0327     addoq   +PT_mof, $sp, $acr
0328     move    [$acr], $mof
0329     addoq   +PT_srp, $sp, $acr
0330     move    [$acr], $srp
0331 
0332     ba  _syscall_traced
0333     nop
0334 
0335     ;; Resume performs the actual task-switching, by switching stack
0336     ;; pointers. Input arguments are:
0337     ;;
0338     ;; R10 = prev
0339     ;; R11 = next
0340     ;; R12 = thread offset in task struct.
0341     ;;
0342     ;; Returns old current in R10.
0343 
0344     .type   resume,@function
0345 resume:
0346     subq    4, $sp          ; Make space for srp.
0347 
0348     add.d   $r12, $r10      ; R10 = current tasks tss.
0349     addoq   +THREAD_ccs, $r10, $acr
0350     move    $srp, [$sp]     ; Keep old/new PC on the stack.
0351     move    $ccs, [$acr]        ; Save IRQ enable state.
0352     di
0353 
0354     addoq   +THREAD_usp, $r10, $acr
0355     subq    10*4, $sp       ; Make room for R9.
0356     move    $usp, [$acr]        ; Save user-mode stackpointer.
0357 
0358     ;; See copy_thread for the reason why register R9 is saved.
0359     movem   $r9, [$sp]      ; Save non-scratch registers and R9.
0360 
0361     addoq   +THREAD_ksp, $r10, $acr
0362     move.d  $sp, $r10       ; Return last running task in R10.
0363     move.d  $sp, [$acr]     ; Save kernel SP for old task.
0364 
0365     and.d   -8192, $r10     ; Get thread_info from stackpointer.
0366     addoq   +TI_task, $r10, $acr
0367     add.d   $r12, $r11      ; Find the new tasks tss.
0368     move.d  [$acr], $r10        ; Get task.
0369     addoq   +THREAD_ksp, $r11, $acr
0370     move.d  [$acr], $sp     ; Switch to new stackframe.
0371     addoq   +THREAD_usp, $r11, $acr
0372     movem   [$sp+], $r9     ; Restore non-scratch registers and R9.
0373 
0374     move    [$acr], $usp        ; Restore user-mode stackpointer.
0375 
0376     addoq   +THREAD_ccs, $r11, $acr
0377     move.d  [$sp+], $r11
0378     jump    $r11            ; Restore PC.
0379     move    [$acr], $ccs        ; Restore IRQ enable status.
0380     .size   resume, . - resume
0381 
0382 nmi_interrupt:
0383 
0384 ;; If we receive a watchdog interrupt while it is not expected, then set
0385 ;; up a canonical frame and dump register contents before dying.
0386 
0387     ;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
0388     subq    12, $sp     ;  Skip EXS, EDA.
0389     move    $nrp, [$sp]
0390     subq    4, $sp
0391     move    $srp, [$sp]
0392     subq    4, $sp
0393     move    $ccs, [$sp]
0394     subq    4, $sp
0395     move    $spc, [$sp]
0396     subq    4, $sp
0397     move    $mof, [$sp]
0398     subq    4, $sp
0399     move    $srs, [$sp]
0400     subq    4, $sp
0401     move.d  $acr, [$sp]
0402     subq    14*4, $sp       ; Make room for R0-R13.
0403     movem   $r13, [$sp]     ; Push R0-R13.
0404     subq    4, $sp
0405     move.d  $r10, [$sp]     ; Push orig_r10.
0406     move.d  REG_ADDR(intr_vect, regi_irq, r_nmi), $r0
0407     move.d  [$r0], $r0
0408     btstq   REG_BIT(intr_vect, r_nmi, watchdog), $r0
0409     bpl     1f
0410     nop
0411     jsr handle_watchdog_bite    ; In time.c.
0412     move.d  $sp, $r10       ; Pointer to registers
0413 1:  btstq   REG_BIT(intr_vect, r_nmi, ext), $r0
0414     bpl     1f
0415     nop
0416     jsr handle_nmi
0417     move.d  $sp, $r10       ; Pointer to registers
0418 1:  addq    4, $sp          ; Skip orig_r10
0419     movem   [$sp+], $r13
0420     move.d  [$sp+], $acr
0421     move    [$sp], $srs
0422     addq    4, $sp
0423     move    [$sp+], $mof
0424     move    [$sp+], $spc
0425     move    [$sp+], $ccs
0426     move    [$sp+], $srp
0427     move    [$sp+], $nrp
0428     addq    8, $sp          ; Skip EXS, EDA.
0429     jump    $nrp
0430     rfn
0431 
0432     .comm   cause_of_death, 4   ;; Don't declare this anywhere.
0433 
0434 spurious_interrupt:
0435     di
0436     jump hard_reset_now
0437     nop
0438 
0439     ;; This handles the case when multiple interrupts arrive at the same
0440     ;; time. Jump to the first set interrupt bit in a priority fashion. The
0441     ;; hardware will call the unserved interrupts after the handler
0442     ;; finishes.
0443     .type   multiple_interrupt, @function
0444 multiple_interrupt:
0445     ;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
0446     subq    12, $sp     ; Skip EXS, EDA.
0447     move    $erp, [$sp]
0448     subq    4, $sp
0449     move    $srp, [$sp]
0450     subq    4, $sp
0451     move    $ccs, [$sp]
0452     subq    4, $sp
0453     move    $spc, [$sp]
0454     subq    4, $sp
0455     move    $mof, [$sp]
0456     subq    4, $sp
0457     move    $srs, [$sp]
0458     subq    4, $sp
0459     move.d  $acr, [$sp]
0460     subq    14*4, $sp   ; Make room for R0-R13.
0461     movem   $r13, [$sp] ; Push R0-R13.
0462     subq    4, $sp
0463     move.d  $r10, [$sp] ; Push orig_r10.
0464 
0465 ; Set S-bit when kernel debugging to keep hardware breakpoints active.
0466 #ifdef CONFIG_ETRAX_KGDB
0467     move $ccs, $r0
0468     or.d (1<<9), $r0
0469     move $r0, $ccs
0470 #endif
0471 
0472     jsr crisv32_do_multiple
0473     move.d  $sp, $r10
0474     jump    ret_from_intr
0475     nop
0476     .size   multiple_interrupt, . - multiple_interrupt
0477 
0478 do_sigtrap:
0479     ;; Sigtraps the process that executed the BREAK instruction. Creates a
0480     ;; frame that Rexit expects.
0481     subq    4, $sp
0482     move    $eda, [$sp]
0483     subq    4, $sp
0484     move    $exs, [$sp]
0485     subq    4, $sp
0486     move    $erp, [$sp]
0487     subq    4, $sp
0488     move    $srp, [$sp]
0489     subq    4, $sp
0490     move    $ccs, [$sp]
0491     subq    4, $sp
0492     move    $spc, [$sp]
0493     subq    4, $sp
0494     move    $mof, [$sp]
0495     subq    4, $sp
0496     move    $srs, [$sp]
0497     subq    4, $sp
0498     move.d  $acr, [$sp]
0499     di              ; Need to disable irq's at this point.
0500     subq    14*4, $sp       ; Make room for r0-r13.
0501     movem   $r13, [$sp]     ; Push the r0-r13 registers.
0502     subq    4, $sp
0503     move.d  $r10, [$sp]     ; Push orig_r10.
0504 
0505     movs.w  -8192, $r9      ; THREAD_SIZE == 8192
0506     and.d   $sp, $r9
0507 
0508     ;; thread_info as first parameter
0509     move.d  $r9, $r10
0510     moveq   5, $r11         ; SIGTRAP as second argument.
0511     jsr ugdb_trap_user
0512     nop
0513     jump    ret_from_intr       ; Use the return routine for interrupts.
0514     nop
0515 
0516 gdb_handle_exception:
0517     subq    4, $sp
0518     move.d  $r0, [$sp]
0519 #ifdef CONFIG_ETRAX_KGDB
0520     move    $ccs, $r0       ; U-flag not affected by previous insns.
0521     btstq   16, $r0         ; Test the U-flag.
0522     bmi _ugdb_handle_exception  ; Go to user mode debugging.
0523     nop             ; Empty delay-slot (cannot pop R0 here).
0524     ba  kgdb_handle_exception   ; Go to kernel debugging.
0525     move.d  [$sp+], $r0     ; Restore R0 in delay slot.
0526 #endif
0527 
0528 _ugdb_handle_exception:
0529     ba  do_sigtrap      ; SIGTRAP the offending process.
0530     move.d  [$sp+], $r0     ; Restore R0 in delay slot.
0531 
0532     .data
0533 
0534     .section .rodata,"a"
0535 sys_call_table:
0536     .long sys_restart_syscall   ; 0 - old "setup()" system call, used
0537                     ; for restarting.
0538     .long sys_exit
0539     .long sys_fork
0540     .long sys_read
0541     .long sys_write
0542     .long sys_open      /* 5 */
0543     .long sys_close
0544     .long sys_waitpid
0545     .long sys_creat
0546     .long sys_link
0547     .long sys_unlink    /* 10 */
0548     .long sys_execve
0549     .long sys_chdir
0550     .long sys_time
0551     .long sys_mknod
0552     .long sys_chmod     /* 15 */
0553     .long sys_lchown16
0554     .long sys_ni_syscall    /* old break syscall holder */
0555     .long sys_stat
0556     .long sys_lseek
0557     .long sys_getpid    /* 20 */
0558     .long sys_mount
0559     .long sys_oldumount
0560     .long sys_setuid16
0561     .long sys_getuid16
0562     .long sys_stime     /* 25 */
0563     .long sys_ptrace
0564     .long sys_alarm
0565     .long sys_fstat
0566     .long sys_pause
0567     .long sys_utime     /* 30 */
0568     .long sys_ni_syscall    /* old stty syscall holder */
0569     .long sys_ni_syscall    /* old gtty syscall holder */
0570     .long sys_access
0571     .long sys_nice
0572     .long sys_ni_syscall    /* 35  old ftime syscall holder */
0573     .long sys_sync
0574     .long sys_kill
0575     .long sys_rename
0576     .long sys_mkdir
0577     .long sys_rmdir     /* 40 */
0578     .long sys_dup
0579     .long sys_pipe
0580     .long sys_times
0581     .long sys_ni_syscall    /* old prof syscall holder */
0582     .long sys_brk       /* 45 */
0583     .long sys_setgid16
0584     .long sys_getgid16
0585     .long sys_signal
0586     .long sys_geteuid16
0587     .long sys_getegid16 /* 50 */
0588     .long sys_acct
0589     .long sys_umount    /* recycled never used phys( */
0590     .long sys_ni_syscall    /* old lock syscall holder */
0591     .long sys_ioctl
0592     .long sys_fcntl     /* 55 */
0593     .long sys_ni_syscall    /* old mpx syscall holder */
0594     .long sys_setpgid
0595     .long sys_ni_syscall    /* old ulimit syscall holder */
0596     .long sys_ni_syscall    /* old sys_olduname holder */
0597     .long sys_umask     /* 60 */
0598     .long sys_chroot
0599     .long sys_ustat
0600     .long sys_dup2
0601     .long sys_getppid
0602     .long sys_getpgrp   /* 65 */
0603     .long sys_setsid
0604     .long sys_sigaction
0605     .long sys_sgetmask
0606     .long sys_ssetmask
0607     .long sys_setreuid16    /* 70 */
0608     .long sys_setregid16
0609     .long sys_sigsuspend
0610     .long sys_sigpending
0611     .long sys_sethostname
0612     .long sys_setrlimit /* 75 */
0613     .long sys_old_getrlimit
0614     .long sys_getrusage
0615     .long sys_gettimeofday
0616     .long sys_settimeofday
0617     .long sys_getgroups16   /* 80 */
0618     .long sys_setgroups16
0619     .long sys_select    /* was old_select in Linux/E100 */
0620     .long sys_symlink
0621     .long sys_lstat
0622     .long sys_readlink  /* 85 */
0623     .long sys_uselib
0624     .long sys_swapon
0625     .long sys_reboot
0626     .long sys_old_readdir
0627     .long sys_old_mmap  /* 90 */
0628     .long sys_munmap
0629     .long sys_truncate
0630     .long sys_ftruncate
0631     .long sys_fchmod
0632     .long sys_fchown16  /* 95 */
0633     .long sys_getpriority
0634     .long sys_setpriority
0635     .long sys_ni_syscall    /* old profil syscall holder */
0636     .long sys_statfs
0637     .long sys_fstatfs   /* 100 */
0638     .long sys_ni_syscall    /* sys_ioperm in i386 */
0639     .long sys_socketcall
0640     .long sys_syslog
0641     .long sys_setitimer
0642     .long sys_getitimer /* 105 */
0643     .long sys_newstat
0644     .long sys_newlstat
0645     .long sys_newfstat
0646     .long sys_ni_syscall    /* old sys_uname holder */
0647     .long sys_ni_syscall    /* sys_iopl in i386 */
0648     .long sys_vhangup
0649     .long sys_ni_syscall    /* old "idle" system call */
0650     .long sys_ni_syscall    /* vm86old in i386 */
0651     .long sys_wait4
0652     .long sys_swapoff   /* 115 */
0653     .long sys_sysinfo
0654     .long sys_ipc
0655     .long sys_fsync
0656     .long sys_sigreturn
0657     .long sys_clone     /* 120 */
0658     .long sys_setdomainname
0659     .long sys_newuname
0660     .long sys_ni_syscall    /* sys_modify_ldt */
0661     .long sys_adjtimex
0662     .long sys_mprotect  /* 125 */
0663     .long sys_sigprocmask
0664     .long sys_ni_syscall    /* old "create_module" */
0665     .long sys_init_module
0666     .long sys_delete_module
0667     .long sys_ni_syscall    /* 130: old "get_kernel_syms" */
0668     .long sys_quotactl
0669     .long sys_getpgid
0670     .long sys_fchdir
0671     .long sys_bdflush
0672     .long sys_sysfs     /* 135 */
0673     .long sys_personality
0674     .long sys_ni_syscall    /* for afs_syscall */
0675     .long sys_setfsuid16
0676     .long sys_setfsgid16
0677     .long sys_llseek    /* 140 */
0678     .long sys_getdents
0679     .long sys_select
0680     .long sys_flock
0681     .long sys_msync
0682     .long sys_readv     /* 145 */
0683     .long sys_writev
0684     .long sys_getsid
0685     .long sys_fdatasync
0686     .long sys_sysctl
0687     .long sys_mlock     /* 150 */
0688     .long sys_munlock
0689     .long sys_mlockall
0690     .long sys_munlockall
0691     .long sys_sched_setparam
0692     .long sys_sched_getparam    /* 155 */
0693     .long sys_sched_setscheduler
0694     .long sys_sched_getscheduler
0695     .long sys_sched_yield
0696     .long sys_sched_get_priority_max
0697     .long sys_sched_get_priority_min    /* 160 */
0698     .long sys_sched_rr_get_interval
0699     .long sys_nanosleep
0700     .long sys_mremap
0701     .long sys_setresuid16
0702     .long sys_getresuid16   /* 165 */
0703     .long sys_ni_syscall    /* sys_vm86 */
0704     .long sys_ni_syscall    /* Old sys_query_module */
0705     .long sys_poll
0706     .long sys_ni_syscall    /* Old nfsservctl */
0707     .long sys_setresgid16   /* 170 */
0708     .long sys_getresgid16
0709     .long sys_prctl
0710     .long sys_rt_sigreturn
0711     .long sys_rt_sigaction
0712     .long sys_rt_sigprocmask    /* 175 */
0713     .long sys_rt_sigpending
0714     .long sys_rt_sigtimedwait
0715     .long sys_rt_sigqueueinfo
0716     .long sys_rt_sigsuspend
0717     .long sys_pread64   /* 180 */
0718     .long sys_pwrite64
0719     .long sys_chown16
0720     .long sys_getcwd
0721     .long sys_capget
0722     .long sys_capset    /* 185 */
0723     .long sys_sigaltstack
0724     .long sys_sendfile
0725     .long sys_ni_syscall    /* streams1 */
0726     .long sys_ni_syscall    /* streams2 */
0727     .long sys_vfork     /* 190 */
0728     .long sys_getrlimit
0729     .long sys_mmap2
0730     .long sys_truncate64
0731     .long sys_ftruncate64
0732     .long sys_stat64    /* 195 */
0733     .long sys_lstat64
0734     .long sys_fstat64
0735     .long sys_lchown
0736     .long sys_getuid
0737     .long sys_getgid    /* 200 */
0738     .long sys_geteuid
0739     .long sys_getegid
0740     .long sys_setreuid
0741     .long sys_setregid
0742     .long sys_getgroups /* 205 */
0743     .long sys_setgroups
0744     .long sys_fchown
0745     .long sys_setresuid
0746     .long sys_getresuid
0747     .long sys_setresgid /* 210 */
0748     .long sys_getresgid
0749     .long sys_chown
0750     .long sys_setuid
0751     .long sys_setgid
0752     .long sys_setfsuid  /* 215 */
0753     .long sys_setfsgid
0754     .long sys_pivot_root
0755     .long sys_mincore
0756     .long sys_madvise
0757     .long sys_getdents64    /* 220 */
0758     .long sys_fcntl64
0759     .long sys_ni_syscall    /* reserved for TUX */
0760     .long sys_ni_syscall
0761     .long sys_gettid
0762     .long sys_readahead /* 225 */
0763     .long sys_setxattr
0764     .long sys_lsetxattr
0765     .long sys_fsetxattr
0766     .long sys_getxattr
0767     .long sys_lgetxattr /* 230 */
0768     .long sys_fgetxattr
0769     .long sys_listxattr
0770     .long sys_llistxattr
0771     .long sys_flistxattr
0772     .long sys_removexattr   /* 235 */
0773     .long sys_lremovexattr
0774     .long sys_fremovexattr
0775     .long sys_tkill
0776     .long sys_sendfile64
0777     .long sys_futex     /* 240 */
0778     .long sys_sched_setaffinity
0779     .long sys_sched_getaffinity
0780     .long sys_ni_syscall    /* sys_set_thread_area */
0781     .long sys_ni_syscall    /* sys_get_thread_area */
0782     .long sys_io_setup  /* 245 */
0783     .long sys_io_destroy
0784     .long sys_io_getevents
0785     .long sys_io_submit
0786     .long sys_io_cancel
0787     .long sys_fadvise64 /* 250 */
0788     .long sys_ni_syscall
0789     .long sys_exit_group
0790     .long sys_lookup_dcookie
0791     .long sys_epoll_create
0792     .long sys_epoll_ctl /* 255 */
0793     .long sys_epoll_wait
0794     .long sys_remap_file_pages
0795     .long sys_set_tid_address
0796     .long sys_timer_create
0797     .long sys_timer_settime     /* 260 */
0798     .long sys_timer_gettime
0799     .long sys_timer_getoverrun
0800     .long sys_timer_delete
0801     .long sys_clock_settime
0802     .long sys_clock_gettime     /* 265 */
0803     .long sys_clock_getres
0804     .long sys_clock_nanosleep
0805     .long sys_statfs64
0806     .long sys_fstatfs64
0807     .long sys_tgkill    /* 270 */
0808     .long sys_utimes
0809     .long sys_fadvise64_64
0810     .long sys_ni_syscall    /* sys_vserver */
0811     .long sys_ni_syscall    /* sys_mbind */
0812     .long sys_ni_syscall    /* 275 sys_get_mempolicy */
0813     .long sys_ni_syscall    /* sys_set_mempolicy */
0814     .long sys_mq_open
0815     .long sys_mq_unlink
0816     .long sys_mq_timedsend
0817     .long sys_mq_timedreceive   /* 280 */
0818     .long sys_mq_notify
0819     .long sys_mq_getsetattr
0820     .long sys_ni_syscall        /* reserved for kexec */
0821     .long sys_waitid
0822     .long sys_ni_syscall        /* 285 */ /* available */
0823     .long sys_add_key
0824     .long sys_request_key
0825     .long sys_keyctl
0826     .long sys_ioprio_set
0827     .long sys_ioprio_get        /* 290 */
0828     .long sys_inotify_init
0829     .long sys_inotify_add_watch
0830     .long sys_inotify_rm_watch
0831     .long sys_migrate_pages
0832     .long sys_openat        /* 295 */
0833     .long sys_mkdirat
0834     .long sys_mknodat
0835     .long sys_fchownat
0836     .long sys_futimesat
0837     .long sys_fstatat64     /* 300 */
0838     .long sys_unlinkat
0839     .long sys_renameat
0840     .long sys_linkat
0841     .long sys_symlinkat
0842     .long sys_readlinkat        /* 305 */
0843     .long sys_fchmodat
0844     .long sys_faccessat
0845     .long sys_pselect6
0846     .long sys_ppoll
0847     .long sys_unshare       /* 310 */
0848     .long sys_set_robust_list
0849     .long sys_get_robust_list
0850     .long sys_splice
0851     .long sys_sync_file_range
0852     .long sys_tee           /* 315 */
0853     .long sys_vmsplice
0854     .long sys_move_pages
0855     .long sys_getcpu
0856     .long sys_epoll_pwait
0857     .long sys_utimensat     /* 320 */
0858     .long sys_signalfd
0859     .long sys_timerfd_create
0860     .long sys_eventfd
0861     .long sys_fallocate
0862     .long sys_timerfd_settime       /* 325 */
0863     .long sys_timerfd_gettime
0864     .long sys_signalfd4
0865     .long sys_eventfd2
0866     .long sys_epoll_create1
0867     .long sys_dup3          /* 330 */
0868     .long sys_pipe2
0869     .long sys_inotify_init1
0870     .long sys_preadv
0871     .long sys_pwritev
0872     .long sys_setns         /* 335 */
0873     .long sys_name_to_handle_at
0874     .long sys_open_by_handle_at
0875     .long sys_rt_tgsigqueueinfo
0876     .long sys_perf_event_open
0877     .long sys_recvmmsg      /* 340 */
0878     .long sys_accept4
0879     .long sys_fanotify_init
0880     .long sys_fanotify_mark
0881     .long sys_prlimit64
0882     .long sys_clock_adjtime     /* 345 */
0883     .long sys_syncfs
0884     .long sys_sendmmsg
0885     .long sys_process_vm_readv
0886     .long sys_process_vm_writev
0887     .long sys_kcmp          /* 350 */
0888     .long sys_finit_module
0889     .long sys_sched_setattr
0890     .long sys_sched_getattr
0891     .long sys_renameat2
0892     .long sys_seccomp       /* 355 */
0893     .long sys_getrandom
0894     .long sys_memfd_create
0895     .long sys_bpf
0896     .long sys_execveat
0897 
0898     /*
0899      * NOTE!! This doesn't have to be exact - we just have
0900      * to make sure we have _enough_ of the "sys_ni_syscall"
0901      * entries. Don't panic if you notice that this hasn't
0902      * been shrunk every time we add a new system call.
0903      */
0904 
0905     .rept NR_syscalls - (.-sys_call_table) / 4
0906         .long sys_ni_syscall
0907     .endr
0908