summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rmlock.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2007-11-18 14:43:53 +0000
committerattilio <attilio@FreeBSD.org>2007-11-18 14:43:53 +0000
commitbfc761fdba732e46979638ae050d0477eaf4b2cb (patch)
tree85188d6cc1153cc1df464313f1de2d46f0d4f067 /sys/kern/kern_rmlock.c
parent9dbec8e7dff5d2722f0ec81fca3a4d632eaadd19 (diff)
downloadFreeBSD-src-bfc761fdba732e46979638ae050d0477eaf4b2cb.zip
FreeBSD-src-bfc761fdba732e46979638ae050d0477eaf4b2cb.tar.gz
Expand lock class with the "virtual" function lc_assert which will offer
an unified way for all the lock primitives to express lock assertions. Currenty, lockmgrs and rmlocks don't have assertions, so just panic in that case. This will be a base for more callout improvements. Ok'ed by: jhb, jeff
Diffstat (limited to 'sys/kern/kern_rmlock.c')
-rw-r--r--sys/kern/kern_rmlock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c
index 276aee6..cbf5cc5 100644
--- a/sys/kern/kern_rmlock.c
+++ b/sys/kern/kern_rmlock.c
@@ -71,12 +71,14 @@ static __inline void compiler_memory_barrier(void) {
__asm __volatile("":::"memory");
}
+static void assert_rm(struct lock_object *lock, int what);
static void lock_rm(struct lock_object *lock, int how);
static int unlock_rm(struct lock_object *lock);
struct lock_class lock_class_rm = {
.lc_name = "rm",
.lc_flags = LC_SLEEPLOCK | LC_RECURSABLE,
+ .lc_assert = assert_rm,
#if 0
#ifdef DDB
.lc_ddb_show = db_show_rwlock,
@@ -87,6 +89,13 @@ struct lock_class lock_class_rm = {
};
static void
+assert_rm(struct lock_object *lock, int what)
+{
+
+ panic("assert_rm called");
+}
+
+static void
lock_rm(struct lock_object *lock, int how) {
panic("lock_rm called");
}
OpenPOWER on IntegriCloud