summaryrefslogtreecommitdiff
path: root/sys/kern/subr_hibernate.c
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2011-09-21 06:13:40 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2011-09-21 06:13:40 +0000
commit4b8c5c91966a8d9133a4b3cc160746b2dd0083e1 (patch)
treee2523306c7b583aba0efcbcf83eab0054d322159 /sys/kern/subr_hibernate.c
parent4a14692e9a9a2f1c4f6bd5ab052054670250cd46 (diff)
Cleanup page calculation for final memory chunk ordering list for
hibernate resume.
Diffstat (limited to 'sys/kern/subr_hibernate.c')
-rw-r--r--sys/kern/subr_hibernate.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index ea7fc67aced..b13ccd25eb8 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.16 2011/09/21 02:51:23 mlarkin Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.17 2011/09/21 06:13:39 mlarkin Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -1143,10 +1143,12 @@ hibernate_unpack_image(union hibernate_info *hiber_info)
paddr_t image_cur;
vaddr_t tempva;
struct hibernate_disk_chunk *chunks;
- u_int8_t *fchunks;
+ char *pva;
+ int *fchunks;
- fchunks = (u_int8_t *)((char *)(hiber_info->piglet_va) +
- (4 * PAGE_SIZE));
+ pva = (char *)hiber_info->piglet_va;
+
+ fchunks = (int *)(pva + (4 * PAGE_SIZE));
/* Copy temporary chunktable to piglet */
tempva = (vaddr_t)km_alloc(HIBERNATE_CHUNK_TABLE_SIZE, &kv_any,
@@ -1158,8 +1160,7 @@ hibernate_unpack_image(union hibernate_info *hiber_info)
bcopy((caddr_t)hibernate_chunktable_area, (caddr_t)tempva,
HIBERNATE_CHUNK_TABLE_SIZE);
- chunks = (struct hibernate_disk_chunk *)((char *)(hiber_info->piglet_va)) +
- HIBERNATE_CHUNK_SIZE;
+ chunks = (struct hibernate_disk_chunk *)(pva + HIBERNATE_CHUNK_SIZE);
hibernate_activate_resume_pt_machdep();