diff options
author | Russell King <rmk@arm.linux.org.uk> | 2004-06-29 05:16:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-29 05:16:41 -0700 |
commit | 7b4032e77c055ca5bbde16d10c384a40e36ff8cb (patch) | |
tree | 42cdca55694bbed2777eefb9426c9c4f45bab9c5 /kernel | |
parent | d070a4344d28190dbdfeaebc416681a569e2cded (diff) | |
download | history-7b4032e77c055ca5bbde16d10c384a40e36ff8cb.tar.gz |
[PATCH] Provide console_suspend() and console_resume()
Add console_stop() and console_start() methods so the serial drivers
can disable console output before suspending a port, and re-enable output
afterwards.
We also add locking to ensure that we synchronise with any in-progress
printk.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 224c37c0e28db8..8b28dd2b4a98f5 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -704,6 +704,27 @@ struct tty_driver *console_device(int *index) } /* + * Prevent further output on the passed console device so that (for example) + * serial drivers can disable console output before suspending a port, and can + * re-enable output afterwards. + */ +void console_stop(struct console *console) +{ + acquire_console_sem(); + console->flags &= ~CON_ENABLED; + release_console_sem(); +} +EXPORT_SYMBOL(console_stop); + +void console_start(struct console *console) +{ + acquire_console_sem(); + console->flags |= CON_ENABLED; + release_console_sem(); +} +EXPORT_SYMBOL(console_start); + +/* * The console driver calls this routine during kernel initialization * to register the console printing procedure with printk() and to * print any messages that were printed by the kernel before the |