diff options
author | David S. Miller <davem@davemloft.net> | 2009-09-24 18:13:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-24 18:13:11 -0400 |
commit | 8b3f6af86378d0a10ca2f1ded1da124aef13b62c (patch) | |
tree | de6ca90295730343c495be8d98be8efa322140ef /arch/microblaze/kernel/ptrace.c | |
parent | 139d6065c83071d5f66cd013a274a43699f8e2c1 (diff) | |
parent | 94e0fb086fc5663c38bbc0fe86d698be8314f82f (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/cpc-usb/TODO
drivers/staging/cpc-usb/cpc-usb_drv.c
drivers/staging/cpc-usb/cpc.h
drivers/staging/cpc-usb/cpc_int.h
drivers/staging/cpc-usb/cpcusb.h
Diffstat (limited to 'arch/microblaze/kernel/ptrace.c')
-rw-r--r-- | arch/microblaze/kernel/ptrace.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c index 53ff39af6a5c..4b3ac32754de 100644 --- a/arch/microblaze/kernel/ptrace.c +++ b/arch/microblaze/kernel/ptrace.c | |||
@@ -29,6 +29,10 @@ | |||
29 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
30 | #include <linux/ptrace.h> | 30 | #include <linux/ptrace.h> |
31 | #include <linux/signal.h> | 31 | #include <linux/signal.h> |
32 | #include <linux/elf.h> | ||
33 | #include <linux/audit.h> | ||
34 | #include <linux/seccomp.h> | ||
35 | #include <linux/tracehook.h> | ||
32 | 36 | ||
33 | #include <linux/errno.h> | 37 | #include <linux/errno.h> |
34 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
@@ -174,6 +178,64 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
174 | return rval; | 178 | return rval; |
175 | } | 179 | } |
176 | 180 | ||
181 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | ||
182 | { | ||
183 | long ret = 0; | ||
184 | |||
185 | secure_computing(regs->r12); | ||
186 | |||
187 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | ||
188 | tracehook_report_syscall_entry(regs)) | ||
189 | /* | ||
190 | * Tracing decided this syscall should not happen. | ||
191 | * We'll return a bogus call number to get an ENOSYS | ||
192 | * error, but leave the original number in regs->regs[0]. | ||
193 | */ | ||
194 | ret = -1L; | ||
195 | |||
196 | if (unlikely(current->audit_context)) | ||
197 | audit_syscall_entry(EM_XILINX_MICROBLAZE, regs->r12, | ||
198 | regs->r5, regs->r6, | ||
199 | regs->r7, regs->r8); | ||
200 | |||
201 | return ret ?: regs->r12; | ||
202 | } | ||
203 | |||
204 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) | ||
205 | { | ||
206 | int step; | ||
207 | |||
208 | if (unlikely(current->audit_context)) | ||
209 | audit_syscall_exit(AUDITSC_RESULT(regs->r3), regs->r3); | ||
210 | |||
211 | step = test_thread_flag(TIF_SINGLESTEP); | ||
212 | if (step || test_thread_flag(TIF_SYSCALL_TRACE)) | ||
213 | tracehook_report_syscall_exit(regs, step); | ||
214 | } | ||
215 | |||
216 | #if 0 | ||
217 | static asmlinkage void syscall_trace(void) | ||
218 | { | ||
219 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | ||
220 | return; | ||
221 | if (!(current->ptrace & PT_PTRACED)) | ||
222 | return; | ||
223 | /* The 0x80 provides a way for the tracing parent to distinguish | ||
224 | between a syscall stop and SIGTRAP delivery */ | ||
225 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | ||
226 | ? 0x80 : 0)); | ||
227 | /* | ||
228 | * this isn't the same as continuing with a signal, but it will do | ||
229 | * for normal use. strace only continues with a signal if the | ||
230 | * stopping signal is not SIGTRAP. -brl | ||
231 | */ | ||
232 | if (current->exit_code) { | ||
233 | send_sig(current->exit_code, current, 1); | ||
234 | current->exit_code = 0; | ||
235 | } | ||
236 | } | ||
237 | #endif | ||
238 | |||
177 | void ptrace_disable(struct task_struct *child) | 239 | void ptrace_disable(struct task_struct *child) |
178 | { | 240 | { |
179 | /* nothing to do */ | 241 | /* nothing to do */ |