struct arch_specific_insn ainsn;
/* insn: must be on special executable page on i386. */
- p->ainsn.insn = get_insn_slot (NULL, 0);
+ p->ainsn.insn = get_insn_slot(NULL, &kprobe_insn_pages, 0);
if (!p->ainsn.insn)
return -ENOMEM;
* get_us_insn_slot() - Find a slot on an executable page for an instruction.
* We allocate an executable page if there's no room on existing ones.
*/
-kprobe_opcode_t *get_insn_slot(struct task_struct *task, int atomic)
+kprobe_opcode_t *get_insn_slot(struct task_struct *task, struct hlist_head *page_list, int atomic)
{
kprobe_opcode_t * free_slot;
struct kprobe_insn_page *kip;
struct hlist_node *pos;
- struct hlist_head *page_list = task ? &uprobe_insn_pages : &kprobe_insn_pages;
hlist_for_each_entry_rcu(kip, pos, page_list, hlist) {
if (!task || (kip->task->tgid == task->tgid)) {
#include "dbi_kprobes.h"
-kprobe_opcode_t *get_insn_slot(struct task_struct *task, int atomic);
+kprobe_opcode_t *get_insn_slot(struct task_struct *task, struct hlist_head *page_list, int atomic);
void free_insn_slot(struct hlist_head *page_list, struct task_struct *task, kprobe_opcode_t *slot);
extern struct hlist_head kprobe_insn_pages;
// FIXME:
#include <dbi_kdebug.h>
extern struct hlist_head uprobe_insn_pages;
-kprobe_opcode_t *get_insn_slot(struct task_struct *task, int atomic);
+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);
}
p->opcode = insn[0];
- p->ainsn.insn_arm = get_insn_slot(task, atomic);
+ p->ainsn.insn_arm = get_insn_slot(task, &uprobe_insn_pages, atomic);
if (!p->ainsn.insn_arm) {
printk("Error in %s at %d: kprobe slot allocation error (arm)\n", __FILE__, __LINE__);
return -ENOMEM;
return -EFAULT;
}
- p->ainsn.insn_thumb = get_insn_slot(task, atomic);
+ p->ainsn.insn_thumb = get_insn_slot(task, &uprobe_insn_pages, atomic);
if (!p->ainsn.insn_thumb) {
printk("Error in %s at %d: kprobe slot allocation error (thumb)\n", __FILE__, __LINE__);
return -ENOMEM;