summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_hibernate.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2013-11-05 00:51:58 +0000
committerkrw <krw@openbsd.org>2013-11-05 00:51:58 +0000
commit862ef960acad6485f84a56d88a6a32c214121ab3 (patch)
treeff22ba8f6d07965df1d536a49457cebc03b549a5 /sys/kern/subr_hibernate.c
parentEnable locking of fields using the acpi global lock if required. Seems to fix (diff)
downloadwireguard-openbsd-862ef960acad6485f84a56d88a6a32c214121ab3.tar.xz
wireguard-openbsd-862ef960acad6485f84a56d88a6a32c214121ab3.zip
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;