diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2012-07-13 14:15:13 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2012-07-13 14:15:13 +0000 |
commit | 64004de4dc30768b74215b739be4b61e63850620 (patch) | |
tree | e3660ad1a00024704eafdfeb2e2813ea902bda10 /sys | |
parent | 4a29ec4f792364ace495d2d7659cb581962022d5 (diff) |
Make amd64 like i386 for hibernate support in acpi_sleep_machdep
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index b521cf00ade..9c88b131e4a 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.47 2010/11/13 04:16:42 guenther Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.48 2012/07/13 14:15:12 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -23,6 +23,7 @@ #include <sys/memrange.h> #include <sys/proc.h> #include <sys/user.h> +#include <sys/hibernate.h> #include <uvm/uvm_extern.h> @@ -237,6 +238,13 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) x86_broadcast_ipi(X86_IPI_HALT); #endif wbinvd(); +#ifdef HIBERNATE + if (state == ACPI_STATE_S4) { + uvm_pmr_zero_everything(); + if (hibernate_suspend()) + panic("%s: hibernate failed", DEVNAME(sc)); + } +#endif acpi_enter_sleep_state(sc, state); panic("%s: acpi_enter_sleep_state failed", DEVNAME(sc)); } |