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