diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-09 17:30:56 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-09 17:30:56 +0000 |
commit | c4819adfb371c4b8ea161ad8d6188da1738027cd (patch) | |
tree | 0482a00096175c941137686711bdff63fd0cde1b /sys/arch/hp300 | |
parent | 0e63b28de578b1f7e6f6cc4940a3bfb8802cb07d (diff) |
Move splassert_check() from common m68k code to each m68k-based architecture,
as its implementation may vary accross platforms (and will very soon).
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/hp300/intr.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/arch/hp300/hp300/intr.c b/sys/arch/hp300/hp300/intr.c index 6dbd866ef11..84c560d8677 100644 --- a/sys/arch/hp300/hp300/intr.c +++ b/sys/arch/hp300/hp300/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.17 2007/05/29 18:10:42 miod Exp $ */ +/* $OpenBSD: intr.c,v 1.18 2007/11/09 17:30:53 miod Exp $ */ /* $NetBSD: intr.c,v 1.5 1998/02/16 20:58:30 thorpej Exp $ */ /*- @@ -300,3 +300,24 @@ netintr() #undef DONETISR } } + +#ifdef DIAGNOSTIC +void +splassert_check(int wantipl, const char *func) +{ + int oldipl; + + __asm __volatile ("movew sr,%0" : "=&d" (oldipl)); + + oldipl = PSLTOIPL(oldipl); + + 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. + */ + _spl(PSL_S | IPLTOPSL(wantipl)); + } +} +#endif |