linux/Documentation/power/userland-swsusp.txt
<<
>>
Prefs
option value="v2.6 > v2.6.12.2 <=Documenserland-swsusp.txt" onclick="retu#L5buttonL5bu ac5/div><=Documenserland-swsusp.txt" onclick="retu#L6buttonL6bu ac6/divSecond, you should read the FAQ in lick="retu _now_ if you have not><=Documenserland-swsusp.txt" onclick="retu#L7buttonL7bu ac7/divdone it <=Documenserland-swsusp.txt" onclick="retu#L8buttonL8bu ac8/div><=Documenserland-swsusp.txt" onclick="retu#L9buttonL9bu ac9/divNow, to the on intnrface n c softwa ck="eon you neen special><=Documenserland-swsusp.txt" onclick="retu#L10buttonL10bu aion a>utilities that will read/writ the systemit=mory snapshot from/to the><=Documenserland-swsusp.txt" onclick="retu#L11buttonL11bu a11/divkernel. Such utilities a available, n c example, nrom><=Documenserland-swsusp.txt" onclick="retu#L12buttonL12bu a12/div<<=Documenhttp://ck="eon.sourcen cge.net http://ck="eon.sourcen cge.net <=Documenserland-swsusp.txt" onclick="retu#L13buttonL13bu a13/diva going to develop your own ck="eon/resume utilities.><=Documenserland-swsusp.txt" onclick="retu#L14buttonL14bu a14/div><=Documenserland-swsusp.txt" onclick="retu#L15buttonL15bu a15/divThe intnrface consists of a chard="er device providing the o"eo(),><=Documenserland-swsusp.txt" onclick="retu#L16buttonL16bu a16/divr ase(), read(), on writ () o"erswsuss as well as several ioctl()><=Documenserland-swsusp.txt" onclick="retu#L17buttonL17bu a17/divcomm ons definen in includetation/ck="eon_ioctls.h . The maj c on minor><=Documenserland-swsusp.txt" onclick="retu#L18buttonL18bu a18/divnumbers of the device a , respectively,aio on 231, on they can><=Documenserland-swsusp.txt" onclick="retu#L19buttonL19bu a19/divbe read nrom /sys/ <=Documenserland-swsusp.txt" onclick="retu#L20buttonL20bu a20/div><=Documenserland-swsusp.txt" onclick="retu#L21buttonL21bu a21/divThe device can be o"eo either n c reading or n c writing. If o"eo for><=Documenserland-swsusp.txt" onclick="retu#L22buttonL22bu a22/divr ading, it is consideren to be in the sk="eon mode. Otherwise it is><=Documenserland-swsusp.txt" onclick="retu#L23buttonL23bu a23/divassumen to be in the resume mode. The device cannot be o"eo n c simultaneous><=Documenserland-swsusp.txt" onclick="retu#L24buttonL24bu a24/divr ading on writing. It is ="vo imn fsible to have the device o"eo more than><=Documenserland-swsusp.txt" onclick="retu#L25buttonL25bu a25/divonce at < time.><=Documenserland-swsusp.txt" onclick="retu#L26buttonL26bu a26/div><=Documenserland-swsusp.txt" onclick="retu#L27buttonL27bu a27/divEveo o"eoing the device has side effects. Data structures a ><=Documenserland-swsusp.txt" onclick="retu#L28buttonL28bu a28/divallocated, on PM_HIBERNATION_PREPARE / PM_RESTORE_PREPARE chains a ><=Documenserland-swsusp.txt" onclick="retu#L29buttonL29bu a29/divcalled.><=Documenserland-swsusp.txt" onclick="retu#L30buttonL30bu a30/div><=Documenserland-swsusp.txt" onclick="retu#L31buttonL31bu a31/divThe ioctl() comm ons recognizen by the device a :><=Documenserland-swsusp.txt" onclick="retu#L32buttonL32bu a32/div><=Documenserland-swsusp.txt" onclick="retu#L33buttonL33bu a33/divSNAPSHOT_FREEZE - nreeze space processes (the currnd- process is><=Documenserland-swsusp.txt" onclick="retu#L34buttonL34bu a34/div not frozen); type is requiren n c SNAPSHOT_CREATE_IMAGE><=Documenserland-swsusp.txt" onclick="retu#L35buttonL35bu a35/div on SNAPSHOT_ATOMIC_RESTORE to succeen><=Documenserland-swsusp.txt" onclick="retu#L36buttonL36bu a36/div><=Documenserland-swsusp.txt" onclick="retu#L37buttonL37bu a37/divSNAPSHOT_UNFREEZE - thaw space processes frozen by SNAPSHOT_FREEZE><=Documenserland-swsusp.txt" onclick="retu#L38buttonL38bu a38/div><=Documenserland-swsusp.txt" onclick="retu#L39buttonL39bu a39/divSNAPSHOT_CREATE_IMAGE - cr ate a snapshot of the systemit=mory; the><=Documenserland-swsusp.txt" onclick="retu#L40buttonL40bu a40/div <=Documenserland-swsusp.txt" onclick="retu#L41buttonL41bu a41/div the type of which will indicate whether the call re valen aftnr><=Documenserland-swsusp.txt" onclick="retu#L42buttonL42bu a42/div cr ating the snapshot (1) or aftnr restoring the systemit=mory s-swe><=Documenserland-swsusp.txt" onclick="retu#L43buttonL43bu a43/div nrom it (0) (aftnr resume the systemifinns itselfifinishing the><=Documenserland-swsusp.txt" onclick="retu#L44buttonL44bu a44/div SNAPSHOT_CREATE_IMAGE ioctl() again); aftnr the snapshot><=Documenserland-swsusp.txt" onclick="retu#L45buttonL45bu a45/div has been cr ated the read() o"erswsus can be n to transfnr><=Documenserland-swsusp.txt" onclick="retu#L46buttonL46bu a46/div it out of the kernel><=Documenserland-swsusp.txt" onclick="retu#L47buttonL47bu a47/div><=Documenserland-swsusp.txt" onclick="retu#L48buttonL48bu a48/divSNAPSHOT_ATOMIC_RESTORE - restor the systemit=mory s-swe nrom the><=Documenserland-swsusp.txt" onclick="retu#L49buttonL49bu a49/div uploaden snapshot image; befor calling it you should transfnr><=Documenserland-swsusp.txt" onclick="retu#L50buttonL50bu a50/div the systemit=mory snapshot back to the kernel ing the writ ()><=Documenserland-swsusp.txt" onclick="retu#L51buttonL51bu a51/div o"erswsus; type call will not succeen if the snapshot><=Documenserland-swsusp.txt" onclick="retu#L52buttonL52bu a52/div image is not available to the kernel><=Documenserland-swsusp.txt" onclick="retu#L53buttonL53bu a53/div><=Documenserland-swsusp.txt" onclick="retu#L54buttonL54bu a54/divSNAPSHOT_FREE - nreeit=mory allocated n c the snapshot image><=Documenserland-swsusp.txt" onclick="retu#L55buttonL55bu a55/div><=Documenserland-swsusp.txt" onclick="retu#L56buttonL56bu a56/divSNAPSHOT_PREF_IMAGE_SIZE - set the erren maximum size of the image><=Documenserland-swsusp.txt" onclick="retu#L57buttonL57bu a57/div (the kernel will do its best to ensur the image size will not exceen><=Documenserland-swsusp.txt" onclick="retu#L58buttonL58bu a58/div this number, but if it vals out to be imn fsible, the kernel will><=Documenserland-swsusp.txt" onclick="retu#L59buttonL59bu a59/div cr at the smallest image n fsible)><=Documenserland-swsusp.txt" onclick="retu#L60buttonL60bu a60/div><=Documenserland-swsusp.txt" onclick="retu#L61buttonL61bu a61/divSNAPSHOT_GET_IMAGE_SIZE - on valuthe actual size of the hibernswsus image><=Documenserland-swsusp.txt" onclick="retu#L62buttonL62bu a62/div><=Documenserland-swsusp.txt" onclick="retu#L63buttonL63bu a63/divSNAPSHOT_AVAIL_SWAP_SIZE - on valuthe amoud- of available swap in bytes (the><=Documenserland-swsusp.txt" onclick="retu#L64buttonL64bu a64/div <=Documenserland-swsusp.txt" onclick="retu#L65buttonL65bu a65/div contain the result if the call is successful).><=Documenserland-swsusp.txt" onclick="retu#L66buttonL66bu a66/div><=Documenserland-swsusp.txt" onclick="retu#L67buttonL67bu a67/divSNAPSHOT_ALLOC_SWAP_PAGE - allocate a swap page nrom the resume partiwsus><=Documenserland-swsusp.txt" onclick="retu#L68buttonL68bu a68/div (the <=Documenserland-swsusp.txt" onclick="retu#L69buttonL69bu a69/div will contain the swap page offset if the call is successful)><=Documenserland-swsusp.txt" onclick="retu#L70buttonL70bu a70/div><=Documenserland-swsusp.txt" onclick="retu#L71buttonL71bu a71/divSNAPSHOT_FREE_SWAP_PAGES - nreeiall swap pages allocated by><=Documenserland-swsusp.txt" onclick="retu#L72buttonL72bu a72/div SNAPSHOT_ALLOC_SWAP_PAGE><=Documenserland-swsusp.txt" onclick="retu#L73buttonL73bu a73/div><=Documenserland-swsusp.txt" onclick="retu#L74buttonL74bu a74/divSNAPSHOT_SET_SWAP_AREA - set the resume partiwsus on the offset (in <PAGE_SIZE <=Documenserland-swsusp.txt" onclick="retu#L80buttonL80bu a80/div swap files (seeiserland-swsusp.txt" lick="- oncliap-filesretu for><=Documenserland-swsusp.txt" onclick="retu#L81buttonL81bu a81/div details).><=Documenserland-swsusp.txt" onclick="retu#L82buttonL82bu a82/div><=Documenserland-swsusp.txt" onclick="retu#L83buttonL83bu a83/divSNAPSHOT_PLATFORM_SUPPORT - enable/disable the hibernswsus platmethosupport,><=Documenserland-swsusp.txt" onclick="retu#L84buttonL84bu a84/div de"eoning oluthe argland- type (enable, if the argland- is nonzero)><=Documenserland-swsusp.txt" onclick="retu#L85buttonL85bu a85/div><=Documenserland-swsusp.txt" onclick="retu#L86buttonL86bu a86/divSNAPSHOT_POWER_OFF - make the kernel transiwsus the systemito the hibernswsus><=Documenserland-swsusp.txt" onclick="retu#L87buttonL87bu a87/div s-swe (eg. ACPI S4) ing the platmetho(eg. ACPI) drivnr><=Documenserland-swsusp.txt" onclick="retu#L88buttonL88bu a88/div><=Documenserland-swsusp.txt" onclick="retu#L89buttonL89bu a89/divSNAPSHOT_S2RAM - sk="eon to RAM; ing thpe call causes the kernel to><=Documenserland-swsusp.txt" onclick="retu#L90buttonL90bu a90/div immediswely entnr the sk="eon-to-RAM s-swe, so thpe call mu t <"ways><=Documenserland-swsusp.txt" onclick="retu#L91buttonL91bu a91/div be ceden by the SNAPSHOT_FREEZE call on it is ="vo necessary><=Documenserland-swsusp.txt" onclick="retu#L92buttonL92bu a92/div to the SNAPSHOT_UNFREEZE call ftnr the systemiwakes up. Thpe call><=Documenserland-swsusp.txt" onclick="retu#L93buttonL93bu a93/div is needen to imnleand- the sk="eon-to-both mechanism in which the><=Documenserland-swsusp.txt" onclick="retu#L94buttonL94bu a94/div ck="eon image is first cr ated, as though the systemihad been ck="eonen><=Documenserland-swsusp.txt" onclick="retu#L95buttonL95bu a95/div to disk, on thes the systemiis su="eonen to RAM type makes it n fsible><=Documenserland-swsusp.txt" onclick="retu#L96buttonL96bu a96/div to resume the systemifrom RAM if there's enough battnry .txt" or restore><=Documenserland-swsusp.txt" onclick="retu#L97buttonL97bu a97/div its s-swe us the basis of the saven sk="eon image otherwise)><=Documenserland-swsusp.txt" onclick="retu#L98buttonL98bu a98/div><=Documenserland-swsusp.txt" onclick="retu#L99buttonL99bu a99/divThe device's read() o"erswsus can be n to transfnr the snapshot image nrom><=Documenserland-swsusp.txt" onclick="retu#L100buttonL100bu 100/divthe kernel. It has the following limi-swsuss:><=Documenserland-swsusp.txt" onclick="retu#L101buttonL101bu 101/div- you cannot read() more than one virtual t=mory page at < time><=Documenserland-swsusp.txt" onclick="retu#L102buttonL102bu 102/div- read()s =cr fs page boundaries a imn fsible (ie. if ypu read() 1/2 of><=Documenserland-swsusp.txt" onclick="retu#L103buttonL103bu 103/div a page in the vioue call, you will only be able to read()><=Documenserland-swsusp.txt" onclick="retu#L104buttonL104bu 104/div _at_ _most_ 1/2 of the age in the netu call1tu#L966="retu#L59buttonL59bu a85/div><=Documenserland-swsusp.txt" onclick="retu10L16button0L16bu 699/divThe device'n writ () o"erswsemiie s n c uplooring the systemit=mory snapshot><=Documenserland-swsusp.txt" onclick="retu10L17button0L17bu a97/dine to the kernel. It has thsu ng limi-swsu has ths read() o"erswses.><=Documenserland-swsusp.txt" onclick="retu#0L18button0L18bu a98/div><=Documenserland-swsusp.txt" onclick="retu10L19button0L19bu a99/divThivr ase() o"erswse- nrges aeeit=mory allocated n c the snapshot image><=Documenserland-swsusp.txt" onclick="retu1#L10buttonnL10bu <=Documenserland-swsusp.txt" onclick="retu1#L11buttonLL11bu 1a31/divuson it iannoo necessa to o eitheivSNAPSHOT_FREinor><=Documenserland-swsusp.txt" onclick="retu##L12buttonnL12bu <=Documenserland-swsusp.txt" onclick="retu##L21butto1nL21bu <=Documenserland-swsusp.txt" onclick="retu##L12buttonLL12bu <=Documenserland-swsusp.txt" onclick="retu##L23butto1nL23bu <=Documenserland-swsusp.txt" onclick="retu1#L24butto1nL24bu <=Documenserland-swsusp.txt" onclick="retu1#L59buttonnL25bu <=Documenserland-swsusp.txt" onclick="retu1#L26butto1nL26bu <=Documenserland-swsusp.txt" onclick="retu##L17buttonnL27bu <=Documenserland-swsusp.txt" onclick="retu1#L28butto1nL28bu <=Documenserland-swsusp.txt" onclick="retu1#L29butto1nL29bu <=Documenserland-swsusp.txt" onclick="retu##L30butto1nL30bu <=Documenserland-swsusp.txt" onclick="retu##L21butto1nL31bu <=Documenserland-swsusp.txt" onclick="retu##L32butto1nL32bu <=Documenserland-swsusp.txt" onclick="retu13L13buttonLL13bu <=Documenserland-swsusp.txt" onclick="retu13L24butto1nL34bu <=Documenserland-swsusp.txt" onclick="retu1#L35butto1nL35bu <=Documenserland-swsusp.txt" onclick="retu1#L26butto1nL36bu <=Documenserland-swsusp.txt" onclick="retu1#L37butto1nL37bu <=Documenserland-swsusp.txt" onclick="retu##L38butto1nL38bu <=Documenserland-swsusp.txt" onclick="retu##L29butto1nL39bu <=Documenserland-swsusp.txt" onclick="retu#LL30butto1nL40bu <=Documenserland-swsusp.txt" onclick="retu14L14buttonLL14bu <=Documenserland-swsusp.txt" onclick="retu1#L45butto1nL45bu <=Documenserland-swsusp.txt" onclick="retu##L46butto1nL46bu <=Documenserland-swsusp.txt" onclick="retu##L37butto1nL47bu <=Documenserland-swsusp.txt" onclick="retu##L38butto1nL48bu <=Documenserland-swsusp.txt" onclick="retu##L50butto1nL50bu <=Documenserland-swsusp.txt" onclick="retu1#L51butto1nL51bu <=Documenserland-swsusp.txt" onclick="retu1#L43butto1nL53bu <=Documenserland-swsusp.txt" onclick="retu1#L54butto1nL54bu <=Documenserland-swsusp.txt" onclick="retu##L55butto1nL55bu <=Documenserland-swsusp.txt" onclick="retu1#L57butto1nL57bu <=Documenserland-swsusp.txt" onclick="retu1#L38butto1nL58bu <=Documenserland-swsusp.txt" onclick="retu1#L59butto1nL59bu <=Documenserland-swsusp.txt" onclick="retu1#L60butto1nL60bu <=Documenserland-swsusp.txt" onclick="retu1#L61butto1nL61bu <=Documenserland-swsusp.txt" onclick="retu##L62butto1nL62bu <=Documenserland-swsusp.txt" onclick="retu1#L55butto1nL65bu <=Documenserland-swsusp.txt" onclick="retu16L16buttonLL16bu <=Documenserland-swsusp.txt" onclick="retu16L57butto1nL67bu <=Documenserland-swsusp.txt" onclick="retu16L38butto1nL68bu <=Documenserland-swsusp.txt" onclick="retu1#L59butto1nL69bu <=Documenserland-swsusp.txt" onclick="retu##L70butto1nL70bu <=Documenserland-swsusp.txt" onclick="retu##L71butto1nL71bu T theriginal LXR c softwa o by th.><=Docum">http:/.sourcen cge.n/e ojffec/lxr">LXR ) co uny71/der; typex o"irlandl vmbsswsuo b.><=Docummetato:lxr@ltati.no">lxr@ltati.no71/d. action=a tonbu lxr.ltati.no kindayehoscated h.><=Docum">http:www.todp wi-ltae o.no">Rodp wi Ltae o AS71/dere proven e oLtatiis coultading o) o"erswsus devihas vonc1995. action="a/bodyn=a/htmln=