aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorJon Medhurst <tixy@yxit.co.uk>2011-04-18 03:53:55 -0400
committerNicolas Pitre <nicolas.pitre@linaro.org>2011-04-28 23:40:59 -0400
commitac211c6994fb5f1f282745054c00d29e53639cb1 (patch)
tree98f60598c79d51dddfe301a644cbed7b2edcea0a /arch/arm
parentfa1a03b429b3fd5f28e7fdd20ce99ca572bfd236 (diff)
ARM: kprobes: Consolidate stub decoding functions
Following the change to remove support for coprocessor instructions we are left with three stub functions which can be consolidated. Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/kprobes-decode.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index ff3970741653..fb818976f4cb 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -1428,33 +1428,19 @@ space_cccc_101x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1428} 1428}
1429 1429
1430static enum kprobe_insn __kprobes 1430static enum kprobe_insn __kprobes
1431space_cccc_1100_010x(kprobe_opcode_t insn, struct arch_specific_insn *asi) 1431space_cccc_11xx(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1432{ 1432{
1433 /* Coprocessor instructions... */
1433 /* MCRR : cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */ 1434 /* MCRR : cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */
1434 /* MRRC : cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */ 1435 /* MRRC : cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */
1435 return INSN_REJECTED; 1436 /* LDC : cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
1436} 1437 /* STC : cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
1438 /* CDP : cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
1439 /* MCR : cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1440 /* MRC : cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
1437 1441
1438static enum kprobe_insn __kprobes 1442 /* SVC : cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
1439space_cccc_110x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1440{
1441 /* LDC : cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
1442 /* STC : cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
1443 return INSN_REJECTED;
1444}
1445 1443
1446static enum kprobe_insn __kprobes
1447space_cccc_111x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1448{
1449 /* BKPT : 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
1450 /* SWI : cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
1451 if ((insn & 0xfff000f0) == 0xe1200070 ||
1452 (insn & 0x0f000000) == 0x0f000000)
1453 return INSN_REJECTED;
1454
1455 /* CDP : cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
1456 /* MCR : cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1457 /* MRC : cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
1458 return INSN_REJECTED; 1444 return INSN_REJECTED;
1459} 1445}
1460 1446
@@ -1598,17 +1584,9 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1598 1584
1599 return space_cccc_101x(insn, asi); 1585 return space_cccc_101x(insn, asi);
1600 1586
1601 } else if ((insn & 0x0fe00000) == 0x0c400000) {
1602
1603 return space_cccc_1100_010x(insn, asi);
1604
1605 } else if ((insn & 0x0e000000) == 0x0c000000) {
1606
1607 return space_cccc_110x(insn, asi);
1608
1609 } 1587 }
1610 1588
1611 return space_cccc_111x(insn, asi); 1589 return space_cccc_11xx(insn, asi);
1612} 1590}
1613 1591
1614void __init arm_kprobe_decode_init(void) 1592void __init arm_kprobe_decode_init(void)