2 * File: arch/blackfin/mach-common/entry.S
4 * Author: Linus Torvalds
7 * Description: contains the system-call and fault low-level handling routines.
8 * This also contains the timer-interrupt handler, as well as all
9 * interrupts and faults that can result in a task-switch.
12 * Copyright 2004-2006 Analog Devices Inc.
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see the file COPYING, or write
28 * to the Free Software Foundation, Inc.,
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 * 25-Dec-2004 - LG Soft India
34 * 1. Fix in return_from_int, to make sure any pending
35 * system call in ILAT for this process to get
36 * executed, otherwise in case context switch happens,
37 * system call of first process (i.e in ILAT) will be
38 * carried forward to the switched process.
39 * 2. Removed Constant references for the following
46 * NOTE: This code handles signal-recognition, which happens every time
47 * after a timer-interrupt and after each system call.
51 #include <linux/linkage.h>
52 #include <linux/unistd.h>
53 #include <asm/blackfin.h>
54 #include <asm/errno.h>
55 #include <asm/thread_info.h> /* TIF_NEED_RESCHED */
56 #include <asm/asm-offsets.h>
57 #include <asm/trace.h>
59 #include <asm/mach-common/context.S>
61 #if defined(CONFIG_BFIN_SCRATCH_REG_RETN)
62 # define EX_SCRATCH_REG RETN
63 #elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)
64 # define EX_SCRATCH_REG RETE
66 # define EX_SCRATCH_REG CYCLES
69 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
75 /* Slightly simplified and streamlined entry point for CPLB misses.
76 * This one does not lower the level to IRQ5, and thus can be used to
77 * patch up CPLB misses on the kernel stack.
82 * Work around an anomaly: if we see a new DCPLB fault, return
83 * without doing anything. Then, if we get the same fault again,
86 p5.l = _last_cplb_fault_retx;
87 p5.h = _last_cplb_fault_retx;
92 if !cc jump _return_from_exception;
102 DEBUG_START_HWTRACE(p5, r7)
109 DEBUG_START_HWTRACE(p5, r7)
110 (R7:6,P5:4) = [sp++];
112 raise 15; /* invoked by TRAP #0, for sys call */
124 ENTRY(_ex_single_step)
128 if cc jump _return_from_exception
137 if !cc jump _ex_trap_c;
140 r6.h = _exception_to_level5;
141 r6.l = _exception_to_level5;
144 if !cc jump _ex_trap_c;
146 ENTRY(_return_from_exception)
147 DEBUG_START_HWTRACE(p5, r7)
154 (R7:6,P5:4) = [sp++];
160 ENTRY(_handle_bad_cplb)
161 /* To get here, we just tried and failed to change a CPLB
162 * so, handle things in trap_c (C code), by lowering to
163 * IRQ5, just like we normally do. Since this is not a
164 * "normal" return path, we have a do alot of stuff to
165 * the stack to get ready so, we can fall through - we
166 * need to make a CPLB exception look like a normal exception
169 DEBUG_START_HWTRACE(p5, r7)
172 [--sp] = (R7:6, P5:4);
174 ENTRY(_ex_replaceable)
178 /* Call C code (trap_c) to handle the exception, which most
179 * likely involves sending a signal to the current process.
180 * To avoid double faults, lower our priority to IRQ5 first.
182 P5.h = _exception_to_level5;
183 P5.l = _exception_to_level5;
189 /* Disable all interrupts, but make sure level 5 is enabled so
190 * we can switch to that level. Save the old mask. */
192 p4.l = _excpt_saved_imask;
193 p4.h = _excpt_saved_imask;
198 /* Save the excause into a circular buffer, in case the instruction
199 * which caused this excecptions causes others.
201 P5.l = _in_ptr_excause;
202 P5.h = _in_ptr_excause;
208 R6.l = _excause_circ_buf;
209 R6.h = _excause_circ_buf;
215 DEBUG_START_HWTRACE(p5, r7)
216 (R7:6,P5:4) = [sp++];
223 ENTRY(_exception_to_level5)
226 /* Restore interrupt mask. We haven't pushed RETI, so this
227 * doesn't enable interrupts until we return from this handler. */
228 p4.l = _excpt_saved_imask;
229 p4.h = _excpt_saved_imask;
233 /* Restore the hardware error vector. */
244 r0 = [p2]; /* Read current IPEND */
245 [sp + PT_IPEND] = r0; /* Store IPEND */
247 /* Pop the excause from the circular buffer and push it on the stack
248 * (in the right place - if you change the location of SEQSTAT, you
249 * must change this offset.
252 P5.l = _out_ptr_excause;
253 P5.h = _out_ptr_excause;
259 R6.l = _excause_circ_buf;
260 R6.h = _excause_circ_buf;
266 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
271 /* See if anything else is in the exception buffer
272 * if there is, process it
274 P5.l = _out_ptr_excause;
275 P5.h = _out_ptr_excause;
276 P4.l = _in_ptr_excause;
277 P4.h = _in_ptr_excause;
281 if ! CC JUMP .L_excep_to_5_again
283 call _ret_from_exception;
286 ENDPROC(_exception_to_level5)
288 ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
289 /* Since the kernel stack can be anywhere, it's not guaranteed to be
290 * covered by a CPLB. Switch to an exception stack; use RETN as a
291 * scratch register (for want of a better option).
294 sp.l = _exception_stack_top;
295 sp.h = _exception_stack_top;
296 /* Try to deal with syscalls quickly. */
298 [--sp] = (R7:6, P5:4);
299 DEBUG_STOP_HWTRACE(p5, r7)
300 r7 = SEQSTAT; /* reason code is in bit 5:0 */
301 r6.l = lo(SEQSTAT_EXCAUSE);
302 r6.h = hi(SEQSTAT_EXCAUSE);
312 r7 = -ENOSYS; /* signextending enough */
313 [sp + PT_R0] = r7; /* return value from system call */
314 jump .Lsyscall_really_exit;
317 ENTRY(_kernel_execve)
320 r3 = SIZEOF_PTREGS / 4;
335 /* Success. Copy our temporary pt_regs to the top of the kernel
336 * stack and do a normal exception return.
339 r0 = (-KERNEL_STACK_SIZE) (x);
343 r0 = KERNEL_STACK_SIZE - 4 (z);
349 r3 = SIZEOF_PTREGS / 4;
355 if ! cc jump 0b (bp);
357 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
362 [SP + PT_SYSCFG] = r0;
363 [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
370 ENDPROC(_kernel_execve)
378 [sp + PT_IPEND] = r0;
380 /* Store RETS for now */
382 [sp + PT_RESERVED] = r0;
383 /* Set the stack for the current process */
385 r6.l = lo(ALIGN_PAGE_MASK);
386 r6.h = hi(ALIGN_PAGE_MASK);
387 r7 = r7 & r6; /* thread_info */
391 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
393 /* Check the System Call */
395 /* System call number is passed in P0 */
398 if ! cc jump .Lbadsys;
400 /* are we tracing syscalls?*/
402 r6.l = lo(ALIGN_PAGE_MASK);
403 r6.h = hi(ALIGN_PAGE_MASK);
407 CC = BITTST(r7,TIF_SYSCALL_TRACE);
408 if CC JUMP _sys_trace;
410 /* Execute the appropriate system call */
413 p5.l = _sys_call_table;
414 p5.h = _sys_call_table;
431 r4.l = lo(ALIGN_PAGE_MASK);
432 r4.h = hi(ALIGN_PAGE_MASK);
433 r7 = r7 & r4; /* thread_info->flags */
435 .Lresume_userspace_1:
436 /* Disable interrupts. */
440 r7 = [p5 + TI_FLAGS];
441 r4.l = lo(_TIF_WORK_MASK);
442 r4.h = hi(_TIF_WORK_MASK);
446 cc = BITTST(r7, TIF_NEED_RESCHED);
447 if !cc jump .Lsyscall_sigpending;
449 /* Reenable interrupts. */
457 jump .Lresume_userspace_1;
459 .Lsyscall_sigpending:
460 cc = BITTST(r7, TIF_RESTORE_SIGMASK);
461 if cc jump .Lsyscall_do_signals;
462 cc = BITTST(r7, TIF_SIGPENDING);
463 if !cc jump .Lsyscall_really_exit;
464 .Lsyscall_do_signals:
465 /* Reenable interrupts. */
474 .Lsyscall_really_exit:
475 r5 = [sp + PT_RESERVED];
478 ENDPROC(_system_call)
483 /* Execute the appropriate system call */
486 p5.l = _sys_call_table;
487 p5.h = _sys_call_table;
506 jump .Lresume_userspace;
511 * Beware - when entering resume, prev (the current task) is
512 * in r0, next (the new task) is in r1.
518 [--sp] = (r7:4, p5:3);
522 [p0+(TASK_THREAD+THREAD_USP)] = p2;
524 /* save current kernel stack pointer */
525 [p0+(TASK_THREAD+THREAD_KSP)] = sp;
527 /* save program counter */
528 r1.l = _new_old_task;
529 r1.h = _new_old_task;
530 [p0+(TASK_THREAD+THREAD_PC)] = r1;
532 /* restore the kernel stack pointer */
533 sp = [p1+(TASK_THREAD+THREAD_KSP)];
535 /* restore user stack pointer */
536 p0 = [p1+(TASK_THREAD+THREAD_USP)];
540 p0 = [p1+(TASK_THREAD+THREAD_PC)];
544 * Following code actually lands up in a new (old) task.
548 (r7:4, p5:3) = [sp++];
553 * When we come out of resume, r0 carries "old" task, becuase we are
559 ENTRY(_ret_from_exception)
565 [sp + PT_IPEND] = r0;
573 if !cc jump 4f; /* if not return to user mode, get out */
575 /* Make sure any pending system call or deferred exception
576 * return in ILAT for this process to get executed, otherwise
577 * in case context switch happens, system call of
578 * first process (i.e in ILAT) will be carried
579 * forward to the switched process
585 r1 = (EVT_IVG14 | EVT_IVG15) (z);
590 /* Set the stack for the current process */
592 r4.l = lo(ALIGN_PAGE_MASK);
593 r4.h = hi(ALIGN_PAGE_MASK);
594 r7 = r7 & r4; /* thread_info->flags */
596 r7 = [p5 + TI_FLAGS];
597 r4.l = lo(_TIF_WORK_MASK);
598 r4.h = hi(_TIF_WORK_MASK);
605 p1.l = _schedule_and_signal;
606 p1.h = _schedule_and_signal;
609 raise 15; /* raise evt14 to do signal or reschedule */
616 ENDPROC(_ret_from_exception)
618 ENTRY(_return_from_int)
619 /* If someone else already raised IRQ 15, do nothing. */
624 cc = bittst (r0, EVT_IVG15_P);
627 /* if not return to user mode, get out */
641 /* Lower the interrupt level to 15. */
644 p1.l = _schedule_and_signal_from_int;
645 p1.h = _schedule_and_signal_from_int;
649 r0.l = lo(CONFIG_BOOT_LOAD);
650 r0.h = hi(CONFIG_BOOT_LOAD);
655 raise 15; /* raise evt15 to do signal or reschedule */
659 ENDPROC(_return_from_int)
661 ENTRY(_lower_to_irq14)
663 r0.l = lo(CONFIG_BOOT_LOAD);
664 r0.h = hi(CONFIG_BOOT_LOAD);
671 ENTRY(_evt14_softirq)
672 #ifdef CONFIG_DEBUG_HWERR
682 _schedule_and_signal_from_int:
683 /* To end up here, vector 15 was changed - so we have to change it
688 p1.l = _evt_system_call;
689 p1.h = _evt_system_call;
693 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
695 [sp + PT_ORIG_P0] = r0;
698 [sp + PT_RESERVED] = p1;
707 call _finish_atomic_sections;
709 jump.s .Lresume_userspace;
711 _schedule_and_signal:
713 /* To end up here, vector 15 was changed - so we have to change it
718 p1.l = _evt_system_call;
719 p1.h = _evt_system_call;
724 [sp + PT_RESERVED] = P0;
725 call .Lresume_userspace;
729 ENDPROC(_lower_to_irq14)
731 /* Make sure when we start, that the circular buffer is initialized properly
732 * R0 and P0 are call clobbered, so we can use them here.
734 ENTRY(_init_exception_buff)
736 p0.h = _in_ptr_excause;
737 p0.l = _in_ptr_excause;
739 p0.h = _out_ptr_excause;
740 p0.l = _out_ptr_excause;
743 ENDPROC(_init_exception_buff)
745 /* We handle this 100% in exception space - to reduce overhead
746 * Only potiential problem is if the software buffer gets swapped out of the
747 * CPLB table - then double fault. - so we don't let this happen in other places
749 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
750 ENTRY(_ex_trace_buff_full)
756 P5.L = _trace_buff_offset;
757 P5.H = _trace_buff_offset;
758 P3 = [P5]; /* trace_buff_offset */
762 R7 <<= 1; /* double, since we need to read twice */
764 R7 <<= 2; /* need to shift over again,
765 * to get the number of bytes */
768 R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
775 P2.L = _trace_buff_offset;
776 P2.H = _trace_buff_offset;
779 P2.L = _software_trace_buff;
780 P2.H = _software_trace_buff;
782 LSETUP (.Lstart, .Lend) LC0;
784 R7 = [P5]; /* read TBUF */
798 jump _return_from_exception;
800 #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
805 ENTRY(_trace_buff_offset)
808 ENTRY(_software_trace_buff)
809 .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
815 * Put these in the kernel data section - that should always be covered by
816 * a CPLB. This is needed to ensure we don't get double fault conditions
819 #ifdef CONFIG_SYSCALL_TAB_L1
825 /* entry for each EXCAUSE[5:0]
826 * This table must be in sync with the table in ./kernel/traps.c
827 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
829 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
830 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
831 .long _ex_replaceable /* 0x02 - User Defined */
832 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
833 .long _ex_replaceable /* 0x04 - User Defined */
834 .long _ex_replaceable /* 0x05 - User Defined */
835 .long _ex_replaceable /* 0x06 - User Defined */
836 .long _ex_replaceable /* 0x07 - User Defined */
837 .long _ex_replaceable /* 0x08 - User Defined */
838 .long _ex_replaceable /* 0x09 - User Defined */
839 .long _ex_replaceable /* 0x0A - User Defined */
840 .long _ex_replaceable /* 0x0B - User Defined */
841 .long _ex_replaceable /* 0x0C - User Defined */
842 .long _ex_replaceable /* 0x0D - User Defined */
843 .long _ex_replaceable /* 0x0E - User Defined */
844 .long _ex_replaceable /* 0x0F - User Defined */
845 .long _ex_single_step /* 0x10 - HW Single step */
846 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
847 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
849 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
851 .long _ex_trap_c /* 0x12 - Reserved */
852 .long _ex_trap_c /* 0x13 - Reserved */
853 .long _ex_trap_c /* 0x14 - Reserved */
854 .long _ex_trap_c /* 0x15 - Reserved */
855 .long _ex_trap_c /* 0x16 - Reserved */
856 .long _ex_trap_c /* 0x17 - Reserved */
857 .long _ex_trap_c /* 0x18 - Reserved */
858 .long _ex_trap_c /* 0x19 - Reserved */
859 .long _ex_trap_c /* 0x1A - Reserved */
860 .long _ex_trap_c /* 0x1B - Reserved */
861 .long _ex_trap_c /* 0x1C - Reserved */
862 .long _ex_trap_c /* 0x1D - Reserved */
863 .long _ex_trap_c /* 0x1E - Reserved */
864 .long _ex_trap_c /* 0x1F - Reserved */
865 .long _ex_trap_c /* 0x20 - Reserved */
866 .long _ex_trap_c /* 0x21 - Undefined Instruction */
867 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
868 .long _ex_dcplb /* 0x23 - Data CPLB Protection Violation */
869 .long _ex_trap_c /* 0x24 - Data access misaligned */
870 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
871 .long _ex_dcplb /* 0x26 - Data CPLB Miss */
872 .long _ex_trap_c /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
873 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
874 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
875 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
876 .long _ex_icplb /* 0x2B - Instruction CPLB protection Violation */
877 .long _ex_icplb /* 0x2C - Instruction CPLB miss */
878 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
879 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
880 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
881 .long _ex_trap_c /* 0x2F - Reserved */
882 .long _ex_trap_c /* 0x30 - Reserved */
883 .long _ex_trap_c /* 0x31 - Reserved */
884 .long _ex_trap_c /* 0x32 - Reserved */
885 .long _ex_trap_c /* 0x33 - Reserved */
886 .long _ex_trap_c /* 0x34 - Reserved */
887 .long _ex_trap_c /* 0x35 - Reserved */
888 .long _ex_trap_c /* 0x36 - Reserved */
889 .long _ex_trap_c /* 0x37 - Reserved */
890 .long _ex_trap_c /* 0x38 - Reserved */
891 .long _ex_trap_c /* 0x39 - Reserved */
892 .long _ex_trap_c /* 0x3A - Reserved */
893 .long _ex_trap_c /* 0x3B - Reserved */
894 .long _ex_trap_c /* 0x3C - Reserved */
895 .long _ex_trap_c /* 0x3D - Reserved */
896 .long _ex_trap_c /* 0x3E - Reserved */
897 .long _ex_trap_c /* 0x3F - Reserved */
900 ENTRY(_sys_call_table)
901 .long _sys_restart_syscall /* 0 */
906 .long _sys_open /* 5 */
908 .long _sys_ni_syscall /* old waitpid */
911 .long _sys_unlink /* 10 */
916 .long _sys_chmod /* 15 */
917 .long _sys_chown /* chown16 */
918 .long _sys_ni_syscall /* old break syscall holder */
919 .long _sys_ni_syscall /* old stat */
921 .long _sys_getpid /* 20 */
923 .long _sys_ni_syscall /* old umount */
926 .long _sys_stime /* 25 */
929 .long _sys_ni_syscall /* old fstat */
931 .long _sys_ni_syscall /* old utime */ /* 30 */
932 .long _sys_ni_syscall /* old stty syscall holder */
933 .long _sys_ni_syscall /* old gtty syscall holder */
936 .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
941 .long _sys_rmdir /* 40 */
945 .long _sys_ni_syscall /* old prof syscall holder */
946 .long _sys_brk /* 45 */
949 .long _sys_ni_syscall /* old sys_signal */
950 .long _sys_geteuid /* geteuid16 */
951 .long _sys_getegid /* getegid16 */ /* 50 */
953 .long _sys_umount /* recycled never used phys() */
954 .long _sys_ni_syscall /* old lock syscall holder */
956 .long _sys_fcntl /* 55 */
957 .long _sys_ni_syscall /* old mpx syscall holder */
959 .long _sys_ni_syscall /* old ulimit syscall holder */
960 .long _sys_ni_syscall /* old old uname */
961 .long _sys_umask /* 60 */
966 .long _sys_getpgrp /* 65 */
968 .long _sys_ni_syscall /* old sys_sigaction */
971 .long _sys_setreuid /* setreuid16 */ /* 70 */
972 .long _sys_setregid /* setregid16 */
973 .long _sys_ni_syscall /* old sys_sigsuspend */
974 .long _sys_ni_syscall /* old sys_sigpending */
975 .long _sys_sethostname
976 .long _sys_setrlimit /* 75 */
977 .long _sys_ni_syscall /* old getrlimit */
979 .long _sys_gettimeofday
980 .long _sys_settimeofday
981 .long _sys_getgroups /* getgroups16 */ /* 80 */
982 .long _sys_setgroups /* setgroups16 */
983 .long _sys_ni_syscall /* old_select */
985 .long _sys_ni_syscall /* old lstat */
986 .long _sys_readlink /* 85 */
988 .long _sys_ni_syscall /* sys_swapon */
990 .long _sys_ni_syscall /* old_readdir */
991 .long _sys_ni_syscall /* sys_mmap */ /* 90 */
996 .long _sys_fchown /* fchown16 */ /* 95 */
997 .long _sys_getpriority
998 .long _sys_setpriority
999 .long _sys_ni_syscall /* old profil syscall holder */
1001 .long _sys_fstatfs /* 100 */
1002 .long _sys_ni_syscall
1003 .long _sys_ni_syscall /* old sys_socketcall */
1005 .long _sys_setitimer
1006 .long _sys_getitimer /* 105 */
1010 .long _sys_ni_syscall /* old uname */
1011 .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
1013 .long _sys_ni_syscall /* obsolete idle() syscall */
1014 .long _sys_ni_syscall /* vm86old for i386 */
1016 .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
1018 .long _sys_ni_syscall /* old sys_ipc */
1020 .long _sys_ni_syscall /* old sys_sigreturn */
1021 .long _sys_clone /* 120 */
1022 .long _sys_setdomainname
1024 .long _sys_ni_syscall /* old sys_modify_ldt */
1026 .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
1027 .long _sys_ni_syscall /* old sys_sigprocmask */
1028 .long _sys_ni_syscall /* old "creat_module" */
1029 .long _sys_init_module
1030 .long _sys_delete_module
1031 .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
1036 .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
1037 .long _sys_personality
1038 .long _sys_ni_syscall /* for afs_syscall */
1039 .long _sys_setfsuid /* setfsuid16 */
1040 .long _sys_setfsgid /* setfsgid16 */
1041 .long _sys_llseek /* 140 */
1043 .long _sys_ni_syscall /* sys_select */
1045 .long _sys_ni_syscall /* sys_msync */
1046 .long _sys_readv /* 145 */
1049 .long _sys_fdatasync
1051 .long _sys_ni_syscall /* 150 */ /* sys_mlock */
1052 .long _sys_ni_syscall /* sys_munlock */
1053 .long _sys_ni_syscall /* sys_mlockall */
1054 .long _sys_ni_syscall /* sys_munlockall */
1055 .long _sys_sched_setparam
1056 .long _sys_sched_getparam /* 155 */
1057 .long _sys_sched_setscheduler
1058 .long _sys_sched_getscheduler
1059 .long _sys_sched_yield
1060 .long _sys_sched_get_priority_max
1061 .long _sys_sched_get_priority_min /* 160 */
1062 .long _sys_sched_rr_get_interval
1063 .long _sys_nanosleep
1065 .long _sys_setresuid /* setresuid16 */
1066 .long _sys_getresuid /* getresuid16 */ /* 165 */
1067 .long _sys_ni_syscall /* for vm86 */
1068 .long _sys_ni_syscall /* old "query_module" */
1069 .long _sys_ni_syscall /* sys_poll */
1070 .long _sys_nfsservctl
1071 .long _sys_setresgid /* setresgid16 */ /* 170 */
1072 .long _sys_getresgid /* getresgid16 */
1074 .long _sys_rt_sigreturn
1075 .long _sys_rt_sigaction
1076 .long _sys_rt_sigprocmask /* 175 */
1077 .long _sys_rt_sigpending
1078 .long _sys_rt_sigtimedwait
1079 .long _sys_rt_sigqueueinfo
1080 .long _sys_rt_sigsuspend
1081 .long _sys_pread64 /* 180 */
1083 .long _sys_lchown /* lchown16 */
1086 .long _sys_capset /* 185 */
1087 .long _sys_sigaltstack
1089 .long _sys_ni_syscall /* streams1 */
1090 .long _sys_ni_syscall /* streams2 */
1091 .long _sys_vfork /* 190 */
1092 .long _sys_getrlimit
1094 .long _sys_truncate64
1095 .long _sys_ftruncate64
1096 .long _sys_stat64 /* 195 */
1101 .long _sys_getgid /* 200 */
1106 .long _sys_getgroups /* 205 */
1107 .long _sys_setgroups
1109 .long _sys_setresuid
1110 .long _sys_getresuid
1111 .long _sys_setresgid /* 210 */
1112 .long _sys_getresgid
1116 .long _sys_setfsuid /* 215 */
1118 .long _sys_pivot_root
1119 .long _sys_ni_syscall /* sys_mincore */
1120 .long _sys_ni_syscall /* sys_madvise */
1121 .long _sys_getdents64 /* 220 */
1123 .long _sys_ni_syscall /* reserved for TUX */
1124 .long _sys_ni_syscall
1126 .long _sys_readahead /* 225 */
1128 .long _sys_lsetxattr
1129 .long _sys_fsetxattr
1131 .long _sys_lgetxattr /* 230 */
1132 .long _sys_fgetxattr
1133 .long _sys_listxattr
1134 .long _sys_llistxattr
1135 .long _sys_flistxattr
1136 .long _sys_removexattr /* 235 */
1137 .long _sys_lremovexattr
1138 .long _sys_fremovexattr
1140 .long _sys_sendfile64
1141 .long _sys_futex /* 240 */
1142 .long _sys_sched_setaffinity
1143 .long _sys_sched_getaffinity
1144 .long _sys_ni_syscall /* sys_set_thread_area */
1145 .long _sys_ni_syscall /* sys_get_thread_area */
1146 .long _sys_io_setup /* 245 */
1147 .long _sys_io_destroy
1148 .long _sys_io_getevents
1149 .long _sys_io_submit
1150 .long _sys_io_cancel
1151 .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
1152 .long _sys_ni_syscall /* sys_freec_hugepages */
1153 .long _sys_exit_group
1154 .long _sys_lookup_dcookie
1155 .long _sys_bfin_spinlock
1156 .long _sys_epoll_create /* 255 */
1157 .long _sys_epoll_ctl
1158 .long _sys_epoll_wait
1159 .long _sys_ni_syscall /* remap_file_pages */
1160 .long _sys_set_tid_address
1161 .long _sys_timer_create /* 260 */
1162 .long _sys_timer_settime
1163 .long _sys_timer_gettime
1164 .long _sys_timer_getoverrun
1165 .long _sys_timer_delete
1166 .long _sys_clock_settime /* 265 */
1167 .long _sys_clock_gettime
1168 .long _sys_clock_getres
1169 .long _sys_clock_nanosleep
1171 .long _sys_fstatfs64 /* 270 */
1174 .long _sys_fadvise64_64
1175 .long _sys_ni_syscall /* vserver */
1176 .long _sys_ni_syscall /* 275, mbind */
1177 .long _sys_ni_syscall /* get_mempolicy */
1178 .long _sys_ni_syscall /* set_mempolicy */
1180 .long _sys_mq_unlink
1181 .long _sys_mq_timedsend /* 280 */
1182 .long _sys_mq_timedreceive
1183 .long _sys_mq_notify
1184 .long _sys_mq_getsetattr
1185 .long _sys_ni_syscall /* kexec_load */
1186 .long _sys_waitid /* 285 */
1188 .long _sys_request_key
1190 .long _sys_ioprio_set
1191 .long _sys_ioprio_get /* 290 */
1192 .long _sys_inotify_init
1193 .long _sys_inotify_add_watch
1194 .long _sys_inotify_rm_watch
1195 .long _sys_ni_syscall /* migrate_pages */
1196 .long _sys_openat /* 295 */
1200 .long _sys_futimesat
1201 .long _sys_fstatat64 /* 300 */
1205 .long _sys_symlinkat
1206 .long _sys_readlinkat /* 305 */
1208 .long _sys_faccessat
1211 .long _sys_unshare /* 310 */
1212 .long _sys_sram_alloc
1213 .long _sys_sram_free
1214 .long _sys_dma_memcpy
1216 .long _sys_bind /* 315 */
1218 .long _sys_getpeername
1219 .long _sys_getsockname
1220 .long _sys_getsockopt
1221 .long _sys_listen /* 320 */
1226 .long _sys_sendmsg /* 325 */
1228 .long _sys_setsockopt
1231 .long _sys_socketpair /* 330 */
1236 .long _sys_msgget /* 335 */
1241 .long _sys_shmdt /* 340 */
1244 .long _sys_sync_file_range
1246 .long _sys_vmsplice /* 345 */
1247 .long _sys_epoll_pwait
1248 .long _sys_utimensat
1251 .long _sys_eventfd /* 350 */
1254 .long _sys_fadvise64
1255 .long _sys_set_robust_list
1256 .long _sys_get_robust_list /* 355 */
1257 .long _sys_fallocate
1258 .rept NR_syscalls-(.-_sys_call_table)/4
1259 .long _sys_ni_syscall
1268 _exception_stack_top:
1270 #if ANOMALY_05000261
1271 /* Used by the assembly entry point to work around an anomaly. */
1272 _last_cplb_fault_retx:
1276 * Single instructions can have multiple faults, which need to be
1277 * handled by traps.c, in irq5. We store the exception cause to ensure
1278 * we don't miss a double fault condition
1280 ENTRY(_in_ptr_excause)
1282 ENTRY(_out_ptr_excause)
1285 ENTRY(_excause_circ_buf)