summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-03-01 07:08:28 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-03-01 07:08:28 +0000
commitc22e6644ff1206c04354ac159441edd932fb06f2 (patch)
treefe7045591fb62a3b1398cefdb7c4c1cc10e26d44 /sys/arch/amd64
parent575ccdb8c7266f61e9d149d127af9f5be8201c97 (diff)
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@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/machdep.c5
1 files changed, 3 insertions, 2 deletions
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);
}
}