From c1d02dab7b9b69826bd736f1a860fb2452d6fc70 Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 20 Feb 2012 22:35:14 +0000 Subject: [PATCH] add a _kernel_locked_p(). --- sys/rump/librump/rumpkern/klock.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/rump/librump/rumpkern/klock.c b/sys/rump/librump/rumpkern/klock.c index 352b6fec9eba..2e20a9e77fbd 100644 --- a/sys/rump/librump/rumpkern/klock.c +++ b/sys/rump/librump/rumpkern/klock.c @@ -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 -__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 #include @@ -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) {