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 <linux/threads.h>
40 #include <asm/blackfin.h>
41 #include <asm/errno.h>
42 #include <asm/fixed_code.h>
43 #include <asm/thread_info.h> /* TIF_NEED_RESCHED */
44 #include <asm/asm-offsets.h>
45 #include <asm/trace.h>
47 #include <asm/context.S>
49 #if defined(CONFIG_BFIN_SCRATCH_REG_RETN)
50 # define EX_SCRATCH_REG RETN
51 #elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)
52 # define EX_SCRATCH_REG RETE
54 # define EX_SCRATCH_REG CYCLES
57 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
63 /* Slightly simplified and streamlined entry point for CPLB misses.
64 * This one does not lower the level to IRQ5, and thus can be used to
65 * patch up CPLB misses on the kernel stack.
68 #define _ex_dviol _ex_workaround_261
69 #define _ex_dmiss _ex_workaround_261
70 #define _ex_dmult _ex_workaround_261
72 ENTRY(_ex_workaround_261)
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 P4 = R7; /* Store EXCAUSE */
81 r7 = [p5 + PDA_LFRETX];
83 [p5 + PDA_LFRETX] = r6;
85 if !cc jump _bfin_return_from_exception;
88 R6 = 0x26; /* Data CPLB Miss */
90 if cc jump _ex_dcplb_miss (BP);
91 R6 = 0x23; /* Data CPLB Miss */
93 if cc jump _ex_dcplb_viol (BP);
94 /* Handle 0x23 Data CPLB Protection Violation
95 * and Data CPLB Multiple Hits - Linux Trap Zero
98 ENDPROC(_ex_workaround_261)
102 #define _ex_dviol _ex_dcplb_viol
104 #define _ex_dviol _ex_trap_c
106 #define _ex_dmiss _ex_dcplb_miss
107 #define _ex_dmult _ex_trap_c
111 ENTRY(_ex_dcplb_viol)
112 ENTRY(_ex_dcplb_miss)
113 ENTRY(_ex_icplb_miss)
114 (R7:6,P5:4) = [sp++];
118 /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
119 * will change the stack pointer. */
123 DEBUG_HWTRACE_SAVE(p5, r7)
129 IF !CC JUMP _handle_bad_cplb;
134 #ifdef CONFIG_DEBUG_DOUBLEFAULT
135 /* While we were processing this, did we double fault? */
136 r7 = SEQSTAT; /* reason code is in bit 5:0 */
137 r6.l = lo(SEQSTAT_EXCAUSE);
138 r6.h = hi(SEQSTAT_EXCAUSE);
142 if CC JUMP _double_fault;
145 DEBUG_HWTRACE_RESTORE(p5, r7)
149 ENDPROC(_ex_icplb_miss)
152 raise 15; /* invoked by TRAP #0, for sys call */
153 jump.s _bfin_return_from_exception;
163 ENTRY(_ex_single_step)
164 /* If we just returned from an interrupt, the single step event is
165 for the RTI instruction. */
169 if cc jump _bfin_return_from_exception;
172 /* Don't do single step in hardware exception handler */
177 if cc jump _bfin_return_from_exception;
179 if cc jump _bfin_return_from_exception;
181 /* skip single step if current interrupt priority is higher than
182 * that of the first instruction, from which gdb starts single step */
185 .Lfind_priority_start:
187 if cc jump .Lfind_priority_done;
191 if cc jump .Lfind_priority_done;
192 jump.s .Lfind_priority_start;
193 .Lfind_priority_done:
194 p4.l = _kgdb_single_step;
195 p4.h = _kgdb_single_step;
198 if cc jump .Ldo_single_step;
204 /* If we were in user mode, do the single step normally. */
214 /* Single stepping only a single instruction, so clear the trace
223 * We were in an interrupt handler. By convention, all of them save
224 * SYSCFG with their first instruction, so by checking whether our
225 * RETX points at the entry point, we can determine whether to allow
226 * a single step, or whether to clear SYSCFG.
228 * First, find out the interrupt level and the event vector for it.
238 /* What we actually do is test for the _second_ instruction in the
239 * IRQ handler. That way, if there are insns following the restore
240 * of SYSCFG after leaving the handler, we will not turn off SYSCFG
247 if !cc jump _bfin_return_from_exception;
253 /* Fall through to _bfin_return_from_exception. */
254 ENDPROC(_ex_single_step)
256 ENTRY(_bfin_return_from_exception)
264 #ifdef CONFIG_DEBUG_DOUBLEFAULT
265 /* While we were processing the current exception,
266 * did we cause another, and double fault?
268 r7 = SEQSTAT; /* reason code is in bit 5:0 */
269 r6.l = lo(SEQSTAT_EXCAUSE);
270 r6.h = hi(SEQSTAT_EXCAUSE);
274 if CC JUMP _double_fault;
276 /* Did we cause a HW error? */
280 r7 = 0x20; /* Did I just cause anther HW error? */
283 if CC JUMP _double_fault;
286 (R7:6,P5:4) = [sp++];
290 ENDPROC(_bfin_return_from_exception)
292 ENTRY(_handle_bad_cplb)
293 DEBUG_HWTRACE_RESTORE(p5, r7)
294 /* To get here, we just tried and failed to change a CPLB
295 * so, handle things in trap_c (C code), by lowering to
296 * IRQ5, just like we normally do. Since this is not a
297 * "normal" return path, we have a do alot of stuff to
298 * the stack to get ready so, we can fall through - we
299 * need to make a CPLB exception look like a normal exception
304 [--sp] = (R7:6,P5:4);
306 ENTRY(_ex_replaceable)
310 /* Make sure we are not in a double fault */
315 if CC jump _double_fault;
317 /* Call C code (trap_c) to handle the exception, which most
318 * likely involves sending a signal to the current process.
319 * To avoid double faults, lower our priority to IRQ5 first.
321 P5.h = _exception_to_level5;
322 P5.l = _exception_to_level5;
329 #ifndef CONFIG_DEBUG_DOUBLEFAULT
332 * Save these registers, as they are only valid in exception context
333 * (where we are now - as soon as we defer to IRQ5, they can change)
334 * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
335 * but they are not very interesting, so don't save them
338 p4.l = lo(DCPLB_FAULT_ADDR);
339 p4.h = hi(DCPLB_FAULT_ADDR);
341 [p5 + PDA_DCPLB] = r7;
343 p4.l = lo(ICPLB_FAULT_ADDR);
344 p4.h = hi(ICPLB_FAULT_ADDR);
346 [p5 + PDA_ICPLB] = r6;
349 [p5 + PDA_RETX] = r6;
352 [p5 + PDA_SYSCFG] = r6;
356 /* Disable all interrupts, but make sure level 5 is enabled so
357 * we can switch to that level. Save the old mask. */
359 [p5 + PDA_EXIMASK] = r6;
361 p4.l = lo(SAFE_USER_INSTRUCTION);
362 p4.h = hi(SAFE_USER_INSTRUCTION);
369 jump.s _bfin_return_from_exception;
372 /* We just realized we got an exception, while we were processing a different
373 * exception. This is a unrecoverable event, so crash
376 /* Turn caches & protection off, to ensure we don't get any more
380 P4.L = LO(IMEM_CONTROL);
381 P4.H = HI(IMEM_CONTROL);
383 R5 = [P4]; /* Control Register*/
384 BITCLR(R5,ENICPLB_P);
385 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
390 P4.L = LO(DMEM_CONTROL);
391 P4.H = HI(DMEM_CONTROL);
393 BITCLR(R5,ENDCPLB_P);
394 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
399 /* Fix up the stack */
400 (R7:6,P5:4) = [sp++];
404 /* We should be out of the exception stack, and back down into
405 * kernel or user space stack
409 /* The dumping functions expect the return address in the RETI
414 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
416 call _double_fault_c;
418 .L_double_fault_panic:
419 JUMP .L_double_fault_panic
421 ENDPROC(_double_fault)
423 ENTRY(_exception_to_level5)
426 GET_PDA(p4, r7); /* Fetch current PDA */
427 r6 = [p4 + PDA_RETX];
430 r6 = [p4 + PDA_SYSCFG];
431 [sp + PT_SYSCFG] = r6;
433 /* Restore interrupt mask. We haven't pushed RETI, so this
434 * doesn't enable interrupts until we return from this handler. */
435 r6 = [p4 + PDA_EXIMASK];
438 /* Restore the hardware error vector. */
449 r0 = [p2]; /* Read current IPEND */
450 [sp + PT_IPEND] = r0; /* Store IPEND */
452 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
457 #ifdef CONFIG_DEBUG_DOUBLEFAULT
462 r1 = 0x20; /* Did I just cause anther HW error? */
465 if CC JUMP _double_fault;
468 call _ret_from_exception;
471 ENDPROC(_exception_to_level5)
473 ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
474 /* Since the kernel stack can be anywhere, it's not guaranteed to be
475 * covered by a CPLB. Switch to an exception stack; use RETN as a
476 * scratch register (for want of a better option).
480 sp = [sp + PDA_EXSTACK]
481 /* Try to deal with syscalls quickly. */
483 [--sp] = (R7:6,P5:4);
485 #if ANOMALY_05000283 || ANOMALY_05000315
494 #ifdef CONFIG_DEBUG_DOUBLEFAULT
496 * Save these registers, as they are only valid in exception context
497 * (where we are now - as soon as we defer to IRQ5, they can change)
498 * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
499 * but they are not very interesting, so don't save them
503 p4.l = lo(DCPLB_FAULT_ADDR);
504 p4.h = hi(DCPLB_FAULT_ADDR);
506 [p5 + PDA_DCPLB] = r7;
508 p4.l = lo(ICPLB_FAULT_ADDR);
509 p4.h = hi(ICPLB_FAULT_ADDR);
511 [p5 + PDA_ICPLB] = r7;
514 [p5 + PDA_RETX] = r6;
516 r7 = SEQSTAT; /* reason code is in bit 5:0 */
517 [p5 + PDA_SEQSTAT] = r7;
519 r7 = SEQSTAT; /* reason code is in bit 5:0 */
521 r6.l = lo(SEQSTAT_EXCAUSE);
522 r6.h = hi(SEQSTAT_EXCAUSE);
532 r7 = -ENOSYS; /* signextending enough */
533 [sp + PT_R0] = r7; /* return value from system call */
534 jump .Lsyscall_really_exit;
537 ENTRY(_kernel_execve)
540 r3 = SIZEOF_PTREGS / 4;
546 if !cc jump .Lclear_regs (bp);
554 if ! cc jump .Lexecve_failed;
555 /* Success. Copy our temporary pt_regs to the top of the kernel
556 * stack and do a normal exception return.
559 r0 = (-KERNEL_STACK_SIZE) (x);
563 r0 = KERNEL_STACK_SIZE - 4 (z);
569 r3 = SIZEOF_PTREGS / 4;
575 if ! cc jump .Lcopy_regs (bp);
577 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
582 [SP + PT_SYSCFG] = r0;
583 [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
590 ENDPROC(_kernel_execve)
598 [sp + PT_IPEND] = r0;
600 /* Store RETS for now */
602 [sp + PT_RESERVED] = r0;
603 /* Set the stack for the current process */
605 r6.l = lo(ALIGN_PAGE_MASK);
606 r6.h = hi(ALIGN_PAGE_MASK);
607 r7 = r7 & r6; /* thread_info */
611 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
613 /* Check the System Call */
615 /* System call number is passed in P0 */
618 if ! cc jump .Lbadsys;
620 /* are we tracing syscalls?*/
622 r6.l = lo(ALIGN_PAGE_MASK);
623 r6.h = hi(ALIGN_PAGE_MASK);
627 CC = BITTST(r7,TIF_SYSCALL_TRACE);
628 if CC JUMP _sys_trace;
630 /* Execute the appropriate system call */
633 p5.l = _sys_call_table;
634 p5.h = _sys_call_table;
651 r4.l = lo(ALIGN_PAGE_MASK);
652 r4.h = hi(ALIGN_PAGE_MASK);
653 r7 = r7 & r4; /* thread_info->flags */
655 .Lresume_userspace_1:
656 /* Disable interrupts. */
660 r7 = [p5 + TI_FLAGS];
661 r4.l = lo(_TIF_WORK_MASK);
662 r4.h = hi(_TIF_WORK_MASK);
666 cc = BITTST(r7, TIF_NEED_RESCHED);
667 if !cc jump .Lsyscall_sigpending;
669 /* Reenable interrupts. */
677 jump .Lresume_userspace_1;
679 .Lsyscall_sigpending:
680 cc = BITTST(r7, TIF_RESTORE_SIGMASK);
681 if cc jump .Lsyscall_do_signals;
682 cc = BITTST(r7, TIF_SIGPENDING);
683 if !cc jump .Lsyscall_really_exit;
684 .Lsyscall_do_signals:
685 /* Reenable interrupts. */
694 .Lsyscall_really_exit:
695 r5 = [sp + PT_RESERVED];
698 ENDPROC(_system_call)
700 /* Do not mark as ENTRY() to avoid error in assembler ...
701 * this symbol need not be global anyways, so ...
706 /* Execute the appropriate system call */
709 p5.l = _sys_call_table;
710 p5.h = _sys_call_table;
729 jump .Lresume_userspace;
734 * Beware - when entering resume, prev (the current task) is
735 * in r0, next (the new task) is in r1.
741 [--sp] = (r7:4, p5:3);
745 [p0+(TASK_THREAD+THREAD_USP)] = p2;
747 /* save current kernel stack pointer */
748 [p0+(TASK_THREAD+THREAD_KSP)] = sp;
750 /* save program counter */
751 r1.l = _new_old_task;
752 r1.h = _new_old_task;
753 [p0+(TASK_THREAD+THREAD_PC)] = r1;
755 /* restore the kernel stack pointer */
756 sp = [p1+(TASK_THREAD+THREAD_KSP)];
758 /* restore user stack pointer */
759 p0 = [p1+(TASK_THREAD+THREAD_USP)];
763 p0 = [p1+(TASK_THREAD+THREAD_PC)];
767 * Following code actually lands up in a new (old) task.
771 (r7:4, p5:3) = [sp++];
776 * When we come out of resume, r0 carries "old" task, becuase we are
782 ENTRY(_ret_from_exception)
788 [sp + PT_IPEND] = r0;
794 if !cc jump 4f; /* if not return to user mode, get out */
796 /* Make sure any pending system call or deferred exception
797 * return in ILAT for this process to get executed, otherwise
798 * in case context switch happens, system call of
799 * first process (i.e in ILAT) will be carried
800 * forward to the switched process
806 r1 = (EVT_IVG14 | EVT_IVG15) (z);
811 /* Set the stack for the current process */
813 r4.l = lo(ALIGN_PAGE_MASK);
814 r4.h = hi(ALIGN_PAGE_MASK);
815 r7 = r7 & r4; /* thread_info->flags */
817 r7 = [p5 + TI_FLAGS];
818 r4.l = lo(_TIF_WORK_MASK);
819 r4.h = hi(_TIF_WORK_MASK);
826 p1.l = _schedule_and_signal;
827 p1.h = _schedule_and_signal;
830 raise 15; /* raise evt14 to do signal or reschedule */
837 ENDPROC(_ret_from_exception)
839 ENTRY(_return_from_int)
840 /* If someone else already raised IRQ 15, do nothing. */
845 cc = bittst (r0, EVT_IVG15_P);
848 /* if not return to user mode, get out */
862 /* Lower the interrupt level to 15. */
865 p1.l = _schedule_and_signal_from_int;
866 p1.h = _schedule_and_signal_from_int;
870 r0.l = lo(SAFE_USER_INSTRUCTION);
871 r0.h = hi(SAFE_USER_INSTRUCTION);
876 raise 15; /* raise evt15 to do signal or reschedule */
880 ENDPROC(_return_from_int)
882 ENTRY(_lower_to_irq14)
884 r0.l = lo(SAFE_USER_INSTRUCTION);
885 r0.h = hi(SAFE_USER_INSTRUCTION);
892 ENTRY(_evt14_softirq)
893 #ifdef CONFIG_DEBUG_HWERR
903 _schedule_and_signal_from_int:
904 /* To end up here, vector 15 was changed - so we have to change it
909 p1.l = _evt_system_call;
910 p1.h = _evt_system_call;
914 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
916 [sp + PT_ORIG_P0] = r0;
919 [sp + PT_RESERVED] = p1;
922 GET_PDA(p0, r0); /* Fetch current PDA (can't migrate to other CPU here) */
923 r0 = [p0 + PDA_IRQFLAGS];
933 call _finish_atomic_sections;
935 jump.s .Lresume_userspace;
937 _schedule_and_signal:
939 /* To end up here, vector 15 was changed - so we have to change it
944 p1.l = _evt_system_call;
945 p1.h = _evt_system_call;
950 [sp + PT_RESERVED] = P0;
951 call .Lresume_userspace;
955 ENDPROC(_lower_to_irq14)
957 /* We handle this 100% in exception space - to reduce overhead
958 * Only potiential problem is if the software buffer gets swapped out of the
959 * CPLB table - then double fault. - so we don't let this happen in other places
961 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
962 ENTRY(_ex_trace_buff_full)
968 P5.L = _trace_buff_offset;
969 P5.H = _trace_buff_offset;
970 P3 = [P5]; /* trace_buff_offset */
974 R7 <<= 1; /* double, since we need to read twice */
976 R7 <<= 2; /* need to shift over again,
977 * to get the number of bytes */
980 R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
987 P2.L = _trace_buff_offset;
988 P2.H = _trace_buff_offset;
991 P2.L = _software_trace_buff;
992 P2.H = _software_trace_buff;
994 LSETUP (.Lstart, .Lend) LC0;
996 R7 = [P5]; /* read TBUF */
1010 jump _bfin_return_from_exception;
1011 ENDPROC(_ex_trace_buff_full)
1013 #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
1017 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
1018 ENTRY(_trace_buff_offset)
1021 ENTRY(_software_trace_buff)
1022 .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
1025 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
1027 #if CONFIG_EARLY_PRINTK
1031 trace_buffer_stop(p0,r0);
1033 #if ANOMALY_05000283 || ANOMALY_05000315
1042 /* Turn caches off, to ensure we don't get double exceptions */
1044 P4.L = LO(IMEM_CONTROL);
1045 P4.H = HI(IMEM_CONTROL);
1047 R5 = [P4]; /* Control Register*/
1048 BITCLR(R5,ENICPLB_P);
1050 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
1055 P4.L = LO(DMEM_CONTROL);
1056 P4.H = HI(DMEM_CONTROL);
1058 BITCLR(R5,ENDCPLB_P);
1059 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
1065 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
1071 ENDPROC(_early_trap)
1073 #endif /* CONFIG_EARLY_PRINTK */
1076 * Put these in the kernel data section - that should always be covered by
1077 * a CPLB. This is needed to ensure we don't get double fault conditions
1080 #ifdef CONFIG_SYSCALL_TAB_L1
1087 /* entry for each EXCAUSE[5:0]
1088 * This table must be in sync with the table in ./kernel/traps.c
1089 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
1091 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
1092 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
1094 .long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection
1095 and break signal trap */
1097 .long _ex_replaceable /* 0x02 - User Defined */
1099 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
1100 .long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */
1101 .long _ex_replaceable /* 0x05 - User Defined */
1102 .long _ex_replaceable /* 0x06 - User Defined */
1103 .long _ex_replaceable /* 0x07 - User Defined */
1104 .long _ex_replaceable /* 0x08 - User Defined */
1105 .long _ex_replaceable /* 0x09 - User Defined */
1106 .long _ex_replaceable /* 0x0A - User Defined */
1107 .long _ex_replaceable /* 0x0B - User Defined */
1108 .long _ex_replaceable /* 0x0C - User Defined */
1109 .long _ex_replaceable /* 0x0D - User Defined */
1110 .long _ex_replaceable /* 0x0E - User Defined */
1111 .long _ex_replaceable /* 0x0F - User Defined */
1112 .long _ex_single_step /* 0x10 - HW Single step */
1113 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
1114 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
1116 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
1118 .long _ex_trap_c /* 0x12 - Reserved */
1119 .long _ex_trap_c /* 0x13 - Reserved */
1120 .long _ex_trap_c /* 0x14 - Reserved */
1121 .long _ex_trap_c /* 0x15 - Reserved */
1122 .long _ex_trap_c /* 0x16 - Reserved */
1123 .long _ex_trap_c /* 0x17 - Reserved */
1124 .long _ex_trap_c /* 0x18 - Reserved */
1125 .long _ex_trap_c /* 0x19 - Reserved */
1126 .long _ex_trap_c /* 0x1A - Reserved */
1127 .long _ex_trap_c /* 0x1B - Reserved */
1128 .long _ex_trap_c /* 0x1C - Reserved */
1129 .long _ex_trap_c /* 0x1D - Reserved */
1130 .long _ex_trap_c /* 0x1E - Reserved */
1131 .long _ex_trap_c /* 0x1F - Reserved */
1132 .long _ex_trap_c /* 0x20 - Reserved */
1133 .long _ex_trap_c /* 0x21 - Undefined Instruction */
1134 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
1135 .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
1136 .long _ex_trap_c /* 0x24 - Data access misaligned */
1137 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
1138 .long _ex_dmiss /* 0x26 - Data CPLB Miss */
1139 .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
1140 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
1141 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
1142 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
1143 .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
1144 .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
1145 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
1146 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1147 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1148 .long _ex_trap_c /* 0x2F - Reserved */
1149 .long _ex_trap_c /* 0x30 - Reserved */
1150 .long _ex_trap_c /* 0x31 - Reserved */
1151 .long _ex_trap_c /* 0x32 - Reserved */
1152 .long _ex_trap_c /* 0x33 - Reserved */
1153 .long _ex_trap_c /* 0x34 - Reserved */
1154 .long _ex_trap_c /* 0x35 - Reserved */
1155 .long _ex_trap_c /* 0x36 - Reserved */
1156 .long _ex_trap_c /* 0x37 - Reserved */
1157 .long _ex_trap_c /* 0x38 - Reserved */
1158 .long _ex_trap_c /* 0x39 - Reserved */
1159 .long _ex_trap_c /* 0x3A - Reserved */
1160 .long _ex_trap_c /* 0x3B - Reserved */
1161 .long _ex_trap_c /* 0x3C - Reserved */
1162 .long _ex_trap_c /* 0x3D - Reserved */
1163 .long _ex_trap_c /* 0x3E - Reserved */
1164 .long _ex_trap_c /* 0x3F - Reserved */
1167 ENTRY(_sys_call_table)
1168 .long _sys_restart_syscall /* 0 */
1173 .long _sys_open /* 5 */
1175 .long _sys_ni_syscall /* old waitpid */
1178 .long _sys_unlink /* 10 */
1183 .long _sys_chmod /* 15 */
1184 .long _sys_chown /* chown16 */
1185 .long _sys_ni_syscall /* old break syscall holder */
1186 .long _sys_ni_syscall /* old stat */
1188 .long _sys_getpid /* 20 */
1190 .long _sys_ni_syscall /* old umount */
1193 .long _sys_stime /* 25 */
1196 .long _sys_ni_syscall /* old fstat */
1198 .long _sys_ni_syscall /* old utime */ /* 30 */
1199 .long _sys_ni_syscall /* old stty syscall holder */
1200 .long _sys_ni_syscall /* old gtty syscall holder */
1203 .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
1208 .long _sys_rmdir /* 40 */
1212 .long _sys_ni_syscall /* old prof syscall holder */
1213 .long _sys_brk /* 45 */
1216 .long _sys_ni_syscall /* old sys_signal */
1217 .long _sys_geteuid /* geteuid16 */
1218 .long _sys_getegid /* getegid16 */ /* 50 */
1220 .long _sys_umount /* recycled never used phys() */
1221 .long _sys_ni_syscall /* old lock syscall holder */
1223 .long _sys_fcntl /* 55 */
1224 .long _sys_ni_syscall /* old mpx syscall holder */
1226 .long _sys_ni_syscall /* old ulimit syscall holder */
1227 .long _sys_ni_syscall /* old old uname */
1228 .long _sys_umask /* 60 */
1233 .long _sys_getpgrp /* 65 */
1235 .long _sys_ni_syscall /* old sys_sigaction */
1238 .long _sys_setreuid /* setreuid16 */ /* 70 */
1239 .long _sys_setregid /* setregid16 */
1240 .long _sys_ni_syscall /* old sys_sigsuspend */
1241 .long _sys_ni_syscall /* old sys_sigpending */
1242 .long _sys_sethostname
1243 .long _sys_setrlimit /* 75 */
1244 .long _sys_ni_syscall /* old getrlimit */
1245 .long _sys_getrusage
1246 .long _sys_gettimeofday
1247 .long _sys_settimeofday
1248 .long _sys_getgroups /* getgroups16 */ /* 80 */
1249 .long _sys_setgroups /* setgroups16 */
1250 .long _sys_ni_syscall /* old_select */
1252 .long _sys_ni_syscall /* old lstat */
1253 .long _sys_readlink /* 85 */
1255 .long _sys_ni_syscall /* sys_swapon */
1257 .long _sys_ni_syscall /* old_readdir */
1258 .long _sys_ni_syscall /* sys_mmap */ /* 90 */
1261 .long _sys_ftruncate
1263 .long _sys_fchown /* fchown16 */ /* 95 */
1264 .long _sys_getpriority
1265 .long _sys_setpriority
1266 .long _sys_ni_syscall /* old profil syscall holder */
1268 .long _sys_fstatfs /* 100 */
1269 .long _sys_ni_syscall
1270 .long _sys_ni_syscall /* old sys_socketcall */
1272 .long _sys_setitimer
1273 .long _sys_getitimer /* 105 */
1277 .long _sys_ni_syscall /* old uname */
1278 .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
1280 .long _sys_ni_syscall /* obsolete idle() syscall */
1281 .long _sys_ni_syscall /* vm86old for i386 */
1283 .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
1285 .long _sys_ni_syscall /* old sys_ipc */
1287 .long _sys_ni_syscall /* old sys_sigreturn */
1288 .long _sys_clone /* 120 */
1289 .long _sys_setdomainname
1291 .long _sys_ni_syscall /* old sys_modify_ldt */
1293 .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
1294 .long _sys_ni_syscall /* old sys_sigprocmask */
1295 .long _sys_ni_syscall /* old "creat_module" */
1296 .long _sys_init_module
1297 .long _sys_delete_module
1298 .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
1303 .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
1304 .long _sys_personality
1305 .long _sys_ni_syscall /* for afs_syscall */
1306 .long _sys_setfsuid /* setfsuid16 */
1307 .long _sys_setfsgid /* setfsgid16 */
1308 .long _sys_llseek /* 140 */
1310 .long _sys_ni_syscall /* sys_select */
1312 .long _sys_ni_syscall /* sys_msync */
1313 .long _sys_readv /* 145 */
1316 .long _sys_fdatasync
1318 .long _sys_ni_syscall /* 150 */ /* sys_mlock */
1319 .long _sys_ni_syscall /* sys_munlock */
1320 .long _sys_ni_syscall /* sys_mlockall */
1321 .long _sys_ni_syscall /* sys_munlockall */
1322 .long _sys_sched_setparam
1323 .long _sys_sched_getparam /* 155 */
1324 .long _sys_sched_setscheduler
1325 .long _sys_sched_getscheduler
1326 .long _sys_sched_yield
1327 .long _sys_sched_get_priority_max
1328 .long _sys_sched_get_priority_min /* 160 */
1329 .long _sys_sched_rr_get_interval
1330 .long _sys_nanosleep
1332 .long _sys_setresuid /* setresuid16 */
1333 .long _sys_getresuid /* getresuid16 */ /* 165 */
1334 .long _sys_ni_syscall /* for vm86 */
1335 .long _sys_ni_syscall /* old "query_module" */
1336 .long _sys_ni_syscall /* sys_poll */
1337 .long _sys_nfsservctl
1338 .long _sys_setresgid /* setresgid16 */ /* 170 */
1339 .long _sys_getresgid /* getresgid16 */
1341 .long _sys_rt_sigreturn
1342 .long _sys_rt_sigaction
1343 .long _sys_rt_sigprocmask /* 175 */
1344 .long _sys_rt_sigpending
1345 .long _sys_rt_sigtimedwait
1346 .long _sys_rt_sigqueueinfo
1347 .long _sys_rt_sigsuspend
1348 .long _sys_pread64 /* 180 */
1350 .long _sys_lchown /* lchown16 */
1353 .long _sys_capset /* 185 */
1354 .long _sys_sigaltstack
1356 .long _sys_ni_syscall /* streams1 */
1357 .long _sys_ni_syscall /* streams2 */
1358 .long _sys_vfork /* 190 */
1359 .long _sys_getrlimit
1361 .long _sys_truncate64
1362 .long _sys_ftruncate64
1363 .long _sys_stat64 /* 195 */
1368 .long _sys_getgid /* 200 */
1373 .long _sys_getgroups /* 205 */
1374 .long _sys_setgroups
1376 .long _sys_setresuid
1377 .long _sys_getresuid
1378 .long _sys_setresgid /* 210 */
1379 .long _sys_getresgid
1383 .long _sys_setfsuid /* 215 */
1385 .long _sys_pivot_root
1386 .long _sys_ni_syscall /* sys_mincore */
1387 .long _sys_ni_syscall /* sys_madvise */
1388 .long _sys_getdents64 /* 220 */
1390 .long _sys_ni_syscall /* reserved for TUX */
1391 .long _sys_ni_syscall
1393 .long _sys_readahead /* 225 */
1395 .long _sys_lsetxattr
1396 .long _sys_fsetxattr
1398 .long _sys_lgetxattr /* 230 */
1399 .long _sys_fgetxattr
1400 .long _sys_listxattr
1401 .long _sys_llistxattr
1402 .long _sys_flistxattr
1403 .long _sys_removexattr /* 235 */
1404 .long _sys_lremovexattr
1405 .long _sys_fremovexattr
1407 .long _sys_sendfile64
1408 .long _sys_futex /* 240 */
1409 .long _sys_sched_setaffinity
1410 .long _sys_sched_getaffinity
1411 .long _sys_ni_syscall /* sys_set_thread_area */
1412 .long _sys_ni_syscall /* sys_get_thread_area */
1413 .long _sys_io_setup /* 245 */
1414 .long _sys_io_destroy
1415 .long _sys_io_getevents
1416 .long _sys_io_submit
1417 .long _sys_io_cancel
1418 .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
1419 .long _sys_ni_syscall /* sys_freec_hugepages */
1420 .long _sys_exit_group
1421 .long _sys_lookup_dcookie
1422 .long _sys_bfin_spinlock
1423 .long _sys_epoll_create /* 255 */
1424 .long _sys_epoll_ctl
1425 .long _sys_epoll_wait
1426 .long _sys_ni_syscall /* remap_file_pages */
1427 .long _sys_set_tid_address
1428 .long _sys_timer_create /* 260 */
1429 .long _sys_timer_settime
1430 .long _sys_timer_gettime
1431 .long _sys_timer_getoverrun
1432 .long _sys_timer_delete
1433 .long _sys_clock_settime /* 265 */
1434 .long _sys_clock_gettime
1435 .long _sys_clock_getres
1436 .long _sys_clock_nanosleep
1438 .long _sys_fstatfs64 /* 270 */
1441 .long _sys_fadvise64_64
1442 .long _sys_ni_syscall /* vserver */
1443 .long _sys_ni_syscall /* 275, mbind */
1444 .long _sys_ni_syscall /* get_mempolicy */
1445 .long _sys_ni_syscall /* set_mempolicy */
1447 .long _sys_mq_unlink
1448 .long _sys_mq_timedsend /* 280 */
1449 .long _sys_mq_timedreceive
1450 .long _sys_mq_notify
1451 .long _sys_mq_getsetattr
1452 .long _sys_ni_syscall /* kexec_load */
1453 .long _sys_waitid /* 285 */
1455 .long _sys_request_key
1457 .long _sys_ioprio_set
1458 .long _sys_ioprio_get /* 290 */
1459 .long _sys_inotify_init
1460 .long _sys_inotify_add_watch
1461 .long _sys_inotify_rm_watch
1462 .long _sys_ni_syscall /* migrate_pages */
1463 .long _sys_openat /* 295 */
1467 .long _sys_futimesat
1468 .long _sys_fstatat64 /* 300 */
1472 .long _sys_symlinkat
1473 .long _sys_readlinkat /* 305 */
1475 .long _sys_faccessat
1478 .long _sys_unshare /* 310 */
1479 .long _sys_sram_alloc
1480 .long _sys_sram_free
1481 .long _sys_dma_memcpy
1483 .long _sys_bind /* 315 */
1485 .long _sys_getpeername
1486 .long _sys_getsockname
1487 .long _sys_getsockopt
1488 .long _sys_listen /* 320 */
1493 .long _sys_sendmsg /* 325 */
1495 .long _sys_setsockopt
1498 .long _sys_socketpair /* 330 */
1503 .long _sys_msgget /* 335 */
1508 .long _sys_shmdt /* 340 */
1511 .long _sys_sync_file_range
1513 .long _sys_vmsplice /* 345 */
1514 .long _sys_epoll_pwait
1515 .long _sys_utimensat
1517 .long _sys_timerfd_create
1518 .long _sys_eventfd /* 350 */
1521 .long _sys_fadvise64
1522 .long _sys_set_robust_list
1523 .long _sys_get_robust_list /* 355 */
1524 .long _sys_fallocate
1525 .long _sys_semtimedop
1526 .long _sys_timerfd_settime
1527 .long _sys_timerfd_gettime
1528 .long _sys_signalfd4 /* 360 */
1530 .long _sys_epoll_create1
1533 .long _sys_inotify_init1 /* 365 */
1535 .rept NR_syscalls-(.-_sys_call_table)/4
1536 .long _sys_ni_syscall
1538 END(_sys_call_table)
1540 #ifdef CONFIG_EXCEPTION_L1_SCRATCH
1541 /* .section .l1.bss.scratch */
1542 .set _exception_stack_top, L1_SCRATCH_START + L1_SCRATCH_LENGTH
1544 #ifdef CONFIG_SYSCALL_TAB_L1
1549 ENTRY(_exception_stack)
1550 .rept 1024 * NR_CPUS
1553 _exception_stack_top: