Module Name:    src
Committed By:   jmcneill
Date:           Sun Aug 28 00:40:10 UTC 2011

Modified Files:
        src/sys/arch/usermode/dev: cpu.c
        src/sys/arch/usermode/usermode: trap.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/usermode/dev/cpu.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/usermode/usermode/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/usermode/dev/cpu.c
diff -u src/sys/arch/usermode/dev/cpu.c:1.19 src/sys/arch/usermode/dev/cpu.c:1.20
--- src/sys/arch/usermode/dev/cpu.c:1.19	Sat Aug 27 21:43:06 2011
+++ src/sys/arch/usermode/dev/cpu.c	Sun Aug 28 00:40:10 2011
@@ -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 <jmcne...@invisible.ca>
@@ -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

Index: src/sys/arch/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.8 src/sys/arch/usermode/usermode/trap.c:1.9
--- src/sys/arch/usermode/usermode/trap.c:1.8	Sat Aug 27 21:19:17 2011
+++ src/sys/arch/usermode/usermode/trap.c	Sun Aug 28 00:40:10 2011
@@ -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 <rein...@netbsd.org>
@@ -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;

Reply via email to