Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern add a _kernel_locked_p().



details:   https://anonhg.NetBSD.org/src/rev/7445b7c0be5b
branches:  trunk
changeset: 777493:7445b7c0be5b
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Feb 20 22:35:14 2012 +0000

description:
add a _kernel_locked_p().

diffstat:

 sys/rump/librump/rumpkern/klock.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r ed72cf304a50 -r 7445b7c0be5b sys/rump/librump/rumpkern/klock.c
--- a/sys/rump/librump/rumpkern/klock.c Mon Feb 20 20:49:12 2012 +0000
+++ b/sys/rump/librump/rumpkern/klock.c Mon Feb 20 22:35:14 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: klock.c,v 1.3 2010/12/01 14:59:38 pooka Exp $  */
+/*     $NetBSD: klock.c,v 1.4 2012/02/20 22:35:14 mrg Exp $    */
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: klock.c,v 1.3 2010/12/01 14:59:38 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: klock.c,v 1.4 2012/02/20 22:35:14 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -117,6 +117,13 @@
        }
 }
 
+bool
+_kernel_locked_p(void)
+{
+
+       return giantowner == curlwp;
+}
+
 void
 rump_user_unschedule(int nlocks, int *countp, void *interlock)
 {



Home | Main Index | Thread Index | Old Index