aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/smr.h
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2020-02-13 20:50:21 +0000
committerJeff Roberson <jeff@FreeBSD.org>2020-02-13 20:50:21 +0000
commita4d50e49da8e636fee461f21bf3d377be8082153 (patch)
treecf2baebf57f56cd8e45a36fed19b3897c38ab002 /sys/sys/smr.h
parent43fbd654516eb5ddfa2994d92b7dfd373192796e (diff)
downloadsrc-a4d50e49da8e636fee461f21bf3d377be8082153.tar.gz
src-a4d50e49da8e636fee461f21bf3d377be8082153.zip
Add more precise SMR entry asserts.
Notes
Notes: svn path=/head/; revision=357882
Diffstat (limited to 'sys/sys/smr.h')
-rw-r--r--sys/sys/smr.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/smr.h b/sys/sys/smr.h
index d00f6239b884..19502020e6eb 100644
--- a/sys/sys/smr.h
+++ b/sys/sys/smr.h
@@ -68,6 +68,15 @@ struct smr {
int c_deferred; /* Deferred advance counter. */
};
+#define SMR_ENTERED(smr) \
+ (curthread->td_critnest != 0 && zpcpu_get((smr))->c_seq != SMR_SEQ_INVALID)
+
+#define SMR_ASSERT_ENTERED(smr) \
+ KASSERT(SMR_ENTERED(smr), ("Not in smr section"))
+
+#define SMR_ASSERT_NOT_ENTERED(smr) \
+ KASSERT(!SMR_ENTERED(smr), ("In smr section."));
+
/*
* Return the current write sequence number.
*/