diff options
Diffstat (limited to 'include/linux/kprobes.h')
-rw-r--r-- | include/linux/kprobes.h | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 4a6ce82ba039..1036631ff4fa 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -125,11 +125,11 @@ struct jprobe { | |||
125 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | 125 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); |
126 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 126 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
127 | 127 | ||
128 | #ifdef ARCH_SUPPORTS_KRETPROBES | 128 | #ifdef CONFIG_KRETPROBES |
129 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, | 129 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, |
130 | struct pt_regs *regs); | 130 | struct pt_regs *regs); |
131 | extern int arch_trampoline_kprobe(struct kprobe *p); | 131 | extern int arch_trampoline_kprobe(struct kprobe *p); |
132 | #else /* ARCH_SUPPORTS_KRETPROBES */ | 132 | #else /* CONFIG_KRETPROBES */ |
133 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, | 133 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, |
134 | struct pt_regs *regs) | 134 | struct pt_regs *regs) |
135 | { | 135 | { |
@@ -138,7 +138,7 @@ static inline int arch_trampoline_kprobe(struct kprobe *p) | |||
138 | { | 138 | { |
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | #endif /* ARCH_SUPPORTS_KRETPROBES */ | 141 | #endif /* CONFIG_KRETPROBES */ |
142 | /* | 142 | /* |
143 | * Function-return probe - | 143 | * Function-return probe - |
144 | * Note: | 144 | * Note: |
@@ -173,6 +173,13 @@ struct kretprobe_blackpoint { | |||
173 | const char *name; | 173 | const char *name; |
174 | void *addr; | 174 | void *addr; |
175 | }; | 175 | }; |
176 | |||
177 | struct kprobe_blackpoint { | ||
178 | const char *name; | ||
179 | unsigned long start_addr; | ||
180 | unsigned long range; | ||
181 | }; | ||
182 | |||
176 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; | 183 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; |
177 | 184 | ||
178 | static inline void kretprobe_assert(struct kretprobe_instance *ri, | 185 | static inline void kretprobe_assert(struct kretprobe_instance *ri, |
@@ -227,15 +234,21 @@ static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) | |||
227 | 234 | ||
228 | int register_kprobe(struct kprobe *p); | 235 | int register_kprobe(struct kprobe *p); |
229 | void unregister_kprobe(struct kprobe *p); | 236 | void unregister_kprobe(struct kprobe *p); |
237 | int register_kprobes(struct kprobe **kps, int num); | ||
238 | void unregister_kprobes(struct kprobe **kps, int num); | ||
230 | int setjmp_pre_handler(struct kprobe *, struct pt_regs *); | 239 | int setjmp_pre_handler(struct kprobe *, struct pt_regs *); |
231 | int longjmp_break_handler(struct kprobe *, struct pt_regs *); | 240 | int longjmp_break_handler(struct kprobe *, struct pt_regs *); |
232 | int register_jprobe(struct jprobe *p); | 241 | int register_jprobe(struct jprobe *p); |
233 | void unregister_jprobe(struct jprobe *p); | 242 | void unregister_jprobe(struct jprobe *p); |
243 | int register_jprobes(struct jprobe **jps, int num); | ||
244 | void unregister_jprobes(struct jprobe **jps, int num); | ||
234 | void jprobe_return(void); | 245 | void jprobe_return(void); |
235 | unsigned long arch_deref_entry_point(void *); | 246 | unsigned long arch_deref_entry_point(void *); |
236 | 247 | ||
237 | int register_kretprobe(struct kretprobe *rp); | 248 | int register_kretprobe(struct kretprobe *rp); |
238 | void unregister_kretprobe(struct kretprobe *rp); | 249 | void unregister_kretprobe(struct kretprobe *rp); |
250 | int register_kretprobes(struct kretprobe **rps, int num); | ||
251 | void unregister_kretprobes(struct kretprobe **rps, int num); | ||
239 | 252 | ||
240 | void kprobe_flush_task(struct task_struct *tk); | 253 | void kprobe_flush_task(struct task_struct *tk); |
241 | void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | 254 | void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); |
@@ -254,16 +267,30 @@ static inline int register_kprobe(struct kprobe *p) | |||
254 | { | 267 | { |
255 | return -ENOSYS; | 268 | return -ENOSYS; |
256 | } | 269 | } |
270 | static inline int register_kprobes(struct kprobe **kps, int num) | ||
271 | { | ||
272 | return -ENOSYS; | ||
273 | } | ||
257 | static inline void unregister_kprobe(struct kprobe *p) | 274 | static inline void unregister_kprobe(struct kprobe *p) |
258 | { | 275 | { |
259 | } | 276 | } |
277 | static inline void unregister_kprobes(struct kprobe **kps, int num) | ||
278 | { | ||
279 | } | ||
260 | static inline int register_jprobe(struct jprobe *p) | 280 | static inline int register_jprobe(struct jprobe *p) |
261 | { | 281 | { |
262 | return -ENOSYS; | 282 | return -ENOSYS; |
263 | } | 283 | } |
284 | static inline int register_jprobes(struct jprobe **jps, int num) | ||
285 | { | ||
286 | return -ENOSYS; | ||
287 | } | ||
264 | static inline void unregister_jprobe(struct jprobe *p) | 288 | static inline void unregister_jprobe(struct jprobe *p) |
265 | { | 289 | { |
266 | } | 290 | } |
291 | static inline void unregister_jprobes(struct jprobe **jps, int num) | ||
292 | { | ||
293 | } | ||
267 | static inline void jprobe_return(void) | 294 | static inline void jprobe_return(void) |
268 | { | 295 | { |
269 | } | 296 | } |
@@ -271,9 +298,16 @@ static inline int register_kretprobe(struct kretprobe *rp) | |||
271 | { | 298 | { |
272 | return -ENOSYS; | 299 | return -ENOSYS; |
273 | } | 300 | } |
301 | static inline int register_kretprobes(struct kretprobe **rps, int num) | ||
302 | { | ||
303 | return -ENOSYS; | ||
304 | } | ||
274 | static inline void unregister_kretprobe(struct kretprobe *rp) | 305 | static inline void unregister_kretprobe(struct kretprobe *rp) |
275 | { | 306 | { |
276 | } | 307 | } |
308 | static inline void unregister_kretprobes(struct kretprobe **rps, int num) | ||
309 | { | ||
310 | } | ||
277 | static inline void kprobe_flush_task(struct task_struct *tk) | 311 | static inline void kprobe_flush_task(struct task_struct *tk) |
278 | { | 312 | { |
279 | } | 313 | } |