Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/kern Pullup rev 1.68 (requested by chs in ticket #915)



details:   https://anonhg.NetBSD.org/src/rev/c591147952d0
branches:  netbsd-3
changeset: 577409:c591147952d0
user:      jmc <jmc%NetBSD.org@localhost>
date:      Fri Oct 28 20:07:02 2005 +0000

description:
Pullup rev 1.68 (requested by chs in ticket #915)
 In sa_switch(), if after we set up the LWP with cpu_setfunc(), we decide that
 we can't do an SA context switch after all, we need to clear the sau from
 the LWP's arg. sa_switch() frees the sau in this case, but if we don't
 reset the LWP's state and the process exits, then the exiting LWP will
 try to free the sau again.

diffstat:

 sys/kern/kern_sa.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 13c71bff5ec5 -r c591147952d0 sys/kern/kern_sa.c
--- a/sys/kern/kern_sa.c        Fri Oct 28 19:49:21 2005 +0000
+++ b/sys/kern/kern_sa.c        Fri Oct 28 20:07:02 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sa.c,v 1.60.2.2 2005/10/21 17:39:40 riz Exp $     */
+/*     $NetBSD: kern_sa.c,v 1.60.2.3 2005/10/28 20:07:02 jmc Exp $     */
 
 /*-
  * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.60.2.2 2005/10/21 17:39:40 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.60.2.3 2005/10/28 20:07:02 jmc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -79,8 +79,8 @@
 #define SA_DEBUG
 
 #ifdef SA_DEBUG
-#define DPRINTF(x)     do { if (sadebug) printf x; } while (0)
-#define DPRINTFN(n,x)  do { if (sadebug & (1<<(n-1))) printf x; } while (0)
+#define DPRINTF(x)     do { if (sadebug) printf_nolog x; } while (0)
+#define DPRINTFN(n,x)  do { if (sadebug & (1<<(n-1))) printf_nolog x; } while (0)
 int    sadebug = 0;
 #else
 #define DPRINTF(x)
@@ -949,6 +949,7 @@
                 */
                if ((l->l_flag & L_SA_PAGEFAULT) && sa_pagefault(l,
                        &sau->sau_event.ss_captured.ss_ctx) != 0) {
+                       cpu_setfunc(l2, sa_switchcall, NULL);
                        sa_putcachelwp(p, l2); /* PHOLD from sa_getcachelwp */
                        mi_switch(l, NULL);
                        sadata_upcall_free(sau);



Home | Main Index | Thread Index | Old Index