*/
static int
install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
- struct vm_area_struct *vma, loff_t vaddr)
+ struct vm_area_struct *vma, unsigned long vaddr)
{
- unsigned long addr;
int ret;
/*
if (!uprobe->consumers)
return -EEXIST;
- addr = (unsigned long)vaddr;
-
if (!(uprobe->flags & UPROBE_COPY_INSN)) {
ret = copy_insn(uprobe, vma->vm_file);
if (ret)
if (is_swbp_insn((uprobe_opcode_t *)uprobe->arch.insn))
return -ENOTSUPP;
- ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, addr);
+ ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr);
if (ret)
return ret;
* Hence increment before and decrement on failure.
*/
atomic_inc(&mm->uprobes_state.count);
- ret = set_swbp(&uprobe->arch, mm, addr);
+ ret = set_swbp(&uprobe->arch, mm, vaddr);
if (ret)
atomic_dec(&mm->uprobes_state.count);
}
static void
-remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, loff_t vaddr)
+remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr)
{
- if (!set_orig_insn(&uprobe->arch, mm, (unsigned long)vaddr, true))
+ if (!set_orig_insn(&uprobe->arch, mm, vaddr, true))
atomic_dec(&mm->uprobes_state.count);
}
struct map_info {
struct map_info *next;
struct mm_struct *mm;
- loff_t vaddr;
+ unsigned long vaddr;
};
static inline struct map_info *free_map_info(struct map_info *info)
while (info) {
struct mm_struct *mm = info->mm;
struct vm_area_struct *vma;
- loff_t vaddr;
if (err)
goto free;
if (!vma || !valid_vma(vma, is_register))
goto unlock;
- vaddr = vma_address(vma, uprobe->offset);
if (vma->vm_file->f_mapping->host != uprobe->inode ||
- vaddr != info->vaddr)
+ vma_address(vma, uprobe->offset) != info->vaddr)
goto unlock;
if (is_register) {
count = 0;
list_for_each_entry(uprobe, &tmp_list, pending_list) {
- loff_t vaddr;
-
if (!ret) {
- vaddr = vma_address(vma, uprobe->offset);
+ loff_t vaddr = vma_address(vma, uprobe->offset);
if (vaddr < vma->vm_start || vaddr >= vma->vm_end) {
put_uprobe(uprobe);
build_probe_list(inode, &tmp_list);
list_for_each_entry(uprobe, &tmp_list, pending_list) {
- loff_t vaddr;
+ loff_t vaddr = vma_address(vma, uprobe->offset);
- vaddr = vma_address(vma, uprobe->offset);
if (vaddr >= start && vaddr < end) {
/*
* An unregister could have removed the probe before