diff options
author | Greg Ungerer <gerg@uclinux.org> | 2010-10-07 11:16:56 +0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2010-10-21 04:17:31 +0400 |
commit | 730251f27df1ed0177609d1e49817f0c3ada0b1a (patch) | |
tree | 9ffee6982b122cb40d9e39722ee1ec8775a7bbba | |
parent | dea2aff876c004cccf29549242c93b208787aa64 (diff) | |
download | linux-730251f27df1ed0177609d1e49817f0c3ada0b1a.tar.xz |
m68knommu: mask of vector bits in exception word properly
The vector field of the processors exception frame actually contains
both the vector exception number and fault status field bits.
The exception processing code was not correctly masking out the
fault status field bits before switching on the vector number.
The default case was catching the bad check, but we are reporting
the wrong kind of exception in some cases.
Reported-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r-- | arch/m68knommu/kernel/traps.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c index e8b813d2d0e4..a768008dfd06 100644 --- a/arch/m68knommu/kernel/traps.c +++ b/arch/m68knommu/kernel/traps.c @@ -179,14 +179,16 @@ static void __show_stack(struct task_struct *task, unsigned long *stack) void bad_super_trap(struct frame *fp) { + int vector = (fp->ptregs.vector >> 2) & 0xff; + console_verbose(); - if (fp->ptregs.vector < 4 * ARRAY_SIZE(vec_names)) + if (vector < ARRAY_SIZE(vec_names)) printk (KERN_WARNING "*** %s *** FORMAT=%X\n", - vec_names[(fp->ptregs.vector) >> 2], + vec_names[vector], fp->ptregs.format); else printk (KERN_WARNING "*** Exception %d *** FORMAT=%X\n", - (fp->ptregs.vector) >> 2, + vector, fp->ptregs.format); printk (KERN_WARNING "Current process id is %d\n", current->pid); die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0); @@ -195,10 +197,11 @@ void bad_super_trap(struct frame *fp) asmlinkage void trap_c(struct frame *fp) { int sig; + int vector = (fp->ptregs.vector >> 2) & 0xff; siginfo_t info; if (fp->ptregs.sr & PS_S) { - if ((fp->ptregs.vector >> 2) == VEC_TRACE) { + if (vector == VEC_TRACE) { /* traced a trapping instruction */ } else bad_super_trap(fp); @@ -206,7 +209,7 @@ asmlinkage void trap_c(struct frame *fp) } /* send the appropriate signal to the user program */ - switch ((fp->ptregs.vector) >> 2) { + switch (vector) { case VEC_ADDRERR: info.si_code = BUS_ADRALN; sig = SIGBUS; |