summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2009-06-03 19:05:35 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2009-06-03 19:05:35 +0000
commit9166ba37786e5c3773caaee29bab06a4cb3775dc (patch)
tree4ab7b782e4a932244a5de583a9d7be5688eca88a /sys/arch
parent805c906b5aed2c799825629e667e9f3a1211b5fe (diff)
Make sure we're running on the right pmap when going to sleep.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/acpi_machdep.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c
index 39378bba64a..47460d9169a 100644
--- a/sys/arch/i386/i386/acpi_machdep.c
+++ b/sys/arch/i386/i386/acpi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_machdep.c,v 1.18 2009/05/31 03:42:38 mlarkin Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.19 2009/06/03 19:05:34 art Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -216,9 +216,12 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
}
if (rcr3() != pmap_kernel()->pm_pdirpa) {
- printf("%s: acpi_sleep_machdep: only kernel may sleep\n",
- DEVNAME(sc));
- return (ENXIO);
+ pmap_activate(curproc);
+ if (rcr3() != pmap_kernel()->pm_pdirpa) {
+ printf("%s: acpi_sleep_machdep: only kernel thread\n",
+ DEVNAME(sc));
+ return (ENXIO);
+ }
}
/*