aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/uprobes.h
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2012-02-22 04:16:02 -0500
committerIngo Molnar <mingo@elte.hu>2012-02-22 05:26:09 -0500
commit3ff54efdfaace9e9b2b7c1959a865be6b91de96c (patch)
tree6218c7b40bd80704d059d5f3fa434974e675b070 /include/linux/uprobes.h
parent96379f60075c75b261328aa7830ef8aa158247ac (diff)
uprobes/core: Move insn to arch specific structure
Few cleanups suggested by Ingo Molnar. - Rename struct uprobe_arch_info to struct arch_uprobe. - Move insn from struct uprobe to struct arch_uprobe. - Make arch specific uprobe functions to accept struct arch_uprobe instead of struct uprobe. - Move struct uprobe to kernel/uprobes.c from include/linux/uprobes.h Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Josh Stone <jistone@redhat.com> Link: http://lkml.kernel.org/r/20120222091602.15880.40249.sendpatchset@srdronam.in.ibm.com [ Made various small improvements ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/uprobes.h')
-rw-r--r--include/linux/uprobes.h23
1 files changed, 2 insertions, 21 deletions
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index fd45b70750d4..9c6be62787ed 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -29,12 +29,6 @@
29struct vm_area_struct; 29struct vm_area_struct;
30#ifdef CONFIG_ARCH_SUPPORTS_UPROBES 30#ifdef CONFIG_ARCH_SUPPORTS_UPROBES
31#include <asm/uprobes.h> 31#include <asm/uprobes.h>
32#else
33
34typedef u8 uprobe_opcode_t;
35struct uprobe_arch_info {};
36
37#define MAX_UINSN_BYTES 4
38#endif 32#endif
39 33
40/* flags that denote/change uprobes behaviour */ 34/* flags that denote/change uprobes behaviour */
@@ -56,22 +50,9 @@ struct uprobe_consumer {
56 struct uprobe_consumer *next; 50 struct uprobe_consumer *next;
57}; 51};
58 52
59struct uprobe {
60 struct rb_node rb_node; /* node in the rb tree */
61 atomic_t ref;
62 struct rw_semaphore consumer_rwsem;
63 struct list_head pending_list;
64 struct uprobe_arch_info arch_info;
65 struct uprobe_consumer *consumers;
66 struct inode *inode; /* Also hold a ref to inode */
67 loff_t offset;
68 int flags;
69 u8 insn[MAX_UINSN_BYTES];
70};
71
72#ifdef CONFIG_UPROBES 53#ifdef CONFIG_UPROBES
73extern int __weak set_bkpt(struct mm_struct *mm, struct uprobe *uprobe, unsigned long vaddr); 54extern int __weak set_bkpt(struct mm_struct *mm, struct arch_uprobe *auprobe, unsigned long vaddr);
74extern int __weak set_orig_insn(struct mm_struct *mm, struct uprobe *uprobe, unsigned long vaddr, bool verify); 55extern int __weak set_orig_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, unsigned long vaddr, bool verify);
75extern bool __weak is_bkpt_insn(uprobe_opcode_t *insn); 56extern bool __weak is_bkpt_insn(uprobe_opcode_t *insn);
76extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer); 57extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer);
77extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer); 58extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer);