]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - Documentation/power/userland-swsusp.txt
Hibernation: Introduce SNAPSHOT_GET_IMAGE_SIZE ioctl
[karo-tx-linux.git] / Documentation / power / userland-swsusp.txt
index 000556c932e9fc4a4ede893f997d66833c4902c9..32f1874796979a70a9fa80f05d7dcb5b1c47b727 100644 (file)
@@ -54,6 +54,8 @@ SNAPSHOT_SET_IMAGE_SIZE - set the preferred maximum size of the image
        this number, but if it turns out to be impossible, the kernel will
        create the smallest image possible)
 
+SNAPSHOT_GET_IMAGE_SIZE - return the actual size of the hibernation image
+
 SNAPSHOT_AVAIL_SWAP - return the amount of available swap in bytes (the last
        argument should be a pointer to an unsigned int variable that will
        contain the result if the call is successful).
@@ -93,21 +95,23 @@ SNAPSHOT_S2RAM - suspend to RAM; using this call causes the kernel to
        to resume the system from RAM if there's enough battery power or restore
        its state on the basis of the saved suspend image otherwise)
 
-SNAPSHOT_PMOPS - enable the usage of the pmops->prepare, pmops->enter and
-       pmops->finish methods (the in-kernel swsusp knows these as the "platform
-       method") which are needed on many machines to (among others) speed up
-       the resume by letting the BIOS skip some steps or to let the system
-       recognise the correct state of the hardware after the resume (in
-       particular on many machines this ensures that unplugged AC
-       adapters get correctly detected and that kacpid does not run wild after
-       the resume).  The last ioctl() argument can take one of the three
-       values, defined in kernel/power/power.h:
+SNAPSHOT_PMOPS - enable the usage of the hibernation_ops->prepare,
+       hibernate_ops->enter and hibernation_ops->finish methods (the in-kernel
+       swsusp knows these as the "platform method") which are needed on many
+       machines to (among others) speed up the resume by letting the BIOS skip
+       some steps or to let the system recognise the correct state of the
+       hardware after the resume (in particular on many machines this ensures
+       that unplugged AC adapters get correctly detected and that kacpid does
+       not run wild after the resume).  The last ioctl() argument can take one
+       of the three values, defined in kernel/power/power.h:
        PMOPS_PREPARE - make the kernel carry out the
-               pm_ops->prepare(PM_SUSPEND_DISK) operation
+               hibernation_ops->prepare() operation
        PMOPS_ENTER - make the kernel power off the system by calling
-               pm_ops->enter(PM_SUSPEND_DISK)
+               hibernation_ops->enter()
        PMOPS_FINISH - make the kernel carry out the
-               pm_ops->finish(PM_SUSPEND_DISK) operation
+               hibernation_ops->finish() operation
+       Note that the actual constants are misnamed because they surface
+       internal kernel implementation details that have changed.
 
 The device's read() operation can be used to transfer the snapshot image from
 the kernel.  It has the following limitations:
@@ -134,13 +138,9 @@ required, as they can use, for example, a special (blank) suspend partition or
 a file on a partition that is unmounted before SNAPSHOT_ATOMIC_SNAPSHOT and
 mounted afterwards.
 
-These utilities SHOULD NOT make any assumptions regarding the ordering of
-data within the snapshot image, except for the image header that MAY be
-assumed to start with an swsusp_info structure, as specified in
-kernel/power/power.h.  This structure MAY be used by the userland utilities
-to obtain some information about the snapshot image, such as the size
-of the snapshot image, including the metadata and the header itself,
-contained in the .size member of swsusp_info.
+These utilities MUST NOT make any assumptions regarding the ordering of
+data within the snapshot image.  The contents of the image are entirely owned
+by the kernel and its structure may be changed in future kernel releases.
 
 The snapshot image MUST be written to the kernel unaltered (ie. all of the image
 data, metadata and header MUST be written in _exactly_ the same amount, form