074-mcfv4e_except_vector_fix.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 09895934aaddf4f08345798068b41344068c7b56 Mon Sep 17 00:00:00 2001
  2. From: Kurt Mahan <[email protected]>
  3. Date: Tue, 8 Jul 2008 00:59:38 -0600
  4. Subject: [PATCH] Fix exception handling to properly get vector.
  5. LTIBName: mcfv4e-except-vector-fix
  6. Signed-off-by: Kurt Mahan <[email protected]>
  7. ---
  8. arch/m68k/coldfire/traps.c | 11 ++++++-----
  9. 1 files changed, 6 insertions(+), 5 deletions(-)
  10. --- a/arch/m68k/coldfire/traps.c
  11. +++ b/arch/m68k/coldfire/traps.c
  12. @@ -7,6 +7,7 @@
  13. * 68040 fixes by Martin Apel
  14. * 68060 fixes by Roman Hodek
  15. * 68060 fixes by Jesper Skov
  16. + * Coldfire fixes by Kurt Mahan
  17. *
  18. * This file is subject to the terms and conditions of the GNU General Public
  19. * License. See the file COPYING in the main directory of this archive
  20. @@ -288,13 +289,13 @@ void show_stack(struct task_struct *task
  21. void bad_super_trap(struct frame *fp)
  22. {
  23. console_verbose();
  24. - if (fp->ptregs.vector < 4*sizeof(vec_names)/sizeof(vec_names[0]))
  25. + if (fp->ptregs.vector < sizeof(vec_names)/sizeof(vec_names[0]))
  26. printk(KERN_WARNING "*** %s *** FORMAT=%X\n",
  27. - vec_names[(fp->ptregs.vector) >> 2],
  28. + vec_names[fp->ptregs.vector],
  29. fp->ptregs.format);
  30. else
  31. printk(KERN_WARNING "*** Exception %d *** FORMAT=%X\n",
  32. - (fp->ptregs.vector) >> 2,
  33. + fp->ptregs.vector,
  34. fp->ptregs.format);
  35. printk(KERN_WARNING "Current process id is %d\n", current->pid);
  36. die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
  37. @@ -306,7 +307,7 @@ asmlinkage void trap_c(struct frame *fp)
  38. siginfo_t info;
  39. if (fp->ptregs.sr & PS_S) {
  40. - if ((fp->ptregs.vector >> 2) == VEC_TRACE) {
  41. + if (fp->ptregs.vector == VEC_TRACE) {
  42. /* traced a trapping instruction */
  43. current->ptrace |= PT_DTRACE;
  44. } else
  45. @@ -315,7 +316,7 @@ asmlinkage void trap_c(struct frame *fp)
  46. }
  47. /* send the appropriate signal to the user program */
  48. - switch ((fp->ptregs.vector) >> 2) {
  49. + switch (fp->ptregs.vector) {
  50. case VEC_ADDRERR:
  51. info.si_code = BUS_ADRALN;
  52. sig = SIGBUS;