// SPDX-License-Identifier: GPL-2.0-only/* * kernel/power/hibernate.c - Hibernation (a.k.a suspend-to-disk) support. * * Copyright (c) 2003 Patrick Mochel * Copyright (c) 2003 Open Source Development Lab * Copyright (c) 2004 Pavel Machek <pavel@ucw.cz> * Copyright (c) 2009 Rafael J. Wysocki, Novell Inc. * Copyright (C) 2012 Bojan Smojver <bojan@rexursive.com> */#define pr_fmt(fmt) "PM: hibernation: " fmt#include<linux/blkdev.h>#include<linux/export.h>#include<linux/suspend.h>#include<linux/reboot.h>#include<linux/string.h>#include<linux/device.h>#include<linux/async.h>#include<linux/delay.h>#include<linux/fs.h>#include<linux/mount.h>#include<linux/pm.h>#include<linux/nmi.h>#include<linux/console.h>#include<linux/cpu.h>#include<linux/freezer.h>#include<linux/gfp.h>#include<linux/syscore_ops.h>#include<linux/ctype.h>#include<linux/ktime.h>#include<linux/security.h>#include<linux/secretmem.h>#include<trace/events/power.h>#include"power.h"staticintnocompress;staticintnoresume;staticintnohibernate;staticintresume_wait;staticunsignedintresume_delay;staticcharresume_file[256]=CONFIG_PM_STD_PARTITION;dev_tswsusp_resume_device;sector_tswsusp_resume_block;__visibleintin_suspend__nosavedata;staticcharhibernate_compressor[CRYPTO_MAX_ALG_NAME]=CONFIG_HIBERNATION_DEF_COMP;/* * Compression/decompression algorithm to be used while saving/loading * image to/from disk. This would later be used in 'kernel/power/swap.c' * to allocate comp streams. */charhib_comp_algo[CRYPTO_MAX_ALG_NAME];enum{HIBERNATION_INVALID