Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * kernel/power/disk.c - Suspend-to-disk support. |
| 3 | * |
| 4 | * Copyright (c) 2003 Patrick Mochel |
| 5 | * Copyright (c) 2003 Open Source Development Lab |
| 6 | * Copyright (c) 2004 Pavel Machek <pavel@suse.cz> |
| 7 | * |
| 8 | * This file is released under the GPLv2. |
| 9 | * |
| 10 | */ |
| 11 | |
| 12 | #include <linux/suspend.h> |
| 13 | #include <linux/syscalls.h> |
| 14 | #include <linux/reboot.h> |
| 15 | #include <linux/string.h> |
| 16 | #include <linux/device.h> |
| 17 | #include <linux/delay.h> |
| 18 | #include <linux/fs.h> |
Andrew Morton | d53d9f1 | 2005-07-12 13:58:07 -0700 | [diff] [blame] | 19 | #include <linux/mount.h> |
Eric W. Biederman | 88d10bb | 2005-09-22 21:43:46 -0700 | [diff] [blame] | 20 | #include <linux/pm.h> |
Andrew Morton | d53d9f1 | 2005-07-12 13:58:07 -0700 | [diff] [blame] | 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include "power.h" |
| 23 | |
| 24 | |
| 25 | extern suspend_disk_method_t pm_disk_mode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | extern int swsusp_suspend(void); |
| 28 | extern int swsusp_write(void); |
| 29 | extern int swsusp_check(void); |
| 30 | extern int swsusp_read(void); |
| 31 | extern void swsusp_close(void); |
| 32 | extern int swsusp_resume(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
| 34 | |
| 35 | static int noresume = 0; |
| 36 | char resume_file[256] = CONFIG_PM_STD_PARTITION; |
| 37 | dev_t swsusp_resume_device; |
| 38 | |
| 39 | /** |
| 40 | * power_down - Shut machine down for hibernate. |
| 41 | * @mode: Suspend-to-disk mode |
| 42 | * |
| 43 | * Use the platform driver, if configured so, and return gracefully if it |
| 44 | * fails. |
| 45 | * Otherwise, try to power off and reboot. If they fail, halt the machine, |
| 46 | * there ain't no turning back. |
| 47 | */ |
| 48 | |
| 49 | static void power_down(suspend_disk_method_t mode) |
| 50 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | int error = 0; |
| 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | switch(mode) { |
| 54 | case PM_DISK_PLATFORM: |
Eric W. Biederman | 88d10bb | 2005-09-22 21:43:46 -0700 | [diff] [blame] | 55 | kernel_power_off_prepare(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | error = pm_ops->enter(PM_SUSPEND_DISK); |
| 57 | break; |
| 58 | case PM_DISK_SHUTDOWN: |
Eric W. Biederman | fdde86a | 2005-07-26 12:01:17 -0600 | [diff] [blame] | 59 | kernel_power_off(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | break; |
| 61 | case PM_DISK_REBOOT: |
Eric W. Biederman | fdde86a | 2005-07-26 12:01:17 -0600 | [diff] [blame] | 62 | kernel_restart(NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | break; |
| 64 | } |
Eric W. Biederman | fdde86a | 2005-07-26 12:01:17 -0600 | [diff] [blame] | 65 | kernel_halt(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | /* Valid image is on the disk, if we continue we risk serious data corruption |
| 67 | after resume. */ |
| 68 | printk(KERN_CRIT "Please power me down manually\n"); |
| 69 | while(1); |
| 70 | } |
| 71 | |
| 72 | |
| 73 | static int in_suspend __nosavedata = 0; |
| 74 | |
| 75 | |
| 76 | /** |
| 77 | * free_some_memory - Try to free as much memory as possible |
| 78 | * |
| 79 | * ... but do not OOM-kill anyone |
| 80 | * |
| 81 | * Notice: all userland should be stopped at this point, or |
| 82 | * livelock is possible. |
| 83 | */ |
| 84 | |
| 85 | static void free_some_memory(void) |
| 86 | { |
| 87 | unsigned int i = 0; |
| 88 | unsigned int tmp; |
| 89 | unsigned long pages = 0; |
| 90 | char *p = "-\\|/"; |
| 91 | |
| 92 | printk("Freeing memory... "); |
| 93 | while ((tmp = shrink_all_memory(10000))) { |
| 94 | pages += tmp; |
Rafael J. Wysocki | 0245b3e | 2005-10-30 15:00:01 -0800 | [diff] [blame] | 95 | printk("\b%c", p[i++ % 4]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | } |
| 97 | printk("\bdone (%li pages freed)\n", pages); |
| 98 | } |
| 99 | |
| 100 | |
| 101 | static inline void platform_finish(void) |
| 102 | { |
| 103 | if (pm_disk_mode == PM_DISK_PLATFORM) { |
| 104 | if (pm_ops && pm_ops->finish) |
| 105 | pm_ops->finish(PM_SUSPEND_DISK); |
| 106 | } |
| 107 | } |
| 108 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | static int prepare_processes(void) |
| 110 | { |
| 111 | int error; |
| 112 | |
| 113 | pm_prepare_console(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | sys_sync(); |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 115 | disable_nonboot_cpus(); |
| 116 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | if (freeze_processes()) { |
| 118 | error = -EBUSY; |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 119 | goto thaw; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | if (pm_disk_mode == PM_DISK_PLATFORM) { |
| 123 | if (pm_ops && pm_ops->prepare) { |
| 124 | if ((error = pm_ops->prepare(PM_SUSPEND_DISK))) |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 125 | goto thaw; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | } |
| 127 | } |
| 128 | |
| 129 | /* Free memory before shutting down devices. */ |
| 130 | free_some_memory(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | return 0; |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 132 | thaw: |
| 133 | thaw_processes(); |
| 134 | enable_nonboot_cpus(); |
| 135 | pm_restore_console(); |
| 136 | return error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | static void unprepare_processes(void) |
| 140 | { |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 141 | platform_finish(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | thaw_processes(); |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 143 | enable_nonboot_cpus(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | pm_restore_console(); |
| 145 | } |
| 146 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | /** |
| 148 | * pm_suspend_disk - The granpappy of power management. |
| 149 | * |
| 150 | * If we're going through the firmware, then get it over with quickly. |
| 151 | * |
| 152 | * If not, then call swsusp to do its thing, then figure out how |
| 153 | * to power down the system. |
| 154 | */ |
| 155 | |
| 156 | int pm_suspend_disk(void) |
| 157 | { |
| 158 | int error; |
| 159 | |
| 160 | error = prepare_processes(); |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 161 | if (error) |
| 162 | return error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 164 | error = device_suspend(PMSG_FREEZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | if (error) { |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 166 | printk("Some devices failed to suspend\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | unprepare_processes(); |
| 168 | return error; |
| 169 | } |
| 170 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | pr_debug("PM: snapshotting memory.\n"); |
| 172 | in_suspend = 1; |
| 173 | if ((error = swsusp_suspend())) |
| 174 | goto Done; |
| 175 | |
| 176 | if (in_suspend) { |
Rafael J. Wysocki | 0245b3e | 2005-10-30 15:00:01 -0800 | [diff] [blame] | 177 | device_resume(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | pr_debug("PM: writing image.\n"); |
| 179 | error = swsusp_write(); |
| 180 | if (!error) |
| 181 | power_down(pm_disk_mode); |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 182 | else { |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 183 | swsusp_free(); |
| 184 | unprepare_processes(); |
| 185 | return error; |
| 186 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | } else |
| 188 | pr_debug("PM: Image restored successfully.\n"); |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 189 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | swsusp_free(); |
| 191 | Done: |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 192 | device_resume(); |
| 193 | unprepare_processes(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | return error; |
| 195 | } |
| 196 | |
| 197 | |
| 198 | /** |
| 199 | * software_resume - Resume from a saved image. |
| 200 | * |
| 201 | * Called as a late_initcall (so all devices are discovered and |
| 202 | * initialized), we call swsusp to see if we have a saved image or not. |
| 203 | * If so, we quiesce devices, the restore the saved image. We will |
| 204 | * return above (in pm_suspend_disk() ) if everything goes well. |
| 205 | * Otherwise, we fail gracefully and return to the normally |
| 206 | * scheduled program. |
| 207 | * |
| 208 | */ |
| 209 | |
| 210 | static int software_resume(void) |
| 211 | { |
| 212 | int error; |
| 213 | |
Shaohua Li | dd5d666 | 2005-09-03 15:57:04 -0700 | [diff] [blame] | 214 | down(&pm_sem); |
Pavel Machek | 3efa147 | 2005-07-07 17:56:43 -0700 | [diff] [blame] | 215 | if (!swsusp_resume_device) { |
Shaohua Li | dd5d666 | 2005-09-03 15:57:04 -0700 | [diff] [blame] | 216 | if (!strlen(resume_file)) { |
| 217 | up(&pm_sem); |
Pavel Machek | 3efa147 | 2005-07-07 17:56:43 -0700 | [diff] [blame] | 218 | return -ENOENT; |
Shaohua Li | dd5d666 | 2005-09-03 15:57:04 -0700 | [diff] [blame] | 219 | } |
Pavel Machek | 3efa147 | 2005-07-07 17:56:43 -0700 | [diff] [blame] | 220 | swsusp_resume_device = name_to_dev_t(resume_file); |
| 221 | pr_debug("swsusp: Resume From Partition %s\n", resume_file); |
| 222 | } else { |
| 223 | pr_debug("swsusp: Resume From Partition %d:%d\n", |
| 224 | MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device)); |
| 225 | } |
| 226 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | if (noresume) { |
| 228 | /** |
| 229 | * FIXME: If noresume is specified, we need to find the partition |
| 230 | * and reset it back to normal swap space. |
| 231 | */ |
Shaohua Li | dd5d666 | 2005-09-03 15:57:04 -0700 | [diff] [blame] | 232 | up(&pm_sem); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | pr_debug("PM: Checking swsusp image.\n"); |
| 237 | |
| 238 | if ((error = swsusp_check())) |
| 239 | goto Done; |
| 240 | |
| 241 | pr_debug("PM: Preparing processes for restore.\n"); |
| 242 | |
| 243 | if ((error = prepare_processes())) { |
| 244 | swsusp_close(); |
Li Shaohua | 5a72e04 | 2005-06-25 14:55:06 -0700 | [diff] [blame] | 245 | goto Done; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | pr_debug("PM: Reading swsusp image.\n"); |
| 249 | |
Rafael J. Wysocki | 2c1b4a5 | 2005-10-30 14:59:58 -0800 | [diff] [blame] | 250 | if ((error = swsusp_read())) { |
| 251 | swsusp_free(); |
| 252 | goto Thaw; |
| 253 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | |
| 255 | pr_debug("PM: Preparing devices for restore.\n"); |
| 256 | |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 257 | if ((error = device_suspend(PMSG_FREEZE))) { |
| 258 | printk("Some devices failed to suspend\n"); |
Rafael J. Wysocki | 2c1b4a5 | 2005-10-30 14:59:58 -0800 | [diff] [blame] | 259 | swsusp_free(); |
| 260 | goto Thaw; |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 261 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | |
| 263 | mb(); |
| 264 | |
| 265 | pr_debug("PM: Restoring saved image.\n"); |
| 266 | swsusp_resume(); |
| 267 | pr_debug("PM: Restore failed, recovering.n"); |
Pavel Machek | 99dc7d6 | 2005-09-03 15:57:05 -0700 | [diff] [blame] | 268 | device_resume(); |
Rafael J. Wysocki | 2c1b4a5 | 2005-10-30 14:59:58 -0800 | [diff] [blame] | 269 | Thaw: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | unprepare_processes(); |
| 271 | Done: |
Shaohua Li | dd5d666 | 2005-09-03 15:57:04 -0700 | [diff] [blame] | 272 | /* For success case, the suspend path will release the lock */ |
| 273 | up(&pm_sem); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | pr_debug("PM: Resume from disk failed.\n"); |
| 275 | return 0; |
| 276 | } |
| 277 | |
| 278 | late_initcall(software_resume); |
| 279 | |
| 280 | |
| 281 | static char * pm_disk_modes[] = { |
| 282 | [PM_DISK_FIRMWARE] = "firmware", |
| 283 | [PM_DISK_PLATFORM] = "platform", |
| 284 | [PM_DISK_SHUTDOWN] = "shutdown", |
| 285 | [PM_DISK_REBOOT] = "reboot", |
| 286 | }; |
| 287 | |
| 288 | /** |
| 289 | * disk - Control suspend-to-disk mode |
| 290 | * |
| 291 | * Suspend-to-disk can be handled in several ways. The greatest |
| 292 | * distinction is who writes memory to disk - the firmware or the OS. |
| 293 | * If the firmware does it, we assume that it also handles suspending |
| 294 | * the system. |
| 295 | * If the OS does it, then we have three options for putting the system |
| 296 | * to sleep - using the platform driver (e.g. ACPI or other PM registers), |
| 297 | * powering off the system or rebooting the system (for testing). |
| 298 | * |
| 299 | * The system will support either 'firmware' or 'platform', and that is |
| 300 | * known a priori (and encoded in pm_ops). But, the user may choose |
| 301 | * 'shutdown' or 'reboot' as alternatives. |
| 302 | * |
| 303 | * show() will display what the mode is currently set to. |
| 304 | * store() will accept one of |
| 305 | * |
| 306 | * 'firmware' |
| 307 | * 'platform' |
| 308 | * 'shutdown' |
| 309 | * 'reboot' |
| 310 | * |
| 311 | * It will only change to 'firmware' or 'platform' if the system |
| 312 | * supports it (as determined from pm_ops->pm_disk_mode). |
| 313 | */ |
| 314 | |
| 315 | static ssize_t disk_show(struct subsystem * subsys, char * buf) |
| 316 | { |
| 317 | return sprintf(buf, "%s\n", pm_disk_modes[pm_disk_mode]); |
| 318 | } |
| 319 | |
| 320 | |
| 321 | static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n) |
| 322 | { |
| 323 | int error = 0; |
| 324 | int i; |
| 325 | int len; |
| 326 | char *p; |
| 327 | suspend_disk_method_t mode = 0; |
| 328 | |
| 329 | p = memchr(buf, '\n', n); |
| 330 | len = p ? p - buf : n; |
| 331 | |
| 332 | down(&pm_sem); |
| 333 | for (i = PM_DISK_FIRMWARE; i < PM_DISK_MAX; i++) { |
| 334 | if (!strncmp(buf, pm_disk_modes[i], len)) { |
| 335 | mode = i; |
| 336 | break; |
| 337 | } |
| 338 | } |
| 339 | if (mode) { |
| 340 | if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT) |
| 341 | pm_disk_mode = mode; |
| 342 | else { |
| 343 | if (pm_ops && pm_ops->enter && |
| 344 | (mode == pm_ops->pm_disk_mode)) |
| 345 | pm_disk_mode = mode; |
| 346 | else |
| 347 | error = -EINVAL; |
| 348 | } |
| 349 | } else |
| 350 | error = -EINVAL; |
| 351 | |
| 352 | pr_debug("PM: suspend-to-disk mode set to '%s'\n", |
| 353 | pm_disk_modes[mode]); |
| 354 | up(&pm_sem); |
| 355 | return error ? error : n; |
| 356 | } |
| 357 | |
| 358 | power_attr(disk); |
| 359 | |
| 360 | static ssize_t resume_show(struct subsystem * subsys, char *buf) |
| 361 | { |
| 362 | return sprintf(buf,"%d:%d\n", MAJOR(swsusp_resume_device), |
| 363 | MINOR(swsusp_resume_device)); |
| 364 | } |
| 365 | |
Andrew Morton | a576219 | 2006-01-06 00:09:50 -0800 | [diff] [blame^] | 366 | static ssize_t resume_store(struct subsystem *subsys, const char *buf, size_t n) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | unsigned int maj, min; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 369 | dev_t res; |
Andrew Morton | a576219 | 2006-01-06 00:09:50 -0800 | [diff] [blame^] | 370 | int ret = -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | |
Andrew Morton | a576219 | 2006-01-06 00:09:50 -0800 | [diff] [blame^] | 372 | if (sscanf(buf, "%u:%u", &maj, &min) != 2) |
| 373 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | |
Andrew Morton | a576219 | 2006-01-06 00:09:50 -0800 | [diff] [blame^] | 375 | res = MKDEV(maj,min); |
| 376 | if (maj != MAJOR(res) || min != MINOR(res)) |
| 377 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | |
Andrew Morton | a576219 | 2006-01-06 00:09:50 -0800 | [diff] [blame^] | 379 | down(&pm_sem); |
| 380 | swsusp_resume_device = res; |
| 381 | up(&pm_sem); |
| 382 | printk("Attempting manual resume\n"); |
| 383 | noresume = 0; |
| 384 | software_resume(); |
| 385 | ret = n; |
| 386 | out: |
| 387 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | } |
| 389 | |
| 390 | power_attr(resume); |
| 391 | |
| 392 | static struct attribute * g[] = { |
| 393 | &disk_attr.attr, |
| 394 | &resume_attr.attr, |
| 395 | NULL, |
| 396 | }; |
| 397 | |
| 398 | |
| 399 | static struct attribute_group attr_group = { |
| 400 | .attrs = g, |
| 401 | }; |
| 402 | |
| 403 | |
| 404 | static int __init pm_disk_init(void) |
| 405 | { |
| 406 | return sysfs_create_group(&power_subsys.kset.kobj,&attr_group); |
| 407 | } |
| 408 | |
| 409 | core_initcall(pm_disk_init); |
| 410 | |
| 411 | |
| 412 | static int __init resume_setup(char *str) |
| 413 | { |
| 414 | if (noresume) |
| 415 | return 1; |
| 416 | |
| 417 | strncpy( resume_file, str, 255 ); |
| 418 | return 1; |
| 419 | } |
| 420 | |
| 421 | static int __init noresume_setup(char *str) |
| 422 | { |
| 423 | noresume = 1; |
| 424 | return 1; |
| 425 | } |
| 426 | |
| 427 | __setup("noresume", noresume_setup); |
| 428 | __setup("resume=", resume_setup); |