summaryrefslogtreecommitdiff
path: root/uprobe
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2013-04-09 11:48:02 +0400
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2013-04-09 11:48:02 +0400
commit39e348ee971240fde96f196917d24652e3d71686 (patch)
treee8425a4bcfb7250bca98148e4da06b8abe3b80db /uprobe
parentd9e194a9ed397f99f833e97df022878202e74127 (diff)
downloadswap-modules-39e348ee971240fde96f196917d24652e3d71686.tar.gz
swap-modules-39e348ee971240fde96f196917d24652e3d71686.tar.bz2
swap-modules-39e348ee971240fde96f196917d24652e3d71686.zip
[IMPROVE] create slot_manager
Diffstat (limited to 'uprobe')
-rw-r--r--uprobe/arch/asm-arm/swap_uprobes.c14
-rw-r--r--uprobe/swap_uprobes.c6
-rw-r--r--uprobe/swap_uprobes.h1
3 files changed, 11 insertions, 10 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c
index cf2c8b64..8ae763bf 100644
--- a/uprobe/arch/asm-arm/swap_uprobes.c
+++ b/uprobe/arch/asm-arm/swap_uprobes.c
@@ -553,7 +553,7 @@ int arch_prepare_uprobe(struct uprobe *up, struct hlist_head *page_list, int ato
}
p->opcode = insn[0];
- p->ainsn.insn_arm = get_insn_slot(task, page_list, atomic);
+ p->ainsn.insn_arm = alloc_insn_slot(up->sm);
if (!p->ainsn.insn_arm) {
printk("Error in %s at %d: kprobe slot allocation error (arm)\n", __FILE__, __LINE__);
return -ENOMEM;
@@ -561,11 +561,11 @@ int arch_prepare_uprobe(struct uprobe *up, struct hlist_head *page_list, int ato
ret = arch_copy_trampoline_arm_uprobe(p, task, 1);
if (ret) {
- free_insn_slot(page_list, task, p->ainsn.insn_arm);
+ free_insn_slot(up->sm, p->ainsn.insn_arm);
return -EFAULT;
}
- p->ainsn.insn_thumb = get_insn_slot(task, page_list, atomic);
+ p->ainsn.insn_thumb = alloc_insn_slot(up->sm);
if (!p->ainsn.insn_thumb) {
printk("Error in %s at %d: kprobe slot allocation error (thumb)\n", __FILE__, __LINE__);
return -ENOMEM;
@@ -573,8 +573,8 @@ int arch_prepare_uprobe(struct uprobe *up, struct hlist_head *page_list, int ato
ret = arch_copy_trampoline_thumb_uprobe(p, task, 1);
if (ret) {
- free_insn_slot(page_list, task, p->ainsn.insn_arm);
- free_insn_slot(page_list, task, p->ainsn.insn_thumb);
+ free_insn_slot(up->sm, p->ainsn.insn_arm);
+ free_insn_slot(up->sm, p->ainsn.insn_thumb);
return -EFAULT;
}
@@ -585,8 +585,8 @@ int arch_prepare_uprobe(struct uprobe *up, struct hlist_head *page_list, int ato
panic("Failed to write memory %p!\n", p->addr);
}
- free_insn_slot(page_list, task, p->ainsn.insn_arm);
- free_insn_slot(page_list, task, p->ainsn.insn_thumb);
+ free_insn_slot(up->sm, p->ainsn.insn_arm);
+ free_insn_slot(up->sm, p->ainsn.insn_thumb);
return -EFAULT;
}
diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c
index fce7b4b7..32656bc3 100644
--- a/uprobe/swap_uprobes.c
+++ b/uprobe/swap_uprobes.c
@@ -379,10 +379,10 @@ static void remove_uprobe(struct uprobe *up)
struct task_struct *task = up->task;
#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);
+ free_insn_slot(up->sm, p->ainsn.insn_arm);
+ free_insn_slot(up->sm, p->ainsn.insn_thumb);
#else /* CONFIG_ARM */
- free_insn_slot(&uprobe_insn_pages, task, p->ainsn.insn);
+ free_insn_slot(up->sm, p->ainsn.insn);
#endif /* CONFIG_ARM */
}
diff --git a/uprobe/swap_uprobes.h b/uprobe/swap_uprobes.h
index 26a99f1c..df2dd563 100644
--- a/uprobe/swap_uprobes.h
+++ b/uprobe/swap_uprobes.h
@@ -32,6 +32,7 @@
struct uprobe {
struct kprobe kp;
struct task_struct *task;
+ struct slot_manager *sm;
};
typedef unsigned long (*uprobe_pre_entry_handler_t)(void *priv_arg, struct pt_regs * regs);