summaryrefslogtreecommitdiff
path: root/sys/kern/subr_hibernate.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-11-05 00:51:59 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-11-05 00:51:59 +0000
commit796d477c0b5f03d8d84b1697382465b7555e5c98 (patch)
tree0522f4b0c219b74af4f5e76a0fc813a809442abc /sys/kern/subr_hibernate.c
parent1de8989a1b132480cf21105d5617b5ca6325daa0 (diff)
Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in order to get|set correct value that includes the high bits of the value.
Diffstat (limited to 'sys/kern/subr_hibernate.c')
-rw-r--r--sys/kern/subr_hibernate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index dfbfedf4ff8..bab98e515f5 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.66 2013/10/20 17:16:47 mlarkin Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.67 2013/11/05 00:51:58 krw Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -663,7 +663,7 @@ get_hibernate_info(union hibernate_info *hiber_info, int suspend)
/* Make sure we have a swap partition. */
if (dl.d_partitions[1].p_fstype != FS_SWAP ||
- dl.d_partitions[1].p_size == 0)
+ DL_GETPSIZE(&dl.d_partitions[1]) == 0)
return (1);
hiber_info->secsize = dl.d_secsize;
@@ -679,8 +679,8 @@ get_hibernate_info(union hibernate_info *hiber_info, int suspend)
hiber_info->swap_offset = dl.d_partitions[1].p_offset;
/* Calculate signature block location */
- hiber_info->sig_offset = dl.d_partitions[1].p_offset +
- dl.d_partitions[1].p_size -
+ hiber_info->sig_offset = DL_GETPOFFSET(&dl.d_partitions[1]) +
+ DL_GETPSIZE(&dl.d_partitions[1]) -
sizeof(union hibernate_info)/hiber_info->secsize;
chunktable_size = HIBERNATE_CHUNK_TABLE_SIZE / hiber_info->secsize;
@@ -729,8 +729,8 @@ get_hibernate_info(union hibernate_info *hiber_info, int suspend)
goto fail;
/* Calculate memory image location in swap */
- hiber_info->image_offset = dl.d_partitions[1].p_offset +
- dl.d_partitions[1].p_size -
+ hiber_info->image_offset = DL_GETPOFFSET(&dl.d_partitions[1]) +
+ DL_GETPSIZE(&dl.d_partitions[1]) -
(hiber_info->image_size / hiber_info->secsize) -
sizeof(union hibernate_info)/hiber_info->secsize -
chunktable_size;