Module Name:    src
Committed By:   mrg
Date:           Mon Feb 20 22:35:15 UTC 2012

Modified Files:
        src/sys/rump/librump/rumpkern: klock.c

Log Message:
add a _kernel_locked_p().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/librump/rumpkern/klock.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/rump/librump/rumpkern/klock.c
diff -u src/sys/rump/librump/rumpkern/klock.c:1.3 src/sys/rump/librump/rumpkern/klock.c:1.4
--- src/sys/rump/librump/rumpkern/klock.c:1.3	Wed Dec  1 14:59:38 2010
+++ src/sys/rump/librump/rumpkern/klock.c	Mon Feb 20 22:35:14 2012
@@ -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 @@ _kernel_unlock(int nlocks, int *countp)
 	}
 }
 
+bool
+_kernel_locked_p(void)
+{
+
+	return giantowner == curlwp;
+}
+
 void
 rump_user_unschedule(int nlocks, int *countp, void *interlock)
 {

Reply via email to