diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2014-10-09 00:42:06 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2014-10-09 00:42:06 +0000 |
commit | 06bbaa5d0dc8661d1b7a193b162632ec837d9560 (patch) | |
tree | a9cc46133a8a866f1ce34cff536e31b1c5d05958 | |
parent | 5377a98584c2781bb39f859bfbea9b74a8710a6f (diff) |
remove an unused function and some unused variables in hibernate
-rw-r--r-- | sys/kern/subr_hibernate.c | 41 | ||||
-rw-r--r-- | sys/sys/hibernate.h | 3 |
2 files changed, 3 insertions, 41 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 diff --git a/sys/sys/hibernate.h b/sys/sys/hibernate.h index 74d3da8edb3..a5da16e91be 100644 --- a/sys/sys/hibernate.h +++ b/sys/sys/hibernate.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hibernate.h,v 1.37 2014/09/26 09:25:38 kettenis Exp $ */ +/* $OpenBSD: hibernate.h,v 1.38 2014/10/09 00:42:05 mlarkin Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl> @@ -145,7 +145,6 @@ void hibernate_populate_resume_pt(union hibernate_info *, paddr_t, paddr_t); int hibernate_alloc(void); void hibernate_free(void); -int hibernate_check_overlap(paddr_t, paddr_t, paddr_t, paddr_t); void hibernate_sort_ranges(union hibernate_info *); void hibernate_suspend_bufcache(void); void hibernate_resume_bufcache(void); |