summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-11-20 16:33:09 +0000
committerattilio <attilio@FreeBSD.org>2011-11-20 16:33:09 +0000
commit6a69e947d3eb5ffaceb04f999c1925ed771b7546 (patch)
tree1fcde0be5ef74d1581c3a825bc7f36ff5d1c05b3 /sys/dev/ppbus
parentbf5f03ca46a93268d5d0eccc7318039bda9106d2 (diff)
downloadFreeBSD-src-6a69e947d3eb5ffaceb04f999c1925ed771b7546.zip
FreeBSD-src-6a69e947d3eb5ffaceb04f999c1925ed771b7546.tar.gz
Introduce macro stubs in the mutex implementation that will be always
defined and will allow consumers, willing to provide options, file and line to locking requests, to not worry about options redefining the interfaces. This is typically useful when there is the need to build another locking interface on top of the mutex one. The introduced functions that consumers can use are: - mtx_lock_flags_ - mtx_unlock_flags_ - mtx_lock_spin_flags_ - mtx_unlock_spin_flags_ - mtx_assert_ - thread_lock_flags_ Spare notes: - Likely we can get rid of all the 'INVARIANTS' specification in the ppbus code by using the same macro as done in this patch (but this is left to the ppbus maintainer) - all the other locking interfaces may require a similar cleanup, where the most notable case is sx which will allow a further cleanup of vm_map locking facilities - The patch should be fully compatible with older branches, thus a MFC is previewed (infact it uses all the underlying mechanisms already present). Comments review by: eadler, Ben Kaduk Discussed with: kib, jhb MFC after: 1 month
Diffstat (limited to 'sys/dev/ppbus')
-rw-r--r--sys/dev/ppbus/ppb_base.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/dev/ppbus/ppb_base.c b/sys/dev/ppbus/ppb_base.c
index 30c42a4..62769b0 100644
--- a/sys/dev/ppbus/ppb_base.c
+++ b/sys/dev/ppbus/ppb_base.c
@@ -236,11 +236,8 @@ ppb_unlock(device_t bus)
void
_ppb_assert_locked(device_t bus, const char *file, int line)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = DEVTOSOFTC(bus);
- _mtx_assert(ppb->ppc_lock, MA_OWNED, file, line);
-#endif
+ mtx_assert_(DEVTOSOFTC(bus)->ppc_lock, MA_OWNED, file, line);
}
void
OpenPOWER on IntegriCloud