diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-01-05 06:47:18 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-05 06:47:23 -0500 |
commit | 5a8b589f8a35b2c69d1819e3365825e4385a844c (patch) | |
tree | f1ca18f216be8517432eee5db0b762c231e13ede /arch/s390/kernel | |
parent | fc0a1fea6b81095b6c0e01ec3407d04c8341974c (diff) |
[S390] kprobes: instruction swap
Move the definition of the helper structure ins_replace_args to the
only place where it is used and drop the old member as it is not needed.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/kprobes.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 91c611f84ff7..1e75ec523577 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -157,17 +157,21 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn) | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | struct ins_replace_args { | ||
161 | kprobe_opcode_t *ptr; | ||
162 | kprobe_opcode_t opcode; | ||
163 | }; | ||
164 | |||
160 | static int __kprobes swap_instruction(void *aref) | 165 | static int __kprobes swap_instruction(void *aref) |
161 | { | 166 | { |
162 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 167 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
163 | unsigned long status = kcb->kprobe_status; | 168 | unsigned long status = kcb->kprobe_status; |
164 | struct ins_replace_args *args = aref; | 169 | struct ins_replace_args *args = aref; |
165 | int rc; | ||
166 | 170 | ||
167 | kcb->kprobe_status = KPROBE_SWAP_INST; | 171 | kcb->kprobe_status = KPROBE_SWAP_INST; |
168 | rc = probe_kernel_write(args->ptr, &args->new, sizeof(args->new)); | 172 | probe_kernel_write(args->ptr, &args->opcode, sizeof(args->opcode)); |
169 | kcb->kprobe_status = status; | 173 | kcb->kprobe_status = status; |
170 | return rc; | 174 | return 0; |
171 | } | 175 | } |
172 | 176 | ||
173 | void __kprobes arch_arm_kprobe(struct kprobe *p) | 177 | void __kprobes arch_arm_kprobe(struct kprobe *p) |
@@ -175,8 +179,7 @@ void __kprobes arch_arm_kprobe(struct kprobe *p) | |||
175 | struct ins_replace_args args; | 179 | struct ins_replace_args args; |
176 | 180 | ||
177 | args.ptr = p->addr; | 181 | args.ptr = p->addr; |
178 | args.old = p->opcode; | 182 | args.opcode = BREAKPOINT_INSTRUCTION; |
179 | args.new = BREAKPOINT_INSTRUCTION; | ||
180 | stop_machine(swap_instruction, &args, NULL); | 183 | stop_machine(swap_instruction, &args, NULL); |
181 | } | 184 | } |
182 | 185 | ||
@@ -185,8 +188,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) | |||
185 | struct ins_replace_args args; | 188 | struct ins_replace_args args; |
186 | 189 | ||
187 | args.ptr = p->addr; | 190 | args.ptr = p->addr; |
188 | args.old = BREAKPOINT_INSTRUCTION; | 191 | args.opcode = p->opcode; |
189 | args.new = p->opcode; | ||
190 | stop_machine(swap_instruction, &args, NULL); | 192 | stop_machine(swap_instruction, &args, NULL); |
191 | } | 193 | } |
192 | 194 | ||