Skip to content

Commit

Permalink
ARM: Make the kprobes condition_check symbol names more generic
Browse files Browse the repository at this point in the history
In preparation for sharing the ARM kprobes instruction interpreting
code with uprobes, make the symbols names less kprobes-specific.

Signed-off-by: David A. Long <dave.long@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
  • Loading branch information
David A. Long committed Mar 18, 2014
1 parent 7579f4b commit f145d66
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 97 deletions.
11 changes: 6 additions & 5 deletions arch/arm/include/asm/probes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
#define _ASM_PROBES_H

struct kprobe;
typedef u32 probes_opcode_t;

struct arch_specific_insn;
typedef void (kprobe_insn_handler_t)(kprobe_opcode_t,
typedef void (kprobe_insn_handler_t)(probes_opcode_t,
struct arch_specific_insn *,
struct pt_regs *);
typedef unsigned long (kprobe_check_cc)(unsigned long);
typedef void (kprobe_insn_singlestep_t)(kprobe_opcode_t,
typedef unsigned long (probes_check_cc)(unsigned long);
typedef void (kprobe_insn_singlestep_t)(probes_opcode_t,
struct arch_specific_insn *,
struct pt_regs *);
typedef void (kprobe_insn_fn_t)(void);

/* Architecture specific copy of original instruction. */
struct arch_specific_insn {
kprobe_opcode_t *insn;
probes_opcode_t *insn;
kprobe_insn_handler_t *insn_handler;
kprobe_check_cc *insn_check_cc;
probes_check_cc *insn_check_cc;
kprobe_insn_singlestep_t *insn_singlestep;
kprobe_insn_fn_t *insn_fn;
};
Expand Down
16 changes: 8 additions & 8 deletions arch/arm/kernel/kprobes-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#endif

static void __kprobes
emulate_ldrdstrd(kprobe_opcode_t insn,
emulate_ldrdstrd(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
unsigned long pc = regs->ARM_pc + 4;
Expand Down Expand Up @@ -102,7 +102,7 @@ emulate_ldrdstrd(kprobe_opcode_t insn,
}

static void __kprobes
emulate_ldr(kprobe_opcode_t insn,
emulate_ldr(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
unsigned long pc = regs->ARM_pc + 4;
Expand Down Expand Up @@ -132,7 +132,7 @@ emulate_ldr(kprobe_opcode_t insn,
}

static void __kprobes
emulate_str(kprobe_opcode_t insn,
emulate_str(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
unsigned long rtpc = regs->ARM_pc - 4 + str_pc_offset;
Expand All @@ -159,7 +159,7 @@ emulate_str(kprobe_opcode_t insn,
}

static void __kprobes
emulate_rd12rn16rm0rs8_rwflags(kprobe_opcode_t insn,
emulate_rd12rn16rm0rs8_rwflags(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
unsigned long pc = regs->ARM_pc + 4;
Expand Down Expand Up @@ -194,7 +194,7 @@ emulate_rd12rn16rm0rs8_rwflags(kprobe_opcode_t insn,
}

static void __kprobes
emulate_rd12rn16rm0_rwflags_nopc(kprobe_opcode_t insn,
emulate_rd12rn16rm0_rwflags_nopc(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
int rd = (insn >> 12) & 0xf;
Expand All @@ -221,7 +221,7 @@ emulate_rd12rn16rm0_rwflags_nopc(kprobe_opcode_t insn,
}

static void __kprobes
emulate_rd16rn12rm0rs8_rwflags_nopc(kprobe_opcode_t insn,
emulate_rd16rn12rm0rs8_rwflags_nopc(probes_opcode_t insn,
struct arch_specific_insn *asi,
struct pt_regs *regs)
{
Expand Down Expand Up @@ -251,7 +251,7 @@ emulate_rd16rn12rm0rs8_rwflags_nopc(kprobe_opcode_t insn,
}

static void __kprobes
emulate_rd12rm0_noflags_nopc(kprobe_opcode_t insn,
emulate_rd12rm0_noflags_nopc(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
int rd = (insn >> 12) & 0xf;
Expand All @@ -271,7 +271,7 @@ emulate_rd12rm0_noflags_nopc(kprobe_opcode_t insn,
}

static void __kprobes
emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(kprobe_opcode_t insn,
emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(probes_opcode_t insn,
struct arch_specific_insn *asi,
struct pt_regs *regs)
{
Expand Down
14 changes: 7 additions & 7 deletions arch/arm/kernel/kprobes-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "kprobes.h"


static void __kprobes simulate_ldm1stm1(kprobe_opcode_t insn,
static void __kprobes simulate_ldm1stm1(probes_opcode_t insn,
struct arch_specific_insn *asi,
struct pt_regs *regs)
{
Expand Down Expand Up @@ -59,7 +59,7 @@ static void __kprobes simulate_ldm1stm1(kprobe_opcode_t insn,
}
}

static void __kprobes simulate_stm1_pc(kprobe_opcode_t insn,
static void __kprobes simulate_stm1_pc(probes_opcode_t insn,
struct arch_specific_insn *asi,
struct pt_regs *regs)
{
Expand All @@ -70,7 +70,7 @@ static void __kprobes simulate_stm1_pc(kprobe_opcode_t insn,
regs->ARM_pc = (long)addr + 4;
}

static void __kprobes simulate_ldm1_pc(kprobe_opcode_t insn,
static void __kprobes simulate_ldm1_pc(probes_opcode_t insn,
struct arch_specific_insn *asi,
struct pt_regs *regs)
{
Expand All @@ -79,7 +79,7 @@ static void __kprobes simulate_ldm1_pc(kprobe_opcode_t insn,
}

static void __kprobes
emulate_generic_r0_12_noflags(kprobe_opcode_t insn,
emulate_generic_r0_12_noflags(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
register void *rregs asm("r1") = regs;
Expand Down Expand Up @@ -107,15 +107,15 @@ emulate_generic_r0_12_noflags(kprobe_opcode_t insn,
}

static void __kprobes
emulate_generic_r2_14_noflags(kprobe_opcode_t insn,
emulate_generic_r2_14_noflags(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
emulate_generic_r0_12_noflags(insn, asi,
(struct pt_regs *)(regs->uregs+2));
}

static void __kprobes
emulate_ldm_r3_15(kprobe_opcode_t insn,
emulate_ldm_r3_15(probes_opcode_t insn,
struct arch_specific_insn *asi, struct pt_regs *regs)
{
emulate_generic_r0_12_noflags(insn, asi,
Expand All @@ -124,7 +124,7 @@ emulate_ldm_r3_15(kprobe_opcode_t insn,
}

enum kprobe_insn __kprobes
kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi,
kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_specific_insn *asi,
const struct decode_header *h)
{
kprobe_insn_handler_t *handler = 0;
Expand Down
Loading

0 comments on commit f145d66

Please sign in to comment.