summaryrefslogtreecommitdiff
path: root/target/linux/coldfire/patches/074-mcfv4e_except_vector_fix.patch
blob: 9956ba71b7ca9d8a3bef83c91a8a40eb4f77e1b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 09895934aaddf4f08345798068b41344068c7b56 Mon Sep 17 00:00:00 2001
From: Kurt Mahan <kmahan@freescale.com>
Date: Tue, 8 Jul 2008 00:59:38 -0600
Subject: [PATCH] Fix exception handling to properly get vector.

LTIBName: mcfv4e-except-vector-fix
Signed-off-by: Kurt Mahan <kmahan@freescale.com>
---
 arch/m68k/coldfire/traps.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

--- a/arch/m68k/coldfire/traps.c
+++ b/arch/m68k/coldfire/traps.c
@@ -7,6 +7,7 @@
  *  68040 fixes by Martin Apel
  *  68060 fixes by Roman Hodek
  *  68060 fixes by Jesper Skov
+ *  Coldfire fixes by Kurt Mahan
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file COPYING in the main directory of this archive
@@ -288,13 +289,13 @@ void show_stack(struct task_struct *task
 void bad_super_trap(struct frame *fp)
 {
 	console_verbose();
-	if (fp->ptregs.vector < 4*sizeof(vec_names)/sizeof(vec_names[0]))
+	if (fp->ptregs.vector < sizeof(vec_names)/sizeof(vec_names[0]))
 		printk(KERN_WARNING "*** %s ***   FORMAT=%X\n",
-			vec_names[(fp->ptregs.vector) >> 2],
+			vec_names[fp->ptregs.vector],
 			fp->ptregs.format);
 	else
 		printk(KERN_WARNING "*** Exception %d ***   FORMAT=%X\n",
-			(fp->ptregs.vector) >> 2,
+			fp->ptregs.vector,
 			fp->ptregs.format);
 	printk(KERN_WARNING "Current process id is %d\n", current->pid);
 	die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
@@ -306,7 +307,7 @@ asmlinkage void trap_c(struct frame *fp)
 	siginfo_t info;
 
 	if (fp->ptregs.sr & PS_S) {
-		if ((fp->ptregs.vector >> 2) == VEC_TRACE) {
+		if (fp->ptregs.vector == VEC_TRACE) {
 			/* traced a trapping instruction */
 			current->ptrace |= PT_DTRACE;
 		} else
@@ -315,7 +316,7 @@ asmlinkage void trap_c(struct frame *fp)
 	}
 
 	/* send the appropriate signal to the user program */
-	switch ((fp->ptregs.vector) >> 2) {
+	switch (fp->ptregs.vector) {
 	case VEC_ADDRERR:
 		info.si_code = BUS_ADRALN;
 		sig = SIGBUS;