]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: Change the remaining shared kprobes/uprobes symbols to something generic
authorDavid A. Long <dave.long@linaro.org>
Thu, 6 Mar 2014 23:12:07 +0000 (18:12 -0500)
committerDavid A. Long <dave.long@linaro.org>
Tue, 18 Mar 2014 20:39:39 +0000 (16:39 -0400)
Any more ARM kprobes/uprobes symbols which have "kprobe" in the name must be
changed to the more generic "probes" or other non-kprobes specific symbol.

Signed-off-by: David A. Long <dave.long@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
arch/arm/include/asm/probes.h
arch/arm/kernel/kprobes-common.c
arch/arm/kernel/kprobes-test.c
arch/arm/kernel/kprobes.c
arch/arm/kernel/kprobes.h
arch/arm/kernel/probes-arm.c
arch/arm/kernel/probes-arm.h
arch/arm/kernel/probes-thumb.c
arch/arm/kernel/probes-thumb.h
arch/arm/kernel/probes.c
arch/arm/kernel/probes.h

index c4acf6c8a2d4fdfc71edf8f7c595c68426da13c5..c37252c73ee5aa215eb151d6ad3c852b73eb1bd7 100644 (file)
 #ifndef _ASM_PROBES_H
 #define _ASM_PROBES_H
 
-struct kprobe;
 typedef u32 probes_opcode_t;
 
 struct arch_specific_insn;
-typedef void (kprobe_insn_handler_t)(probes_opcode_t,
+typedef void (probes_insn_handler_t)(probes_opcode_t,
                                     struct arch_specific_insn *,
                                     struct pt_regs *);
 typedef unsigned long (probes_check_cc)(unsigned long);
-typedef void (kprobe_insn_singlestep_t)(probes_opcode_t,
+typedef void (probes_insn_singlestep_t)(probes_opcode_t,
                                        struct arch_specific_insn *,
                                        struct pt_regs *);
-typedef void (kprobe_insn_fn_t)(void);
+typedef void (probes_insn_fn_t)(void);
 
 /* Architecture specific copy of original instruction. */
 struct arch_specific_insn {
        probes_opcode_t                 *insn;
-       kprobe_insn_handler_t           *insn_handler;
+       probes_insn_handler_t           *insn_handler;
        probes_check_cc                 *insn_check_cc;
-       kprobe_insn_singlestep_t        *insn_singlestep;
-       kprobe_insn_fn_t                *insn_fn;
+       probes_insn_singlestep_t        *insn_singlestep;
+       probes_insn_fn_t                *insn_fn;
 };
 
 #endif
index f151e15f566af4160cd1e8aee519647ffc1c1b68..6159725597a1bc69d5080bc5929b9692548364a4 100644 (file)
@@ -127,7 +127,7 @@ enum probes_insn __kprobes
 kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi,
                const struct decode_header *h)
 {
-       kprobe_insn_handler_t *handler = 0;
+       probes_insn_handler_t *handler = 0;
        unsigned reglist = insn & 0xffff;
        int is_ldm = insn & 0x100000;
        int rn = (insn >> 16) & 0xf;
index 4a774d40c946064c2c462a9e810b9c9bc3d69b5a..c2fd06b4c3894bd5e5a901e70abd5411d00691ae 100644 (file)
 #include <asm/opcodes.h>
 
 #include "kprobes.h"
+#include "probes-arm.h"
+#include "probes-thumb.h"
 #include "kprobes-test.h"
 
 
@@ -1610,7 +1612,7 @@ static int __init run_all_tests(void)
                goto out;
 
        pr_info("ARM instruction simulation\n");
-       ret = run_test_cases(kprobe_arm_test_cases, kprobe_decode_arm_table);
+       ret = run_test_cases(kprobe_arm_test_cases, probes_decode_arm_table);
        if (ret)
                goto out;
 
@@ -1633,13 +1635,13 @@ static int __init run_all_tests(void)
 
        pr_info("16-bit Thumb instruction simulation\n");
        ret = run_test_cases(kprobe_thumb16_test_cases,
-                               kprobe_decode_thumb16_table);
+                               probes_decode_thumb16_table);
        if (ret)
                goto out;
 
        pr_info("32-bit Thumb instruction simulation\n");
        ret = run_test_cases(kprobe_thumb32_test_cases,
-                               kprobe_decode_thumb32_table);
+                               probes_decode_thumb32_table);
        if (ret)
                goto out;
 #endif
