Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106682
b: refs/heads/master
c: 1c133b4
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jul 28, 2008
1 parent caf1a8a commit d993a4e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 768225868c16d882f7a38a11027945284dc9f49e
refs/heads/master: 1c133b4b3d58bf88293eeea0d9d090777333bf48
12 changes: 10 additions & 2 deletions trunk/arch/sparc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1196,8 +1196,9 @@ sys_rt_sigreturn:
be 1f
nop

add %sp, STACKFRAME_SZ, %o0
call syscall_trace
nop
mov 1, %o1

1:
/* We are returning to a signal handler. */
Expand Down Expand Up @@ -1287,8 +1288,12 @@ linux_fast_syscall:
mov %i3, %o3

linux_syscall_trace:
add %sp, STACKFRAME_SZ, %o0
call syscall_trace
nop
mov 0, %o1
cmp %o0, 0
bne 3f
mov -ENOSYS, %o0
mov %i0, %o0
mov %i1, %o1
mov %i2, %o2
Expand Down Expand Up @@ -1337,6 +1342,7 @@ syscall_is_too_hard:
call %l7
mov %i5, %o5

3:
st %o0, [%sp + STACKFRAME_SZ + PT_I0]

ret_sys_call:
Expand Down Expand Up @@ -1374,6 +1380,8 @@ ret_sys_call:
st %l2, [%sp + STACKFRAME_SZ + PT_NPC]

linux_syscall_trace2:
add %sp, STACKFRAME_SZ, %o0
mov 1, %o1
call syscall_trace
add %l1, 0x4, %l2 /* npc = npc+4 */
st %l1, [%sp + STACKFRAME_SZ + PT_PC]
Expand Down
26 changes: 11 additions & 15 deletions trunk/arch/sparc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/signal.h>
#include <linux/regset.h>
#include <linux/elf.h>
#include <linux/tracehook.h>

#include <asm/pgtable.h>
#include <asm/system.h>
Expand Down Expand Up @@ -450,21 +451,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
return ret;
}

asmlinkage void syscall_trace(void)
asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p)
{
if (!test_thread_flag(TIF_SYSCALL_TRACE))
return;
if (!(current->ptrace & PT_PTRACED))
return;
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0));
/*
* this isn't the same as continuing with a signal, but it will do
* for normal use. strace only continues with a signal if the
* stopping signal is not SIGTRAP. -brl
*/
if (current->exit_code) {
send_sig (current->exit_code, current, 1);
current->exit_code = 0;
int ret = 0;

if (test_thread_flag(TIF_SYSCALL_TRACE)) {
if (syscall_exit_p)
tracehook_report_syscall_exit(regs, 0);
else
ret = tracehook_report_syscall_entry(regs);
}

return ret;
}

0 comments on commit d993a4e

Please sign in to comment.