ia64/linux-2.6.18-xen.hg

view kernel/power/console.c @ 798:b02a90bf5bbc

ACPI: Backport missing part for T-State MSR support

Part of below kernel commit was missed while packporting T-State
support.

commit f79f06ab9f86d7203006d2ec8992ac80df36a34e
Author: Zhao Yakui <yakui.zhao@intel.com>
Date: Thu Nov 15 17:06:36 2007 +0800

ACPI: Enable MSR (FixedHW) support for T-States

Add throttling control via MSR when T-states uses
the FixHW Control Status registers.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Mar 02 10:53:59 2009 +0000 (2009-03-02)
parents 831230e53067
children
line source
1 /*
2 * drivers/power/process.c - Functions for saving/restoring console.
3 *
4 * Originally from swsusp.
5 */
7 #include <linux/vt_kern.h>
8 #include <linux/kbd_kern.h>
9 #include <linux/console.h>
10 #include "power.h"
12 #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
13 #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
15 static int orig_fgconsole, orig_kmsg;
17 int pm_prepare_console(void)
18 {
19 acquire_console_sem();
21 orig_fgconsole = fg_console;
23 if (vc_allocate(SUSPEND_CONSOLE)) {
24 /* we can't have a free VC for now. Too bad,
25 * we don't want to mess the screen for now. */
26 release_console_sem();
27 return 1;
28 }
30 set_console(SUSPEND_CONSOLE);
31 release_console_sem();
33 if (vt_waitactive(SUSPEND_CONSOLE)) {
34 pr_debug("Suspend: Can't switch VCs.");
35 return 1;
36 }
37 orig_kmsg = kmsg_redirect;
38 kmsg_redirect = SUSPEND_CONSOLE;
39 return 0;
40 }
42 void pm_restore_console(void)
43 {
44 acquire_console_sem();
45 set_console(orig_fgconsole);
46 release_console_sem();
47 kmsg_redirect = orig_kmsg;
48 return;
49 }
50 #endif