index bfd7b8161c584fc76e6a8d05b8309c164079bcda..468d4a980c6c1bcab4fb6b0aa004b3b94ae249a5 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/bug.h>
 
 #include "kprobes.h"
+#include "probes-arm.h"
+#include "probes-thumb.h"
 #include "patch.h"
 
 #define MIN_STACK_SIZE(addr)                           \
@@ -69,10 +71,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
        if (is_wide_instruction(insn)) {
                insn <<= 16;
                insn |= ((u16 *)addr)[1];
-               decode_insn = thumb32_kprobe_decode_insn;
+               decode_insn = thumb32_probes_decode_insn;
                actions = kprobes_t32_actions;
        } else {
-               decode_insn = thumb16_kprobe_decode_insn;
+               decode_insn = thumb16_probes_decode_insn;
                actions = kprobes_t16_actions;
        }
 #else /* !CONFIG_THUMB2_KERNEL */
@@ -80,7 +82,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
        if (addr & 0x3)
                return -EINVAL;
        insn = *p->addr;
-       decode_insn = arm_kprobe_decode_insn;
+       decode_insn = arm_probes_decode_insn;
        actions = kprobes_arm_actions;
 #endif
 
@@ -99,7 +101,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
                        p->ainsn.insn[is] = tmp_insn[is];
                flush_insns(p->ainsn.insn,
                                sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE);
-               p->ainsn.insn_fn = (kprobe_insn_fn_t *)
+               p->ainsn.insn_fn = (probes_insn_fn_t *)
                                        ((uintptr_t)p->ainsn.insn | thumb);
                break;
 
index 3684fc9e27cc5c5feea03dacb4a11bd064dd9dab..eee8089b1b934521704359f2e4628c8bdc1fc581 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef _ARM_KERNEL_KPROBES_H
 #define _ARM_KERNEL_KPROBES_H
 
+#include "probes.h"
+
 /*
  * These undefined instructions must be unique and
  * reserved solely for kprobes' use.
@@ -27,8 +29,9 @@
 #define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION  0xde18
 #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION  0xf7f0a018
 
-struct decode_header;
-union decode_action;
+enum probes_insn __kprobes
+kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi,
+               const struct decode_header *h);
 
 typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
                                                struct arch_specific_insn *,
@@ -36,21 +39,13 @@ typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
 
 #ifdef CONFIG_THUMB2_KERNEL
 
-enum probes_insn thumb16_kprobe_decode_insn(probes_opcode_t,
-                                           struct arch_specific_insn *,
-                                           const union decode_action *);
-enum probes_insn thumb32_kprobe_decode_insn(probes_opcode_t,
-                                           struct arch_specific_insn *,
-                                           const union decode_action *);
+extern const union decode_action kprobes_t32_actions[];
+extern const union decode_action kprobes_t16_actions[];
 
 #else /* !CONFIG_THUMB2_KERNEL */
 
-enum probes_insn arm_kprobe_decode_insn(probes_opcode_t,
-                                       struct arch_specific_insn *,
-                                       const union decode_action *);
+extern const union decode_action kprobes_arm_actions[];
 
 #endif
 
-#include "probes.h"
-
 #endif /* _ARM_KERNEL_KPROBES_H */
index a9439e607ac09dcbb24df1eb10c3ef956a809cdf..738e5fc589289a437e44cf20a0c503c6a0ee9c03 100644 (file)
@@ -610,7 +610,7 @@ static const union decode_item arm_cccc_100x_table[] = {
        DECODE_END
 };
 
