summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include/intr.h
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2005-01-07 02:03:18 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2005-01-07 02:03:18 +0000
commitaa857eaece54434fbe04ad99d247aa595a375f91 (patch)
treee5ddd98b7704593801f20b65d3379736a6b4669b /sys/arch/i386/include/intr.h
parentfac5d51b32a7e3008dd61c6bed8aa0490b2c5de8 (diff)
Fix profiled kernel builds on i386 by moving splraise/splx code into macros
permitting non-recursive reuse in mcount. Should be a no-op for normal builds.
Diffstat (limited to 'sys/arch/i386/include/intr.h')
-rw-r--r--sys/arch/i386/include/intr.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/arch/i386/include/intr.h b/sys/arch/i386/include/intr.h
index a7606ca005b..f076a9eb48a 100644
--- a/sys/arch/i386/include/intr.h
+++ b/sys/arch/i386/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.23 2004/12/24 21:22:01 pvalchev Exp $ */
+/* $OpenBSD: intr.h,v 1.24 2005/01/07 02:03:17 pascoe Exp $ */
/* $NetBSD: intr.h,v 1.5 1996/05/13 06:11:28 mycroft Exp $ */
/*
@@ -88,6 +88,21 @@ void splassert_check(int, const char *);
#endif
/*
+ * Define the splraise and splx code in macros, so that the code can be
+ * reused in a profiling build in a way that does not cause recursion.
+ */
+#define _SPLRAISE(ocpl, ncpl) \
+ ocpl = lapic_tpr; \
+ if (ncpl > ocpl) \
+ lapic_tpr = ncpl
+
+
+#define _SPLX(ncpl) \
+ lapic_tpr = ncpl; \
+ if (ipending & IUNMASK(ncpl)) \
+ Xspllower()
+
+/*
* Hardware interrupt masks
*/
#define splbio() splraise(IPL_BIO)