ARM: kprobes: introduces checker
authorWang Nan <wangnan0@huawei.com>
Mon, 5 Jan 2015 11:29:18 +0000 (19:29 +0800)
committerJon Medhurst <tixy@linaro.org>
Fri, 9 Jan 2015 09:36:51 +0000 (09:36 +0000)
This patch introdces 'checker' to decoding phase, and calls checkers
when instruction decoding. This allows further decoding for specific
instructions.  This patch introduces a stub call of checkers in kprobe
arch_prepare_kprobe() as an example and for further expansion.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reviewed-by: Jon Medhurst <tixy@linaro.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
arch/arm/probes/decode-arm.c
arch/arm/probes/decode-arm.h
arch/arm/probes/decode-thumb.c
arch/arm/probes/decode-thumb.h
arch/arm/probes/decode.c
arch/arm/probes/decode.h
arch/arm/probes/kprobes/actions-arm.c
arch/arm/probes/kprobes/actions-thumb.c
arch/arm/probes/kprobes/core.c
arch/arm/probes/kprobes/core.h
arch/arm/probes/uprobes/core.c

index 04114f7..f72c33a 100644 (file)
@@ -726,10 +726,11 @@ static void __kprobes arm_singlestep(probes_opcode_t insn,
  */
 enum probes_insn __kprobes
 arm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
-                      bool emulate, const union decode_action *actions)
+                      bool emulate, const union decode_action *actions,
+                      const struct decode_checker *checkers[])
 {
        asi->insn_singlestep = arm_singlestep;
        asi->insn_check_cc = probes_condition_checks[insn>>28];
        return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
-                                 emulate, actions);
+                                 emulate, actions, checkers);
 }
index cb0b263..b3b80f6 100644 (file)
@@ -68,6 +68,7 @@ extern const union decode_item probes_decode_arm_table[];
 
 enum probes_insn arm_probes_decode_insn(probes_opcode_t,
                struct arch_probes_insn *, bool emulate,
-               const union decode_action *actions);
+               const union decode_action *actions,
+               const struct decode_checker *checkers[]);
 
 #endif
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge