summaryrefslogtreecommitdiff
path: root/sys/arch/i386/i386/hibernate_machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/i386/hibernate_machdep.c')
-rw-r--r--sys/arch/i386/i386/hibernate_machdep.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/i386/i386/hibernate_machdep.c b/sys/arch/i386/i386/hibernate_machdep.c
index 6c574ee3b62..c94fdf9985b 100644
--- a/sys/arch/i386/i386/hibernate_machdep.c
+++ b/sys/arch/i386/i386/hibernate_machdep.c
@@ -70,7 +70,7 @@ get_hibernate_io_function()
#if NWD > 0
/* XXX - Only support wd hibernate presently */
- if (strcmp(findblkname(major(swapdev)), "wd") == 0)
+ if (strcmp(findblkname(major(swdevt[0].sw_dev)), "wd") == 0)
return wd_hibernate_io;
else
return NULL;
@@ -99,9 +99,9 @@ get_hibernate_info(struct hibernate_info *hiber_info)
hiber_info->image_size = 0;
for(i=0; i<ndumpmem; i++) {
- hiber_info->ranges[i].base = dumpmem[i].start;
+ hiber_info->ranges[i].base = dumpmem[i].start * PAGE_SIZE;
hiber_info->ranges[i].end =
- (dumpmem[i].start + dumpmem[i].end * PAGE_SIZE);
+ (dumpmem[i].end * PAGE_SIZE);
hiber_info->image_size +=
hiber_info->ranges[i].end - hiber_info->ranges[i].base;
}
@@ -129,8 +129,9 @@ get_hibernate_info(struct hibernate_info *hiber_info)
}
/* Calculate signature block offset in swap */
- hiber_info->sig_offset = DL_BLKTOSEC(&dl, (dl.d_partitions[1].p_size - 1)) *
- DL_BLKSPERSEC(&dl);
+ hiber_info->sig_offset = DL_BLKTOSEC(&dl,
+ dl.d_partitions[1].p_size - 1)) *
+ DL_BLKSPERSEC(&dl);
/* Calculate memory image offset in swap */
hiber_info->image_offset = dl.d_partitions[1].p_offset +
@@ -229,6 +230,7 @@ hibernate_write_image()
pmap_kenter_pa(HIBERNATE_TEMP_PAGE, HIBERNATE_TEMP_PAGE, VM_PROT_ALL);
pmap_kenter_pa(HIBERNATE_ALLOC_PAGE, HIBERNATE_ALLOC_PAGE, VM_PROT_ALL);
+ pmap_kenter_pa(HIBERNATE_IO_PAGE, HIBERNATE_IO_PAGE, VM_PROT_ALL);
blkctr = hiber_info.image_offset;
@@ -236,7 +238,7 @@ hibernate_write_image()
range_base = hiber_info.ranges[i].base;
range_end = hiber_info.ranges[i].end;
- for (j=0; j < (range_end - range_base)/NBPG;
+ for (j=0; j < (range_end - range_base);
blkctr += (NBPG/512), j += NBPG) {
addr = range_base + j;
pmap_kenter_pa(HIBERNATE_TEMP_PAGE, addr,