diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/beagle/dev/intc.c | 20 | ||||
-rw-r--r-- | sys/arch/beagle/include/beagle_intr.h | 6 |
2 files changed, 22 insertions, 4 deletions
diff --git a/sys/arch/beagle/dev/intc.c b/sys/arch/beagle/dev/intc.c index 71518f14b0f..27df50c37e1 100644 --- a/sys/arch/beagle/dev/intc.c +++ b/sys/arch/beagle/dev/intc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intc.c,v 1.1 2009/05/08 03:13:26 drahn Exp $ */ +/* $OpenBSD: intc.c,v 1.2 2010/06/01 03:11:43 drahn Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * @@ -499,3 +499,21 @@ void intc_test(void) printf("done\n"); } #endif + +#ifdef DIAGNOSTIC +void +intc_splassert_check(int wantipl, const char *func) +{ + int oldipl = current_ipl_level; + + if (oldipl < wantipl) { + splassert_fail(wantipl, oldipl, func); + /* + * If the splassert_ctl is set to not panic, raise the ipl + * in a feeble attempt to reduce damage. + */ + intc_setipl(wantipl); + } +} +#endif + diff --git a/sys/arch/beagle/include/beagle_intr.h b/sys/arch/beagle/include/beagle_intr.h index 8a97a26401b..4c49659992b 100644 --- a/sys/arch/beagle/include/beagle_intr.h +++ b/sys/arch/beagle/include/beagle_intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: beagle_intr.h,v 1.1 2009/05/08 03:13:26 drahn Exp $ */ +/* $OpenBSD: beagle_intr.h,v 1.2 2010/06/01 03:11:43 drahn Exp $ */ /* $NetBSD: intr.h,v 1.12 2003/06/16 20:00:59 thorpej Exp $ */ /* @@ -100,10 +100,10 @@ void _setsoftintr(int); */ void splassert_fail(int, int, const char *); extern int splassert_ctl; -void i80321_splassert_check(int, const char *); +void intc_splassert_check(int, const char *); #define splassert(__wantipl) do { \ if (splassert_ctl > 0) { \ - i80321_splassert_check(__wantipl, __func__); \ + intc_splassert_check(__wantipl, __func__); \ } \ } while (0) #define splsoftassert(wantipl) splassert(wantipl) |