Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/alpha When delivering a signal, arrange for t...



details:   https://anonhg.NetBSD.org/src/rev/9435cf100297
branches:  trunk
changeset: 533460:9435cf100297
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jul 01 03:10:01 2002 +0000

description:
When delivering a signal, arrange for the signal handler to be invoked
directly, using the trampoline only for the return path.

diffstat:

 sys/arch/alpha/alpha/locore.s       |  26 ++++++++------------------
 sys/arch/alpha/alpha/machdep.c      |   7 ++++---
 sys/arch/alpha/alpha/osf1_sigcode.s |  10 +++-------
 3 files changed, 15 insertions(+), 28 deletions(-)

diffs (114 lines):

diff -r 912eebb461cf -r 9435cf100297 sys/arch/alpha/alpha/locore.s
--- a/sys/arch/alpha/alpha/locore.s     Mon Jul 01 02:12:11 2002 +0000
+++ b/sys/arch/alpha/alpha/locore.s     Mon Jul 01 03:10:01 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.100 2002/05/13 21:38:09 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.101 2002/07/01 03:10:01 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
 
 #include <machine/asm.h>
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.100 2002/05/13 21:38:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.101 2002/07/01 03:10:01 thorpej Exp $");
 
 #include "assym.h"
 
@@ -272,26 +272,16 @@
 /**************************************************************************/
 
 /*
- * Signal "trampoline" code. Invoked from RTE setup by sendsig().
- *
- * On entry, stack & registers look like:
+ * Signal "trampoline" code.
  *
- *      a0     signal number
- *      a1     signal specific code
- *      a2     pointer to signal context frame (scp)
- *      pv     address of handler
- *      sp+0   saved hardware state
- *                      .
- *                      .
- *      scp+0  beginning of signal context frame
+ * The kernel arranges for the handler to be invoked directly.  This
+ * trampoline is used only to return from the signal.
+ *
+ * The stack pointer points to the saved sigcontext.
  */
 
 NESTED_NOPROFILE(sigcode,0,0,ra,0,0)
-       lda     sp, -16(sp)             /* save the sigcontext pointer */
-       stq     a2, 0(sp)
-       jsr     ra, (t12)               /* call the signal handler (t12==pv) */
-       ldq     a0, 0(sp)               /* get the sigcontext pointer */
-       lda     sp, 16(sp)
+       mov     sp, a0                  /* get pointer to sigcontext */
        CALLSYS_NOERROR(__sigreturn14)  /* and call sigreturn() with it. */
        mov     v0, a0                  /* if that failed, get error code */
        CALLSYS_NOERROR(exit)           /* and call exit() with it. */
diff -r 912eebb461cf -r 9435cf100297 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Mon Jul 01 02:12:11 2002 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Mon Jul 01 03:10:01 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.254 2002/03/18 22:57:53 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.255 2002/07/01 03:10:01 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.254 2002/03/18 22:57:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.255 2002/07/01 03:10:01 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1599,11 +1599,12 @@
 #endif
 
        /* Set up the registers to return to sigcode. */
-       frame->tf_regs[FRAME_PC] = (u_int64_t)p->p_sigctx.ps_sigcode;
+       frame->tf_regs[FRAME_PC] = (u_int64_t)catcher;
        frame->tf_regs[FRAME_A0] = sig;
        frame->tf_regs[FRAME_A1] = code;
        frame->tf_regs[FRAME_A2] = (u_int64_t)scp;
        frame->tf_regs[FRAME_T12] = (u_int64_t)catcher;         /* t12 is pv */
+       frame->tf_regs[FRAME_RA] = (u_int64_t)p->p_sigctx.ps_sigcode;
        alpha_pal_wrusp((unsigned long)scp);
 
        /* Remember that we're now on the signal stack. */
diff -r 912eebb461cf -r 9435cf100297 sys/arch/alpha/alpha/osf1_sigcode.s
--- a/sys/arch/alpha/alpha/osf1_sigcode.s       Mon Jul 01 02:12:11 2002 +0000
+++ b/sys/arch/alpha/alpha/osf1_sigcode.s       Mon Jul 01 03:10:01 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_sigcode.s,v 1.2 2002/05/13 21:37:12 thorpej Exp $ */
+/* $NetBSD: osf1_sigcode.s,v 1.3 2002/07/01 03:10:02 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -61,7 +61,7 @@
 
 #include <compat/osf1/osf1_syscall.h>
 
-__KERNEL_RCSID(0, "$NetBSD: osf1_sigcode.s,v 1.2 2002/05/13 21:37:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_sigcode.s,v 1.3 2002/07/01 03:10:02 thorpej Exp $");
 
 /*
  * OSF/1 signal trampoline code.
@@ -75,11 +75,7 @@
        call_pal PAL_OSF1_callsys
 
 NESTED_NOPROFILE(osf1_sigcode,0,0,ra,0,0)
-       lda     sp, -16(sp)
-       stq     a2, 0(sp)
-       jsr     ra, (t12)
-       ldq     a0, 0(sp)
-       lda     sp, 16(sp)
+       mov     sp, a0
        OSF1_CALLSYS_NOERROR(sigreturn)
        mov     v0, a0
        OSF1_CALLSYS_NOERROR(exit)



Home | Main Index | Thread Index | Old Index