aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/traps.c
diff options
context:
space:
mode:
authorRobin Getz <rgetz@blackfin.uclinux.org>2008-10-08 02:43:47 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-08 02:43:47 -0400
commit5c64e0d5109532f8184be29c1dc163059e3ded4b (patch)
treeb39ae82bbdc99dba134c48c00e16d949ef742541 /arch/blackfin/kernel/traps.c
parentaca5e4aac88a0ee84e9dc63e3d4189adbaef24ca (diff)
Blackfin arch: Better error handling of unknown exceptions
Better error handling of unknown exceptions, allows userspace to do a EXCPT n instruction for a not installed exception handler, and the kernel doesn't crash (like it use to before this). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/traps.c')
-rw-r--r--arch/blackfin/kernel/traps.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 8d561baef896..be5ae7fabc5f 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -301,18 +301,28 @@ asmlinkage void trap_c(struct pt_regs *fp)
301 printk(KERN_NOTICE EXC_0x03(KERN_NOTICE)); 301 printk(KERN_NOTICE EXC_0x03(KERN_NOTICE));
302 CHK_DEBUGGER_TRAP_MAYBE(); 302 CHK_DEBUGGER_TRAP_MAYBE();
303 break; 303 break;
304 /* 0x04 - User Defined, Caught by default */ 304 /* 0x04 - User Defined */
305 /* 0x05 - User Defined, Caught by default */ 305 /* 0x05 - User Defined */
306 /* 0x06 - User Defined, Caught by default */ 306 /* 0x06 - User Defined */
307 /* 0x07 - User Defined, Caught by default */ 307 /* 0x07 - User Defined */
308 /* 0x08 - User Defined, Caught by default */ 308 /* 0x08 - User Defined */
309 /* 0x09 - User Defined, Caught by default */ 309 /* 0x09 - User Defined */
310 /* 0x0A - User Defined, Caught by default */ 310 /* 0x0A - User Defined */
311 /* 0x0B - User Defined, Caught by default */ 311 /* 0x0B - User Defined */
312 /* 0x0C - User Defined, Caught by default */ 312 /* 0x0C - User Defined */
313 /* 0x0D - User Defined, Caught by default */ 313 /* 0x0D - User Defined */
314 /* 0x0E - User Defined, Caught by default */ 314 /* 0x0E - User Defined */
315 /* 0x0F - User Defined, Caught by default */ 315 /* 0x0F - User Defined */
316 /*
317 * If we got here, it is most likely that someone was trying to use a
318 * custom exception handler, and it is not actually installed properly
319 */
320 case VEC_EXCPT04 ... VEC_EXCPT15:
321 info.si_code = ILL_ILLPARAOP;
322 sig = SIGILL;
323 printk(KERN_NOTICE EXC_0x04(KERN_NOTICE));
324 CHK_DEBUGGER_TRAP_MAYBE();
325 break;
316 /* 0x10 HW Single step, handled here */ 326 /* 0x10 HW Single step, handled here */
317 case VEC_STEP: 327 case VEC_STEP:
318 info.si_code = TRAP_STEP; 328 info.si_code = TRAP_STEP;
@@ -507,9 +517,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
507 } 517 }
508 CHK_DEBUGGER_TRAP_MAYBE(); 518 CHK_DEBUGGER_TRAP_MAYBE();
509 break; 519 break;
520 /*
521 * We should be handling all known exception types above,
522 * if we get here we hit a reserved one, so panic
523 */
510 default: 524 default:
511 info.si_code = TRAP_ILLTRAP; 525 oops_in_progress = 1;
512 sig = SIGTRAP; 526 info.si_code = ILL_ILLPARAOP;
527 sig = SIGILL;
513 printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n", 528 printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n",
514 (fp->seqstat & SEQSTAT_EXCAUSE)); 529 (fp->seqstat & SEQSTAT_EXCAUSE));
515 CHK_DEBUGGER_TRAP_MAYBE(); 530 CHK_DEBUGGER_TRAP_MAYBE();