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