aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/platform/5307
diff options
context:
space:
mode:
authorPhilippe De Muyter <phdm@macqel.be>2006-06-25 21:37:57 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 00:04:24 -0400
commit623f523cc05c35a385c04fde2114925f5954192b (patch)
tree5bd31c92272974c50650dd276bef3d0719303197 /arch/m68knommu/platform/5307
parent7bf9a37d8df1e7db82784117d28bb98da5f53f2f (diff)
[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: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68knommu/platform/5307')
-rw-r--r--arch/m68knommu/platform/5307/entry.S46
1 files changed, 20 insertions, 26 deletions
diff --git a/arch/m68knommu/platform/5307/entry.S b/arch/m68knommu/platform/5307/entry.S
index 89b180d4ed6a..9ddf5476ef8f 100644
--- a/arch/m68knommu/platform/5307/entry.S
+++ b/arch/m68knommu/platform/5307/entry.S
@@ -4,8 +4,8 @@
4 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com) 4 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
5 * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>, 5 * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
6 * Kenneth Albanowski <kjahds@kjahds.com>, 6 * Kenneth Albanowski <kjahds@kjahds.com>,
7 * Copyright (C) 2000 Lineo Inc. (www.lineo.com) 7 * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
8 * Copyright (C) 2004 Macq Electronique SA. (www.macqel.com) 8 * Copyright (C) 2004-2006 Macq Electronique SA. (www.macqel.com)
9 * 9 *
10 * Based on: 10 * Based on:
11 * 11 *
@@ -56,32 +56,27 @@ sw_usp:
56.globl inthandler 56.globl inthandler
57.globl fasthandler 57.globl fasthandler
58 58
59enosys:
60 mov.l #sys_ni_syscall,%d3
61 bra 1f
62
59ENTRY(system_call) 63ENTRY(system_call)
60 SAVE_ALL 64 SAVE_ALL
61 move #0x2000,%sr /* enable intrs again */ 65 move #0x2000,%sr /* enable intrs again */
62 66
63 movel #-LENOSYS,%d2 67 cmpl #NR_syscalls,%d0
64 movel %d2,PT_D0(%sp) /* default return value in d0 */ 68 jcc enosys
65 /* original D0 is in orig_d0 */
66 movel %d0,%d2
67
68 /* save top of frame */
69 pea %sp@
70 jbsr set_esp0
71 addql #4,%sp
72
73 cmpl #NR_syscalls,%d2
74 jcc ret_from_exception
75 lea sys_call_table,%a0 69 lea sys_call_table,%a0
76 lsll #2,%d2 /* movel %a0@(%d2:l:4),%d3 */ 70 lsll #2,%d0 /* movel %a0@(%d0:l:4),%d3 */
77 movel %a0@(%d2),%d3 71 movel %a0@(%d0),%d3
78 jeq ret_from_exception 72 jeq enosys
79 lsrl #2,%d2
80 73
741:
81 movel %sp,%d2 /* get thread_info pointer */ 75 movel %sp,%d2 /* get thread_info pointer */
82 andl #-THREAD_SIZE,%d2 /* at start of kernel stack */ 76 andl #-THREAD_SIZE,%d2 /* at start of kernel stack */
83 movel %d2,%a0 77 movel %d2,%a0
84 btst #TIF_SYSCALL_TRACE,%a0@(TI_FLAGS) 78 movel %sp,%a0@(THREAD_ESP0) /* save top of frame */
79 btst #(TIF_SYSCALL_TRACE%8),%a0@(TI_FLAGS+(31-TIF_SYSCALL_TRACE)/8)
85 bnes 1f 80 bnes 1f
86 81
87 movel %d3,%a0 82 movel %d3,%a0
@@ -126,8 +121,8 @@ Luser_return:
126 jne Lwork_to_do /* still work to do */ 121 jne Lwork_to_do /* still work to do */
127 122
128Lreturn: 123Lreturn:
129 move #0x2700,%sr /* disable intrs */ 124 move #0x2700,%sr /* disable intrs */
130 movel sw_usp,%a0 /* get usp */ 125 movel sw_usp,%a0 /* get usp */
131 movel %sp@(PT_PC),%a0@- /* copy exception program counter */ 126 movel %sp@(PT_PC),%a0@- /* copy exception program counter */
132 movel %sp@(PT_FORMATVEC),%a0@-/* copy exception format/vector/sr */ 127 movel %sp@(PT_FORMATVEC),%a0@-/* copy exception format/vector/sr */
133 moveml %sp@,%d1-%d5/%a0-%a2 128 moveml %sp@,%d1-%d5/%a0-%a2
@@ -170,7 +165,7 @@ ENTRY(inthandler)
170 movel %d0,%sp@(PT_ORIG_D0) 165 movel %d0,%sp@(PT_ORIG_D0)
171 addql #1,local_irq_count 166 addql #1,local_irq_count
172 167
173 movew %sp@(PT_FORMATVEC),%d0 /* put exception # in d0 */ 168 movew %sp@(PT_FORMATVEC),%d0 /* put exception # in d0 */
174 andl #0x03fc,%d0 /* mask out vector only */ 169 andl #0x03fc,%d0 /* mask out vector only */
175 170
176 leal per_cpu__kstat+STAT_IRQ,%a0 171 leal per_cpu__kstat+STAT_IRQ,%a0
@@ -184,7 +179,7 @@ ENTRY(inthandler)
184 179
185 movel %sp,%sp@- /* push regs arg onto stack */ 180 movel %sp,%sp@- /* push regs arg onto stack */
186 movel %a0@(8),%sp@- /* push devid arg */ 181 movel %a0@(8),%sp@- /* push devid arg */
187 movel %d0,%sp@- /* push vector # on stack */ 182 movel %d0,%sp@- /* push vector # on stack */
188 183
189 movel %a0@,%a0 /* get function to call */ 184 movel %a0@,%a0 /* get function to call */
190 jbsr %a0@ /* call vector handler */ 185 jbsr %a0@ /* call vector handler */
@@ -201,7 +196,7 @@ ENTRY(inthandler)
201ENTRY(fasthandler) 196ENTRY(fasthandler)
202 SAVE_LOCAL 197 SAVE_LOCAL
203 198
204 movew %sp@(PT_FORMATVEC),%d0 199 movew %sp@(PT_FORMATVEC),%d0
205 andl #0x03fc,%d0 /* mask out vector only */ 200 andl #0x03fc,%d0 /* mask out vector only */
206 201
207 leal per_cpu__kstat+STAT_IRQ,%a0 202 leal per_cpu__kstat+STAT_IRQ,%a0
@@ -210,7 +205,7 @@ ENTRY(fasthandler)
210 movel %sp,%sp@- /* push regs arg onto stack */ 205 movel %sp,%sp@- /* push regs arg onto stack */
211 clrl %sp@- /* push devid arg */ 206 clrl %sp@- /* push devid arg */
212 lsrl #2,%d0 /* calculate real vector # */ 207 lsrl #2,%d0 /* calculate real vector # */
213 movel %d0,%sp@- /* push vector # on stack */ 208 movel %d0,%sp@- /* push vector # on stack */
214 209
215 lsll #4,%d0 /* adjust for array offset */ 210 lsll #4,%d0 /* adjust for array offset */
216 lea irq_list,%a0 211 lea irq_list,%a0
@@ -265,4 +260,3 @@ ENTRY(resume)
265 movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */ 260 movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */
266 movew %d0, %sr 261 movew %d0, %sr
267 rts 262 rts
268