sh: Fix PC adjustments for varying opcode length.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 8 May 2007 06:31:48 +0000 (15:31 +0900)
committerPaul Mundt <lethal@hera.kernel.org>
Wed, 9 May 2007 01:35:01 +0000 (01:35 +0000)
commit53f983a90d7908bcece51f86180c7c9b575a1e4d
treeda5914e6f18e8dd55563697de7339af2d99d9c18
parentbd0799977cb9b68aa6a39e9630aeea4778a58385
sh: Fix PC adjustments for varying opcode length.

There are a few different cases for figuring out how to
size the instruction. We read in the instruction located
at regs->pc - 4 when rewinding the opcode to figure out if
there's a 32-bit opcode before the faulting instruction, with
a default of a - 2 adjustment on a mismatch. In practice this
works for the cases where pc - 4 is just another 16-bit opcode,
or we happen to have a 32-bit and a 16-bit immediately
preceeding the pc value.

In the cases where we aren't rewinding, this is much less ugly..

We also don't bother fixing up the places where we're explicitly
dealing with 16-bit instructions, since this might lead to
confusion regarding the encoding size possibilities on other
CPU variants.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/sh4/fpu.c
arch/sh/kernel/kgdb_stub.c
arch/sh/kernel/process.c
arch/sh/kernel/signal.c
arch/sh/kernel/traps.c