summaryrefslogtreecommitdiff
path: root/uprobe
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2013-03-28 12:28:03 +0400
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2013-03-28 12:47:46 +0400
commit5d62eae30b09bdcda595b3615cb238320ad42de4 (patch)
treed782965010e2bf0d063829e45b7ac5124606dd11 /uprobe
parente40586aab17b20dd097678107fb15313d122e918 (diff)
downloadswap-modules-5d62eae30b09bdcda595b3615cb238320ad42de4.tar.gz
swap-modules-5d62eae30b09bdcda595b3615cb238320ad42de4.tar.bz2
swap-modules-5d62eae30b09bdcda595b3615cb238320ad42de4.zip
[REFACTOR] rename and move arch_remove_uprobe()
rename: arch_remove_uprobe() --> remove_uprobe() move: from src/modules/kprobe/arch/dbi_kprobes.c to src/modules/uprobe/swap_uprobes.c
Diffstat (limited to 'uprobe')
-rw-r--r--uprobe/arch/asm-arm/swap_uprobes.c3
-rw-r--r--uprobe/swap_uprobes.c19
2 files changed, 19 insertions, 3 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c
index 9cf028d2..53e99d50 100644
--- a/uprobe/arch/asm-arm/swap_uprobes.c
+++ b/uprobe/arch/asm-arm/swap_uprobes.c
@@ -3,14 +3,13 @@
#include <asm/traps.h>
#include <swap_uprobes.h>
#include <asm/swap_uprobes.h>
+#include <dbi_insn_slots.h>
// FIXME:
#include <dbi_kdebug.h>
extern struct hlist_head uprobe_insn_pages;
-kprobe_opcode_t *get_insn_slot(struct task_struct *task, struct hlist_head *page_list, int atomic);
int arch_check_insn_arm(struct arch_specific_insn *ainsn);
int prep_pc_dep_insn_execbuf(kprobe_opcode_t *insns, kprobe_opcode_t insn, int uregs);
-void free_insn_slot(struct hlist_head *page_list, struct task_struct *task, kprobe_opcode_t *slot);
void pc_dep_insn_execbuf(void);
void gen_insn_execbuf(void);
void gen_insn_execbuf_thumb(void);
diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c
index 71558237..81f2b68d 100644
--- a/uprobe/swap_uprobes.c
+++ b/uprobe/swap_uprobes.c
@@ -33,6 +33,7 @@
#include <linux/hash.h>
#include <linux/mempolicy.h>
#include <linux/module.h>
+#include <dbi_insn_slots.h>
enum {
UPROBE_HASH_BITS = 10,
@@ -41,6 +42,7 @@ enum {
struct hlist_head uprobe_insn_slot_table[UPROBE_TABLE_SIZE];
struct hlist_head uprobe_table[UPROBE_TABLE_SIZE];
+struct hlist_head uprobe_insn_pages;
#define DEBUG_PRINT_HASH_TABLE 0
@@ -361,6 +363,21 @@ struct kprobe *get_kprobe_by_insn_slot(void *addr, int tgid, struct task_struct
}
#endif /* CONFIG_ARM */
+
+static void remove_uprobe(struct kprobe *p, struct task_struct *task)
+{
+ if (p->tgid == 0) {
+ panic("remove_uprobe for tgid == 0!!!");
+ }
+
+#ifdef CONFIG_ARM
+ free_insn_slot(&uprobe_insn_pages, task, p->ainsn.insn_arm);
+ free_insn_slot(&uprobe_insn_pages, task, p->ainsn.insn_thumb);
+#else /* CONFIG_ARM */
+ free_insn_slot(&uprobe_insn_pages, task, p->ainsn.insn);
+#endif /* CONFIG_ARM */
+}
+
int dbi_register_uprobe(struct kprobe *p, struct task_struct *task, int atomic)
{
int ret = 0;
@@ -467,7 +484,7 @@ valid_p:
synchronize_sched();
}
- arch_remove_uprobe(p, task);
+ remove_uprobe(p, task);
} else {
if (p->break_handler) {
old_p->break_handler = NULL;