diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-09-24 13:21:31 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-09-24 13:21:31 +0000 |
commit | 7d41d2d54ec72e7e87c510b37c88a79f246c565e (patch) | |
tree | a4491d0a119e7c1d9e0fe4280dc229f9e3033dc3 /sys/arch/amd64/include | |
parent | d2ebe13a412b859545811580c7b40e4f3c69544c (diff) |
Add stricter asserts to DIAGNOSTIC kernels to help catch mutex and
rwlock misuse. In particular, this commit makes the following
changes:
1. i386 and amd64 now count the number of active mutexes so that
assertwaitok(9) can detect attempts to sleep while holding a mutex.
2. i386 and amd64 check that we actually hold mutexes when passed to
mtx_leave().
3. Calls to rw_exit*() now call rw_assert_{rd,wr}lock() as
appropriate.
ok krw@, oga@; "sounds good to me" deraadt@; assembly bits double
checked by pirofti@
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 91a5678e88e..08806916e7d 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.55 2010/08/11 21:22:44 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.56 2010/09/24 13:21:30 matthew Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -87,6 +87,10 @@ struct cpu_info { int ci_idepth; u_int32_t ci_imask[NIPL]; u_int32_t ci_iunmask[NIPL]; +#ifdef DIAGNOSTIC + int ci_mutex_level; +#define __HAVE_CPU_MUTEX_LEVEL +#endif u_int ci_flags; u_int32_t ci_ipis; |