diff options
author | 2014-10-09 00:42:05 +0000 | |
---|---|---|
committer | 2014-10-09 00:42:05 +0000 | |
commit | 24aea4fd927e92efc99f32a861f067daa62421b9 (patch) | |
tree | 3492b02802532ca9912cd0585328744d79e6e3aa /sys/kern/subr_hibernate.c | |
parent | USE_SHLIBDIR is archaic (diff) | |
download | wireguard-openbsd-24aea4fd927e92efc99f32a861f067daa62421b9.tar.xz wireguard-openbsd-24aea4fd927e92efc99f32a861f067daa62421b9.zip |
remove an unused function and some unused variables in hibernate
Diffstat (limited to 'sys/kern/subr_hibernate.c')
-rw-r--r-- | sys/kern/subr_hibernate.c | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index d83b89b6784..efdba836f40 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.101 2014/09/26 09:25:38 kettenis Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.102 2014/10/09 00:42:05 mlarkin Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl> @@ -47,9 +47,7 @@ * 1*PAGE_SIZE I/O page used during hibernate suspend * 2*PAGE_SIZE I/O page used during hibernate suspend * 3*PAGE_SIZE copy page used during hibernate suspend - * 4*PAGE_SIZE final chunk ordering list (8 pages) - * 12*PAGE_SIZE piglet chunk ordering list (8 pages) - * 20*PAGE_SIZE temp chunk ordering list (8 pages) + * 4*PAGE_SIZE final chunk ordering list (24 pages) * 28*PAGE_SIZE RLE utility page * 29*PAGE_SIZE start of hiballoc area * 109*PAGE_SIZE end of hiballoc area (80 pages) @@ -525,7 +523,6 @@ uvm_page_rle(paddr_t addr) int get_hibernate_info(union hibernate_info *hib, int suspend) { - int chunktable_size; struct disklabel dl; char err_string[128], *dl_ret; @@ -566,8 +563,6 @@ get_hibernate_info(union hibernate_info *hib, int suspend) hib->sig_offset = DL_GETPSIZE(&dl.d_partitions[1]) - sizeof(union hibernate_info)/DEV_BSIZE; - chunktable_size = HIBERNATE_CHUNK_TABLE_SIZE / DEV_BSIZE; - /* Stash kernel version information */ memset(&hib->kernel_version, 0, 128); bcopy(version, &hib->kernel_version, @@ -827,7 +822,6 @@ hibernate_write_signature(union hibernate_info *hib) int hibernate_write_chunktable(union hibernate_info *hib) { - struct hibernate_disk_chunk *chunks; vaddr_t hibernate_chunk_table_start; size_t hibernate_chunk_table_size; int i, err; @@ -837,9 +831,6 @@ hibernate_write_chunktable(union hibernate_info *hib) hibernate_chunk_table_start = hib->piglet_va + HIBERNATE_CHUNK_SIZE; - chunks = (struct hibernate_disk_chunk *)(hib->piglet_va + - HIBERNATE_CHUNK_SIZE); - /* Write chunk table */ for (i = 0; i < hibernate_chunk_table_size; i += MAXPHYS) { if ((err = hib->io_func(hib->dev, @@ -883,34 +874,6 @@ hibernate_clear_signature(void) } /* - * Check chunk range overlap when calculating whether or not to copy a - * compressed chunk to the piglet area before decompressing. - * - * returns zero if the ranges do not overlap, non-zero otherwise. - */ -int -hibernate_check_overlap(paddr_t r1s, paddr_t r1e, paddr_t r2s, paddr_t r2e) -{ - /* case A : end of r1 overlaps start of r2 */ - if (r1s < r2s && r1e > r2s) - return (1); - - /* case B : r1 entirely inside r2 */ - if (r1s >= r2s && r1e <= r2e) - return (1); - - /* case C : r2 entirely inside r1 */ - if (r2s >= r1s && r2e <= r1e) - return (1); - - /* case D : end of r2 overlaps start of r1 */ - if (r2s < r1s && r2e > r1s) - return (1); - - return (0); -} - -/* * Compare two hibernate_infos to determine if they are the same (eg, * we should be performing a hibernate resume on this machine. * Not all fields are checked - just enough to verify that the machine |