summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/kprobes-decode.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-21 09:22:45 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-21 09:22:45 +0100
commit14764b01a5576ce23a9d0c95a027049206a19cef (patch)
treefa7f4e3b9b62598076baf7d312dd37d6c91b0d56 /arch/arm/kernel/kprobes-decode.c
parentfc4978b796e5e52ab3a709495a968199afe0a108 (diff)
parent5ccd4302a20bfe56eb72a5e27ad0be046fc820a5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion into devel-stable
Diffstat (limited to 'arch/arm/kernel/kprobes-decode.c')
-rw-r--r--arch/arm/kernel/kprobes-decode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index da1f94906a4..8bccbfa693f 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs)
{
insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0];
kprobe_opcode_t insn = p->opcode;
+ long ppc = (long)p->addr + 8;
union reg_pair fnr;
int rd = (insn >> 12) & 0xf;
int rn = (insn >> 16) & 0xf;
int rm = insn & 0xf;
long rdv;
- long rnv = regs->uregs[rn];
- long rmv = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */
+ long rnv = (rn == 15) ? ppc : regs->uregs[rn];
+ long rmv = (rm == 15) ? ppc : regs->uregs[rm];
long cpsr = regs->ARM_cpsr;
fnr.dr = insnslot_llret_3arg_rflags(rnv, 0, rmv, cpsr, i_fn);