Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireles...
[linux-2.6] / arch / blackfin / mach-common / entry.S
1 /*
2  * File:         arch/blackfin/mach-common/entry.S
3  * Based on:
4  * Author:       Linus Torvalds
5  *
6  * Created:      ?
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.
10  *
11  * Modified:
12  *               Copyright 2004-2006 Analog Devices Inc.
13  *
14  * Bugs:         Enter bugs at http://blackfin.uclinux.org/
15  *
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.
20  *
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.
25  *
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
30  */
31
32 /* NOTE: This code handles signal-recognition, which happens every time
33  * after a timer-interrupt and after each system call.
34  */
35
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>
45
46 #include <asm/mach-common/context.S>
47
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
52 #else
53 # define EX_SCRATCH_REG CYCLES
54 #endif
55
56 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
57 .section .l1.text
58 #else
59 .text
60 #endif
61
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.
65  */
66 #if ANOMALY_05000261
67 #define _ex_dviol _ex_workaround_261
68 #define _ex_dmiss _ex_workaround_261
69 #define _ex_dmult _ex_workaround_261
70
71 ENTRY(_ex_workaround_261)
72         /*
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,
75          * handle it.
76          */
77         P4 = R7;        /* Store EXCAUSE */
78         p5.l = _last_cplb_fault_retx;
79         p5.h = _last_cplb_fault_retx;
80         r7 = [p5];
81         r6 = retx;
82         [p5] = r6;
83         cc = r6 == r7;
84         if !cc jump _bfin_return_from_exception;
85         /* fall through */
86         R7 = P4;
87         R6 = 0x26;      /* Data CPLB Miss */
88         cc = R6 == R7;
89         if cc jump _ex_dcplb_miss (BP);
90         R6 = 0x23;      /* Data CPLB Miss */
91         cc = R6 == R7;
92         if cc jump _ex_dcplb_viol (BP);
93         /* Handle 0x23 Data CPLB Protection Violation
94          * and Data CPLB Multiple Hits - Linux Trap Zero
95          */
96         jump _ex_trap_c;
97 ENDPROC(_ex_workaround_261)
98
99 #else
100 #ifdef CONFIG_MPU
101 #define _ex_dviol _ex_dcplb_viol
102 #else
103 #define _ex_dviol _ex_trap_c
104 #endif
105 #define _ex_dmiss _ex_dcplb_miss
106 #define _ex_dmult _ex_trap_c
107 #endif
108
109
110 ENTRY(_ex_dcplb_viol)
111 ENTRY(_ex_dcplb_miss)
112 ENTRY(_ex_icplb_miss)
113         (R7:6,P5:4) = [sp++];
114         ASTAT = [sp++];
115         SAVE_ALL_SYS
116 #ifdef CONFIG_MPU
117         /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
118          * will change the stack pointer.  */
119         R0 = SEQSTAT;
120         R1 = SP;
121 #endif
122         DEBUG_HWTRACE_SAVE(p5, r7)
123 #ifdef CONFIG_MPU
124         sp += -12;
125         call _cplb_hdr;
126         sp += 12;
127         CC = R0 == 0;
128         IF !CC JUMP _handle_bad_cplb;
129 #else
130         call __cplb_hdr;
131 #endif
132         DEBUG_HWTRACE_RESTORE(p5, r7)
133         RESTORE_ALL_SYS
134         SP = EX_SCRATCH_REG;
135         rtx;
136 ENDPROC(_ex_icplb_miss)
137
138 ENTRY(_ex_syscall)
139         (R7:6,P5:4) = [sp++];
140         ASTAT = [sp++];
141         raise 15;               /* invoked by TRAP #0, for sys call */
142         sp = EX_SCRATCH_REG;
143         rtx
144 ENDPROC(_ex_syscall)
145
146 ENTRY(_ex_soft_bp)
147         r7 = retx;
148         r7 += -2;
149         retx = r7;
150         jump.s _ex_trap_c;
151 ENDPROC(_ex_soft_bp)
152
153 ENTRY(_ex_single_step)
154         r7 = retx;
155         r6 = reti;
156         cc = r7 == r6;
157         if cc jump _bfin_return_from_exception
158         r7 = syscfg;
159         bitclr (r7, 0);
160         syscfg = R7;
161
162         p5.l = lo(IPEND);
163         p5.h = hi(IPEND);
164         r6 = [p5];
165         cc = bittst(r6, 5);
166         if !cc jump _ex_trap_c;
167         p4.l = lo(EVT5);
168         p4.h = hi(EVT5);
169         r6.h = _exception_to_level5;
170         r6.l = _exception_to_level5;
171         r7 = [p4];
172         cc = r6 == r7;
173         if !cc jump _ex_trap_c;
174 ENDPROC(_ex_single_step)
175
176 ENTRY(_bfin_return_from_exception)
177 #if ANOMALY_05000257
178         R7=LC0;
179         LC0=R7;
180         R7=LC1;
181         LC1=R7;
182 #endif
183         (R7:6,P5:4) = [sp++];
184         ASTAT = [sp++];
185         sp = EX_SCRATCH_REG;
186         rtx;
187 ENDPROC(_bfin_return_from_exception)
188
189 ENTRY(_handle_bad_cplb)
190         DEBUG_HWTRACE_RESTORE(p5, r7)
191         /* To get here, we just tried and failed to change a CPLB
192          * so, handle things in trap_c (C code), by lowering to
193          * IRQ5, just like we normally do. Since this is not a
194          * "normal" return path, we have a do alot of stuff to
195          * the stack to get ready so, we can fall through - we
196          * need to make a CPLB exception look like a normal exception
197          */
198
199         RESTORE_ALL_SYS
200         [--sp] = ASTAT;
201         [--sp] = (R7:6,P5:4);
202
203 ENTRY(_ex_replaceable)
204         nop;
205
206 ENTRY(_ex_trap_c)
207         /* Make sure we are not in a double fault */
208         p4.l = lo(IPEND);
209         p4.h = hi(IPEND);
210         r7 = [p4];
211         CC = BITTST (r7, 5);
212         if CC jump _double_fault;
213
214         /* Call C code (trap_c) to handle the exception, which most
215          * likely involves sending a signal to the current process.
216          * To avoid double faults, lower our priority to IRQ5 first.
217          */
218         P5.h = _exception_to_level5;
219         P5.l = _exception_to_level5;
220         p4.l = lo(EVT5);
221         p4.h = hi(EVT5);
222         [p4] = p5;
223         csync;
224
225         p4.l = lo(DCPLB_FAULT_ADDR);
226         p4.h = hi(DCPLB_FAULT_ADDR);
227         r7 = [p4];
228         p5.h = _saved_dcplb_fault_addr;
229         p5.l = _saved_dcplb_fault_addr;
230         [p5] = r7;
231
232         r7 = [p4 + (ICPLB_FAULT_ADDR - DCPLB_FAULT_ADDR)];
233         p5.h = _saved_icplb_fault_addr;
234         p5.l = _saved_icplb_fault_addr;
235         [p5] = r7;
236
237         p4.l = __retx;
238         p4.h = __retx;
239         r6 = retx;
240         [p4] = r6;
241         p4.l = lo(SAFE_USER_INSTRUCTION);
242         p4.h = hi(SAFE_USER_INSTRUCTION);
243         retx = p4;
244
245         /* Disable all interrupts, but make sure level 5 is enabled so
246          * we can switch to that level.  Save the old mask.  */
247         cli r6;
248         p4.l = _excpt_saved_imask;
249         p4.h = _excpt_saved_imask;
250         [p4] = r6;
251         r6 = 0x3f;
252         sti r6;
253
254         (R7:6,P5:4) = [sp++];
255         ASTAT = [sp++];
256         SP = EX_SCRATCH_REG;
257         raise 5;
258         rtx;
259 ENDPROC(_ex_trap_c)
260
261 /* We just realized we got an exception, while we were processing a different
262  * exception. This is a unrecoverable event, so crash
263  */
264 ENTRY(_double_fault)
265         /* Turn caches & protection off, to ensure we don't get any more
266          * double exceptions
267          */
268
269         P4.L = LO(IMEM_CONTROL);
270         P4.H = HI(IMEM_CONTROL);
271
272         R5 = [P4];              /* Control Register*/
273         BITCLR(R5,ENICPLB_P);
274         SSYNC;          /* SSYNC required before writing to IMEM_CONTROL. */
275         .align 8;
276         [P4] = R5;
277         SSYNC;
278
279         P4.L = LO(DMEM_CONTROL);
280         P4.H = HI(DMEM_CONTROL);
281         R5 = [P4];
282         BITCLR(R5,ENDCPLB_P);
283         SSYNC;          /* SSYNC required before writing to DMEM_CONTROL. */
284         .align 8;
285         [P4] = R5;
286         SSYNC;
287
288         /* Fix up the stack */
289         (R7:6,P5:4) = [sp++];
290         ASTAT = [sp++];
291         SP = EX_SCRATCH_REG;
292
293         /* We should be out of the exception stack, and back down into
294          * kernel or user space stack
295          */
296         SAVE_ALL_SYS
297
298         r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
299         SP += -12;
300         call _double_fault_c;
301         SP += 12;
302 .L_double_fault_panic:
303         JUMP .L_double_fault_panic
304
305 ENDPROC(_double_fault)
306
307 ENTRY(_exception_to_level5)
308         SAVE_ALL_SYS
309
310         p4.l = __retx;
311         p4.h = __retx;
312         r6 = [p4];
313         [sp + PT_PC] = r6;
314
315         /* Restore interrupt mask.  We haven't pushed RETI, so this
316          * doesn't enable interrupts until we return from this handler.  */
317         p4.l = _excpt_saved_imask;
318         p4.h = _excpt_saved_imask;
319         r6 = [p4];
320         sti r6;
321
322         /* Restore the hardware error vector.  */
323         P5.h = _evt_ivhw;
324         P5.l = _evt_ivhw;
325         p4.l = lo(EVT5);
326         p4.h = hi(EVT5);
327         [p4] = p5;
328         csync;
329
330         p2.l = lo(IPEND);
331         p2.h = hi(IPEND);
332         csync;
333         r0 = [p2];              /* Read current IPEND */
334         [sp + PT_IPEND] = r0;   /* Store IPEND */
335
336         r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
337         SP += -12;
338         call _trap_c;
339         SP += 12;
340
341         call _ret_from_exception;
342         RESTORE_ALL_SYS
343         rti;
344 ENDPROC(_exception_to_level5)
345
346 ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
347         /* Since the kernel stack can be anywhere, it's not guaranteed to be
348          * covered by a CPLB.  Switch to an exception stack; use RETN as a
349          * scratch register (for want of a better option).
350          */
351         EX_SCRATCH_REG = sp;
352         sp.l = _exception_stack_top;
353         sp.h = _exception_stack_top;
354         /* Try to deal with syscalls quickly.  */
355         [--sp] = ASTAT;
356         [--sp] = (R7:6,P5:4);
357         r7 = SEQSTAT;           /* reason code is in bit 5:0 */
358         r6.l = lo(SEQSTAT_EXCAUSE);
359         r6.h = hi(SEQSTAT_EXCAUSE);
360         r7 = r7 & r6;
361         p5.h = _ex_table;
362         p5.l = _ex_table;
363         p4 = r7;
364         p5 = p5 + (p4 << 2);
365         p4 = [p5];
366         jump (p4);
367
368 .Lbadsys:
369         r7 = -ENOSYS;           /* signextending enough */
370         [sp + PT_R0] = r7;      /* return value from system call */
371         jump .Lsyscall_really_exit;
372 ENDPROC(_trap)
373
374 ENTRY(_kernel_execve)
375         link SIZEOF_PTREGS;
376         p0 = sp;
377         r3 = SIZEOF_PTREGS / 4;
378         r4 = 0(x);
379 0:
380         [p0++] = r4;
381         r3 += -1;
382         cc = r3 == 0;
383         if !cc jump 0b (bp);
384
385         p0 = sp;
386         sp += -16;
387         [sp + 12] = p0;
388         call _do_execve;
389         SP += 16;
390         cc = r0 == 0;
391         if ! cc jump 1f;
392         /* Success.  Copy our temporary pt_regs to the top of the kernel
393          * stack and do a normal exception return.
394          */
395         r1 = sp;
396         r0 = (-KERNEL_STACK_SIZE) (x);
397         r1 = r1 & r0;
398         p2 = r1;
399         p3 = [p2];
400         r0 = KERNEL_STACK_SIZE - 4 (z);
401         p1 = r0;
402         p1 = p1 + p2;
403
404         p0 = fp;
405         r4 = [p0--];
406         r3 = SIZEOF_PTREGS / 4;
407 0:
408         r4 = [p0--];
409         [p1--] = r4;
410         r3 += -1;
411         cc = r3 == 0;
412         if ! cc jump 0b (bp);
413
414         r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
415         p1 = r0;
416         p1 = p1 + p2;
417         sp = p1;
418         r0 = syscfg;
419         [SP + PT_SYSCFG] = r0;
420         [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
421
422         RESTORE_CONTEXT;
423         rti;
424 1:
425         unlink;
426         rts;
427 ENDPROC(_kernel_execve)
428
429 ENTRY(_system_call)
430         /* Store IPEND */
431         p2.l = lo(IPEND);
432         p2.h = hi(IPEND);
433         csync;
434         r0 = [p2];
435         [sp + PT_IPEND] = r0;
436
437         /* Store RETS for now */
438         r0 = rets;
439         [sp + PT_RESERVED] = r0;
440         /* Set the stack for the current process */
441         r7 = sp;
442         r6.l = lo(ALIGN_PAGE_MASK);
443         r6.h = hi(ALIGN_PAGE_MASK);
444         r7 = r7 & r6;           /* thread_info */
445         p2 = r7;
446         p2 = [p2];
447
448         [p2+(TASK_THREAD+THREAD_KSP)] = sp;
449
450         /* Check the System Call */
451         r7 = __NR_syscall;
452         /* System call number is passed in P0 */
453         r6 = p0;
454         cc = r6 < r7;
455         if ! cc jump .Lbadsys;
456
457         /* are we tracing syscalls?*/
458         r7 = sp;
459         r6.l = lo(ALIGN_PAGE_MASK);
460         r6.h = hi(ALIGN_PAGE_MASK);
461         r7 = r7 & r6;
462         p2 = r7;
463         r7 = [p2+TI_FLAGS];
464         CC = BITTST(r7,TIF_SYSCALL_TRACE);
465         if CC JUMP _sys_trace;
466
467         /* Execute the appropriate system call */
468
469         p4 = p0;
470         p5.l = _sys_call_table;
471         p5.h = _sys_call_table;
472         p5 = p5 + (p4 << 2);
473         r0 = [sp + PT_R0];
474         r1 = [sp + PT_R1];
475         r2 = [sp + PT_R2];
476         p5 = [p5];
477
478         [--sp] = r5;
479         [--sp] = r4;
480         [--sp] = r3;
481         SP += -12;
482         call (p5);
483         SP += 24;
484         [sp + PT_R0] = r0;
485
486 .Lresume_userspace:
487         r7 = sp;
488         r4.l = lo(ALIGN_PAGE_MASK);
489         r4.h = hi(ALIGN_PAGE_MASK);
490         r7 = r7 & r4;           /* thread_info->flags */
491         p5 = r7;
492 .Lresume_userspace_1:
493         /* Disable interrupts.  */
494         [--sp] = reti;
495         reti = [sp++];
496
497         r7 = [p5 + TI_FLAGS];
498         r4.l = lo(_TIF_WORK_MASK);
499         r4.h = hi(_TIF_WORK_MASK);
500         r7 =  r7 & r4;
501
502 .Lsyscall_resched:
503         cc = BITTST(r7, TIF_NEED_RESCHED);
504         if !cc jump .Lsyscall_sigpending;
505
506         /* Reenable interrupts.  */
507         [--sp] = reti;
508         r0 = [sp++];
509
510         SP += -12;
511         call _schedule;
512         SP += 12;
513
514         jump .Lresume_userspace_1;
515
516 .Lsyscall_sigpending:
517         cc = BITTST(r7, TIF_RESTORE_SIGMASK);
518         if cc jump .Lsyscall_do_signals;
519         cc = BITTST(r7, TIF_SIGPENDING);
520         if !cc jump .Lsyscall_really_exit;
521 .Lsyscall_do_signals:
522         /* Reenable interrupts.  */
523         [--sp] = reti;
524         r0 = [sp++];
525
526         r0 = sp;
527         SP += -12;
528         call _do_signal;
529         SP += 12;
530
531 .Lsyscall_really_exit:
532         r5 = [sp + PT_RESERVED];
533         rets = r5;
534         rts;
535 ENDPROC(_system_call)
536
537 _sys_trace:
538         call _syscall_trace;
539
540         /* Execute the appropriate system call */
541
542         p4 = [SP + PT_P0];
543         p5.l = _sys_call_table;
544         p5.h = _sys_call_table;
545         p5 = p5 + (p4 << 2);
546         r0 = [sp + PT_R0];
547         r1 = [sp + PT_R1];
548         r2 = [sp + PT_R2];
549         r3 = [sp + PT_R3];
550         r4 = [sp + PT_R4];
551         r5 = [sp + PT_R5];
552         p5 = [p5];
553
554         [--sp] = r5;
555         [--sp] = r4;
556         [--sp] = r3;
557         SP += -12;
558         call (p5);
559         SP += 24;
560         [sp + PT_R0] = r0;
561
562         call _syscall_trace;
563         jump .Lresume_userspace;
564 ENDPROC(_sys_trace)
565
566 ENTRY(_resume)
567         /*
568          * Beware - when entering resume, prev (the current task) is
569          * in r0, next (the new task) is in r1.
570          */
571         p0 = r0;
572         p1 = r1;
573         [--sp] = rets;
574         [--sp] = fp;
575         [--sp] = (r7:4, p5:3);
576
577         /* save usp */
578         p2 = usp;
579         [p0+(TASK_THREAD+THREAD_USP)] = p2;
580
581         /* save current kernel stack pointer */
582         [p0+(TASK_THREAD+THREAD_KSP)] = sp;
583
584         /* save program counter */
585         r1.l = _new_old_task;
586         r1.h = _new_old_task;
587         [p0+(TASK_THREAD+THREAD_PC)] = r1;
588
589         /* restore the kernel stack pointer */
590         sp = [p1+(TASK_THREAD+THREAD_KSP)];
591
592         /* restore user stack pointer */
593         p0 = [p1+(TASK_THREAD+THREAD_USP)];
594         usp = p0;
595
596         /* restore pc */
597         p0 = [p1+(TASK_THREAD+THREAD_PC)];
598         jump (p0);
599
600         /*
601          * Following code actually lands up in a new (old) task.
602          */
603
604 _new_old_task:
605         (r7:4, p5:3) = [sp++];
606         fp = [sp++];
607         rets = [sp++];
608
609         /*
610          * When we come out of resume, r0 carries "old" task, becuase we are
611          * in "new" task.
612          */
613         rts;
614 ENDPROC(_resume)
615
616 ENTRY(_ret_from_exception)
617         p2.l = lo(IPEND);
618         p2.h = hi(IPEND);
619
620         csync;
621         r0 = [p2];
622         [sp + PT_IPEND] = r0;
623
624 1:
625         r2 = LO(~0x37) (Z);
626         r0 = r2 & r0;
627         cc = r0 == 0;
628         if !cc jump 4f; /* if not return to user mode, get out */
629
630         /* Make sure any pending system call or deferred exception
631          * return in ILAT for this process to get executed, otherwise
632          * in case context switch happens, system call of
633          * first process (i.e in ILAT) will be carried
634          * forward to the switched process
635          */
636
637         p2.l = lo(ILAT);
638         p2.h = hi(ILAT);
639         r0 = [p2];
640         r1 = (EVT_IVG14 | EVT_IVG15) (z);
641         r0 = r0 & r1;
642         cc = r0 == 0;
643         if !cc jump 5f;
644
645         /* Set the stack for the current process */
646         r7 = sp;
647         r4.l = lo(ALIGN_PAGE_MASK);
648         r4.h = hi(ALIGN_PAGE_MASK);
649         r7 = r7 & r4;           /* thread_info->flags */
650         p5 = r7;
651         r7 = [p5 + TI_FLAGS];
652         r4.l = lo(_TIF_WORK_MASK);
653         r4.h = hi(_TIF_WORK_MASK);
654         r7 =  r7 & r4;
655         cc = r7 == 0;
656         if cc jump 4f;
657
658         p0.l = lo(EVT15);
659         p0.h = hi(EVT15);
660         p1.l = _schedule_and_signal;
661         p1.h = _schedule_and_signal;
662         [p0] = p1;
663         csync;
664         raise 15;               /* raise evt14 to do signal or reschedule */
665 4:
666         r0 = syscfg;
667         bitclr(r0, 0);
668         syscfg = r0;
669 5:
670         rts;
671 ENDPROC(_ret_from_exception)
672
673 ENTRY(_return_from_int)
674         /* If someone else already raised IRQ 15, do nothing.  */
675         csync;
676         p2.l = lo(ILAT);
677         p2.h = hi(ILAT);
678         r0 = [p2];
679         cc = bittst (r0, EVT_IVG15_P);
680         if cc jump 2f;
681
682         /* if not return to user mode, get out */
683         p2.l = lo(IPEND);
684         p2.h = hi(IPEND);
685         r0 = [p2];
686         r1 = 0x17(Z);
687         r2 = ~r1;
688         r2.h = 0;
689         r0 = r2 & r0;
690         r1 = 1;
691         r1 = r0 - r1;
692         r2 = r0 & r1;
693         cc = r2 == 0;
694         if !cc jump 2f;
695
696         /* Lower the interrupt level to 15.  */
697         p0.l = lo(EVT15);
698         p0.h = hi(EVT15);
699         p1.l = _schedule_and_signal_from_int;
700         p1.h = _schedule_and_signal_from_int;
701         [p0] = p1;
702         csync;
703 #if ANOMALY_05000281
704         r0.l = lo(SAFE_USER_INSTRUCTION);
705         r0.h = hi(SAFE_USER_INSTRUCTION);
706         reti = r0;
707 #endif
708         r0 = 0x801f (z);
709         STI r0;
710         raise 15;       /* raise evt15 to do signal or reschedule */
711         rti;
712 2:
713         rts;
714 ENDPROC(_return_from_int)
715
716 ENTRY(_lower_to_irq14)
717 #if ANOMALY_05000281
718         r0.l = lo(SAFE_USER_INSTRUCTION);
719         r0.h = hi(SAFE_USER_INSTRUCTION);
720         reti = r0;
721 #endif
722         r0 = 0x401f;
723         sti r0;
724         raise 14;
725         rti;
726 ENTRY(_evt14_softirq)
727 #ifdef CONFIG_DEBUG_HWERR
728         r0 = 0x3f;
729         sti r0;
730 #else
731         cli r0;
732 #endif
733         [--sp] = RETI;
734         SP += 4;
735         rts;
736
737 _schedule_and_signal_from_int:
738         /* To end up here, vector 15 was changed - so we have to change it
739          * back.
740          */
741         p0.l = lo(EVT15);
742         p0.h = hi(EVT15);
743         p1.l = _evt_system_call;
744         p1.h = _evt_system_call;
745         [p0] = p1;
746         csync;
747
748         /* Set orig_p0 to -1 to indicate this isn't the end of a syscall.  */
749         r0 = -1 (x);
750         [sp + PT_ORIG_P0] = r0;
751
752         p1 = rets;
753         [sp + PT_RESERVED] = p1;
754
755         p0.l = _irq_flags;
756         p0.h = _irq_flags;
757         r0 = [p0];
758         sti r0;
759
760         r0 = sp;
761         sp += -12;
762         call _finish_atomic_sections;
763         sp += 12;
764         jump.s .Lresume_userspace;
765
766 _schedule_and_signal:
767         SAVE_CONTEXT_SYSCALL
768         /* To end up here, vector 15 was changed - so we have to change it
769          * back.
770          */
771         p0.l = lo(EVT15);
772         p0.h = hi(EVT15);
773         p1.l = _evt_system_call;
774         p1.h = _evt_system_call;
775         [p0] = p1;
776         csync;
777         p0.l = 1f;
778         p0.h = 1f;
779         [sp + PT_RESERVED] = P0;
780         call .Lresume_userspace;
781 1:
782         RESTORE_CONTEXT
783         rti;
784 ENDPROC(_lower_to_irq14)
785
786 /* We handle this 100% in exception space - to reduce overhead
787  * Only potiential problem is if the software buffer gets swapped out of the
788  * CPLB table - then double fault. - so we don't let this happen in other places
789  */
790 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
791 ENTRY(_ex_trace_buff_full)
792         [--sp] = P3;
793         [--sp] = P2;
794         [--sp] = LC0;
795         [--sp] = LT0;
796         [--sp] = LB0;
797         P5.L = _trace_buff_offset;
798         P5.H = _trace_buff_offset;
799         P3 = [P5];              /* trace_buff_offset */
800         P5.L = lo(TBUFSTAT);
801         P5.H = hi(TBUFSTAT);
802         R7 = [P5];
803         R7 <<= 1;               /* double, since we need to read twice */
804         LC0 = R7;
805         R7 <<= 2;               /* need to shift over again,
806                                  * to get the number of bytes */
807         P5.L = lo(TBUF);
808         P5.H = hi(TBUF);
809         R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
810
811         P2 = R7;
812         P3 = P3 + P2;
813         R7 = P3;
814         R7 = R7 & R6;
815         P3 = R7;
816         P2.L = _trace_buff_offset;
817         P2.H = _trace_buff_offset;
818         [P2] = P3;
819
820         P2.L = _software_trace_buff;
821         P2.H = _software_trace_buff;
822
823         LSETUP (.Lstart, .Lend) LC0;
824 .Lstart:
825         R7 = [P5];      /* read TBUF */
826         P4 = P3 + P2;
827         [P4] = R7;
828         P3 += -4;
829         R7 = P3;
830         R7 = R7 & R6;
831 .Lend:
832         P3 = R7;
833
834         LB0 = [sp++];
835         LT0 = [sp++];
836         LC0 = [sp++];
837         P2 = [sp++];
838         P3 = [sp++];
839         jump _bfin_return_from_exception;
840 ENDPROC(_ex_trace_buff_full)
841
842 #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
843 .data
844 #else
845 .section .l1.data.B
846 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
847 ENTRY(_trace_buff_offset)
848         .long 0;
849 ALIGN
850 ENTRY(_software_trace_buff)
851         .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
852         .long 0
853         .endr
854 #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
855
856 #if CONFIG_EARLY_PRINTK
857 __INIT
858 ENTRY(_early_trap)
859         SAVE_ALL_SYS
860         trace_buffer_stop(p0,r0);
861
862         /* Turn caches off, to ensure we don't get double exceptions */
863
864         P4.L = LO(IMEM_CONTROL);
865         P4.H = HI(IMEM_CONTROL);
866
867         R5 = [P4];              /* Control Register*/
868         BITCLR(R5,ENICPLB_P);
869         CLI R1;
870         SSYNC;          /* SSYNC required before writing to IMEM_CONTROL. */
871         .align 8;
872         [P4] = R5;
873         SSYNC;
874
875         P4.L = LO(DMEM_CONTROL);
876         P4.H = HI(DMEM_CONTROL);
877         R5 = [P4];
878         BITCLR(R5,ENDCPLB_P);
879         SSYNC;          /* SSYNC required before writing to DMEM_CONTROL. */
880         .align 8;
881         [P4] = R5;
882         SSYNC;
883         STI R1;
884
885         r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
886         r1 = RETX;
887
888         SP += -12;
889         call _early_trap_c;
890         SP += 12;
891 ENDPROC(_early_trap)
892 __FINIT
893 #endif /* CONFIG_EARLY_PRINTK */
894
895 /*
896  * Put these in the kernel data section - that should always be covered by
897  * a CPLB. This is needed to ensure we don't get double fault conditions
898  */
899
900 #ifdef CONFIG_SYSCALL_TAB_L1
901 .section .l1.data
902 #else
903 .data
904 #endif
905
906 ENTRY(_ex_table)
907         /* entry for each EXCAUSE[5:0]
908          * This table must be in sync with the table in ./kernel/traps.c
909          * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
910          */
911         .long _ex_syscall       /* 0x00 - User Defined - Linux Syscall */
912         .long _ex_soft_bp       /* 0x01 - User Defined - Software breakpoint */
913         .long _ex_replaceable   /* 0x02 - User Defined */
914         .long _ex_trap_c        /* 0x03 - User Defined - userspace stack overflow */
915         .long _ex_trap_c        /* 0x04 - User Defined - dump trace buffer */
916         .long _ex_replaceable   /* 0x05 - User Defined */
917         .long _ex_replaceable   /* 0x06 - User Defined */
918         .long _ex_replaceable   /* 0x07 - User Defined */
919         .long _ex_replaceable   /* 0x08 - User Defined */
920         .long _ex_replaceable   /* 0x09 - User Defined */
921         .long _ex_replaceable   /* 0x0A - User Defined */
922         .long _ex_replaceable   /* 0x0B - User Defined */
923         .long _ex_replaceable   /* 0x0C - User Defined */
924         .long _ex_replaceable   /* 0x0D - User Defined */
925         .long _ex_replaceable   /* 0x0E - User Defined */
926         .long _ex_replaceable   /* 0x0F - User Defined */
927         .long _ex_single_step   /* 0x10 - HW Single step */
928 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
929         .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
930 #else
931         .long _ex_trap_c        /* 0x11 - Trace Buffer Full */
932 #endif
933         .long _ex_trap_c        /* 0x12 - Reserved */
934         .long _ex_trap_c        /* 0x13 - Reserved */
935         .long _ex_trap_c        /* 0x14 - Reserved */
936         .long _ex_trap_c        /* 0x15 - Reserved */
937         .long _ex_trap_c        /* 0x16 - Reserved */
938         .long _ex_trap_c        /* 0x17 - Reserved */
939         .long _ex_trap_c        /* 0x18 - Reserved */
940         .long _ex_trap_c        /* 0x19 - Reserved */
941         .long _ex_trap_c        /* 0x1A - Reserved */
942         .long _ex_trap_c        /* 0x1B - Reserved */
943         .long _ex_trap_c        /* 0x1C - Reserved */
944         .long _ex_trap_c        /* 0x1D - Reserved */
945         .long _ex_trap_c        /* 0x1E - Reserved */
946         .long _ex_trap_c        /* 0x1F - Reserved */
947         .long _ex_trap_c        /* 0x20 - Reserved */
948         .long _ex_trap_c        /* 0x21 - Undefined Instruction */
949         .long _ex_trap_c        /* 0x22 - Illegal Instruction Combination */
950         .long _ex_dviol         /* 0x23 - Data CPLB Protection Violation */
951         .long _ex_trap_c        /* 0x24 - Data access misaligned */
952         .long _ex_trap_c        /* 0x25 - Unrecoverable Event */
953         .long _ex_dmiss         /* 0x26 - Data CPLB Miss */
954         .long _ex_dmult         /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
955         .long _ex_trap_c        /* 0x28 - Emulation Watchpoint */
956         .long _ex_trap_c        /* 0x29 - Instruction fetch access error (535 only) */
957         .long _ex_trap_c        /* 0x2A - Instruction fetch misaligned */
958         .long _ex_trap_c        /* 0x2B - Instruction CPLB protection Violation */
959         .long _ex_icplb_miss    /* 0x2C - Instruction CPLB miss */
960         .long _ex_trap_c        /* 0x2D - Instruction CPLB Multiple Hits */
961         .long _ex_trap_c        /* 0x2E - Illegal use of Supervisor Resource */
962         .long _ex_trap_c        /* 0x2E - Illegal use of Supervisor Resource */
963         .long _ex_trap_c        /* 0x2F - Reserved */
964         .long _ex_trap_c        /* 0x30 - Reserved */
965         .long _ex_trap_c        /* 0x31 - Reserved */
966         .long _ex_trap_c        /* 0x32 - Reserved */
967         .long _ex_trap_c        /* 0x33 - Reserved */
968         .long _ex_trap_c        /* 0x34 - Reserved */
969         .long _ex_trap_c        /* 0x35 - Reserved */
970         .long _ex_trap_c        /* 0x36 - Reserved */
971         .long _ex_trap_c        /* 0x37 - Reserved */
972         .long _ex_trap_c        /* 0x38 - Reserved */
973         .long _ex_trap_c        /* 0x39 - Reserved */
974         .long _ex_trap_c        /* 0x3A - Reserved */
975         .long _ex_trap_c        /* 0x3B - Reserved */
976         .long _ex_trap_c        /* 0x3C - Reserved */
977         .long _ex_trap_c        /* 0x3D - Reserved */
978         .long _ex_trap_c        /* 0x3E - Reserved */
979         .long _ex_trap_c        /* 0x3F - Reserved */
980 END(_ex_table)
981
982 ENTRY(_sys_call_table)
983         .long _sys_restart_syscall      /* 0 */
984         .long _sys_exit
985         .long _sys_fork
986         .long _sys_read
987         .long _sys_write
988         .long _sys_open         /* 5 */
989         .long _sys_close
990         .long _sys_ni_syscall   /* old waitpid */
991         .long _sys_creat
992         .long _sys_link
993         .long _sys_unlink       /* 10 */
994         .long _sys_execve
995         .long _sys_chdir
996         .long _sys_time
997         .long _sys_mknod
998         .long _sys_chmod                /* 15 */
999         .long _sys_chown        /* chown16 */
1000         .long _sys_ni_syscall   /* old break syscall holder */
1001         .long _sys_ni_syscall   /* old stat */
1002         .long _sys_lseek
1003         .long _sys_getpid       /* 20 */
1004         .long _sys_mount
1005         .long _sys_ni_syscall   /* old umount */
1006         .long _sys_setuid
1007         .long _sys_getuid
1008         .long _sys_stime                /* 25 */
1009         .long _sys_ptrace
1010         .long _sys_alarm
1011         .long _sys_ni_syscall   /* old fstat */
1012         .long _sys_pause
1013         .long _sys_ni_syscall   /* old utime */ /* 30 */
1014         .long _sys_ni_syscall   /* old stty syscall holder */
1015         .long _sys_ni_syscall   /* old gtty syscall holder */
1016         .long _sys_access
1017         .long _sys_nice
1018         .long _sys_ni_syscall   /* 35 */ /* old ftime syscall holder */
1019         .long _sys_sync
1020         .long _sys_kill
1021         .long _sys_rename
1022         .long _sys_mkdir
1023         .long _sys_rmdir                /* 40 */
1024         .long _sys_dup
1025         .long _sys_pipe
1026         .long _sys_times
1027         .long _sys_ni_syscall   /* old prof syscall holder */
1028         .long _sys_brk          /* 45 */
1029         .long _sys_setgid
1030         .long _sys_getgid
1031         .long _sys_ni_syscall   /* old sys_signal */
1032         .long _sys_geteuid      /* geteuid16 */
1033         .long _sys_getegid      /* getegid16 */ /* 50 */
1034         .long _sys_acct
1035         .long _sys_umount       /* recycled never used phys() */
1036         .long _sys_ni_syscall   /* old lock syscall holder */
1037         .long _sys_ioctl
1038         .long _sys_fcntl                /* 55 */
1039         .long _sys_ni_syscall   /* old mpx syscall holder */
1040         .long _sys_setpgid
1041         .long _sys_ni_syscall   /* old ulimit syscall holder */
1042         .long _sys_ni_syscall   /* old old uname */
1043         .long _sys_umask                /* 60 */
1044         .long _sys_chroot
1045         .long _sys_ustat
1046         .long _sys_dup2
1047         .long _sys_getppid
1048         .long _sys_getpgrp      /* 65 */
1049         .long _sys_setsid
1050         .long _sys_ni_syscall   /* old sys_sigaction */
1051         .long _sys_sgetmask
1052         .long _sys_ssetmask
1053         .long _sys_setreuid     /* setreuid16 */        /* 70 */
1054         .long _sys_setregid     /* setregid16 */
1055         .long _sys_ni_syscall   /* old sys_sigsuspend */
1056         .long _sys_ni_syscall   /* old sys_sigpending */
1057         .long _sys_sethostname
1058         .long _sys_setrlimit    /* 75 */
1059         .long _sys_ni_syscall   /* old getrlimit */
1060         .long _sys_getrusage
1061         .long _sys_gettimeofday
1062         .long _sys_settimeofday
1063         .long _sys_getgroups    /* getgroups16 */       /* 80 */
1064         .long _sys_setgroups    /* setgroups16 */
1065         .long _sys_ni_syscall   /* old_select */
1066         .long _sys_symlink
1067         .long _sys_ni_syscall   /* old lstat */
1068         .long _sys_readlink     /* 85 */
1069         .long _sys_uselib
1070         .long _sys_ni_syscall   /* sys_swapon */
1071         .long _sys_reboot
1072         .long _sys_ni_syscall   /* old_readdir */
1073         .long _sys_ni_syscall   /* sys_mmap */  /* 90 */
1074         .long _sys_munmap
1075         .long _sys_truncate
1076         .long _sys_ftruncate
1077         .long _sys_fchmod
1078         .long _sys_fchown       /* fchown16 */  /* 95 */
1079         .long _sys_getpriority
1080         .long _sys_setpriority
1081         .long _sys_ni_syscall   /* old profil syscall holder */
1082         .long _sys_statfs
1083         .long _sys_fstatfs      /* 100 */
1084         .long _sys_ni_syscall
1085         .long _sys_ni_syscall   /* old sys_socketcall */
1086         .long _sys_syslog
1087         .long _sys_setitimer
1088         .long _sys_getitimer    /* 105 */
1089         .long _sys_newstat
1090         .long _sys_newlstat
1091         .long _sys_newfstat
1092         .long _sys_ni_syscall   /* old uname */
1093         .long _sys_ni_syscall   /* iopl for i386 */ /* 110 */
1094         .long _sys_vhangup
1095         .long _sys_ni_syscall   /* obsolete idle() syscall */
1096         .long _sys_ni_syscall   /* vm86old for i386 */
1097         .long _sys_wait4
1098         .long _sys_ni_syscall   /* 115 */ /* sys_swapoff */
1099         .long _sys_sysinfo
1100         .long _sys_ni_syscall   /* old sys_ipc */
1101         .long _sys_fsync
1102         .long _sys_ni_syscall   /* old sys_sigreturn */
1103         .long _sys_clone                /* 120 */
1104         .long _sys_setdomainname
1105         .long _sys_newuname
1106         .long _sys_ni_syscall   /* old sys_modify_ldt */
1107         .long _sys_adjtimex
1108         .long _sys_ni_syscall   /* 125 */ /* sys_mprotect */
1109         .long _sys_ni_syscall   /* old sys_sigprocmask */
1110         .long _sys_ni_syscall   /* old "creat_module" */
1111         .long _sys_init_module
1112         .long _sys_delete_module
1113         .long _sys_ni_syscall   /* 130: old "get_kernel_syms" */
1114         .long _sys_quotactl
1115         .long _sys_getpgid
1116         .long _sys_fchdir
1117         .long _sys_bdflush
1118         .long _sys_ni_syscall   /* 135 */ /* sys_sysfs */
1119         .long _sys_personality
1120         .long _sys_ni_syscall   /* for afs_syscall */
1121         .long _sys_setfsuid     /* setfsuid16 */
1122         .long _sys_setfsgid     /* setfsgid16 */
1123         .long _sys_llseek       /* 140 */
1124         .long _sys_getdents
1125         .long _sys_ni_syscall   /* sys_select */
1126         .long _sys_flock
1127         .long _sys_ni_syscall   /* sys_msync */
1128         .long _sys_readv                /* 145 */
1129         .long _sys_writev
1130         .long _sys_getsid
1131         .long _sys_fdatasync
1132         .long _sys_sysctl
1133         .long _sys_ni_syscall   /* 150 */ /* sys_mlock */
1134         .long _sys_ni_syscall   /* sys_munlock */
1135         .long _sys_ni_syscall   /* sys_mlockall */
1136         .long _sys_ni_syscall   /* sys_munlockall */
1137         .long _sys_sched_setparam
1138         .long _sys_sched_getparam /* 155 */
1139         .long _sys_sched_setscheduler
1140         .long _sys_sched_getscheduler
1141         .long _sys_sched_yield
1142         .long _sys_sched_get_priority_max
1143         .long _sys_sched_get_priority_min  /* 160 */
1144         .long _sys_sched_rr_get_interval
1145         .long _sys_nanosleep
1146         .long _sys_mremap
1147         .long _sys_setresuid    /* setresuid16 */
1148         .long _sys_getresuid    /* getresuid16 */       /* 165 */
1149         .long _sys_ni_syscall   /* for vm86 */
1150         .long _sys_ni_syscall   /* old "query_module" */
1151         .long _sys_ni_syscall   /* sys_poll */
1152         .long _sys_nfsservctl
1153         .long _sys_setresgid    /* setresgid16 */       /* 170 */
1154         .long _sys_getresgid    /* getresgid16 */
1155         .long _sys_prctl
1156         .long _sys_rt_sigreturn
1157         .long _sys_rt_sigaction
1158         .long _sys_rt_sigprocmask /* 175 */
1159         .long _sys_rt_sigpending
1160         .long _sys_rt_sigtimedwait
1161         .long _sys_rt_sigqueueinfo
1162         .long _sys_rt_sigsuspend
1163         .long _sys_pread64      /* 180 */
1164         .long _sys_pwrite64
1165         .long _sys_lchown       /* lchown16 */
1166         .long _sys_getcwd
1167         .long _sys_capget
1168         .long _sys_capset       /* 185 */
1169         .long _sys_sigaltstack
1170         .long _sys_sendfile
1171         .long _sys_ni_syscall   /* streams1 */
1172         .long _sys_ni_syscall   /* streams2 */
1173         .long _sys_vfork                /* 190 */
1174         .long _sys_getrlimit
1175         .long _sys_mmap2
1176         .long _sys_truncate64
1177         .long _sys_ftruncate64
1178         .long _sys_stat64       /* 195 */
1179         .long _sys_lstat64
1180         .long _sys_fstat64
1181         .long _sys_chown
1182         .long _sys_getuid
1183         .long _sys_getgid       /* 200 */
1184         .long _sys_geteuid
1185         .long _sys_getegid
1186         .long _sys_setreuid
1187         .long _sys_setregid
1188         .long _sys_getgroups    /* 205 */
1189         .long _sys_setgroups
1190         .long _sys_fchown
1191         .long _sys_setresuid
1192         .long _sys_getresuid
1193         .long _sys_setresgid    /* 210 */
1194         .long _sys_getresgid
1195         .long _sys_lchown
1196         .long _sys_setuid
1197         .long _sys_setgid
1198         .long _sys_setfsuid     /* 215 */
1199         .long _sys_setfsgid
1200         .long _sys_pivot_root
1201         .long _sys_ni_syscall   /* sys_mincore */
1202         .long _sys_ni_syscall   /* sys_madvise */
1203         .long _sys_getdents64   /* 220 */
1204         .long _sys_fcntl64
1205         .long _sys_ni_syscall   /* reserved for TUX */
1206         .long _sys_ni_syscall
1207         .long _sys_gettid
1208         .long _sys_readahead    /* 225 */
1209         .long _sys_setxattr
1210         .long _sys_lsetxattr
1211         .long _sys_fsetxattr
1212         .long _sys_getxattr
1213         .long _sys_lgetxattr    /* 230 */
1214         .long _sys_fgetxattr
1215         .long _sys_listxattr
1216         .long _sys_llistxattr
1217         .long _sys_flistxattr
1218         .long _sys_removexattr  /* 235 */
1219         .long _sys_lremovexattr
1220         .long _sys_fremovexattr
1221         .long _sys_tkill
1222         .long _sys_sendfile64
1223         .long _sys_futex                /* 240 */
1224         .long _sys_sched_setaffinity
1225         .long _sys_sched_getaffinity
1226         .long _sys_ni_syscall   /* sys_set_thread_area */
1227         .long _sys_ni_syscall   /* sys_get_thread_area */
1228         .long _sys_io_setup     /* 245 */
1229         .long _sys_io_destroy
1230         .long _sys_io_getevents
1231         .long _sys_io_submit
1232         .long _sys_io_cancel
1233         .long _sys_ni_syscall   /* 250 */ /* sys_alloc_hugepages */
1234         .long _sys_ni_syscall   /* sys_freec_hugepages */
1235         .long _sys_exit_group
1236         .long _sys_lookup_dcookie
1237         .long _sys_bfin_spinlock
1238         .long _sys_epoll_create /* 255 */
1239         .long _sys_epoll_ctl
1240         .long _sys_epoll_wait
1241         .long _sys_ni_syscall /* remap_file_pages */
1242         .long _sys_set_tid_address
1243         .long _sys_timer_create /* 260 */
1244         .long _sys_timer_settime
1245         .long _sys_timer_gettime
1246         .long _sys_timer_getoverrun
1247         .long _sys_timer_delete
1248         .long _sys_clock_settime /* 265 */
1249         .long _sys_clock_gettime
1250         .long _sys_clock_getres
1251         .long _sys_clock_nanosleep
1252         .long _sys_statfs64
1253         .long _sys_fstatfs64    /* 270 */
1254         .long _sys_tgkill
1255         .long _sys_utimes
1256         .long _sys_fadvise64_64
1257         .long _sys_ni_syscall /* vserver */
1258         .long _sys_ni_syscall /* 275, mbind */
1259         .long _sys_ni_syscall /* get_mempolicy */
1260         .long _sys_ni_syscall /* set_mempolicy */
1261         .long _sys_mq_open
1262         .long _sys_mq_unlink
1263         .long _sys_mq_timedsend /* 280 */
1264         .long _sys_mq_timedreceive
1265         .long _sys_mq_notify
1266         .long _sys_mq_getsetattr
1267         .long _sys_ni_syscall /* kexec_load */
1268         .long _sys_waitid       /* 285 */
1269         .long _sys_add_key
1270         .long _sys_request_key
1271         .long _sys_keyctl
1272         .long _sys_ioprio_set
1273         .long _sys_ioprio_get   /* 290 */
1274         .long _sys_inotify_init
1275         .long _sys_inotify_add_watch
1276         .long _sys_inotify_rm_watch
1277         .long _sys_ni_syscall /* migrate_pages */
1278         .long _sys_openat       /* 295 */
1279         .long _sys_mkdirat
1280         .long _sys_mknodat
1281         .long _sys_fchownat
1282         .long _sys_futimesat
1283         .long _sys_fstatat64    /* 300 */
1284         .long _sys_unlinkat
1285         .long _sys_renameat
1286         .long _sys_linkat
1287         .long _sys_symlinkat
1288         .long _sys_readlinkat   /* 305 */
1289         .long _sys_fchmodat
1290         .long _sys_faccessat
1291         .long _sys_pselect6
1292         .long _sys_ppoll
1293         .long _sys_unshare      /* 310 */
1294         .long _sys_sram_alloc
1295         .long _sys_sram_free
1296         .long _sys_dma_memcpy
1297         .long _sys_accept
1298         .long _sys_bind         /* 315 */
1299         .long _sys_connect
1300         .long _sys_getpeername
1301         .long _sys_getsockname
1302         .long _sys_getsockopt
1303         .long _sys_listen       /* 320 */
1304         .long _sys_recv
1305         .long _sys_recvfrom
1306         .long _sys_recvmsg
1307         .long _sys_send
1308         .long _sys_sendmsg      /* 325 */
1309         .long _sys_sendto
1310         .long _sys_setsockopt
1311         .long _sys_shutdown
1312         .long _sys_socket
1313         .long _sys_socketpair   /* 330 */
1314         .long _sys_semctl
1315         .long _sys_semget
1316         .long _sys_semop
1317         .long _sys_msgctl
1318         .long _sys_msgget       /* 335 */
1319         .long _sys_msgrcv
1320         .long _sys_msgsnd
1321         .long _sys_shmat
1322         .long _sys_shmctl
1323         .long _sys_shmdt        /* 340 */
1324         .long _sys_shmget
1325         .long _sys_splice
1326         .long _sys_sync_file_range
1327         .long _sys_tee
1328         .long _sys_vmsplice     /* 345 */
1329         .long _sys_epoll_pwait
1330         .long _sys_utimensat
1331         .long _sys_signalfd
1332         .long _sys_timerfd_create
1333         .long _sys_eventfd      /* 350 */
1334         .long _sys_pread64
1335         .long _sys_pwrite64
1336         .long _sys_fadvise64
1337         .long _sys_set_robust_list
1338         .long _sys_get_robust_list      /* 355 */
1339         .long _sys_fallocate
1340         .long _sys_semtimedop
1341         .long _sys_timerfd_settime
1342         .long _sys_timerfd_gettime
1343
1344         .rept NR_syscalls-(.-_sys_call_table)/4
1345         .long _sys_ni_syscall
1346         .endr
1347 _excpt_saved_imask:
1348         .long 0;
1349
1350 _exception_stack:
1351         .rept 1024
1352         .long 0;
1353         .endr
1354 _exception_stack_top:
1355
1356 #if ANOMALY_05000261
1357 /* Used by the assembly entry point to work around an anomaly.  */
1358 _last_cplb_fault_retx:
1359         .long 0;
1360 #endif
1361         /* Used to save the real RETX when temporarily storing a safe
1362          * return address.  */
1363 __retx:
1364         .long 0;