Commit 623f523c authored by Philippe De Muyter's avatar Philippe De Muyter Committed by Linus Torvalds

[PATCH] m68knommu: improve syscall entry and fix strace

Here is a patch to the system call handling for 5307/5272/etc to:

- fix the strace support (one tested the wrong bit)
- make all system calls a little bit faster by inlining set_esp0 and
  supporting ENOSYS out of the critical path.
- remove extraneous spaces
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7bf9a37d
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>, * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
* Kenneth Albanowski <kjahds@kjahds.com>, * Kenneth Albanowski <kjahds@kjahds.com>,
* Copyright (C) 2000 Lineo Inc. (www.lineo.com) * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
* Copyright (C) 2004 Macq Electronique SA. (www.macqel.com) * Copyright (C) 2004-2006 Macq Electronique SA. (www.macqel.com)
* *
* Based on: * Based on:
* *
...@@ -56,32 +56,27 @@ sw_usp: ...@@ -56,32 +56,27 @@ sw_usp:
.globl inthandler .globl inthandler
.globl fasthandler .globl fasthandler
enosys:
mov.l #sys_ni_syscall,%d3
bra 1f
ENTRY(system_call) ENTRY(system_call)
SAVE_ALL SAVE_ALL
move #0x2000,%sr /* enable intrs again */ move #0x2000,%sr /* enable intrs again */
movel #-LENOSYS,%d2 cmpl #NR_syscalls,%d0
movel %d2,PT_D0(%sp) /* default return value in d0 */ jcc enosys
/* original D0 is in orig_d0 */
movel %d0,%d2
/* save top of frame */
pea %sp@
jbsr set_esp0
addql #4,%sp
cmpl #NR_syscalls,%d2
jcc ret_from_exception
lea sys_call_table,%a0 lea sys_call_table,%a0
lsll #2,%d2 /* movel %a0@(%d2:l:4),%d3 */ lsll #2,%d0 /* movel %a0@(%d0:l:4),%d3 */
movel %a0@(%d2),%d3 movel %a0@(%d0),%d3
jeq ret_from_exception jeq enosys
lsrl #2,%d2
1:
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
btst #TIF_SYSCALL_TRACE,%a0@(TI_FLAGS) movel %sp,%a0@(THREAD_ESP0) /* save top of frame */
btst #(TIF_SYSCALL_TRACE%8),%a0@(TI_FLAGS+(31-TIF_SYSCALL_TRACE)/8)
bnes 1f bnes 1f
movel %d3,%a0 movel %d3,%a0
...@@ -265,4 +260,3 @@ ENTRY(resume) ...@@ -265,4 +260,3 @@ ENTRY(resume)
movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */ movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */
movew %d0, %sr movew %d0, %sr
rts rts
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