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
32 /* NOTE: This code handles signal-recognition, which happens every time
33 * after a timer-interrupt and after each system call.
36 #include <linux/init.h>
37 #include <linux/linkage.h>
38 #include <linux/unistd.h>
39 #include <asm/blackfin.h>
40 #include <asm/errno.h>
41 #include <asm/fixed_code.h>
42 #include <asm/thread_info.h> /* TIF_NEED_RESCHED */
43 #include <asm/asm-offsets.h>
44 #include <asm/trace.h>
46 #include <asm/context.S>
48 #if defined(CONFIG_BFIN_SCRATCH_REG_RETN)
49 # define EX_SCRATCH_REG RETN
50 #elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)
51 # define EX_SCRATCH_REG RETE
53 # define EX_SCRATCH_REG CYCLES
56 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
62 /* Slightly simplified and streamlined entry point for CPLB misses.
63 * This one does not lower the level to IRQ5, and thus can be used to
64 * patch up CPLB misses on the kernel stack.
67 #define _ex_dviol _ex_workaround_261
68 #define _ex_dmiss _ex_workaround_261
69 #define _ex_dmult _ex_workaround_261
71 ENTRY(_ex_workaround_261)
73 * Work around an anomaly: if we see a new DCPLB fault, return
74 * without doing anything. Then, if we get the same fault again,
77 P4 = R7; /* Store EXCAUSE */
78 p5.l = _last_cplb_fault_retx;
79 p5.h = _last_cplb_fault_retx;
84 if !cc jump _bfin_return_from_exception;
87 R6 = 0x26; /* Data CPLB Miss */
89 if cc jump _ex_dcplb_miss (BP);
90 R6 = 0x23; /* Data CPLB Miss */
92 if cc jump _ex_dcplb_viol (BP);
93 /* Handle 0x23 Data CPLB Protection Violation
94 * and Data CPLB Multiple Hits - Linux Trap Zero
97 ENDPROC(_ex_workaround_261)
101 #define _ex_dviol _ex_dcplb_viol
103 #define _ex_dviol _ex_trap_c
105 #define _ex_dmiss _ex_dcplb_miss
106 #define _ex_dmult _ex_trap_c
110 ENTRY(_ex_dcplb_viol)
111 ENTRY(_ex_dcplb_miss)
112 ENTRY(_ex_icplb_miss)
113 (R7:6,P5:4) = [sp++];
117 /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
118 * will change the stack pointer. */
122 DEBUG_HWTRACE_SAVE(p5, r7)
128 IF !CC JUMP _handle_bad_cplb;
133 #ifdef CONFIG_DEBUG_DOUBLEFAULT
134 /* While we were processing this, did we double fault? */
135 r7 = SEQSTAT; /* reason code is in bit 5:0 */
136 r6.l = lo(SEQSTAT_EXCAUSE);
137 r6.h = hi(SEQSTAT_EXCAUSE);
141 if CC JUMP _double_fault;
144 DEBUG_HWTRACE_RESTORE(p5, r7)
148 ENDPROC(_ex_icplb_miss)
151 raise 15; /* invoked by TRAP #0, for sys call */
152 jump.s _bfin_return_from_exception;
162 ENTRY(_ex_single_step)
163 /* If we just returned from an interrupt, the single step event is
164 for the RTI instruction. */
168 if cc jump _bfin_return_from_exception;
171 /* Don't do single step in hardware exception handler */
176 if cc jump _bfin_return_from_exception;
178 if cc jump _bfin_return_from_exception;
180 /* skip single step if current interrupt priority is higher than
181 * that of the first instruction, from which gdb starts single step */
184 .Lfind_priority_start:
186 if cc jump .Lfind_priority_done;
190 if cc jump .Lfind_priority_done;
191 jump.s .Lfind_priority_start;
192 .Lfind_priority_done:
193 p4.l = _kgdb_single_step;
194 p4.h = _kgdb_single_step;
197 if cc jump .Ldo_single_step;
203 /* If we were in user mode, do the single step normally. */
213 /* Single stepping only a single instruction, so clear the trace
222 * We were in an interrupt handler. By convention, all of them save
223 * SYSCFG with their first instruction, so by checking whether our
224 * RETX points at the entry point, we can determine whether to allow
225 * a single step, or whether to clear SYSCFG.
227 * First, find out the interrupt level and the event vector for it.
237 /* What we actually do is test for the _second_ instruction in the
238 * IRQ handler. That way, if there are insns following the restore
239 * of SYSCFG after leaving the handler, we will not turn off SYSCFG
246 if !cc jump _bfin_return_from_exception;
252 /* Fall through to _bfin_return_from_exception. */
253 ENDPROC(_ex_single_step)
255 ENTRY(_bfin_return_from_exception)
263 #ifdef CONFIG_DEBUG_DOUBLEFAULT
264 /* While we were processing the current exception,
265 * did we cause another, and double fault?
267 r7 = SEQSTAT; /* reason code is in bit 5:0 */
268 r6.l = lo(SEQSTAT_EXCAUSE);
269 r6.h = hi(SEQSTAT_EXCAUSE);
273 if CC JUMP _double_fault;
275 /* Did we cause a HW error? */
279 r7 = 0x20; /* Did I just cause anther HW error? */
282 if CC JUMP _double_fault;
285 (R7:6,P5:4) = [sp++];
289 ENDPROC(_bfin_return_from_exception)
291 ENTRY(_handle_bad_cplb)
292 DEBUG_HWTRACE_RESTORE(p5, r7)
293 /* To get here, we just tried and failed to change a CPLB
294 * so, handle things in trap_c (C code), by lowering to
295 * IRQ5, just like we normally do. Since this is not a
296 * "normal" return path, we have a do alot of stuff to
297 * the stack to get ready so, we can fall through - we
298 * need to make a CPLB exception look like a normal exception
303 [--sp] = (R7:6,P5:4);
305 ENTRY(_ex_replaceable)
309 /* Make sure we are not in a double fault */
314 if CC jump _double_fault;
316 /* Call C code (trap_c) to handle the exception, which most
317 * likely involves sending a signal to the current process.
318 * To avoid double faults, lower our priority to IRQ5 first.
320 P5.h = _exception_to_level5;
321 P5.l = _exception_to_level5;
327 #ifndef CONFIG_DEBUG_DOUBLEFAULT
329 * Save these registers, as they are only valid in exception context
330 * (where we are now - as soon as we defer to IRQ5, they can change)
331 * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
332 * but they are not very interesting, so don't save them
335 p4.l = lo(DCPLB_FAULT_ADDR);
336 p4.h = hi(DCPLB_FAULT_ADDR);
338 p5.h = _saved_dcplb_fault_addr;
339 p5.l = _saved_dcplb_fault_addr;
342 r7 = [p4 + (ICPLB_FAULT_ADDR - DCPLB_FAULT_ADDR)];
343 p5.h = _saved_icplb_fault_addr;
344 p5.l = _saved_icplb_fault_addr;
357 /* Disable all interrupts, but make sure level 5 is enabled so
358 * we can switch to that level. Save the old mask. */
362 p4.l = lo(SAFE_USER_INSTRUCTION);
363 p4.h = hi(SAFE_USER_INSTRUCTION);
370 jump.s _bfin_return_from_exception;
373 /* We just realized we got an exception, while we were processing a different
374 * exception. This is a unrecoverable event, so crash
377 /* Turn caches & protection off, to ensure we don't get any more
381 P4.L = LO(IMEM_CONTROL);
382 P4.H = HI(IMEM_CONTROL);
384 R5 = [P4]; /* Control Register*/
385 BITCLR(R5,ENICPLB_P);
386 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
391 P4.L = LO(DMEM_CONTROL);
392 P4.H = HI(DMEM_CONTROL);
394 BITCLR(R5,ENDCPLB_P);
395 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
400 /* Fix up the stack */
401 (R7:6,P5:4) = [sp++];
405 /* We should be out of the exception stack, and back down into
406 * kernel or user space stack
410 /* The dumping functions expect the return address in the RETI
415 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
417 call _double_fault_c;
419 .L_double_fault_panic:
420 JUMP .L_double_fault_panic
422 ENDPROC(_double_fault)
424 ENTRY(_exception_to_level5)
433 [sp + PT_SYSCFG] = r6;
435 /* Restore interrupt mask. We haven't pushed RETI, so this
436 * doesn't enable interrupts until we return from this handler. */
440 /* Restore the hardware error vector. */
451 r0 = [p2]; /* Read current IPEND */
452 [sp + PT_IPEND] = r0; /* Store IPEND */
454 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
459 #ifdef CONFIG_DEBUG_DOUBLEFAULT
464 r1 = 0x20; /* Did I just cause anther HW error? */
467 if CC JUMP _double_fault;
470 call _ret_from_exception;
473 ENDPROC(_exception_to_level5)
475 ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
476 /* Since the kernel stack can be anywhere, it's not guaranteed to be
477 * covered by a CPLB. Switch to an exception stack; use RETN as a
478 * scratch register (for want of a better option).
481 sp.l = _exception_stack_top;
482 sp.h = _exception_stack_top;
483 /* Try to deal with syscalls quickly. */
485 [--sp] = (R7:6,P5:4);
487 #if ANOMALY_05000283 || ANOMALY_05000315
496 #ifdef CONFIG_DEBUG_DOUBLEFAULT
498 * Save these registers, as they are only valid in exception context
499 * (where we are now - as soon as we defer to IRQ5, they can change)
500 * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
501 * but they are not very interesting, so don't save them
504 p4.l = lo(DCPLB_FAULT_ADDR);
505 p4.h = hi(DCPLB_FAULT_ADDR);
507 p5.h = _saved_dcplb_fault_addr;
508 p5.l = _saved_dcplb_fault_addr;
511 r7 = [p4 + (ICPLB_FAULT_ADDR - DCPLB_FAULT_ADDR)];
512 p5.h = _saved_icplb_fault_addr;
513 p5.l = _saved_icplb_fault_addr;
521 r7 = SEQSTAT; /* reason code is in bit 5:0 */
522 p4.l = _saved_seqstat;
523 p4.h = _saved_seqstat;
526 r7 = SEQSTAT; /* reason code is in bit 5:0 */
528 r6.l = lo(SEQSTAT_EXCAUSE);
529 r6.h = hi(SEQSTAT_EXCAUSE);
539 r7 = -ENOSYS; /* signextending enough */
540 [sp + PT_R0] = r7; /* return value from system call */
541 jump .Lsyscall_really_exit;
544 ENTRY(_kernel_execve)
547 r3 = SIZEOF_PTREGS / 4;
562 /* Success. Copy our temporary pt_regs to the top of the kernel
563 * stack and do a normal exception return.
566 r0 = (-KERNEL_STACK_SIZE) (x);
570 r0 = KERNEL_STACK_SIZE - 4 (z);
576 r3 = SIZEOF_PTREGS / 4;
582 if ! cc jump 0b (bp);
584 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
589 [SP + PT_SYSCFG] = r0;
590 [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
597 ENDPROC(_kernel_execve)
605 [sp + PT_IPEND] = r0;
607 /* Store RETS for now */
609 [sp + PT_RESERVED] = r0;
610 /* Set the stack for the current process */
612 r6.l = lo(ALIGN_PAGE_MASK);
613 r6.h = hi(ALIGN_PAGE_MASK);
614 r7 = r7 & r6; /* thread_info */
618 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
620 /* Check the System Call */
622 /* System call number is passed in P0 */
625 if ! cc jump .Lbadsys;
627 /* are we tracing syscalls?*/
629 r6.l = lo(ALIGN_PAGE_MASK);
630 r6.h = hi(ALIGN_PAGE_MASK);
634 CC = BITTST(r7,TIF_SYSCALL_TRACE);
635 if CC JUMP _sys_trace;
637 /* Execute the appropriate system call */
640 p5.l = _sys_call_table;
641 p5.h = _sys_call_table;
658 r4.l = lo(ALIGN_PAGE_MASK);
659 r4.h = hi(ALIGN_PAGE_MASK);
660 r7 = r7 & r4; /* thread_info->flags */
662 .Lresume_userspace_1:
663 /* Disable interrupts. */
667 r7 = [p5 + TI_FLAGS];
668 r4.l = lo(_TIF_WORK_MASK);
669 r4.h = hi(_TIF_WORK_MASK);
673 cc = BITTST(r7, TIF_NEED_RESCHED);
674 if !cc jump .Lsyscall_sigpending;
676 /* Reenable interrupts. */
684 jump .Lresume_userspace_1;
686 .Lsyscall_sigpending:
687 cc = BITTST(r7, TIF_RESTORE_SIGMASK);
688 if cc jump .Lsyscall_do_signals;
689 cc = BITTST(r7, TIF_SIGPENDING);
690 if !cc jump .Lsyscall_really_exit;
691 .Lsyscall_do_signals:
692 /* Reenable interrupts. */
701 .Lsyscall_really_exit:
702 r5 = [sp + PT_RESERVED];
705 ENDPROC(_system_call)
707 /* Do not mark as ENTRY() to avoid error in assembler ...
708 * this symbol need not be global anyways, so ...
713 /* Execute the appropriate system call */
716 p5.l = _sys_call_table;
717 p5.h = _sys_call_table;
736 jump .Lresume_userspace;
741 * Beware - when entering resume, prev (the current task) is
742 * in r0, next (the new task) is in r1.
748 [--sp] = (r7:4, p5:3);
752 [p0+(TASK_THREAD+THREAD_USP)] = p2;
754 /* save current kernel stack pointer */
755 [p0+(TASK_THREAD+THREAD_KSP)] = sp;
757 /* save program counter */
758 r1.l = _new_old_task;
759 r1.h = _new_old_task;
760 [p0+(TASK_THREAD+THREAD_PC)] = r1;
762 /* restore the kernel stack pointer */
763 sp = [p1+(TASK_THREAD+THREAD_KSP)];
765 /* restore user stack pointer */
766 p0 = [p1+(TASK_THREAD+THREAD_USP)];
770 p0 = [p1+(TASK_THREAD+THREAD_PC)];
774 * Following code actually lands up in a new (old) task.
778 (r7:4, p5:3) = [sp++];
783 * When we come out of resume, r0 carries "old" task, becuase we are
789 ENTRY(_ret_from_exception)
795 [sp + PT_IPEND] = r0;
801 if !cc jump 4f; /* if not return to user mode, get out */
803 /* Make sure any pending system call or deferred exception
804 * return in ILAT for this process to get executed, otherwise
805 * in case context switch happens, system call of
806 * first process (i.e in ILAT) will be carried
807 * forward to the switched process
813 r1 = (EVT_IVG14 | EVT_IVG15) (z);
818 /* Set the stack for the current process */
820 r4.l = lo(ALIGN_PAGE_MASK);
821 r4.h = hi(ALIGN_PAGE_MASK);
822 r7 = r7 & r4; /* thread_info->flags */
824 r7 = [p5 + TI_FLAGS];
825 r4.l = lo(_TIF_WORK_MASK);
826 r4.h = hi(_TIF_WORK_MASK);
833 p1.l = _schedule_and_signal;
834 p1.h = _schedule_and_signal;
837 raise 15; /* raise evt14 to do signal or reschedule */
844 ENDPROC(_ret_from_exception)
846 ENTRY(_return_from_int)
847 /* If someone else already raised IRQ 15, do nothing. */
852 cc = bittst (r0, EVT_IVG15_P);
855 /* if not return to user mode, get out */
869 /* Lower the interrupt level to 15. */
872 p1.l = _schedule_and_signal_from_int;
873 p1.h = _schedule_and_signal_from_int;
877 r0.l = lo(SAFE_USER_INSTRUCTION);
878 r0.h = hi(SAFE_USER_INSTRUCTION);
883 raise 15; /* raise evt15 to do signal or reschedule */
887 ENDPROC(_return_from_int)
889 ENTRY(_lower_to_irq14)
891 r0.l = lo(SAFE_USER_INSTRUCTION);
892 r0.h = hi(SAFE_USER_INSTRUCTION);
899 ENTRY(_evt14_softirq)
900 #ifdef CONFIG_DEBUG_HWERR
910 _schedule_and_signal_from_int:
911 /* To end up here, vector 15 was changed - so we have to change it
916 p1.l = _evt_system_call;
917 p1.h = _evt_system_call;
921 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
923 [sp + PT_ORIG_P0] = r0;
926 [sp + PT_RESERVED] = p1;
935 call _finish_atomic_sections;
937 jump.s .Lresume_userspace;
939 _schedule_and_signal:
941 /* To end up here, vector 15 was changed - so we have to change it
946 p1.l = _evt_system_call;
947 p1.h = _evt_system_call;
952 [sp + PT_RESERVED] = P0;
953 call .Lresume_userspace;
957 ENDPROC(_lower_to_irq14)
959 /* We handle this 100% in exception space - to reduce overhead
960 * Only potiential problem is if the software buffer gets swapped out of the
961 * CPLB table - then double fault. - so we don't let this happen in other places
963 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
964 ENTRY(_ex_trace_buff_full)
970 P5.L = _trace_buff_offset;
971 P5.H = _trace_buff_offset;
972 P3 = [P5]; /* trace_buff_offset */
976 R7 <<= 1; /* double, since we need to read twice */
978 R7 <<= 2; /* need to shift over again,
979 * to get the number of bytes */
982 R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
989 P2.L = _trace_buff_offset;
990 P2.H = _trace_buff_offset;
993 P2.L = _software_trace_buff;
994 P2.H = _software_trace_buff;
996 LSETUP (.Lstart, .Lend) LC0;
998 R7 = [P5]; /* read TBUF */
1012 jump _bfin_return_from_exception;
1013 ENDPROC(_ex_trace_buff_full)
1015 #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
1019 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
1020 ENTRY(_trace_buff_offset)
1023 ENTRY(_software_trace_buff)
1024 .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
1027 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
1029 #if CONFIG_EARLY_PRINTK
1033 trace_buffer_stop(p0,r0);
1035 #if ANOMALY_05000283 || ANOMALY_05000315
1044 /* Turn caches off, to ensure we don't get double exceptions */
1046 P4.L = LO(IMEM_CONTROL);
1047 P4.H = HI(IMEM_CONTROL);
1049 R5 = [P4]; /* Control Register*/
1050 BITCLR(R5,ENICPLB_P);
1052 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
1057 P4.L = LO(DMEM_CONTROL);
1058 P4.H = HI(DMEM_CONTROL);
1060 BITCLR(R5,ENDCPLB_P);
1061 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
1067 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
1073 ENDPROC(_early_trap)
1075 #endif /* CONFIG_EARLY_PRINTK */
1078 * Put these in the kernel data section - that should always be covered by
1079 * a CPLB. This is needed to ensure we don't get double fault conditions
1082 #ifdef CONFIG_SYSCALL_TAB_L1
1089 /* entry for each EXCAUSE[5:0]
1090 * This table must be in sync with the table in ./kernel/traps.c
1091 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
1093 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
1094 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
1096 .long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection
1097 and break signal trap */
1099 .long _ex_replaceable /* 0x02 - User Defined */
1101 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
1102 .long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */
1103 .long _ex_replaceable /* 0x05 - User Defined */
1104 .long _ex_replaceable /* 0x06 - User Defined */
1105 .long _ex_replaceable /* 0x07 - User Defined */
1106 .long _ex_replaceable /* 0x08 - User Defined */
1107 .long _ex_replaceable /* 0x09 - User Defined */
1108 .long _ex_replaceable /* 0x0A - User Defined */
1109 .long _ex_replaceable /* 0x0B - User Defined */
1110 .long _ex_replaceable /* 0x0C - User Defined */
1111 .long _ex_replaceable /* 0x0D - User Defined */
1112 .long _ex_replaceable /* 0x0E - User Defined */
1113 .long _ex_replaceable /* 0x0F - User Defined */
1114 .long _ex_single_step /* 0x10 - HW Single step */
1115 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
1116 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
1118 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
1120 .long _ex_trap_c /* 0x12 - Reserved */
1121 .long _ex_trap_c /* 0x13 - Reserved */
1122 .long _ex_trap_c /* 0x14 - Reserved */
1123 .long _ex_trap_c /* 0x15 - Reserved */
1124 .long _ex_trap_c /* 0x16 - Reserved */
1125 .long _ex_trap_c /* 0x17 - Reserved */
1126 .long _ex_trap_c /* 0x18 - Reserved */
1127 .long _ex_trap_c /* 0x19 - Reserved */
1128 .long _ex_trap_c /* 0x1A - Reserved */
1129 .long _ex_trap_c /* 0x1B - Reserved */
1130 .long _ex_trap_c /* 0x1C - Reserved */
1131 .long _ex_trap_c /* 0x1D - Reserved */
1132 .long _ex_trap_c /* 0x1E - Reserved */
1133 .long _ex_trap_c /* 0x1F - Reserved */
1134 .long _ex_trap_c /* 0x20 - Reserved */
1135 .long _ex_trap_c /* 0x21 - Undefined Instruction */
1136 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
1137 .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
1138 .long _ex_trap_c /* 0x24 - Data access misaligned */
1139 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
1140 .long _ex_dmiss /* 0x26 - Data CPLB Miss */
1141 .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
1142 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
1143 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
1144 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
1145 .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
1146 .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
1147 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
1148 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1149 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1150 .long _ex_trap_c /* 0x2F - Reserved */
1151 .long _ex_trap_c /* 0x30 - Reserved */
1152 .long _ex_trap_c /* 0x31 - Reserved */
1153 .long _ex_trap_c /* 0x32 - Reserved */
1154 .long _ex_trap_c /* 0x33 - Reserved */
1155 .long _ex_trap_c /* 0x34 - Reserved */
1156 .long _ex_trap_c /* 0x35 - Reserved */
1157 .long _ex_trap_c /* 0x36 - Reserved */
1158 .long _ex_trap_c /* 0x37 - Reserved */
1159 .long _ex_trap_c /* 0x38 - Reserved */
1160 .long _ex_trap_c /* 0x39 - Reserved */
1161 .long _ex_trap_c /* 0x3A - Reserved */
1162 .long _ex_trap_c /* 0x3B - Reserved */
1163 .long _ex_trap_c /* 0x3C - Reserved */
1164 .long _ex_trap_c /* 0x3D - Reserved */
1165 .long _ex_trap_c /* 0x3E - Reserved */
1166 .long _ex_trap_c /* 0x3F - Reserved */
1169 ENTRY(_sys_call_table)
1170 .long _sys_restart_syscall /* 0 */
1175 .long _sys_open /* 5 */
1177 .long _sys_ni_syscall /* old waitpid */
1180 .long _sys_unlink /* 10 */
1185 .long _sys_chmod /* 15 */
1186 .long _sys_chown /* chown16 */
1187 .long _sys_ni_syscall /* old break syscall holder */
1188 .long _sys_ni_syscall /* old stat */
1190 .long _sys_getpid /* 20 */
1192 .long _sys_ni_syscall /* old umount */
1195 .long _sys_stime /* 25 */
1198 .long _sys_ni_syscall /* old fstat */
1200 .long _sys_ni_syscall /* old utime */ /* 30 */
1201 .long _sys_ni_syscall /* old stty syscall holder */
1202 .long _sys_ni_syscall /* old gtty syscall holder */
1205 .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
1210 .long _sys_rmdir /* 40 */
1214 .long _sys_ni_syscall /* old prof syscall holder */
1215 .long _sys_brk /* 45 */
1218 .long _sys_ni_syscall /* old sys_signal */
1219 .long _sys_geteuid /* geteuid16 */
1220 .long _sys_getegid /* getegid16 */ /* 50 */
1222 .long _sys_umount /* recycled never used phys() */
1223 .long _sys_ni_syscall /* old lock syscall holder */
1225 .long _sys_fcntl /* 55 */
1226 .long _sys_ni_syscall /* old mpx syscall holder */
1228 .long _sys_ni_syscall /* old ulimit syscall holder */
1229 .long _sys_ni_syscall /* old old uname */
1230 .long _sys_umask /* 60 */
1235 .long _sys_getpgrp /* 65 */
1237 .long _sys_ni_syscall /* old sys_sigaction */
1240 .long _sys_setreuid /* setreuid16 */ /* 70 */
1241 .long _sys_setregid /* setregid16 */
1242 .long _sys_ni_syscall /* old sys_sigsuspend */
1243 .long _sys_ni_syscall /* old sys_sigpending */
1244 .long _sys_sethostname
1245 .long _sys_setrlimit /* 75 */
1246 .long _sys_ni_syscall /* old getrlimit */
1247 .long _sys_getrusage
1248 .long _sys_gettimeofday
1249 .long _sys_settimeofday
1250 .long _sys_getgroups /* getgroups16 */ /* 80 */
1251 .long _sys_setgroups /* setgroups16 */
1252 .long _sys_ni_syscall /* old_select */
1254 .long _sys_ni_syscall /* old lstat */
1255 .long _sys_readlink /* 85 */
1257 .long _sys_ni_syscall /* sys_swapon */
1259 .long _sys_ni_syscall /* old_readdir */
1260 .long _sys_ni_syscall /* sys_mmap */ /* 90 */
1263 .long _sys_ftruncate
1265 .long _sys_fchown /* fchown16 */ /* 95 */
1266 .long _sys_getpriority
1267 .long _sys_setpriority
1268 .long _sys_ni_syscall /* old profil syscall holder */
1270 .long _sys_fstatfs /* 100 */
1271 .long _sys_ni_syscall
1272 .long _sys_ni_syscall /* old sys_socketcall */
1274 .long _sys_setitimer
1275 .long _sys_getitimer /* 105 */
1279 .long _sys_ni_syscall /* old uname */
1280 .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
1282 .long _sys_ni_syscall /* obsolete idle() syscall */
1283 .long _sys_ni_syscall /* vm86old for i386 */
1285 .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
1287 .long _sys_ni_syscall /* old sys_ipc */
1289 .long _sys_ni_syscall /* old sys_sigreturn */
1290 .long _sys_clone /* 120 */
1291 .long _sys_setdomainname
1293 .long _sys_ni_syscall /* old sys_modify_ldt */
1295 .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
1296 .long _sys_ni_syscall /* old sys_sigprocmask */
1297 .long _sys_ni_syscall /* old "creat_module" */
1298 .long _sys_init_module
1299 .long _sys_delete_module
1300 .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
1305 .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
1306 .long _sys_personality
1307 .long _sys_ni_syscall /* for afs_syscall */
1308 .long _sys_setfsuid /* setfsuid16 */
1309 .long _sys_setfsgid /* setfsgid16 */
1310 .long _sys_llseek /* 140 */
1312 .long _sys_ni_syscall /* sys_select */
1314 .long _sys_ni_syscall /* sys_msync */
1315 .long _sys_readv /* 145 */
1318 .long _sys_fdatasync
1320 .long _sys_ni_syscall /* 150 */ /* sys_mlock */
1321 .long _sys_ni_syscall /* sys_munlock */
1322 .long _sys_ni_syscall /* sys_mlockall */
1323 .long _sys_ni_syscall /* sys_munlockall */
1324 .long _sys_sched_setparam
1325 .long _sys_sched_getparam /* 155 */
1326 .long _sys_sched_setscheduler
1327 .long _sys_sched_getscheduler
1328 .long _sys_sched_yield
1329 .long _sys_sched_get_priority_max
1330 .long _sys_sched_get_priority_min /* 160 */
1331 .long _sys_sched_rr_get_interval
1332 .long _sys_nanosleep
1334 .long _sys_setresuid /* setresuid16 */
1335 .long _sys_getresuid /* getresuid16 */ /* 165 */
1336 .long _sys_ni_syscall /* for vm86 */
1337 .long _sys_ni_syscall /* old "query_module" */
1338 .long _sys_ni_syscall /* sys_poll */
1339 .long _sys_nfsservctl
1340 .long _sys_setresgid /* setresgid16 */ /* 170 */
1341 .long _sys_getresgid /* getresgid16 */
1343 .long _sys_rt_sigreturn
1344 .long _sys_rt_sigaction
1345 .long _sys_rt_sigprocmask /* 175 */
1346 .long _sys_rt_sigpending
1347 .long _sys_rt_sigtimedwait
1348 .long _sys_rt_sigqueueinfo
1349 .long _sys_rt_sigsuspend
1350 .long _sys_pread64 /* 180 */
1352 .long _sys_lchown /* lchown16 */
1355 .long _sys_capset /* 185 */
1356 .long _sys_sigaltstack
1358 .long _sys_ni_syscall /* streams1 */
1359 .long _sys_ni_syscall /* streams2 */
1360 .long _sys_vfork /* 190 */
1361 .long _sys_getrlimit
1363 .long _sys_truncate64
1364 .long _sys_ftruncate64
1365 .long _sys_stat64 /* 195 */
1370 .long _sys_getgid /* 200 */
1375 .long _sys_getgroups /* 205 */
1376 .long _sys_setgroups
1378 .long _sys_setresuid
1379 .long _sys_getresuid
1380 .long _sys_setresgid /* 210 */
1381 .long _sys_getresgid
1385 .long _sys_setfsuid /* 215 */
1387 .long _sys_pivot_root
1388 .long _sys_ni_syscall /* sys_mincore */
1389 .long _sys_ni_syscall /* sys_madvise */
1390 .long _sys_getdents64 /* 220 */
1392 .long _sys_ni_syscall /* reserved for TUX */
1393 .long _sys_ni_syscall
1395 .long _sys_readahead /* 225 */
1397 .long _sys_lsetxattr
1398 .long _sys_fsetxattr
1400 .long _sys_lgetxattr /* 230 */
1401 .long _sys_fgetxattr
1402 .long _sys_listxattr
1403 .long _sys_llistxattr
1404 .long _sys_flistxattr
1405 .long _sys_removexattr /* 235 */
1406 .long _sys_lremovexattr
1407 .long _sys_fremovexattr
1409 .long _sys_sendfile64
1410 .long _sys_futex /* 240 */
1411 .long _sys_sched_setaffinity
1412 .long _sys_sched_getaffinity
1413 .long _sys_ni_syscall /* sys_set_thread_area */
1414 .long _sys_ni_syscall /* sys_get_thread_area */
1415 .long _sys_io_setup /* 245 */
1416 .long _sys_io_destroy
1417 .long _sys_io_getevents
1418 .long _sys_io_submit
1419 .long _sys_io_cancel
1420 .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
1421 .long _sys_ni_syscall /* sys_freec_hugepages */
1422 .long _sys_exit_group
1423 .long _sys_lookup_dcookie
1424 .long _sys_bfin_spinlock
1425 .long _sys_epoll_create /* 255 */
1426 .long _sys_epoll_ctl
1427 .long _sys_epoll_wait
1428 .long _sys_ni_syscall /* remap_file_pages */
1429 .long _sys_set_tid_address
1430 .long _sys_timer_create /* 260 */
1431 .long _sys_timer_settime
1432 .long _sys_timer_gettime
1433 .long _sys_timer_getoverrun
1434 .long _sys_timer_delete
1435 .long _sys_clock_settime /* 265 */
1436 .long _sys_clock_gettime
1437 .long _sys_clock_getres
1438 .long _sys_clock_nanosleep
1440 .long _sys_fstatfs64 /* 270 */
1443 .long _sys_fadvise64_64
1444 .long _sys_ni_syscall /* vserver */
1445 .long _sys_ni_syscall /* 275, mbind */
1446 .long _sys_ni_syscall /* get_mempolicy */
1447 .long _sys_ni_syscall /* set_mempolicy */
1449 .long _sys_mq_unlink
1450 .long _sys_mq_timedsend /* 280 */
1451 .long _sys_mq_timedreceive
1452 .long _sys_mq_notify
1453 .long _sys_mq_getsetattr
1454 .long _sys_ni_syscall /* kexec_load */
1455 .long _sys_waitid /* 285 */
1457 .long _sys_request_key
1459 .long _sys_ioprio_set
1460 .long _sys_ioprio_get /* 290 */
1461 .long _sys_inotify_init
1462 .long _sys_inotify_add_watch
1463 .long _sys_inotify_rm_watch
1464 .long _sys_ni_syscall /* migrate_pages */
1465 .long _sys_openat /* 295 */
1469 .long _sys_futimesat
1470 .long _sys_fstatat64 /* 300 */
1474 .long _sys_symlinkat
1475 .long _sys_readlinkat /* 305 */
1477 .long _sys_faccessat
1480 .long _sys_unshare /* 310 */
1481 .long _sys_sram_alloc
1482 .long _sys_sram_free
1483 .long _sys_dma_memcpy
1485 .long _sys_bind /* 315 */
1487 .long _sys_getpeername
1488 .long _sys_getsockname
1489 .long _sys_getsockopt
1490 .long _sys_listen /* 320 */
1495 .long _sys_sendmsg /* 325 */
1497 .long _sys_setsockopt
1500 .long _sys_socketpair /* 330 */
1505 .long _sys_msgget /* 335 */
1510 .long _sys_shmdt /* 340 */
1513 .long _sys_sync_file_range
1515 .long _sys_vmsplice /* 345 */
1516 .long _sys_epoll_pwait
1517 .long _sys_utimensat
1519 .long _sys_timerfd_create
1520 .long _sys_eventfd /* 350 */
1523 .long _sys_fadvise64
1524 .long _sys_set_robust_list
1525 .long _sys_get_robust_list /* 355 */
1526 .long _sys_fallocate
1527 .long _sys_semtimedop
1528 .long _sys_timerfd_settime
1529 .long _sys_timerfd_gettime
1530 .long _sys_signalfd4 /* 360 */
1532 .long _sys_epoll_create1
1535 .long _sys_inotify_init1 /* 365 */
1537 .rept NR_syscalls-(.-_sys_call_table)/4
1538 .long _sys_ni_syscall
1540 END(_sys_call_table)
1546 _exception_stack_top:
1548 #if ANOMALY_05000261
1549 /* Used by the assembly entry point to work around an anomaly. */
1550 _last_cplb_fault_retx: