#ifdef CONFIG_ARCH_HIBERNATION_HEADER /* Maximum size of architecture specific data in a hibernation header */ #define MAX_ARCH_HEADER_SIZE (sizeof(struct new_utsname) + 4)
/* * Keep some memory free so that I/O operations can succeed without paging * [Might this be more than 4 MB?]
*/ #define PAGES_FOR_IO ((4096 * 1024) >> PAGE_SHIFT)
/* * Keep 1 MB of memory free so that device drivers can allocate some pages in * their .suspend() routines without breaking the suspend to disk.
*/ #define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT)
/* * Auxiliary structure used for reading the snapshot image data and * metadata from and writing them to the list of page backup entries * (PBEs) which is the main data structure of swsusp. * * Using struct snapshot_handle we can transfer the image, including its * metadata, as a continuous sequence of bytes with the help of * snapshot_read_next() and snapshot_write_next(). * * The code that writes the image to a storage or transfers it to * the user land is required to use snapshot_read_next() for this * purpose and it should not make any assumptions regarding the internal * structure of the image. Similarly, the code that reads the image from * a storage or transfers it from the user land is required to use * snapshot_write_next(). * * This may allow us to change the internal structure of the image * in the future with considerably less effort.
*/
struct snapshot_handle { unsignedint cur; /* number of the block of PAGE_SIZE bytes the * next operation will refer to (ie. current)
*/ void *buffer; /* address of the block to read from * or write to
*/ int sync_read; /* Set to one to notify the caller of * snapshot_write_next() that it may * need to call wait_on_bio_chain()
*/
};
/* This macro returns the address from/to which the caller of * snapshot_read_next()/snapshot_write_next() is allowed to * read/write data after the function returns
*/ #define data_of(handle) ((handle).buffer)
/* * Flags that can be passed from the hibernatig hernel to the "boot" kernel in * the image header.
*/ #define SF_COMPRESSION_ALG_LZO 0 /* dummy, details given below */ #define SF_PLATFORM_MODE 1 #define SF_NOCOMPRESS_MODE 2 #define SF_CRC32_MODE 4 #define SF_HW_SIG 8
/* * Bit to indicate the compression algorithm to be used(for LZ4). The same * could be checked while saving/loading image to/from disk to use the * corresponding algorithms. * * By default, LZO compression is enabled if SF_CRC32_MODE is set. Use * SF_COMPRESSION_ALG_LZ4 to override this behaviour and use LZ4. * * SF_CRC32_MODE, SF_COMPRESSION_ALG_LZO(dummy) -> Compression, LZO * SF_CRC32_MODE, SF_COMPRESSION_ALG_LZ4 -> Compression, LZ4
*/ #define SF_COMPRESSION_ALG_LZ4 16
#ifdef CONFIG_SUSPEND_FREEZER staticinlineint suspend_freeze_processes(void)
{ int error;
error = freeze_processes(); /* * freeze_processes() automatically thaws every task if freezing * fails. So we need not do anything extra upon error.
*/ if (error) return error;
error = freeze_kernel_threads(); /* * freeze_kernel_threads() thaws only kernel threads upon freezing * failure. So we have to thaw the userspace tasks ourselves.
*/ if (error)
thaw_processes();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.