Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sh3/sh3 When delivering a signal, arrange for the h...



details:   https://anonhg.NetBSD.org/src/rev/11f036786c22
branches:  trunk
changeset: 533170:11f036786c22
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jun 23 18:49:33 2002 +0000

description:
When delivering a signal, arrange for the handler to be invoked
directly.  The trampoline is now used only for the return, and
makes it another 2 instructions shorter.

diffstat:

 sys/arch/sh3/sh3/locore_subr.S |  13 +++++--------
 sys/arch/sh3/sh3/sh3_machdep.c |   9 +++++----
 2 files changed, 10 insertions(+), 12 deletions(-)

diffs (59 lines):

diff -r ff06a1a76bd4 -r 11f036786c22 sys/arch/sh3/sh3/locore_subr.S
--- a/sys/arch/sh3/sh3/locore_subr.S    Sun Jun 23 18:35:05 2002 +0000
+++ b/sys/arch/sh3/sh3/locore_subr.S    Sun Jun 23 18:49:33 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_subr.S,v 1.11 2002/06/23 18:35:07 thorpej Exp $ */
+/*     $NetBSD: locore_subr.S,v 1.12 2002/06/23 18:49:33 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -341,18 +341,15 @@
  * sigcode:
  *     Signal trampoline. copied to top of user stack.
  *
- *     On entry, the registers and stack look like this:
+ *     The kernel arranges for the signal handler to be invoked
+ *     directly.  This trampoline is used only to perform the
+ *     return.
  *
- *     r4      signal number
- *     r5      signal specific code
- *     r6      pointer to sigcontext structure
- *     r7      address of handler
+ *     On entry, the stack looks like this:
  *
  *     sp->    sigcontext structure
  */
 NENTRY(sigcode)
-       jsr     @r7                     /* call handler */
-        nop
        mov     r15, r4                 /* get pointer to sigcontext */
        mov.l   _L.SYS___sigreturn14, r0
        trapa   #0x80                   /* and call sigreturn() */
diff -r ff06a1a76bd4 -r 11f036786c22 sys/arch/sh3/sh3/sh3_machdep.c
--- a/sys/arch/sh3/sh3/sh3_machdep.c    Sun Jun 23 18:35:05 2002 +0000
+++ b/sys/arch/sh3/sh3/sh3_machdep.c    Sun Jun 23 18:49:33 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sh3_machdep.c,v 1.42 2002/06/23 18:35:07 thorpej Exp $ */
+/*     $NetBSD: sh3_machdep.c,v 1.43 2002/06/23 18:49:33 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@@ -432,13 +432,14 @@
        }
 
        /*
-        * Build context to run handler in.
+        * Build context to run handler in.  We invoke the handler
+        * directly, only returning via the trampoline.
         */
        tf->tf_r4 = sig;
        tf->tf_r5 = code;
        tf->tf_r6 = (int)&fp->sf_sc;
-       tf->tf_r7 = (int)catcher;
-       tf->tf_spc = (int)p->p_sigctx.ps_sigcode;
+       tf->tf_spc = (int)catcher;
+       tf->tf_pr = (int)p->p_sigctx.ps_sigcode;
        tf->tf_r15 = (int)fp;
 
        /* Remember that we're now on the signal stack. */



Home | Main Index | Thread Index | Old Index