Source-Changes-HG archive

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

[src/trunk]: src/sys Fix a bug and a compilation problem. Bug: spin mutexes ...



details:   https://anonhg.NetBSD.org/src/rev/b70783d899fe
branches:  trunk
changeset: 778928:b70783d899fe
user:      tls <tls%NetBSD.org@localhost>
date:      Fri Apr 20 21:57:33 2012 +0000

description:
Fix a bug and a compilation problem.  Bug: spin mutexes don't have owners,
so KASSERT(!mutex_owned()) shouldn't be used to assert that the current
LWP does not have the mutex.  Compilation problem: explicitly include
sys/mutex.h from rnd.h so evbarm builds again.

diffstat:

 sys/dev/rndpseudo.c |  8 +++-----
 sys/sys/rnd.h       |  3 ++-
 2 files changed, 5 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 4f2e0e73afda -r b70783d899fe sys/dev/rndpseudo.c
--- a/sys/dev/rndpseudo.c       Fri Apr 20 20:23:20 2012 +0000
+++ b/sys/dev/rndpseudo.c       Fri Apr 20 21:57:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rndpseudo.c,v 1.8 2012/04/17 02:50:38 tls Exp $        */
+/*     $NetBSD: rndpseudo.c,v 1.9 2012/04/20 21:57:33 tls Exp $        */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rndpseudo.c,v 1.8 2012/04/17 02:50:38 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rndpseudo.c,v 1.9 2012/04/20 21:57:33 tls Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -298,8 +298,6 @@
                return EIO;
         }
 
-       KASSERT(!mutex_owned(&cprng->reseed.mtx));
-
        strength = cprng_strong_strength(cprng);
        ret = 0;
        bf = pool_cache_get(rp_pc, PR_WAITOK);
@@ -326,7 +324,7 @@
                        }
                        goto out;
                }
-               /* KASSERT(!mutex_owned(&cprng->reseed.mtx)); */
+
                ret = uiomove((void *)bf, nread, uio);
                if (ret != 0 || n < want) {
                        goto out;
diff -r 4f2e0e73afda -r b70783d899fe sys/sys/rnd.h
--- a/sys/sys/rnd.h     Fri Apr 20 20:23:20 2012 +0000
+++ b/sys/sys/rnd.h     Fri Apr 20 21:57:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rnd.h,v 1.31 2012/04/17 02:50:39 tls Exp $     */
+/*     $NetBSD: rnd.h,v 1.32 2012/04/20 21:57:34 tls Exp $     */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -41,6 +41,7 @@
 #include <sys/sha1.h>
 
 #ifdef _KERNEL
+#include <sys/mutex.h>
 #include <sys/queue.h>
 #endif
 



Home | Main Index | Thread Index | Old Index