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.
374 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ...
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)
427 GET_PDA(p4, r7); /* Fetch current PDA */
428 r6 = [p4 + PDA_RETX];
431 r6 = [p4 + PDA_SYSCFG];
432 [sp + PT_SYSCFG] = r6;
434 /* Restore interrupt mask. We haven't pushed RETI, so this
435 * doesn't enable interrupts until we return from this handler. */
436 r6 = [p4 + PDA_EXIMASK];
439 /* Restore the hardware error vector. */
450 r0 = [p2]; /* Read current IPEND */
451 [sp + PT_IPEND] = r0; /* Store IPEND */
453 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
458 #ifdef CONFIG_DEBUG_DOUBLEFAULT
463 r1 = 0x20; /* Did I just cause anther HW error? */
466 if CC JUMP _double_fault;
469 call _ret_from_exception;
472 ENDPROC(_exception_to_level5)
474 ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
475 /* Since the kernel stack can be anywhere, it's not guaranteed to be
476 * covered by a CPLB. Switch to an exception stack; use RETN as a
477 * scratch register (for want of a better option).
481 sp = [sp + PDA_EXSTACK]
482 /* Try to deal with syscalls quickly. */
484 [--sp] = (R7:6,P5:4);
486 #if ANOMALY_05000283 || ANOMALY_05000315
495 #ifdef CONFIG_DEBUG_DOUBLEFAULT
497 * Save these registers, as they are only valid in exception context
498 * (where we are now - as soon as we defer to IRQ5, they can change)
499 * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
500 * 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 + PDA_DCPLB] = r7;
509 p4.l = lo(ICPLB_FAULT_ADDR);
510 p4.h = hi(ICPLB_FAULT_ADDR);
512 [p5 + PDA_ICPLB] = r7;
515 [p5 + PDA_RETX] = r6;
517 r7 = SEQSTAT; /* reason code is in bit 5:0 */
518 [p5 + PDA_SEQSTAT] = r7;
520 r7 = SEQSTAT; /* reason code is in bit 5:0 */
522 r6.l = lo(SEQSTAT_EXCAUSE);
523 r6.h = hi(SEQSTAT_EXCAUSE);
533 r7 = -ENOSYS; /* signextending enough */
534 [sp + PT_R0] = r7; /* return value from system call */
535 jump .Lsyscall_really_exit;
538 ENTRY(_kernel_execve)
541 r3 = SIZEOF_PTREGS / 4;
547 if !cc jump .Lclear_regs (bp);
555 if ! cc jump .Lexecve_failed;
556 /* Success. Copy our temporary pt_regs to the top of the kernel
557 * stack and do a normal exception return.
560 r0 = (-KERNEL_STACK_SIZE) (x);
564 r0 = KERNEL_STACK_SIZE - 4 (z);
570 r3 = SIZEOF_PTREGS / 4;
576 if ! cc jump .Lcopy_regs (bp);
578 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
583 [SP + PT_SYSCFG] = r0;
584 [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
591 ENDPROC(_kernel_execve)
599 [sp + PT_IPEND] = r0;
601 /* Store RETS for now */
603 [sp + PT_RESERVED] = r0;
604 /* Set the stack for the current process */
606 r6.l = lo(ALIGN_PAGE_MASK);
607 r6.h = hi(ALIGN_PAGE_MASK);
608 r7 = r7 & r6; /* thread_info */
612 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
614 /* Check the System Call */
616 /* System call number is passed in P0 */
619 if ! cc jump .Lbadsys;
621 /* are we tracing syscalls?*/
623 r6.l = lo(ALIGN_PAGE_MASK);
624 r6.h = hi(ALIGN_PAGE_MASK);
628 CC = BITTST(r7,TIF_SYSCALL_TRACE);
629 if CC JUMP _sys_trace;
631 /* Execute the appropriate system call */
634 p5.l = _sys_call_table;
635 p5.h = _sys_call_table;
652 r4.l = lo(ALIGN_PAGE_MASK);
653 r4.h = hi(ALIGN_PAGE_MASK);
654 r7 = r7 & r4; /* thread_info->flags */
656 .Lresume_userspace_1:
657 /* Disable interrupts. */
661 r7 = [p5 + TI_FLAGS];
662 r4.l = lo(_TIF_WORK_MASK);
663 r4.h = hi(_TIF_WORK_MASK);
667 cc = BITTST(r7, TIF_NEED_RESCHED);
668 if !cc jump .Lsyscall_sigpending;
670 /* Reenable interrupts. */
678 jump .Lresume_userspace_1;
680 .Lsyscall_sigpending:
681 cc = BITTST(r7, TIF_RESTORE_SIGMASK);
682 if cc jump .Lsyscall_do_signals;
683 cc = BITTST(r7, TIF_SIGPENDING);
684 if !cc jump .Lsyscall_really_exit;
685 .Lsyscall_do_signals:
686 /* Reenable interrupts. */
695 .Lsyscall_really_exit:
696 r5 = [sp + PT_RESERVED];
699 ENDPROC(_system_call)
701 /* Do not mark as ENTRY() to avoid error in assembler ...
702 * this symbol need not be global anyways, so ...
707 /* Execute the appropriate system call */
710 p5.l = _sys_call_table;
711 p5.h = _sys_call_table;
730 jump .Lresume_userspace;
735 * Beware - when entering resume, prev (the current task) is
736 * in r0, next (the new task) is in r1.
742 [--sp] = (r7:4, p5:3);
746 [p0+(TASK_THREAD+THREAD_USP)] = p2;
748 /* save current kernel stack pointer */
749 [p0+(TASK_THREAD+THREAD_KSP)] = sp;
751 /* save program counter */
752 r1.l = _new_old_task;
753 r1.h = _new_old_task;
754 [p0+(TASK_THREAD+THREAD_PC)] = r1;
756 /* restore the kernel stack pointer */
757 sp = [p1+(TASK_THREAD+THREAD_KSP)];
759 /* restore user stack pointer */
760 p0 = [p1+(TASK_THREAD+THREAD_USP)];
764 p0 = [p1+(TASK_THREAD+THREAD_PC)];
768 * Following code actually lands up in a new (old) task.
772 (r7:4, p5:3) = [sp++];
777 * When we come out of resume, r0 carries "old" task, becuase we are
783 ENTRY(_ret_from_exception)
789 [sp + PT_IPEND] = r0;
795 if !cc jump 4f; /* if not return to user mode, get out */
797 /* Make sure any pending system call or deferred exception
798 * return in ILAT for this process to get executed, otherwise
799 * in case context switch happens, system call of
800 * first process (i.e in ILAT) will be carried
801 * forward to the switched process
807 r1 = (EVT_IVG14 | EVT_IVG15) (z);
812 /* Set the stack for the current process */
814 r4.l = lo(ALIGN_PAGE_MASK);
815 r4.h = hi(ALIGN_PAGE_MASK);
816 r7 = r7 & r4; /* thread_info->flags */
818 r7 = [p5 + TI_FLAGS];
819 r4.l = lo(_TIF_WORK_MASK);
820 r4.h = hi(_TIF_WORK_MASK);
827 p1.l = _schedule_and_signal;
828 p1.h = _schedule_and_signal;
831 raise 15; /* raise evt14 to do signal or reschedule */
838 ENDPROC(_ret_from_exception)
840 ENTRY(_return_from_int)
841 /* If someone else already raised IRQ 15, do nothing. */
846 cc = bittst (r0, EVT_IVG15_P);
849 /* if not return to user mode, get out */
863 /* Lower the interrupt level to 15. */
866 p1.l = _schedule_and_signal_from_int;
867 p1.h = _schedule_and_signal_from_int;
871 r0.l = lo(SAFE_USER_INSTRUCTION);
872 r0.h = hi(SAFE_USER_INSTRUCTION);
877 raise 15; /* raise evt15 to do signal or reschedule */
881 ENDPROC(_return_from_int)
883 ENTRY(_lower_to_irq14)
885 r0.l = lo(SAFE_USER_INSTRUCTION);
886 r0.h = hi(SAFE_USER_INSTRUCTION);
893 ENTRY(_evt14_softirq)
894 #ifdef CONFIG_DEBUG_HWERR
904 _schedule_and_signal_from_int:
905 /* To end up here, vector 15 was changed - so we have to change it
910 p1.l = _evt_system_call;
911 p1.h = _evt_system_call;
915 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
917 [sp + PT_ORIG_P0] = r0;
920 [sp + PT_RESERVED] = p1;
923 GET_PDA(p0, r0); /* Fetch current PDA (can't migrate to other CPU here) */
924 r0 = [p0 + PDA_IRQFLAGS];
926 p0.l = _bfin_irq_flags;
927 p0.h = _bfin_irq_flags;
934 call _finish_atomic_sections;
936 jump.s .Lresume_userspace;
938 _schedule_and_signal:
940 /* To end up here, vector 15 was changed - so we have to change it
945 p1.l = _evt_system_call;
946 p1.h = _evt_system_call;
951 [sp + PT_RESERVED] = P0;
952 call .Lresume_userspace;
956 ENDPROC(_lower_to_irq14)
958 /* We handle this 100% in exception space - to reduce overhead
959 * Only potiential problem is if the software buffer gets swapped out of the
960 * CPLB table - then double fault. - so we don't let this happen in other places
962 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
963 ENTRY(_ex_trace_buff_full)
969 P5.L = _trace_buff_offset;
970 P5.H = _trace_buff_offset;
971 P3 = [P5]; /* trace_buff_offset */
975 R7 <<= 1; /* double, since we need to read twice */
977 R7 <<= 2; /* need to shift over again,
978 * to get the number of bytes */
981 R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
988 P2.L = _trace_buff_offset;
989 P2.H = _trace_buff_offset;
992 P2.L = _software_trace_buff;
993 P2.H = _software_trace_buff;
995 LSETUP (.Lstart, .Lend) LC0;
997 R7 = [P5]; /* read TBUF */
1011 jump _bfin_return_from_exception;
1012 ENDPROC(_ex_trace_buff_full)
1014 #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
1018 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
1019 ENTRY(_trace_buff_offset)
1022 ENTRY(_software_trace_buff)
1023 .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
1026 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
1028 #if CONFIG_EARLY_PRINTK
1032 trace_buffer_stop(p0,r0);
1034 #if ANOMALY_05000283 || ANOMALY_05000315
1043 /* Turn caches off, to ensure we don't get double exceptions */
1045 P4.L = LO(IMEM_CONTROL);
1046 P4.H = HI(IMEM_CONTROL);
1048 R5 = [P4]; /* Control Register*/
1049 BITCLR(R5,ENICPLB_P);
1051 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
1056 P4.L = LO(DMEM_CONTROL);
1057 P4.H = HI(DMEM_CONTROL);
1059 BITCLR(R5,ENDCPLB_P);
1060 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
1066 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
1072 ENDPROC(_early_trap)
1074 #endif /* CONFIG_EARLY_PRINTK */
1077 * Put these in the kernel data section - that should always be covered by
1078 * a CPLB. This is needed to ensure we don't get double fault conditions
1081 #ifdef CONFIG_SYSCALL_TAB_L1
1088 /* entry for each EXCAUSE[5:0]
1089 * This table must be in sync with the table in ./kernel/traps.c
1090 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
1092 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
1093 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
1095 .long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection
1096 and break signal trap */
1098 .long _ex_replaceable /* 0x02 - User Defined */
1100 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
1101 .long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */
1102 .long _ex_replaceable /* 0x05 - User Defined */
1103 .long _ex_replaceable /* 0x06 - User Defined */
1104 .long _ex_replaceable /* 0x07 - User Defined */
1105 .long _ex_replaceable /* 0x08 - User Defined */
1106 .long _ex_replaceable /* 0x09 - User Defined */
1107 .long _ex_replaceable /* 0x0A - User Defined */
1108 .long _ex_replaceable /* 0x0B - User Defined */
1109 .long _ex_replaceable /* 0x0C - User Defined */
1110 .long _ex_replaceable /* 0x0D - User Defined */
1111 .long _ex_replaceable /* 0x0E - User Defined */
1112 .long _ex_replaceable /* 0x0F - User Defined */
1113 .long _ex_single_step /* 0x10 - HW Single step */
1114 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
1115 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
1117 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
1119 .long _ex_trap_c /* 0x12 - Reserved */
1120 .long _ex_trap_c /* 0x13 - Reserved */
1121 .long _ex_trap_c /* 0x14 - Reserved */
1122 .long _ex_trap_c /* 0x15 - Reserved */
1123 .long _ex_trap_c /* 0x16 - Reserved */
1124 .long _ex_trap_c /* 0x17 - Reserved */
1125 .long _ex_trap_c /* 0x18 - Reserved */
1126 .long _ex_trap_c /* 0x19 - Reserved */
1127 .long _ex_trap_c /* 0x1A - Reserved */
1128 .long _ex_trap_c /* 0x1B - Reserved */
1129 .long _ex_trap_c /* 0x1C - Reserved */
1130 .long _ex_trap_c /* 0x1D - Reserved */
1131 .long _ex_trap_c /* 0x1E - Reserved */
1132 .long _ex_trap_c /* 0x1F - Reserved */
1133 .long _ex_trap_c /* 0x20 - Reserved */
1134 .long _ex_trap_c /* 0x21 - Undefined Instruction */
1135 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
1136 .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
1137 .long _ex_trap_c /* 0x24 - Data access misaligned */
1138 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
1139 .long _ex_dmiss /* 0x26 - Data CPLB Miss */
1140 .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
1141 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
1142 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
1143 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
1144 .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
1145 .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
1146 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
1147 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1148 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1149 .long _ex_trap_c /* 0x2F - Reserved */
1150 .long _ex_trap_c /* 0x30 - Reserved */
1151 .long _ex_trap_c /* 0x31 - Reserved */
1152 .long _ex_trap_c /* 0x32 - Reserved */
1153 .long _ex_trap_c /* 0x33 - Reserved */
1154 .long _ex_trap_c /* 0x34 - Reserved */
1155 .long _ex_trap_c /* 0x35 - Reserved */
1156 .long _ex_trap_c /* 0x36 - Reserved */
1157 .long _ex_trap_c /* 0x37 - Reserved */
1158 .long _ex_trap_c /* 0x38 - Reserved */
1159 .long _ex_trap_c /* 0x39 - Reserved */
1160 .long _ex_trap_c /* 0x3A - Reserved */
1161 .long _ex_trap_c /* 0x3B - Reserved */
1162 .long _ex_trap_c /* 0x3C - Reserved */
1163 .long _ex_trap_c /* 0x3D - Reserved */
1164 .long _ex_trap_c /* 0x3E - Reserved */
1165 .long _ex_trap_c /* 0x3F - Reserved */
1168 ENTRY(_sys_call_table)
1169 .long _sys_restart_syscall /* 0 */
1174 .long _sys_open /* 5 */
1176 .long _sys_ni_syscall /* old waitpid */
1179 .long _sys_unlink /* 10 */
1184 .long _sys_chmod /* 15 */
1185 .long _sys_chown /* chown16 */
1186 .long _sys_ni_syscall /* old break syscall holder */
1187 .long _sys_ni_syscall /* old stat */
1189 .long _sys_getpid /* 20 */
1191 .long _sys_ni_syscall /* old umount */
1194 .long _sys_stime /* 25 */
1197 .long _sys_ni_syscall /* old fstat */
1199 .long _sys_ni_syscall /* old utime */ /* 30 */
1200 .long _sys_ni_syscall /* old stty syscall holder */
1201 .long _sys_ni_syscall /* old gtty syscall holder */
1204 .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
1209 .long _sys_rmdir /* 40 */
1213 .long _sys_ni_syscall /* old prof syscall holder */
1214 .long _sys_brk /* 45 */
1217 .long _sys_ni_syscall /* old sys_signal */
1218 .long _sys_geteuid /* geteuid16 */
1219 .long _sys_getegid /* getegid16 */ /* 50 */
1221 .long _sys_umount /* recycled never used phys() */
1222 .long _sys_ni_syscall /* old lock syscall holder */
1224 .long _sys_fcntl /* 55 */
1225 .long _sys_ni_syscall /* old mpx syscall holder */
1227 .long _sys_ni_syscall /* old ulimit syscall holder */
1228 .long _sys_ni_syscall /* old old uname */
1229 .long _sys_umask /* 60 */
1234 .long _sys_getpgrp /* 65 */
1236 .long _sys_ni_syscall /* old sys_sigaction */
1239 .long _sys_setreuid /* setreuid16 */ /* 70 */
1240 .long _sys_setregid /* setregid16 */
1241 .long _sys_ni_syscall /* old sys_sigsuspend */
1242 .long _sys_ni_syscall /* old sys_sigpending */
1243 .long _sys_sethostname
1244 .long _sys_setrlimit /* 75 */
1245 .long _sys_ni_syscall /* old getrlimit */
1246 .long _sys_getrusage
1247 .long _sys_gettimeofday
1248 .long _sys_settimeofday
1249 .long _sys_getgroups /* getgroups16 */ /* 80 */
1250 .long _sys_setgroups /* setgroups16 */
1251 .long _sys_ni_syscall /* old_select */
1253 .long _sys_ni_syscall /* old lstat */
1254 .long _sys_readlink /* 85 */
1256 .long _sys_ni_syscall /* sys_swapon */
1258 .long _sys_ni_syscall /* old_readdir */
1259 .long _sys_ni_syscall /* sys_mmap */ /* 90 */
1262 .long _sys_ftruncate
1264 .long _sys_fchown /* fchown16 */ /* 95 */
1265 .long _sys_getpriority
1266 .long _sys_setpriority
1267 .long _sys_ni_syscall /* old profil syscall holder */
1269 .long _sys_fstatfs /* 100 */
1270 .long _sys_ni_syscall
1271 .long _sys_ni_syscall /* old sys_socketcall */
1273 .long _sys_setitimer
1274 .long _sys_getitimer /* 105 */
1278 .long _sys_ni_syscall /* old uname */
1279 .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
1281 .long _sys_ni_syscall /* obsolete idle() syscall */
1282 .long _sys_ni_syscall /* vm86old for i386 */
1284 .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
1286 .long _sys_ni_syscall /* old sys_ipc */
1288 .long _sys_ni_syscall /* old sys_sigreturn */
1289 .long _sys_clone /* 120 */
1290 .long _sys_setdomainname
1292 .long _sys_ni_syscall /* old sys_modify_ldt */
1294 .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
1295 .long _sys_ni_syscall /* old sys_sigprocmask */
1296 .long _sys_ni_syscall /* old "creat_module" */
1297 .long _sys_init_module
1298 .long _sys_delete_module
1299 .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
1304 .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
1305 .long _sys_personality
1306 .long _sys_ni_syscall /* for afs_syscall */
1307 .long _sys_setfsuid /* setfsuid16 */
1308 .long _sys_setfsgid /* setfsgid16 */
1309 .long _sys_llseek /* 140 */
1311 .long _sys_ni_syscall /* sys_select */
1313 .long _sys_ni_syscall /* sys_msync */
1314 .long _sys_readv /* 145 */
1317 .long _sys_fdatasync
1319 .long _sys_ni_syscall /* 150 */ /* sys_mlock */
1320 .long _sys_ni_syscall /* sys_munlock */
1321 .long _sys_ni_syscall /* sys_mlockall */
1322 .long _sys_ni_syscall /* sys_munlockall */
1323 .long _sys_sched_setparam
1324 .long _sys_sched_getparam /* 155 */
1325 .long _sys_sched_setscheduler
1326 .long _sys_sched_getscheduler
1327 .long _sys_sched_yield
1328 .long _sys_sched_get_priority_max
1329 .long _sys_sched_get_priority_min /* 160 */
1330 .long _sys_sched_rr_get_interval
1331 .long _sys_nanosleep
1333 .long _sys_setresuid /* setresuid16 */
1334 .long _sys_getresuid /* getresuid16 */ /* 165 */
1335 .long _sys_ni_syscall /* for vm86 */
1336 .long _sys_ni_syscall /* old "query_module" */
1337 .long _sys_ni_syscall /* sys_poll */
1338 .long _sys_nfsservctl
1339 .long _sys_setresgid /* setresgid16 */ /* 170 */
1340 .long _sys_getresgid /* getresgid16 */
1342 .long _sys_rt_sigreturn
1343 .long _sys_rt_sigaction
1344 .long _sys_rt_sigprocmask /* 175 */
1345 .long _sys_rt_sigpending
1346 .long _sys_rt_sigtimedwait
1347 .long _sys_rt_sigqueueinfo
1348 .long _sys_rt_sigsuspend
1349 .long _sys_pread64 /* 180 */
1351 .long _sys_lchown /* lchown16 */
1354 .long _sys_capset /* 185 */
1355 .long _sys_sigaltstack
1357 .long _sys_ni_syscall /* streams1 */
1358 .long _sys_ni_syscall /* streams2 */
1359 .long _sys_vfork /* 190 */
1360 .long _sys_getrlimit
1362 .long _sys_truncate64
1363 .long _sys_ftruncate64
1364 .long _sys_stat64 /* 195 */
1369 .long _sys_getgid /* 200 */
1374 .long _sys_getgroups /* 205 */
1375 .long _sys_setgroups
1377 .long _sys_setresuid
1378 .long _sys_getresuid
1379 .long _sys_setresgid /* 210 */
1380 .long _sys_getresgid
1384 .long _sys_setfsuid /* 215 */
1386 .long _sys_pivot_root
1387 .long _sys_ni_syscall /* sys_mincore */
1388 .long _sys_ni_syscall /* sys_madvise */
1389 .long _sys_getdents64 /* 220 */
1391 .long _sys_ni_syscall /* reserved for TUX */
1392 .long _sys_ni_syscall
1394 .long _sys_readahead /* 225 */
1396 .long _sys_lsetxattr
1397 .long _sys_fsetxattr
1399 .long _sys_lgetxattr /* 230 */
1400 .long _sys_fgetxattr
1401 .long _sys_listxattr
1402 .long _sys_llistxattr
1403 .long _sys_flistxattr
1404 .long _sys_removexattr /* 235 */
1405 .long _sys_lremovexattr
1406 .long _sys_fremovexattr
1408 .long _sys_sendfile64
1409 .long _sys_futex /* 240 */
1410 .long _sys_sched_setaffinity
1411 .long _sys_sched_getaffinity
1412 .long _sys_ni_syscall /* sys_set_thread_area */
1413 .long _sys_ni_syscall /* sys_get_thread_area */
1414 .long _sys_io_setup /* 245 */
1415 .long _sys_io_destroy
1416 .long _sys_io_getevents
1417 .long _sys_io_submit
1418 .long _sys_io_cancel
1419 .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
1420 .long _sys_ni_syscall /* sys_freec_hugepages */
1421 .long _sys_exit_group
1422 .long _sys_lookup_dcookie
1423 .long _sys_bfin_spinlock
1424 .long _sys_epoll_create /* 255 */
1425 .long _sys_epoll_ctl
1426 .long _sys_epoll_wait
1427 .long _sys_ni_syscall /* remap_file_pages */
1428 .long _sys_set_tid_address
1429 .long _sys_timer_create /* 260 */
1430 .long _sys_timer_settime
1431 .long _sys_timer_gettime
1432 .long _sys_timer_getoverrun
1433 .long _sys_timer_delete
1434 .long _sys_clock_settime /* 265 */
1435 .long _sys_clock_gettime
1436 .long _sys_clock_getres
1437 .long _sys_clock_nanosleep
1439 .long _sys_fstatfs64 /* 270 */
1442 .long _sys_fadvise64_64
1443 .long _sys_ni_syscall /* vserver */
1444 .long _sys_ni_syscall /* 275, mbind */
1445 .long _sys_ni_syscall /* get_mempolicy */
1446 .long _sys_ni_syscall /* set_mempolicy */
1448 .long _sys_mq_unlink
1449 .long _sys_mq_timedsend /* 280 */
1450 .long _sys_mq_timedreceive
1451 .long _sys_mq_notify
1452 .long _sys_mq_getsetattr
1453 .long _sys_ni_syscall /* kexec_load */
1454 .long _sys_waitid /* 285 */
1456 .long _sys_request_key
1458 .long _sys_ioprio_set
1459 .long _sys_ioprio_get /* 290 */
1460 .long _sys_inotify_init
1461 .long _sys_inotify_add_watch
1462 .long _sys_inotify_rm_watch
1463 .long _sys_ni_syscall /* migrate_pages */
1464 .long _sys_openat /* 295 */
1468 .long _sys_futimesat
1469 .long _sys_fstatat64 /* 300 */
1473 .long _sys_symlinkat
1474 .long _sys_readlinkat /* 305 */
1476 .long _sys_faccessat
1479 .long _sys_unshare /* 310 */
1480 .long _sys_sram_alloc
1481 .long _sys_sram_free
1482 .long _sys_dma_memcpy
1484 .long _sys_bind /* 315 */
1486 .long _sys_getpeername
1487 .long _sys_getsockname
1488 .long _sys_getsockopt
1489 .long _sys_listen /* 320 */
1494 .long _sys_sendmsg /* 325 */
1496 .long _sys_setsockopt
1499 .long _sys_socketpair /* 330 */
1504 .long _sys_msgget /* 335 */
1509 .long _sys_shmdt /* 340 */
1512 .long _sys_sync_file_range
1514 .long _sys_vmsplice /* 345 */
1515 .long _sys_epoll_pwait
1516 .long _sys_utimensat
1518 .long _sys_timerfd_create
1519 .long _sys_eventfd /* 350 */
1522 .long _sys_fadvise64
1523 .long _sys_set_robust_list
1524 .long _sys_get_robust_list /* 355 */
1525 .long _sys_fallocate
1526 .long _sys_semtimedop
1527 .long _sys_timerfd_settime
1528 .long _sys_timerfd_gettime
1529 .long _sys_signalfd4 /* 360 */
1531 .long _sys_epoll_create1
1534 .long _sys_inotify_init1 /* 365 */
1536 .rept NR_syscalls-(.-_sys_call_table)/4
1537 .long _sys_ni_syscall
1539 END(_sys_call_table)
1541 #ifdef CONFIG_EXCEPTION_L1_SCRATCH
1542 /* .section .l1.bss.scratch */
1543 .set _exception_stack_top, L1_SCRATCH_START + L1_SCRATCH_LENGTH
1545 #ifdef CONFIG_SYSCALL_TAB_L1
1550 ENTRY(_exception_stack)
1551 .rept 1024 * NR_CPUS
1554 _exception_stack_top: