Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258377
b: refs/heads/master
c: 6c8a192
h: refs/heads/master
i:
  258375: fa7274a
v: v3
  • Loading branch information
Jon Medhurst authored and Tixy committed Jul 13, 2011
1 parent 44c7ab1 commit 9f28280
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8723942f7b4501c87a95b7446786e6f4ba3779cf
refs/heads/master: 6c8a192929af0383f4b0f14646af85208e9c3f00
37 changes: 20 additions & 17 deletions trunk/arch/arm/kernel/kprobes-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,23 @@ static const union decode_item arm_1111_table[] = {
DECODE_END
};

static const union decode_item arm_cccc_000x_____1xx1_table[] = {
/* LDRD/STRD lr,pc,{... cccc 000x x0x0 xxxx 111x xxxx 1101 xxxx */
DECODE_REJECT (0x0e10e0d0, 0x0000e0d0),

/* LDRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1101 xxxx */
/* STRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1111 xxxx */
DECODE_EMULATEX (0x0e5000d0, 0x000000d0, emulate_ldrdstrd,
REGS(NOPCWB, NOPCX, 0, 0, NOPC)),

/* LDRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1101 xxxx */
/* STRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1111 xxxx */
DECODE_EMULATEX (0x0e5000d0, 0x004000d0, emulate_ldrdstrd,
REGS(NOPCWB, NOPCX, 0, 0, 0)),

DECODE_END
};

static const union decode_item arm_cccc_000x_table[] = {
/* Data-processing (register) */

Expand Down Expand Up @@ -1192,23 +1209,9 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
}

} else if ((insn & 0x0e1000d0) == 0x00000d0) {
/* STRD/LDRD */
if ((insn & 0x0000e000) == 0x0000e000)
return INSN_REJECTED; /* Rd is LR or PC */
if (is_writeback(insn) && is_r15(insn, 16))
return INSN_REJECTED; /* Writeback to PC */

insn &= 0xfff00fff;
insn |= 0x00002000; /* Rn = r0, Rd = r2 */
if (!(insn & (1 << 22))) {
/* Register index */
insn &= ~0xf;
insn |= 1; /* Rm = r1 */
}
asi->insn[0] = insn;
asi->insn_handler =
(insn & (1 << 5)) ? emulate_strd : emulate_ldrd;
return INSN_GOOD;

return kprobe_decode_insn(insn, asi, arm_cccc_000x_____1xx1_table,
false);
}

/* LDRH/STRH/LDRSB/LDRSH */
Expand Down

0 comments on commit 9f28280

Please sign in to comment.