diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2012-06-20 17:31:56 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2012-06-20 17:31:56 +0000 |
commit | 75f4de530c66727ae1777ae323968ad7bb428043 (patch) | |
tree | ef8c46cb2f909ca671ed7006fc25860c038eca5b /sys/arch | |
parent | e3751797b5afd2a18ab6175ce166111383bf99b5 (diff) |
Fix some hibernate issues on machines with > 3.5GB phys mem
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/acpi_machdep.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/include/hibernate_var.h | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c index 027658fe2fe..ad27b83fbb0 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.42 2012/03/26 16:15:42 mlarkin Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.43 2012/06/20 17:31:55 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -265,9 +265,11 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) #endif wbinvd(); #ifdef HIBERNATE - if (state == ACPI_STATE_S4) + 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)); @@ -277,8 +279,10 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) #ifdef HIBERNATE /* Free piglet and other pages allocated during suspend */ - if (state == ACPI_STATE_S4) + if (state == ACPI_STATE_S4) { hibernate_free(); + uvm_pmr_dirty_everything(); + } #endif /* Reset the vector */ diff --git a/sys/arch/i386/include/hibernate_var.h b/sys/arch/i386/include/hibernate_var.h index 86299d8b0a9..e7e18e86899 100644 --- a/sys/arch/i386/include/hibernate_var.h +++ b/sys/arch/i386/include/hibernate_var.h @@ -27,15 +27,12 @@ #define HIBERNATE_STACK_PAGE (PAGE_SIZE * 7) #define HIBERNATE_INFLATE_PAGE (PAGE_SIZE * 8) #define HIBERNATE_COPY_PAGE (PAGE_SIZE * 9) +#define HIBERNATE_HIBALLOC_PAGE (PAGE_SIZE * 10) /* Use 4MB hibernation chunks */ #define HIBERNATE_CHUNK_SIZE 0x400000 -/* 1MB of chunk table from 1MB-2MB phys */ -#define HIBERNATE_CHUNK_TABLE_START 0x100000 -#define HIBERNATE_CHUNK_TABLE_END 0x200000 -#define HIBERNATE_CHUNK_TABLE_SIZE (HIBERNATE_CHUNK_TABLE_END - \ - HIBERNATE_CHUNK_TABLE_START) +#define HIBERNATE_CHUNK_TABLE_SIZE 0x100000 #define HIBERNATE_STACK_OFFSET 0x0F00 |