Commit 151941a8 authored by Matt Waddel's avatar Matt Waddel Committed by Linus Torvalds

m68knommu: fix syscall tracing

Fix the system call code for handling syscall tracing, so strace
and gdbserver work properly.

This fix originally developed by Philippe De Muyter and Stuart Hughes.
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f909b1ef
...@@ -74,7 +74,8 @@ ENTRY(system_call) ...@@ -74,7 +74,8 @@ ENTRY(system_call)
movel %sp,%d2 /* get thread_info pointer */ movel %sp,%d2 /* get thread_info pointer */
andl #-THREAD_SIZE,%d2 /* at start of kernel stack */ andl #-THREAD_SIZE,%d2 /* at start of kernel stack */
movel %d2,%a0 movel %d2,%a0
movel %sp,%a0@(THREAD_ESP0) /* save top of frame */ movel %a0@,%a1 /* save top of frame */
movel %sp,%a1@(TASK_THREAD+THREAD_ESP0)
btst #(TIF_SYSCALL_TRACE%8),%a0@(TI_FLAGS+(31-TIF_SYSCALL_TRACE)/8) btst #(TIF_SYSCALL_TRACE%8),%a0@(TI_FLAGS+(31-TIF_SYSCALL_TRACE)/8)
bnes 1f bnes 1f
...@@ -83,6 +84,8 @@ ENTRY(system_call) ...@@ -83,6 +84,8 @@ ENTRY(system_call)
movel %d0,%sp@(PT_D0) /* save the return value */ movel %d0,%sp@(PT_D0) /* save the return value */
jra ret_from_exception jra ret_from_exception
1: 1:
movel #-ENOSYS,%d2 /* strace needs -ENOSYS in PT_D0 */
movel %d2,PT_D0(%sp) /* on syscall entry */
subql #4,%sp subql #4,%sp
SAVE_SWITCH_STACK SAVE_SWITCH_STACK
jbsr syscall_trace jbsr syscall_trace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment