From e542f648a4854f6e4a6e489c278979addb120480 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 3 Apr 2013 17:16:44 +0400 Subject: [PATCH] [REFACTOR] move 'struct prev_kprobe' from src/modules/kprobe/arch/dbi_kprobes.h to src/modules/kprobe/arch/asm-arm/dbi_kprobes.h --- driver/Makefile.am | 7 +++++-- driver/module.c | 1 + driver/sspt/ip.c | 1 + driver/storage.c | 1 + kprobe/Makefile.am | 4 +++- kprobe/arch/asm-arm/dbi_kprobes.h | 7 +++++-- kprobe/arch/dbi_kprobes.h | 6 ------ kprobe/dbi_kprobes.h | 4 +++- uprobe/arch/asm-arm/swap_uprobes.c | 1 + uprobe/swap_uprobes.c | 1 + 10 files changed, 21 insertions(+), 12 deletions(-) diff --git a/driver/Makefile.am b/driver/Makefile.am index 730fdde..a6440c1 100644 --- a/driver/Makefile.am +++ b/driver/Makefile.am @@ -33,8 +33,11 @@ driver_module_dir = $(realpath $(srcdir)) module_name = swap_driver cross_compiler = $(subst gcc,,$(CC)) -inlude_opt = -I$(realpath $(top_srcdir)/src/modules/ksyms) -I$(realpath $(top_srcdir)/src/common) \ - -I$(realpath $(top_srcdir)/src/profile) -I$(realpath $(top_srcdir)/src/modules/kprobe) \ +inlude_opt = -I$(realpath $(top_srcdir)/src/modules/ksyms) \ + -I$(realpath $(top_srcdir)/src/common) \ + -I$(realpath $(top_srcdir)/src/profile) \ + -I$(realpath $(top_srcdir)/src/modules/kprobe) \ + -I$(realpath $(top_srcdir)/src/modules/kprobe/arch) \ -I$(realpath $(top_srcdir)/src/modules/uprobe) extra_cflags = "$(inlude_opt) -DEC_ARCH_$(ARCH) -D__DEBUG $(memchecker) $(debug_opt) $(android_opt) $(slp_opt) $(android_app_opt) $(board_opt)" diff --git a/driver/module.c b/driver/module.c index c74dc82..c600fe1 100644 --- a/driver/module.c +++ b/driver/module.c @@ -16,6 +16,7 @@ //////////////////////////////////////////////////////////////////////////////////// #include "module.h" +#include static char gl_szDefaultDeviceName[128] = DEFAULT_DEVICE_NAME; char* device_name = NULL; diff --git a/driver/sspt/ip.c b/driver/sspt/ip.c index 49f6ab2..f29f08e 100644 --- a/driver/sspt/ip.c +++ b/driver/sspt/ip.c @@ -22,6 +22,7 @@ * */ +#include #include "ip.h" #include "sspt_page.h" #include "sspt_file.h" diff --git a/driver/storage.c b/driver/storage.c index 4338115..3126246 100644 --- a/driver/storage.c +++ b/driver/storage.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "module.h" #include "storage.h" #include "handlers_core.h" diff --git a/kprobe/Makefile.am b/kprobe/Makefile.am index 233b981..36536e9 100644 --- a/kprobe/Makefile.am +++ b/kprobe/Makefile.am @@ -16,7 +16,9 @@ kprobes_module_dir = $(realpath $(top_srcdir)/src/modules/kprobe) module_name = swap_kprobe cross_compiler = $(subst gcc,,$(CC)) -inlude_opt = -I$(realpath $(top_srcdir)/src/modules/ksyms) +inlude_opt = -I$(realpath $(top_srcdir)/src/modules/ksyms) \ + -I$(realpath $(top_srcdir)/src/modules/kprobe) \ + -I$(realpath $(top_srcdir)/src/modules/kprobe/arch) extra_cflags = "$(inlude_opt) $(android_opt) $(board_opt)" all-local: diff --git a/kprobe/arch/asm-arm/dbi_kprobes.h b/kprobe/arch/asm-arm/dbi_kprobes.h index 7260ea3..2fa579b 100644 --- a/kprobe/arch/asm-arm/dbi_kprobes.h +++ b/kprobe/arch/asm-arm/dbi_kprobes.h @@ -30,8 +30,6 @@ */ #include -#include "../../dbi_kprobes_deps.h" -#include "../dbi_kprobes.h" typedef unsigned long kprobe_opcode_t; @@ -64,6 +62,11 @@ typedef unsigned long kprobe_opcode_t; #define UREGS_OFFSET 8 +struct prev_kprobe { + struct kprobe *kp; + unsigned long status; +}; + static inline unsigned long arch_get_task_pc(struct task_struct *p) { return task_thread_info(p)->cpu_context.pc; diff --git a/kprobe/arch/dbi_kprobes.h b/kprobe/arch/dbi_kprobes.h index 61cbc31..a8558d4 100644 --- a/kprobe/arch/dbi_kprobes.h +++ b/kprobe/arch/dbi_kprobes.h @@ -57,11 +57,6 @@ struct kretprobe_instance; struct task_struct; struct kprobe_ctlblk; -struct prev_kprobe { - struct kprobe *kp; - unsigned long status; -}; - void kretprobe_trampoline (void); extern void __arch_prepare_kretprobe (struct kretprobe *rp, struct pt_regs *regs); @@ -73,7 +68,6 @@ extern int arch_init_kprobes (void); extern void dbi_arch_exit_kprobes (void); extern int patch_suspended_task(struct kretprobe *rp, struct task_struct *tsk); -void prepare_singlestep (struct kprobe *p, struct pt_regs *regs); void save_previous_kprobe (struct kprobe_ctlblk *kcb, struct kprobe *cur_p); void restore_previous_kprobe (struct kprobe_ctlblk *kcb); void set_current_kprobe (struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb); diff --git a/kprobe/dbi_kprobes.h b/kprobe/dbi_kprobes.h index 06d8bd5..2820acf 100644 --- a/kprobe/dbi_kprobes.h +++ b/kprobe/dbi_kprobes.h @@ -58,7 +58,7 @@ #include #include -#include "arch/asm/dbi_kprobes.h" +#include /* kprobe_status settings */ #define KPROBE_HIT_ACTIVE 0x00000001 @@ -274,5 +274,7 @@ struct kprobe *kprobe_running (void); void reset_current_kprobe (void); struct kprobe_ctlblk *get_kprobe_ctlblk (void); +void prepare_singlestep(struct kprobe *p, struct pt_regs *regs); + #endif /* _DBI_KPROBES_H */ diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c index eb4a5f6..33f3525 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.c +++ b/uprobe/arch/asm-arm/swap_uprobes.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "trampoline_thumb.h" // FIXME: diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c index 48ce30b..a60c38f 100644 --- a/uprobe/swap_uprobes.c +++ b/uprobe/swap_uprobes.c @@ -34,6 +34,7 @@ #include #include #include +#include enum { UPROBE_HASH_BITS = 10, -- 2.7.4