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