diff options
author | jhb <jhb@FreeBSD.org> | 2002-10-16 17:22:03 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-10-16 17:22:03 +0000 |
commit | 2ebbd8afb9db48cd481133aaca93ec7995f8095c (patch) | |
tree | 61370f0a0cb252191e92c0926e6d3dc97c461668 /sys/i386/acpica/acpi_wakeup.c | |
parent | 8e1742136bd2e5f479a441cb985b56f1b65c2c65 (diff) | |
download | FreeBSD-src-2ebbd8afb9db48cd481133aaca93ec7995f8095c.zip FreeBSD-src-2ebbd8afb9db48cd481133aaca93ec7995f8095c.tar.gz |
- curproc may be NULL in 4-stable. In that case use the vmspace from
proc0.
- Remove unused include.
Sponsored by: The Weather Channel
Diffstat (limited to 'sys/i386/acpica/acpi_wakeup.c')
-rw-r--r-- | sys/i386/acpica/acpi_wakeup.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index d54a68b..6dc942e 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -32,7 +32,6 @@ #include <sys/kernel.h> #include <sys/bus.h> #include <sys/lock.h> -#include <sys/mutex.h> #include <sys/proc.h> #include <sys/sysctl.h> @@ -189,6 +188,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) int ret = 0; int pteobj_allocated = 0; u_long ef; + struct proc *p; if (sc->acpi_wakeaddr == 0) { return (0); @@ -200,7 +200,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) disable_intr(); /* Create Identity Mapping */ - pm = vmspace_pmap(CURPROC->p_vmspace); + if ((p = curproc) == NULL) + p = &proc0; + pm = vmspace_pmap(p->p_vmspace); if (pm->pm_pteobj == NULL) { pm->pm_pteobj = vm_object_allocate(OBJT_DEFAULT, PTDPTDI + 1); pteobj_allocated = 1; |