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