summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2019-09-05 05:31:39 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2019-09-05 05:31:39 +0000
commit4b2b041ac8a7c0b6420ddab454af2762ad8194a3 (patch)
tree33bd2a9fe45021c9212fb42ef75f5d24b61b4390 /sys/arch/mips64
parent3b6ad0ff73e79a075e7b058bc11d904693203c69 (diff)
Implement splassert() on mips64.
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/interrupt.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c
index 54e6bb1874a..764d887b5c5 100644
--- a/sys/arch/mips64/mips64/interrupt.c
+++ b/sys/arch/mips64/mips64/interrupt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interrupt.c,v 1.72 2019/09/05 05:06:33 visa Exp $ */
+/* $OpenBSD: interrupt.c,v 1.73 2019/09/05 05:31:38 visa Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -247,3 +247,17 @@ spllower(int newipl)
splx(newipl);
return oldipl;
}
+
+#ifdef DIAGNOSTIC
+void
+splassert_check(int wantipl, const char *func)
+{
+ struct cpu_info *ci = curcpu();
+
+ if (ci->ci_ipl < wantipl)
+ splassert_fail(wantipl, ci->ci_ipl, func);
+
+ if (wantipl == IPL_NONE && ci->ci_intrdepth != 0)
+ splassert_fail(-1, ci->ci_intrdepth, func);
+}
+#endif