diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-11-09 13:49:39 -0500 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-11-20 10:31:01 -0500 |
commit | c912dae60ae6f659455f239298110adc67a5f3e9 (patch) | |
tree | 1997566bb556e768f12881dd39d1d1036ef9e5b5 /include/linux/uprobes.h | |
parent | 3d78e945b6249d4ef2308192343f8b203b1d7ea5 (diff) |
uprobes: Cleanup !CONFIG_UPROBES decls, unexport xol_area
1. Don't include asm/uprobes.h unconditionally, we only need
it if CONFIG_UPROBES.
2. Move the definition of "struct xol_area" into uprobes.c.
Perhaps we should simply kill struct uprobes_state, it buys
nothing.
3. Kill the dummy definition of uprobe_get_swbp_addr(), nobody
except handle_swbp() needs it.
4. Purely cosmetic, but move the decl of uprobe_get_swbp_addr()
up, close to other __weak helpers.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/uprobes.h')
-rw-r--r-- | include/linux/uprobes.h | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 2225542624de..e32251e00e62 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -33,10 +33,6 @@ struct mm_struct; | |||
33 | struct inode; | 33 | struct inode; |
34 | struct notifier_block; | 34 | struct notifier_block; |
35 | 35 | ||
36 | #ifdef CONFIG_ARCH_SUPPORTS_UPROBES | ||
37 | # include <asm/uprobes.h> | ||
38 | #endif | ||
39 | |||
40 | #define UPROBE_HANDLER_REMOVE 1 | 36 | #define UPROBE_HANDLER_REMOVE 1 |
41 | #define UPROBE_HANDLER_MASK 1 | 37 | #define UPROBE_HANDLER_MASK 1 |
42 | 38 | ||
@@ -61,6 +57,8 @@ struct uprobe_consumer { | |||
61 | }; | 57 | }; |
62 | 58 | ||
63 | #ifdef CONFIG_UPROBES | 59 | #ifdef CONFIG_UPROBES |
60 | #include <asm/uprobes.h> | ||
61 | |||
64 | enum uprobe_task_state { | 62 | enum uprobe_task_state { |
65 | UTASK_RUNNING, | 63 | UTASK_RUNNING, |
66 | UTASK_SSTEP, | 64 | UTASK_SSTEP, |
@@ -93,24 +91,7 @@ struct uprobe_task { | |||
93 | unsigned int depth; | 91 | unsigned int depth; |
94 | }; | 92 | }; |
95 | 93 | ||
96 | /* | 94 | struct xol_area; |
97 | * On a breakpoint hit, thread contests for a slot. It frees the | ||
98 | * slot after singlestep. Currently a fixed number of slots are | ||
99 | * allocated. | ||
100 | */ | ||
101 | struct xol_area { | ||
102 | wait_queue_head_t wq; /* if all slots are busy */ | ||
103 | atomic_t slot_count; /* number of in-use slots */ | ||
104 | unsigned long *bitmap; /* 0 = free slot */ | ||
105 | struct page *page; | ||
106 | |||
107 | /* | ||
108 | * We keep the vma's vm_start rather than a pointer to the vma | ||
109 | * itself. The probed process or a naughty kernel module could make | ||
110 | * the vma go away, and we must handle that reasonably gracefully. | ||
111 | */ | ||
112 | unsigned long vaddr; /* Page(s) of instruction slots */ | ||
113 | }; | ||
114 | 95 | ||
115 | struct uprobes_state { | 96 | struct uprobes_state { |
116 | struct xol_area *xol_area; | 97 | struct xol_area *xol_area; |
@@ -120,6 +101,7 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign | |||
120 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 101 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
121 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 102 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
122 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | 103 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); |
104 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
123 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); | 105 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); |
124 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 106 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
125 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 107 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
@@ -131,7 +113,6 @@ extern void uprobe_end_dup_mmap(void); | |||
131 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | 113 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); |
132 | extern void uprobe_free_utask(struct task_struct *t); | 114 | extern void uprobe_free_utask(struct task_struct *t); |
133 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); | 115 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); |
134 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
135 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 116 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
136 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 117 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
137 | extern void uprobe_notify_resume(struct pt_regs *regs); | 118 | extern void uprobe_notify_resume(struct pt_regs *regs); |
@@ -187,10 +168,6 @@ static inline bool uprobe_deny_signal(void) | |||
187 | { | 168 | { |
188 | return false; | 169 | return false; |
189 | } | 170 | } |
190 | static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) | ||
191 | { | ||
192 | return 0; | ||
193 | } | ||
194 | static inline void uprobe_free_utask(struct task_struct *t) | 171 | static inline void uprobe_free_utask(struct task_struct *t) |
195 | { | 172 | { |
196 | } | 173 | } |