summaryrefslogtreecommitdiffstats
path: root/sys/sys/mutex.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-03-30 18:10:08 +0000
committerjhb <jhb@FreeBSD.org>2007-03-30 18:10:08 +0000
commit67753b036c10a44b3206d9deff7f2f1434d12bad (patch)
tree530f2c83744dfe9ea106f5b97ae93dc59b2d0aa5 /sys/sys/mutex.h
parent602dd12fbccb137326e1fe68ee555a1e572328d1 (diff)
downloadFreeBSD-src-67753b036c10a44b3206d9deff7f2f1434d12bad.zip
FreeBSD-src-67753b036c10a44b3206d9deff7f2f1434d12bad.tar.gz
- Use PARTIAL_PICKUP_GIANT() to implement PICKUP_GIANT().
- Move UGAR() macro up to the comment that describes it. - Fix a couple of typos.
Diffstat (limited to 'sys/sys/mutex.h')
-rw-r--r--sys/sys/mutex.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index 6d16ff0..dea4b76 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -375,11 +375,7 @@ do { \
mtx_unlock(&Giant)
#define PICKUP_GIANT() \
- mtx_assert(&Giant, MA_NOTOWNED); \
- while (_giantcnt--) \
- mtx_lock(&Giant); \
- if (mtx_owned(&Giant)) \
- WITNESS_RESTORE(&Giant.lock_object, Giant); \
+ PARTIAL_PICKUP_GIANT(); \
} while (0)
#define PARTIAL_PICKUP_GIANT() \
@@ -390,14 +386,20 @@ do { \
WITNESS_RESTORE(&Giant.lock_object, Giant)
#endif
+#define UGAR(rval) do { \
+ int _val = (rval); \
+ mtx_unlock(&Giant); \
+ return (_val); \
+} while (0)
+
/*
* Network MPSAFE temporary workarounds. When debug_mpsafenet
* is 1 the network is assumed to operate without Giant on the
* input path and protocols that require Giant must collect it
* on entry. When 0 Giant is grabbed in the network interface
* ISR's and in the netisr path and there is no need to grab
- * the Giant lock. Note that, unlike GIANT_PICKUP() and
- * GIANT_DROP(), these macros directly wrap mutex operations
+ * the Giant lock. Note that, unlike PICKUP_GIANT() and
+ * DROP_GIANT(), these macros directly wrap mutex operations
* without special recursion handling.
*
* This mechanism is intended as temporary until everything of
@@ -421,12 +423,6 @@ extern int debug_mpsafenet; /* defined in net/netisr.c */
} while (0)
#define NET_CALLOUT_MPSAFE (debug_mpsafenet ? CALLOUT_MPSAFE : 0)
-#define UGAR(rval) do { \
- int _val = (rval); \
- mtx_unlock(&Giant); \
- return (_val); \
-} while (0)
-
struct mtx_args {
struct mtx *ma_mtx;
const char *ma_desc;
OpenPOWER on IntegriCloud