-const union decode_item kprobe_decode_arm_table[] = {
+const union decode_item probes_decode_arm_table[] = {
        /*
         * Unconditional instructions
         *                      1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
@@ -701,7 +701,7 @@ const union decode_item kprobe_decode_arm_table[] = {
        DECODE_END
 };
 #ifdef CONFIG_ARM_KPROBES_TEST_MODULE
-EXPORT_SYMBOL_GPL(kprobe_decode_arm_table);
+EXPORT_SYMBOL_GPL(probes_decode_arm_table);
 #endif
 
 static void __kprobes arm_singlestep(probes_opcode_t insn,
@@ -724,11 +724,11 @@ static void __kprobes arm_singlestep(probes_opcode_t insn,
  *   should also be very rare.
  */
 enum probes_insn __kprobes
-arm_kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+arm_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
                       const union decode_action *actions)
 {
        asi->insn_singlestep = arm_singlestep;
        asi->insn_check_cc = probes_condition_checks[insn>>28];
-       return kprobe_decode_insn(insn, asi, kprobe_decode_arm_table, false,
+       return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
                                  actions);
 }
index 9a9d379dbf339631e6a7113d41c3892a0b8de77a..7a5cce497a9b022832be39076abaa44d74845ed0 100644 (file)
@@ -64,4 +64,10 @@ void __kprobes simulate_mrs(probes_opcode_t opcode,
 void __kprobes simulate_mov_ipsp(probes_opcode_t opcode,
        struct arch_specific_insn *asi, struct pt_regs *regs);
 
+extern const union decode_item probes_decode_arm_table[];
+
+enum probes_insn arm_probes_decode_insn(probes_opcode_t,
+               struct arch_specific_insn *,
+               const union decode_action *actions);
+
 #endif
index d23ef009fe638f9838aeba3c42fcf5105bd0a024..eab440f6b2d439b1718983f38a9cb21342fd744b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/kprobes-thumb.c
+ * arch/arm/kernel/probes-thumb.c
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
@@ -552,7 +552,7 @@ static const union decode_item t32_table_1111_1011_1[] = {
        DECODE_END
 };
 
-const union decode_item kprobe_decode_thumb32_table[] = {
+const union decode_item probes_decode_thumb32_table[] = {
 
        /*
         * Load/store multiple instructions
@@ -641,7 +641,7 @@ const union decode_item kprobe_decode_thumb32_table[] = {
        DECODE_END
 };
 #ifdef CONFIG_ARM_KPROBES_TEST_MODULE
-EXPORT_SYMBOL_GPL(kprobe_decode_thumb32_table);
+EXPORT_SYMBOL_GPL(probes_decode_thumb32_table);
 #endif
 
 static const union decode_item t16_table_1011[] = {
@@ -696,7 +696,7 @@ static const union decode_item t16_table_1011[] = {
        DECODE_END
 };
 
-const union decode_item kprobe_decode_thumb16_table[] = {
+const union decode_item probes_decode_thumb16_table[] = {
 
        /*
         * Shift (immediate), add, subtract, move, and compare
@@ -833,7 +833,7 @@ const union decode_item kprobe_decode_thumb16_table[] = {
        DECODE_END
 };
 #ifdef CONFIG_ARM_KPROBES_TEST_MODULE
-EXPORT_SYMBOL_GPL(kprobe_decode_thumb16_table);
+EXPORT_SYMBOL_GPL(probes_decode_thumb16_table);
 #endif
 
 static unsigned long __kprobes thumb_check_cc(unsigned long cpsr)
@@ -862,21 +862,21 @@ static void __kprobes thumb32_singlestep(probes_opcode_t opcode,
 }
 
 enum probes_insn __kprobes
-thumb16_kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
                           const union decode_action *actions)
 {
        asi->insn_singlestep = thumb16_singlestep;
        asi->insn_check_cc = thumb_check_cc;
-       return kprobe_decode_insn(insn, asi, kprobe_decode_thumb16_table, true,
+       return probes_decode_insn(insn, asi, probes_decode_thumb16_table, true,
                                  actions);
 }
 
 enum probes_insn __kprobes
-thumb32_kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
                           const union decode_action *actions)
 {
        asi->insn_singlestep = thumb32_singlestep;
        asi->insn_check_cc = thumb_check_cc;
-       return kprobe_decode_insn(insn, asi, kprobe_decode_thumb32_table, true,
+       return probes_decode_insn(insn, asi, probes_decode_thumb32_table, true,
                                  actions);
 }
index 8d6b4eefa7067fe134063504baa3a279813d7bab..d6f67c1df7af63d3e8d0940deba7cdcf4c3b753d 100644 (file)
@@ -84,4 +84,14 @@ enum probes_t16_action {
        NUM_PROBES_T16_ACTIONS
 };
 
+extern const union decode_item probes_decode_thumb32_table[];
+extern const union decode_item probes_decode_thumb16_table[];
+
+enum probes_insn __kprobes
+thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+               const union decode_action *actions);
+enum probes_insn __kprobes
+thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+               const union decode_action *actions);
+
 #endif
index 92d359a228433098b44444d188e1fc6d7b84effd..b6d9b855273c864c0a6cbfdfd7d3517df6ecc308 100644 (file)
@@ -340,7 +340,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
 };
 
 /*
- * kprobe_decode_insn operates on data tables in order to decode an ARM
+ * probes_decode_insn operates on data tables in order to decode an ARM
  * architecture instruction onto which a kprobe has been placed.
  *
  * These instruction decoding tables are a concatenation of entries each
@@ -383,7 +383,7 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
  *
  */
 int __kprobes
-kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
                   const union decode_item *table, bool thumb,
                   const union decode_action *actions)
 {
index 870282a39261ec0d9540b585027e46c2d0892ff8..0c72e544175d5f1609e155a7204d26fad4be2e48 100644 (file)
 
 #include <linux/types.h>
 #include <linux/stddef.h>
-#include <linux/kprobes.h>
-#include "kprobes.h"
+#include <asm/probes.h>
 
 void __init arm_probes_decode_init(void);
 
+extern probes_check_cc * const probes_condition_checks[16];
+
 #if __LINUX_ARM_ARCH__ >= 7
 
 /* str_pc_offset is architecturally defined from ARMv7 onwards */
@@ -40,7 +41,6 @@ void __init find_str_pc_offset(void);
 
 #endif
 
-struct decode_header;
 
 /*
  * Update ITSTATE after normal execution of an IT block instruction.
@@ -133,15 +133,6 @@ static inline void __kprobes alu_write_pc(long pcv, struct pt_regs *regs)
 }
 
 
-void __kprobes probes_simulate_nop(probes_opcode_t, struct arch_specific_insn *,
-               struct pt_regs *regs);
-void __kprobes probes_emulate_none(probes_opcode_t, struct arch_specific_insn *,
-               struct pt_regs *regs);
-
-enum probes_insn __kprobes
-kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi,
-               const struct decode_header *h);
-
 /*
  * Test if load/store instructions writeback the address register.
  * if P (bit 24) == 0 or W (bit 21) == 1
@@ -150,7 +141,7 @@ kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi,
 
 /*
  * The following definitions and macros are used to build instruction
- * decoding tables for use by kprobe_decode_insn.
+ * decoding tables for use by probes_decode_insn.
  *
  * These tables are a concatenation of entries each of which consist of one of
  * the decode_* structs. All of the fields in every type of decode structure
@@ -313,12 +304,13 @@ union decode_item {
        int                     action;
 };
 
+struct decode_header;
 typedef enum probes_insn (probes_custom_decode_t)(probes_opcode_t,
                                                  struct arch_specific_insn *,
                                                  const struct decode_header *);
 
 union decode_action {
-       kprobe_insn_handler_t   *handler;
+       probes_insn_handler_t   *handler;
        probes_custom_decode_t  *decoder;
 };
 
@@ -404,22 +396,12 @@ struct decode_reject {
 #define DECODE_REJECT(_mask, _value)                           \
        DECODE_HEADER(DECODE_TYPE_REJECT, _mask, _value, 0)
 
+probes_insn_handler_t probes_simulate_nop;
+probes_insn_handler_t probes_emulate_none;
 
-#ifdef CONFIG_THUMB2_KERNEL
-extern const union decode_item kprobe_decode_thumb16_table[];
-extern const union decode_item kprobe_decode_thumb32_table[];
-extern const union decode_action kprobes_t32_actions[];
-extern const union decode_action kprobes_t16_actions[];
-#else
-extern const union decode_item kprobe_decode_arm_table[];
-extern const union decode_action kprobes_arm_actions[];
-#endif
-
-extern probes_check_cc * const probes_condition_checks[16];
-
-
-int kprobe_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
-                      const union decode_item *table, bool thumb16,
-                      const union decode_action *actions);
+int __kprobes
+probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
+               const union decode_item *table, bool thumb,
+               const union decode_action *actions);
 
 #endif