From c22e6644ff1206c04354ac159441edd932fb06f2 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 1 Mar 2010 07:08:28 +0000 Subject: bring the splassert semantic from sparc64 to amd64. splassert in interrupt handlers now checks that the spl the isr was established at is the same as the one passed to splassert. this lets you check that isrs dont enter code that have insufficient protection if entered from process context. ok kettenis@ --- sys/arch/amd64/amd64/machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/arch/amd64') diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 8da63781347..e8815274bb1 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.102 2009/11/23 16:21:54 pirofti Exp $ */ +/* $OpenBSD: machdep.c,v 1.103 2010/03/01 07:08:27 dlg Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1768,7 +1768,8 @@ splassert_check(int wantipl, const char *func) { int cpl = curcpu()->ci_ilevel; - if (cpl < wantipl) { + if (cpl < wantipl || + (curcpu()->ci_idepth && cpl > wantipl)) { splassert_fail(wantipl, cpl, func); } } -- cgit v1.2.3