blob: 5531f49c84e632714117dc4cf256257c382de33d [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
Robin Getz2ebcade2007-10-09 17:24:30 +080032/* NOTE: This code handles signal-recognition, which happens every time
Bryan Wu1394f032007-05-06 14:50:22 -070033 * after a timer-interrupt and after each system call.
34 */
35
Mike Frysinger9cb07b22007-11-21 16:45:08 +080036#include <linux/init.h>
Bryan Wu1394f032007-05-06 14:50:22 -070037#include <linux/linkage.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080038#include <linux/unistd.h>
Graf Yang6b3087c2009-01-07 23:14:39 +080039#include <linux/threads.h>
Bryan Wu1394f032007-05-06 14:50:22 -070040#include <asm/blackfin.h>
Bryan Wu1394f032007-05-06 14:50:22 -070041#include <asm/errno.h>
Bernd Schmidt5d750b92008-04-25 05:02:33 +080042#include <asm/fixed_code.h>
Bryan Wu1394f032007-05-06 14:50:22 -070043#include <asm/thread_info.h> /* TIF_NEED_RESCHED */
44#include <asm/asm-offsets.h>
Robin Getz669b7922007-06-21 16:34:08 +080045#include <asm/trace.h>
Bryan Wu1394f032007-05-06 14:50:22 -070046
Bryan Wu639f6572008-08-27 10:51:02 +080047#include <asm/context.S>
Bryan Wu1394f032007-05-06 14:50:22 -070048
Mike Frysingerf0b5d122007-08-05 17:03:59 +080049#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
53#else
54# define EX_SCRATCH_REG CYCLES
55#endif
56
Bryan Wu1394f032007-05-06 14:50:22 -070057#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
58.section .l1.text
59#else
60.text
61#endif
62
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.
66 */
Mike Frysinger1aafd902007-07-25 11:19:14 +080067#if ANOMALY_05000261
Robin Getzf26fbc42007-11-12 22:21:30 +080068#define _ex_dviol _ex_workaround_261
69#define _ex_dmiss _ex_workaround_261
70#define _ex_dmult _ex_workaround_261
71
72ENTRY(_ex_workaround_261)
Bryan Wu1394f032007-05-06 14:50:22 -070073 /*
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,
76 * handle it.
77 */
Robin Getzf26fbc42007-11-12 22:21:30 +080078 P4 = R7; /* Store EXCAUSE */
Graf Yang6b3087c2009-01-07 23:14:39 +080079
80 GET_PDA(p5, r7);
81 r7 = [p5 + PDA_LFRETX];
Bryan Wu1394f032007-05-06 14:50:22 -070082 r6 = retx;
Graf Yang6b3087c2009-01-07 23:14:39 +080083 [p5 + PDA_LFRETX] = r6;
Bryan Wu1394f032007-05-06 14:50:22 -070084 cc = r6 == r7;
Mike Frysinger8d6c2422007-11-21 15:53:49 +080085 if !cc jump _bfin_return_from_exception;
Bryan Wu1394f032007-05-06 14:50:22 -070086 /* fall through */
Robin Getzf26fbc42007-11-12 22:21:30 +080087 R7 = P4;
88 R6 = 0x26; /* Data CPLB Miss */
89 cc = R6 == R7;
90 if cc jump _ex_dcplb_miss (BP);
Bernd Schmidtb97b8a92008-01-27 18:39:16 +080091 R6 = 0x23; /* Data CPLB Miss */
92 cc = R6 == R7;
93 if cc jump _ex_dcplb_viol (BP);
Robin Getzf26fbc42007-11-12 22:21:30 +080094 /* Handle 0x23 Data CPLB Protection Violation
95 * and Data CPLB Multiple Hits - Linux Trap Zero
96 */
97 jump _ex_trap_c;
98ENDPROC(_ex_workaround_261)
Bryan Wu1394f032007-05-06 14:50:22 -070099
Robin Getzf26fbc42007-11-12 22:21:30 +0800100#else
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800101#ifdef CONFIG_MPU
102#define _ex_dviol _ex_dcplb_viol
103#else
Robin Getzf26fbc42007-11-12 22:21:30 +0800104#define _ex_dviol _ex_trap_c
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800105#endif
Robin Getzf26fbc42007-11-12 22:21:30 +0800106#define _ex_dmiss _ex_dcplb_miss
107#define _ex_dmult _ex_trap_c
108#endif
109
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800110
111ENTRY(_ex_dcplb_viol)
Robin Getzf26fbc42007-11-12 22:21:30 +0800112ENTRY(_ex_dcplb_miss)
113ENTRY(_ex_icplb_miss)
Bryan Wu1394f032007-05-06 14:50:22 -0700114 (R7:6,P5:4) = [sp++];
115 ASTAT = [sp++];
116 SAVE_ALL_SYS
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800117#ifdef CONFIG_MPU
Bernd Schmidt2a0c4fd2008-04-23 07:17:34 +0800118 /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
119 * will change the stack pointer. */
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800120 R0 = SEQSTAT;
121 R1 = SP;
Bernd Schmidt2a0c4fd2008-04-23 07:17:34 +0800122#endif
123 DEBUG_HWTRACE_SAVE(p5, r7)
124#ifdef CONFIG_MPU
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800125 sp += -12;
126 call _cplb_hdr;
127 sp += 12;
128 CC = R0 == 0;
129 IF !CC JUMP _handle_bad_cplb;
130#else
Bryan Wu1394f032007-05-06 14:50:22 -0700131 call __cplb_hdr;
Bernd Schmidtb97b8a92008-01-27 18:39:16 +0800132#endif
Robin Getz0c7a6b22008-10-08 16:27:12 +0800133
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);
139 r7 = r7 & r6;
140 r6 = 0x25;
141 CC = R7 == R6;
142 if CC JUMP _double_fault;
143#endif
144
Mike Frysinger80f31c82008-02-02 15:47:24 +0800145 DEBUG_HWTRACE_RESTORE(p5, r7)
Bryan Wu1394f032007-05-06 14:50:22 -0700146 RESTORE_ALL_SYS
Mike Frysingerf0b5d122007-08-05 17:03:59 +0800147 SP = EX_SCRATCH_REG;
Bryan Wu1394f032007-05-06 14:50:22 -0700148 rtx;
Robin Getzf26fbc42007-11-12 22:21:30 +0800149ENDPROC(_ex_icplb_miss)
Bryan Wu1394f032007-05-06 14:50:22 -0700150
Bryan Wu1394f032007-05-06 14:50:22 -0700151ENTRY(_ex_syscall)
Bryan Wu1394f032007-05-06 14:50:22 -0700152 raise 15; /* invoked by TRAP #0, for sys call */
Robin Getz0c7a6b22008-10-08 16:27:12 +0800153 jump.s _bfin_return_from_exception;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800154ENDPROC(_ex_syscall)
Bryan Wu1394f032007-05-06 14:50:22 -0700155
Bryan Wu1394f032007-05-06 14:50:22 -0700156ENTRY(_ex_soft_bp)
157 r7 = retx;
158 r7 += -2;
159 retx = r7;
160 jump.s _ex_trap_c;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800161ENDPROC(_ex_soft_bp)
Bryan Wu1394f032007-05-06 14:50:22 -0700162
163ENTRY(_ex_single_step)
Bernd Schmidt0893f122008-05-07 11:41:26 +0800164 /* If we just returned from an interrupt, the single step event is
165 for the RTI instruction. */
Bryan Wu1394f032007-05-06 14:50:22 -0700166 r7 = retx;
167 r6 = reti;
168 cc = r7 == r6;
Bernd Schmidt0893f122008-05-07 11:41:26 +0800169 if cc jump _bfin_return_from_exception;
170
Jie Zhang5400c5a2008-08-05 17:33:38 +0800171#ifdef CONFIG_KGDB
Sonic Zhang0d1cdd72008-07-26 18:54:38 +0800172 /* Don't do single step in hardware exception handler */
173 p5.l = lo(IPEND);
174 p5.h = hi(IPEND);
175 r6 = [p5];
Sonic Zhangd6a29892008-08-05 18:28:26 +0800176 cc = bittst(r6, 4);
177 if cc jump _bfin_return_from_exception;
Sonic Zhang0d1cdd72008-07-26 18:54:38 +0800178 cc = bittst(r6, 5);
179 if cc jump _bfin_return_from_exception;
180
Sonic Zhang0d1cdd72008-07-26 18:54:38 +0800181 /* skip single step if current interrupt priority is higher than
182 * that of the first instruction, from which gdb starts single step */
183 r6 >>= 6;
184 r7 = 10;
185.Lfind_priority_start:
186 cc = bittst(r6, 0);
187 if cc jump .Lfind_priority_done;
188 r6 >>= 1;
189 r7 += -1;
190 cc = r7 == 0;
191 if cc jump .Lfind_priority_done;
192 jump.s .Lfind_priority_start;
193.Lfind_priority_done:
Sonic Zhanga5ac0122008-10-13 14:07:19 +0800194 p4.l = _kgdb_single_step;
195 p4.h = _kgdb_single_step;
Sonic Zhang0d1cdd72008-07-26 18:54:38 +0800196 r6 = [p4];
197 cc = r6 == 0;
198 if cc jump .Ldo_single_step;
199 r6 += -1;
200 cc = r6 < r7;
Sonic Zhangd6a29892008-08-05 18:28:26 +0800201 if cc jump 1f;
Sonic Zhang0d1cdd72008-07-26 18:54:38 +0800202.Ldo_single_step:
Sonic Zhangd6a29892008-08-05 18:28:26 +0800203#else
Bernd Schmidt0893f122008-05-07 11:41:26 +0800204 /* If we were in user mode, do the single step normally. */
Jie Zhang5400c5a2008-08-05 17:33:38 +0800205 p5.l = lo(IPEND);
206 p5.h = hi(IPEND);
Bernd Schmidt0893f122008-05-07 11:41:26 +0800207 r6 = [p5];
208 r7 = 0xffe0 (z);
209 r7 = r7 & r6;
210 cc = r7 == 0;
Jie Zhang5400c5a2008-08-05 17:33:38 +0800211 if !cc jump 1f;
Sonic Zhangd6a29892008-08-05 18:28:26 +0800212#endif
Bernd Schmidt0893f122008-05-07 11:41:26 +0800213
Jie Zhang5400c5a2008-08-05 17:33:38 +0800214 /* Single stepping only a single instruction, so clear the trace
215 * bit here. */
216 r7 = syscfg;
217 bitclr (r7, 0);
218 syscfg = R7;
219 jump _ex_trap_c;
220
2211:
Bernd Schmidt0893f122008-05-07 11:41:26 +0800222 /*
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.
227 *
228 * First, find out the interrupt level and the event vector for it.
229 */
230 p5.l = lo(EVT0);
231 p5.h = hi(EVT0);
232 p5 += -4;
2332:
234 r7 = rot r7 by -1;
235 p5 += 4;
236 if !cc jump 2b;
237
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
241 * for them. */
242
243 r7 = [p5];
244 r7 += 2;
245 r6 = RETX;
246 cc = R7 == R6;
247 if !cc jump _bfin_return_from_exception;
248
Bryan Wu1394f032007-05-06 14:50:22 -0700249 r7 = syscfg;
250 bitclr (r7, 0);
251 syscfg = R7;
252
Jie Zhang5400c5a2008-08-05 17:33:38 +0800253 /* Fall through to _bfin_return_from_exception. */
Mike Frysinger46c87c32007-11-21 16:15:48 +0800254ENDPROC(_ex_single_step)
Bryan Wu1394f032007-05-06 14:50:22 -0700255
Mike Frysinger8d6c2422007-11-21 15:53:49 +0800256ENTRY(_bfin_return_from_exception)
Mike Frysinger1aafd902007-07-25 11:19:14 +0800257#if ANOMALY_05000257
Michael Hennerich8af10b72007-05-21 18:09:09 +0800258 R7=LC0;
259 LC0=R7;
260 R7=LC1;
261 LC1=R7;
262#endif
Robin Getz0c7a6b22008-10-08 16:27:12 +0800263
264#ifdef CONFIG_DEBUG_DOUBLEFAULT
265 /* While we were processing the current exception,
266 * did we cause another, and double fault?
267 */
268 r7 = SEQSTAT; /* reason code is in bit 5:0 */
269 r6.l = lo(SEQSTAT_EXCAUSE);
270 r6.h = hi(SEQSTAT_EXCAUSE);
271 r7 = r7 & r6;
272 r6 = 0x25;
273 CC = R7 == R6;
274 if CC JUMP _double_fault;
275
276 /* Did we cause a HW error? */
277 p5.l = lo(ILAT);
278 p5.h = hi(ILAT);
279 r6 = [p5];
280 r7 = 0x20; /* Did I just cause anther HW error? */
Graf Yang4213cb62008-11-18 17:48:22 +0800281 r6 = r7 & r6;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800282 CC = R7 == R6;
283 if CC JUMP _double_fault;
284#endif
285
Bryan Wu1394f032007-05-06 14:50:22 -0700286 (R7:6,P5:4) = [sp++];
287 ASTAT = [sp++];
Mike Frysingerf0b5d122007-08-05 17:03:59 +0800288 sp = EX_SCRATCH_REG;
Bryan Wu1394f032007-05-06 14:50:22 -0700289 rtx;
Mike Frysinger46c87c32007-11-21 16:15:48 +0800290ENDPROC(_bfin_return_from_exception)
Bryan Wu1394f032007-05-06 14:50:22 -0700291
292ENTRY(_handle_bad_cplb)
Bernd Schmidt2a0c4fd2008-04-23 07:17:34 +0800293 DEBUG_HWTRACE_RESTORE(p5, r7)
Bryan Wu1394f032007-05-06 14:50:22 -0700294 /* 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
300 */
301
Bryan Wu1394f032007-05-06 14:50:22 -0700302 RESTORE_ALL_SYS
303 [--sp] = ASTAT;
Mike Frysinger80f31c82008-02-02 15:47:24 +0800304 [--sp] = (R7:6,P5:4);
Bryan Wu1394f032007-05-06 14:50:22 -0700305
Mike Frysinger1ffe6642007-08-05 17:14:04 +0800306ENTRY(_ex_replaceable)
307 nop;
308
Bryan Wu1394f032007-05-06 14:50:22 -0700309ENTRY(_ex_trap_c)
Robin Getz2ebcade2007-10-09 17:24:30 +0800310 /* Make sure we are not in a double fault */
311 p4.l = lo(IPEND);
312 p4.h = hi(IPEND);
313 r7 = [p4];
314 CC = BITTST (r7, 5);
315 if CC jump _double_fault;
316
Bryan Wu1394f032007-05-06 14:50:22 -0700317 /* 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.
320 */
321 P5.h = _exception_to_level5;
322 P5.l = _exception_to_level5;
323 p4.l = lo(EVT5);
324 p4.h = hi(EVT5);
325 [p4] = p5;
326 csync;
327
Graf Yang6b3087c2009-01-07 23:14:39 +0800328 GET_PDA(p5, r6);
Robin Getz0c7a6b22008-10-08 16:27:12 +0800329#ifndef CONFIG_DEBUG_DOUBLEFAULT
Graf Yang6b3087c2009-01-07 23:14:39 +0800330
Robin Getz0c7a6b22008-10-08 16:27:12 +0800331 /*
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
336 */
337
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800338 p4.l = lo(DCPLB_FAULT_ADDR);
339 p4.h = hi(DCPLB_FAULT_ADDR);
340 r7 = [p4];
Graf Yang6b3087c2009-01-07 23:14:39 +0800341 [p5 + PDA_DCPLB] = r7;
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800342
Graf Yang6b3087c2009-01-07 23:14:39 +0800343 p4.l = lo(ICPLB_FAULT_ADDR);
344 p4.h = hi(ICPLB_FAULT_ADDR);
345 r6 = [p4];
346 [p5 + PDA_ICPLB] = r6;
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800347
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800348 r6 = retx;
Graf Yang6b3087c2009-01-07 23:14:39 +0800349 [p5 + PDA_RETX] = r6;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800350#endif
Bernd Schmidt0893f122008-05-07 11:41:26 +0800351 r6 = SYSCFG;
Graf Yang6b3087c2009-01-07 23:14:39 +0800352 [p5 + PDA_SYSCFG] = r6;
Bernd Schmidt0893f122008-05-07 11:41:26 +0800353 BITCLR(r6, 0);
354 SYSCFG = r6;
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800355
Bryan Wu1394f032007-05-06 14:50:22 -0700356 /* Disable all interrupts, but make sure level 5 is enabled so
357 * we can switch to that level. Save the old mask. */
358 cli r6;
Graf Yang6b3087c2009-01-07 23:14:39 +0800359 [p5 + PDA_EXIMASK] = r6;
Bernd Schmidt0893f122008-05-07 11:41:26 +0800360
361 p4.l = lo(SAFE_USER_INSTRUCTION);
362 p4.h = hi(SAFE_USER_INSTRUCTION);
363 retx = p4;
364
Bryan Wu1394f032007-05-06 14:50:22 -0700365 r6 = 0x3f;
366 sti r6;
367
Bryan Wu1394f032007-05-06 14:50:22 -0700368 raise 5;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800369 jump.s _bfin_return_from_exception;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800370ENDPROC(_ex_trap_c)
Bryan Wu1394f032007-05-06 14:50:22 -0700371
Robin Getz2ebcade2007-10-09 17:24:30 +0800372/* We just realized we got an exception, while we were processing a different
373 * exception. This is a unrecoverable event, so crash
374 */
375ENTRY(_double_fault)
Robin Getz0c7a6b22008-10-08 16:27:12 +0800376 /* Turn caches & protection off, to ensure we don't get any more
377 * double exceptions
378 */
Robin Getz2ebcade2007-10-09 17:24:30 +0800379
Robin Getz0c7a6b22008-10-08 16:27:12 +0800380 P4.L = LO(IMEM_CONTROL);
381 P4.H = HI(IMEM_CONTROL);
Robin Getz2ebcade2007-10-09 17:24:30 +0800382
Robin Getz0c7a6b22008-10-08 16:27:12 +0800383 R5 = [P4]; /* Control Register*/
384 BITCLR(R5,ENICPLB_P);
385 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
386 .align 8;
387 [P4] = R5;
388 SSYNC;
Robin Getz2ebcade2007-10-09 17:24:30 +0800389
Robin Getz0c7a6b22008-10-08 16:27:12 +0800390 P4.L = LO(DMEM_CONTROL);
391 P4.H = HI(DMEM_CONTROL);
392 R5 = [P4];
393 BITCLR(R5,ENDCPLB_P);
394 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
395 .align 8;
396 [P4] = R5;
397 SSYNC;
Robin Getz2ebcade2007-10-09 17:24:30 +0800398
Robin Getz0c7a6b22008-10-08 16:27:12 +0800399 /* Fix up the stack */
400 (R7:6,P5:4) = [sp++];
401 ASTAT = [sp++];
402 SP = EX_SCRATCH_REG;
Robin Getz2ebcade2007-10-09 17:24:30 +0800403
Robin Getz0c7a6b22008-10-08 16:27:12 +0800404 /* We should be out of the exception stack, and back down into
405 * kernel or user space stack
406 */
407 SAVE_ALL_SYS
Robin Getz2ebcade2007-10-09 17:24:30 +0800408
Bernd Schmidtddb3f002008-05-07 11:41:26 +0800409 /* The dumping functions expect the return address in the RETI
410 * slot. */
411 r6 = retx;
412 [sp + PT_PC] = r6;
413
Robin Getz0c7a6b22008-10-08 16:27:12 +0800414 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
415 SP += -12;
416 call _double_fault_c;
417 SP += 12;
Robin Getz2ebcade2007-10-09 17:24:30 +0800418.L_double_fault_panic:
419 JUMP .L_double_fault_panic
420
421ENDPROC(_double_fault)
422
Bryan Wu1394f032007-05-06 14:50:22 -0700423ENTRY(_exception_to_level5)
424 SAVE_ALL_SYS
425
Graf Yang6b3087c2009-01-07 23:14:39 +0800426 GET_PDA(p4, r7); /* Fetch current PDA */
427 r6 = [p4 + PDA_RETX];
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800428 [sp + PT_PC] = r6;
429
Graf Yang6b3087c2009-01-07 23:14:39 +0800430 r6 = [p4 + PDA_SYSCFG];
Bernd Schmidt0893f122008-05-07 11:41:26 +0800431 [sp + PT_SYSCFG] = r6;
432
Bryan Wu1394f032007-05-06 14:50:22 -0700433 /* Restore interrupt mask. We haven't pushed RETI, so this
434 * doesn't enable interrupts until we return from this handler. */
Graf Yang6b3087c2009-01-07 23:14:39 +0800435 r6 = [p4 + PDA_EXIMASK];
Bryan Wu1394f032007-05-06 14:50:22 -0700436 sti r6;
437
438 /* Restore the hardware error vector. */
439 P5.h = _evt_ivhw;
440 P5.l = _evt_ivhw;
441 p4.l = lo(EVT5);
442 p4.h = hi(EVT5);
443 [p4] = p5;
444 csync;
445
446 p2.l = lo(IPEND);
447 p2.h = hi(IPEND);
448 csync;
449 r0 = [p2]; /* Read current IPEND */
450 [sp + PT_IPEND] = r0; /* Store IPEND */
451
Bryan Wu1394f032007-05-06 14:50:22 -0700452 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
453 SP += -12;
454 call _trap_c;
455 SP += 12;
456
Robin Getz0c7a6b22008-10-08 16:27:12 +0800457#ifdef CONFIG_DEBUG_DOUBLEFAULT
458 /* Grab ILAT */
459 p2.l = lo(ILAT);
460 p2.h = hi(ILAT);
461 r0 = [p2];
462 r1 = 0x20; /* Did I just cause anther HW error? */
463 r0 = r0 & r1;
464 CC = R0 == R1;
465 if CC JUMP _double_fault;
466#endif
467
Bryan Wu1394f032007-05-06 14:50:22 -0700468 call _ret_from_exception;
469 RESTORE_ALL_SYS
470 rti;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800471ENDPROC(_exception_to_level5)
Bryan Wu1394f032007-05-06 14:50:22 -0700472
473ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
474 /* Since the kernel stack can be anywhere, it's not guaranteed to be
475 * covered by a CPLB. Switch to an exception stack; use RETN as a
476 * scratch register (for want of a better option).
477 */
Mike Frysingerf0b5d122007-08-05 17:03:59 +0800478 EX_SCRATCH_REG = sp;
Graf Yang6b3087c2009-01-07 23:14:39 +0800479 GET_PDA_SAFE(sp);
480 sp = [sp + PDA_EXSTACK]
Bryan Wu1394f032007-05-06 14:50:22 -0700481 /* Try to deal with syscalls quickly. */
482 [--sp] = ASTAT;
Mike Frysinger80f31c82008-02-02 15:47:24 +0800483 [--sp] = (R7:6,P5:4);
Robin Getz0c7a6b22008-10-08 16:27:12 +0800484
Michael Hennerich5e9e7682008-10-09 12:31:03 +0800485#if ANOMALY_05000283 || ANOMALY_05000315
486 cc = r7 == r7;
487 p5.h = HI(CHIPID);
488 p5.l = LO(CHIPID);
489 if cc jump 1f;
490 r7.l = W[p5];
4911:
492#endif
493
Robin Getz0c7a6b22008-10-08 16:27:12 +0800494#ifdef CONFIG_DEBUG_DOUBLEFAULT
495 /*
496 * Save these registers, as they are only valid in exception context
497 * (where we are now - as soon as we defer to IRQ5, they can change)
498 * DCPLB_STATUS and ICPLB_STATUS are also only valid in EVT3,
499 * but they are not very interesting, so don't save them
500 */
501
Graf Yang6b3087c2009-01-07 23:14:39 +0800502 GET_PDA(p5, r7);
Robin Getz0c7a6b22008-10-08 16:27:12 +0800503 p4.l = lo(DCPLB_FAULT_ADDR);
504 p4.h = hi(DCPLB_FAULT_ADDR);
505 r7 = [p4];
Graf Yang6b3087c2009-01-07 23:14:39 +0800506 [p5 + PDA_DCPLB] = r7;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800507
Graf Yang6b3087c2009-01-07 23:14:39 +0800508 p4.l = lo(ICPLB_FAULT_ADDR);
509 p4.h = hi(ICPLB_FAULT_ADDR);
510 r7 = [p4];
511 [p5 + PDA_ICPLB] = r7;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800512
Robin Getz0c7a6b22008-10-08 16:27:12 +0800513 r6 = retx;
Graf Yang6b3087c2009-01-07 23:14:39 +0800514 [p5 + PDA_RETX] = r6;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800515
Bryan Wu1394f032007-05-06 14:50:22 -0700516 r7 = SEQSTAT; /* reason code is in bit 5:0 */
Graf Yang6b3087c2009-01-07 23:14:39 +0800517 [p5 + PDA_SEQSTAT] = r7;
Robin Getz0c7a6b22008-10-08 16:27:12 +0800518#else
519 r7 = SEQSTAT; /* reason code is in bit 5:0 */
520#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700521 r6.l = lo(SEQSTAT_EXCAUSE);
522 r6.h = hi(SEQSTAT_EXCAUSE);
523 r7 = r7 & r6;
Mike Frysinger1ffe6642007-08-05 17:14:04 +0800524 p5.h = _ex_table;
525 p5.l = _ex_table;
Bryan Wu1394f032007-05-06 14:50:22 -0700526 p4 = r7;
527 p5 = p5 + (p4 << 2);
528 p4 = [p5];
529 jump (p4);
530
531.Lbadsys:
532 r7 = -ENOSYS; /* signextending enough */
533 [sp + PT_R0] = r7; /* return value from system call */
534 jump .Lsyscall_really_exit;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800535ENDPROC(_trap)
Bryan Wu1394f032007-05-06 14:50:22 -0700536
537ENTRY(_kernel_execve)
538 link SIZEOF_PTREGS;
539 p0 = sp;
540 r3 = SIZEOF_PTREGS / 4;
541 r4 = 0(x);
Graf Yang6b3087c2009-01-07 23:14:39 +0800542.Lclear_regs:
Bryan Wu1394f032007-05-06 14:50:22 -0700543 [p0++] = r4;
544 r3 += -1;
545 cc = r3 == 0;
Graf Yang6b3087c2009-01-07 23:14:39 +0800546 if !cc jump .Lclear_regs (bp);
Bryan Wu1394f032007-05-06 14:50:22 -0700547
548 p0 = sp;
549 sp += -16;
550 [sp + 12] = p0;
551 call _do_execve;
552 SP += 16;
553 cc = r0 == 0;
Graf Yang6b3087c2009-01-07 23:14:39 +0800554 if ! cc jump .Lexecve_failed;
Bryan Wu1394f032007-05-06 14:50:22 -0700555 /* Success. Copy our temporary pt_regs to the top of the kernel
556 * stack and do a normal exception return.
557 */
558 r1 = sp;
559 r0 = (-KERNEL_STACK_SIZE) (x);
560 r1 = r1 & r0;
561 p2 = r1;
562 p3 = [p2];
563 r0 = KERNEL_STACK_SIZE - 4 (z);
564 p1 = r0;
565 p1 = p1 + p2;
566
567 p0 = fp;
568 r4 = [p0--];
569 r3 = SIZEOF_PTREGS / 4;
Graf Yang6b3087c2009-01-07 23:14:39 +0800570.Lcopy_regs:
Bryan Wu1394f032007-05-06 14:50:22 -0700571 r4 = [p0--];
572 [p1--] = r4;
573 r3 += -1;
574 cc = r3 == 0;
Graf Yang6b3087c2009-01-07 23:14:39 +0800575 if ! cc jump .Lcopy_regs (bp);
Bryan Wu1394f032007-05-06 14:50:22 -0700576
577 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
578 p1 = r0;
579 p1 = p1 + p2;
580 sp = p1;
581 r0 = syscfg;
582 [SP + PT_SYSCFG] = r0;
583 [p3 + (TASK_THREAD + THREAD_KSP)] = sp;
584
585 RESTORE_CONTEXT;
586 rti;
Graf Yang6b3087c2009-01-07 23:14:39 +0800587.Lexecve_failed:
Bryan Wu1394f032007-05-06 14:50:22 -0700588 unlink;
589 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800590ENDPROC(_kernel_execve)
Bryan Wu1394f032007-05-06 14:50:22 -0700591
592ENTRY(_system_call)
593 /* Store IPEND */
594 p2.l = lo(IPEND);
595 p2.h = hi(IPEND);
596 csync;
597 r0 = [p2];
598 [sp + PT_IPEND] = r0;
599
600 /* Store RETS for now */
601 r0 = rets;
602 [sp + PT_RESERVED] = r0;
603 /* Set the stack for the current process */
604 r7 = sp;
605 r6.l = lo(ALIGN_PAGE_MASK);
606 r6.h = hi(ALIGN_PAGE_MASK);
607 r7 = r7 & r6; /* thread_info */
608 p2 = r7;
609 p2 = [p2];
610
611 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
612
613 /* Check the System Call */
614 r7 = __NR_syscall;
615 /* System call number is passed in P0 */
616 r6 = p0;
617 cc = r6 < r7;
618 if ! cc jump .Lbadsys;
619
620 /* are we tracing syscalls?*/
621 r7 = sp;
622 r6.l = lo(ALIGN_PAGE_MASK);
623 r6.h = hi(ALIGN_PAGE_MASK);
624 r7 = r7 & r6;
625 p2 = r7;
626 r7 = [p2+TI_FLAGS];
627 CC = BITTST(r7,TIF_SYSCALL_TRACE);
628 if CC JUMP _sys_trace;
629
630 /* Execute the appropriate system call */
631
632 p4 = p0;
633 p5.l = _sys_call_table;
634 p5.h = _sys_call_table;
635 p5 = p5 + (p4 << 2);
636 r0 = [sp + PT_R0];
637 r1 = [sp + PT_R1];
638 r2 = [sp + PT_R2];
639 p5 = [p5];
640
641 [--sp] = r5;
642 [--sp] = r4;
643 [--sp] = r3;
644 SP += -12;
645 call (p5);
646 SP += 24;
647 [sp + PT_R0] = r0;
648
649.Lresume_userspace:
650 r7 = sp;
651 r4.l = lo(ALIGN_PAGE_MASK);
652 r4.h = hi(ALIGN_PAGE_MASK);
653 r7 = r7 & r4; /* thread_info->flags */
654 p5 = r7;
655.Lresume_userspace_1:
656 /* Disable interrupts. */
657 [--sp] = reti;
658 reti = [sp++];
659
660 r7 = [p5 + TI_FLAGS];
661 r4.l = lo(_TIF_WORK_MASK);
662 r4.h = hi(_TIF_WORK_MASK);
663 r7 = r7 & r4;
664
665.Lsyscall_resched:
666 cc = BITTST(r7, TIF_NEED_RESCHED);
667 if !cc jump .Lsyscall_sigpending;
668
669 /* Reenable interrupts. */
670 [--sp] = reti;
671 r0 = [sp++];
672
673 SP += -12;
674 call _schedule;
675 SP += 12;
676
677 jump .Lresume_userspace_1;
678
679.Lsyscall_sigpending:
680 cc = BITTST(r7, TIF_RESTORE_SIGMASK);
681 if cc jump .Lsyscall_do_signals;
682 cc = BITTST(r7, TIF_SIGPENDING);
683 if !cc jump .Lsyscall_really_exit;
684.Lsyscall_do_signals:
685 /* Reenable interrupts. */
686 [--sp] = reti;
687 r0 = [sp++];
688
689 r0 = sp;
690 SP += -12;
691 call _do_signal;
692 SP += 12;
693
694.Lsyscall_really_exit:
695 r5 = [sp + PT_RESERVED];
696 rets = r5;
697 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800698ENDPROC(_system_call)
Bryan Wu1394f032007-05-06 14:50:22 -0700699
Mike Frysinger47664c12008-10-09 15:32:18 +0800700/* Do not mark as ENTRY() to avoid error in assembler ...
701 * this symbol need not be global anyways, so ...
702 */
Bryan Wu1394f032007-05-06 14:50:22 -0700703_sys_trace:
704 call _syscall_trace;
705
706 /* Execute the appropriate system call */
707
708 p4 = [SP + PT_P0];
709 p5.l = _sys_call_table;
710 p5.h = _sys_call_table;
711 p5 = p5 + (p4 << 2);
712 r0 = [sp + PT_R0];
713 r1 = [sp + PT_R1];
714 r2 = [sp + PT_R2];
715 r3 = [sp + PT_R3];
716 r4 = [sp + PT_R4];
717 r5 = [sp + PT_R5];
718 p5 = [p5];
719
720 [--sp] = r5;
721 [--sp] = r4;
722 [--sp] = r3;
723 SP += -12;
724 call (p5);
725 SP += 24;
726 [sp + PT_R0] = r0;
727
728 call _syscall_trace;
729 jump .Lresume_userspace;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800730ENDPROC(_sys_trace)
Bryan Wu1394f032007-05-06 14:50:22 -0700731
732ENTRY(_resume)
733 /*
734 * Beware - when entering resume, prev (the current task) is
735 * in r0, next (the new task) is in r1.
736 */
737 p0 = r0;
738 p1 = r1;
739 [--sp] = rets;
740 [--sp] = fp;
741 [--sp] = (r7:4, p5:3);
742
743 /* save usp */
744 p2 = usp;
745 [p0+(TASK_THREAD+THREAD_USP)] = p2;
746
747 /* save current kernel stack pointer */
748 [p0+(TASK_THREAD+THREAD_KSP)] = sp;
749
750 /* save program counter */
751 r1.l = _new_old_task;
752 r1.h = _new_old_task;
753 [p0+(TASK_THREAD+THREAD_PC)] = r1;
754
755 /* restore the kernel stack pointer */
756 sp = [p1+(TASK_THREAD+THREAD_KSP)];
757
758 /* restore user stack pointer */
759 p0 = [p1+(TASK_THREAD+THREAD_USP)];
760 usp = p0;
761
762 /* restore pc */
763 p0 = [p1+(TASK_THREAD+THREAD_PC)];
764 jump (p0);
765
766 /*
767 * Following code actually lands up in a new (old) task.
768 */
769
770_new_old_task:
771 (r7:4, p5:3) = [sp++];
772 fp = [sp++];
773 rets = [sp++];
774
775 /*
776 * When we come out of resume, r0 carries "old" task, becuase we are
777 * in "new" task.
778 */
779 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800780ENDPROC(_resume)
Bryan Wu1394f032007-05-06 14:50:22 -0700781
782ENTRY(_ret_from_exception)
783 p2.l = lo(IPEND);
784 p2.h = hi(IPEND);
785
786 csync;
787 r0 = [p2];
788 [sp + PT_IPEND] = r0;
789
7901:
Robin Getzd5c4b5e2007-12-21 17:49:53 +0800791 r2 = LO(~0x37) (Z);
Bryan Wu1394f032007-05-06 14:50:22 -0700792 r0 = r2 & r0;
793 cc = r0 == 0;
794 if !cc jump 4f; /* if not return to user mode, get out */
795
796 /* Make sure any pending system call or deferred exception
797 * return in ILAT for this process to get executed, otherwise
798 * in case context switch happens, system call of
799 * first process (i.e in ILAT) will be carried
800 * forward to the switched process
801 */
802
803 p2.l = lo(ILAT);
804 p2.h = hi(ILAT);
805 r0 = [p2];
806 r1 = (EVT_IVG14 | EVT_IVG15) (z);
807 r0 = r0 & r1;
808 cc = r0 == 0;
809 if !cc jump 5f;
810
811 /* Set the stack for the current process */
812 r7 = sp;
813 r4.l = lo(ALIGN_PAGE_MASK);
814 r4.h = hi(ALIGN_PAGE_MASK);
815 r7 = r7 & r4; /* thread_info->flags */
816 p5 = r7;
817 r7 = [p5 + TI_FLAGS];
818 r4.l = lo(_TIF_WORK_MASK);
819 r4.h = hi(_TIF_WORK_MASK);
820 r7 = r7 & r4;
821 cc = r7 == 0;
822 if cc jump 4f;
823
824 p0.l = lo(EVT15);
825 p0.h = hi(EVT15);
826 p1.l = _schedule_and_signal;
827 p1.h = _schedule_and_signal;
828 [p0] = p1;
829 csync;
830 raise 15; /* raise evt14 to do signal or reschedule */
8314:
832 r0 = syscfg;
833 bitclr(r0, 0);
834 syscfg = r0;
8355:
836 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800837ENDPROC(_ret_from_exception)
Bryan Wu1394f032007-05-06 14:50:22 -0700838
839ENTRY(_return_from_int)
840 /* If someone else already raised IRQ 15, do nothing. */
841 csync;
842 p2.l = lo(ILAT);
843 p2.h = hi(ILAT);
844 r0 = [p2];
845 cc = bittst (r0, EVT_IVG15_P);
846 if cc jump 2f;
847
848 /* if not return to user mode, get out */
849 p2.l = lo(IPEND);
850 p2.h = hi(IPEND);
851 r0 = [p2];
852 r1 = 0x17(Z);
853 r2 = ~r1;
854 r2.h = 0;
855 r0 = r2 & r0;
856 r1 = 1;
857 r1 = r0 - r1;
858 r2 = r0 & r1;
859 cc = r2 == 0;
860 if !cc jump 2f;
861
862 /* Lower the interrupt level to 15. */
863 p0.l = lo(EVT15);
864 p0.h = hi(EVT15);
865 p1.l = _schedule_and_signal_from_int;
866 p1.h = _schedule_and_signal_from_int;
867 [p0] = p1;
868 csync;
Mike Frysinger1aafd902007-07-25 11:19:14 +0800869#if ANOMALY_05000281
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800870 r0.l = lo(SAFE_USER_INSTRUCTION);
871 r0.h = hi(SAFE_USER_INSTRUCTION);
Bryan Wu1394f032007-05-06 14:50:22 -0700872 reti = r0;
873#endif
874 r0 = 0x801f (z);
875 STI r0;
876 raise 15; /* raise evt15 to do signal or reschedule */
877 rti;
8782:
879 rts;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800880ENDPROC(_return_from_int)
Bryan Wu1394f032007-05-06 14:50:22 -0700881
882ENTRY(_lower_to_irq14)
Mike Frysinger1aafd902007-07-25 11:19:14 +0800883#if ANOMALY_05000281
Bernd Schmidt5d750b92008-04-25 05:02:33 +0800884 r0.l = lo(SAFE_USER_INSTRUCTION);
885 r0.h = hi(SAFE_USER_INSTRUCTION);
Bryan Wu1394f032007-05-06 14:50:22 -0700886 reti = r0;
887#endif
888 r0 = 0x401f;
889 sti r0;
890 raise 14;
891 rti;
892ENTRY(_evt14_softirq)
893#ifdef CONFIG_DEBUG_HWERR
894 r0 = 0x3f;
895 sti r0;
896#else
897 cli r0;
898#endif
899 [--sp] = RETI;
900 SP += 4;
901 rts;
902
903_schedule_and_signal_from_int:
904 /* To end up here, vector 15 was changed - so we have to change it
905 * back.
906 */
907 p0.l = lo(EVT15);
908 p0.h = hi(EVT15);
909 p1.l = _evt_system_call;
910 p1.h = _evt_system_call;
911 [p0] = p1;
912 csync;
Bernd Schmidtc8244982007-05-21 18:09:33 +0800913
914 /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */
915 r0 = -1 (x);
916 [sp + PT_ORIG_P0] = r0;
917
Bryan Wu1394f032007-05-06 14:50:22 -0700918 p1 = rets;
919 [sp + PT_RESERVED] = p1;
920
Graf Yang6b3087c2009-01-07 23:14:39 +0800921#ifdef CONFIG_SMP
922 GET_PDA(p0, r0); /* Fetch current PDA (can't migrate to other CPU here) */
923 r0 = [p0 + PDA_IRQFLAGS];
924#else
Bryan Wu1394f032007-05-06 14:50:22 -0700925 p0.l = _irq_flags;
926 p0.h = _irq_flags;
927 r0 = [p0];
Graf Yang6b3087c2009-01-07 23:14:39 +0800928#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700929 sti r0;
930
Bernd Schmidt7adfb582007-06-21 11:34:16 +0800931 r0 = sp;
932 sp += -12;
933 call _finish_atomic_sections;
934 sp += 12;
Bryan Wu1394f032007-05-06 14:50:22 -0700935 jump.s .Lresume_userspace;
936
937_schedule_and_signal:
938 SAVE_CONTEXT_SYSCALL
939 /* To end up here, vector 15 was changed - so we have to change it
940 * back.
941 */
942 p0.l = lo(EVT15);
943 p0.h = hi(EVT15);
944 p1.l = _evt_system_call;
945 p1.h = _evt_system_call;
946 [p0] = p1;
947 csync;
948 p0.l = 1f;
949 p0.h = 1f;
950 [sp + PT_RESERVED] = P0;
951 call .Lresume_userspace;
9521:
953 RESTORE_CONTEXT
954 rti;
Mike Frysinger51be24c2007-06-11 15:31:30 +0800955ENDPROC(_lower_to_irq14)
Bryan Wu1394f032007-05-06 14:50:22 -0700956
Robin Getz518039b2007-07-25 11:03:28 +0800957/* We handle this 100% in exception space - to reduce overhead
958 * Only potiential problem is if the software buffer gets swapped out of the
959 * CPLB table - then double fault. - so we don't let this happen in other places
960 */
961#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
962ENTRY(_ex_trace_buff_full)
963 [--sp] = P3;
964 [--sp] = P2;
965 [--sp] = LC0;
966 [--sp] = LT0;
967 [--sp] = LB0;
968 P5.L = _trace_buff_offset;
969 P5.H = _trace_buff_offset;
970 P3 = [P5]; /* trace_buff_offset */
971 P5.L = lo(TBUFSTAT);
972 P5.H = hi(TBUFSTAT);
973 R7 = [P5];
974 R7 <<= 1; /* double, since we need to read twice */
975 LC0 = R7;
976 R7 <<= 2; /* need to shift over again,
977 * to get the number of bytes */
978 P5.L = lo(TBUF);
979 P5.H = hi(TBUF);
980 R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
981
982 P2 = R7;
983 P3 = P3 + P2;
984 R7 = P3;
985 R7 = R7 & R6;
986 P3 = R7;
987 P2.L = _trace_buff_offset;
988 P2.H = _trace_buff_offset;
989 [P2] = P3;
990
991 P2.L = _software_trace_buff;
992 P2.H = _software_trace_buff;
993
994 LSETUP (.Lstart, .Lend) LC0;
995.Lstart:
996 R7 = [P5]; /* read TBUF */
997 P4 = P3 + P2;
998 [P4] = R7;
999 P3 += -4;
1000 R7 = P3;
1001 R7 = R7 & R6;
1002.Lend:
1003 P3 = R7;
1004
1005 LB0 = [sp++];
1006 LT0 = [sp++];
1007 LC0 = [sp++];
1008 P2 = [sp++];
1009 P3 = [sp++];
Mike Frysinger8d6c2422007-11-21 15:53:49 +08001010 jump _bfin_return_from_exception;
Robin Getz337d3902007-10-09 17:31:46 +08001011ENDPROC(_ex_trace_buff_full)
Robin Getz518039b2007-07-25 11:03:28 +08001012
1013#if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
1014.data
1015#else
1016.section .l1.data.B
Robin Getz337d3902007-10-09 17:31:46 +08001017#endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
Robin Getz518039b2007-07-25 11:03:28 +08001018ENTRY(_trace_buff_offset)
1019 .long 0;
1020ALIGN
1021ENTRY(_software_trace_buff)
1022 .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
1023 .long 0
1024 .endr
Robin Getz337d3902007-10-09 17:31:46 +08001025#endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
1026
1027#if CONFIG_EARLY_PRINTK
Mike Frysinger9cb07b22007-11-21 16:45:08 +08001028__INIT
Robin Getz337d3902007-10-09 17:31:46 +08001029ENTRY(_early_trap)
1030 SAVE_ALL_SYS
1031 trace_buffer_stop(p0,r0);
1032
Michael Hennerich5e9e7682008-10-09 12:31:03 +08001033#if ANOMALY_05000283 || ANOMALY_05000315
1034 cc = r5 == r5;
1035 p4.h = HI(CHIPID);
1036 p4.l = LO(CHIPID);
1037 if cc jump 1f;
1038 r5.l = W[p4];
10391:
1040#endif
1041
Robin Getz337d3902007-10-09 17:31:46 +08001042 /* Turn caches off, to ensure we don't get double exceptions */
1043
1044 P4.L = LO(IMEM_CONTROL);
1045 P4.H = HI(IMEM_CONTROL);
1046
1047 R5 = [P4]; /* Control Register*/
1048 BITCLR(R5,ENICPLB_P);
1049 CLI R1;
1050 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
1051 .align 8;
1052 [P4] = R5;
1053 SSYNC;
1054
1055 P4.L = LO(DMEM_CONTROL);
1056 P4.H = HI(DMEM_CONTROL);
1057 R5 = [P4];
1058 BITCLR(R5,ENDCPLB_P);
1059 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
1060 .align 8;
1061 [P4] = R5;
1062 SSYNC;
1063 STI R1;
1064
1065 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
1066 r1 = RETX;
1067
1068 SP += -12;
1069 call _early_trap_c;
1070 SP += 12;
1071ENDPROC(_early_trap)
Mike Frysinger9cb07b22007-11-21 16:45:08 +08001072__FINIT
Robin Getz337d3902007-10-09 17:31:46 +08001073#endif /* CONFIG_EARLY_PRINTK */
Robin Getz518039b2007-07-25 11:03:28 +08001074
Bryan Wu1394f032007-05-06 14:50:22 -07001075/*
1076 * Put these in the kernel data section - that should always be covered by
1077 * a CPLB. This is needed to ensure we don't get double fault conditions
1078 */
1079
1080#ifdef CONFIG_SYSCALL_TAB_L1
1081.section .l1.data
1082#else
1083.data
1084#endif
Robin Getzf26fbc42007-11-12 22:21:30 +08001085
Mike Frysinger1ffe6642007-08-05 17:14:04 +08001086ENTRY(_ex_table)
Bryan Wu1394f032007-05-06 14:50:22 -07001087 /* entry for each EXCAUSE[5:0]
Mike Frysinger9401e612007-07-12 11:50:43 +08001088 * This table must be in sync with the table in ./kernel/traps.c
Bryan Wu1394f032007-05-06 14:50:22 -07001089 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
1090 */
Mike Frysinger1ffe6642007-08-05 17:14:04 +08001091 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
Bryan Wu1394f032007-05-06 14:50:22 -07001092 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
Sonic Zhanga5ac0122008-10-13 14:07:19 +08001093#ifdef CONFIG_KGDB
1094 .long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection
1095 and break signal trap */
1096#else
Mike Frysinger1ffe6642007-08-05 17:14:04 +08001097 .long _ex_replaceable /* 0x02 - User Defined */
Sonic Zhanga5ac0122008-10-13 14:07:19 +08001098#endif
Mike Frysinger9401e612007-07-12 11:50:43 +08001099 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
Robin Getz9f336a52007-10-29 18:23:28 +08001100 .long _ex_trap_c /* 0x04 - User Defined - dump trace buffer */
Mike Frysinger1ffe6642007-08-05 17:14:04 +08001101 .long _ex_replaceable /* 0x05 - User Defined */
1102 .long _ex_replaceable /* 0x06 - User Defined */
1103 .long _ex_replaceable /* 0x07 - User Defined */
1104 .long _ex_replaceable /* 0x08 - User Defined */
1105 .long _ex_replaceable /* 0x09 - User Defined */
1106 .long _ex_replaceable /* 0x0A - User Defined */
1107 .long _ex_replaceable /* 0x0B - User Defined */
1108 .long _ex_replaceable /* 0x0C - User Defined */
1109 .long _ex_replaceable /* 0x0D - User Defined */
1110 .long _ex_replaceable /* 0x0E - User Defined */
1111 .long _ex_replaceable /* 0x0F - User Defined */
Bryan Wu1394f032007-05-06 14:50:22 -07001112 .long _ex_single_step /* 0x10 - HW Single step */
Robin Getz518039b2007-07-25 11:03:28 +08001113#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
1114 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
1115#else
Bryan Wu1394f032007-05-06 14:50:22 -07001116 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
Robin Getz518039b2007-07-25 11:03:28 +08001117#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001118 .long _ex_trap_c /* 0x12 - Reserved */
1119 .long _ex_trap_c /* 0x13 - Reserved */
1120 .long _ex_trap_c /* 0x14 - Reserved */
1121 .long _ex_trap_c /* 0x15 - Reserved */
1122 .long _ex_trap_c /* 0x16 - Reserved */
1123 .long _ex_trap_c /* 0x17 - Reserved */
1124 .long _ex_trap_c /* 0x18 - Reserved */
1125 .long _ex_trap_c /* 0x19 - Reserved */
1126 .long _ex_trap_c /* 0x1A - Reserved */
1127 .long _ex_trap_c /* 0x1B - Reserved */
1128 .long _ex_trap_c /* 0x1C - Reserved */
1129 .long _ex_trap_c /* 0x1D - Reserved */
1130 .long _ex_trap_c /* 0x1E - Reserved */
1131 .long _ex_trap_c /* 0x1F - Reserved */
1132 .long _ex_trap_c /* 0x20 - Reserved */
1133 .long _ex_trap_c /* 0x21 - Undefined Instruction */
1134 .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */
Robin Getzf26fbc42007-11-12 22:21:30 +08001135 .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */
Bryan Wu1394f032007-05-06 14:50:22 -07001136 .long _ex_trap_c /* 0x24 - Data access misaligned */
1137 .long _ex_trap_c /* 0x25 - Unrecoverable Event */
Robin Getzf26fbc42007-11-12 22:21:30 +08001138 .long _ex_dmiss /* 0x26 - Data CPLB Miss */
1139 .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */
Bryan Wu1394f032007-05-06 14:50:22 -07001140 .long _ex_trap_c /* 0x28 - Emulation Watchpoint */
1141 .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */
1142 .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */
Robin Getzf26fbc42007-11-12 22:21:30 +08001143 .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */
1144 .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */
Bryan Wu1394f032007-05-06 14:50:22 -07001145 .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */
1146 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1147 .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */
1148 .long _ex_trap_c /* 0x2F - Reserved */
1149 .long _ex_trap_c /* 0x30 - Reserved */
1150 .long _ex_trap_c /* 0x31 - Reserved */
1151 .long _ex_trap_c /* 0x32 - Reserved */
1152 .long _ex_trap_c /* 0x33 - Reserved */
1153 .long _ex_trap_c /* 0x34 - Reserved */
1154 .long _ex_trap_c /* 0x35 - Reserved */
1155 .long _ex_trap_c /* 0x36 - Reserved */
1156 .long _ex_trap_c /* 0x37 - Reserved */
1157 .long _ex_trap_c /* 0x38 - Reserved */
1158 .long _ex_trap_c /* 0x39 - Reserved */
1159 .long _ex_trap_c /* 0x3A - Reserved */
1160 .long _ex_trap_c /* 0x3B - Reserved */
1161 .long _ex_trap_c /* 0x3C - Reserved */
1162 .long _ex_trap_c /* 0x3D - Reserved */
1163 .long _ex_trap_c /* 0x3E - Reserved */
1164 .long _ex_trap_c /* 0x3F - Reserved */
Mike Frysinger1ffe6642007-08-05 17:14:04 +08001165END(_ex_table)
Bryan Wu1394f032007-05-06 14:50:22 -07001166
Bryan Wu1394f032007-05-06 14:50:22 -07001167ENTRY(_sys_call_table)
Bryan Wu0b95f222007-09-23 00:51:32 +08001168 .long _sys_restart_syscall /* 0 */
Bryan Wu1394f032007-05-06 14:50:22 -07001169 .long _sys_exit
1170 .long _sys_fork
1171 .long _sys_read
1172 .long _sys_write
1173 .long _sys_open /* 5 */
1174 .long _sys_close
1175 .long _sys_ni_syscall /* old waitpid */
1176 .long _sys_creat
1177 .long _sys_link
1178 .long _sys_unlink /* 10 */
1179 .long _sys_execve
1180 .long _sys_chdir
1181 .long _sys_time
1182 .long _sys_mknod
1183 .long _sys_chmod /* 15 */
1184 .long _sys_chown /* chown16 */
1185 .long _sys_ni_syscall /* old break syscall holder */
1186 .long _sys_ni_syscall /* old stat */
1187 .long _sys_lseek
1188 .long _sys_getpid /* 20 */
1189 .long _sys_mount
1190 .long _sys_ni_syscall /* old umount */
1191 .long _sys_setuid
1192 .long _sys_getuid
1193 .long _sys_stime /* 25 */
1194 .long _sys_ptrace
1195 .long _sys_alarm
1196 .long _sys_ni_syscall /* old fstat */
1197 .long _sys_pause
1198 .long _sys_ni_syscall /* old utime */ /* 30 */
1199 .long _sys_ni_syscall /* old stty syscall holder */
1200 .long _sys_ni_syscall /* old gtty syscall holder */
1201 .long _sys_access
1202 .long _sys_nice
1203 .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */
1204 .long _sys_sync
1205 .long _sys_kill
1206 .long _sys_rename
1207 .long _sys_mkdir
1208 .long _sys_rmdir /* 40 */
1209 .long _sys_dup
1210 .long _sys_pipe
1211 .long _sys_times
1212 .long _sys_ni_syscall /* old prof syscall holder */
1213 .long _sys_brk /* 45 */
1214 .long _sys_setgid
1215 .long _sys_getgid
1216 .long _sys_ni_syscall /* old sys_signal */
1217 .long _sys_geteuid /* geteuid16 */
1218 .long _sys_getegid /* getegid16 */ /* 50 */
1219 .long _sys_acct
1220 .long _sys_umount /* recycled never used phys() */
1221 .long _sys_ni_syscall /* old lock syscall holder */
1222 .long _sys_ioctl
1223 .long _sys_fcntl /* 55 */
1224 .long _sys_ni_syscall /* old mpx syscall holder */
1225 .long _sys_setpgid
1226 .long _sys_ni_syscall /* old ulimit syscall holder */
1227 .long _sys_ni_syscall /* old old uname */
1228 .long _sys_umask /* 60 */
1229 .long _sys_chroot
1230 .long _sys_ustat
1231 .long _sys_dup2
1232 .long _sys_getppid
1233 .long _sys_getpgrp /* 65 */
1234 .long _sys_setsid
1235 .long _sys_ni_syscall /* old sys_sigaction */
1236 .long _sys_sgetmask
1237 .long _sys_ssetmask
1238 .long _sys_setreuid /* setreuid16 */ /* 70 */
1239 .long _sys_setregid /* setregid16 */
1240 .long _sys_ni_syscall /* old sys_sigsuspend */
1241 .long _sys_ni_syscall /* old sys_sigpending */
1242 .long _sys_sethostname
1243 .long _sys_setrlimit /* 75 */
1244 .long _sys_ni_syscall /* old getrlimit */
1245 .long _sys_getrusage
1246 .long _sys_gettimeofday
1247 .long _sys_settimeofday
1248 .long _sys_getgroups /* getgroups16 */ /* 80 */
1249 .long _sys_setgroups /* setgroups16 */
1250 .long _sys_ni_syscall /* old_select */
1251 .long _sys_symlink
1252 .long _sys_ni_syscall /* old lstat */
1253 .long _sys_readlink /* 85 */
1254 .long _sys_uselib
1255 .long _sys_ni_syscall /* sys_swapon */
1256 .long _sys_reboot
1257 .long _sys_ni_syscall /* old_readdir */
1258 .long _sys_ni_syscall /* sys_mmap */ /* 90 */
1259 .long _sys_munmap
1260 .long _sys_truncate
1261 .long _sys_ftruncate
1262 .long _sys_fchmod
1263 .long _sys_fchown /* fchown16 */ /* 95 */
1264 .long _sys_getpriority
1265 .long _sys_setpriority
1266 .long _sys_ni_syscall /* old profil syscall holder */
1267 .long _sys_statfs
1268 .long _sys_fstatfs /* 100 */
1269 .long _sys_ni_syscall
1270 .long _sys_ni_syscall /* old sys_socketcall */
1271 .long _sys_syslog
1272 .long _sys_setitimer
1273 .long _sys_getitimer /* 105 */
1274 .long _sys_newstat
1275 .long _sys_newlstat
1276 .long _sys_newfstat
1277 .long _sys_ni_syscall /* old uname */
1278 .long _sys_ni_syscall /* iopl for i386 */ /* 110 */
1279 .long _sys_vhangup
1280 .long _sys_ni_syscall /* obsolete idle() syscall */
1281 .long _sys_ni_syscall /* vm86old for i386 */
1282 .long _sys_wait4
1283 .long _sys_ni_syscall /* 115 */ /* sys_swapoff */
1284 .long _sys_sysinfo
1285 .long _sys_ni_syscall /* old sys_ipc */
1286 .long _sys_fsync
1287 .long _sys_ni_syscall /* old sys_sigreturn */
1288 .long _sys_clone /* 120 */
1289 .long _sys_setdomainname
1290 .long _sys_newuname
1291 .long _sys_ni_syscall /* old sys_modify_ldt */
1292 .long _sys_adjtimex
1293 .long _sys_ni_syscall /* 125 */ /* sys_mprotect */
1294 .long _sys_ni_syscall /* old sys_sigprocmask */
1295 .long _sys_ni_syscall /* old "creat_module" */
1296 .long _sys_init_module
1297 .long _sys_delete_module
1298 .long _sys_ni_syscall /* 130: old "get_kernel_syms" */
1299 .long _sys_quotactl
1300 .long _sys_getpgid
1301 .long _sys_fchdir
1302 .long _sys_bdflush
1303 .long _sys_ni_syscall /* 135 */ /* sys_sysfs */
1304 .long _sys_personality
1305 .long _sys_ni_syscall /* for afs_syscall */
1306 .long _sys_setfsuid /* setfsuid16 */
1307 .long _sys_setfsgid /* setfsgid16 */
1308 .long _sys_llseek /* 140 */
1309 .long _sys_getdents
1310 .long _sys_ni_syscall /* sys_select */
1311 .long _sys_flock
1312 .long _sys_ni_syscall /* sys_msync */
1313 .long _sys_readv /* 145 */
1314 .long _sys_writev
1315 .long _sys_getsid
1316 .long _sys_fdatasync
1317 .long _sys_sysctl
1318 .long _sys_ni_syscall /* 150 */ /* sys_mlock */
1319 .long _sys_ni_syscall /* sys_munlock */
1320 .long _sys_ni_syscall /* sys_mlockall */
1321 .long _sys_ni_syscall /* sys_munlockall */
1322 .long _sys_sched_setparam
1323 .long _sys_sched_getparam /* 155 */
1324 .long _sys_sched_setscheduler
1325 .long _sys_sched_getscheduler
1326 .long _sys_sched_yield
1327 .long _sys_sched_get_priority_max
1328 .long _sys_sched_get_priority_min /* 160 */
1329 .long _sys_sched_rr_get_interval
1330 .long _sys_nanosleep
Bryan Wu0b95f222007-09-23 00:51:32 +08001331 .long _sys_mremap
Bryan Wu1394f032007-05-06 14:50:22 -07001332 .long _sys_setresuid /* setresuid16 */
1333 .long _sys_getresuid /* getresuid16 */ /* 165 */
1334 .long _sys_ni_syscall /* for vm86 */
1335 .long _sys_ni_syscall /* old "query_module" */
1336 .long _sys_ni_syscall /* sys_poll */
Bryan Wu0b95f222007-09-23 00:51:32 +08001337 .long _sys_nfsservctl
Bryan Wu1394f032007-05-06 14:50:22 -07001338 .long _sys_setresgid /* setresgid16 */ /* 170 */
1339 .long _sys_getresgid /* getresgid16 */
1340 .long _sys_prctl
1341 .long _sys_rt_sigreturn
1342 .long _sys_rt_sigaction
1343 .long _sys_rt_sigprocmask /* 175 */
1344 .long _sys_rt_sigpending
1345 .long _sys_rt_sigtimedwait
1346 .long _sys_rt_sigqueueinfo
1347 .long _sys_rt_sigsuspend
1348 .long _sys_pread64 /* 180 */
1349 .long _sys_pwrite64
1350 .long _sys_lchown /* lchown16 */
1351 .long _sys_getcwd
1352 .long _sys_capget
1353 .long _sys_capset /* 185 */
1354 .long _sys_sigaltstack
1355 .long _sys_sendfile
1356 .long _sys_ni_syscall /* streams1 */
1357 .long _sys_ni_syscall /* streams2 */
1358 .long _sys_vfork /* 190 */
1359 .long _sys_getrlimit
1360 .long _sys_mmap2
1361 .long _sys_truncate64
1362 .long _sys_ftruncate64
1363 .long _sys_stat64 /* 195 */
1364 .long _sys_lstat64
1365 .long _sys_fstat64
1366 .long _sys_chown
1367 .long _sys_getuid
1368 .long _sys_getgid /* 200 */
1369 .long _sys_geteuid
1370 .long _sys_getegid
1371 .long _sys_setreuid
1372 .long _sys_setregid
1373 .long _sys_getgroups /* 205 */
1374 .long _sys_setgroups
1375 .long _sys_fchown
1376 .long _sys_setresuid
1377 .long _sys_getresuid
1378 .long _sys_setresgid /* 210 */
1379 .long _sys_getresgid
1380 .long _sys_lchown
1381 .long _sys_setuid
1382 .long _sys_setgid
1383 .long _sys_setfsuid /* 215 */
1384 .long _sys_setfsgid
1385 .long _sys_pivot_root
1386 .long _sys_ni_syscall /* sys_mincore */
1387 .long _sys_ni_syscall /* sys_madvise */
1388 .long _sys_getdents64 /* 220 */
1389 .long _sys_fcntl64
1390 .long _sys_ni_syscall /* reserved for TUX */
1391 .long _sys_ni_syscall
1392 .long _sys_gettid
Bryan Wu0b95f222007-09-23 00:51:32 +08001393 .long _sys_readahead /* 225 */
Bryan Wu1394f032007-05-06 14:50:22 -07001394 .long _sys_setxattr
1395 .long _sys_lsetxattr
1396 .long _sys_fsetxattr
1397 .long _sys_getxattr
1398 .long _sys_lgetxattr /* 230 */
1399 .long _sys_fgetxattr
1400 .long _sys_listxattr
1401 .long _sys_llistxattr
1402 .long _sys_flistxattr
1403 .long _sys_removexattr /* 235 */
1404 .long _sys_lremovexattr
1405 .long _sys_fremovexattr
1406 .long _sys_tkill
1407 .long _sys_sendfile64
1408 .long _sys_futex /* 240 */
1409 .long _sys_sched_setaffinity
1410 .long _sys_sched_getaffinity
1411 .long _sys_ni_syscall /* sys_set_thread_area */
1412 .long _sys_ni_syscall /* sys_get_thread_area */
1413 .long _sys_io_setup /* 245 */
1414 .long _sys_io_destroy
1415 .long _sys_io_getevents
1416 .long _sys_io_submit
1417 .long _sys_io_cancel
1418 .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */
1419 .long _sys_ni_syscall /* sys_freec_hugepages */
1420 .long _sys_exit_group
1421 .long _sys_lookup_dcookie
1422 .long _sys_bfin_spinlock
1423 .long _sys_epoll_create /* 255 */
1424 .long _sys_epoll_ctl
1425 .long _sys_epoll_wait
1426 .long _sys_ni_syscall /* remap_file_pages */
1427 .long _sys_set_tid_address
1428 .long _sys_timer_create /* 260 */
1429 .long _sys_timer_settime
1430 .long _sys_timer_gettime
1431 .long _sys_timer_getoverrun
1432 .long _sys_timer_delete
1433 .long _sys_clock_settime /* 265 */
1434 .long _sys_clock_gettime
1435 .long _sys_clock_getres
1436 .long _sys_clock_nanosleep
1437 .long _sys_statfs64
1438 .long _sys_fstatfs64 /* 270 */
1439 .long _sys_tgkill
1440 .long _sys_utimes
1441 .long _sys_fadvise64_64
1442 .long _sys_ni_syscall /* vserver */
1443 .long _sys_ni_syscall /* 275, mbind */
1444 .long _sys_ni_syscall /* get_mempolicy */
1445 .long _sys_ni_syscall /* set_mempolicy */
1446 .long _sys_mq_open
1447 .long _sys_mq_unlink
1448 .long _sys_mq_timedsend /* 280 */
1449 .long _sys_mq_timedreceive
1450 .long _sys_mq_notify
1451 .long _sys_mq_getsetattr
1452 .long _sys_ni_syscall /* kexec_load */
1453 .long _sys_waitid /* 285 */
1454 .long _sys_add_key
1455 .long _sys_request_key
1456 .long _sys_keyctl
1457 .long _sys_ioprio_set
1458 .long _sys_ioprio_get /* 290 */
1459 .long _sys_inotify_init
1460 .long _sys_inotify_add_watch
1461 .long _sys_inotify_rm_watch
1462 .long _sys_ni_syscall /* migrate_pages */
1463 .long _sys_openat /* 295 */
1464 .long _sys_mkdirat
1465 .long _sys_mknodat
1466 .long _sys_fchownat
1467 .long _sys_futimesat
1468 .long _sys_fstatat64 /* 300 */
1469 .long _sys_unlinkat
1470 .long _sys_renameat
1471 .long _sys_linkat
1472 .long _sys_symlinkat
1473 .long _sys_readlinkat /* 305 */
1474 .long _sys_fchmodat
1475 .long _sys_faccessat
1476 .long _sys_pselect6
1477 .long _sys_ppoll
1478 .long _sys_unshare /* 310 */
1479 .long _sys_sram_alloc
1480 .long _sys_sram_free
1481 .long _sys_dma_memcpy
1482 .long _sys_accept
1483 .long _sys_bind /* 315 */
1484 .long _sys_connect
1485 .long _sys_getpeername
1486 .long _sys_getsockname
1487 .long _sys_getsockopt
1488 .long _sys_listen /* 320 */
1489 .long _sys_recv
1490 .long _sys_recvfrom
1491 .long _sys_recvmsg
1492 .long _sys_send
1493 .long _sys_sendmsg /* 325 */
1494 .long _sys_sendto
1495 .long _sys_setsockopt
1496 .long _sys_shutdown
1497 .long _sys_socket
1498 .long _sys_socketpair /* 330 */
1499 .long _sys_semctl
1500 .long _sys_semget
1501 .long _sys_semop
1502 .long _sys_msgctl
1503 .long _sys_msgget /* 335 */
1504 .long _sys_msgrcv
1505 .long _sys_msgsnd
1506 .long _sys_shmat
1507 .long _sys_shmctl
1508 .long _sys_shmdt /* 340 */
1509 .long _sys_shmget
Bryan Wu0b95f222007-09-23 00:51:32 +08001510 .long _sys_splice
1511 .long _sys_sync_file_range
1512 .long _sys_tee
1513 .long _sys_vmsplice /* 345 */
1514 .long _sys_epoll_pwait
1515 .long _sys_utimensat
1516 .long _sys_signalfd
Bryan Wu2f775db2008-03-06 16:04:58 -07001517 .long _sys_timerfd_create
Bryan Wu0b95f222007-09-23 00:51:32 +08001518 .long _sys_eventfd /* 350 */
1519 .long _sys_pread64
1520 .long _sys_pwrite64
1521 .long _sys_fadvise64
1522 .long _sys_set_robust_list
1523 .long _sys_get_robust_list /* 355 */
1524 .long _sys_fallocate
Bernd Schmidtfc975512008-01-27 19:56:43 +08001525 .long _sys_semtimedop
Bryan Wu2f775db2008-03-06 16:04:58 -07001526 .long _sys_timerfd_settime
1527 .long _sys_timerfd_gettime
Bryan Wua4b7b6d2008-08-14 15:40:19 +08001528 .long _sys_signalfd4 /* 360 */
1529 .long _sys_eventfd2
1530 .long _sys_epoll_create1
1531 .long _sys_dup3
1532 .long _sys_pipe2
1533 .long _sys_inotify_init1 /* 365 */
Bryan Wu2f775db2008-03-06 16:04:58 -07001534
Bryan Wu1394f032007-05-06 14:50:22 -07001535 .rept NR_syscalls-(.-_sys_call_table)/4
1536 .long _sys_ni_syscall
1537 .endr
Robin Getz0c7a6b22008-10-08 16:27:12 +08001538END(_sys_call_table)
Bryan Wu1394f032007-05-06 14:50:22 -07001539
Mike Frysinger6ad2b842008-10-28 11:03:09 +08001540#ifdef CONFIG_EXCEPTION_L1_SCRATCH
1541/* .section .l1.bss.scratch */
1542.set _exception_stack_top, L1_SCRATCH_START + L1_SCRATCH_LENGTH
1543#else
1544#ifdef CONFIG_SYSCALL_TAB_L1
1545.section .l1.bss
1546#else
1547.bss
1548#endif
Graf Yang6b3087c2009-01-07 23:14:39 +08001549ENTRY(_exception_stack)
1550 .rept 1024 * NR_CPUS
Graf Yangefe065a2008-10-28 14:00:52 +08001551 .long 0
1552 .endr
1553_exception_stack_top:
Mike Frysinger6ad2b842008-10-28 11:03:09 +08001554#endif