Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode cpu_lwp_trampoline isn't supposed to retur...



details:   https://anonhg.NetBSD.org/src/rev/6dc6fd37fcb8
branches:  trunk
changeset: 768851:6dc6fd37fcb8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Aug 28 00:40:10 2011 +0000

description:
cpu_lwp_trampoline isn't supposed to return, so drop the atexit handler
and drop a panic() at the end of the function

diffstat:

 sys/arch/usermode/dev/cpu.c       |   6 ++++--
 sys/arch/usermode/usermode/trap.c |  15 ++-------------
 2 files changed, 6 insertions(+), 15 deletions(-)

diffs (77 lines):

diff -r a6e31c844695 -r 6dc6fd37fcb8 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Sat Aug 27 23:42:33 2011 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Sun Aug 28 00:40:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.19 2011/08/27 21:43:06 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.20 2011/08/28 00:40:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_cpu.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.19 2011/08/27 21:43:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.20 2011/08/28 00:40:10 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -275,6 +275,8 @@
        lwp_startup(curcpu()->ci_stash, curlwp);
 
        func(arg);
+
+       panic("%s: shouldn't return", __func__);
 }
 
 void
diff -r a6e31c844695 -r 6dc6fd37fcb8 sys/arch/usermode/usermode/trap.c
--- a/sys/arch/usermode/usermode/trap.c Sat Aug 27 23:42:33 2011 +0000
+++ b/sys/arch/usermode/usermode/trap.c Sun Aug 28 00:40:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.8 2011/08/27 21:19:17 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.9 2011/08/28 00:40:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%netbsd.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.8 2011/08/27 21:19:17 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.9 2011/08/28 00:40:10 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -48,7 +48,6 @@
 
 void setup_signal_handlers(void);
 static void mem_access_handler(int sig, siginfo_t *info, void *ctx);
-static void exit_func(void);
 
 
 static struct sigaction sa;
@@ -59,14 +58,6 @@
 {
 }
 
-static void
-exit_func(void)
-{
-       if (panicstr == NULL)
-               child_return(curlwp);
-       panic("atexit() with panic `%s`", panicstr);
-}
-
 void
 setup_signal_handlers(void)
 {
@@ -77,8 +68,6 @@
                panic("couldn't register SIGSEGV handler : %d", errno);
        if (thunk_sigaction(SIGBUS, &sa, NULL) == -1)
                panic("couldn't register SIGBUS handler : %d", errno);
-       if (thunk_atexit(exit_func))
-               panic("couldn't register atexit() handler : %d", errno);
 }
 
 static struct trapframe kernel_tf;



Home | Main Index | Thread Index | Old Index