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 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
67 /* Slightly simplified and streamlined entry point for CPLB misses.
68 * This one does not lower the level to IRQ5, and thus can be used to
69 * patch up CPLB misses on the kernel stack.
72 #if defined(ANOMALY_05000261)
74 * Work around an anomaly: if we see a new DCPLB fault, return
75 * without doing anything. Then, if we get the same fault again,
78 p5.l = _last_cplb_fault_retx;
79 p5.h = _last_cplb_fault_retx;
84 if !cc jump _return_from_exception;
94 DEBUG_START_HWTRACE(p5, r7)
101 /* Transform this into a syscall - twiddle the syscall vector. */
109 ENDPROC(_ex_spinlock)
112 DEBUG_START_HWTRACE(p5, r7)
113 (R7:6,P5:4) = [sp++];
115 raise 15; /* invoked by TRAP #0, for sys call */
122 /* To end up here, vector 15 was changed - so we have to change it
127 p1.l = _evt_system_call;
128 p1.h = _evt_system_call;
133 call _sys_bfin_spinlock;
138 ENDPROC(_spinlock_bh)
147 ENTRY(_ex_single_step)
151 if cc jump _return_from_exception
160 if !cc jump _ex_trap_c;
163 r6.h = _exception_to_level5;
164 r6.l = _exception_to_level5;
167 if !cc jump _ex_trap_c;
169 _return_from_exception:
170 DEBUG_START_HWTRACE(p5, r7)
171 #ifdef ANOMALY_05000257
177 (R7:6,P5:4) = [sp++];
183 ENTRY(_handle_bad_cplb)
184 /* To get here, we just tried and failed to change a CPLB
185 * so, handle things in trap_c (C code), by lowering to
186 * IRQ5, just like we normally do. Since this is not a
187 * "normal" return path, we have a do alot of stuff to
188 * the stack to get ready so, we can fall through - we
189 * need to make a CPLB exception look like a normal exception
192 DEBUG_START_HWTRACE(p5, r7)
195 [--sp] = (R7:6, P5:4);
198 /* Call C code (trap_c) to handle the exception, which most
199 * likely involves sending a signal to the current process.
200 * To avoid double faults, lower our priority to IRQ5 first.
202 P5.h = _exception_to_level5;
203 P5.l = _exception_to_level5;
209 /* Disable all interrupts, but make sure level 5 is enabled so
210 * we can switch to that level. Save the old mask. */
212 p4.l = _excpt_saved_imask;
213 p4.h = _excpt_saved_imask;
218 /* Save the excause into a circular buffer, in case the instruction
219 * which caused this excecptions causes others.
221 P5.l = _in_ptr_excause;
222 P5.h = _in_ptr_excause;
228 R6.l = _excause_circ_buf;
229 R6.h = _excause_circ_buf;
235 DEBUG_START_HWTRACE(p5, r7)
236 (R7:6,P5:4) = [sp++];
243 ENTRY(_exception_to_level5)
246 /* Restore interrupt mask. We haven't pushed RETI, so this
247 * doesn't enable interrupts until we return from this handler. */
248 p4.l = _excpt_saved_imask;
249 p4.h = _excpt_saved_imask;
253 /* Restore the hardware error vector. */
264 r0 = [p2]; /* Read current IPEND */
265 [sp + PT_IPEND] = r0; /* Store IPEND */
267 /* Pop the excause from the circular buffer and push it on the stack
268 * (in the right place - if you change the location of SEQSTAT, you
269 * must change this offset.
272 P5.l = _out_ptr_excause;
273 P5.h = _out_ptr_excause;
279 R6.l = _excause_circ_buf;
280 R6.h = _excause_circ_buf;
286 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
291 /* See if anything else is in the exception buffer
292 * if there is, process it
294 P5.l = _out_ptr_excause;
295 P5.h = _out_ptr_excause;
296 P4.l = _in_ptr_excause;
297 P4.h = _in_ptr_excause;
301 if ! CC JUMP .L_excep_to_5_again
303 call _ret_from_exception;
306 ENDPROC(_exception_to_level5)
308 ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
309 /* Since the kernel stack can be anywhere, it's not guaranteed to be
310 * covered by a CPLB. Switch to an exception stack; use RETN as a
311 * scratch register (for want of a better option).
314 sp.l = _exception_stack_top;
315 sp.h = _exception_stack_top;
316 /* Try to deal with syscalls quickly. */
318 [--sp] = (R7:6, P5:4);
319 DEBUG_STOP_HWTRACE(p5, r7)
320 r7 = SEQSTAT; /* reason code is in bit 5:0 */
321 r6.l = lo(SEQSTAT_EXCAUSE);
322 r6.h = hi(SEQSTAT_EXCAUSE);
332 r7 = -ENOSYS; /* signextending enough */
333 [sp + PT_R0] = r7; /* return value from system call */
334 jump .Lsyscall_really_exit;
337 ENTRY(_kernel_execve)
340 r3 = SIZEOF_PTREGS / 4;
355 /* Success. Copy our temporary pt_regs to the top of the kernel
356 * stack and do a normal exception return.
359 r0 = (-KERNEL_STACK_SIZE) (x);
363 r0 = KERNEL_STACK_SIZE - 4 (z);
369 r3 = SIZEOF_PTREGS / 4;
375 if ! cc jump 0b (bp);
377 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
382 [SP + PT_SYSCFG] = r0;
383 [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
390 ENDPROC(_kernel_execve)
398 [sp + PT_IPEND] = r0;
400 /* Store RETS for now */
402 [sp + PT_RESERVED] = r0;
403 /* Set the stack for the current process */
405 r6.l = lo(ALIGN_PAGE_MASK);
406 r6.h = hi(ALIGN_PAGE_MASK);
407 r7 = r7 & r6; /* thread_info */
411 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
413 /* Check the System Call */
415 /* System call number is passed in P0 */
418 if ! cc jump .Lbadsys;
420 /* are we tracing syscalls?*/
422 r6.l = lo(ALIGN_PAGE_MASK);
423 r6.h = hi(ALIGN_PAGE_MASK);
427 CC = BITTST(r7,TIF_SYSCALL_TRACE);
428 if CC JUMP _sys_trace;
430 /* Execute the appropriate system call */
433 p5.l = _sys_call_table;
434 p5.h = _sys_call_table;
451 r4.l = lo(ALIGN_PAGE_MASK);
452 r4.h = hi(ALIGN_PAGE_MASK);
453 r7 = r7 & r4; /* thread_info->flags */
455 .Lresume_userspace_1:
456 /* Disable interrupts. */
460 r7 = [p5 + TI_FLAGS];
461 r4.l = lo(_TIF_WORK_MASK);
462 r4.h = hi(_TIF_WORK_MASK);
466 cc = BITTST(r7, TIF_NEED_RESCHED);
467 if !cc jump .Lsyscall_sigpending;
469 /* Reenable interrupts. */
477 jump .Lresume_userspace_1;
479 .Lsyscall_sigpending:
480 cc = BITTST(r7, TIF_RESTORE_SIGMASK);
481 if cc jump .Lsyscall_do_signals;
482 cc = BITTST(r7, TIF_SIGPENDING);
483 if !cc jump .Lsyscall_really_exit;
484 .Lsyscall_do_signals:
485 /* Reenable interrupts. */
494 .Lsyscall_really_exit:
495 r5 = [sp + PT_RESERVED];
498 ENDPROC(_system_call)
503 /* Execute the appropriate system call */
506 p5.l = _sys_call_table;
507 p5.h = _sys_call_table;
526 jump .Lresume_userspace;
531 * Beware - when entering resume, prev (the current task) is
532 * in r0, next (the new task) is in r1.
538 [--sp] = (r7:4, p5:3);
542 [p0+(TASK_THREAD+THREAD_USP)] = p2;
544 /* save current kernel stack pointer */
545 [p0+(TASK_THREAD+THREAD_KSP)] = sp;
547 /* save program counter */
548 r1.l = _new_old_task;
549 r1.h = _new_old_task;
550 [p0+(TASK_THREAD+THREAD_PC)] = r1;
552 /* restore the kernel stack pointer */
553 sp = [p1+(TASK_THREAD+THREAD_KSP)];
555 /* restore user stack pointer */
556 p0 = [p1+(TASK_THREAD+THREAD_USP)];
560 p0 = [p1+(TASK_THREAD+THREAD_PC)];
564 * Following code actually lands up in a new (old) task.
568 (r7:4, p5:3) = [sp++];
573 * When we come out of resume, r0 carries "old" task, becuase we are
579 ENTRY(_ret_from_exception)
585 [sp + PT_IPEND] = r0;
593 if !cc jump 4f; /* if not return to user mode, get out */
595 /* Make sure any pending system call or deferred exception
596 * return in ILAT for this process to get executed, otherwise
597 * in case context switch happens, system call of
598 * first process (i.e in ILAT) will be carried
599 * forward to the switched process
605 r1 = (EVT_IVG14 | EVT_IVG15) (z);
610 /* Set the stack for the current process */
612 r4.l = lo(ALIGN_PAGE_MASK);
613 r4.h = hi(ALIGN_PAGE_MASK);
614 r7 = r7 & r4; /* thread_info->flags */
616 r7 = [p5 + TI_FLAGS];
617 r4.l = lo(_TIF_WORK_MASK);
618 r4.h = hi(_TIF_WORK_MASK);
625 p1.l = _schedule_and_signal;
626 p1.h = _schedule_and_signal;
629 raise 15; /* raise evt14 to do signal or reschedule */
636 ENDPROC(_ret_from_exception)
638 ENTRY(_return_from_int)
639 /* If someone else already raised IRQ 15, do nothing. */
644 cc = bittst (r0, EVT_IVG15_P);
647 /* if not return to user mode, get out */
661 /* Lower the interrupt level to 15. */
664 p1.l = _schedule_and_signal_from_int;
665 p1.h = _schedule_and_signal_from_int;
668 #if defined(ANOMALY_05000281)
669 r0.l = lo(CONFIG_BOOT_LOAD);
670 r0.h = hi(CONFIG_BOOT_LOAD);
675 raise 15; /* raise evt15 to do signal or reschedule */
679 ENDPROC(_return_from_int)
681 ENTRY(_lower_to_irq14)
682 #if defined(ANOMALY_05000281)
683 r0.l = lo(CONFIG_BOOT_LOAD);
684 r0.h = hi(CONFIG_BOOT_LOAD);
691 ENTRY(_evt14_softirq)
692 #ifdef CONFIG_DEBUG_HWERR
702 _schedule_and_signal_from_int:
703 /* To end up here, vector 15 was changed - so we have to change it
708 p1.l = _evt_system_call;
709 p1.h = _evt_system_call;
713 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
715 [sp + PT_ORIG_P0] = r0;
718 [sp + PT_RESERVED] = p1;
727 call _finish_atomic_sections;
729 jump.s .Lresume_userspace;
731 _schedule_and_signal:
733 /* To end up here, vector 15 was changed - so we have to change it
738 p1.l = _evt_system_call;
739 p1.h = _evt_system_call;
744 [sp + PT_RESERVED] = P0;
745 call .Lresume_userspace;
749 ENDPROC(_lower_to_irq14)
751 /* Make sure when we start, that the circular buffer is initialized properly
752 * R0 and P0 are call clobbered, so we can use them here.
754 ENTRY(_init_exception_buff)
756 p0.h = _in_ptr_excause;
757 p0.l = _in_ptr_excause;
759 p0.h = _out_ptr_excause;
760 p0.l = _out_ptr_excause;
763 ENDPROC(_init_exception_buff)
766 * Put these in the kernel data section - that should always be covered by
767 * a CPLB. This is needed to ensure we don't get double fault conditions
770 #ifdef CONFIG_SYSCALL_TAB_L1
777 /* entry for each EXCAUSE[5:0]
778 * This table bmust be in sync with the table in ./kernel/traps.c
779 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
781 .long _ex_syscall; /* 0x00 - User Defined - Linux Syscall */
782 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
783 .long _ex_trap_c /* 0x02 - User Defined */
784 .long _ex_trap_c /* 0x03 - User Defined - Atomic test and set service */
785 .long _ex_spinlock /* 0x04 - User Defined */
786 .long _ex_trap_c /* 0x05 - User Defined */
787 .long _ex_trap_c /* 0x06 - User Defined */
788 .long _ex_trap_c /* 0x07 - User Defined */
789 .long _ex_trap_c /* 0x08 - User Defined */
790 .long _ex_trap_c /* 0x09 - User Defined */
791 .long _ex_trap_c /* 0x0A - User Defined */
792 .long _ex_trap_c /* 0x0B - User Defined */
793 .long _ex_trap_c /* 0x0C - User Defined */
794 .long _ex_trap_c /* 0x0D - User Defined */
795 .long _ex_trap_c /* 0x0E - User Defined */
796 .long _ex_trap_c /* 0x0F - User Defined */
797 .long _ex_single_step /* 0x10 - HW Single step */
798 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
799 .long _ex_trap_c /* 0x12 - Reserved */
800 .long _ex_trap_c /* 0x13 - Reserved */
801 .long _ex_trap_c /* 0x14 - Reserved */
802 .long _ex_trap_c /* 0x15 - Reserved */
803 .long _ex_trap_c /* 0x16 - Reserved */
804 .long _ex_trap_c /* 0x17 - Reserved */
805 .long _ex_trap_c /* 0x18 - Reserved */
806 .long _ex_trap_c /* 0x19 - Reserved */
807 .long _ex_trap_c /* 0x1A - Reserved */
808 .long _ex_trap_c /* 0x1B - Reserved */
809 .long _ex_trap_c /* 0x1C - Reserved */
810 .long _ex_trap_c /* 0x1D - Reserved */
811 .long _ex_trap_c /* 0x1E - Reserved */
812 .long _ex_trap_c /* 0x1F - Reserved */
813 .long _ex_trap_c /* 0x20 - Reserved */
814 .long _ex_trap_c /* 0x21 - Undefined Instruction */
815 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
816 .long _ex_dcplb /* 0x23 - Data CPLB Protection Violation */
817 .long _ex_trap_c /* 0x24 - Data access misaligned */
818 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
819 .long _ex_dcplb /* 0x26 - Data CPLB Miss */
820 .long _ex_trap_c /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
821 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
822 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
823 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
824 .long _ex_icplb /* 0x2B - Instruction CPLB protection Violation */
825 .long _ex_icplb /* 0x2C - Instruction CPLB miss */
826 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
827 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
828 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
829 .long _ex_trap_c /* 0x2F - Reserved */
830 .long _ex_trap_c /* 0x30 - Reserved */
831 .long _ex_trap_c /* 0x31 - Reserved */
832 .long _ex_trap_c /* 0x32 - Reserved */
833 .long _ex_trap_c /* 0x33 - Reserved */
834 .long _ex_trap_c /* 0x34 - Reserved */
835 .long _ex_trap_c /* 0x35 - Reserved */
836 .long _ex_trap_c /* 0x36 - Reserved */
837 .long _ex_trap_c /* 0x37 - Reserved */
838 .long _ex_trap_c /* 0x38 - Reserved */
839 .long _ex_trap_c /* 0x39 - Reserved */
840 .long _ex_trap_c /* 0x3A - Reserved */
841 .long _ex_trap_c /* 0x3B - Reserved */
842 .long _ex_trap_c /* 0x3C - Reserved */
843 .long _ex_trap_c /* 0x3D - Reserved */
844 .long _ex_trap_c /* 0x3E - Reserved */
845 .long _ex_trap_c /* 0x3F - Reserved */
848 ENTRY(_sys_call_table)
849 .long _sys_ni_syscall /* 0 - old "setup()" system call*/
854 .long _sys_open /* 5 */
856 .long _sys_ni_syscall /* old waitpid */
859 .long _sys_unlink /* 10 */
864 .long _sys_chmod /* 15 */
865 .long _sys_chown /* chown16 */
866 .long _sys_ni_syscall /* old break syscall holder */
867 .long _sys_ni_syscall /* old stat */
869 .long _sys_getpid /* 20 */
871 .long _sys_ni_syscall /* old umount */
874 .long _sys_stime /* 25 */
877 .long _sys_ni_syscall /* old fstat */
879 .long _sys_ni_syscall /* old utime */ /* 30 */
880 .long _sys_ni_syscall /* old stty syscall holder */
881 .long _sys_ni_syscall /* old gtty syscall holder */
884 .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
889 .long _sys_rmdir /* 40 */
893 .long _sys_ni_syscall /* old prof syscall holder */
894 .long _sys_brk /* 45 */
897 .long _sys_ni_syscall /* old sys_signal */
898 .long _sys_geteuid /* geteuid16 */
899 .long _sys_getegid /* getegid16 */ /* 50 */
901 .long _sys_umount /* recycled never used phys() */
902 .long _sys_ni_syscall /* old lock syscall holder */
904 .long _sys_fcntl /* 55 */
905 .long _sys_ni_syscall /* old mpx syscall holder */
907 .long _sys_ni_syscall /* old ulimit syscall holder */
908 .long _sys_ni_syscall /* old old uname */
909 .long _sys_umask /* 60 */
914 .long _sys_getpgrp /* 65 */
916 .long _sys_ni_syscall /* old sys_sigaction */
919 .long _sys_setreuid /* setreuid16 */ /* 70 */
920 .long _sys_setregid /* setregid16 */
921 .long _sys_ni_syscall /* old sys_sigsuspend */
922 .long _sys_ni_syscall /* old sys_sigpending */
923 .long _sys_sethostname
924 .long _sys_setrlimit /* 75 */
925 .long _sys_ni_syscall /* old getrlimit */
927 .long _sys_gettimeofday
928 .long _sys_settimeofday
929 .long _sys_getgroups /* getgroups16 */ /* 80 */
930 .long _sys_setgroups /* setgroups16 */
931 .long _sys_ni_syscall /* old_select */
933 .long _sys_ni_syscall /* old lstat */
934 .long _sys_readlink /* 85 */
936 .long _sys_ni_syscall /* sys_swapon */
938 .long _sys_ni_syscall /* old_readdir */
939 .long _sys_ni_syscall /* sys_mmap */ /* 90 */
944 .long _sys_fchown /* fchown16 */ /* 95 */
945 .long _sys_getpriority
946 .long _sys_setpriority
947 .long _sys_ni_syscall /* old profil syscall holder */
949 .long _sys_fstatfs /* 100 */
950 .long _sys_ni_syscall
951 .long _sys_ni_syscall /* old sys_socketcall */
954 .long _sys_getitimer /* 105 */
958 .long _sys_ni_syscall /* old uname */
959 .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
961 .long _sys_ni_syscall /* obsolete idle() syscall */
962 .long _sys_ni_syscall /* vm86old for i386 */
964 .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
966 .long _sys_ni_syscall /* old sys_ipc */
968 .long _sys_ni_syscall /* old sys_sigreturn */
969 .long _sys_clone /* 120 */
970 .long _sys_setdomainname
972 .long _sys_ni_syscall /* old sys_modify_ldt */
974 .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
975 .long _sys_ni_syscall /* old sys_sigprocmask */
976 .long _sys_ni_syscall /* old "creat_module" */
977 .long _sys_init_module
978 .long _sys_delete_module
979 .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
984 .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
985 .long _sys_personality
986 .long _sys_ni_syscall /* for afs_syscall */
987 .long _sys_setfsuid /* setfsuid16 */
988 .long _sys_setfsgid /* setfsgid16 */
989 .long _sys_llseek /* 140 */
991 .long _sys_ni_syscall /* sys_select */
993 .long _sys_ni_syscall /* sys_msync */
994 .long _sys_readv /* 145 */
999 .long _sys_ni_syscall /* 150 */ /* sys_mlock */
1000 .long _sys_ni_syscall /* sys_munlock */
1001 .long _sys_ni_syscall /* sys_mlockall */
1002 .long _sys_ni_syscall /* sys_munlockall */
1003 .long _sys_sched_setparam
1004 .long _sys_sched_getparam /* 155 */
1005 .long _sys_sched_setscheduler
1006 .long _sys_sched_getscheduler
1007 .long _sys_sched_yield
1008 .long _sys_sched_get_priority_max
1009 .long _sys_sched_get_priority_min /* 160 */
1010 .long _sys_sched_rr_get_interval
1011 .long _sys_nanosleep
1012 .long _sys_ni_syscall /* sys_mremap */
1013 .long _sys_setresuid /* setresuid16 */
1014 .long _sys_getresuid /* getresuid16 */ /* 165 */
1015 .long _sys_ni_syscall /* for vm86 */
1016 .long _sys_ni_syscall /* old "query_module" */
1017 .long _sys_ni_syscall /* sys_poll */
1018 .long _sys_ni_syscall /* sys_nfsservctl */
1019 .long _sys_setresgid /* setresgid16 */ /* 170 */
1020 .long _sys_getresgid /* getresgid16 */
1022 .long _sys_rt_sigreturn
1023 .long _sys_rt_sigaction
1024 .long _sys_rt_sigprocmask /* 175 */
1025 .long _sys_rt_sigpending
1026 .long _sys_rt_sigtimedwait
1027 .long _sys_rt_sigqueueinfo
1028 .long _sys_rt_sigsuspend
1029 .long _sys_pread64 /* 180 */
1031 .long _sys_lchown /* lchown16 */
1034 .long _sys_capset /* 185 */
1035 .long _sys_sigaltstack
1037 .long _sys_ni_syscall /* streams1 */
1038 .long _sys_ni_syscall /* streams2 */
1039 .long _sys_vfork /* 190 */
1040 .long _sys_getrlimit
1042 .long _sys_truncate64
1043 .long _sys_ftruncate64
1044 .long _sys_stat64 /* 195 */
1049 .long _sys_getgid /* 200 */
1054 .long _sys_getgroups /* 205 */
1055 .long _sys_setgroups
1057 .long _sys_setresuid
1058 .long _sys_getresuid
1059 .long _sys_setresgid /* 210 */
1060 .long _sys_getresgid
1064 .long _sys_setfsuid /* 215 */
1066 .long _sys_pivot_root
1067 .long _sys_ni_syscall /* sys_mincore */
1068 .long _sys_ni_syscall /* sys_madvise */
1069 .long _sys_getdents64 /* 220 */
1071 .long _sys_ni_syscall /* reserved for TUX */
1072 .long _sys_ni_syscall
1074 .long _sys_ni_syscall /* 225 */ /* sys_readahead */
1076 .long _sys_lsetxattr
1077 .long _sys_fsetxattr
1079 .long _sys_lgetxattr /* 230 */
1080 .long _sys_fgetxattr
1081 .long _sys_listxattr
1082 .long _sys_llistxattr
1083 .long _sys_flistxattr
1084 .long _sys_removexattr /* 235 */
1085 .long _sys_lremovexattr
1086 .long _sys_fremovexattr
1088 .long _sys_sendfile64
1089 .long _sys_futex /* 240 */
1090 .long _sys_sched_setaffinity
1091 .long _sys_sched_getaffinity
1092 .long _sys_ni_syscall /* sys_set_thread_area */
1093 .long _sys_ni_syscall /* sys_get_thread_area */
1094 .long _sys_io_setup /* 245 */
1095 .long _sys_io_destroy
1096 .long _sys_io_getevents
1097 .long _sys_io_submit
1098 .long _sys_io_cancel
1099 .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
1100 .long _sys_ni_syscall /* sys_freec_hugepages */
1101 .long _sys_exit_group
1102 .long _sys_lookup_dcookie
1103 .long _sys_bfin_spinlock
1104 .long _sys_epoll_create /* 255 */
1105 .long _sys_epoll_ctl
1106 .long _sys_epoll_wait
1107 .long _sys_ni_syscall /* remap_file_pages */
1108 .long _sys_set_tid_address
1109 .long _sys_timer_create /* 260 */
1110 .long _sys_timer_settime
1111 .long _sys_timer_gettime
1112 .long _sys_timer_getoverrun
1113 .long _sys_timer_delete
1114 .long _sys_clock_settime /* 265 */
1115 .long _sys_clock_gettime
1116 .long _sys_clock_getres
1117 .long _sys_clock_nanosleep
1119 .long _sys_fstatfs64 /* 270 */
1122 .long _sys_fadvise64_64
1123 .long _sys_ni_syscall /* vserver */
1124 .long _sys_ni_syscall /* 275, mbind */
1125 .long _sys_ni_syscall /* get_mempolicy */
1126 .long _sys_ni_syscall /* set_mempolicy */
1128 .long _sys_mq_unlink
1129 .long _sys_mq_timedsend /* 280 */
1130 .long _sys_mq_timedreceive
1131 .long _sys_mq_notify
1132 .long _sys_mq_getsetattr
1133 .long _sys_ni_syscall /* kexec_load */
1134 .long _sys_waitid /* 285 */
1136 .long _sys_request_key
1138 .long _sys_ioprio_set
1139 .long _sys_ioprio_get /* 290 */
1140 .long _sys_inotify_init
1141 .long _sys_inotify_add_watch
1142 .long _sys_inotify_rm_watch
1143 .long _sys_ni_syscall /* migrate_pages */
1144 .long _sys_openat /* 295 */
1148 .long _sys_futimesat
1149 .long _sys_fstatat64 /* 300 */
1153 .long _sys_symlinkat
1154 .long _sys_readlinkat /* 305 */
1156 .long _sys_faccessat
1159 .long _sys_unshare /* 310 */
1160 .long _sys_sram_alloc
1161 .long _sys_sram_free
1162 .long _sys_dma_memcpy
1164 .long _sys_bind /* 315 */
1166 .long _sys_getpeername
1167 .long _sys_getsockname
1168 .long _sys_getsockopt
1169 .long _sys_listen /* 320 */
1174 .long _sys_sendmsg /* 325 */
1176 .long _sys_setsockopt
1179 .long _sys_socketpair /* 330 */
1184 .long _sys_msgget /* 335 */
1189 .long _sys_shmdt /* 340 */
1191 .rept NR_syscalls-(.-_sys_call_table)/4
1192 .long _sys_ni_syscall
1201 _exception_stack_top:
1203 #if defined(ANOMALY_05000261)
1204 /* Used by the assembly entry point to work around an anomaly. */
1205 _last_cplb_fault_retx:
1209 * Single instructions can have multiple faults, which need to be
1210 * handled by traps.c, in irq5. We store the exception cause to ensure
1211 * we don't miss a double fault condition
1213 ENTRY(_in_ptr_excause)
1215 ENTRY(_out_ptr_excause)
1218 ENTRY(_excause_circ_buf)