aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorJon Medhurst <tixy@yxit.co.uk>2011-06-09 04:46:56 -0400
committerTixy <tixy@medhuaa1.miniserver.com>2011-07-13 13:32:50 -0400
commit0d32e7d11b5ce8b3ab11fd74123b46b88f26b3e2 (patch)
treed7b0731a75f3bac0f91585987520e9381348e702 /arch/arm/kernel
parent56d8fbddc2a2be7aa81d65e5a6f0f6093ee70c48 (diff)
ARM: kprobes: Migrate ARM space_cccc_100x to decoding tables
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/kprobes-arm.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c
index 319e6feb0363..b2fd2c87ffee 100644
--- a/arch/arm/kernel/kprobes-arm.c
+++ b/arch/arm/kernel/kprobes-arm.c
@@ -1434,25 +1434,18 @@ static const union decode_item arm_cccc_01xx_table[] = {
1434 DECODE_END 1434 DECODE_END
1435}; 1435};
1436 1436
1437static enum kprobe_insn __kprobes 1437static const union decode_item arm_cccc_100x_table[] = {
1438space_cccc_100x(kprobe_opcode_t insn, struct arch_specific_insn *asi) 1438 /* Block data transfer instructions */
1439{ 1439
1440 /* LDM(2) : cccc 100x x101 xxxx 0xxx xxxx xxxx xxxx */ 1440 /* LDM cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
1441 /* LDM(3) : cccc 100x x1x1 xxxx 1xxx xxxx xxxx xxxx */ 1441 /* STM cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */
1442 if ((insn & 0x0e708000) == 0x85000000 || 1442 DECODE_CUSTOM (0x0e400000, 0x08000000, kprobe_decode_ldmstm),
1443 (insn & 0x0e508000) == 0x85010000) 1443
1444 return INSN_REJECTED; 1444 /* STM (user registers) cccc 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
1445 1445 /* LDM (user registers) cccc 100x x1x1 xxxx 0xxx xxxx xxxx xxxx */
1446 /* LDM(1) : cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */ 1446 /* LDM (exception ret) cccc 100x x1x1 xxxx 1xxx xxxx xxxx xxxx */
1447 /* STM(1) : cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */ 1447 DECODE_END
1448 1448};
1449 /*
1450 * Make the instruction unconditional because the new emulation
1451 * functions don't bother to setup the PSR context.
1452 */
1453 insn = (insn | 0xe0000000) & ~0x10000000;
1454 return kprobe_decode_ldmstm(insn, asi);
1455}
1456 1449
1457static enum kprobe_insn __kprobes 1450static enum kprobe_insn __kprobes
1458space_cccc_101x(kprobe_opcode_t insn, struct arch_specific_insn *asi) 1451space_cccc_101x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
@@ -1531,7 +1524,7 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1531 1524
1532 else if ((insn & 0x0e000000) == 0x08000000) 1525 else if ((insn & 0x0e000000) == 0x08000000)
1533 1526
1534 return space_cccc_100x(insn, asi); 1527 return kprobe_decode_insn(insn, asi, arm_cccc_100x_table, false);
1535 1528
1536 else if ((insn & 0x0e000000) == 0x0a000000) 1529 else if ((insn & 0x0e000000) == 0x0a000000)
1537 1530