summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-10-20 22:44:06 +0000
committerjhb <jhb@FreeBSD.org>2000-10-20 22:44:06 +0000
commitab67e1548e508ee6855267abfe9c626ce21c1454 (patch)
tree4b220ffab975313d7511aec65fddb4cba96496ef
parent060a190f062c5c6e4af9be7d4e590e2631b61858 (diff)
downloadFreeBSD-src-ab67e1548e508ee6855267abfe9c626ce21c1454.zip
FreeBSD-src-ab67e1548e508ee6855267abfe9c626ce21c1454.tar.gz
Define the mtx_legal2block() macro used in the witness code that managed
to get lost during the MI mutex conversion. Reported by: Steve Kargl <sgk@troutmask.apl.washington.edu>
-rw-r--r--sys/alpha/include/mutex.h3
-rw-r--r--sys/amd64/include/mutex.h2
-rw-r--r--sys/i386/include/mutex.h2
-rw-r--r--sys/ia64/include/mutex.h2
-rw-r--r--sys/powerpc/include/mutex.h3
5 files changed, 12 insertions, 0 deletions
diff --git a/sys/alpha/include/mutex.h b/sys/alpha/include/mutex.h
index 75c64cf..72d3b7b 100644
--- a/sys/alpha/include/mutex.h
+++ b/sys/alpha/include/mutex.h
@@ -60,6 +60,9 @@ extern char STR_SIEN[];
#define ASS_SIEN(mpp) MPASS2((mpp)->mtx_saveintr \
!= ALPHA_PSL_IPL_HIGH, STR_SIEN)
+#define mtx_legal2block() \
+ ((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) == ALPHA_PSL_IPL_HIGH)
+
/*
* Assembly macros (for internal use only)
*--------------------------------------------------------------------------
diff --git a/sys/amd64/include/mutex.h b/sys/amd64/include/mutex.h
index 1a8a7b6..0c4a9eb 100644
--- a/sys/amd64/include/mutex.h
+++ b/sys/amd64/include/mutex.h
@@ -60,6 +60,8 @@ extern char STR_SIEN[];
#define ASS_IDIS MPASS2((read_eflags() & PSL_I) == 0, STR_IDIS)
#define ASS_SIEN(mpp) MPASS2((mpp)->mtx_saveintr & PSL_I, STR_SIEN)
+#define mtx_legal2block() (read_eflags() & PSL_I)
+
/*
* Assembly macros (for internal use only)
*------------------------------------------------------------------------------
diff --git a/sys/i386/include/mutex.h b/sys/i386/include/mutex.h
index 1a8a7b6..0c4a9eb 100644
--- a/sys/i386/include/mutex.h
+++ b/sys/i386/include/mutex.h
@@ -60,6 +60,8 @@ extern char STR_SIEN[];
#define ASS_IDIS MPASS2((read_eflags() & PSL_I) == 0, STR_IDIS)
#define ASS_SIEN(mpp) MPASS2((mpp)->mtx_saveintr & PSL_I, STR_SIEN)
+#define mtx_legal2block() (read_eflags() & PSL_I)
+
/*
* Assembly macros (for internal use only)
*------------------------------------------------------------------------------
diff --git a/sys/ia64/include/mutex.h b/sys/ia64/include/mutex.h
index fe9c646..e3a4a64 100644
--- a/sys/ia64/include/mutex.h
+++ b/sys/ia64/include/mutex.h
@@ -59,6 +59,8 @@ extern char STR_SIEN[];
#define ASS_IDIS MPASS2(!(save_intr() & IA64_PSR_I), STR_IDIS)
#define ASS_SIEN(mpp) MPASS2((mpp)->mtx_saveintr & IA64_PSR_I), STR_SIEN)
+#define mtx_legal2block() ((save_intr() & IA64_PSL_I)
+
#endif /* _KERNEL */
#else /* !LOCORE */
diff --git a/sys/powerpc/include/mutex.h b/sys/powerpc/include/mutex.h
index 75c64cf..72d3b7b 100644
--- a/sys/powerpc/include/mutex.h
+++ b/sys/powerpc/include/mutex.h
@@ -60,6 +60,9 @@ extern char STR_SIEN[];
#define ASS_SIEN(mpp) MPASS2((mpp)->mtx_saveintr \
!= ALPHA_PSL_IPL_HIGH, STR_SIEN)
+#define mtx_legal2block() \
+ ((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) == ALPHA_PSL_IPL_HIGH)
+
/*
* Assembly macros (for internal use only)
*--------------------------------------------------------------------------
OpenPOWER on IntegriCloud