sched: Fix build warning in get_update_sysctl_factor()
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / kernel / power / console.c
blob5187136fe1de961a4ceaee2e8729b9aaa39daa38
1 /*
2 * drivers/power/process.c - Functions for saving/restoring console.
4 * Originally from swsusp.
5 */
7 #include <linux/vt_kern.h>
8 #include <linux/kbd_kern.h>
9 #include <linux/console.h>
10 #include <linux/module.h>
11 #include "power.h"
13 #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
14 #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
16 static int orig_fgconsole, orig_kmsg;
18 int pm_prepare_console(void)
20 orig_fgconsole = vt_move_to_console(SUSPEND_CONSOLE, 1);
21 if (orig_fgconsole < 0)
22 return 1;
24 orig_kmsg = kmsg_redirect;
25 kmsg_redirect = SUSPEND_CONSOLE;
26 return 0;
29 void pm_restore_console(void)
31 if (orig_fgconsole >= 0) {
32 vt_move_to_console(orig_fgconsole, 0);
33 kmsg_redirect = orig_kmsg;
36 #endif