| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | #ifndef _LINUX_UPROBES_H |
|---|
| 2 | 3 | #define _LINUX_UPROBES_H |
|---|
| 3 | 4 | /* |
|---|
| 4 | 5 | * User-space Probes (UProbes) |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 19 | 6 | * |
|---|
| 20 | 7 | * Copyright (C) IBM Corporation, 2008-2012 |
|---|
| 21 | 8 | * Authors: |
|---|
| .. | .. |
|---|
| 115 | 102 | struct xol_area *xol_area; |
|---|
| 116 | 103 | }; |
|---|
| 117 | 104 | |
|---|
| 105 | +extern void __init uprobes_init(void); |
|---|
| 118 | 106 | extern int set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
|---|
| 119 | 107 | extern int set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
|---|
| 120 | 108 | extern bool is_swbp_insn(uprobe_opcode_t *insn); |
|---|
| .. | .. |
|---|
| 123 | 111 | extern unsigned long uprobe_get_trap_addr(struct pt_regs *regs); |
|---|
| 124 | 112 | extern int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); |
|---|
| 125 | 113 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
|---|
| 114 | +extern int uprobe_register_refctr(struct inode *inode, loff_t offset, loff_t ref_ctr_offset, struct uprobe_consumer *uc); |
|---|
| 126 | 115 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
|---|
| 127 | 116 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
|---|
| 128 | 117 | extern int uprobe_mmap(struct vm_area_struct *vma); |
|---|
| .. | .. |
|---|
| 153 | 142 | struct uprobes_state { |
|---|
| 154 | 143 | }; |
|---|
| 155 | 144 | |
|---|
| 145 | +static inline void uprobes_init(void) |
|---|
| 146 | +{ |
|---|
| 147 | +} |
|---|
| 148 | + |
|---|
| 156 | 149 | #define uprobe_get_trap_addr(regs) instruction_pointer(regs) |
|---|
| 157 | 150 | |
|---|
| 158 | 151 | static inline int |
|---|
| .. | .. |
|---|
| 160 | 153 | { |
|---|
| 161 | 154 | return -ENOSYS; |
|---|
| 162 | 155 | } |
|---|
| 156 | +static inline int uprobe_register_refctr(struct inode *inode, loff_t offset, loff_t ref_ctr_offset, struct uprobe_consumer *uc) |
|---|
| 157 | +{ |
|---|
| 158 | + return -ENOSYS; |
|---|
| 159 | +} |
|---|
| 163 | 160 | static inline int |
|---|
| 164 | 161 | uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool add) |
|---|
| 165 | 162 | { |
|---|