aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/traps.c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2008-10-13 02:07:19 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-13 02:07:19 -0400
commita5ac0129249611fc4a35e6d7cd9b8462d67e5798 (patch)
tree9fd28b5e6e10cce341e63a1fd9885fae5e019643 /arch/blackfin/kernel/traps.c
parent5d2e321306f82550e6d354b3210a18b86bdb13c1 (diff)
Blackfin arch: add supporting for kgdb
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/traps.c')
-rw-r--r--arch/blackfin/kernel/traps.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index bd41fca315dd..8d561baef896 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -43,12 +43,11 @@
43#include <asm/dma.h> 43#include <asm/dma.h>
44 44
45#ifdef CONFIG_KGDB 45#ifdef CONFIG_KGDB
46# include <linux/debugger.h>
47# include <linux/kgdb.h> 46# include <linux/kgdb.h>
48 47
49# define CHK_DEBUGGER_TRAP() \ 48# define CHK_DEBUGGER_TRAP() \
50 do { \ 49 do { \
51 CHK_DEBUGGER(trapnr, sig, info.si_code, fp, ); \ 50 kgdb_handle_exception(trapnr, sig, info.si_code, fp); \
52 } while (0) 51 } while (0)
53# define CHK_DEBUGGER_TRAP_MAYBE() \ 52# define CHK_DEBUGGER_TRAP_MAYBE() \
54 do { \ 53 do { \
@@ -300,7 +299,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
300 info.si_code = SEGV_STACKFLOW; 299 info.si_code = SEGV_STACKFLOW;
301 sig = SIGSEGV; 300 sig = SIGSEGV;
302 printk(KERN_NOTICE EXC_0x03(KERN_NOTICE)); 301 printk(KERN_NOTICE EXC_0x03(KERN_NOTICE));
303 CHK_DEBUGGER_TRAP(); 302 CHK_DEBUGGER_TRAP_MAYBE();
304 break; 303 break;
305 /* 0x04 - User Defined, Caught by default */ 304 /* 0x04 - User Defined, Caught by default */
306 /* 0x05 - User Defined, Caught by default */ 305 /* 0x05 - User Defined, Caught by default */
@@ -329,7 +328,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
329 info.si_code = TRAP_TRACEFLOW; 328 info.si_code = TRAP_TRACEFLOW;
330 sig = SIGTRAP; 329 sig = SIGTRAP;
331 printk(KERN_NOTICE EXC_0x11(KERN_NOTICE)); 330 printk(KERN_NOTICE EXC_0x11(KERN_NOTICE));
332 CHK_DEBUGGER_TRAP(); 331 CHK_DEBUGGER_TRAP_MAYBE();
333 break; 332 break;
334 /* 0x12 - Reserved, Caught by default */ 333 /* 0x12 - Reserved, Caught by default */
335 /* 0x13 - Reserved, Caught by default */ 334 /* 0x13 - Reserved, Caught by default */
@@ -351,35 +350,35 @@ asmlinkage void trap_c(struct pt_regs *fp)
351 info.si_code = ILL_ILLOPC; 350 info.si_code = ILL_ILLOPC;
352 sig = SIGILL; 351 sig = SIGILL;
353 printk(KERN_NOTICE EXC_0x21(KERN_NOTICE)); 352 printk(KERN_NOTICE EXC_0x21(KERN_NOTICE));
354 CHK_DEBUGGER_TRAP(); 353 CHK_DEBUGGER_TRAP_MAYBE();
355 break; 354 break;
356 /* 0x22 - Illegal Instruction Combination, handled here */ 355 /* 0x22 - Illegal Instruction Combination, handled here */
357 case VEC_ILGAL_I: 356 case VEC_ILGAL_I:
358 info.si_code = ILL_ILLPARAOP; 357 info.si_code = ILL_ILLPARAOP;
359 sig = SIGILL; 358 sig = SIGILL;
360 printk(KERN_NOTICE EXC_0x22(KERN_NOTICE)); 359 printk(KERN_NOTICE EXC_0x22(KERN_NOTICE));
361 CHK_DEBUGGER_TRAP(); 360 CHK_DEBUGGER_TRAP_MAYBE();
362 break; 361 break;
363 /* 0x23 - Data CPLB protection violation, handled here */ 362 /* 0x23 - Data CPLB protection violation, handled here */
364 case VEC_CPLB_VL: 363 case VEC_CPLB_VL:
365 info.si_code = ILL_CPLB_VI; 364 info.si_code = ILL_CPLB_VI;
366 sig = SIGBUS; 365 sig = SIGBUS;
367 printk(KERN_NOTICE EXC_0x23(KERN_NOTICE)); 366 printk(KERN_NOTICE EXC_0x23(KERN_NOTICE));
368 CHK_DEBUGGER_TRAP(); 367 CHK_DEBUGGER_TRAP_MAYBE();
369 break; 368 break;
370 /* 0x24 - Data access misaligned, handled here */ 369 /* 0x24 - Data access misaligned, handled here */
371 case VEC_MISALI_D: 370 case VEC_MISALI_D:
372 info.si_code = BUS_ADRALN; 371 info.si_code = BUS_ADRALN;
373 sig = SIGBUS; 372 sig = SIGBUS;
374 printk(KERN_NOTICE EXC_0x24(KERN_NOTICE)); 373 printk(KERN_NOTICE EXC_0x24(KERN_NOTICE));
375 CHK_DEBUGGER_TRAP(); 374 CHK_DEBUGGER_TRAP_MAYBE();
376 break; 375 break;
377 /* 0x25 - Unrecoverable Event, handled here */ 376 /* 0x25 - Unrecoverable Event, handled here */
378 case VEC_UNCOV: 377 case VEC_UNCOV:
379 info.si_code = ILL_ILLEXCPT; 378 info.si_code = ILL_ILLEXCPT;
380 sig = SIGILL; 379 sig = SIGILL;
381 printk(KERN_NOTICE EXC_0x25(KERN_NOTICE)); 380 printk(KERN_NOTICE EXC_0x25(KERN_NOTICE));
382 CHK_DEBUGGER_TRAP(); 381 CHK_DEBUGGER_TRAP_MAYBE();
383 break; 382 break;
384 /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr, 383 /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr,
385 error case is handled here */ 384 error case is handled here */
@@ -387,7 +386,6 @@ asmlinkage void trap_c(struct pt_regs *fp)
387 info.si_code = BUS_ADRALN; 386 info.si_code = BUS_ADRALN;
388 sig = SIGBUS; 387 sig = SIGBUS;
389 printk(KERN_NOTICE EXC_0x26(KERN_NOTICE)); 388 printk(KERN_NOTICE EXC_0x26(KERN_NOTICE));
390 CHK_DEBUGGER_TRAP();
391 break; 389 break;
392 /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */ 390 /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */
393 case VEC_CPLB_MHIT: 391 case VEC_CPLB_MHIT:
@@ -399,7 +397,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
399 else 397 else
400#endif 398#endif
401 printk(KERN_NOTICE EXC_0x27(KERN_NOTICE)); 399 printk(KERN_NOTICE EXC_0x27(KERN_NOTICE));
402 CHK_DEBUGGER_TRAP(); 400 CHK_DEBUGGER_TRAP_MAYBE();
403 break; 401 break;
404 /* 0x28 - Emulation Watchpoint, handled here */ 402 /* 0x28 - Emulation Watchpoint, handled here */
405 case VEC_WATCH: 403 case VEC_WATCH:
@@ -418,7 +416,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
418 info.si_code = BUS_OPFETCH; 416 info.si_code = BUS_OPFETCH;
419 sig = SIGBUS; 417 sig = SIGBUS;
420 printk(KERN_NOTICE "BF535: VEC_ISTRU_VL\n"); 418 printk(KERN_NOTICE "BF535: VEC_ISTRU_VL\n");
421 CHK_DEBUGGER_TRAP(); 419 CHK_DEBUGGER_TRAP_MAYBE();
422 break; 420 break;
423#else 421#else
424 /* 0x29 - Reserved, Caught by default */ 422 /* 0x29 - Reserved, Caught by default */
@@ -428,21 +426,20 @@ asmlinkage void trap_c(struct pt_regs *fp)
428 info.si_code = BUS_ADRALN; 426 info.si_code = BUS_ADRALN;
429 sig = SIGBUS; 427 sig = SIGBUS;
430 printk(KERN_NOTICE EXC_0x2A(KERN_NOTICE)); 428 printk(KERN_NOTICE EXC_0x2A(KERN_NOTICE));
431 CHK_DEBUGGER_TRAP(); 429 CHK_DEBUGGER_TRAP_MAYBE();
432 break; 430 break;
433 /* 0x2B - Instruction CPLB protection violation, handled here */ 431 /* 0x2B - Instruction CPLB protection violation, handled here */
434 case VEC_CPLB_I_VL: 432 case VEC_CPLB_I_VL:
435 info.si_code = ILL_CPLB_VI; 433 info.si_code = ILL_CPLB_VI;
436 sig = SIGBUS; 434 sig = SIGBUS;
437 printk(KERN_NOTICE EXC_0x2B(KERN_NOTICE)); 435 printk(KERN_NOTICE EXC_0x2B(KERN_NOTICE));
438 CHK_DEBUGGER_TRAP(); 436 CHK_DEBUGGER_TRAP_MAYBE();
439 break; 437 break;
440 /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */ 438 /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */
441 case VEC_CPLB_I_M: 439 case VEC_CPLB_I_M:
442 info.si_code = ILL_CPLB_MISS; 440 info.si_code = ILL_CPLB_MISS;
443 sig = SIGBUS; 441 sig = SIGBUS;
444 printk(KERN_NOTICE EXC_0x2C(KERN_NOTICE)); 442 printk(KERN_NOTICE EXC_0x2C(KERN_NOTICE));
445 CHK_DEBUGGER_TRAP();
446 break; 443 break;
447 /* 0x2D - Instruction CPLB Multiple Hits, handled here */ 444 /* 0x2D - Instruction CPLB Multiple Hits, handled here */
448 case VEC_CPLB_I_MHIT: 445 case VEC_CPLB_I_MHIT:
@@ -454,14 +451,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
454 else 451 else
455#endif 452#endif
456 printk(KERN_NOTICE EXC_0x2D(KERN_NOTICE)); 453 printk(KERN_NOTICE EXC_0x2D(KERN_NOTICE));
457 CHK_DEBUGGER_TRAP(); 454 CHK_DEBUGGER_TRAP_MAYBE();
458 break; 455 break;
459 /* 0x2E - Illegal use of Supervisor Resource, handled here */ 456 /* 0x2E - Illegal use of Supervisor Resource, handled here */
460 case VEC_ILL_RES: 457 case VEC_ILL_RES:
461 info.si_code = ILL_PRVOPC; 458 info.si_code = ILL_PRVOPC;
462 sig = SIGILL; 459 sig = SIGILL;
463 printk(KERN_NOTICE EXC_0x2E(KERN_NOTICE)); 460 printk(KERN_NOTICE EXC_0x2E(KERN_NOTICE));
464 CHK_DEBUGGER_TRAP(); 461 CHK_DEBUGGER_TRAP_MAYBE();
465 break; 462 break;
466 /* 0x2F - Reserved, Caught by default */ 463 /* 0x2F - Reserved, Caught by default */
467 /* 0x30 - Reserved, Caught by default */ 464 /* 0x30 - Reserved, Caught by default */
@@ -508,14 +505,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
508 printk(KERN_NOTICE HWC_default(KERN_NOTICE)); 505 printk(KERN_NOTICE HWC_default(KERN_NOTICE));
509 break; 506 break;
510 } 507 }
511 CHK_DEBUGGER_TRAP(); 508 CHK_DEBUGGER_TRAP_MAYBE();
512 break; 509 break;
513 default: 510 default:
514 info.si_code = TRAP_ILLTRAP; 511 info.si_code = TRAP_ILLTRAP;
515 sig = SIGTRAP; 512 sig = SIGTRAP;
516 printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n", 513 printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n",
517 (fp->seqstat & SEQSTAT_EXCAUSE)); 514 (fp->seqstat & SEQSTAT_EXCAUSE));
518 CHK_DEBUGGER_TRAP(); 515 CHK_DEBUGGER_TRAP_MAYBE();
519 break; 516 break;
520 } 517 }
521 518