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