Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Add a new more KASSERT/KASSERTMSG



details:   https://anonhg.NetBSD.org/src/rev/eae9ba6d9b28
branches:  trunk
changeset: 781281:eae9ba6d9b28
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Aug 30 02:26:38 2012 +0000

description:
Add a new more KASSERT/KASSERTMSG

diffstat:

 sys/kern/kern_synch.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 57816a0f1d63 -r eae9ba6d9b28 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Thu Aug 30 02:26:02 2012 +0000
+++ b/sys/kern/kern_synch.c     Thu Aug 30 02:26:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.303 2012/08/18 08:54:06 christos Exp $        */
+/*     $NetBSD: kern_synch.c,v 1.304 2012/08/30 02:26:38 matt Exp $    */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.303 2012/08/18 08:54:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.304 2012/08/30 02:26:38 matt Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -522,6 +522,7 @@
 
        binuptime(&bt);
 
+       KASSERTMSG(l == curlwp, "l %p curlwp %p", l, curlwp);
        KASSERT((l->l_pflag & LP_RUNNING) != 0);
        KASSERT(l->l_cpu == curcpu());
        ci = l->l_cpu;
@@ -712,8 +713,13 @@
                }
 
                /* Switch to the new LWP.. */
+               KASSERT(curlwp == ci->ci_curlwp);
+               KASSERTMSG(l == curlwp, "l %p curlwp %p", l, curlwp);
                prevlwp = cpu_switchto(l, newl, returning);
                ci = curcpu();
+               KASSERT(curlwp == ci->ci_curlwp);
+               KASSERTMSG(l == curlwp, "l %p curlwp %p prevlwp %p",
+                   l, curlwp, prevlwp);
 
                /*
                 * Switched away - we have new curlwp.



Home | Main Index | Thread Index | Old Index