Commit ac211c69 authored by Jon Medhurst's avatar Jon Medhurst Committed by Nicolas Pitre

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: default avatarJon Medhurst <tixy@yxit.co.uk>
Signed-off-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
parent fa1a03b4
...@@ -1428,33 +1428,19 @@ space_cccc_101x(kprobe_opcode_t insn, struct arch_specific_insn *asi) ...@@ -1428,33 +1428,19 @@ space_cccc_101x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
} }
static enum kprobe_insn __kprobes static enum kprobe_insn __kprobes
space_cccc_1100_010x(kprobe_opcode_t insn, struct arch_specific_insn *asi) space_cccc_11xx(kprobe_opcode_t insn, struct arch_specific_insn *asi)
{ {
/* Coprocessor instructions... */
/* MCRR : cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */ /* MCRR : cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */
/* MRRC : cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */ /* MRRC : cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */
return INSN_REJECTED; /* LDC : cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
} /* STC : cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
/* CDP : cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
/* MCR : cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
/* MRC : cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
static enum kprobe_insn __kprobes /* SVC : cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
space_cccc_110x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
{
/* LDC : cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
/* STC : cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
return INSN_REJECTED;
}
static enum kprobe_insn __kprobes
space_cccc_111x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
{
/* BKPT : 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
/* SWI : cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
if ((insn & 0xfff000f0) == 0xe1200070 ||
(insn & 0x0f000000) == 0x0f000000)
return INSN_REJECTED;
/* CDP : cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
/* MCR : cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
/* MRC : cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
return INSN_REJECTED; return INSN_REJECTED;
} }
...@@ -1598,17 +1584,9 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi) ...@@ -1598,17 +1584,9 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
return space_cccc_101x(insn, asi); return space_cccc_101x(insn, asi);
} else if ((insn & 0x0fe00000) == 0x0c400000) {
return space_cccc_1100_010x(insn, asi);
} else if ((insn & 0x0e000000) == 0x0c000000) {
return space_cccc_110x(insn, asi);
} }
return space_cccc_111x(insn, asi); return space_cccc_11xx(insn, asi);
} }
void __init arm_kprobe_decode_init(void) void __init arm_kprobe_decode_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment