diff options
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r-- | sys/kern/kern_mutex.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 041b480..7666116 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -85,14 +85,15 @@ __FBSDID("$FreeBSD$"); #define mtx_owner(m) ((struct thread *)((m)->mtx_lock & ~MTX_FLAGMASK)) -static void assert_mtx(struct lock_object *lock, int what); +static void assert_mtx(const struct lock_object *lock, int what); #ifdef DDB -static void db_show_mtx(struct lock_object *lock); +static void db_show_mtx(const struct lock_object *lock); #endif static void lock_mtx(struct lock_object *lock, int how); static void lock_spin(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_mtx(struct lock_object *lock, struct thread **owner); +static int owner_mtx(const struct lock_object *lock, + struct thread **owner); #endif static int unlock_mtx(struct lock_object *lock); static int unlock_spin(struct lock_object *lock); @@ -134,10 +135,10 @@ struct mtx blocked_lock; struct mtx Giant; void -assert_mtx(struct lock_object *lock, int what) +assert_mtx(const struct lock_object *lock, int what) { - mtx_assert((struct mtx *)lock, what); + mtx_assert((const struct mtx *)lock, what); } void @@ -174,9 +175,9 @@ unlock_spin(struct lock_object *lock) #ifdef KDTRACE_HOOKS int -owner_mtx(struct lock_object *lock, struct thread **owner) +owner_mtx(const struct lock_object *lock, struct thread **owner) { - struct mtx *m = (struct mtx *)lock; + const struct mtx *m = (const struct mtx *)lock; *owner = mtx_owner(m); return (mtx_unowned(m) == 0); @@ -693,7 +694,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) */ #ifdef INVARIANT_SUPPORT void -_mtx_assert(struct mtx *m, int what, const char *file, int line) +_mtx_assert(const struct mtx *m, int what, const char *file, int line) { if (panicstr != NULL || dumping) @@ -871,12 +872,12 @@ mutex_init(void) #ifdef DDB void -db_show_mtx(struct lock_object *lock) +db_show_mtx(const struct lock_object *lock) { struct thread *td; - struct mtx *m; + const struct mtx *m; - m = (struct mtx *)lock; + m = (const struct mtx *)lock; db_printf(" flags: {"); if (LOCK_CLASS(lock) == &lock_class_mtx_spin) |