diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-04-20 13:57:31 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-04-20 13:57:31 +0000 |
commit | da85a125dd7fd9af53b0919887129daaf4fa53bb (patch) | |
tree | a8a5d35dfd86d6f624f47c01ea1bd6c6ac4b32b6 /sys/arch/alpha/include | |
parent | 4718dfdd3c76a956f1a6022f2dbb3c240b27f3e2 (diff) |
Hook up mutex(9) to witness(4).
Diffstat (limited to 'sys/arch/alpha/include')
-rw-r--r-- | sys/arch/alpha/include/mutex.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/arch/alpha/include/mutex.h b/sys/arch/alpha/include/mutex.h index c5509881c5a..a75afb2e4e8 100644 --- a/sys/arch/alpha/include/mutex.h +++ b/sys/arch/alpha/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.7 2015/04/17 12:38:54 dlg Exp $ */ +/* $OpenBSD: mutex.h,v 1.8 2017/04/20 13:57:29 visa Exp $ */ /* * Copyright (c) 2004 Artur Grabowski <art@openbsd.org> @@ -28,10 +28,15 @@ #ifndef _MACHINE_MUTEX_H_ #define _MACHINE_MUTEX_H_ +#include <sys/_lock.h> + struct mutex { void *mtx_owner; int mtx_wantipl; int mtx_oldipl; +#ifdef WITNESS + struct lock_object mtx_lock_obj; +#endif }; /* @@ -48,10 +53,16 @@ struct mutex { #define __MUTEX_IPL(ipl) (ipl) #endif -#define MUTEX_INITIALIZER(ipl) { NULL, __MUTEX_IPL((ipl)), IPL_NONE } +#ifdef WITNESS +#define MUTEX_INITIALIZER_FLAGS(ipl, name, flags) \ + { NULL, __MUTEX_IPL((ipl)), IPL_NONE, MTX_LO_INITIALIZER(name, flags) } +#else +#define MUTEX_INITIALIZER_FLAGS(ipl, name, flags) \ + { NULL, __MUTEX_IPL((ipl)), IPL_NONE } +#endif void __mtx_init(struct mutex *, int); -#define mtx_init(mtx, ipl) __mtx_init((mtx), __MUTEX_IPL((ipl))) +#define _mtx_init(mtx, ipl) __mtx_init((mtx), __MUTEX_IPL((ipl))) #ifdef DIAGNOSTIC #define MUTEX_ASSERT_LOCKED(mtx) do { \ @@ -68,6 +79,7 @@ void __mtx_init(struct mutex *, int); #define MUTEX_ASSERT_UNLOCKED(mtx) do { } while (0) #endif +#define MUTEX_LOCK_OBJECT(mtx) (&(mtx)->mtx_lock_obj) #define MUTEX_OLDIPL(mtx) (mtx)->mtx_oldipl #endif /* _MACHINE_MUTEX_H_ */ |